/* ═══════════════════════════════════════════════════════════════
   SONY NZ — FEEL EVERYTHING · cinematic dark stage
   ═══════════════════════════════════════════════════════════════ */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../assets/fonts/Inter-100-900-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('../assets/fonts/JetBrainsMono-300-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../assets/fonts/JetBrainsMono-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../assets/fonts/JetBrainsMono-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+FEFF, U+FFFD;
}

:root {
  --black: #040407;
  --ink: #0a0a10;
  --panel: #0e0e16;
  --line: rgba(255, 255, 255, 0.09);
  --text: #e8e9f0;
  --dim: #8b8d9c;
  --blue: #4a8dff;
  --blue-hot: #7db4ff;
  --blue-glow: rgba(74, 141, 255, 0.55);
  --red: #ff4d5e;
  --display: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --rail-w: 64px;
  --ease-cine: cubic-bezier(0.16, 1, 0.3, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scrollbar-width: none; }
html, body { background: var(--black); }
body {
  font-family: var(--display);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
.scroll-space { height: 800vh; } /* document runway: 8 chapters × 100vh */
::-webkit-scrollbar { display: none; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }

.mono {
  font-family: var(--mono);
  font-weight: 400;
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
}
[hidden] { display: none !important; }

/* ── grain + vignette ─────────────────────────────────────────── */
.grain {
  position: fixed; inset: -60px; z-index: 40; pointer-events: none; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 0.9s steps(4) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 25% { transform: translate(-18px, 12px); }
  50% { transform: translate(14px, -16px); } 75% { transform: translate(-10px, -8px); }
  100% { transform: translate(0, 0); }
}
.vignette {
  position: fixed; inset: 0; z-index: 39; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 45%, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
}

/* ── chapter rail ─────────────────────────────────────────────── */
.rail {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--rail-w); z-index: 50;
  display: flex; flex-direction: column; align-items: center;
  padding: 22px 0; gap: 26px;
  border-right: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(4, 4, 7, 0.85), rgba(4, 4, 7, 0));
  backdrop-filter: blur(6px);
}
.rail__brand {
  font-weight: 700; font-size: 0.82rem; letter-spacing: 0.28em; writing-mode: vertical-rl;
  transform: rotate(180deg); color: var(--text);
}
.rail__brand span { color: var(--blue); }
.rail__list { list-style: none; display: flex; flex-direction: column; gap: 18px; flex: 1; justify-content: center; }
.rail__list a { display: flex; align-items: center; gap: 12px; position: relative; }
.rail__list i {
  display: block; width: 7px; height: 7px; border-radius: 50%;
  border: 1px solid var(--dim); transition: all 0.5s var(--ease-cine);
}
.rail__list a span {
  position: absolute; left: 22px; white-space: nowrap;
  font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--dim); opacity: 0; transform: translateX(-6px);
  transition: all 0.4s var(--ease-cine); pointer-events: none;
}
.rail__list a:hover span, .rail__list a.is-active span { opacity: 1; transform: translateX(0); }
.rail__list a.is-active i { background: var(--blue); border-color: var(--blue); box-shadow: 0 0 12px var(--blue-glow); }
.rail__list a.is-active span { color: var(--text); }
.rail__progress { width: 2px; height: 80px; background: var(--line); position: relative; }
.rail__progress b { position: absolute; top: 0; left: 0; right: 0; height: 0%; background: var(--blue); box-shadow: 0 0 8px var(--blue-glow); }

/* ── stage / track / chapters ───────────────────────────────────
   The stage is a fixed viewport; the PAGE scrolls vertically and
   natively (wheel, touch, keys, scrollbar — nothing is hijacked)
   while the track translates horizontally with scroll progress. */
.stage { position: fixed; inset: 0; overflow: hidden; outline: none; }
.track {
  display: flex; height: 100dvh;
  will-change: transform;
}
.chapter {
  position: relative; flex: 0 0 100vw; width: 100vw; height: 100dvh;
  overflow: hidden;
  display: flex; align-items: center;
  padding-left: var(--rail-w);
  background: var(--black);
}
.chapter__inner {
  position: relative; z-index: 2;
  width: 100%; max-width: 1500px; margin: 0 auto;
  padding: clamp(20px, 5vh, 60px) clamp(24px, 6vw, 110px);
}
.chapter__inner--split {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(28px, 5vw, 90px); align-items: center;
}
.chapter__inner--flip { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); }
.chapter__inner--tall { align-self: flex-start; padding-top: clamp(56px, 9vh, 110px); }
.chapter__inner--game { align-self: flex-start; padding-top: clamp(40px, 6vh, 70px); display: flex; flex-direction: column; gap: clamp(10px, 2vh, 22px); max-height: 100dvh; }
.chapter__index {
  position: absolute; right: clamp(16px, 3vw, 44px); bottom: clamp(14px, 3vh, 34px);
  z-index: 3; color: rgba(255, 255, 255, 0.28);
}

