/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
video::-webkit-media-controls { display: none !important; }
video::-webkit-media-controls-panel { display: none !important; }
video::-webkit-media-controls-overlay-play-button { display: none !important; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
  transition: background-color 0.5s ease, color 0.5s ease;
}

button { cursor: pointer; border: none; background: none; font-family: inherit; color: inherit; }
ul { list-style: none; }
a { color: inherit; text-decoration: none; }

/* ============================================================
   CSS VARIABLES — THEMES
   ============================================================ */

/* ── HOME  (warm dark + amber gold)
   Вайб: личный, тёплый, немного загадочный. Ботаническая текстура
   как намёк на живое, органичное присутствие.
   ── */
body.theme-home {
  --bg-primary:    #090907;
  --bg-secondary:  #111110;
  --bg-card:       #1a1a17;
  --text-primary:  #ede8dc;
  --text-secondary:#807868;
  --text-muted:    #363430;
  --accent:        #c8a030;
  --accent-glow:   rgba(200,160,48,0.08);
  --accent-border: rgba(200,160,48,0.13);
  --nav-bg:        rgba(9,9,7,0.88);
}

/* ── CG ART  (warm near-black + burnt orange)
   Вайб: серьёзный, графический, архивный. Гармонические волны,
   геометрические формы, промышленная типографика.
   ── */
body.theme-cg-art {
  --bg-primary:    #0b0a08;
  --bg-secondary:  #141310;
  --bg-card:       #1e1d18;
  --text-primary:  #e8e4dc;
  --text-secondary:#786858;
  --text-muted:    #383430;
  --accent:        #c86830;
  --accent-glow:   rgba(200,104,48,0.08);
  --accent-border: rgba(200,104,48,0.14);
  --nav-bg:        rgba(11,10,8,0.88);
}

/* ── KHIDI  (dark teal + warm teal accent)
   Вайб: мост между людьми. Тёплый, живой, открытый.
   Тил — цвет воды и связи. Логотип уже готов.
   ── */
body.theme-khidi {
  --bg-primary:    #265B61;
  --bg-secondary:  #e8e8e8;
  --bg-card:       #ffffff;
  --text-primary:  #265B61;
  --text-secondary:#265B61;
  --text-muted:    #7a9490;
  --accent:        #265B61;
  --accent-glow:   rgba(38,91,97,0.10);
  --accent-border: rgba(38,91,97,0.22);
  --nav-bg:        rgba(242,242,242,0.96);
}

/* ── DARK PHILOSOPHER  (pure black + emerald green + amber fire)
   Вайб: темнота как пространство для мысли. Плёночное зерно,
   зелёный туман, горящие янтарные глаза. Пространства Тарковского.
   ── */
body.theme-dark-philosopher {
  --bg-primary:    #030504;
  --bg-secondary:  #07100a;
  --bg-card:       #0c1a10;
  --text-primary:  #c4ddd0;
  --text-secondary:#306a48;
  --text-muted:    #122018;
  --accent:        #00c878;
  --accent-warm:   #d46020;
  --accent-glow:   rgba(0,200,120,0.07);
  --accent-border: rgba(0,200,120,0.13);
  --nav-bg:        rgba(3,5,4,0.92);
}

/* ── CG TUNDRA  (dark night sky + holographic sky blue + earth)
   Вайб: эксцентричный, живой, немного безумный. Тундра как место
   где 3D встречает реальность. Серебряный пиджак в мерзлоте.
   ── */
body.theme-cg-tundra {
  --bg-primary:    #050d18;
  --bg-secondary:  #091620;
  --bg-card:       #0e2030;
  --text-primary:  #cce4f8;
  --text-secondary:#4888b0;
  --text-muted:    #102030;
  --accent:        #58b8f8;
  --accent-warm:   #c07830;
  --accent-glow:   rgba(88,184,248,0.07);
  --accent-border: rgba(88,184,248,0.13);
  --nav-bg:        rgba(5,13,24,0.88);
}

/* ============================================================
   CURSOR GLOW
   ============================================================ */
#cursor-glow {
  position: fixed;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 65%);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 2;
  transition: background 0.7s ease;
  top: 50%; left: 50%;
}

/* ============================================================
   TRANSITION OVERLAY
   ============================================================ */
#transition-overlay {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.32s ease;
}
#transition-overlay.is-active {
  opacity: 1;
  pointer-events: all;
}

/* ============================================================
   NAVIGATION
   ============================================================ */
#main-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--accent-border);
  z-index: 100;
  transition: background 0.5s ease, border-color 0.5s ease;
}

.nav-logo {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-primary);
  opacity: 0.85;
  transition: opacity 0.2s;
  padding: 6px 0;
}
.nav-logo:hover { opacity: 1; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-secondary);
  transition: color 0.25s, background 0.25s;
  white-space: nowrap;
}
.nav-item:hover {
  color: var(--text-primary);
  background: var(--accent-border);
}
.nav-item.is-active { color: var(--accent); }

.nav-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: background 0.25s;
  flex-shrink: 0;
}
.nav-item.is-active .nav-dot,
.nav-item:hover .nav-dot { background: var(--accent); }

/* Mobile toggle */
#mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
}
#mobile-toggle span {
  display: block;
  width: 22px; height: 1.5px;
  background: var(--text-secondary);
  transition: transform 0.25s, opacity 0.25s;
}
#mobile-toggle.is-open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
#mobile-toggle.is-open span:nth-child(2) { opacity: 0; }
#mobile-toggle.is-open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Mobile drawer */
#mobile-drawer {
  display: none;
  position: fixed;
  top: 60px; left: 0; right: 0;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--accent-border);
  padding: 16px 24px;
  z-index: 99;
  flex-direction: column;
  gap: 4px;
}
#mobile-drawer.is-open { display: flex; }

.drawer-item {
  padding: 12px 8px;
  font-size: 15px;
  color: var(--text-secondary);
  text-align: left;
  border-bottom: 1px solid var(--accent-border);
  transition: color 0.2s;
}
.drawer-item:hover { color: var(--accent); }

/* ============================================================
   PAGES
   ============================================================ */
.page {
  display: none;
  min-height: 100vh;
  padding-top: 60px;
  position: relative;
}
.page.is-active { display: block; }

/* Shared background layer */
.page-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

/* ── HOME BG: botanical line texture + amber glow ── */
.home-bg {
  background-image:
    radial-gradient(ellipse 70% 50% at 50% 110%, rgba(200,160,48,0.09) 0%, transparent 65%),
    radial-gradient(ellipse 40% 30% at 10% 80%, rgba(200,160,48,0.04) 0%, transparent 55%),
    /* Faint vertical stem lines */
    repeating-linear-gradient(
      90deg,
      transparent 0px, transparent 89px,
      rgba(255,255,255,0.012) 89px, rgba(255,255,255,0.012) 90px
    );
}

/* ── CG ART BG: harmonic wave interference ── */
.cgart-bg {
  background-image:
    radial-gradient(ellipse 80% 50% at 50% 30%, rgba(200,104,48,0.06) 0%, transparent 60%),
    /* Two harmonic overlapping stripe frequencies */
    repeating-linear-gradient(
      0deg,
      transparent 0px, transparent 22px,
      rgba(255,255,255,0.018) 22px, rgba(255,255,255,0.018) 23px
    ),
    repeating-linear-gradient(
      0deg,
      transparent 0px, transparent 9px,
      rgba(255,255,255,0.012) 9px, rgba(255,255,255,0.012) 10px
    );
}

