@import url('https://fonts.googleapis.com/css2?family=Bytesized&family=Coral+Pixels&family=Pixelify+Sans:wght@400..700&display=swap');

/* ==================== THEME ==================== */
:root {
  --bg: #05060b;
  --bg-screen: #0b0e18;
  --accent: #7dfcff;
  --accent-soft: #55b6ff;
  --text-main: #f4f7ff;
  --text-muted: #a3add8;
  --danger: #ff6b9c;
  --border: #323a58;
  --card-bg: #090d1b;
  --panel-bg: #080b16;
  --shadow-strong: 0 10px 0 #020308;
  --shadow-medium: 0 6px 0 #020308;
}

/* ==================== GLOBAL ==================== */
*,
*::before,
*::after { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Pixelify Sans", system-ui, sans-serif;
  background:
    radial-gradient(circle at 0 0, #161a26 0, transparent 55%),
    radial-gradient(circle at 100% 100%, #101321 0, transparent 55%),
    repeating-linear-gradient(to bottom, var(--bg) 0, var(--bg) 1px, #060712 1px, #060712 3px);
  color: var(--text-main);
  letter-spacing: 0.03em;
  font-size: 12px;
}

h1, h2, h3, h4 {
  font-family: "Pixelify Sans", system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  text-align: center;
  margin: 0 0 .2rem;
  color: var(--accent);
}

p { color: var(--text-muted); line-height: 1.5; }
a { color: inherit; }

/* ==================== LAYOUT / DS SCREEN ==================== */
header,
.site-nav { max-width: 1100px; margin: 0.4rem auto 0; padding: 0 1rem; }

main {
  max-width: 1100px;
  margin: 1.5rem auto 3rem;
  padding: 1.2rem;
  background: var(--bg-screen);
  border-radius: 8px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-strong);
  position: relative;
  overflow: hidden;
  
}

main::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(80, 100, 160, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(80, 100, 160, 0.12) 1px, transparent 1px);
  background-size: 6px 6px;
  opacity: 0.6;
  mix-blend-mode: screen;
}
main > * { position: relative; z-index: 1; }

/* ========= P5JS ========= */
.sketch-frame {
  margin: 1rem auto 2rem;
  max-width: 500px;
  aspect-ratio: 16 / 9;
  background: var(--bg);
  border-radius: 6px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-medium);
  overflow: hidden;
  position: relative;
}
#canvas-parent canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}
.sketch-frame::after {
  content: "p5.js sketch";
  position: absolute;
  right: 0.6rem;
  bottom: 0.4rem;
  font-size: 0.6rem;
  color: var(--text-muted);
  opacity: 0.7;
}

/* ==================== NAVBAR ==================== */
.site-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.navbar-toggle {
  display: none;
  background: #090d1b;
  border: 1px solid var(--border);
  color: var(--text-main);
  font-size: 1.1rem;
  padding: 0.25rem 0.8rem;
  border-radius: 999px;
  cursor: pointer;
}
.navbar-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.navbar-menu {
  list-style: none;
  display: flex;
  gap: 0.8rem;
  margin: 0;
  padding: 0;
}
.navbar-menu li a {
  text-decoration: none;
  padding: 0.2rem 0.8rem;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--text-main);
  font-size: 0.7rem;
}
.navbar-menu li a:hover,
.navbar-menu li a.is-active { border-color: var(--accent-soft); }

/* ==================== PANELS & CARDS ==================== */
.panel {
  background: var(--panel-bg);
  border-radius: 6px;
  border: 1px solid var(--border);
  padding: 0.8rem;
}
.carousel-card,
.card {
  background: var(--card-bg);
  border-radius: 6px;
  border: 1px solid var(--border);
  padding: 0.7rem;
  text-align: center;
  display: flex;
  flex-direction: column;
}

/* ==================== UTIL GRIDS ==================== */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 0.8rem; }

