/* BLACKOUT V7 — "One take". A single continuous film, scrubbed by scroll through one WebGL shader. */
@font-face { font-family: 'RHD'; src: url(fonts/red-hat-display.woff2) format('woff2'); font-weight: 300 900; font-display: swap; }
@font-face { font-family: 'JBM'; src: url(../shared/fonts/jetbrains-mono.woff2) format('woff2'); font-weight: 100 800; font-display: swap; }

:root {
  --bg: #050409; --ink: #f4f2fb; --dim: #a7a3b8; --vio: #ab9ff2; --vio-l: #c9c0ff; --vio-d: #8b7cf0;
  --line: rgba(201, 192, 255, .16); --pad: clamp(20px, 4.2vw, 64px); --nav: 64px;
  --ease: cubic-bezier(.2, .7, .1, 1);
}
* { box-sizing: border-box; }
html { background: var(--bg); }
html.lenis, html.lenis body { height: auto; }
body { margin: 0; color: var(--ink); background: var(--bg); font: 400 16px/1.55 'RHD', system-ui, sans-serif; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
p { margin: 0; }

#film { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; background: var(--bg) url(img/k0.webp) center / cover no-repeat; }
body.film-on #film { background-image: none; }
.veil { position: fixed; inset: 0; z-index: 1; pointer-events: none; background:
  linear-gradient(180deg, rgba(5,4,9,.72) 0, rgba(5,4,9,0) 22%, rgba(5,4,9,0) 62%, rgba(5,4,9,.78) 100%),
  radial-gradient(120% 90% at 50% 50%, rgba(5,4,9,0) 55%, rgba(5,4,9,.55) 100%); }

/* nav */
.nav { position: fixed; z-index: 20; top: 0; left: 0; right: 0; height: var(--nav); padding: 0 var(--pad); display: flex; align-items: center; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: .14em; font-size: 15px; }
.pw { width: 22px; height: 22px; fill: none; stroke: var(--vio-l); stroke-width: 2.6; stroke-linecap: round; filter: drop-shadow(0 0 6px rgba(171,159,242,.8)); }
.nav-state { margin-left: auto; font: 500 11px/1 'JBM', monospace; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); display: inline-flex; align-items: center; gap: 8px; }
.nav-state i { width: 6px; height: 6px; border-radius: 50%; background: var(--vio); box-shadow: 0 0 10px var(--vio); }
.btn { display: inline-flex; align-items: center; gap: 10px; height: 40px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line); font-weight: 700; font-size: 14px; letter-spacing: .01em; background: rgba(12,10,22,.45); backdrop-filter: blur(10px); transition: border-color .4s, transform .5s var(--ease), box-shadow .5s; }
.btn span { transition: transform .5s var(--ease); }
.btn:hover { border-color: rgba(201,192,255,.6); }
.btn:hover span { transform: translateX(4px); }
.btn-solid { height: 52px; padding: 0 26px; font-size: 16px; color: #120e22; border: 0; background: linear-gradient(135deg, var(--vio-l), var(--vio-d)); box-shadow: 0 10px 40px rgba(139,124,240,.45), inset 0 1px 0 rgba(255,255,255,.5); }
.btn-solid:hover { transform: translateY(-2px); box-shadow: 0 16px 56px rgba(139,124,240,.65), inset 0 1px 0 rgba(255,255,255,.6); }

/* progress rail + chapter index */
.rail { position: fixed; z-index: 15; left: var(--pad); right: var(--pad); bottom: 22px; height: 1px; background: var(--line); }
.rail i { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, var(--vio-d), var(--vio-l)); box-shadow: 0 0 12px var(--vio); }
.index { position: fixed; z-index: 15; left: var(--pad); right: var(--pad); bottom: 30px; margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); font: 500 10.5px/1 'JBM', monospace; letter-spacing: .14em; text-transform: uppercase; color: rgba(167,163,184,.45); }
.index li { transition: color .5s; }
.index li.on { color: var(--vio-l); }