/* ── KHIDI BG ── */
.khidi-bg {
  background-color: #265B61;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100'><text x='50' y='50' font-family='serif' font-size='32' text-anchor='middle' dominant-baseline='central' fill='%23D3C8BC'>ლ</text></svg>"),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100'><text x='50' y='50' font-family='serif' font-size='32' text-anchor='middle' dominant-baseline='central' fill='%23D3C8BC'>ლ</text></svg>");
  background-size: 100px 100px;
  background-position: 0 0, 50px 50px;
}

.khidi-card {
  position: relative;
  z-index: 1;
  background: #f2f2f2;
  border-radius: 28px;
  margin: 30px 60px 30px;
  padding: 40px 64px 46px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.22);
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-weight: 400;
}

.khidi-card h1,
.khidi-card h2,
.khidi-card h3,
.khidi-card h4,
.khidi-card .section-label,
.khidi-card .info-label {
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-weight: 600;
}

.khidi-heading {
  color: #1d1d1d;
  font-size: 2.2rem;
  font-weight: 700;
  margin: 0 0 16px;
}

.khidi-layout {
  display: flex;
  gap: 56px;
  align-items: flex-start;
}

.khidi-full {
  margin-top: 48px;
}

.khidi-main {
  flex: 1;
  min-width: 0;
  padding-left: 60px;
}

/* khidi-specific overrides */
#page-khidi .page-hero {
  border-bottom: none;
  margin-bottom: 0;
  padding: 16px 0 64px;
}
#page-khidi .khidi-heading {
  margin-left: 0;
  padding-left: 0;
  text-align: left;
}
#page-khidi .page-intro {
  margin-left: 0;
  padding-left: 3px;
  text-align: left;
}
#page-khidi .geo-divider {
  padding-left: 0;
  padding-right: 0;
}
#page-khidi .two-col {
  padding-left: 0;
  padding-right: 0;
}
#page-khidi .info-label {
  color: rgba(255,255,255,0.65);
}
#page-khidi .info-list li {
  color: #fff;
}
#page-khidi .geo-panel {
  background: #265B61;
  border-color: rgba(255,255,255,0.25);
}
#page-khidi .geo-cell {
  border-color: rgba(255,255,255,0.25);
}
#page-khidi .gi {
  color: #fff;
  opacity: 0.7;
}
#page-khidi .gi.gi-acc {
  opacity: 1;
}
#page-khidi .geo-divider::before,
#page-khidi .geo-divider::after {
  background: rgba(38,91,97,0.3);
}

.khidi-sidebar {
  width: 280px;
  flex-shrink: 0;
  padding-top: 24px;
  transform: translateX(-170px) translateY(60px);
}

.khidi-sidebar-title {
  font-size: 1rem;
  font-weight: 600;
  color: #1d1d1d;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.khidi-sidebar-text {
  font-size: 14px;
  line-height: 1.75;
  color: #265B61;
  margin-bottom: 32px;
}

.khidi-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.khidi-link-btn {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(38,91,97,0.2);
  background: transparent;
  transition: background 0.2s, border-color 0.2s;
  cursor: pointer;
}

.khidi-link-btn:hover {
  background: rgba(38,91,97,0.06);
  border-color: rgba(38,91,97,0.4);
}

.khidi-link-icon {
  font-size: 18px;
  color: #265B61;
  flex-shrink: 0;
  margin-top: 1px;
}

.khidi-link-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.khidi-link-title {
  font-size: 14px;
  font-weight: 600;
  color: #1d1d1d;
}

.khidi-link-desc {
  font-size: 12px;
  color: #265B61;
  line-height: 1.5;
}

body.theme-khidi .nav-logo {
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-weight: 700;
}

.nav-item[data-page="khidi"].is-active {
  font-weight: 700;
}

#page-khidi .page-logo {
  padding: 20px 0 0;
  margin-left: -30px;   /* ← вот это сдвигает влево */
}
#page-khidi .page-hero h1 {
  font-family: 'Segoe UI', system-ui, sans-serif;
  letter-spacing: normal;
}

/* ── CG TUNDRA: page-specific overrides ── */
#page-cg-tundra .page-logo img    { display: none; }
#page-cg-tundra .tundra-hero-spacer { border-bottom: none; margin-bottom: 0; padding-bottom: 0; min-height: 52vh; }
#page-cg-tundra .offerings-grid   { margin-top: 0; }

.tundra-pre-offerings {
  position: relative;
  z-index: 1;
  padding: 0 64px 28px;
}
.tundra-pre-offerings .page-eyebrow {
  text-transform: uppercase;
  font-size: 22px;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}
.tundra-pre-offerings .page-intro {
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  max-width: 640px;
}

/* ── DARK PHILOSOPHER BG: green mist, fire glow ── */
.dp-bg {
  inset: -6%;
  background-image:
    radial-gradient(ellipse 100% 55% at 50% 100%, rgba(0,100,50,0.22) 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 50% 85%, rgba(0,60,30,0.18) 0%, transparent 45%),
    radial-gradient(ellipse 40% 30% at 50% 100%, rgba(180,80,0,0.08) 0%, transparent 35%);
  animation: dp-vertigo 18s ease-in-out infinite;
}

.dp-shadow-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1000px;
  background-image: url('../assets/dp-shadow.jpg');
  background-repeat: no-repeat;
  background-position: 75% 0;
  background-size: auto 1000px;
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: 0;
}

/* Film grain for Dark Philosopher */
.dp-grain {
  position: fixed;
  inset: -40px;
  pointer-events: none;
  z-index: 1;
  opacity: 0.3;
  mix-blend-mode: screen;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='256' height='256'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='turbulence' baseFrequency='0.5' numOctaves='3' stitchTiles='stitch'/%3E%3CfeComponentTransfer%3E%3CfeFuncR type='linear' slope='4' intercept='-1.5'/%3E%3CfeFuncG type='linear' slope='3' intercept='-1'/%3E%3CfeFuncB type='linear' slope='3' intercept='-1'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 360px 360px;
  animation: dp-grain-boil 2s steps(8) infinite;
}

/* Chromatic aberration: two re-tinted grain layers offset left/right */
.dp-aberr-r {
  opacity: 0.10;
  transform: translateX(-2px);
  filter: sepia(1) saturate(10) hue-rotate(320deg);
  animation-delay: 0.12s;
}
.dp-aberr-b {
  opacity: 0.1;
  transform: translateX(2px);
  filter: sepia(1) saturate(10) hue-rotate(155deg);
  animation-delay: 0.43s;
}

/* Firelight glow — bottom of screen, no actual fire, just the ambient flicker */
.dp-fire, .dp-fire-bl, .dp-fire-br {
  position: fixed;
  bottom: 0;
  pointer-events: none;
  z-index: 1;
}
.dp-fire {
  left: 0; right: 0;
  height: 52%;
  background:
    radial-gradient(ellipse 72% 58% at 50% 100%, rgba(215,78,10,0.26) 0%, transparent 65%),
    radial-gradient(ellipse 46% 42% at 32% 100%, rgba(195,58,0,0.18) 0%, transparent 52%),
    radial-gradient(ellipse 46% 42% at 68% 100%, rgba(185,50,0,0.18) 0%, transparent 52%);
  animation: dp-fire-flash 4.8s ease-in-out infinite;
}
.dp-fire-bl {
  left: -8%;
  width: 56%;
  height: 62%;
  background:
    radial-gradient(ellipse 90% 78% at 0% 100%, rgba(225,82,10,0.20) 0%, transparent 65%),
    radial-gradient(ellipse 62% 58% at 4% 88%,  rgba(205,58,0,0.14) 0%, transparent 55%);
  animation: dp-fire-flash 3.6s ease-in-out 1.7s infinite;
}
.dp-fire-br {
  right: -8%;
  width: 56%;
  height: 62%;
  background:
    radial-gradient(ellipse 90% 78% at 100% 100%, rgba(225,82,10,0.20) 0%, transparent 65%),
    radial-gradient(ellipse 62% 58% at 96% 88%,  rgba(205,58,0,0.14) 0%, transparent 55%);
  animation: dp-fire-flash 5.3s ease-in-out 3.2s infinite;
}

