/* WRAITHERIX v4 — "Spectral Circuit" (brand/DESIGN.md) */
:root {
  --board: #0A1016; --board-2: #121A20; --plate: #1B252C; --trace: #2A3A42;
  --steel: #7DBABE; --steel-d: #40575B; --mist: #D9F5EC;
  --cyan: #6FD6E0; --cyan-s: #A6F1F4; --cyan-d: #2E8C96;
  --amber: #E4A957; --amber-d: #9C6B2C; --danger: #FF5C5C;
  --text: #E6F4F4; --muted: #8FA7AB; --dim: #7A9298; --on-cyan: #06161A;
  --display: 'Chakra Petch', 'Rajdhani', ui-sans-serif, system-ui, sans-serif;
  --sans: 'Inter Tight', 'Inter', ui-sans-serif, system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  --pad: clamp(20px, 4.45vw, 64px);
  --e-out: cubic-bezier(.16,1,.3,1); --e-inout: cubic-bezier(.65,0,.35,1);
  --glow: 0 0 2px var(--cyan-s), 0 0 22px rgba(111,214,224,.45);
  --chamfer: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  color-scheme: only dark;
}
* { box-sizing: border-box; }
html { background: var(--board); color: var(--text); -webkit-font-smoothing: antialiased; forced-color-adjust: none; }
body { margin: 0; font-family: var(--sans); font-size: 17px; line-height: 1.55; }
a { color: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 4px; }
.skip { position: fixed; left: 12px; top: -64px; z-index: 100; background: var(--cyan); color: var(--on-cyan); padding: 12px 16px; text-decoration: none; clip-path: var(--chamfer); }
.skip:focus { top: 12px; }

/* ---------- nav ---------- */
.nav { position: fixed; z-index: 50; top: 0; left: 0; right: 0; height: 72px; display: flex; align-items: center; justify-content: space-between; padding: 0 var(--pad); color: var(--text); background: linear-gradient(rgba(10,16,22,.85), rgba(10,16,22,0)); }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; text-decoration: none; font: 600 15px var(--display); letter-spacing: .22em; }
.brand img { width: 28px; height: auto; filter: drop-shadow(0 0 6px rgba(111,214,224,.6)); }
.nav-links { display: flex; align-items: center; gap: clamp(16px, 2vw, 30px); font: 500 13px var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.nav-links .nl { text-decoration: none; color: var(--muted); min-height: 44px; display: inline-flex; align-items: center; }
.nav-links .nl:hover { color: var(--cyan); }
.nav-cta { text-decoration: none; background: var(--cyan); color: var(--on-cyan); padding: 0 18px; height: 44px; display: inline-flex; align-items: center; font: 500 13px var(--mono); letter-spacing: .1em; text-transform: uppercase; clip-path: var(--chamfer); transition: background .2s, box-shadow .2s; }
.nav-cta:hover { background: var(--cyan-s); }
.burger { display: none; width: 44px; height: 44px; margin-right: -10px; border: 0; background: none; position: relative; cursor: pointer; color: var(--text); }
.burger span { position: absolute; left: 12px; right: 12px; height: 1.5px; background: currentColor; transition: transform .3s var(--e-out); }
.burger span:first-child { top: 18px; } .burger span:last-child { top: 25px; }
.burger[aria-expanded="true"] span:first-child { transform: translateY(3.5px) rotate(45deg); }
.burger[aria-expanded="true"] span:last-child { transform: translateY(-3.5px) rotate(-45deg); }
.mnav { position: fixed; z-index: 55; top: 64px; left: 12px; right: 12px; background: rgba(18,26,32,.97); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); padding: 10px; box-shadow: 0 0 0 1px var(--trace), 0 30px 60px -20px #000; display: flex; flex-direction: column; clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px); }
.mnav a { min-height: 48px; display: flex; align-items: center; padding: 0 14px; text-decoration: none; font: 500 14px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text); }
.mnav a:hover { color: var(--cyan); }
.mnav .nav-cta { justify-content: center; margin-top: 6px; color: var(--on-cyan); }
body.menu-open { overflow: hidden; }