/* reveal choreography */
.chapter .eyebrow, .chapter .display, .chapter .lede, .chapter .specrow,
.chapter .sweep-target, .chapter .duel, .chapter .setup, .chapter .signal__cabinet {
  opacity: 0; transform: translateY(34px);
  transition: opacity 1.1s var(--ease-cine), transform 1.1s var(--ease-cine);
}
.chapter.is-live .eyebrow { opacity: 1; transform: none; transition-delay: 0.15s; }
.chapter.is-live .display { opacity: 1; transform: none; transition-delay: 0.3s; }
.chapter.is-live .lede { opacity: 1; transform: none; transition-delay: 0.45s; }
.chapter.is-live .specrow { opacity: 1; transform: none; transition-delay: 0.6s; }
.chapter.is-live .sweep-target { opacity: 1; transform: none; transition-delay: 0.35s; }
.chapter.is-live .duel, .chapter.is-live .setup, .chapter.is-live .signal__cabinet {
  opacity: 1; transform: none; transition-delay: 0.4s;
}
/* light sweep across revealed elements */
.sweep-target { position: relative; overflow: hidden; }
.sweep-target::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 30%, rgba(125, 180, 255, 0.16) 48%, rgba(255, 255, 255, 0.28) 50%, rgba(125, 180, 255, 0.16) 52%, transparent 70%);
  transform: translateX(-130%);
}
.chapter.is-live .sweep-target::after { animation: sweep 1.6s var(--ease-cine) 0.5s 1 forwards; }
@keyframes sweep { to { transform: translateX(130%); } }

/* ── shared type ──────────────────────────────────────────────── */
.eyebrow { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.32em; color: var(--blue); margin-bottom: clamp(14px, 2.4vh, 26px); }
.display {
  font-weight: 160; font-size: clamp(2.4rem, 5.6vw, 4.9rem);
  line-height: 1.02; letter-spacing: -0.015em; margin-bottom: clamp(16px, 3vh, 30px);
}
.display--center { text-align: center; }
.accent { color: var(--blue); text-shadow: 0 0 34px var(--blue-glow); font-style: normal; }
.lede { font-weight: 300; font-size: clamp(0.95rem, 1.25vw, 1.12rem); line-height: 1.75; color: #b9bbc8; max-width: 46ch; }
.lede--short { max-width: 60ch; }
.hint { margin-top: 18px; font-size: 0.58rem; opacity: 0.7; }

.specrow { display: flex; gap: clamp(20px, 3vw, 44px); margin-top: clamp(22px, 4vh, 40px); }
.specrow > div { display: flex; flex-direction: column; gap: 8px; }
.specrow b {
  font-family: var(--display); font-weight: 200; font-size: clamp(1.5rem, 2.4vw, 2.2rem);
  color: var(--text); letter-spacing: 0;
}
.specrow .u { font-size: 0.5em; color: var(--dim); font-weight: 300; margin-left: 2px; }
.specrow span { font-size: 0.58rem; }

.tag {
  position: absolute; left: 14px; bottom: 12px; color: var(--blue-hot);
  text-shadow: 0 1px 8px #000;
}

/* ── CH 00 · prologue ─────────────────────────────────────────── */
.chapter--prologue { justify-content: flex-start; }
.chapter--prologue .chapter__inner { position: static; }
.prologue__field { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; }
.prologue__title {
  font-weight: 140; font-size: clamp(3.4rem, 11vw, 10rem);
  line-height: 0.94; letter-spacing: -0.02em; margin: 2vh 0 4vh;
}
.prologue__title .line { display: block; overflow: hidden; }
.prologue__title .line em { display: block; font-style: normal; transform: translateY(110%); transition: transform 1.3s var(--ease-cine); }
.chapter.is-live .prologue__title .line em { transform: none; }
.chapter.is-live .prologue__title .line:nth-child(2) em { transition-delay: 0.14s; }
.chapter.is-live .prologue__title .line:nth-child(3) em { transition-delay: 0.28s; }
.line--indent { padding-left: clamp(40px, 9vw, 160px); }
.prologue__sub { font-weight: 300; color: var(--dim); line-height: 1.8; font-size: clamp(0.9rem, 1.15vw, 1.05rem); }
.prologue__cue {
  position: absolute; bottom: clamp(26px, 4vh, 46px); left: clamp(24px, 6vw, 110px);
  display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--dim);
}
.prologue__cue svg { animation: cuebob 2.2s ease-in-out infinite; }
@keyframes cuebob { 0%, 100% { transform: translateY(0); opacity: 0.5; } 50% { transform: translateY(9px); opacity: 1; } }

