/* ════════════════════════════════════════════════════════════════
   PIXELJI UNIVERSE — universe.css
   Respecting Every Pixel.
   ════════════════════════════════════════════════════════════════ */

/* ══ TOKENS ══ */
:root {
  --pixelji-red:   #CC1F1F;
  --pixelji-dark:  #1A1A1A;
  --void-space:    #060608;
  --pixel-white:   #E8E8F0;
  --ember-glow:    #FF3B1F;
  --grid-grey:     #2A2A2E;
  --matte-silver:  #8A8A9A;
  --signal-white:  #FFFFFF;
  --red-bright:    #FF4242;  /* brighter red for SMALL text — better contrast on the void */

  --red-soft: rgba(204, 31, 31, 0.20);
  --red-line: rgba(204, 31, 31, 0.34);
  --glass:    rgba(20, 20, 26, 0.42);
  --glass-bd: rgba(255, 255, 255, 0.07);

  --font-display: 'Bebas Neue', sans-serif;
  --font-synco:   'Syncopate', sans-serif;
  --font-body:    'Inter', sans-serif;
  --font-mono:    'Share Tech Mono', monospace;
  --font-accent:  'Rajdhani', sans-serif;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --maxw: 1320px;

  --z-canvas: 0;
  --z-content: 2;
  --z-rail: 30;
  --z-badge: 35;
  --z-ui: 40;
  --z-overlay: 60;
  --z-loader: 90;
  --z-cursor: 9999;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--void-space);
  color: var(--pixel-white);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.is-loading { overflow: hidden; height: 100vh; }

a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
em { font-style: normal; color: var(--pixelji-red); }
.accent { color: var(--pixelji-red); }
.mono { font-family: var(--font-mono); letter-spacing: 0.04em; }

::selection { background: var(--pixelji-red); color: var(--void-space); }

/* hide native cursor when custom is active */
body.custom-cursor, body.custom-cursor * { cursor: none; }

/* ══ PERSISTENT CANVAS + FILM LAYERS ══ */
#webgl {
  position: fixed; inset: 0;
  width: 100vw; height: 100vh;
  z-index: var(--z-canvas);
  display: block;
  touch-action: pan-y;
}
.vignette {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 52%, rgba(0,0,0,0.62) 100%);
}
.grain {
  position: fixed; inset: -50%; z-index: 1; pointer-events: none;
  opacity: 0.05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grainShift 0.6s steps(3) infinite;
}
@keyframes grainShift {
  0% { transform: translate(0,0); } 50% { transform: translate(-4%, 3%); } 100% { transform: translate(3%,-2%); }
}

/* ════════════════════════════════════════════════════════════════
   CHAPTER 0 — LOADER (Pixel Birth)
   ════════════════════════════════════════════════════════════════ */
.loader {
  position: fixed; inset: 0; z-index: var(--z-loader);
  background: var(--void-space);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.8s var(--ease-out);
}
.loader.is-done { opacity: 0; pointer-events: none; }
#loader-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.loader-readout {
  position: absolute; left: 50%; bottom: 72px; transform: translateX(-50%);
  text-align: center; font-family: var(--font-mono); font-size: 12px;
  color: var(--pixelji-red); letter-spacing: 0.08em; line-height: 2;
}
.loader-readout [data-line] { opacity: 0; }
.loader-bar {
  position: absolute; left: 0; bottom: 0; width: 100%; height: 2px;
  background: rgba(255,255,255,0.06);
}
.loader-bar-fill {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--pixelji-red), var(--ember-glow));
  box-shadow: 0 0 18px var(--ember-glow);
}

/* ════════════════════════════════════════════════════════════════
   GLOBAL UI
   ════════════════════════════════════════════════════════════════ */
/* Custom cursor */
.cursor { position: fixed; top: 0; left: 0; z-index: var(--z-cursor); pointer-events: none; transform: translate(-50%, -50%); mix-blend-mode: screen; }
.cursor-dot { position: absolute; top: 50%; left: 50%; width: 6px; height: 6px; border-radius: 50%; background: var(--ember-glow); transform: translate(-50%,-50%); }
.cursor-ring { position: absolute; top: 50%; left: 50%; width: 30px; height: 30px; border: 1px solid var(--red-line); border-radius: 50%; transform: translate(-50%,-50%) scale(1); transition: width .25s var(--ease-out), height .25s var(--ease-out), border-color .25s, opacity .25s; }
body.cursor-hover .cursor-ring { width: 56px; height: 56px; border-color: var(--pixelji-red); }
body.cursor-down .cursor-ring { width: 18px; height: 18px; }

/* PIX nav trigger */
.pix-trigger {
  position: fixed; top: 26px; left: 28px; z-index: var(--z-ui);
  display: flex; align-items: center; gap: 12px;
  background: none; border: none; color: var(--pixel-white);
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.18em;
}
.pix-square {
  width: 26px; height: 26px; flex: none;
  background:
    linear-gradient(var(--pixelji-red),var(--pixelji-red)) 0 0/8px 8px no-repeat,
    linear-gradient(var(--pixelji-red),var(--pixelji-red)) 9px 9px/8px 8px no-repeat,
    linear-gradient(var(--pixelji-red),var(--pixelji-red)) 18px 0/8px 8px no-repeat,
    linear-gradient(var(--pixelji-red),var(--pixelji-red)) 0 18px/8px 8px no-repeat,
    linear-gradient(var(--pixelji-red),var(--pixelji-red)) 18px 18px/8px 8px no-repeat;
  box-shadow: 0 0 16px rgba(204,31,31,.5);
  transition: transform .4s var(--ease-out);
}
.pix-trigger:hover .pix-square { transform: rotate(90deg); }
.pix-trigger-label { opacity: .7; }

