/* BLACKOUT V6 — one continuous world. Geist + Geist Mono (OFL), self-hosted. */
@font-face { font-family: "Geist"; src: url("../fonts/geist.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("../fonts/geist-mono.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #06050a;
  --ink: #f4f2fc;
  --mute: rgba(232, 228, 255, .66);
  --dim: rgba(232, 228, 255, .42);
  --line: rgba(201, 192, 255, .16);
  --v1: #ab9ff2;
  --v2: #c9c0ff;
  --v3: #8b7cf0;
  --m: clamp(20px, 3.4vw, 56px);
  --nav: 72px;
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --out: cubic-bezier(.16, 1, .3, 1);
  --in: cubic-bezier(.7, 0, .84, 0);
  --io: cubic-bezier(.65, 0, .35, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); color: var(--ink); -webkit-text-size-adjust: 100%; scrollbar-width: thin; scrollbar-color: #2a2540 var(--bg); }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body { margin: 0; font: 400 16px/1.55 var(--sans); background: var(--bg); overflow-x: clip; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
h1, h2, p, ul, figure { margin: 0; padding: 0; }
ul { list-style: none; }
a { color: inherit; text-decoration: none; }
svg { display: block; }
::selection { background: var(--v3); color: #0b0916; }
:focus-visible { outline: 1px solid var(--v2); outline-offset: 4px; border-radius: 4px; }
.defs { position: absolute; }

/* ---------- the world ---------- */
#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; pointer-events: none; opacity: 0; transition: opacity .6s linear; }
html.gl #gl { opacity: 1; }
html.flat #gl { display: none; }
.ground { position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(60% 70% at 72% 44%, rgba(110, 92, 240, .20), transparent 70%),
    radial-gradient(80% 50% at 50% 108%, rgba(139, 124, 240, .16), transparent 70%),
    linear-gradient(180deg, #07060c 0%, #06050a 60%, #08071a 100%); }
html.gl .ground { display: none; }
main { position: relative; z-index: 2; }

/* ---------- type ---------- */
.h1 { font-weight: 300; font-size: clamp(44px, min(6.6vw, 14.4vh), 128px); line-height: .98; letter-spacing: -.045em; max-width: 9.4em; text-wrap: balance; }
.h2 { font-weight: 300; font-size: clamp(30px, min(3.8vw, 8vh), 62px); line-height: 1.04; letter-spacing: -.038em; text-wrap: balance; }
.p { color: var(--mute); font-size: clamp(15px, 1.25vw, 18px); line-height: 1.58; max-width: 40ch; letter-spacing: -.005em; }
.lede { color: var(--mute); font-size: clamp(16px, 1.42vw, 20px); line-height: 1.5; max-width: 37ch; letter-spacing: -.01em; }
.kick, .ch__k { font: 500 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); display: flex; align-items: center; gap: 12px; }
.ch__k em, .lk em { font-style: normal; color: var(--v1); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--v2); box-shadow: 0 0 12px var(--v3); }
.pill { display: inline-flex; align-items: center; height: 20px; padding: 0 9px; border: 1px solid rgba(201, 192, 255, .45); border-radius: 99px; font: 500 10px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--v2); font-style: normal; white-space: nowrap; }

/* lines that slide inside a mask */
.ln-mask { padding-bottom: .14em; margin-bottom: -.14em; }
html.motion .sp:not(.is-split) { visibility: hidden; }
html.motion .beat .ln { transform: translateY(112%); transition: transform .55s var(--in); will-change: transform; }
html.motion .beat.is-on .ln { transform: none; transition: transform 1.05s var(--out) calc(160ms + var(--i, 0) * 62ms); }
html.motion .beat.is-past .ln { transform: translateY(-112%); }
html.motion .beat .rise { clip-path: inset(0 0 100% 0); transform: translateY(18px); opacity: 0; transition: clip-path .5s var(--in), transform .5s var(--in), opacity .3s linear .2s; }
html.motion .beat.is-on .rise { clip-path: inset(-20px -20px -20px -20px); transform: none; opacity: 1; transition: clip-path 1s var(--out) .42s, transform 1s var(--out) .42s, opacity .4s linear .42s; }
html.motion .beat.is-past .rise { transform: translateY(-18px); clip-path: inset(100% 0 0 0); }
html.motion .beat { pointer-events: none; }
html.motion .beat.is-on { pointer-events: auto; }

/* ---------- nav ---------- */
.nav { position: fixed; z-index: 40; top: 0; left: 0; right: 0; height: var(--nav); padding: 0 var(--m); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; pointer-events: none; }
.nav > * { pointer-events: auto; }
.nav .btn { justify-self: end; }
.wm { display: inline-flex; align-items: center; gap: .04em; font: 600 15px/1 var(--sans); letter-spacing: .2em; justify-self: start; transform-origin: 0 50%; }
.wm .pw { width: 1.12em; height: 1.12em; margin: 0 .16em 0 -.02em; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; overflow: visible; }
.wm:hover .pw { stroke: var(--v2); }
.wm .pw path { transition: stroke .3s; }
.nav__links { display: flex; gap: clamp(18px, 2.4vw, 36px); transition: opacity .5s, transform .8s var(--out); }
html.is-loading .nav__links, html.is-loading .nav .btn { opacity: 0; transform: translateY(-8px); }
html.is-loading:not(.wm-set) .nav .wm { opacity: 0; }
.nav .btn { transition: opacity .5s .1s, transform .8s var(--out) .1s; }
.lk { position: relative; display: inline-flex; align-items: center; gap: 8px; font: 400 13px/1 var(--sans); letter-spacing: -.005em; color: var(--mute); padding: 8px 0; transition: color .3s; }
.lk em { font: 500 10px/1 var(--mono); letter-spacing: .1em; opacity: .9; }
.lk small { font: 500 9px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--v2); border: 1px solid rgba(201, 192, 255, .4); border-radius: 99px; padding: 3px 6px; }
.lk::after { content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: 100% 50%; transition: transform .5s var(--out); }
.lk:hover, .lk.is-here { color: var(--ink); }
.lk:hover::after, .lk.is-here::after { transform: scaleX(1); transform-origin: 0 50%; }
.lk svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; transition: transform .5s var(--out); }
.lk--down { font-size: 14px; color: var(--ink); }
.lk--down:hover svg { transform: translateY(3px); }