/* ==================== OC THUMBNAIL GRID ==================== */
.thumbnail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.8rem;
  margin-top: 1.2rem;
}
.thumbnail-item {
  text-align: center;
  cursor: pointer;
  border-radius: 6px;
  padding: 0.3rem;
  background: #070915;
  border: 1px solid var(--border);
  opacity: 0.7;
  transition: 0.15s ease-out;
}
.thumbnail-item img {
  display: block;
  width: 100%;
  height: 90px;
  object-fit: cover;
  border-radius: 4px;
  image-rendering: pixelated;
  margin-bottom: 0.25rem;
}
.thumbnail-item span {
  display: block;
  font-size: 0.6rem;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.thumbnail-item:hover { opacity: 1; transform: translateY(-1px); border-color: var(--accent-soft); }
.thumbnail-item.active { opacity: 1; transform: translateY(-2px); border-color: var(--accent); }

/* ==================== LIGHTBOX ==================== */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  display: none;
  justify-content: center;
  align-items: center;
  background:
    radial-gradient(circle at 20% 0%, rgba(125, 252, 255, 0.15), transparent 60%),
    rgba(0, 0, 0, 0.92);
  z-index: 100;
}
.lightbox-content {
  max-width: 95%;
  max-height: 90%;
  border-radius: 6px;
  background: var(--bg);
  image-rendering: pixelated;
}
.lightbox-close {
  position: absolute;
  top: 16px;
  right: 24px;
  color: var(--text-main);
  font-size: 1.5rem;
  cursor: pointer;
}

/* ==================== OC GALLERY ==================== */
.oc-gallery,
.assets-gallery { display: grid; grid-template-columns: 50% 1fr; gap: 1rem; align-items: start; }

.oc-main-card,
.asset-main-card {
  background: var(--card-bg);
  border-radius: 6px;
  border: 1px solid var(--border);
  padding: 1rem;
  text-align: center;
  max-height: 70vh;
}
.oc-main-card h2,
.asset-main-card h2 { margin-bottom: 0.5rem; font-size: 1rem; }
.oc-main-card p, .oc-main-card small,
.asset-main-card p, .asset-main-card small { color: var(--text-muted); margin: 0.5rem 0 0; font-size: 0.7rem; }
.oc-main-card small,
.asset-main-card small { font-size: 0.6rem; }

.oc-main-thumbnails,
.oc-small-thumbnails,
.oc-thumbnails-sidebar,
.assets-sidebar { display: grid; gap: 0.5rem; }

.oc-main-thumbnails { grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); margin-bottom: 0.5rem; }

.oc-main-thumb,
.oc-sidebar-thumb,
.oc-small-thumbnails .small-thumb {
  border-radius: 4px;
  overflow: hidden;
  transition: transform 0.15s ease-out;
  cursor: pointer;
}

.oc-main-thumb:hover,
.oc-sidebar-thumb:hover,
.oc-small-thumbnails .small-thumb:hover { transform: scale(1.05); }

.oc-main-thumb img,
.oc-big-image img,
.oc-sidebar-thumb img,
.oc-small-thumbnails img,
.asset-big-image img,
.asset-sidebar-thumb img {
  image-rendering: pixelated;
  border-radius: 4px;
  width: 100%;
  height: auto;
}

.oc-big-image,
.asset-big-image { margin-bottom: 0.5rem; overflow: hidden; text-align: center; }
.oc-big-image img,
.asset-big-image img {
  max-height: 40vh;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  display: inline-block;
}

.oc-small-thumbnails,
.assets-sidebar {
  grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
  max-height: 40vh;
  min-height: 100px;
  overflow-y: auto;
  padding-right: 0.25rem;
  scrollbar-width: thin;
  scrollbar-color: #ccc transparent;
}
.oc-small-thumbnails::-webkit-scrollbar,
.assets-sidebar::-webkit-scrollbar { width: 6px; }
.oc-small-thumbnails::-webkit-scrollbar-track,
.assets-sidebar::-webkit-scrollbar-track { background: transparent; }
.oc-small-thumbnails::-webkit-scrollbar-thumb,
.assets-sidebar::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
.oc-small-thumbnails::-webkit-scrollbar-thumb:hover,
.assets-sidebar::-webkit-scrollbar-thumb:hover { background: #aaa; }

.oc-small-thumbnails .small-thumb {
  display: flex;
  justify-content: center;
  align-items: center;
}

.oc-thumbnails-sidebar {
  grid-template-columns: repeat(3, 1fr);
  max-height: 70vh;
  overflow-y: auto;
  place-items: center;
  padding: 0.5rem;
}
.oc-sidebar-thumb {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #070915;
  border: 1px solid var(--border);
  padding: 0.5rem;
  width: 100%;
  height: 150px;
  opacity: 0.7;
  transition: transform 0.15s ease-out;
  box-sizing: border-box;
}
.oc-sidebar-thumb span {
  font-size: 0.5rem;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.oc-sidebar-thumb:hover,
.oc-sidebar-thumb.active { opacity: 1; transform: translateY(-1px); border-color: var(--accent-soft); }

/* ==================== ASSETS GALLERY ==================== */
.assets-sidebar {
  grid-template-columns: repeat(3, 1fr);
  max-height: 70vh;
  overflow-y: auto;
  place-items: center;
  padding: 0.5rem;
}

.asset-sidebar-thumb {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #070915;
  border: 1px solid var(--border);
  padding: 0.5rem;
  width: 100%;
  height: 150px;
  opacity: 0.7;
  transition: transform 0.15s ease-out;
  cursor: pointer;
  box-sizing: border-box;
  border-radius: 4px;
}
.asset-sidebar-thumb span {
  font-size: 0.5rem;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 0.25rem;
}
.asset-sidebar-thumb:hover,
.asset-sidebar-thumb.active { opacity: 1; transform: translateY(-1px); border-color: var(--accent-soft); }

.asset-details { text-align: left; }
.asset-description { font-size: 0.7rem; line-height: 1.4; margin: 0.5rem 0; }

.download-btn {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.5rem 0.8rem;
  border-radius: 4px;
  border: 1px solid var(--accent-soft);
  background: transparent;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.7rem;
  cursor: pointer;
  transition: all 0.15s ease-out;
  font-family: "Pixelify Sans", system-ui, sans-serif;
}
.download-btn:hover { background: var(--accent-soft); color: var(--bg); transform: translateY(-1px); }

/* ==================== SEARCH & BUTTONS ==================== */
.oc-search-container,
.assets-search-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin: 0 auto 1rem;
  width: 100%;
  max-width: 450px;
}

.oc-search-bar,
.assets-search-bar {
  flex: 1;
  height: 36px;
  padding: 0 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #090d1b;
  color: var(--text-main);
  font-family: "Pixelify Sans", system-ui, sans-serif;
  font-size: 0.8rem;
  box-sizing: border-box;
}
.assets-search-bar::placeholder { color: var(--text-muted); }
.assets-search-bar:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-color: var(--accent-soft); }