/* Sound toggle */
.sound-toggle {
  position: fixed; top: 26px; right: 28px; z-index: var(--z-ui);
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--glass); border: 1px solid var(--glass-bd);
  backdrop-filter: blur(8px); color: var(--pixel-white); font-size: 16px;
  display: grid; place-items: center;
}
.sound-toggle .sound-on { display: none; }
.sound-toggle[aria-pressed="true"] .sound-on { display: block; color: var(--pixelji-red); }
.sound-toggle[aria-pressed="true"] .sound-off { display: none; }

/* Chapter progress rail */
.chapter-rail {
  position: fixed; right: 26px; top: 50%; transform: translateY(-50%);
  z-index: var(--z-rail); display: flex; flex-direction: column; gap: 14px; align-items: center;
}
.rail-dot {
  position: relative; width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255,255,255,0.18); border: none; padding: 0;
  transition: transform .35s var(--ease-out), background .35s;
}
.rail-dot::after {
  content: attr(data-label); position: absolute; right: 20px; top: 50%; transform: translateY(-50%);
  white-space: nowrap; font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em;
  color: var(--matte-silver); opacity: 0; transition: opacity .25s; pointer-events: none;
}
.rail-dot:hover::after { opacity: 1; }
.rail-dot.is-active { background: var(--pixelji-red); transform: scale(1.9); box-shadow: 0 0 12px var(--ember-glow); }

/* Nav overlay */
.nav-overlay {
  position: fixed; inset: 0; z-index: var(--z-overlay);
  background: rgba(6,6,8,0.86); backdrop-filter: blur(16px);
  display: grid; grid-template-columns: 1fr 1fr; align-items: center;
  opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .5s var(--ease-out), visibility 0s .5s;
}
/* visibility flips instantly on OPEN (focusable at once) but waits for the
   opacity fade-out on CLOSE — and removes the closed overlay from the tab order */
.nav-overlay.is-open { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity .5s var(--ease-out), visibility 0s 0s; }
.nav-overlay[hidden] { display: grid; }
.nav-overlay-inner { padding: 0 clamp(28px, 8vw, 120px); }
.nav-overlay-eyebrow { font-family: var(--font-mono); font-size: 12px; color: var(--pixelji-red); letter-spacing: .2em; margin-bottom: 26px; }
.nav-list li { overflow: hidden; }
.nav-list a {
  display: flex; align-items: baseline; gap: 16px;
  font-family: var(--font-display); font-size: clamp(30px, 4vw, 56px); line-height: 1.12;
  color: var(--pixel-white); transition: color .25s, transform .35s var(--ease-out);
}
.nav-list a .nav-no { font-family: var(--font-mono); font-size: 13px; color: var(--matte-silver); }
.nav-list a:hover { color: var(--pixelji-red); transform: translateX(14px); }
.nav-list a.is-flagship .nav-star { color: var(--pixelji-red); }
.nav-overlay-meta { margin-top: 40px; display: flex; flex-direction: column; gap: 4px; font-family: var(--font-mono); font-size: 11px; color: var(--matte-silver); letter-spacing: .08em; }
.nav-overlay-preview { position: relative; height: 60vh; margin-right: clamp(28px,6vw,90px); border: 1px solid var(--glass-bd); border-radius: 14px; overflow: hidden; background: rgba(255,255,255,0.015); display: grid; place-items: center; font-family: var(--font-mono); color: var(--matte-silver); font-size: 12px; letter-spacing: .14em; text-align: center; }
.nav-overlay-close { position: absolute; top: 26px; right: 32px; background: none; border: none; color: var(--pixel-white); font-size: 34px; line-height: 1; }

/* Once in a Lifetime badge */
.oial-badge {
  position: fixed; right: 22px; bottom: 22px; z-index: var(--z-badge);
  display: flex; align-items: center; gap: 12px;
  padding: 11px 18px 11px 14px; border-radius: 100px;
  background: var(--glass); border: 1px solid var(--red-line);
  backdrop-filter: blur(10px);
  box-shadow: 0 0 0 0 rgba(204,31,31,0.5);
  animation: badgePulse 2.8s var(--ease-out) infinite;
  transition: opacity .4s var(--ease-out), transform .4s var(--ease-out), visibility .4s;
}
/* hide the persistent badge while the Contact / OIAL chapters are active
   (it overlaps the footer, social orbs & compare card, and is redundant there) */
.oial-badge.is-hidden { opacity: 0; visibility: hidden; transform: translateY(26px); pointer-events: none; }
@keyframes badgePulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(204,31,31,0.45); }
  50% { box-shadow: 0 0 0 10px rgba(204,31,31,0); }
}
.oial-badge-star { color: var(--pixelji-red); font-size: 15px; }
.oial-badge-text { display: flex; flex-direction: column; font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; line-height: 1.35; }
.oial-badge-text small { color: var(--matte-silver); font-size: 9.5px; letter-spacing: .06em; }

/* ════════════════════════════════════════════════════════════════
   CHAPTER LAYOUT FRAME
   ════════════════════════════════════════════════════════════════ */