/* ---------- button ---------- */
.btn { --h: 50px; position: relative; display: inline-flex; align-items: center; gap: 12px; height: var(--h); padding: 0 8px 0 24px; border-radius: 99px; color: #0b0916; font: 500 15px/1 var(--sans); letter-spacing: -.01em; background: linear-gradient(120deg, #c9c0ff 0%, #8b7cf0 100%); overflow: hidden; isolation: isolate; box-shadow: 0 0 0 1px rgba(255, 255, 255, .22) inset, 0 12px 40px -12px rgba(139, 124, 240, .7); transition: box-shadow .5s var(--out), transform .5s var(--out); will-change: transform; }
.btn::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, .7) 50%, transparent 70%); transform: translateX(-110%); transition: transform .9s var(--out); }
.btn:hover::before { transform: translateX(110%); }
.btn:hover { box-shadow: 0 0 0 1px rgba(255, 255, 255, .4) inset, 0 16px 50px -10px rgba(139, 124, 240, .95); }
.btn:active { transform: scale(.975); }
.btn__a { position: relative; width: calc(var(--h) - 16px); height: calc(var(--h) - 16px); border-radius: 50%; background: #0b0916; overflow: hidden; flex: none; }
.btn__a svg { position: absolute; inset: 0; margin: auto; width: 14px; height: 14px; fill: none; stroke: var(--v2); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; transition: transform .6s var(--out); }
.btn__a svg:nth-child(2) { transform: translateX(-240%); }
.btn:hover .btn__a svg:nth-child(1) { transform: translateX(240%); }
.btn:hover .btn__a svg:nth-child(2) { transform: none; }
.btn--s { --h: 40px; font-size: 13.5px; padding-left: 18px; gap: 10px; }
.btn--s .btn__a svg { width: 12px; height: 12px; }

/* ---------- hero ---------- */
.hero.beat { position: relative; min-height: 100vh; min-height: 100svh; display: flex; align-items: center; padding: var(--nav) var(--m) 64px; }
.hero__in { display: grid; gap: clamp(16px, 3.2vh, 30px); justify-items: start; max-width: 56vw; margin-top: -1vh; }
.hero__cta { display: flex; align-items: center; gap: 28px; margin-top: clamp(2px, 1vh, 10px); }
.hero__meta { position: absolute; right: var(--m); bottom: 28px; font: 500 10.5px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }

/* ---------- chapters ---------- */
.ch { position: relative; height: 100vh; height: 100svh; overflow: clip; }
.ch__in { position: absolute; left: var(--m); top: clamp(108px, 21vh, 220px); width: min(41vw, 560px); display: grid; gap: clamp(16px, 3.4vh, 34px); }
.beats { display: grid; }
.beat { display: grid; gap: clamp(12px, 2.4vh, 22px); align-content: start; justify-items: start; }
html.motion .beats > .beat { grid-area: 1 / 1; }
.ch__k .pill { margin-left: 4px; }
.note .pill { margin-left: 6px; vertical-align: 1px; }
.ch::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(6, 5, 10, .86) 0%, rgba(6, 5, 10, .72) 26%, rgba(6, 5, 10, .3) 44%, transparent 60%); pointer-events: none; }
html.static .ch::before { display: none; }
.datum { display: grid; gap: 8px; font: 300 clamp(26px, 2.6vw, 40px)/1 var(--mono); letter-spacing: -.04em; color: var(--ink); font-variant-numeric: tabular-nums; padding-top: 14px; border-top: 1px solid var(--line); min-width: min(100%, 300px); }
.datum small, .code__h { font: 500 10.5px/1.2 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.limit { position: relative; max-width: 44ch; padding: 14px 0 0 0; border-top: 1px solid var(--line); font-size: clamp(14px, 1.1vw, 15.5px); line-height: 1.5; color: var(--mute); }
.limit b { display: block; font: 500 10.5px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--v2); margin-bottom: 9px; }
.note { font-size: 14px; color: var(--dim); padding-top: 12px; border-top: 1px solid var(--line); max-width: 44ch; }
.code { width: min(100%, 430px); padding-top: 12px; border-top: 1px solid var(--line); }
.code__h { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.code__h b { color: var(--v2); font-weight: 500; }
.code__b { font: 400 clamp(10.5px, .86vw, 12.5px)/1.7 var(--mono); letter-spacing: .04em; color: var(--v2); word-break: break-all; }
.code__b span { color: rgba(201, 192, 255, .2); transition: color .5s linear; }
.code__b span.on { color: var(--ink); }
.code__b span.on.old { color: var(--v1); }

/* ---------- labels on the sculpture ---------- */
#tags { position: fixed; inset: 0; z-index: 5; pointer-events: none; overflow: clip; }
.tag { position: absolute; left: 0; top: 0; padding: 0 0 0 16px; font: 400 10.5px/1.35 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--mute); white-space: nowrap; opacity: 0; visibility: hidden; will-change: transform, opacity; text-shadow: 0 0 12px var(--bg), 0 0 4px var(--bg); }
.tag b { display: block; font-weight: 500; color: var(--ink); }
.tag i { position: absolute; left: -4px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; border: 1px solid var(--v2); box-shadow: 0 0 10px var(--v3); }
html.flat #tags { display: none; }