/* ── CG TUNDRA: hero photo backdrop ── */
.tundra-hero-bg {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 90vh;
  background: url('../assets/cg-tundra/hero-bg.jpg') center calc(10% - 200px) / cover no-repeat;
  mask-image: linear-gradient(to bottom, black 0%, black 45%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 0%, black 45%, transparent 100%);
  z-index: 1;
  pointer-events: none;
}

/* ── CG TUNDRA BG: perspective grid + sky glow ── */
.tundra-bg {
  background-image:
    radial-gradient(ellipse 120% 50% at 50% -5%, rgba(88,184,248,0.09) 0%, transparent 50%),
    /* Horizontal horizon lines */
    repeating-linear-gradient(
      0deg,
      transparent 0px, transparent 99px,
      rgba(88,184,248,0.04) 99px, rgba(88,184,248,0.04) 100px
    ),
    /* Diagonal lines suggesting vanishing-point perspective */
    repeating-linear-gradient(
      72deg,
      transparent 0px, transparent 89px,
      rgba(88,184,248,0.025) 89px, rgba(88,184,248,0.025) 90px
    ),
    repeating-linear-gradient(
      108deg,
      transparent 0px, transparent 89px,
      rgba(88,184,248,0.025) 89px, rgba(88,184,248,0.025) 90px
    );
}

/* Stars — used by Dark Philosopher */
#dp-stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  animation: dp-stars-drift 26s ease-in-out infinite;
}
.star {
  position: absolute;
  border-radius: 50%;
  background: rgba(160,240,200,0.7);
  animation: twinkle var(--dur, 4s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}
@keyframes twinkle {
  0%, 100% { opacity: var(--min-op, 0.05); }
  50%       { opacity: var(--max-op, 0.5); }
}

/* ============================================================
   HERO — HOME
   ============================================================ */
.hero {
  position: relative;
  z-index: 1;
  min-height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 64px;
  max-width: 1200px;
}

.hero-eyebrow {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 24px;
}

.hero-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(64px, 10vw, 128px);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 32px;
}

.hero-tagline {
  font-size: clamp(14px, 1.5vw, 17px);
  font-weight: 300;
  color: var(--text-secondary);
  line-height: 1.8;
  max-width: 480px;
}

/* ============================================================
   PROJECT CARDS — HOME
   ============================================================ */
.project-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--accent-border);
  border-top: 1px solid var(--accent-border);
  border-bottom: 1px solid var(--accent-border);
  margin-bottom: 80px;
}

.project-card {
  background: var(--bg-primary);
  padding: 36px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
  transition: background 0.25s;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.project-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}
.project-card:hover { background: var(--bg-secondary); }
.project-card:hover::after { transform: scaleX(1); }

/* Card accent lines — match each project's actual accent color */
.card-cg-art::after            { background: #c86830; }
.card-khidi::after             { background: #38aa96; }
.card-dark-philosopher::after  { background: #00c878; }
.card-cg-tundra::after         { background: #58b8f8; }

.card-index {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  color: var(--text-muted);
}
.project-card h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}
.project-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  flex: 1;
}
.card-arrow {
  font-size: 16px;
  color: var(--text-muted);
  transition: color 0.25s, transform 0.25s;
  align-self: flex-end;
}
.project-card:hover .card-arrow {
  color: var(--accent);
  transform: translateX(4px);
}

/* ============================================================
   NEWS FEED
   ============================================================ */
.news-section {
  position: relative;
  z-index: 1;
  padding: 0 64px 80px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
}

.section-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
}

.news-filters {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  color: var(--text-secondary);
  border: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.filter-btn:hover {
  color: var(--text-primary);
  border-color: var(--accent-border);
}
.filter-btn.is-active {
  color: var(--accent);
  border-color: var(--accent-border);
  background: var(--accent-glow);
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--accent-border);
  border: 1px solid var(--accent-border);
  border-radius: 4px;
  overflow: hidden;
}

.news-card {
  background: var(--bg-primary);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: background 0.2s;
}
.news-card:hover { background: var(--bg-secondary); }

.news-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}
.news-badge {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 3px;
  border: 1px solid currentColor;
  opacity: 0.8;
}

/* Badge colors match each project's real accent */
.badge-cg-art            { color: #c86830; }
.badge-khidi             { color: #38aa96; }
.badge-dark-philosopher  { color: #00c878; }
.badge-cg-tundra         { color: #58b8f8; }
.badge-general           { color: #807868; }

.news-date {
  font-size: 11px;
  color: var(--text-muted);
}
.news-card h4 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
}
.news-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}
.news-link {
  font-size: 12px;
  color: var(--accent);
  margin-top: 4px;
  display: inline-block;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.news-card:hover .news-link { opacity: 1; }

/* ============================================================
   PAGE HERO (inner pages)
   ============================================================ */
.page-hero {
  position: relative;
  z-index: 1;
  padding: 80px 64px 64px;
  max-width: 900px;
  border-bottom: 1px solid var(--accent-border);
  margin-bottom: 64px;
}

.page-eyebrow {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
}

.page-hero h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(52px, 8vw, 96px);
  font-weight: 700;
  line-height: 0.94;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 28px;
}

.subtitle-word {
  color: var(--accent);
  opacity: 0.65;
}

.page-intro {
  font-size: 16px;
  font-weight: 300;
  color: var(--text-secondary);
  line-height: 1.8;
  max-width: 580px;
}

/* ── DARK PHILOSOPHER: special type treatment ── */
#page-dark-philosopher {
  --text-primary:   #ffffff;
  --text-secondary: rgba(255,255,255,0.62);
  --text-muted:     rgba(255,255,255,0.32);
  font-family: 'Book Antiqua', Palatino, 'Palatino Linotype', Georgia, serif;
  color: #ffffff;
}
#page-dark-philosopher h1,
#page-dark-philosopher h2,
#page-dark-philosopher h3,
#page-dark-philosopher p,
#page-dark-philosopher li,
#page-dark-philosopher .page-eyebrow,
#page-dark-philosopher .page-intro,
#page-dark-philosopher .info-text,
#page-dark-philosopher .info-label,
#page-dark-philosopher .section-label {
  font-family: 'Book Antiqua', Palatino, 'Palatino Linotype', Georgia, serif;
  color: #ffffff;
}
#page-dark-philosopher .page-hero h1 {
  font-weight: 400;
  letter-spacing: 0.04em;
}
#page-dark-philosopher .page-eyebrow,
#page-dark-philosopher .section-label {
  text-shadow: 0 0 24px rgba(0,200,120,0.35);
}
#page-dark-philosopher .page-hero h1,
#page-dark-philosopher .hero-name {
  text-shadow: 0 0 60px rgba(0,80,40,0.5);
}
/* Logos on inner pages */
.page-logo {
  position: relative;
  z-index: 1;
  padding: 48px 64px 0;
}
#page-dark-philosopher .page-logo {
  padding: 12px 64px 0;
  max-width: calc(100% - 340px);
}
#page-dark-philosopher .page-hero {
  padding-top: 20px;
  max-width: calc(900px - 340px);
}