.chapter {
  position: relative; z-index: var(--z-content);
  min-height: 100vh; width: 100%;
  display: flex; align-items: center;
  padding: clamp(90px, 12vh, 150px) clamp(24px, 6vw, 96px);
}
.chapter-grid { width: 100%; max-width: var(--maxw); margin: 0 auto; }
.chapter-grid--right { display: flex; justify-content: flex-end; }
.chapter-grid--right .chapter-head { text-align: right; margin-left: auto; }
.chapter-grid--right .pill-row, .chapter-grid--right .inline-ctas { justify-content: flex-end; }

.eyebrow { font-size: 12px; color: var(--pixelji-red); letter-spacing: .24em; margin-bottom: 18px; }
.chapter-title {
  font-family: var(--font-display);
  font-size: clamp(52px, 9vw, 150px); line-height: 0.92; letter-spacing: 0.01em;
  color: var(--pixel-white); text-transform: uppercase;
}
.chapter-sub { font-family: var(--font-accent); font-weight: 600; font-size: clamp(18px, 2.4vw, 30px); color: var(--pixelji-red); margin: 22px 0 14px; letter-spacing: .01em; }
.chapter-body { max-width: 540px; font-size: clamp(15px, 1.2vw, 18px); color: rgba(232,232,240,0.72); }
.chapter-head { max-width: 640px; }
.chapter-head--center { max-width: 760px; margin: 0 auto; text-align: center; }
.chapter-head--center .chapter-body { margin: 0 auto; }

/* Pills / tags */
.pill-row { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 28px; max-width: 600px; }
.pill { font-size: 11px; color: var(--pixelji-red); border: 1px solid var(--red-line); border-radius: 4px; padding: 6px 10px; letter-spacing: .08em; background: var(--red-soft); }
.card-tag { display: inline-block; font-size: 11px; color: var(--pixelji-red); letter-spacing: .14em; margin-bottom: 14px; }

/* Glass cards */
.service-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 44px; }
.glass-card {
  background: var(--glass); border: 1px solid var(--glass-bd); border-radius: 16px;
  padding: 28px 24px; backdrop-filter: blur(10px);
  transition: transform .4s var(--ease-out), border-color .3s, box-shadow .3s;
  transform-style: preserve-3d;
}
.glass-card:hover { border-color: var(--red-line); box-shadow: 0 24px 60px rgba(0,0,0,.45), 0 0 0 1px var(--red-line); }
.glass-card h3 { font-family: var(--font-accent); font-weight: 700; font-size: 21px; margin-bottom: 8px; }
.glass-card p { font-size: 14px; color: var(--matte-silver); }

/* ══ Buttons ══ */
.orb-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; padding: 16px 30px; margin-top: 14px; border-radius: 100px; background: var(--pixelji-red); color: var(--void-space); font-family: var(--font-synco); font-weight: 700; font-size: 13px; letter-spacing: .08em; overflow: hidden; isolation: isolate; transition: transform .3s var(--ease-out), box-shadow .3s; }
.orb-btn:hover { box-shadow: 0 0 34px rgba(255,59,31,.6); transform: translateY(-2px); }
.orb-btn-glow { position: absolute; inset: -40%; z-index: -1; background: radial-gradient(circle, rgba(255,59,31,.9), transparent 60%); opacity: .5; animation: orbSpin 6s linear infinite; }
@keyframes orbSpin { to { transform: rotate(360deg); } }
.orb-btn--wide { width: 100%; padding: 18px; }
.ghost-btn { display: inline-flex; align-items: center; padding: 16px 26px; margin-top: 14px; border: 1px solid var(--glass-bd); border-radius: 100px; font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; color: var(--pixel-white); background: rgba(255,255,255,0.02); transition: border-color .3s, background .3s; }
.ghost-btn:hover { border-color: var(--red-line); background: var(--red-soft); }

/* ════════════════════════════════════════════════════════════════
   CHAPTER 1 — HERO
   ════════════════════════════════════════════════════════════════ */