/* ---------- ledger ---------- */
.ledger { position: relative; padding: clamp(110px, 22vh, 220px) var(--m) clamp(90px, 18vh, 180px); }
.ledger__h { display: grid; gap: 22px; margin-bottom: clamp(36px, 8vh, 80px); }
.ledger__h .h2 { max-width: 16em; }
.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(28px, 5vw, 88px); align-items: start; }
.col__h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 14px; font: 400 22px/1 var(--sans); letter-spacing: -.03em; }
.col__h small { font: 500 10.5px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.rows li { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) auto; gap: 6px 20px; align-items: center; padding: 15px 0 15px 18px; min-height: 56px; }
.rows li::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--line); transform-origin: 0 50%; }
.rows li::after { content: ""; position: absolute; left: 0; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--v2); box-shadow: 0 0 10px var(--v3); }
.col--next .rows li::after { background: none; border: 1px solid var(--v1); box-shadow: none; }
.rows b { font-weight: 400; font-size: clamp(14.5px, 1.2vw, 17px); letter-spacing: -.015em; line-height: 1.25; }
.rows span { font-size: 14px; line-height: 1.4; color: var(--dim); }
.col--next .rows b { color: var(--mute); }
html.motion .rows li { opacity: 0; transform: translateY(14px); transition: opacity .7s linear, transform 1s var(--out); }
html.motion .rows li::before { transform: scaleX(0); transition: transform 1.2s var(--out); }
html.motion .rows li.is-in { opacity: 1; transform: none; }
html.motion .rows li.is-in::before { transform: scaleX(1); }