/* ── DARK PHILOSOPHER: right description panel ── */
.dp-desc-panel {
  position: fixed;
  right: 0;
  top: 60px;
  bottom: 0;
  width: 300px;
  z-index: 2;
  padding: 56px 40px 56px 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 28px;
  pointer-events: none;
  border-left: 1px solid rgba(0,200,120,0.10);
}
.dp-desc-panel p {
  font-family: 'Book Antiqua', Palatino, 'Palatino Linotype', Georgia, serif;
  font-size: 13px;
  line-height: 1.85;
  color: rgba(255,255,255,0.48);
}
.dp-desc-panel p:first-child {
  color: rgba(255,255,255,0.68);
}
@media (max-width: 1024px) {
  .dp-desc-panel { display: none; }
  #page-dark-philosopher .page-logo,
  #page-dark-philosopher .page-hero { max-width: 100%; }
}
.page-logo img {
  height: 56px;
  width: auto;
  object-fit: contain;
  opacity: 0.9;
  filter: brightness(1.1);
}
#page-khidi .page-logo img {
  height: 336px;
}
#page-dark-philosopher .page-logo img {
  height: 280px;
  filter: url(#dp-logo-key);
  opacity: 1;
}

/* ── CG TUNDRA: holographic accent text ── */
#page-cg-tundra .page-eyebrow {
  background: linear-gradient(90deg, #58b8f8, #a860f8, #f86060, #58b8f8);
  background-size: 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: holoshimmer 4s linear infinite;
}
@keyframes holoshimmer {
  0%   { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

/* ============================================================
   TWO COLUMN INFO
   ============================================================ */
.two-col {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--accent-border);
  border-top: 1px solid var(--accent-border);
  border-bottom: 1px solid var(--accent-border);
  margin: 0 64px 64px;
}

.info-block {
  background: var(--bg-primary);
  padding: 32px;
}
.info-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}
.info-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.info-list li {
  font-size: 14px;
  color: var(--text-secondary);
  padding-left: 14px;
  position: relative;
}
.info-list li::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--text-muted);
}
.info-text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ============================================================
   PORTFOLIO GRID
   ============================================================ */
.portfolio-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--accent-border);
  border: 1px solid var(--accent-border);
  margin: 0 64px 64px;
  border-radius: 4px;
  overflow: hidden;
}

.portfolio-item {
  aspect-ratio: 16/10;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

/* ============================================================
   CTA BLOCK
   ============================================================ */
.cta-block {
  position: relative;
  z-index: 1;
  padding: 0 64px 64px;
}
.cta-btn {
  display: inline-block;
  padding: 14px 28px;
  border: 1px solid var(--accent-border);
  border-radius: 4px;
  font-size: 14px;
  color: var(--accent);
  background: var(--accent-glow);
  transition: background 0.25s, border-color 0.25s, color 0.25s;
  letter-spacing: 0.05em;
}
.cta-btn:hover {
  background: var(--accent-border);
  color: var(--text-primary);
}

/* ============================================================
   VIDEO PLACEHOLDER
   ============================================================ */
.video-placeholder {
  position: relative;
  z-index: 1;
  padding: 0 64px 64px;
}
.video-frame {
  width: 100%;
  max-width: 800px;
  aspect-ratio: 16/9;
  background: var(--bg-card);
  border: 1px solid var(--accent-border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}

/* ============================================================
   OFFERINGS GRID
   ============================================================ */
.offerings-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--accent-border);
  border: 1px solid var(--accent-border);
  margin: 0 64px 64px;
  border-radius: 4px;
  overflow: hidden;
}

.offering-card {
  background: var(--bg-card);
  padding: 32px;
}
.offering-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
}
.offering-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ============================================================
   PAGE-LEVEL NEWS (mini)
   ============================================================ */
.page-news {
  position: relative;
  z-index: 1;
  padding: 0 64px 80px;
}
.page-news .section-label {
  margin-bottom: 20px;
  display: block;
}
.mini-news { grid-template-columns: repeat(3, 1fr); }

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* ============================================================
   PAGE ENTER ANIMATIONS
   ============================================================ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.page.is-active .hero,
.page.is-active .page-hero,
.page.is-active .page-logo { animation: fadeUp 0.5s ease both; }

.page.is-active .project-grid { animation: fadeUp 0.5s 0.1s ease both; }

.page.is-active .news-section,
.page.is-active .two-col,
.page.is-active .portfolio-grid,
.page.is-active .video-placeholder,
.page.is-active .offerings-grid,
.page.is-active .cta-block,
.page.is-active .page-news { animation: fadeUp 0.5s 0.18s ease both; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .project-grid     { grid-template-columns: repeat(2, 1fr); }
  .portfolio-grid   { grid-template-columns: repeat(2, 1fr); }
  .offerings-grid   { grid-template-columns: 1fr; }
  .mini-news        { grid-template-columns: repeat(2, 1fr); }
  .news-grid        { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .nav-links     { display: none; }
  #mobile-toggle { display: flex; }
  .hero-emblem   { display: none; }

  /* ── Drawer — always dark, never inherits theme color ── */
  #mobile-drawer              { background: #111 !important; }
  #mobile-drawer .drawer-item { color: #d0d0d0 !important; }

  /* ── Hero ── */
  .hero          { padding: 40px 24px 40px; flex-direction: column; min-height: auto; padding-top: 48px; }
  .hero-portrait { background-size: auto 480px; height: 480px; }
  .hero-name     { font-size: 48px; letter-spacing: -1px; }
  .hero-tagline  { background: rgba(0,0,0,0.52); padding: 12px 16px; border-radius: 6px; }

  /* ── Page structure — 64px → 24px ── */
  .page-logo         { padding: 28px 24px 0; }
  .page-hero         { padding: 40px 24px 36px; }
  .news-section      { padding: 0 24px 48px; }
  .page-news         { padding: 0 24px 48px; }
  .cta-block         { padding: 0 24px 48px; }
  .video-placeholder { padding: 0 24px 48px; }
  .social-links      { padding: 0 24px 40px; }
  .yt-embed-wrap     { padding: 0 0 32px; }
  .word-cloud        { padding: 28px 24px; }
  .geo-divider       { padding: 0 24px; margin-bottom: 40px; }
  .geo-panel         { margin: 0 16px; }
  .geo-cell          { padding: 7px 10px; }

  /* ── Grids → 1 column ── */
  .project-grid         { grid-template-columns: 1fr; }
  .news-grid            { grid-template-columns: 1fr; }
  .mini-news            { grid-template-columns: 1fr; }
  .two-col              { grid-template-columns: 1fr; margin: 0 24px 48px; }
  .portfolio-grid       { grid-template-columns: 1fr; margin: 0 24px 48px; }
  .offerings-grid       { grid-template-columns: 1fr; margin: 0 24px 48px; }
  .works-grid           { grid-template-columns: 1fr; margin: 0 24px 48px; }
  .tundra-hero-portrait { grid-template-columns: 1fr; margin: 0 24px 48px; }
  .tundra-works-grid    { grid-template-columns: 1fr; margin: 0 24px 48px; }

  /* ── Shorts → 2 columns ── */
  .shorts-grid { grid-template-columns: repeat(2,1fr); padding: 0 24px 48px; max-width: 100%; }

  /* ── CG Art — intro text visible over wave canvas ── */
  #page-cg-art .page-intro { background: rgba(0,0,0,0.52); padding: 12px 16px; border-radius: 6px; color: #fff; }

  /* ── CG Tundra ── */
  .osc-wrap             { height: 220px; margin-top: 100px; }
  .tundra-float-obj     { width: auto; right: calc(2% + 50px); bottom: 15%; }
  .tundra-float-btn     { font-size: 13px !important; padding: 10px 18px !important; }
  .tundra-pre-offerings { padding: 0 24px 24px; }
  .tundra-hero-bg       { top: 150px; height: 72vh; background-position: center calc(10% - 50px); }

  /* ── Khidi ── */
  .khidi-card               { margin: 16px; padding: 28px 24px; overflow: hidden; }
  .khidi-layout             { flex-direction: column; gap: 24px; }
  .khidi-main               { padding-left: 0; }
  .khidi-sidebar            { width: 100%; transform: none; padding-top: 0; }
  .khidi-card .social-links { padding-left: 0; padding-right: 0; }
  #page-khidi .page-logo img { height: 168px; }

  /* ── Dark Philosopher ── */
  #page-dark-philosopher .page-logo            { padding: 12px 24px 0; max-width: 100%; }
  #page-dark-philosopher .page-hero            { max-width: 100%; }
  #page-dark-philosopher .shorts-grid          { max-width: 100%; padding: 0 24px 48px; }
  #page-dark-philosopher .page-eyebrow         { display: none; }
}

/* ============================================================
   HERO WITH PORTRAIT (Home)
   ============================================================ */
.hero {
  flex-direction: row;
  align-items: center;
  gap: 48px;
}
.hero-content { flex: 1; min-width: 0; }
.hero-portrait {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1000px;
  background-image: url('../assets/avatar.png');
  background-repeat: no-repeat;
  background-position: 75% 0;
  background-size: auto 1000px;
  pointer-events: none;
  z-index: 0;
}
.hero-portrait::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 45%;
  background: linear-gradient(transparent, var(--bg-primary));
  border-radius: 0 0 4px 4px;
}