.chapter--hero { flex-direction: column; justify-content: center; text-align: center; }
.letterbox { position: fixed; left: 0; width: 100%; height: 9vh; background: var(--void-space); z-index: 5; pointer-events: none; transform: scaleY(0); transform-origin: center; }
.letterbox--top { top: 0; transform-origin: top; }
.letterbox--bottom { bottom: 0; transform-origin: bottom; }
.hero-inner { width: 100%; }
.hero-title { font-family: var(--font-display); line-height: 0.86; text-transform: uppercase; }
.hero-title .word { display: block; font-size: clamp(56px, 13vw, 200px); letter-spacing: 0.01em; }
.hero-title .word--accent { color: var(--pixelji-red); text-shadow: 0 0 50px rgba(204,31,31,.45); }
.hero-meta { position: absolute; left: clamp(24px,6vw,96px); bottom: clamp(28px, 6vh, 64px); text-align: left; font-size: 12px; color: var(--pixelji-red); line-height: 1.9; }
.hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-top: 38px; }
.scroll-indicator { position: absolute; right: clamp(20px, 4vw, 52px); bottom: 18vh; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.scroll-indicator-text { writing-mode: vertical-rl; font-family: var(--font-mono); font-size: 11px; letter-spacing: .22em; color: var(--matte-silver); }
.scroll-indicator-line { width: 1px; height: 60px; background: linear-gradient(var(--pixelji-red), transparent); animation: scrollPulse 2s var(--ease-out) infinite; }
@keyframes scrollPulse { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

/* ══ HUD overlays ══ */
.hud { position: absolute; top: clamp(86px, 12vh, 130px); left: clamp(24px,6vw,96px); font-size: 11px; color: var(--pixelji-red); line-height: 1.9; letter-spacing: .06em; z-index: 4; pointer-events: none; opacity: .8; }
.hud--right { left: auto; right: clamp(24px,6vw,96px); text-align: right; }
.drag-hint { font-size: 11px; color: var(--matte-silver); margin-top: 18px; letter-spacing: .12em; }

/* ════════════════════════════════════════════════════════════════
   CHAPTER 3 — ONCE IN A LIFETIME
   ════════════════════════════════════════════════════════════════ */
.oial-inner { width: 100%; max-width: var(--maxw); margin: 0 auto; }
.stat-bar { display: flex; gap: 36px; margin: 30px 0; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; }
.stat-num { font-family: var(--font-display); font-size: clamp(40px, 5vw, 72px); line-height: 1; color: var(--pixel-white); }
.stat-label { font-size: 11px; color: var(--matte-silver); letter-spacing: .12em; margin-top: 4px; }
.compare-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 54px; }
.compare-col { background: var(--glass); border: 1px solid var(--glass-bd); border-radius: 14px; padding: 26px 22px; backdrop-filter: blur(8px); }
.compare-col h4 { font-family: var(--font-accent); font-weight: 700; font-size: 19px; margin: 10px 0 6px; }
.compare-col .mono { font-size: 10.5px; color: var(--pixelji-red); letter-spacing: .14em; margin-bottom: 10px; }
.compare-col p:last-child { font-size: 14px; color: var(--matte-silver); }
.compare-col--hero { border-color: var(--red-line); background: linear-gradient(160deg, var(--red-soft), var(--glass)); box-shadow: 0 0 0 1px var(--red-line), 0 20px 50px rgba(0,0,0,.4); }
.compare-icon { display: inline-flex; }
.compare-icon .ci { width: 42px; height: 42px; stroke-linecap: round; stroke-linejoin: round; }
.ci.ci--dim { color: var(--matte-silver); stroke: var(--matte-silver); }              /* the "old way" — muted */
.ci.ci--hot { color: var(--ember-glow); stroke: var(--ember-glow); filter: drop-shadow(0 0 6px rgba(255,59,31,.45)); } /* the flagship — hot */
/* camera: aperture pulses (capturing) */
.ci-iris { transform-box: fill-box; transform-origin: center; animation: ciIris 2.8s ease-in-out infinite; }
@keyframes ciIris { 0%, 100% { transform: scale(1); opacity: 1; } 46% { transform: scale(0.5); opacity: 0.65; } }
/* clapper: the top claps shut then opens, looping */
.ci-clap-top { transform-box: fill-box; transform-origin: left bottom; animation: ciClap 3s ease-in-out infinite; }
@keyframes ciClap { 0%, 64%, 100% { transform: rotate(0deg); } 16% { transform: rotate(-26deg); } 38% { transform: rotate(0deg); } }
/* VR: a scan line sweeps across the goggles */
.ci-scan { transform-box: fill-box; transform-origin: center; animation: ciScan 2.4s ease-in-out infinite; }
@keyframes ciScan { 0% { transform: translateX(-13px); opacity: 0; } 22% { opacity: 1; } 78% { opacity: 1; } 100% { transform: translateX(13px); opacity: 0; } }

/* ════════════════════════════════════════════════════════════════
   CHAPTER 5 — ANIMATION (ticker)
   ════════════════════════════════════════════════════════════════ */
.chapter--anim { flex-direction: column; justify-content: center; }
.anim-inner { width: 100%; max-width: var(--maxw); margin: 0 auto; }
.chapter--anim .chapter-sub { color: var(--pixel-white); } /* red washed out over the particle storm */
.ticker { position: absolute; left: 0; bottom: 9vh; width: 100%; overflow: hidden; border-top: 1px solid var(--red-line); border-bottom: 1px solid var(--red-line); padding: 14px 0; background: rgba(6,6,8,0.4); }
.ticker-track { display: flex; white-space: nowrap; font-size: 14px; color: var(--pixelji-red); letter-spacing: .14em; will-change: transform; }

/* Inline CTAs */
.inline-ctas { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 26px; font-size: 11px; color: var(--matte-silver); letter-spacing: .1em; }
.inline-ctas span { color: var(--pixelji-red); }

/* ════════════════════════════════════════════════════════════════
   CHAPTER 7 — STUDIO
   ════════════════════════════════════════════════════════════════ */
.studio-inner { width: 100%; max-width: var(--maxw); margin: 0 auto; }
.timeline { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 18px; margin: 44px 0; }
.timeline-node { border-left: 1px solid var(--red-line); padding-left: 16px; }
.timeline-node .timeline-no { display: block; font-size: 12px; color: var(--pixelji-red); margin-bottom: 8px; }
.timeline-node b { font-family: var(--font-accent); font-weight: 700; font-size: 18px; display: block; letter-spacing: .04em; }
.timeline-node span:last-child { font-size: 13px; color: var(--matte-silver); }
.studio-facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin: 38px 0; }
.fact { text-align: center; padding: 22px 12px; border: 1px solid var(--glass-bd); border-radius: 12px; background: var(--glass); }
.fact-num { font-family: var(--font-display); font-size: clamp(40px, 5vw, 72px); line-height: 1; color: var(--pixelji-red); display: block; }
.fact-label { font-size: 10.5px; color: var(--matte-silver); letter-spacing: .1em; margin-top: 6px; display: block; }
.studio-story { max-width: 720px; font-size: clamp(15px, 1.3vw, 18px); color: rgba(232,232,240,0.78); }