.progress { position: fixed; z-index: 51; left: 0; right: 0; top: 0; height: 2px; display: none; }
.progress i { display: block; height: 100%; transform-origin: left; transform: scaleX(0); background: var(--cyan); box-shadow: var(--glow); }
.dots { position: fixed; z-index: 51; right: 18px; top: 50%; transform: translateY(-50%); list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.dots::before { content: ""; position: absolute; left: 13.5px; top: 14px; bottom: 14px; width: 1px; background: var(--trace); }
.dots button { width: 28px; height: 28px; border: 0; background: none; cursor: pointer; position: relative; }
.dots button::before { content: ""; position: absolute; left: 50%; top: 50%; width: 7px; height: 7px; margin: -3.5px; background: var(--board); box-shadow: inset 0 0 0 1px var(--steel-d); transform: rotate(45deg); transition: background .3s, box-shadow .3s; }
.dots button.is-on::before { background: var(--amber); box-shadow: 0 0 10px var(--amber); }
.dots button::after { content: attr(data-label); position: absolute; right: 34px; top: 50%; transform: translateY(-50%); white-space: nowrap; font: 500 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; padding: 5px 8px; background: var(--plate); color: var(--cyan); box-shadow: 0 0 0 1px var(--trace); opacity: 0; pointer-events: none; transition: opacity .2s; }
.dots button:hover::after, .dots button:focus-visible::after { opacity: 1; }

/* ---------- stage ---------- */
.stage { position: fixed; inset: 0; height: 100vh; height: 100svh; overflow: clip; z-index: 1; background: var(--board); }
.board { position: absolute; inset: 0; z-index: 0; background: url(/l/assets/v4/board.webp?v=2) center/cover no-repeat; opacity: .35; }
@media (max-width: 899px) { .board { background-image: url(/l/assets/v4/board-m.webp?v=2); } }
.scene { position: absolute; inset: 0; overflow: hidden; opacity: 0; visibility: hidden; pointer-events: none; z-index: 1; }
.scene.is-active { opacity: 1; visibility: visible; pointer-events: auto; }
.veil { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 40; pointer-events: none; }
.spacer { position: relative; z-index: 0; pointer-events: none; }

/* type */
.eyebrow { font: 500 13px var(--mono); letter-spacing: .14em; text-transform: uppercase; margin: 0 0 18px; color: var(--amber); display: flex; align-items: center; gap: 10px; }
.eyebrow::before { content: ""; width: 7px; height: 7px; background: var(--amber); box-shadow: 0 0 10px var(--amber); transform: rotate(45deg); flex: none; }
h1, h2 { font-family: var(--display); font-weight: 600; letter-spacing: -.01em; margin: 0; text-wrap: balance; color: var(--text); }
h1 { font-size: clamp(54px, 6.6vw, 108px); line-height: .94; }
h2 { font-size: clamp(42px, 5vw, 80px); line-height: .98; }
h1 em, h2 em { font-style: normal; color: var(--cyan); text-shadow: 0 0 28px rgba(111,214,224,.45); }
.sub { font-size: 20px; line-height: 1.5; max-width: 36ch; margin: 22px 0 0; color: var(--muted); }
.copy { position: absolute; z-index: 5; }
.ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.btn { display: inline-flex; align-items: center; gap: 10px; height: 54px; padding: 0 26px; text-decoration: none; font: 500 14px var(--mono); letter-spacing: .1em; text-transform: uppercase; clip-path: var(--chamfer); transition: background .2s, color .2s, box-shadow .2s, transform .3s var(--e-out); }
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--cyan); color: var(--on-cyan); }
.btn-primary:hover { background: var(--cyan-s); }
.btn-ghost { background: var(--plate); color: var(--text); box-shadow: inset 0 0 0 1px var(--steel-d); }
.btn-ghost:hover { box-shadow: inset 0 0 0 1px var(--cyan); color: var(--cyan); }
.micro { margin: 18px 0 0; font: 500 12px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.link { display: inline-flex; min-height: 44px; align-items: center; margin-top: 18px; color: var(--cyan); font: 500 13px var(--mono); letter-spacing: .08em; text-transform: uppercase; text-decoration: none; }
.link:hover { text-shadow: var(--glow); }

/* ---------- 0 hero ---------- */
.s-hero { background: var(--board); }
.hero-bg { position: absolute; inset: 0; will-change: transform, opacity; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; object-position: 70% 50%; display: block; }
.hero-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10,16,22,.96) 0%, rgba(10,16,22,.82) 30%, rgba(10,16,22,.15) 58%, rgba(10,16,22,0) 75%), linear-gradient(0deg, rgba(10,16,22,.7), transparent 30%); }
.hero-cv { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; }
.is-motion .hero-bg { clip-path: inset(0 0 100% 0); }
.hero-copy { left: var(--pad); top: 50%; transform: translateY(-46%); width: min(48%, 680px); }
.hero-copy h1 .ln { display: block; }
.scroll-hint { position: absolute; z-index: 5; left: var(--pad); bottom: 28px; margin: 0; font: 500 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); display: flex; gap: 10px; align-items: center; }
.scroll-hint span { width: 1px; height: 28px; background: var(--cyan); transform-origin: top; animation: hint 1.8s var(--e-inout) infinite; }
@keyframes hint { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }
.is-motion .hero-copy > * { opacity: 0; transform: translateY(18px); transition: opacity .6s var(--e-out), transform .6s var(--e-out); }
.is-motion .hero-copy.in > * { opacity: 1; transform: none; }
.hero-copy.in > :nth-child(2) { transition-delay: .09s; } .hero-copy.in > :nth-child(3) { transition-delay: .3s; } .hero-copy.in > :nth-child(4) { transition-delay: .5s; } .hero-copy.in > :nth-child(5) { transition-delay: .6s; }