/* ============================================================
   HOME BOTANICAL BACKGROUND
   ============================================================ */
.home-bg {
  background-image:
    url('../assets/botanical-bg.png'),
    radial-gradient(ellipse 70% 50% at 50% 110%, rgba(200,160,48,0.09) 0%, transparent 65%);
  background-size: 360px auto, auto;
  background-repeat: repeat, no-repeat;
  background-position: center top, center;
  mix-blend-mode: normal;
  opacity: 0.06;
}

/* ============================================================
   WORD CLOUD
   ============================================================ */
.word-cloud {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 2px 18px;
  padding: 40px 64px 44px;
  border-bottom: 1px solid var(--accent-border);
  align-items: baseline;
}
.word-cloud span {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
  cursor: default;
  transition: opacity 0.2s, color 0.2s;
}
.word-cloud span:hover { color: var(--accent); opacity: 1 !important; }
.wc-xl { font-size: 30px; opacity: 0.82; }
.wc-lg { font-size: 20px; opacity: 0.60; }
.wc-md { font-size: 15px; opacity: 0.40; }
.wc-sm { font-size: 11px; opacity: 0.22; }

/* ── Tag cloud — infinite marquee ───────────────────────────── */
.tag-cloud {
  position: relative;
  z-index: 1;
  overflow: hidden;
  padding: 40px 0 44px;
  border-bottom: 1px solid var(--accent-border);
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.tc-row   { overflow: hidden; }

.tc-inner {
  display: flex;
  width: max-content;
  will-change: transform;
}

/* Row 0, 2 … — moves right (left-to-right) */
.tc-inner--ltr {
  animation: tc-ltr linear infinite;
}
/* Row 1, 3 … — moves left (right-to-left) */
.tc-inner--rtl {
  animation: tc-rtl linear infinite;
}

@keyframes tc-ltr {
  from { transform: translateX(-50%); }
  to   { transform: translateX(0); }
}
@keyframes tc-rtl {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.tc-tag {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 16px;
  line-height: 1;
  padding: 6px 14px;
  border-radius: 0;
  border: 1px solid transparent;
  cursor: default;
  white-space: nowrap;
  flex-shrink: 0;
  margin-right: 1px;
}

.tc-tag--pill  { border-radius: 999px; }
.tc-tag--ghost { background: transparent !important; }

.tc-tag--bold    { font-weight: 700; }
.tc-tag--italic  { font-style: italic; font-weight: 400; }
.tc-tag--regular { font-weight: 400; }

/* ============================================================
   SPARKLES (Home hero)
   ============================================================ */
#sparkle-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.sparkle {
  position: absolute;
  color: #c8a030;
  opacity: 0;
  animation: sparkle-life ease-out both;
}
@keyframes sparkle-life {
  0%   { opacity: 0;   transform: scale(0)   rotate(0deg); }
  30%  { opacity: 0.9; transform: scale(1)   rotate(18deg); }
  70%  { opacity: 0.6; transform: scale(1.1) rotate(-10deg); }
  100% { opacity: 0;   transform: scale(0.4) rotate(25deg); }
}

/* ============================================================
   OSCILLOSCOPE (CG Artist)
   ============================================================ */
.osc-wrap {
  position: relative;
  z-index: 3;                         /* above noise canvas (z-index:0) */
  width: 100%;
  height: clamp(460px, 62vh, 680px);
  border-top: 1px solid var(--accent-border);
  border-bottom: 1px solid var(--accent-border);
  overflow: visible;
  margin-bottom: 64px;
  cursor: crosshair;
}
#osc-canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.osc-label {
  position: absolute;
  bottom: 14px;
  right: 24px;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  pointer-events: none;
}
.osc-hint {
  position: absolute;
  bottom: 14px;
  left: 24px;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  pointer-events: none;
}

/* ============================================================
   PORTFOLIO GRID — real images/video
   ============================================================ */
.portfolio-item {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.portfolio-item img,
.portfolio-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}
.portfolio-item:hover img,
.portfolio-item:hover video { transform: scale(1.04); }
.portfolio-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 16px;
  background: linear-gradient(transparent 40%, rgba(0,0,0,0.65));
  opacity: 0;
  transition: opacity 0.3s;
}
.portfolio-item:hover .portfolio-overlay { opacity: 1; }
.portfolio-overlay p {
  font-size: 12px;
  color: rgba(255,255,255,0.85);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ============================================================
   SOCIAL LINKS
   ============================================================ */
.social-links {
  position: relative;
  z-index: 1;
  padding: 0 64px 56px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.social-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border: 1px solid var(--accent-border);
  border-radius: 4px;
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  white-space: nowrap;
}
.social-link:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-glow);
}
.social-link-icon { color: var(--accent); font-size: 14px; }
.social-link-name { font-weight: 500; color: var(--text-primary); }
.social-link-handle { color: var(--text-muted); font-size: 11px; }

/* ============================================================
   YOUTUBE EMBED (full-width)
   ============================================================ */