/* ════════════════════════════════════════════════════════════════
   CHAPTER 8 — TEAM
   ════════════════════════════════════════════════════════════════ */
.team-inner { width: 100%; max-width: var(--maxw); margin: 0 auto; }
.team-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-top: 48px; }
.team-card { background: var(--glass); border: 1px solid var(--glass-bd); border-radius: 16px; padding: 26px 22px; backdrop-filter: blur(8px); transition: transform .4s var(--ease-out), border-color .3s; }
.team-card:hover { border-color: var(--red-line); transform: translateY(-6px); }
.team-avatar { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-display); font-size: 26px; color: var(--void-space); background: linear-gradient(135deg, var(--pixelji-red), var(--ember-glow)); margin-bottom: 16px; }
.team-name { font-family: var(--font-display); font-size: 27px; letter-spacing: .02em; line-height: 1; }
.team-role { font-family: var(--font-mono); font-size: 11px; color: var(--pixelji-red); letter-spacing: .08em; margin: 6px 0 10px; }
.team-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.team-tags span { font-family: var(--font-mono); font-size: 9.5px; color: var(--matte-silver); border: 1px solid var(--glass-bd); border-radius: 3px; padding: 3px 6px; }

/* ════════════════════════════════════════════════════════════════
   CHAPTER 9 — WORK
   ════════════════════════════════════════════════════════════════ */
.work-inner, .blog-inner, .contact-inner { width: 100%; max-width: var(--maxw); margin: 0 auto; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 36px 0 30px; }
.filter-btn { font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; color: var(--matte-silver); border: 1px solid var(--glass-bd); background: none; border-radius: 4px; padding: 8px 13px; transition: color .25s, border-color .25s, background .25s; }
.filter-btn.is-active, .filter-btn:hover { color: var(--pixelji-red); border-color: var(--red-line); background: var(--red-soft); }
.work-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.work-card { position: relative; aspect-ratio: 4/3; border-radius: 14px; overflow: hidden; border: 1px solid var(--glass-bd); cursor: none; transition: transform .4s var(--ease-out), border-color .3s, box-shadow .3s; transform-style: preserve-3d; }
.work-card:hover { border-color: var(--pixelji-red); box-shadow: 0 0 30px rgba(204,31,31,.3); }
.work-card-thumb { position: absolute; inset: 0; background-size: cover; background-position: center; transition: transform .5s var(--ease-out); }
.work-card:hover .work-card-thumb { transform: scale(1.08); }
.work-card-shade { position: absolute; inset: 0; background: linear-gradient(transparent 30%, rgba(6,6,8,.9)); }
.work-card-cat { position: absolute; top: 14px; left: 14px; font-family: var(--font-mono); font-size: 10px; color: var(--pixelji-red); letter-spacing: .1em; background: rgba(6,6,8,.6); padding: 4px 8px; border-radius: 4px; }
.work-card-name { position: absolute; left: 16px; bottom: 30px; right: 16px; font-family: var(--font-display); font-size: 28px; line-height: 1; }
.work-card-client { position: absolute; left: 16px; bottom: 14px; font-family: var(--font-mono); font-size: 10.5px; color: var(--matte-silver); }

/* ════════════════════════════════════════════════════════════════
   CHAPTER 10 — BLOG
   ════════════════════════════════════════════════════════════════ */
.blog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 44px; }
.blog-card { background: var(--glass); border: 1px solid var(--glass-bd); border-radius: 14px; padding: 26px 22px; backdrop-filter: blur(8px); transition: transform .4s var(--ease-out), border-color .3s; display: flex; flex-direction: column; gap: 12px; min-height: 220px; }
.blog-card:hover { border-color: var(--red-line); transform: translateY(-6px); box-shadow: 0 0 30px rgba(204,31,31,.18); }
.blog-cat { font-family: var(--font-mono); font-size: 10px; color: var(--pixelji-red); letter-spacing: .1em; }
.blog-title { font-family: var(--font-display); font-size: 28px; line-height: 1.02; }
.blog-excerpt { font-size: 14px; color: var(--matte-silver); flex: 1; }
.blog-readtime { font-family: var(--font-mono); font-size: 10px; color: var(--matte-silver); text-align: right; }

/* ════════════════════════════════════════════════════════════════
   CHAPTER 11 — CONTACT / PORTAL
   ════════════════════════════════════════════════════════════════ */