/* film track */
.track { position: relative; height: 1040vh; z-index: 5; }
.stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.cap { position: absolute; z-index: 6; max-width: min(540px, 44vw); opacity: 0; visibility: hidden; pointer-events: none; }
.cap.on { visibility: visible; pointer-events: auto; }
.cap-left { left: var(--pad); bottom: clamp(70px, 13vh, 130px); }
.cap-right { right: var(--pad); bottom: clamp(70px, 13vh, 130px); }
.cap-hero { left: var(--pad); top: calc(var(--nav) + clamp(8px, 4vh, 44px)); max-width: min(560px, 33vw); }
.kicker { font: 500 11.5px/1 'JBM', monospace; letter-spacing: .16em; text-transform: uppercase; color: var(--vio-l); margin-bottom: 16px; }
h1, h2 { margin: 0; font-weight: 800; letter-spacing: -.035em; line-height: .96; text-wrap: balance; }
h1 { font-size: clamp(38px, 5vw, 84px); }
h1 .l1, h1 .l2 { display: block; }
h1 .l2 { color: rgba(244,242,251,.2); transition: color 1.2s var(--ease), text-shadow 1.2s; }
h1 .l2.lit { color: var(--vio-l); text-shadow: 0 0 60px rgba(171,159,242,.55); }
h2 { font-size: clamp(34px, 4.6vw, 72px); margin-bottom: 18px; }
h2 em, h1 em { font-style: normal; color: var(--vio-l); }
.cap p { color: #d9d5e8; font-size: clamp(15px, 1.25vw, 18px); max-width: 34em; text-shadow: 0 1px 24px rgba(5,4,9,.9); }
.cap .sub { margin-top: 20px; max-width: 31em; font-size: clamp(15px, 1.35vw, 19px); }
.cap .fine { margin-top: 14px; font-size: 12.5px; line-height: 1.5; color: var(--dim); padding-left: 12px; border-left: 1px solid var(--vio); }
.cta { margin-top: 26px; display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.hint { font: 500 11px/1 'JBM', monospace; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.w { display: inline-block; overflow: hidden; vertical-align: bottom; padding-bottom: .12em; margin-bottom: -.12em; }
.w > i { display: inline-block; font-style: normal; will-change: transform; }

/* the SMS */
.sms { margin-top: 18px; border: 1px solid var(--line); border-radius: 14px; background: rgba(10,8,20,.62); backdrop-filter: blur(14px); padding: 12px 14px 14px; max-width: 520px; }
.sms-top { display: flex; justify-content: space-between; font: 500 10.5px/1 'JBM', monospace; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); margin-bottom: 10px; }
.sms-top b { color: var(--vio-l); font-weight: 600; }
.sms-code { font: 500 12.5px/1.5 'JBM', monospace; color: var(--ink); word-break: break-all; min-height: 5.9em; }
.sms-code .new { color: #120e22; background: var(--vio-l); }

.chips { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { font: 500 11px/1 'JBM', monospace; letter-spacing: .04em; padding: 7px 10px; border-radius: 999px; border: 1px solid var(--line); color: #dcd8ea; background: rgba(10,8,20,.5); }
.chips .built { color: #120e22; background: var(--vio-l); border-color: transparent; text-transform: uppercase; letter-spacing: .1em; }
.chips.coming { margin-top: 8px; }
.chips.coming li { border-style: dashed; color: var(--dim); }
.chips .soon { color: var(--vio-l); border: 1px dashed var(--vio); text-transform: uppercase; letter-spacing: .1em; background: none; }

/* the close: the film's ring becomes the O of the wordmark */
.cap-final { left: 0; right: 0; top: 0; bottom: 0; max-width: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; text-align: center; padding: var(--nav) var(--pad) 70px; }
.mark { display: flex; align-items: center; justify-content: center; font-weight: 900; letter-spacing: .02em; line-height: 1; font-size: clamp(54px, 11.5vw, 190px); }
.mk-o { display: block; width: .76em; height: .76em; margin: 0 .05em; flex: none; }
.mk-l, .mk-r { display: inline-block; }
.final-line { font-size: clamp(16px, 1.6vw, 22px); color: #e6e2f3 !important; max-width: none !important; }
.cap-final .fine { border: 0; padding: 0; margin: 0; text-align: center; }

/* the plain route (2D fallback, reduced motion, no JS) */
.plain { display: none; }
body.plain-on #film, body.plain-on .rail, body.plain-on .index, body.plain-on .veil { display: none; }
body.plain-on .track { height: auto; }
body.plain-on .stage { position: static; height: auto; overflow: visible; display: flex; flex-direction: column; gap: 0; padding-top: var(--nav); }
body.plain-on .cap { position: relative; inset: auto; opacity: 1; visibility: visible; pointer-events: auto; max-width: 760px; margin: 0 auto; padding: 56px var(--pad); left: auto; right: auto; top: auto; bottom: auto; }
body.plain-on .cap-final { min-height: 60vh; }
body.plain-on .mk-o { border: .09em solid var(--vio-l); border-top-color: transparent; border-radius: 50%; box-shadow: 0 0 40px rgba(171,159,242,.5); }
body.plain-on h1 .l2 { color: var(--vio-l); }
body.plain-on .plain { display: block; position: absolute; inset: 0; z-index: -1; opacity: .34; overflow: hidden; }
body.plain-on .plain figure { margin: 0; }
body.plain-on .plain img { width: 100%; height: auto; min-height: 90vh; object-fit: cover; display: block; }
body.plain-on main { position: relative; }

.foot { position: relative; z-index: 6; background: linear-gradient(180deg, rgba(5,4,9,0), var(--bg) 30%); padding: 70px var(--pad) 46px; }
.foot-in { max-width: 1240px; margin: 0 auto; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 28px; align-items: start; }
.foot p { font-size: 12.5px; line-height: 1.6; color: var(--dim); max-width: 78em; }

@media (max-width: 820px) {
  :root { --nav: 56px; }
  .nav-state { display: none; }
  .nav .btn { margin-left: auto; height: 36px; padding: 0 14px; font-size: 13px; }
  .track { height: 820vh; }
  .cap, .cap-hero { max-width: none; left: var(--pad); right: var(--pad); }
  .cap-left, .cap-right { top: 57svh; bottom: auto; }
  .cap-code p:not(.fine) { font-size: 13.5px; }
  .cap-code .sms-code { min-height: 0; }
  .chips { margin-top: 10px; gap: 5px; }
  .cap-hero { top: 57svh; bottom: auto; }
  .cap-hero .kicker { margin-bottom: 10px; }
  .cap-hero .sub { margin-top: 12px; font-size: 14px; }
  .cap-hero .cta { margin-top: 16px; }
  h1 { font-size: clamp(32px, 9.4vw, 48px); }
  h2 { font-size: clamp(30px, 9vw, 44px); margin-bottom: 12px; }
  .cap p { font-size: 14.5px; line-height: 1.5; }
  .cap .fine { font-size: 11.5px; margin-top: 10px; }
  .sms { margin-top: 12px; padding: 10px 12px; }
  .sms-code { font-size: 10.5px; min-height: 6em; }
  .chips li { font-size: 10px; padding: 6px 8px; }
  .index { display: none; }
  .rail { bottom: 16px; }
  .hint { display: none; }
  .mark { font-size: 13.6vw; }
  .cap-final { justify-content: flex-start; padding-top: 30svh; }
  .foot-in { grid-template-columns: minmax(0, 1fr); }
  .veil { background: linear-gradient(180deg, rgba(5,4,9,.5) 0, rgba(5,4,9,0) 12%); }
  #film { background-size: auto 60%; background-position: 50% 12%; }
}
@media (max-height: 660px) and (min-width: 821px) {
  h1 { font-size: clamp(38px, 4.6vw, 66px); }
  h2 { font-size: clamp(32px, 4vw, 54px); margin-bottom: 12px; }
  .cap p { font-size: 15px; line-height: 1.48; }
  .cap-left, .cap-right { bottom: 58px; }
  .cap .fine { margin-top: 10px; font-size: 12px; }
  .sms { margin-top: 12px; }
  .sms-code { font-size: 11.5px; min-height: 5.4em; }
  .chips { margin-top: 10px; }
  .cap-final { gap: 14px; }
  .mark { font-size: clamp(54px, 10vw, 150px); }
}