/* ---------- close (the footer lives inside it, so the mark never has to move) ---------- */
.close { position: relative; height: 100vh; height: 100svh; overflow: clip; display: flex; flex-direction: column; justify-content: flex-end; }
.close__in { display: grid; justify-items: center; gap: clamp(16px, 3.4vh, 32px); text-align: center; padding: 0 var(--m) clamp(26px, 5.4vh, 60px); }
.h1--c { font-size: clamp(38px, min(5.4vw, 10.6vh), 100px); max-width: none; }
.close__cta { display: flex; align-items: center; gap: 22px; }
.close__n { font: 500 10.5px/1.3 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--dim); text-align: left; }

/* ---------- footer ---------- */
.foot { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px clamp(24px, 5vw, 80px); align-items: center; padding: 20px var(--m) 30px; border-top: 1px solid var(--line); }
.foot__n { font-size: 13px; line-height: 1.5; color: var(--dim); max-width: 78ch; }
.foot__l { display: flex; gap: 24px; }

/* ---------- hud ---------- */
.hud { position: fixed; z-index: 15; left: 0; right: 0; bottom: 0; pointer-events: none; }
.hud__c { position: absolute; left: var(--m); bottom: 26px; display: flex; align-items: baseline; gap: 8px; font: 500 10.5px/1.3 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); transition: opacity .5s; }
.hud__n, .hud__t { display: inline-block; overflow: hidden; height: 1.3em; }
.hud__n b, .hud__t b { display: block; font-weight: 500; color: var(--ink); }
.hud__t { margin-left: 10px; }
.hud__t b { color: var(--v2); }
.hud__line { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: rgba(201, 192, 255, .08); }
.hud__line i { position: absolute; inset: 0; background: linear-gradient(90deg, #8b7cf0, #c9c0ff 70%, #fff); transform: scaleX(0); transform-origin: 0 50%; will-change: transform; }
.hud__line u { position: absolute; bottom: 6px; width: 3px; height: 3px; margin-left: -1px; border-radius: 50%; background: rgba(201, 192, 255, .45); }
html.at-end .hud__c { opacity: 0; }

/* ---------- loader ---------- */
.loader { position: fixed; inset: 0; z-index: 30; background: var(--bg); display: grid; place-items: center; pointer-events: none; }
.loader__t { margin-top: 92px; display: flex; gap: 12px; font: 500 10.5px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--dim); font-variant-numeric: tabular-nums; }
.loader__t b { color: var(--v2); font-weight: 500; }
html:not(.js) .loader, html.static .loader { display: none; }

/* ---------- 2D route (no WebGL) ---------- */
.fig { display: none; }
html.flat .fig { display: block; position: absolute; right: 4vw; top: 50%; width: min(50vw, 720px); transform: translateY(-50%); filter: drop-shadow(0 0 22px rgba(139, 124, 240, .55)); }
html.flat .fig svg { width: 100%; height: auto; overflow: visible; }
html.flat .hero .fig { width: min(40vw, 580px); }
html.flat .fig--power { right: auto; left: 50%; top: 34%; width: min(34vh, 42vw); transform: translate(-50%, -50%); }
html.flat.motion .fig { transition: opacity .9s linear, transform 1.4s var(--out); }
html.flat.motion .ch:not(.is-live) .fig { opacity: 0; transform: translateY(-46%) scale(.96); }

/* static route: reduced motion. No pins, no smooth scroll, everything visible. */
html.static .ch { height: auto; padding: 14vh var(--m) 10vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 5vw; align-items: center; overflow: visible; }
html.static .ch__in { position: static; width: auto; }
html.static .beats { gap: 44px; }
html.static .fig { position: sticky; top: 22vh; right: auto; width: 100%; transform: none; align-self: start; }
html.static .hero .fig { position: absolute; right: 5vw; top: 50%; width: min(44vw, 620px); transform: translateY(-50%); }
html.static .close { height: auto; min-height: 100svh; padding-top: 16vh; align-items: stretch; }
html.static .fig--power { position: static; width: min(30vh, 40vw); transform: none; margin: 0 auto 6vh; }
html.static .hud__c { display: none; }

/* ---------- phones ---------- */
@media (max-width: 760px) {
  :root { --nav: 60px; }
  .nav { grid-template-columns: 1fr auto; }
  .nav__links { display: none; }
  .wm { font-size: 13.5px; }
  .h1 { font-size: clamp(40px, 13.2vw, 64px); }
  .h2 { font-size: clamp(28px, 7.8vw, 36px); }
  .hero.beat { align-items: flex-end; padding-bottom: 76px; }
  .hero__in { max-width: none; gap: 16px; }
  .hero__cta { gap: 20px; }
  .hero__meta { display: none; }
  .ch::before { background: linear-gradient(0deg, rgba(6, 5, 10, .86) 0%, rgba(6, 5, 10, .7) 42%, transparent 60%); }
  .ch__in { left: var(--m); right: var(--m); top: calc(var(--nav) + 6px); bottom: 50px; width: auto; display: flex; flex-direction: column; justify-content: space-between; }
  .beats { align-items: end; }
  .beat { gap: 11px; }
  .p { font-size: 15px; line-height: 1.48; max-width: none; }
  .limit, .note { font-size: 14px; line-height: 1.42; padding-top: 10px; }
  .limit b { margin-bottom: 6px; }
  .datum { font-size: 26px; padding-top: 10px; }
  .code__b { font-size: 10.5px; line-height: 1.55; }
  .code__h span:last-child { display: none; }
  .ledger { padding-top: 84px; padding-bottom: 56px; }
  .ledger__h { margin-bottom: 30px; }
  .cols { grid-template-columns: minmax(0, 1fr); gap: 34px; }
  .rows li { grid-template-columns: minmax(0, 1fr) auto; padding: 10px 0 10px 16px; min-height: 42px; }
  .rows span { display: none; }
  .col__h { font-size: 19px; }
  .close__in { padding-bottom: 22px; gap: 16px; }
  .h1--c { font-size: clamp(36px, 11.6vw, 56px); max-width: 7em; }
  .close__cta { flex-direction: column; gap: 14px; }
  .close__n { text-align: center; }
  .foot { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 16px var(--m) 26px; }
  .foot__n { font-size: 12px; line-height: 1.4; }
  .foot__l { flex-wrap: wrap; gap: 8px 20px; }
  .hud__c { bottom: 18px; }
  .tag { font-size: 9.5px; }
  html.flat .fig { right: auto; left: 7vw; top: 14vh; width: 86vw; transform: none; }
  html.flat.motion .ch:not(.is-live) .fig { transform: scale(.96); }
  html.flat .hero .fig { top: 12vh; }
  html.flat .fig--power { left: 50%; top: 30%; width: 52vw; transform: translate(-50%, -50%); }
  html.static .ch { grid-template-columns: minmax(0, 1fr); padding-top: 9vh; }
  html.static .fig, html.static .hero .fig { position: static; width: 100%; transform: none; }
  html.static .hero { flex-direction: column-reverse; justify-content: flex-end; gap: 4vh; padding-top: 14vh; }
  html.static .ch__in { display: grid; }
}
@media (max-height: 520px) and (min-width: 761px) {
  .ch__in { top: 92px; }
}