.chapter--contact { flex-direction: column; justify-content: center; }
.chapter--contact .contact-inner { position: relative; }
.chapter--contact .contact-inner::before {
  content: ''; position: absolute; inset: -80px -8vw; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse 92% 80% at center, rgba(6,6,8,0.84), rgba(6,6,8,0.56) 58%, rgba(6,6,8,0.2) 86%, transparent 100%);
}
.portal-form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: 680px; margin: 44px auto 0; width: 100%; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field--full { grid-column: 1 / -1; }
.field label { font-family: var(--font-mono); font-size: 11px; color: var(--pixel-white); letter-spacing: .1em; }
.field input, .field textarea {
  background: rgba(18,18,26,0.42);
  backdrop-filter: blur(14px) saturate(150%); -webkit-backdrop-filter: blur(14px) saturate(150%);
  border: 1px solid rgba(255,255,255,0.14); border-radius: 10px; padding: 13px 15px;
  color: var(--pixel-white); font-family: var(--font-body); font-size: 15px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 6px 22px rgba(0,0,0,0.3);
  transition: border-color .25s, background .25s, box-shadow .25s; resize: vertical;
}
.field input::placeholder, .field textarea::placeholder { color: rgba(232,232,240,0.5); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--pixelji-red); background: rgba(30,12,12,0.5); box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 0 0 3px rgba(204,31,31,0.18); }
.portal-form .orb-btn { grid-column: 1 / -1; }
.portal-success { grid-column: 1/-1; text-align: center; color: var(--pixelji-red); line-height: 2; font-size: 13px; }
.portal-error { grid-column: 1/-1; text-align: center; color: var(--ember-glow); line-height: 1.7; font-size: 12.5px; padding: 12px 14px; border: 1px solid var(--red-line); border-radius: 8px; background: rgba(204,31,31,0.09); }
.hp-field { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.contact-foot { display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap; max-width: var(--maxw); margin: 60px auto 0; width: 100%; }
.contact-details { font-size: 12px; color: var(--matte-silver); line-height: 1.9; font-style: normal; }
.contact-details a { color: var(--pixel-white); }
.contact-details a:hover { color: var(--pixelji-red); }
.social-orbs { display: flex; gap: 12px; align-items: flex-start; }
.social-orbs a { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-mono); font-size: 12px; border: 1px solid var(--glass-bd); color: var(--matte-silver); transition: all .3s var(--ease-out); }
.social-orbs a:hover { color: var(--void-space); background: var(--pixelji-red); border-color: var(--pixelji-red); box-shadow: 0 0 24px rgba(255,59,31,.6); transform: translateY(-4px); }
.universe-footer { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; max-width: var(--maxw); margin: 50px auto 0; width: 100%; padding-top: 24px; border-top: 1px solid var(--glass-bd); font-size: 11px; color: var(--matte-silver); letter-spacing: .1em; }

/* ════════════════════════════════════════════════════════════════
   DETAIL OVERLAY (work / blog)
   ════════════════════════════════════════════════════════════════ */
.detail-overlay { position: fixed; inset: 0; z-index: var(--z-overlay); background: rgba(6,6,8,0.94); backdrop-filter: blur(18px); overflow-y: auto; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .4s var(--ease-out), visibility 0s .4s; }
.detail-overlay.is-open { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity .4s var(--ease-out), visibility 0s 0s; }
.detail-overlay[hidden] { display: block; }
.detail-close { position: fixed; top: 26px; left: 28px; background: none; border: 1px solid var(--glass-bd); border-radius: 100px; padding: 10px 18px; color: var(--pixel-white); font-family: var(--font-mono); font-size: 12px; letter-spacing: .1em; z-index: 2; }
.detail-content { max-width: 900px; margin: 0 auto; padding: 120px 24px 90px; }
.detail-content h2 { font-family: var(--font-display); font-size: clamp(44px, 7vw, 96px); line-height: .95; margin-bottom: 18px; }
.detail-hero { aspect-ratio: 16/8; border-radius: 16px; background-size: cover; background-position: center; border: 1px solid var(--red-line); margin-bottom: 26px; }
.detail-stats { display: flex; flex-wrap: wrap; gap: 22px; margin-bottom: 24px; font-family: var(--font-mono); font-size: 12px; color: var(--matte-silver); }
.detail-stats b { color: var(--pixelji-red); display: block; margin-bottom: 3px; letter-spacing: .1em; }
.detail-content p { color: rgba(232,232,240,.75); font-size: 16px; margin-bottom: 16px; }

/* ════════════════════════════════════════════════════════════════
   TRANSITION FX OVERLAY
   ════════════════════════════════════════════════════════════════ */
.fx-overlay { position: fixed; inset: 0; z-index: var(--z-overlay); pointer-events: none; overflow: hidden; }
/* a single red "scanline" bar that sweeps across once on nav jumps */
.fx-pixels { position: absolute; top: 0; bottom: 0; left: 0; width: 100vw;
  transform: translateX(-100%); opacity: 0; mix-blend-mode: screen; will-change: transform, opacity;
  background: linear-gradient(90deg, transparent 0%, rgba(204,31,31,0) 68%, rgba(204,31,31,0.14) 86%, rgba(255,59,31,0.55) 98%, var(--ember-glow) 100%); }
.fx-iris { position: absolute; top: 50%; left: 50%; width: 46px; height: 46px; border-radius: 50%;
  border: 3px solid var(--pixelji-red); box-shadow: 0 0 50px var(--ember-glow), inset 0 0 30px var(--ember-glow);
  transform: translate(-50%, -50%) scale(0); opacity: 0; }

/* Reveal base */
.reveal { opacity: 0; transform: translateY(34px); transition: opacity .8s var(--ease-out), transform .8s var(--ease-out); }
.reveal.is-visible { opacity: 1; transform: none; }
.reveal:nth-child(2) { transition-delay: .06s; }
.reveal:nth-child(3) { transition-delay: .12s; }
.reveal:nth-child(4) { transition-delay: .18s; }

/* noscript */
.noscript { position: fixed; inset: 0; z-index: 999; background: var(--void-space); display: grid; place-content: center; text-align: center; gap: 14px; padding: 30px; }
.noscript h1 { font-family: var(--font-display); font-size: 64px; color: var(--pixelji-red); }