.yt-embed-wrap {
  position: relative;
  z-index: 1;
  padding: 0 64px 64px;
}
.yt-embed-inner {
  position: relative;
  width: 100%;
  max-width: 800px;
  aspect-ratio: 16/9;
  background: var(--bg-card);
  border: 1px solid var(--accent-border);
  border-radius: 4px;
  overflow: hidden;
}
.yt-embed-inner iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ============================================================
   DARK PHILOSOPHER — SHORTS GRID
   ============================================================ */
.shorts-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  padding: 0 64px 64px;
  max-width: calc(100% - 340px);
}
.short-wrap {
  position: relative;
  aspect-ratio: 9/16;
  background: var(--bg-card);
  border: 1px solid var(--accent-border);
  border-radius: 6px;
  overflow: hidden;
}
.short-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}
.short-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-align: center;
  padding: 16px;
}
.short-placeholder .ph-icon { font-size: 28px; opacity: 0.4; color: var(--accent); }

/* ============================================================
   DARK PHILOSOPHER — GLITCH EFFECT
   ============================================================ */
@keyframes glitch-1 {
  0%   { clip-path: inset(35% 0 55% 0); transform: translate(-4px, 0); }
  25%  { clip-path: inset(10% 0 80% 0); transform: translate( 4px, 0); }
  50%  { clip-path: inset(65% 0 25% 0); transform: translate(-3px, 0); }
  75%  { clip-path: inset(20% 0 70% 0); transform: translate( 2px, 0); }
  100% { clip-path: inset(35% 0 55% 0); transform: translate(-4px, 0); }
}
@keyframes glitch-2 {
  0%   { clip-path: inset(55% 0 35% 0); transform: translate( 4px, 0); }
  25%  { clip-path: inset(70% 0 20% 0); transform: translate(-4px, 0); }
  50%  { clip-path: inset(15% 0 75% 0); transform: translate( 3px, 0); }
  75%  { clip-path: inset(45% 0 45% 0); transform: translate(-2px, 0); }
  100% { clip-path: inset(55% 0 35% 0); transform: translate( 4px, 0); }
}

.glitch-text {
  position: relative;
  display: inline-block;
}
.glitch-text::before,
.glitch-text::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  font: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  opacity: 0;
  pointer-events: none;
}
.glitch-text.is-glitching::before {
  opacity: 0.75;
  color: #00c878;
  animation: glitch-1 0.28s steps(2) both;
}
.glitch-text.is-glitching::after {
  opacity: 0.65;
  color: #d46020;
  animation: glitch-2 0.28s steps(3) both;
}

/* ============================================================
   CG TUNDRA — PERSPECTIVE GRID
   ============================================================ */
.tundra-perspective {
  position: fixed;
  bottom: 0;
  left: -25%;
  width: 150%;
  height: 55vh;
  perspective: 700px;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.tundra-grid-floor {
  position: absolute;
  inset: 0;
  transform-origin: bottom center;
  transform: rotateX(62deg);
  background-image:
    linear-gradient(rgba(88,184,248,0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(88,184,248,0.07) 1px, transparent 1px);
  background-size: 72px 72px;
  animation: tundraMove 10s linear infinite;
}
@keyframes tundraMove {
  from { background-position: 0 0; }
  to   { background-position: 0 72px; }
}

/* ============================================================
   CG TUNDRA — WORKS GRID (2×2 blocks + fly-in gallery)
   ============================================================ */
.works-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin: 0 64px 64px;
}

.works-block {
  position: relative;
  aspect-ratio: 16/9;
  cursor: pointer;
  overflow: hidden;
  border-radius: 4px;
  border: 1px solid var(--accent-border);
  background: var(--bg-secondary);
  transition: border-color 0.25s;
}
.works-block:hover,
.works-block.is-active { border-color: var(--accent); }

.works-block-bg {
  position: absolute;
  inset: 0;
}
.works-block-bg img,
.works-block-bg video {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 0.5s ease;
}
.works-block:hover .works-block-bg img,
.works-block:hover .works-block-bg video { transform: scale(1.04); }

/* Multi-vertical block: videos side by side in a row */
.works-block--multi-vert .works-block-bg {
  display: flex;
  gap: 3px;
}
.works-block--multi-vert .works-block-bg video,
.works-block--multi-vert .works-block-bg img {
  flex: 1 1 0;
  width: 0;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.works-block--multi-vert:hover .works-block-bg video { transform: scale(1.03); }
.works-block--multi-vert .works-block-bg video { opacity: 0.4; transition: transform 0.5s ease, opacity 0.5s ease; }
.works-block--multi-vert .works-block-bg video.is-playing { opacity: 1; }

.works-block-footer {
  position: absolute;
  top: 12px; left: 12px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}
.works-block-label {
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(0,0,0,0.5);
  padding: 5px 10px;
  border-radius: 3px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.works-hint-btn {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.5);
  background: rgba(0,0,0,0.5);
  color: rgba(255,255,255,0.85);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  pointer-events: all;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background 0.2s, border-color 0.2s;
  flex-shrink: 0;
}
.works-hint-btn:hover {
  background: rgba(0,0,0,0.75);
  border-color: var(--accent);
  color: var(--accent);
}
.works-block-toggle {
  font-size: 20px;
  color: var(--accent);
  background: rgba(0,0,0,0.5);
  padding: 2px 8px;
  border-radius: 3px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  line-height: 1.2;
  pointer-events: all;
}
.works-block.is-active .works-block-toggle { transform: rotate(90deg); }

/* Hint popup overlay */
.works-hint-popup {
  position: absolute;
  inset: 0;
  z-index: 10;
  background: rgba(5, 13, 24, 0.93);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  border-radius: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
  cursor: pointer;
}
.works-hint-popup.is-visible {
  opacity: 1;
  pointer-events: all;
}
.works-hint-title {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}
.works-hint-text {
  font-size: 13px;
  line-height: 1.7;
  color: rgba(255,255,255,0.82);
  max-width: 420px;
}

.works-block-tags-bar {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  pointer-events: none;
}
.works-block-tag {
  font-size: 10px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.72);
  background: rgba(0,0,0,0.55);
  padding: 3px 7px;
  border-radius: 2px;
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.13);
}

/* Gallery panel — spans full width, collapses to 0 when closed */
.works-gallery {
  grid-column: 1 / -1;
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}
.works-gallery.is-open { grid-template-rows: 1fr; }

.works-gallery-inner {
  min-height: 0;
  overflow: hidden;
  display: grid;
  gap: 5px;
  padding: 0;
  transition: padding 0.45s ease;
}
.works-gallery.is-open .works-gallery-inner { padding: 5px 0 0; }

/* Gallery items */
.works-gallery-item {
  aspect-ratio: 16/10;
  position: relative;
  overflow: hidden;
  border-radius: 3px;
  border: 1px solid var(--accent-border);
  background: var(--bg-card);
  opacity: 0;
}
.works-gallery-item img,
.works-gallery-item video {
  width: 100%; height: 100%; object-fit: cover; display: block;
}

/* Placeholder cell */
.works-gallery-placeholder {
  border-style: dashed !important;
}