/* ---------- 1 frames ---------- */
.s-frames { background: #05090C; }
.film-main { position: absolute; inset: 0; overflow: hidden; background: #05090C; }
.film-main img, .film-main canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.film-main img { object-fit: cover; will-change: transform, filter; transform-origin: 60% 45%; }
.shade-bottom { position: absolute; left: 0; right: 0; bottom: 0; height: 62%; background: linear-gradient(to top, rgba(5,9,12,.95), rgba(5,9,12,.6) 45%, transparent); }
.film-copy { left: var(--pad); bottom: 220px; width: min(46%, 640px); }
.filmstrip { position: absolute; left: var(--pad); right: var(--pad); bottom: 36px; z-index: 5; }
.film-meta { display: flex; justify-content: space-between; margin: 0 0 10px; font: 500 12px var(--mono); letter-spacing: .12em; color: var(--steel); text-transform: uppercase; }
.strip { position: relative; display: grid; grid-template-columns: repeat(12, 1fr); gap: 8px; height: 108px; }
.strip i { display: block; width: 100%; height: 100%; background: #0A1016 center/cover no-repeat; box-shadow: inset 0 0 0 1px var(--trace); opacity: .12; clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px); will-change: opacity, filter; }
.playhead { position: absolute; top: -6px; bottom: -6px; width: 2px; left: 0; background: var(--amber); box-shadow: 0 0 12px var(--amber); will-change: transform; }

/* ---------- 2 stream ---------- */
.s-stream { background: transparent; }
.stream-copy { left: var(--pad); top: 50%; transform: translateY(-50%); width: min(38%, 540px); }
.page { position: absolute; top: 90px; bottom: 90px; left: 46%; right: var(--pad); background: rgba(18,26,32,.72); box-shadow: inset 0 0 0 1px var(--trace); clip-path: polygon(16px 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%, 0 16px); overflow: hidden; }
.page::before { content: "STREAM · /v1/chat/completions"; position: absolute; left: 22px; top: 16px; font: 500 11px var(--mono); letter-spacing: .12em; color: var(--dim); }
.page-in { position: absolute; left: 28px; right: 28px; bottom: 150px; font: 400 clamp(20px, 1.8vw, 26px)/1.5 var(--sans); color: var(--text); will-change: transform; -webkit-mask: linear-gradient(transparent 0, #000 30%); mask: linear-gradient(transparent 0, #000 30%); }
.tok { transition: background-color .6s var(--e-out), color .6s; background-color: rgba(228,169,87,.32); color: #FFE7C2; }
.tok.old { background-color: transparent; color: var(--text); }
.cursor-blk { display: inline-block; width: 9px; height: 1.05em; background: var(--cyan); box-shadow: var(--glow); vertical-align: -.15em; margin-left: 2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.counter { position: absolute; right: calc(var(--pad) + 28px); bottom: 110px; z-index: 6; padding: 10px 0 0 24px; background: linear-gradient(90deg, transparent, rgba(18,26,32,.95) 24px); display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.counter-num { font: 500 clamp(34px, 3.6vw, 52px) var(--mono); font-variant-numeric: tabular-nums; min-width: 8ch; text-align: right; display: inline-flex; gap: 12px; align-items: baseline; color: var(--cyan); text-shadow: 0 0 18px rgba(111,214,224,.4); }
.counter-num .inf { color: var(--amber); text-shadow: 0 0 14px rgba(228,169,87,.5); }
.counter-label { font: 500 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.marquee { width: 220px; height: 2px; background: var(--trace); overflow: hidden; margin-top: 6px; }
.marquee i { display: block; width: 40%; height: 100%; background: var(--cyan); box-shadow: var(--glow); animation: mq 1.6s linear infinite; }
@keyframes mq { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
.note { font: 500 10px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); margin-top: 6px; }

/* ---------- 3 shift ---------- */
.s-shift { background: transparent; }
.shift-cv { position: absolute; inset: 0; width: 100%; height: 100%; }
.shift-copy { left: var(--pad); bottom: 64px; width: min(44%, 620px); }
.chips { position: absolute; z-index: 5; right: var(--pad); bottom: 64px; display: flex; gap: 8px; flex-wrap: wrap; }
.chips button { height: 44px; padding: 0 18px; border: 0; cursor: pointer; font: 500 12px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--steel); background: var(--plate); box-shadow: inset 0 0 0 1px var(--trace); clip-path: var(--chamfer); transition: background .2s, color .2s; }
.chips button:hover { color: var(--cyan); }
.chips button.is-on { background: var(--cyan); color: var(--on-cyan); box-shadow: none; }

/* ---------- 4 pulse ---------- */
.s-pulse { background: transparent; }
.pulse-cv { position: absolute; inset: 0; width: 100%; height: 100%; }
.pulse-copy { left: var(--pad); top: 96px; width: min(52%, 720px); }
.pulse-copy .sub { max-width: 46ch; }
.pulse-time { position: absolute; z-index: 5; left: 0; right: 0; bottom: 36px; text-align: center; margin: 0; font: 500 12px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--amber); }

/* ---------- 5 wisps ---------- */
.s-wisps { background: radial-gradient(60% 70% at 70% 50%, rgba(46,140,150,.18), transparent 70%); }
.wisps-cv { position: absolute; inset: 0; width: 100%; height: 100%; }
.wisps-copy { left: var(--pad); top: 50%; transform: translateY(-50%); width: min(40%, 560px); }
.receivers { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.rcv { position: absolute; display: flex; flex-direction: column; align-items: center; gap: 8px; font: 500 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--steel); transform: translate(-50%, -50%); transition: color .3s; }
.rcv svg { width: 48px; height: 48px; padding: 11px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: square; background: var(--plate); box-shadow: inset 0 0 0 1px var(--trace); clip-path: var(--chamfer); transition: box-shadow .3s; }
.rcv.hit { color: var(--cyan); }
.rcv.hit svg { box-shadow: inset 0 0 0 1px var(--cyan); }
.orb-label { position: absolute; transform: translate(-50%, 0); font: 500 11px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--amber); }

/* ---------- 6 key ---------- */
.s-key { background: transparent; }
.key-copy { left: var(--pad); top: 50%; transform: translateY(-50%); width: min(38%, 540px); }
.code-panel { position: absolute; top: 96px; right: var(--pad); bottom: 48px; width: min(52vw, 820px); background: rgba(10,16,22,.94); box-shadow: inset 0 0 0 1px var(--trace), 0 0 60px -10px rgba(111,214,224,.15); color: var(--text); padding: 18px clamp(20px, 2.6vw, 40px) 22px; display: flex; flex-direction: column; clip-path: polygon(18px 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%, 0 18px); }
.code-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 1px solid var(--trace); padding-bottom: 8px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs button, .copy-btn { min-height: 44px; padding: 0 14px; border: 0; background: none; cursor: pointer; font: 500 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { color: var(--cyan); box-shadow: inset 0 -2px 0 var(--cyan); }
.copy-btn { color: var(--cyan); background: var(--plate); clip-path: var(--chamfer); }
.code-pane { flex: 0 1 auto; overflow: auto; margin-top: 18px; }
.code { margin: 0; font: 400 clamp(13px, 1.05vw, 16px)/1.7 var(--mono); white-space: pre; color: var(--mist); }
.code .ch { opacity: 0; }
.code .ch.on { opacity: 1; }
.code .hl-url { color: var(--cyan); text-shadow: 0 0 0 transparent; transition: text-shadow .9s var(--e-out); }
.code .hl-url.on { text-shadow: 0 0 14px rgba(111,214,224,.8); }
.response { margin-top: auto; border-top: 1px solid var(--trace); padding-top: 14px; min-height: 120px; }
.resp-label { margin: 0 0 8px; font: 500 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--amber); }
.resp-text { margin: 0; font: 400 20px/1.5 var(--sans); color: var(--text); min-height: 3em; }
.code-foot { margin: 12px 0 0; font-size: 14px; color: var(--muted); }
.code-foot code { font-family: var(--mono); color: var(--amber); }
.code-foot a { color: var(--cyan); }

/* ---------- 7 final ---------- */
.s-final { background: radial-gradient(50% 60% at 50% 45%, rgba(46,140,150,.2), transparent 70%); }
.final-cv { position: absolute; inset: 0; width: 100%; height: 100%; }
.final-in { position: absolute; z-index: 5; left: 50%; top: 46%; transform: translate(-50%, -50%); width: min(92vw, 900px); text-align: center; }
.final-in .eyebrow { justify-content: center; }
.final-in .sub { margin-left: auto; margin-right: auto; }
.final-in .ctas { justify-content: center; }
.sum { list-style: none; padding: 0; margin: 30px auto 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; font: 500 12px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--steel); }
.sum li::before { content: "◆ "; color: var(--amber); font-size: 9px; vertical-align: 2px; }
.foot { position: absolute; z-index: 5; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 20px; padding: 14px var(--pad) 18px; border-top: 1px solid var(--trace); font-size: 13px; color: var(--dim); background: rgba(10,16,22,.85); }
.foot nav { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.foot a { text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; color: var(--muted); }
.foot a:hover { color: var(--cyan); }
.foot-code { font-family: 'JetBrains Mono', ui-monospace, monospace; letter-spacing: .1em; }
.legal { font-size: 12px; }

/* ---------- mobile ---------- */
@media (max-width: 899px) {
  h1 { font-size: 44px; line-height: .96; } h2 { font-size: 36px; line-height: 1; }
  .sub { font-size: 17px; margin-top: 14px; }
  .eyebrow { font-size: 11px; margin-bottom: 12px; }
  .nav { height: 64px; background: rgba(10,16,22,.88); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
  .nav-links .nl { display: none; } .burger { display: block; }
  .brand { font-size: 13px; letter-spacing: .16em; } .nav-cta { height: 40px; padding: 0 12px; font-size: 11px; white-space: nowrap; } .nav-links { gap: 10px; }
  .dots { display: none; } .progress { display: block; }
  .ctas { margin-top: 20px; }
  .btn { height: 52px; width: 100%; justify-content: center; }
  .hero-bg img { object-position: 50% 30%; height: 56%; }
  .hero-bg::after { background: linear-gradient(0deg, var(--board) 44%, rgba(10,16,22,.4) 62%, rgba(10,16,22,0) 80%); }
  .hero-copy { left: 20px; right: 20px; top: auto; bottom: 28px; transform: none; width: auto; }
  .micro { margin-top: 12px; }
  .scroll-hint { display: none; }
  /* mobile: the clip plays in a 16:9 "player" so the whole frame is visible */
  .film-main { top: 84px; left: 12px; right: 12px; bottom: auto; height: auto; aspect-ratio: 16 / 9; width: auto; clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px); box-shadow: inset 0 0 0 1px var(--trace); }
  .film-main::after { content: "● GENERATING · 4S CLIP"; position: absolute; left: 12px; top: 10px; font: 500 10px var(--mono); letter-spacing: .12em; color: var(--amber); text-shadow: 0 1px 6px #000; }
  .shade-bottom { display: none; }
  .film-copy { left: 20px; right: 20px; width: auto; top: calc(84px + (100vw - 24px) * 9 / 16 + 28px); bottom: auto; }
  .strip { grid-template-columns: repeat(12, 1fr); height: 34px; gap: 3px; }
  .filmstrip { left: 20px; right: 20px; top: calc(84px + (100vw - 24px) * 9 / 16 + 270px); bottom: auto; }
  .stream-copy { left: 20px; right: 20px; top: 84px; transform: none; width: auto; }
  .page { left: 20px; right: 20px; top: 300px; bottom: 120px; }
  .page-in { font-size: 17px; left: 18px; right: 18px; bottom: 22px; }
  .counter { right: 20px; bottom: 22px; padding: 0; background: none; } .counter-num { font-size: 30px; } .marquee { width: 160px; }
  .shift-copy { left: 20px; right: 20px; width: auto; bottom: 96px; }
  .chips { left: 20px; right: 20px; bottom: 28px; gap: 6px; } .chips button { padding: 0 11px; font-size: 11px; }
  .pulse-copy { left: 20px; right: 20px; width: auto; top: 84px; }
  .wisps-copy { left: 20px; right: 20px; width: auto; top: 84px; transform: none; }
  .wisps-copy .link { margin-top: 8px; }
  .key-copy { left: 20px; right: 20px; top: 80px; transform: none; width: auto; }
  .key-copy .ctas { display: none; }
  .code-panel { top: auto; left: 12px; right: 12px; bottom: 12px; height: 54svh; width: auto; padding: 10px 14px 14px; }
  .code { font-size: 12px; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; } .tabs button { padding: 0 10px; white-space: nowrap; font-size: 11px; } .copy-btn { padding: 0 10px; font-size: 11px; }
  .response { min-height: 72px; padding-top: 10px; } .resp-text { font-size: 16px; }
  .code-foot { font-size: 13px; margin-top: 8px; }
  .final-in { top: 44%; } .foot { font-size: 12px; padding: 8px 20px 10px; } .foot nav { gap: 0 14px; }
  .sum { gap: 6px 12px; font-size: 11px; }
}

/* ---------- static (reduced motion / ?static=1) ---------- */
.is-static .stage { position: static; height: auto; overflow: visible; }
.is-static .board { position: fixed; }
.is-static .scene { position: relative; inset: auto; min-height: 100svh; opacity: 1; visibility: visible; pointer-events: auto; }
.is-static .veil, .is-static .spacer, .is-static .scroll-hint, .is-static .hero-cv, .is-static .marquee, .is-static .cursor-blk, .is-static .progress { display: none; }
.is-static .hero-bg { opacity: 1; }
.is-static .code .ch { opacity: 1; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* language switch */
.lang-switch { display: inline-flex; align-items: stretch; height: 34px; box-shadow: inset 0 0 0 1px var(--trace); clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px); }
.lang-switch button { border: 0; background: transparent; color: var(--dim); font: 500 11.5px var(--mono); letter-spacing: .1em; padding: 0 10px; cursor: pointer; transition: color .2s, background .2s; }
.lang-switch button:hover { color: var(--text); }
.lang-switch button[aria-pressed="true"] { color: var(--on-cyan); background: var(--cyan); }
.lang-switch--m { margin-top: 10px; height: 46px; width: 100%; }
.lang-switch--m button { flex: 1; font-size: 13px; }
@media (max-width: 899px) { .nav-links > .lang-switch { display: none; } }
html[lang="ru"] h1, html[lang="ru"] h2 { hyphens: manual; overflow-wrap: break-word; }

/* mobile: layout driven by measured copy height (see mobileFit in i18n.js) */
@media (max-width: 899px) {
  .page { top: var(--page-top, 300px); }
  .s-stream .stream-copy .sub { font-size: 15px; line-height: 1.5; }
  .chips { bottom: 22px; }
  .shift-copy { bottom: var(--shift-bottom, 96px); }
  .final-in { top: auto; bottom: var(--final-bottom, 140px); transform: translateX(-50%); }
  .s-final .final-in .sub { font-size: 15px; }
}
@media (max-width: 899px) {
  .code-panel { height: auto; top: var(--code-top, auto); }
}
@media (max-width: 899px) and (max-height: 700px) {
  .s-final .sum { display: none; }
  .s-final .final-in .sub { margin-top: 10px; }
}
@media (max-width: 899px) and (max-height: 700px) {
  .key-copy .sub { display: none; }
  .stream-copy .sub, .pulse-copy .sub, .wisps-copy .sub { font-size: 14px; }
}
/* stream box label sits on its own opaque strip so scrolling text never runs under it */
.page::before { z-index: 3; left: 0; right: 0; top: 0; padding: 16px 22px 12px; background: linear-gradient(rgba(18,26,32,.98) 75%, rgba(18,26,32,0)); }
@media (max-width: 899px) { .page::before { padding: 12px 18px 10px; font-size: 10px; } .page-in { top: 40px; } }
@media (max-width: 899px) and (max-height: 700px) {
  .wisps-copy .link { display: none; }
  .wisps-copy .sub { margin-top: 8px; }
}