/* ════════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .service-cards, .compare-cols, .studio-facts, .team-grid, .work-grid, .blog-grid { grid-template-columns: repeat(2, 1fr); }
  .nav-overlay { grid-template-columns: 1fr; }
  .nav-overlay-preview { display: none; }
}
@media (max-width: 680px) {
  .chapter { padding: 100px 22px; }
  .chapter-grid--right { justify-content: flex-start; }
  .chapter-grid--right .chapter-head { text-align: left; margin-left: 0; }
  .chapter-grid--right .pill-row, .chapter-grid--right .inline-ctas { justify-content: flex-start; }
  .service-cards, .compare-cols, .studio-facts, .team-grid, .work-grid, .blog-grid, .portal-form { grid-template-columns: 1fr; }
  .hero-meta { font-size: 10px; }
  .hud { font-size: 10px; }
  .chapter-rail { right: 12px; gap: 11px; }
  .rail-dot::after { display: none; }
  .oial-badge-text small { display: none; }
  .scroll-indicator { display: none; }
  .stat-bar { gap: 22px; }
  .contact-foot { flex-direction: column; }
}

/* ══ Touch: drop the custom cursor, restore native ══ */
@media (hover: none) {
  .cursor { display: none; }
  body.custom-cursor, body.custom-cursor * { cursor: auto; }
  .grain { display: none; }
}

/* ══ Reduced motion ══ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .grain, .scroll-indicator-line { display: none; }
}

/* ════════════════════════════════════════════════════════════════
   BATCH D — responsive + contrast / a11y polish
   ════════════════════════════════════════════════════════════════ */

/* P2-9: brighter red for SMALL text (better contrast on the void) */
.eyebrow, .pill, .card-tag, .hero-meta, .hud, .work-card-cat, .blog-cat,
.timeline-no, .team-role, .compare-col .mono, .nav-overlay-eyebrow { color: var(--red-bright); }

/* P2-8: pills + inline CTAs readable, with hover affordance */
.pill { border-color: var(--red-line); transition: background .2s, border-color .2s, color .2s; }
.pill:hover { background: rgba(204,31,31,0.32); border-color: var(--pixelji-red); color: var(--pixel-white); }
.inline-ctas span { color: var(--red-bright); transition: color .2s; }
.inline-ctas span:hover { color: var(--pixel-white); }

/* P2-10: lift body text, more so on the busiest (animated/bright) chapters */
.chapter-body { color: rgba(232,232,240,0.82); }
.chapter--oial .chapter-body, .chapter--anim .chapter-body,
.chapter--contact .chapter-body, .chapter--vr .chapter-body { color: rgba(232,232,240,0.92); }

/* P2-13: visible keyboard focus (the custom cursor hides the pointer, so focus must read clearly) */
a:focus-visible, button:focus-visible, [tabindex]:focus-visible,
.work-card:focus-visible, .blog-card:focus-visible, .rail-dot:focus-visible, .filter-btn:focus-visible {
  outline: 2px solid var(--red-bright); outline-offset: 3px; border-radius: 4px;
}
.field input:focus-visible, .field textarea:focus-visible { outline: 2px solid var(--red-bright); outline-offset: 1px; }

/* ── Responsive ── */
/* P2-1 / P2-2 / P2-7 — tablet and down */
@media (max-width: 1024px) {
  .timeline { grid-template-columns: repeat(2, 1fr); }
  .portal-form { grid-template-columns: 1fr; }
  .scroll-indicator { display: none; }
  .compare-col--hero { grid-column: 1 / -1; }   /* hero card spans full width below the other two */
}
/* P2-3 / P2-4 / P2-6 — mobile */
@media (max-width: 680px) {
  .chapter { min-height: 100dvh; padding: 86px 20px; }
  .timeline { grid-template-columns: 1fr; }
  .hud { top: 68px; font-size: 9.5px; }
  .hud--right { right: 18px; left: auto; }
  .loader-readout { bottom: clamp(40px, 10vh, 72px); font-size: 11px; }
  .detail-content { padding: 80px 18px 60px; }
}
/* P2-3 — very short viewports (avoid empty 100vh scroll) */
@media (max-height: 600px) { .chapter { min-height: 92vh; } }
/* P2-5 — short landscape phones: declutter the fixed UI */
@media (max-height: 500px) and (orientation: landscape) {
  .sound-toggle { width: 34px; height: 34px; }
  .oial-badge { transform: scale(0.85); transform-origin: bottom right; }
  .scroll-indicator { display: none; }
}

/* ════════════════════════════════════════════════════════════════
   Text legibility over the animated canvas (black background preserved)
   ════════════════════════════════════════════════════════════════ */
/* A dark glow behind text — invisible on pure black, but lifts contrast over
   the vortex / bokeh / wireframes so red & white text always reads clearly.
   No background change: the loved black stays black. */
.chapter-title { text-shadow: 0 2px 24px rgba(0,0,0,0.55); }
.chapter-sub, .chapter-body, .eyebrow, .stat-num, .stat-label,
.compare-col h4, .compare-col p, .timeline-node b, .timeline-node span { text-shadow: 0 1px 11px rgba(0,0,0,0.62); }
.hero-meta, .hud, .drag-hint, .inline-ctas { text-shadow: 0 1px 8px rgba(0,0,0,0.72); }
/* brighter red for sub-headlines over the busiest chapters (they sit on the canvas) */
.chapter--contact .chapter-sub, .chapter--oial .chapter-sub, .chapter--vr .chapter-sub { color: var(--red-bright); }

/* mobile: cap the glass-input backdrop-blur (expensive on touch) — lean more opaque instead */
@media (hover: none), (max-width: 680px) {
  .field input, .field textarea {
    backdrop-filter: blur(6px) saturate(140%); -webkit-backdrop-filter: blur(6px) saturate(140%);
    background: rgba(14,14,20,0.72);
  }
}