/* Fly-in animation */
@keyframes works-fly-in {
  from { opacity: 0; transform: translateX(-32px) scale(0.92); }
  to   { opacity: 1; transform: none; }
}
@keyframes works-fly-out {
  from { opacity: 1; transform: none; }
  to   { opacity: 0; transform: translateX(-20px); }
}
.works-gallery-item.is-visible {
  animation: works-fly-in 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.works-gallery-item.is-leaving {
  animation: works-fly-out 0.2s ease forwards;
}

/* Block highlight flash — triggered by tag-cloud navigation */
@keyframes block-highlight {
  0%   { box-shadow: 0 0  0px 0px transparent; }
  25%  { box-shadow: 0 0 0 3px var(--accent), 0 0 28px 4px var(--accent-glow); }
  60%  { box-shadow: 0 0 0 3px var(--accent), 0 0 28px 4px var(--accent-glow); }
  100% { box-shadow: 0 0  0px 0px transparent; }
}
.works-block.is-highlighted {
  animation: block-highlight 1.4s ease-out forwards;
  z-index: 4;
}

/* ============================================================
   FEATURED PORTRAIT (CG Tundra)
   ============================================================ */
.tundra-hero-portrait {
  position: relative;
  z-index: 1;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--accent-border);
  border: 1px solid var(--accent-border);
  margin: 0 64px 64px;
  border-radius: 4px;
  overflow: hidden;
}
.tundra-hero-portrait img {
  width: 100%;
  height: 100%;
  min-height: 360px;
  object-fit: cover;
  display: block;
}
.tundra-portrait-copy {
  background: var(--bg-card);
  padding: 40px 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
}
.tundra-portrait-copy h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
}
.tundra-portrait-copy p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ============================================================
   TYPEWRITER CURSOR (Home hero)
   ============================================================ */
.tw-cursor {
  color: var(--accent);
  font-weight: 300;
  animation: tw-blink 0.85s step-end infinite;
  user-select: none;
}
@keyframes tw-blink {
  0%, 100% { opacity: 0.7; }
  50%       { opacity: 0; }
}

/* ============================================================
   CG TUNDRA — FLOATING 3D OBJECT
   ============================================================ */
.tundra-float-obj {
  position: fixed;
  right: calc(5% + 100px);
  bottom: 30%;
  width: auto;
  pointer-events: all;
  z-index: 2;
  animation: tundra-float 8s ease-in-out infinite;
  filter: drop-shadow(0 20px 50px rgba(88,184,248,0.22))
          drop-shadow(0 0 20px rgba(88,184,248,0.08));
}
.tundra-float-btn {
  display: block;
  white-space: nowrap;
  font-size: 26px;
  padding: 33px 66px;
  border-width: 2px;
  transform: perspective(480px) rotateY(-16deg) rotateX(6deg);
}
@keyframes tundra-float {
  0%, 100% { transform: translateY(0px)   rotateZ(0.5deg);  }
  35%       { transform: translateY(-20px) rotateZ(-0.4deg); }
  70%       { transform: translateY(-10px) rotateZ(0.7deg);  }
}

@media (max-width: 768px) {
  .tundra-float-obj { width: auto; right: 12px; bottom: 18%; }
}

/* ============================================================
   NOISE CANVAS (Home + CG Artist background)
   ============================================================ */
.noise-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.wave-bg-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* CG Art background images — absolute inside section, scroll with content */
.cg-bg-corner {
  position: absolute;
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: screen;
  filter: contrast(1.1) sepia(1) hue-rotate(-15deg) saturate(2.6) brightness(1.00);
  opacity: 0;
  transition: opacity 0s;
  /* Aligned to hero — top of page section, right side */
  top: 40px;
  right: 0;
  width:  680px;
  height: 680px;
  background: url('../assets/cg-bg-1.png') no-repeat center / contain;
}
.cg-bg-corner.is-visible { opacity: 0.8; }

/* CGBackground2.jpg — sits in normal flow after portfolio grid */
.cg-bg-wide {
  display: block;
  position: relative;
  z-index: 0;           /* stays behind portfolio-grid (z-index: 1) */
  margin-top: -120px;   /* pull top edge up under the portfolio bottom */
  width: 100%;
  height: 280px;
  pointer-events: none;
  mix-blend-mode: screen;
  filter: contrast(1.1) sepia(1) hue-rotate(-15deg) saturate(2.5) brightness(1.0);
  background: url('../assets/cg-bg-2.jpg') no-repeat center / cover;
  opacity: 0;
  transition: opacity 0.5s;
}
.cg-bg-wide.is-visible { opacity: 0.6; }

/* ============================================================
   HERO EMBLEM (Home — three-circles + star, very faint)
   ============================================================ */
.hero-emblem {
  position: absolute;
  left: 2%;
  top: 50%;
  transform: translateY(-52%);
  width: 340px;
  height: 340px;
  color: var(--accent);
  opacity: 0.055;
  pointer-events: none;
  z-index: 0;
  animation: emblem-drift 140s linear infinite;
  flex-shrink: 0;
}
.hero-emblem svg { width: 100%; height: 100%; }
@keyframes emblem-drift {
  from { transform: translateY(-52%) rotate(0deg);   }
  to   { transform: translateY(-52%) rotate(360deg); }
}
@media (max-width: 768px) { .hero-emblem { display: none; } }

/* ============================================================
   GEOMETRIC SECTION DIVIDERS
   All pages. Panel with icon cells + extending lines.
   ============================================================ */
.geo-divider {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  padding: 0 64px;
  margin-bottom: 64px;
  user-select: none;
  pointer-events: none;
}
.geo-divider::before,
.geo-divider::after {
  content: '';
  flex: 1;
  height: 3px;
  background: var(--accent-border);
}
.geo-panel {
  display: flex;
  align-items: stretch;
  border: 2px solid var(--accent-border);
  border-radius: 4px;
  overflow: hidden;
  margin: 0 28px;
  background: var(--bg-primary);
}
.geo-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-right: 2px solid var(--accent-border);
}
.gi { stroke-width: 3.5; }
.geo-cell:last-child { border-right: none; }

/* Icon base */
.gi {
  display: block;
  width: 13px;
  height: 13px;
  color: var(--accent);
  opacity: 0.42;
  flex-shrink: 0;
}
.gi-lg  { width: 16px; height: 16px; }
.gi-acc { opacity: 0.72; }
.gi-glyph {
  width: auto; height: auto;
  font-size: 15px;
  line-height: 1;
  font-style: normal;
}

@media (max-width: 768px) {
  .geo-divider          { padding: 0 24px; margin-bottom: 48px; }
  .geo-panel            { margin: 0 16px; }
  .geo-cell             { padding: 7px 10px; }
}

