/* Landing, redesign 19 Nov (ref 2,4). One continuous camera move over a fixed shader sky (js/sky.js):
   dusk peak -> cream fog where the wordmark parts around the peak -> grey cloud sea where four lights land (how it works)
   -> night globe (live chain numbers) -> canopy light (what is public) -> dawn fog (token, questions).
   The peak is the bill (three.js, js/bill3d.js), cut into shares that drift into the mist as you scroll.
   Type is small and wide-tracked; the scenery does the talking. */
#sky { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; background: var(--dusk); }
/* page layers sit above the sky; a negative z-index on the fixed WebGL canvas left an unpainted strip under the sticky hero */
main, .foot, .banner { position: relative; z-index: 1; }
html:not(.sky-on) .hero { background: linear-gradient(180deg, #151a26, #4c5466); }
html:not(.sky-on) .how { background: linear-gradient(180deg, #3a414e, #626a76); }
html:not(.sky-on) .live { background: #0c1018; }
html:not(.sky-on) .split-list { background: linear-gradient(160deg, #2e3a29, #7d8452); }
html:not(.sky-on) .ledger, html:not(.sky-on) .token, html:not(.sky-on) .faq, html:not(.sky-on) .foot { background: var(--bg); }

/* nav: tiny, sits over the scenery, follows the tone of the current scene */
.nav { position: fixed; left: 0; right: 0; top: var(--nav-top, 36px); z-index: 20; height: 64px; display: flex; justify-content: space-between; align-items: center; padding-inline: var(--gutter); color: var(--fg); transition: color .6s var(--ease); }
body[data-tone="dark"] .nav { color: var(--dusk-fg); }
.nav::before { content: ""; position: absolute; inset: 0 0 -18px; z-index: -1; opacity: 0; transition: opacity .5s var(--ease), background .6s;
  background: linear-gradient(rgba(233, 230, 223, .82) 60%, rgba(233, 230, 223, 0)); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  -webkit-mask-image: linear-gradient(#000 65%, transparent); mask-image: linear-gradient(#000 65%, transparent); }
body[data-tone="dark"] .nav::before { background: linear-gradient(rgba(20, 24, 34, .6) 60%, rgba(20, 24, 34, 0)); }
.scrolled .nav::before { opacity: 1; }
.brand { display: inline-flex; align-items: center; gap: 12px; font: 400 14px var(--display); letter-spacing: .32em; text-transform: uppercase; text-decoration: none; }
.brand svg { width: 24px; height: 24px; }
.nav nav { display: flex; align-items: center; gap: 28px; font: 400 11px var(--display); letter-spacing: .2em; text-transform: uppercase; }
.nav nav a:not(.btn) { text-decoration: none; opacity: .75; transition: opacity .2s; position: relative; }
.nav nav a:not(.btn):hover { opacity: 1; }
@media (max-width: 820px) { .nav nav a:not(.btn) { display: none; } }

section { position: relative; scroll-margin-top: 64px; }
.dark { color: var(--dusk-fg); }
.dark .fine, .dark .label { color: var(--dusk-mute); }
.dark .link { color: var(--dusk-fg); border-color: var(--dusk-line); }
.fine { color: var(--mute); font-size: 14px; line-height: 1.6; max-width: 62ch; }
h2 { font-size: clamp(24px, 3vw, 42px); letter-spacing: .16em; }

/* ---------- hero: pinned while the fog rolls in ---------- */
.hero { height: 250vh; --p: 0; }
.hero-pin { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; isolation: isolate; }
.stage { position: absolute; inset: 0; z-index: 0; }
#gl { width: 100%; height: 100%; opacity: 0; transition: opacity 1.4s var(--ease); }
.gl-on #gl { opacity: 1; }
.gl-on .fallback { display: none; }
.fallback { position: absolute; left: 50%; top: 52%; translate: -50% -50%; width: min(70vw, 760px); aspect-ratio: 3 / 1.3;
  background: linear-gradient(180deg, #e9e4dc, #6b7180); clip-path: polygon(0 100%, 22% 62%, 34% 70%, 50% 6%, 58% 30%, 66% 22%, 80% 58%, 100% 100%); opacity: .8; }
.fallback i { display: none; }

.tags { position: absolute; inset: 0; pointer-events: none; }
.tag { position: absolute; left: 0; top: 0; translate: -50% -100%; font: 400 10.5px/1.45 var(--mono); color: var(--dusk-fg); background: rgba(27, 33, 48, .5);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border: 1px solid var(--dusk-line); padding: 6px 10px 6px 24px; border-radius: 999px; white-space: nowrap; opacity: 0; transition: opacity .7s var(--ease); }
.tag::before { content: ""; position: absolute; left: 10px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border: 1px solid var(--glow); transform: rotate(45deg); }
.tag b { display: block; color: #fff; font-weight: 400; }
.tag::after { content: ""; position: absolute; left: 50%; top: 100%; width: 1px; height: 16px; background: linear-gradient(var(--dusk-line), transparent); }
.tag.on { opacity: 1; }

/* drifting cloud banks in front of the peak, thicker as you scroll */
.hero-pin::after { content: ""; position: absolute; inset: auto 0 0; height: 22vh; z-index: 1; pointer-events: none; opacity: clamp(0, calc((var(--p) - .6) * 3), 1); background: linear-gradient(transparent, rgba(236, 233, 227, .9)); }
.mist { position: absolute; inset: 0; z-index: 1; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); pointer-events: none; opacity: clamp(.18, calc(var(--p) * 1.8), .95); }
.mist i { position: absolute; width: 90vw; height: 34vh; border-radius: 50%; filter: blur(30px);
  background: radial-gradient(closest-side, rgba(244, 241, 235, .95), rgba(244, 241, 235, 0)); animation: bank 46s ease-in-out infinite alternate; }
.mist i:nth-child(1) { left: -30vw; bottom: 4vh; }
.mist i:nth-child(2) { right: -34vw; bottom: 16vh; animation-duration: 58s; animation-direction: alternate-reverse; }
.mist i:nth-child(3) { left: 10vw; bottom: -14vh; width: 110vw; height: 30vh; animation-duration: 66s; }
@keyframes bank { from { transform: translateX(-5vw); } to { transform: translateX(6vw); } }

.wordmark { position: absolute; z-index: 2; left: 0; right: 0; top: 50%; display: flex; justify-content: center; gap: calc(32vw + var(--p) * 10vw); pointer-events: none;
  font: 200 clamp(26px, 5.4vw, 88px)/1 var(--display); letter-spacing: .5em; text-transform: uppercase; color: rgba(35, 38, 45, .62);
  opacity: clamp(0, calc((var(--p) - .2) * 3.4), 1); }
.wordmark span:last-child { margin-right: -.5em; }
.mistline { position: absolute; z-index: 2; left: var(--gutter); bottom: 14vh; max-width: 46ch; pointer-events: none;
  font: 300 clamp(13px, 1.2vw, 16px)/1.9 var(--display); letter-spacing: .2em; text-transform: uppercase; color: var(--fg);
  opacity: clamp(0, calc((var(--p) - .5) * 4), 1); transform: translateY(calc((1 - var(--p)) * 30px)); }

.hero-copy { position: absolute; z-index: 3; left: var(--gutter); bottom: clamp(28px, 6vh, 64px); color: var(--dusk-fg); display: grid; gap: 26px; max-width: 600px;
  opacity: clamp(0, calc(1 - var(--p) * 4), 1); }
.past .hero-copy, .past .splitter { pointer-events: none; }
.hero h1 { font-size: clamp(34px, 5vw, 76px); font-weight: 200; letter-spacing: .2em; line-height: 1.12; }
.hero h1 .w { display: inline-block; }
.hero h1 .ev { font-weight: 400; }
.hero-side { display: grid; gap: 22px; justify-items: start; }
.lede { font-size: 16.5px; line-height: 1.65; color: rgba(236, 232, 224, .78); max-width: 44ch; }
.cta { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.cta .link { background: none; border-width: 0 0 1px; border-color: var(--dusk-line); color: var(--dusk-fg); cursor: pointer; font: 400 11.5px var(--display); letter-spacing: .2em; text-transform: uppercase; padding: 0 0 3px; }
.cta .link:hover { border-color: var(--dusk-fg); color: #fff; }

.splitter { position: absolute; z-index: 3; right: var(--gutter); bottom: clamp(28px, 6vh, 64px); color: var(--dusk-fg); display: grid; gap: 14px; width: 300px;
  padding: 18px 20px; border-radius: var(--r); background: rgba(27, 33, 48, .42); border: 1px solid var(--dusk-line); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  opacity: clamp(0, calc(1 - var(--p) * 4), 1); }
.splitter .label { color: var(--dusk-mute); }
.splitter p { font-size: 13.5px; color: var(--dusk-mute); }
.splitter p b { color: #fff; font: 300 22px var(--display); letter-spacing: .04em; }
.ppl { display: flex; justify-content: space-between; gap: 6px; }
.ppl button { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--dusk-line); background: transparent; color: var(--dusk-fg); font: 300 16px var(--display); cursor: pointer;
  transition: background .25s, color .25s, border-color .25s, transform .15s var(--ease); }
.ppl button:hover { border-color: var(--dusk-fg); }
.ppl button:active { transform: scale(.94); }
.ppl button[aria-checked="true"] { background: var(--dusk-fg); border-color: var(--dusk-fg); color: var(--dusk); }

@media (max-width: 860px) {
  .hero { height: 210vh; }
  .hero-pin { display: grid; grid-template-rows: 1fr auto auto; align-content: end; padding-bottom: 36px; }
  .hero-copy { position: relative; left: auto; bottom: auto; grid-row: 2; padding: 0 var(--gutter) 14px; gap: 16px; }
  .splitter { position: relative; right: auto; bottom: auto; grid-row: 3; width: auto; margin: 0 var(--gutter) 20px; padding: 14px 16px; gap: 10px; }
  .hero h1 { font-size: clamp(28px, 8.4vw, 44px); letter-spacing: .16em; }
  .lede { font-size: 15px; }
  .ppl button { width: 40px; height: 40px; }
  .wordmark { top: 40%; gap: calc(30vw + var(--p) * 8vw); }
  .mistline { bottom: 18vh; right: var(--gutter); }
}

/* ---------- scenes after the hero ---------- */
.ledger, .live, .split-list { min-height: 100vh; }
.ledger, .live, .split-list, .token { display: grid; align-items: center; padding-block: clamp(90px, 14vh, 160px); }
.token { padding-bottom: 20px; }
.ledger-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px 40px; align-items: end; margin-bottom: 44px; }
.ledger-head h2 { grid-column: 1; }
.ledger-lede { grid-column: 1; color: var(--mute); max-width: 52ch; }
.ledger-head .seg { grid-column: 2; grid-row: 1 / span 2; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 999px; padding: 4px; gap: 4px; background: rgba(255, 255, 255, .35); }
.seg button { border: 0; background: none; padding: 9px 16px; border-radius: 999px; cursor: pointer; font: 400 11px var(--display); letter-spacing: .18em; text-transform: uppercase; color: var(--mute); transition: background .25s, color .25s; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.ledger-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, .7fr); gap: clamp(24px, 5vw, 80px); align-items: center; }
.tape { padding: 22px 26px 18px; font: 13px/1.4 var(--mono); }
.tape-row { display: grid; grid-template-columns: 1fr 1fr 90px; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: center; }
.tape-row.head { color: var(--dim); font: 400 10.5px var(--display); letter-spacing: .2em; text-transform: uppercase; }
.tape-row .r { text-align: right; }
.tape-row .to { transition: color .5s var(--ease); }
.tape[data-view="usual"] .to { color: var(--bad); }
.tape[data-view="evenly"] .to { color: var(--acc); }
.tape-sum { display: flex; justify-content: space-between; gap: 12px; padding-top: 16px; font-weight: 500; flex-wrap: wrap; }
.ledger-notes { display: grid; gap: 18px; font-size: 17px; line-height: 1.6; }
@media (max-width: 860px) { .ledger-head { grid-template-columns: 1fr; } .ledger-head .seg { grid-column: 1; grid-row: auto; justify-self: start; } .ledger-grid { grid-template-columns: 1fr; } .tape { padding: 16px; } .tape-row { grid-template-columns: 1fr 1fr 62px; font-size: 11.5px; gap: 8px; } }

/* how: pinned horizontal track over the cloud sea */
.how { padding-block: clamp(70px, 10vh, 120px) 0; }
.how-pin { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; gap: 48px; overflow: hidden; padding-block: 40px; }
.how-top { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; }
.how-steps { list-style: none; display: flex; gap: 8px; margin: 0; padding: 0; font: 400 10.5px var(--display); letter-spacing: .2em; text-transform: uppercase; }
.how-steps li { padding: 7px 13px; border: 1px solid var(--dusk-line); border-radius: 999px; color: var(--dusk-mute); transition: background .4s, color .4s; }
.how-steps li.on { background: var(--dusk-fg); border-color: var(--dusk-fg); color: var(--dusk); }
.how-track { display: flex; gap: 24px; padding-inline: max(var(--gutter), calc((100vw - 1280px) / 2)); width: max-content; }
.frame { width: min(420px, 80vw); padding: 28px; display: grid; gap: 14px; align-content: start; min-height: 470px; border-radius: var(--r);
  background: rgba(22, 27, 38, .42); border: 1px solid var(--dusk-line); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.frame h3 { font-size: 17px; letter-spacing: .16em; line-height: 1.4; }
.frame > p { color: var(--dusk-mute); font-size: 15px; }
.fnum { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--dusk-line); display: grid; place-items: center; font: 200 18px var(--display); color: var(--dusk-fg); position: relative; }
.fnum::after { content: ""; position: absolute; inset: -1px; border-radius: 50%; border: 1px solid transparent; border-top-color: var(--glow); transform: rotate(40deg); }
.mini { margin-top: 6px; border-top: 1px solid var(--dusk-line); padding-top: 16px; display: grid; gap: 10px; font-size: 14px; }
.mini label { display: grid; grid-template-columns: 80px 1fr; align-items: center; gap: 10px; font: 400 10.5px var(--display); letter-spacing: .18em; text-transform: uppercase; color: var(--dusk-mute); }
.dark .field { background: rgba(255, 255, 255, .06); border-color: var(--dusk-line); color: var(--dusk-fg); }
.dark .field:focus { background: rgba(255, 255, 255, .1); border-color: var(--dusk-fg); box-shadow: none; }
.shares { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font: 13px var(--mono); max-height: 150px; overflow: auto; }
.shares li { display: flex; justify-content: space-between; border-bottom: 1px solid var(--dusk-line); padding: 4px 0; }
.links code { display: block; font: 12px var(--mono); background: rgba(255, 255, 255, .06); padding: 8px 10px; border-radius: var(--r); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.links span { font-size: 13px; color: var(--dusk-mute); }
.txs { list-style: none; margin: 6px 0 0; padding: 16px 0 0; counter-reset: t; }
.txs li { display: grid; gap: 2px; padding-left: 34px; position: relative; counter-increment: t; }
.txs li::before { content: counter(t); position: absolute; left: 0; top: 1px; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--dusk-line); font: 300 11px/20px var(--display); text-align: center; }
.txs span { color: var(--dusk-mute); font-size: 13.5px; }
.vault div { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; border-bottom: 1px solid var(--dusk-line); padding: 6px 0; font-size: 13px; }
.dark .pill.ok { color: #9fd8bd; border-color: rgba(159, 216, 189, .35); }
.dark .pill.open { color: #f0c98d; border-color: rgba(240, 201, 141, .35); }
@media (max-width: 899px) {
  .how-pin { min-height: 0; overflow: visible; }
  .how-track { flex-direction: column; width: auto; padding-inline: var(--gutter); }
  .frame { width: 100%; min-height: 0; }
}

/* live: the night globe */
.live-in { display: grid; gap: 40px; }
.live-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 760px; border-top: 1px solid var(--dusk-line); }
.live-grid > div { padding: 22px 22px 24px 0; display: grid; gap: 10px; border-bottom: 1px solid var(--dusk-line); min-width: 0; }
.live-grid > div:nth-child(odd) { border-right: 1px solid var(--dusk-line); }
.live-grid > div:nth-child(even) { padding-left: 22px; }
.live-grid b { font: 300 clamp(21px, 3.4vw, 46px)/1.1 var(--mono); letter-spacing: -.02em; overflow-wrap: anywhere; color: #fff; }
.live-grid a.mono { font: 400 clamp(15px, 1.4vw, 19px) var(--mono); overflow-wrap: anywhere; justify-self: start; }

/* public / private: canopy light */
.pp-in { display: grid; gap: 38px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; max-width: 980px; border-radius: var(--r); background: rgba(18, 26, 16, .38); border: 1px solid rgba(236, 232, 224, .2); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.cols > div { padding: 30px; }
.cols > div + div { border-left: 1px solid rgba(236, 232, 224, .2); }
.cols h3 { font-size: 15px; letter-spacing: .2em; margin-bottom: 18px; display: flex; align-items: center; gap: 12px; }
.cols h3::before { content: ""; width: 8px; height: 8px; border: 1px solid currentColor; transform: rotate(45deg); }
.cols > div + div h3::before { background: currentColor; }
.cols ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; font-size: 16.5px; }
.cols li { padding-left: 22px; position: relative; }
.cols li::before { content: ""; position: absolute; left: 0; top: .78em; width: 12px; height: 1px; background: currentColor; opacity: .6; }
.split-list .fine { color: rgba(240, 237, 230, .92); text-shadow: 0 1px 12px rgba(20, 28, 16, .7); }
@media (max-width: 760px) { .cols { grid-template-columns: 1fr; } .cols > div { padding: 22px; } .cols > div + div { border-left: 0; border-top: 1px solid rgba(236, 232, 224, .2); } }

/* token on dawn fog */
.token-in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 400px); gap: clamp(28px, 6vw, 96px); align-items: center; }
.token h2 { font-size: clamp(40px, 7vw, 108px); font-weight: 200; letter-spacing: .14em; margin-bottom: 22px; }
.token-in > div > p { font-size: 17px; max-width: 54ch; margin-bottom: 14px; }
.tk-card { background: var(--dusk); color: var(--dusk-fg); padding: 28px; display: grid; gap: 14px; border-radius: var(--r); box-shadow: 0 40px 80px -50px rgba(27, 33, 48, .8); }
.tk-card .label, .tk-card .fine { color: var(--dusk-mute); }
.tk-card b { font-size: 14px; overflow-wrap: anywhere; }
.tk-card .row { display: flex; gap: 10px; flex-wrap: wrap; }
.tk-card .btn.ghost { color: var(--dusk-fg); border-color: var(--dusk-line); }
@media (max-width: 860px) { .token-in { grid-template-columns: 1fr; } }

/* questions: two-column list */
.faq { padding-block: clamp(60px, 10vh, 120px) 80px; }
.faq-in { display: grid; gap: 40px; }
.qa { display: grid; grid-template-columns: 1fr 1fr; gap: 0 56px; margin: 0; }
.qa > div { padding: 22px 0; border-top: 1px solid var(--line-2); }
.qa dt { font: 400 13px/1.5 var(--display); letter-spacing: .14em; text-transform: uppercase; margin-bottom: 10px; }
.qa dd { margin: 0; color: var(--mute); }
@media (max-width: 760px) { .qa { grid-template-columns: 1fr; } }

.foot { padding-block: 34px 90px; }
.foot-in { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; border-top: 1px solid var(--line-2); padding-top: 30px; }
.foot nav { display: flex; gap: 26px; font: 400 11px var(--display); letter-spacing: .2em; text-transform: uppercase; }
.foot nav a { text-decoration: none; color: var(--mute); }
.foot nav a:hover { color: var(--fg); }

/* chapter indicator: a thin ring that fills with the page, the current scene's name beside it */
.chapter { position: fixed; z-index: 15; right: var(--gutter); bottom: 22px; display: flex; align-items: center; gap: 12px; flex-direction: row-reverse; color: var(--fg); pointer-events: none; transition: color .6s var(--ease); }
body[data-tone="dark"] .chapter { color: var(--dusk-fg); }
.chapter svg { width: 44px; height: 44px; transform: rotate(-90deg); }
.chapter circle { fill: none; stroke: currentColor; stroke-width: 1; }
.chapter .trk { opacity: .25; }
.chapter .bar { stroke-dasharray: 125.7; stroke-dashoffset: 125.7; }
.ch-n { position: absolute; right: 0; width: 44px; text-align: center; font: 300 11px var(--display); letter-spacing: .08em; }
.ch-name { font: 400 10px var(--display); letter-spacing: .24em; text-transform: uppercase; opacity: .8; }
.hero-zone .chapter { opacity: 0; }
@media (max-width: 860px) { .chapter { display: none; } .live-grid > div { padding-right: 12px; } .live-grid > div:nth-child(even) { padding-left: 12px; } }

/* custom cursor, fine pointers only */
.cursor { position: fixed; left: 0; top: 0; z-index: 90; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; border: 1px solid currentColor; color: var(--fg); pointer-events: none; display: none;
  transition: width .3s var(--ease), height .3s var(--ease), margin .3s var(--ease), color .4s; }
body[data-tone="dark"] .cursor { color: var(--dusk-fg); }
.cursor span { display: grid; place-items: center; height: 100%; font: 200 20px var(--display); opacity: 0; transition: opacity .2s; }
@media (pointer: fine) { .has-cursor .cursor { display: block; } }
.cursor.big { width: 40px; height: 40px; margin: -20px 0 0 -20px; }
.cursor.split { width: 52px; height: 52px; margin: -26px 0 0 -26px; }
.cursor.split span { opacity: 1; }
@media (max-width: 520px) { .tag { font-size: 9.5px; padding: 4px 8px 4px 20px; } .tag::before { left: 8px; } }