/* ════════════════════════════════════════════════════════════════
   MOBILE REVISION PASS (2026-06-14)
   Scroll-jank, visibility, readability, safe-area & touch ergonomics.
   Appended last so these win on source order. env() insets resolve to
   0 on non-notched / desktop viewports → zero desktop regression. The
   loved black void and the DOM-over-canvas text model are untouched.
   ════════════════════════════════════════════════════════════════ */

/* — Safe-area insets on every viewport-edge-anchored fixed element
     (notch / home indicator / rounded corners, especially in landscape) — */
.pix-trigger      { top: max(26px, env(safe-area-inset-top)); left: max(28px, env(safe-area-inset-left)); }
.sound-toggle     { top: max(26px, env(safe-area-inset-top)); right: max(28px, env(safe-area-inset-right)); }
.nav-overlay-close{ top: max(26px, env(safe-area-inset-top)); right: max(32px, env(safe-area-inset-right)); }
.detail-close     { top: max(26px, env(safe-area-inset-top)); left: max(28px, env(safe-area-inset-left)); }
.chapter-rail     { right: max(26px, env(safe-area-inset-right)); }
.oial-badge       { right: max(22px, env(safe-area-inset-right)); bottom: max(22px, env(safe-area-inset-bottom)); }

/* — Secondary text that sits on the live canvas but lacked a contrast shadow — */
.glass-card p   { text-shadow: 0 1px 8px rgba(0,0,0,0.62); }
.team-tags span { color: rgba(232,232,240,0.9); text-shadow: 0 1px 6px rgba(0,0,0,0.5); }

/* — Touch devices: real tap targets, tactile press feedback, calmer ambient motion — */
@media (hover: none) {
  /* 8-10px visual dot preserved, but a 38px hit area (was 8px — far below the 44px min) */
  .rail-dot {
    width: 38px; height: 38px;
    background: radial-gradient(circle, rgba(255,255,255,0.30) 4px, transparent 5px) center / 100% 100% no-repeat;
  }
  .rail-dot.is-active {
    background: radial-gradient(circle, var(--pixelji-red) 5.5px, transparent 6.5px) center / 100% 100% no-repeat;
    transform: none; box-shadow: none; /* don't scale the 38px hit-area into neighbouring dots */
  }
  .filter-btn { padding: 15px 16px; } /* ~44px tall */
  /* press feedback (covers both <a class="orb-btn"> CTAs and <button>s) */
  .orb-btn:active, [data-magnetic]:active, .filter-btn:active, .social-orbs a:active { transform: scale(0.97); }
  /* stop the continuous box-shadow repaint of the badge pulse on touch (battery / CPU) */
  .oial-badge { animation: none; box-shadow: 0 0 0 0 rgba(204,31,31,0.45); }
}

/* — Mobile layout / readability — */
@media (max-width: 680px) {
  /* canvas tracks the dynamic viewport like the chapters do, so it no longer overshoots
     when the address bar collapses (the chapters already use 100dvh here) */
  #webgl { height: 100dvh; }

  .chapter {
    padding: 70px max(20px, env(safe-area-inset-right))
             max(50px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  }
  .chapter-rail { right: max(12px, env(safe-area-inset-right)); }
  .letterbox { height: 5vh; } /* 9vh bars ate too much of a short phone */

  /* headlines: lower the clamp floors so long lines don't overflow / clip the top of the hero */
  .chapter-title    { font-size: clamp(42px, 9vw, 150px); line-height: 1; }
  .hero-title       { line-height: 0.95; }
  .hero-title .word { font-size: clamp(46px, 12.5vw, 200px); }

  /* lift cramped 9.5-11px UI text to comfortable mobile sizes */
  .pill, .card-tag, .stat-label, .team-role { font-size: 12px; }
  .team-tags span        { font-size: 10.5px; }
  .compare-col .mono     { font-size: 11.5px; }
  .timeline-node .timeline-no { font-size: 13px; }

  /* HUD telemetry collided with the (now full-width, multi-line) headline on OIAL/VR with no room
     beside it on a narrow phone — it's purely decorative (aria-hidden), so drop it on mobile along
     with the drag hint (no drag-to-orbit affordance is needed on touch). */
  .hud, .drag-hint { display: none; }

  /* roomier contact social orbs + tighter compare cards on narrow phones */
  .social-orbs   { gap: 18px; }
  .social-orbs a { width: 50px; height: 50px; }
  .compare-col   { padding: 20px 16px; }
  .compare-col h4{ font-size: 17px; }

  /* detail overlay heading clears the (now safe-area'd) close button */
  .detail-content { padding: calc(100px + env(safe-area-inset-top)) 18px 60px; }
}

/* — Very short / landscape phones: the decorative letterbox bars only steal height, and the
     viewport-WIDTH-based title clamps (13vw / 9vw) blow up on a wide-but-short landscape phone
     (e.g. 812×375 → 105px words that overflow the 375px height). Constrain by height here and
     trim the big vertical chapter padding so content fits without overflow. — */
@media (max-height: 600px) {
  .letterbox { display: none; }
  .hero-title .word { font-size: clamp(40px, 9vh, 96px); }
  .chapter-title    { font-size: clamp(36px, 8vh, 90px); line-height: 1; }
  .chapter { padding-top: 64px; padding-bottom: 44px; }
  /* decorative bottom-left meta collides with the centred hero actions on a short landscape phone */
  .hero-meta { display: none; }
}