/* ── CH 01 · vision ───────────────────────────────────────────── */
.chapter--vision { background: radial-gradient(90% 100% at 75% 30%, #0b1024 0%, var(--black) 62%); }
.vision__demo { position: relative; display: flex; flex-direction: column; gap: 18px; }
.vision__screen {
  position: relative; border: 1px solid var(--line); border-radius: 6px; overflow: hidden;
  background: #000; box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7), 0 0 0 6px #0a0a0d, 0 0 60px rgba(74, 141, 255, 0.07);
}
.vision__screen canvas { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; }
.vision__scanner { position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; background: var(--blue-hot); box-shadow: 0 0 18px var(--blue-glow); pointer-events: none; }
.vision__scanner i { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 34px; height: 34px; border: 1px solid var(--blue-hot); border-radius: 50%; background: rgba(4, 4, 7, 0.6); backdrop-filter: blur(2px); }
.vision__range { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; }
.vision__caption { padding: 10px 14px; border-top: 1px solid var(--line); color: var(--blue-hot); }
.vision__product { position: relative; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); max-height: 220px; }
.vision__product img { width: 100%; height: 100%; object-fit: cover; filter: saturate(1.1); }
.xr-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 3px; margin-top: clamp(18px, 3vh, 30px); overflow: hidden; }
.xr-toggle__btn { font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.18em; padding: 11px 18px; color: var(--dim); transition: all 0.4s; }
.xr-toggle__btn.is-on { background: var(--blue); color: #04050c; }

/* ── CH 02 · sound ────────────────────────────────────────────── */
.chapter--sound { background: radial-gradient(90% 100% at 25% 70%, #120a18 0%, var(--black) 62%); }
.sound__demo { display: flex; flex-direction: column; gap: 18px; }
.sound__panel { position: relative; border: 1px solid var(--line); border-radius: 6px; background: var(--ink); overflow: hidden; box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7); }
.sound__panel canvas { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; }
.sound__hud { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-top: 1px solid var(--line); }
.sound__hud > span { color: var(--blue-hot); }
.anc-btn { display: inline-flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.2em; color: var(--text); border: 1px solid var(--line); border-radius: 999px; padding: 9px 16px; transition: all 0.4s; }
.anc-btn__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); transition: all 0.4s; }
.anc-btn[aria-pressed="true"] { border-color: var(--blue); box-shadow: 0 0 24px rgba(74, 141, 255, 0.25); }
.anc-btn[aria-pressed="true"] .anc-btn__dot { background: var(--blue); box-shadow: 0 0 10px var(--blue-glow); }
.sound__product { position: relative; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); max-height: 220px; background: var(--panel); }
.sound__product img { width: 100%; height: 100%; object-fit: cover; mix-blend-mode: multiply; filter: contrast(1.05); }

/* ── CH 03 · light ────────────────────────────────────────────── */
.chapter--light { background: radial-gradient(90% 100% at 70% 75%, #101322 0%, var(--black) 60%); }
.light__demo { display: flex; flex-direction: column; gap: 18px; }
.light__sensorwrap { border: 1px solid var(--line); border-radius: 6px; background: var(--ink); overflow: hidden; box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7); }
.light__sensorwrap canvas { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; }
.light__legend { display: flex; border-top: 1px solid var(--line); }
.light__legend button { flex: 1; padding: 12px 6px; font-size: 0.56rem; letter-spacing: 0.14em; color: var(--dim); border-right: 1px solid var(--line); transition: all 0.3s; }
.light__legend button:last-child { border-right: 0; }
.light__legend button.is-on { color: var(--blue-hot); background: rgba(74, 141, 255, 0.08); }
.light__product { position: relative; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); max-height: 200px; }
.light__product img { width: 100%; height: 100%; object-fit: cover; }