/* ── DARK PHILOSOPHER: grain / fire / vertigo / aberration keyframes ── */
@keyframes dp-grain-boil {
  0%   { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='256' height='256'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='turbulence' baseFrequency='0.6' numOctaves='3' seed='0' stitchTiles='stitch'/%3E%3CfeComponentTransfer%3E%3CfeFuncR type='linear' slope='4' intercept='-1.5'/%3E%3CfeFuncG type='linear' slope='3' intercept='-1'/%3E%3CfeFuncB type='linear' slope='3' intercept='-1'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
  12% { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='256' height='256'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='turbulence' baseFrequency='0.6' numOctaves='3' seed='17' stitchTiles='stitch'/%3E%3CfeComponentTransfer%3E%3CfeFuncR type='linear' slope='4' intercept='-1.5'/%3E%3CfeFuncG type='linear' slope='3' intercept='-1'/%3E%3CfeFuncB type='linear' slope='3' intercept='-1'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
  25% { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='256' height='256'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='turbulence' baseFrequency='0.6' numOctaves='3' seed='43' stitchTiles='stitch'/%3E%3CfeComponentTransfer%3E%3CfeFuncR type='linear' slope='4' intercept='-1.5'/%3E%3CfeFuncG type='linear' slope='3' intercept='-1'/%3E%3CfeFuncB type='linear' slope='3' intercept='-1'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
  37% { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='256' height='256'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='turbulence' baseFrequency='0.6' numOctaves='3' seed='81' stitchTiles='stitch'/%3E%3CfeComponentTransfer%3E%3CfeFuncR type='linear' slope='4' intercept='-1.5'/%3E%3CfeFuncG type='linear' slope='3' intercept='-1'/%3E%3CfeFuncB type='linear' slope='3' intercept='-1'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
  50% { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='256' height='256'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='turbulence' baseFrequency='0.6' numOctaves='3' seed='7' stitchTiles='stitch'/%3E%3CfeComponentTransfer%3E%3CfeFuncR type='linear' slope='4' intercept='-1.5'/%3E%3CfeFuncG type='linear' slope='3' intercept='-1'/%3E%3CfeFuncB type='linear' slope='3' intercept='-1'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
  62% { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='256' height='256'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='turbulence' baseFrequency='0.6' numOctaves='3' seed='55' stitchTiles='stitch'/%3E%3CfeComponentTransfer%3E%3CfeFuncR type='linear' slope='4' intercept='-1.5'/%3E%3CfeFuncG type='linear' slope='3' intercept='-1'/%3E%3CfeFuncB type='linear' slope='3' intercept='-1'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
  75% { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='256' height='256'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='turbulence' baseFrequency='0.6' numOctaves='3' seed='29' stitchTiles='stitch'/%3E%3CfeComponentTransfer%3E%3CfeFuncR type='linear' slope='4' intercept='-1.5'/%3E%3CfeFuncG type='linear' slope='3' intercept='-1'/%3E%3CfeFuncB type='linear' slope='3' intercept='-1'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
  87% { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='256' height='256'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='turbulence' baseFrequency='0.6' numOctaves='3' seed='94' stitchTiles='stitch'/%3E%3CfeComponentTransfer%3E%3CfeFuncR type='linear' slope='4' intercept='-1.5'/%3E%3CfeFuncG type='linear' slope='3' intercept='-1'/%3E%3CfeFuncB type='linear' slope='3' intercept='-1'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
}
@keyframes dp-fire-flash {
  0%   { opacity: 0.55; }
  8%   { opacity: 0.05; }
  18%  { opacity: 0.90; }
  24%  { opacity: 1.00; }
  32%  { opacity: 0.18; }
  41%  { opacity: 0.82; }
  48%  { opacity: 1.00; }
  55%  { opacity: 0.08; }
  64%  { opacity: 0.78; }
  72%  { opacity: 0.20; }
  80%  { opacity: 1.00; }
  88%  { opacity: 0.40; }
  94%  { opacity: 0.85; }
  100% { opacity: 0.55; }
}
@keyframes dp-vertigo {
  0%, 100% { transform: scale(1.00); }
  33%      { transform: scale(1.05) rotate(0.4deg); }
  66%      { transform: scale(0.97) rotate(-0.3deg); }
}
@keyframes dp-stars-drift {
  0%, 100% { transform: scale(1.00) rotate(0deg); }
  50%      { transform: scale(1.10) rotate(1.2deg); }
}


/* ============================================================
   TAG NAVIGATION POPUP
   ============================================================ */
.tag-nav-popup {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  z-index: 9000;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 10px 16px 10px 20px;
  background: var(--bg-card);
  border: 1px solid var(--accent-border);
  border-radius: 6px;
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  white-space: nowrap;
}
.tag-nav-popup.is-open {
  opacity: 1;
  pointer-events: all;
  transform: translateX(-50%) translateY(0);
}
.tag-nav-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.04em;
}
.tag-nav-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}
.tag-nav-counter {
  font-size: 12px;
  color: var(--text-secondary);
  min-width: 36px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.tag-nav-btn {
  width: 26px;
  height: 26px;
  border-radius: 3px;
  border: 1px solid var(--accent-border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.18s, color 0.18s;
}
.tag-nav-btn:hover { border-color: var(--accent); color: var(--accent); }
.tag-nav-close { margin-left: 8px; font-size: 16px; }

/* ── Shorts thumbnail overlay (mobile click-to-load) ── */
.short-thumb {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.short-play-btn {
  width: 48px;
  height: 48px;
  background: rgba(0,0,0,0.65);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.short-play-btn::after {
  content: '';
  border-left: 16px solid #fff;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  margin-left: 4px;
}

/* ============================================================
   MOBILE OVERRIDES — final block, wins cascade over all above
   ============================================================ */
@media (max-width: 768px) {
  /* Hero — push content down 70px, fix flex after line-1336 desktop rule */
  .hero          { flex-direction: column !important; padding-top: 118px !important; min-height: auto !important; }
  .hero-portrait { background-size: auto 480px; height: 480px; }

  /* Grids → 1 column (must be after desktop definitions to win) */
  .works-grid        { grid-template-columns: 1fr !important; margin: 0 16px 48px; }
  .tundra-works-grid { grid-template-columns: 1fr !important; margin: 0 16px 48px; }
  .works-block       { min-height: 200px; }

  /* YouTube embeds — full width (desktop padding: 0 64px 64px at line ~1600 was winning) */
  .yt-embed-wrap      { padding: 0 0 32px !important; }
  .yt-embed-inner     { max-width: 100%; }
  .khidi-card .yt-embed-wrap { margin-left: -24px !important; margin-right: -24px !important; }
  /* Khidi video — 10% smaller than full card width */
  .khidi-card .yt-embed-wrap { width: 90%; margin: 0 auto 32px !important; }

  /* CG Tundra apply button — fixed at bottom-center, no animation/filter (avoids iOS stacking bug) */
  .tundra-float-obj { position: fixed !important; left: 50% !important; right: auto !important; bottom: 24px !important; transform: translateX(-50%) !important; animation: none !important; filter: none !important; z-index: 200 !important; padding: 0; display: block; width: auto; }
  .tundra-float-btn { transform: none !important; white-space: nowrap; }

  /* CG Tundra hero spacer — reduce 52vh gap so Online Education isn't pushed far down */
  #page-cg-tundra .tundra-hero-spacer { min-height: 180px !important; }

  /* Dark Philosopher shorts — 20% bigger (less padding), 50% less gap */
  #page-dark-philosopher .shorts-grid { padding: 0 4px 48px !important; gap: 10px !important; }

  /* CG Tundra pre-offerings intro — semi-bold */
  .tundra-pre-offerings .page-intro { font-weight: 600; color: #fff; }

  /* DP logo — PNG with alpha, 30% smaller, invert white→black */
  #page-dark-philosopher .page-logo img { filter: invert(1) !important; height: 196px !important; }

  /* DP page-hero — shift title + intro down 30px */
  #page-dark-philosopher .page-hero { margin-top: 30px; }

  /* DP YouTube video — 10% smaller, escape the full-bleed override */
  #page-dark-philosopher .yt-embed-wrap { padding: 0 5% 32px !important; }

  /* CG Tundra hero bg — restore, fix to top of section (top:150px caused mid-page gap) */
  .tundra-hero-bg { height: 64vh; background-position: center calc(10% - 50px); top: 0; }

  /* Oscilloscope — guarantee margin applies after section styles */
  .osc-wrap { margin-top: 100px; }
}