.oc-random-button {
  padding: 0.5rem 0.8rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #090d1b;
  color: var(--text-main);
  font-family: "Pixelify Sans", system-ui, sans-serif;
  font-size: 0.8rem;
  cursor: pointer;
  height: 36px;
  transition: background 0.15s ease-out, border-color 0.15s ease-out, transform 0.1s ease-out;
}
.oc-random-button:hover { border-color: var(--accent-soft); background: #0d1224; transform: translateY(-1px); }
.oc-random-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ==================== TEXT EFFECTS ==================== */
.text-rainbow {
  background: linear-gradient(90deg, #ff0040, #ff9a00, #fff700, #00ff85, #00c8ff, #a600ff, #ff0040);
  background-size: 400% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: rainbow-shift 8s linear infinite;
}
@keyframes rainbow-shift { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }

.text-shakey { display: inline-block; animation: text-shake 0.18s infinite; transform-origin: center; }
@keyframes text-shake {
  0% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(-0.5px, 0.5px) rotate(-1deg); }
  50% { transform: translate(0.8px, -0.6px) rotate(1deg); }
  75% { transform: translate(-0.4px, 0.4px) rotate(0.5deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

.text-glow {
  color: #fff;
  text-shadow:
    0 0 4px rgba(255, 255, 255, 0.6),
    0 0 10px rgba(0, 255, 255, 0.7),
    0 0 18px rgba(0, 180, 255, 0.7);
}

.text-typewriter {
  display: inline-block;
  white-space: nowrap;
  overflow: hidden;
  border-right: 2px solid var(--accent);
  animation: typewriter 3s steps(30, end) 1, caret-blink 0.8s step-end infinite;
}
@keyframes typewriter { from { width: 0; } to { width: 100%; } }
@keyframes caret-blink { 0%, 100% { border-color: transparent; } 50% { border-color: var(--accent); } }

.text-float { display: inline-block; animation: text-float 3s ease-in-out infinite; }
@keyframes text-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

.text-pulse { display: inline-block; animation: text-pulse 1.4s ease-in-out infinite; }
@keyframes text-pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.04); opacity: 0.85; } }

/* ---------- Text Gradient Utilities ---------- */
.text-gradient {
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: glitch-gradient 4s linear infinite;
}
.text-aqua-green { background-image: linear-gradient(90deg, #0ff, #00ff9d, #0ff); }
.text-sky-blue { background-image: linear-gradient(90deg, #5ad1ff, #89f7fe, #5ad1ff); }
.text-orange { background-image: linear-gradient(90deg, #ff9a3c, #ff6a00, #ff9a3c); }
.text-yellow { background-image: linear-gradient(90deg, #fff500, #ffd700, #fff500); }
.text-pale-yellow { background-image: linear-gradient(90deg, #fff9c4, #fff3a0, #fff9c4); }
.text-purple { background-image: linear-gradient(90deg, #b677ff, #6a00ff, #b677ff); }
.text-red { background-image: linear-gradient(90deg, #ff5f5f, #ff0000, #ff5f5f); }
.text-peach-pink { background-image: linear-gradient(90deg, #ffc1a1, #ff9bb5, #ffc1a1); }
.text-blue-white-gray { background-image: linear-gradient(90deg, #4fa3ff, #ffffff, #a0a7b5); }
.text-black-purple { background-image: linear-gradient(90deg, #000000, #3b004e, #000000); }
.text-black { background-image: linear-gradient(90deg, #000000, #333333, #000000); }
.text-pale-pink { background-image: linear-gradient(90deg, #ffd6e8, #ffb6d9, #ffd6e8); }
.text-gray { background-image: linear-gradient(90deg, #c1c6d0, #858a94, #c1c6d0); }
@keyframes glitch-gradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
h1.text-gradient, h2.text-gradient, h3.text-gradient {
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.7), 0 0 4px rgba(0, 0, 0, 0.7);
}


/* ==================== SECTIONS / CARDS ==================== */
.layer-intro { text-align: center; margin-top: 0.4rem; }

.alter-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin: 1.5rem auto 0;
  max-width: 1000px;
}
@media (min-width: 640px) { .alter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .alter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.alter-card {
  background: rgba(0, 0, 0, 0.6);
  border-radius: 0.85rem;
  padding: 1rem 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  text-align: left;
}
.alter-card h4 { margin: 0 0 0.25rem; }
.alter-card small { display: block; margin-bottom: 0.5rem; color: gray; }
.alter-card p { margin: 0; font-size: 0.9rem; line-height: 1.45; }

.section-spacer { margin: 2rem 0; }

/* ==================== SHARED STATES ==================== */
.oc-sidebar-thumb.active,
.asset-sidebar-thumb.active,
.thumbnail-item.active { border-color: var(--accent); }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
  main { margin: 1rem auto 2rem; padding: 1rem; }
  .main-swiper .swiper-slide { width: 280px; height: 360px; }

  .site-nav { position: relative; justify-content: flex-end; }
  .navbar-toggle { display: inline-block; }
  .navbar-menu {
    position: absolute;
    top: 2.4rem;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    padding: 0.4rem 0.6rem;
    gap: 0.4rem;
    background: var(--bg-screen);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: var(--shadow-medium);
    display: none;
    z-index: 1000;
  }
  .navbar-menu.navbar-menu--open { display: flex; }
  .navbar-menu li a { font-size: 0.75rem; padding: 0.25rem 0.8rem; width: 100%; text-align: left; }

  .oc-gallery,
  .assets-gallery { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }

  .oc-thumbnails-sidebar,
  .assets-sidebar {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    max-height: none;
    overflow-y: visible;
  }

  .oc-search-bar,
  .assets-search-bar { max-width: 100%; }
}

@media (max-width: 600px) { body { font-size: 10px; } }

@media (max-width: 480px) {
  main { margin: 1rem 0.75rem 2rem; }

  .thumbnail-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }
  .thumbnail-item img { height: 70px; }

  .sketch-frame { aspect-ratio: 3 / 2; margin-bottom: 1.2rem; }

  .assets-sidebar { grid-template-columns: repeat(2, 1fr); gap: 0.4rem; padding: 0.3rem; }
  .asset-sidebar-thumb { height: 120px; }
  .asset-sidebar-thumb img { max-height: 90px; }
  .asset-main-card { padding: 0.7rem; }

  img.did-hero { max-width: 80% !important; }
}

.oc-main-card,
.asset-main-card {
  max-height: none;    
  overflow: visible;     
}

.oc-small-thumbnails {
  max-height: 40vh;
  overflow-y: auto;
}

.site-nav {
  background: var(--bg-screen);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.35rem 0.75rem;
}

.recent-commissions-carousel {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.5rem;
}
.recent-commissions-viewport {
  overflow: hidden;
}
.recent-commissions-track {
  display: flex;
  gap: 16px;
  transition: transform 0.25s ease;
}
.recent-commission-card {
  border: 1px solid #333;
  padding: 0.75rem;
  border-radius: 10px;
  background: #0b0b0f;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.recent-commission-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 6px;
  background: #0b0b0f;
}
.recent-commissions-nav {
  background: none;
  border: 1px solid #444;
  color: #fff;
  border-radius: 8px;
  width: 36px;
  height: 36px;
  cursor: pointer;
}
.recent-commissions-nav:disabled {
  opacity: 0.35;
  cursor: default;
}