/* ── CH 04 · duel ─────────────────────────────────────────────── */
.chapter--duel { background: radial-gradient(80% 90% at 50% 0%, #0d0f1e 0%, var(--black) 60%); }
.chapter--duel .eyebrow, .chapter--setup .eyebrow { text-align: center; }
.duel { display: grid; grid-template-columns: 1fr auto 1fr; gap: clamp(12px, 3vw, 40px); align-items: center; max-width: 900px; margin: 0 auto; width: 100%; }
.duel__card {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px;
  border: 1px solid var(--line); border-radius: 8px; padding: clamp(14px, 2.5vh, 26px);
  background: var(--panel); transition: border-color 0.4s, box-shadow 0.4s, transform 0.4s var(--ease-cine);
  width: 100%;
}
.duel__card:hover { border-color: rgba(74, 141, 255, 0.5); transform: translateY(-3px); }
.duel__card img { width: 100%; height: clamp(90px, 16vh, 150px); object-fit: cover; border-radius: 4px; filter: saturate(1.05); }
.duel__card img.is-blend, .duel__pick img.is-blend { mix-blend-mode: multiply; }
.duel__pick img.is-blend { background: var(--panel); }
.duel__card .mono { color: var(--text); font-size: 0.72rem; }
.duel__change { font-size: 0.54rem; color: var(--blue); }
.duel__side.is-winner .duel__card { border-color: var(--blue); box-shadow: 0 0 44px rgba(74, 141, 255, 0.28); }
.duel__vs { font-size: 1rem; color: var(--red); letter-spacing: 0.3em; animation: vspulse 2.4s ease-in-out infinite; }
@keyframes vspulse { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; text-shadow: 0 0 18px rgba(255, 77, 94, 0.7); } }
.duel__picker {
  position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 18px;
  background: rgba(4, 4, 7, 0.9); backdrop-filter: blur(10px);
}
.duel__picker[hidden] { display: none; }
.duel__picker-head { display: flex; gap: 26px; align-items: center; color: var(--text); }
.duel__picker-head button { color: var(--dim); font-size: 1rem; }
.duel__picker-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 150px)); gap: 12px; padding: 0 20px; max-width: 720px; }
.duel__pick { border: 1px solid var(--line); border-radius: 6px; padding: 10px; display: flex; flex-direction: column; gap: 8px; transition: all 0.3s; background: var(--panel); }
.duel__pick:hover, .duel__pick:focus-visible { border-color: var(--blue); box-shadow: 0 0 20px rgba(74, 141, 255, 0.2); }
.duel__pick img { height: 74px; width: 100%; object-fit: cover; border-radius: 3px; }
.duel__pick span { font-family: var(--mono); font-size: 0.56rem; letter-spacing: 0.12em; color: var(--text); text-align: center; }
.duel__bars { max-width: 900px; margin: clamp(16px, 3vh, 30px) auto 0; width: 100%; display: flex; flex-direction: column; gap: clamp(8px, 1.6vh, 14px); }
.dbar { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; }
.dbar__label { font-family: var(--mono); font-size: 0.58rem; letter-spacing: 0.16em; color: var(--dim); text-transform: uppercase; text-align: center; min-width: 92px; }
.dbar__track { height: 8px; background: rgba(255, 255, 255, 0.05); border-radius: 999px; overflow: hidden; display: flex; }
.dbar__track--l { justify-content: flex-end; }
.dbar__fill { height: 100%; width: 0%; border-radius: 999px; transition: width 1.1s var(--ease-cine); }
.dbar__track--l .dbar__fill { background: linear-gradient(90deg, #1d3f7a, var(--blue)); }
.dbar__track--r .dbar__fill { background: linear-gradient(90deg, var(--red), #7a1d2b); }
.dbar__fill.is-max { box-shadow: 0 0 14px var(--blue-glow); }
.dbar__val { font-family: var(--mono); font-size: 0.6rem; color: var(--text); min-width: 44px; }
.dbar__val--l { text-align: right; }
.duel__verdict { text-align: center; margin-top: clamp(12px, 2.4vh, 22px); color: var(--blue-hot); min-height: 1.2em; }

/* ── CH 05 · setup ────────────────────────────────────────────── */
.chapter--setup { background: radial-gradient(80% 90% at 50% 100%, #0e1420 0%, var(--black) 62%); }
.setup { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(24px, 4vw, 70px); max-width: 1150px; margin: 0 auto; width: 100%; align-items: center; }
.setup__steps { display: flex; flex-direction: column; gap: clamp(12px, 2.2vh, 22px); }
.setup__step { border: 0; }
.setup__step legend { margin-bottom: 10px; color: var(--blue); }
.setup__opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.setup__opts button {
  display: flex; flex-direction: column; gap: 6px; align-items: flex-start;
  border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px;
  font-weight: 300; font-size: 0.8rem; letter-spacing: 0.02em; color: var(--text);
  background: var(--panel); transition: all 0.35s var(--ease-cine); text-align: left;
}
.setup__opts button .mono { font-size: 0.52rem; }
.setup__opts button:hover { border-color: rgba(74, 141, 255, 0.45); }
.setup__opts button.is-sel { border-color: var(--blue); background: rgba(74, 141, 255, 0.1); box-shadow: 0 0 24px rgba(74, 141, 255, 0.15); }
.setup__score { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.setup__dial { position: relative; width: clamp(180px, 24vh, 260px); }
.setup__dial canvas { width: 100%; height: auto; display: block; }
.setup__dial-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.setup__dial-text b { font-weight: 150; font-size: clamp(2.6rem, 6vh, 4rem); }
.setup__dial-text .mono { font-size: 0.52rem; text-align: center; line-height: 1.7; }
.setup__verdict { font-weight: 300; color: #b9bbc8; text-align: center; min-height: 2.6em; max-width: 30ch; font-size: 0.9rem; line-height: 1.6; }
.setup__cta {
  font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.2em;
  border: 1px solid var(--blue); color: var(--blue-hot); border-radius: 3px;
  padding: 13px 22px; transition: all 0.35s; opacity: 0.35;
}
.setup__cta:not(:disabled) { opacity: 1; }
.setup__cta:not(:disabled):hover { background: var(--blue); color: #04050c; box-shadow: 0 0 30px var(--blue-glow); }
.setup__cta:disabled { cursor: default; }

/* ── CH 06 · signal run ───────────────────────────────────────── */
.chapter--signal { background: radial-gradient(90% 100% at 50% 50%, #0a0d1c 0%, var(--black) 70%); }
.signal__head .display { margin-bottom: 8px; }
.signal__cabinet {
  position: relative; border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
  background: #02030a; box-shadow: 0 40px 110px rgba(0, 0, 0, 0.75), 0 0 70px rgba(74, 141, 255, 0.06);
  width: 100%; max-width: 1100px; margin: 0 auto;
}
.signal__cabinet canvas { display: block; width: 100%; height: auto; aspect-ratio: 21 / 9; touch-action: none; }
.signal__overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(2, 3, 10, 0.72); backdrop-filter: blur(4px); transition: opacity 0.6s; }
.signal__overlay.is-hidden { opacity: 0; pointer-events: none; }
.signal__menu, .signal__gameover { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 20px; }
.signal__title { color: var(--blue-hot); font-size: 0.8rem; letter-spacing: 0.4em; }
.signal__how { line-height: 2.2; font-size: 0.6rem; }
.signal__how b { color: var(--text); border: 1px solid var(--line); border-radius: 3px; padding: 2px 7px; }
.legend-orb, .legend-noise { display: inline-block; width: 9px; height: 9px; border-radius: 50%; vertical-align: baseline; }
.legend-orb { background: var(--blue); box-shadow: 0 0 8px var(--blue-glow); }
.legend-noise { background: var(--red); border-radius: 2px; }
.signal__start {
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.3em; color: #04050c;
  background: var(--blue); border-radius: 3px; padding: 14px 34px; transition: all 0.3s;
}
.signal__start:hover { background: var(--blue-hot); box-shadow: 0 0 34px var(--blue-glow); }
.signal__best { font-size: 0.58rem; }
.signal__final b { font-weight: 150; font-size: 3.4rem; display: block; }
.signal__hud {
  position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between;
  padding: 12px 18px; color: var(--dim); pointer-events: none;
  background: linear-gradient(180deg, rgba(2, 3, 10, 0.75), transparent);
}
.signal__hud b { color: var(--text); font-weight: 500; }
.signal__pad { position: absolute; right: 14px; bottom: 12px; display: none; grid-template-columns: repeat(3, 46px); grid-template-rows: repeat(2, 46px); gap: 6px; }
.signal__pad button {
  border: 1px solid var(--line); border-radius: 6px; background: rgba(14, 14, 22, 0.75);
  color: var(--blue-hot); font-size: 0.85rem; touch-action: none; user-select: none; -webkit-user-select: none;
}
.signal__pad button:active { background: rgba(74, 141, 255, 0.3); }
.signal__pad [data-dir="up"] { grid-column: 2; grid-row: 1; }
.signal__pad [data-dir="left"] { grid-column: 1; grid-row: 2; }
.signal__pad [data-dir="down"] { grid-column: 2; grid-row: 2; }
.signal__pad [data-dir="right"] { grid-column: 3; grid-row: 2; }
@media (pointer: coarse) { .signal__cabinet.is-playing .signal__pad { display: grid; } }

/* ── CH 07 · epilogue ─────────────────────────────────────────── */
.chapter--epilogue { background: radial-gradient(100% 100% at 50% 100%, #0c1122 0%, var(--black) 65%); }
.epilogue__title { font-weight: 160; font-size: clamp(2.2rem, 5vw, 4.4rem); line-height: 1.12; margin-bottom: clamp(26px, 5vh, 50px); }
.epilogue__links { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin-bottom: clamp(26px, 5vh, 50px); }
.epilogue__cta {
  font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.3em;
  background: var(--blue); color: #04050c; border-radius: 3px; padding: 18px 34px; transition: all 0.3s;
}
.epilogue__cta:hover { background: var(--blue-hot); box-shadow: 0 0 44px var(--blue-glow); }
.epilogue__link { border-bottom: 1px solid var(--line); padding-bottom: 6px; transition: all 0.3s; }
.epilogue__link:hover { color: var(--blue-hot); border-color: var(--blue); }
.epilogue__recap { display: flex; gap: 28px; flex-wrap: wrap; margin-bottom: clamp(30px, 7vh, 70px); }
.epilogue__recap span { border: 1px solid var(--line); border-radius: 999px; padding: 9px 18px; }
.epilogue__foot { display: flex; flex-direction: column; gap: 8px; opacity: 0.55; font-size: 0.56rem; line-height: 1.9; }

/* ── responsive ───────────────────────────────────────────────── */
@media (max-width: 1080px) {
  .chapter__inner--split, .chapter__inner--flip { grid-template-columns: 1fr; gap: 22px; align-content: center; }
  .chapter__inner--flip .chapter__copy { order: -1; }
  .vision__product, .sound__product, .light__product { display: none; }
  .setup { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  :root { --rail-w: 44px; }
  .rail { padding: 14px 0; gap: 16px; }
  .rail__brand { font-size: 0.62rem; }
  .rail__list { gap: 13px; }
  .rail__list a span { display: none; }
  .rail__progress { height: 54px; }
  .chapter__inner { padding: 18px 16px 18px 18px; }
  .chapter__inner--tall, .chapter__inner--game { padding-top: 34px; }
  .display { font-size: clamp(1.9rem, 8.4vw, 2.6rem); }
  .lede { font-size: 0.88rem; }
  .specrow { flex-wrap: wrap; gap: 16px; }
  .prologue__title { font-size: clamp(3rem, 15vw, 5rem); }
  .prologue__cue { left: 18px; bottom: 84px; }
  .chapter__index { display: none; }
  .setup__opts { grid-template-columns: 1fr; }
  .duel { grid-template-columns: 1fr; gap: 8px; }
  .duel__vs { text-align: center; }
  .dbar__label { min-width: 64px; font-size: 0.5rem; }
  .signal__cabinet canvas { aspect-ratio: 4 / 3; }
  .vision__screen canvas, .sound__panel canvas, .light__sensorwrap canvas { aspect-ratio: 4 / 3; }
}

@media (prefers-reduced-motion: reduce) {
  .grain { animation: none; }
  .prologue__cue svg, .duel__vs { animation: none; }
  .chapter .eyebrow, .chapter .display, .chapter .lede, .chapter .specrow,
  .chapter .sweep-target, .chapter .duel, .chapter .setup, .chapter .signal__cabinet,
  .prologue__title .line em { transition-duration: 0.01s; }
}
