/* Landing page only (index.html, body.landing). Motion classes come from js/motion.js:
   html.motion is set when motion is allowed; .in marks an element that has scrolled into view. */
:root { --ease: cubic-bezier(.16, 1, .3, 1); }

/* ---------- header: floats over the room, hides on the way down, returns on the way up */
body.landing header.top { position: fixed; top: 0; left: 0; right: 0; z-index: 50; border-bottom-color: transparent; transition: transform .7s var(--ease), background-color .5s, border-color .5s, opacity .8s; }
body.landing header.top .tokenbar { border-top-color: transparent; transition: border-color .5s; }
body.landing header.top.solid { background: rgba(11, 12, 11, .8); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom-color: var(--line); }
body.landing header.top.solid .tokenbar { border-top-color: var(--line); }
body.landing header.top.away { transform: translateY(-101%); }
body.landing .tokenbar:has(#burned[hidden]) { display: none; }   /* nothing to show until the burn total loads */
.motion body.landing:has(.intro.s-dark) header.top:not(:hover):not(:focus-within) { opacity: .45; }

/* ---------- the dark room */
.intro { position: relative; height: 270vh; }
.intro-stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; background: #070807; }
#room { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; }
.room-vignette { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse 75% 70% at 50% 58%, transparent 35%, rgba(4, 5, 4, .9) 100%); opacity: calc(1 - var(--ip, 0) * .55); }
.intro-stage::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 120px; pointer-events: none; background: linear-gradient(transparent, var(--bg)); opacity: var(--ip, 0); }

.whisper { position: absolute; left: 50%; top: 31%; transform: translate(-50%, 0); margin: 0; white-space: nowrap; font-size: 12px; letter-spacing: .26em; text-transform: uppercase; color: #7e837c; opacity: clamp(0, calc(1 - (var(--ip, 0) - .1) * 9), 1); pointer-events: none; }
.whisper .caret { font-style: normal; color: var(--accent); margin-left: 4px; animation: pulse 1s steps(2) infinite; }

.intro-copy { position: absolute; left: 0; right: 0; top: clamp(118px, 15vh, 168px); z-index: 2; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 22px; padding: 0 24px; pointer-events: none; }
.intro-copy a, .intro-copy button { pointer-events: auto; }
.intro h1 { margin: 0; max-width: 1000px; font-family: var(--serif); font-weight: 400; font-size: clamp(44px, min(6.2vw, 9.5vh), 96px); line-height: .96; letter-spacing: -.025em; text-wrap: balance; }
.intro h1 em { color: var(--accent); }
.intro h1 { filter: drop-shadow(0 0 26px rgba(143, 240, 212, .12)); }
.intro-more { position: relative; display: flex; flex-direction: column; align-items: center; gap: 22px; }
.intro-more::before { content: ""; position: absolute; inset: -50px -120px; z-index: -1; background: radial-gradient(closest-side, rgba(9, 10, 9, .82), rgba(9, 10, 9, .55) 55%, transparent); pointer-events: none; }
.intro-more p { margin: 0; max-width: 640px; font-size: 15px; color: #c9ccc4; }
.intro .ctas { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.intro .ctas .btn { min-height: 52px; padding: 0 28px; font-size: 14px; }
.intro .statusline { justify-content: center; }

.scrollhint { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 3; display: flex; flex-direction: column; align-items: center; gap: 10px; background: none; border: 0; padding: 8px 14px; color: var(--muted); font: inherit; font-size: 11px; letter-spacing: .24em; text-transform: uppercase; cursor: pointer; opacity: clamp(0, calc(1 - var(--ip, 0) * 14), 1); }
.scrollhint:hover { color: var(--accent); }
.scrollhint i { display: block; width: 1px; height: 46px; background: linear-gradient(var(--accent), transparent); transform-origin: top; animation: drip 2.4s var(--ease) infinite; }
.intro:not(.s-dark) .scrollhint { pointer-events: none; }
@keyframes drip { 0% { transform: scaleY(0); opacity: 1; } 55% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }

/* intro copy enters with the light */
.motion .intro .ic { opacity: 0; transform: translateY(18px); filter: blur(6px); transition: opacity 1s var(--ease), transform 1.2s var(--ease), filter 1s var(--ease); }
.motion .intro.s-title .eyebrow.ic,
.motion .intro.s-copy .intro-more .ic { opacity: 1; transform: none; filter: none; }
.motion .intro.s-copy .intro-more .ic:nth-child(2) { transition-delay: .1s; }
.motion .intro.s-copy .intro-more .ic:nth-child(3) { transition-delay: .2s; }
.motion .intro .intro-more::before { opacity: 0; transition: opacity 1.2s var(--ease); }
.motion .intro.s-copy .intro-more::before { opacity: 1; }

/* ---------- word-by-word headings */
.motion .split .w { display: inline-block; overflow: hidden; vertical-align: top; padding: 0 .08em .14em 0; margin: 0 -.08em -.14em 0; }
.motion .split .w > span { display: inline-block; transform: translateY(110%) rotate(4deg); transform-origin: 0 100%; transition: transform 1.2s var(--ease); transition-delay: calc(var(--i, 0) * 55ms); }
.motion .split.in .w > span,
.motion .intro.s-title h1 .w > span { transform: none; }
.motion .intro h1 .w > span { transition-delay: calc(var(--i, 0) * 90ms); }

/* ---------- reveals */
.motion [data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity 1s var(--ease), transform 1.2s var(--ease); }
.motion [data-reveal].in { opacity: 1; transform: none; }
.motion .st { opacity: 0; transform: translateY(22px); transition: opacity .9s var(--ease), transform 1.1s var(--ease); transition-delay: calc(var(--i, 0) * 45ms); }
.motion [data-stagger].in .st { opacity: 1; transform: none; }

/* ---------- sections: an echo line draws out from the centre, a ring pings once */
body.landing section.block { position: relative; border-top: 0; }
body.landing section.block::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--line2) 18%, rgba(143, 240, 212, .75) 50%, var(--line2) 82%, transparent); }
body.landing section.block::after { content: ""; position: absolute; top: -4px; left: 50%; width: 9px; height: 9px; margin-left: -4.5px; border-radius: 50%; border: 1px solid var(--accent); background: var(--bg); }
.motion body.landing section.block::before { transform: scaleX(0); transition: transform 1.8s var(--ease); }
.motion body.landing section.block.in::before { transform: scaleX(1); }
.motion body.landing section.block::after { opacity: 0; transform: scale(.2); transition: opacity .6s, transform .9s var(--ease); }
.motion body.landing section.block.in::after { opacity: 1; transform: none; animation: ping 2.6s var(--ease) .25s 1 both; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(143, 240, 212, .55); } 100% { box-shadow: 0 0 0 46px rgba(143, 240, 212, 0); } }

/* live echoes band */
body.landing .echoes { position: relative; }
.motion body.landing .echoes { opacity: 0; transition: opacity 1.2s var(--ease); }
.motion body.landing .echoes.in { opacity: 1; }

/* ---------- light that follows the pointer */
body.landing .cell { background: radial-gradient(420px circle at var(--mx, -999px) var(--my, -999px), rgba(143, 240, 212, .075), transparent 45%), var(--bg); }
body.landing .x4live, body.landing .floorbox { background-image: radial-gradient(520px circle at var(--mx, -999px) var(--my, -999px), rgba(143, 240, 212, .05), transparent 45%); }

/* the floor rises and settles as it comes into view */
.motion body.landing .floorbox { transform-origin: 50% 0; transform: perspective(1400px) translateY(calc((1 - var(--p, 1)) * 90px)) rotateX(calc((1 - var(--p, 1)) * 16deg)) scale(calc(.92 + var(--p, 1) * .08)); opacity: calc(.2 + var(--p, 1) * .8); }

/* profit split: the bar fills, the numbers count */
.motion body.landing #split .splitbar { clip-path: inset(0 100% 0 0); transition: clip-path 1.8s var(--ease) .25s; }
.motion body.landing #split.in .splitbar { clip-path: inset(0 0 0 0); }

/* ---------- the loop, animated */
.loopviz { display: flex; flex-direction: column; gap: 18px; }
#loopCv { display: block; width: 100%; height: 400px; }
.loopsteps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.loopsteps button { position: relative; overflow: hidden; background: none; border: 1px solid var(--line2); color: var(--muted); font: inherit; font-size: 12px; letter-spacing: .06em; text-align: left; padding: 12px 14px; min-height: 44px; cursor: pointer; }
.loopsteps button b { color: var(--dim); font-weight: 600; margin-right: 8px; }
.loopsteps button::after { content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--accent); transform-origin: left; transform: scaleX(var(--fill, 0)); }
.loopsteps button[aria-selected="true"] { color: var(--text); border-color: var(--accent); }
.loopsteps button[aria-selected="true"] b { color: var(--accent); }
.loopsteps button:hover { color: var(--text); }
.loopcap { margin: 0; min-height: 1.6em; color: var(--muted); font-size: 14px; }
@media (max-width: 680px) { .loopsteps { grid-template-columns: 1fr 1fr; } }

/* ---------- kinetic type: two rows sliding against each other with the scroll */
.kinetic { overflow: hidden; padding: 84px 0 64px; display: flex; flex-direction: column; gap: 0; border-top: 1px solid var(--line); }
.krow { white-space: nowrap; font-family: var(--serif); font-size: clamp(64px, 11vw, 172px); line-height: 1.02; letter-spacing: -.03em; color: var(--text); will-change: transform; transform: translate3d(calc(var(--t, .5) * -38%), 0, 0); }
.krow span { display: inline-block; }
.krow.alt { font-style: italic; color: transparent; -webkit-text-stroke: 1px rgba(143, 240, 212, .6); transform: translate3d(calc(-44% + var(--t, .5) * 38%), 0, 0); }

/* ---------- CTA: the mint light wipes in as a widening echo */
.ctawipe { position: relative; overflow: hidden; }
.ctawipe .cta .row { padding-top: 120px; padding-bottom: 120px; }
.motion .ctawipe .cta { clip-path: circle(var(--r, 0px) at 50% 50%); }
.ctawipe .ring { position: absolute; left: 50%; top: 50%; z-index: 1; border: 1px solid var(--accent); border-radius: 50%; transform: translate(-50%, -50%); pointer-events: none; opacity: 0; }

/* ---------- chapter index (bottom left) */
.lp-index { position: fixed; left: 24px; bottom: 22px; z-index: 40; display: flex; align-items: center; gap: 12px; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: #ece7da; mix-blend-mode: difference; pointer-events: none; }
.lp-index #idxNum { color: var(--accent); }
.lp-index i { display: block; width: 64px; height: 1px; background: rgba(236, 231, 218, .25); }
.lp-index b { display: block; height: 100%; background: currentColor; transform-origin: left; transform: scaleX(0); }

/* ---------- small screens */
@media (max-width: 1380px) { .lp-index { display: none; } }
@media (max-width: 640px) {
  .intro { height: 230vh; }
  .intro-copy { top: 112px; gap: 18px; padding: 0 18px; }
  .intro h1 { font-size: clamp(36px, 10.5vw, 52px); }
  .intro-more { gap: 16px; }
  .intro-more p { font-size: 13px; }
  .intro .ctas { gap: 10px; }
  .intro .ctas .btn { min-height: 46px; padding: 0 16px; font-size: 13px; }
  .whisper { top: 30%; font-size: 11px; }
  .kinetic { padding: 56px 0 40px; }
  .ctawipe .cta .row { padding-top: 80px; padding-bottom: 80px; }
}

@media (prefers-reduced-motion: reduce) {
  .intro { height: auto; }
  .intro-stage { position: relative; height: 100vh; min-height: 700px; }
  .whisper, .scrollhint { display: none; }
  .krow, .krow.alt { transform: none; }
}

/* ---------- closing summary + the glitch door into the app */
.ctawipe .cta .row.ctasum { flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 28px; padding-top: 128px; padding-bottom: 128px; }
.ctaeye { font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: rgba(11, 12, 11, .6); }
.ctasum h2.big { font-size: clamp(44px, 6.4vw, 92px); color: var(--bg); }
.ctasum h2.big em { color: #0b2a22; }
.ctalead { margin: 0; max-width: 640px; font-size: 15px; color: rgba(11, 12, 11, .8); }
.sumgrid { width: 100%; max-width: 1040px; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid rgba(11, 12, 11, .22); margin-top: 8px; }
.sumgrid > div { padding: 22px 20px 4px; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.sumgrid > div + div { border-left: 1px solid rgba(11, 12, 11, .22); }
.sumgrid b { font-size: 11px; letter-spacing: .14em; color: rgba(11, 12, 11, .5); font-weight: 600; }
.sumgrid h4 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 26px; line-height: 1.05; color: var(--bg); }
.sumgrid p { margin: 0; font-size: 12.5px; line-height: 1.55; color: rgba(11, 12, 11, .72); }
/* locked, upcoming blocks: camouflaged in ASCII noise */
.lockgrid { width: 100%; max-width: 1040px; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px dashed rgba(11, 12, 11, .3); margin-top: -4px; }
.lock { position: relative; padding: 22px 20px 6px; display: flex; flex-direction: column; gap: 8px; text-align: left; overflow: hidden; }
.lock + .lock { border-left: 1px dashed rgba(11, 12, 11, .3); }
.lockgrid > * + * { border-left: 1px dashed rgba(11, 12, 11, .3); }
/* an unlocked block: a shipped feature, linked */
.unlk { position: relative; padding: 22px 20px 6px; display: flex; flex-direction: column; gap: 8px; text-align: left; overflow: hidden; color: inherit; text-decoration: none; background: rgba(11, 12, 11, .05); transition: background .25s; }
.unlk:hover { background: rgba(11, 12, 11, .1); }
.unlk .lk-tag { color: #0b2a22; font-weight: 600; }
.unlk .lk-icon { color: #0b2a22; }
.unlk h4 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 26px; line-height: 1.05; color: var(--bg); min-height: 1.05em; }
.unlk p { margin: 0; font-size: 12.5px; line-height: 1.55; color: rgba(11, 12, 11, .72); }
.unlk-go { margin-top: auto; padding-top: 6px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: #0b2a22; }
.unlk:hover .unlk-go { text-decoration: underline; }
.lk-top { display: flex; align-items: center; gap: 12px; }
.lk-top b { font-size: 11px; letter-spacing: .14em; color: rgba(11, 12, 11, .5); font-weight: 600; }
.lk-tag { font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: rgba(11, 12, 11, .55); }
.lk-icon { position: absolute; top: 16px; right: 18px; margin: 0; font-family: var(--mono); font-size: 11px; line-height: 1.05; color: rgba(11, 12, 11, .45); }
.lk-title { font-family: var(--mono); font-weight: 600; font-size: 21px; line-height: 1.2; letter-spacing: .02em; color: rgba(11, 12, 11, .32); white-space: pre-wrap; min-height: 1.2em; }
.lk-desc { margin: 0; font-family: var(--mono); font-size: 12.5px; line-height: 1.55; color: rgba(11, 12, 11, .3); white-space: pre-wrap; word-break: break-word; }
.lock .v { color: #0b0c0b; }         /* decoded for a moment */
.lock .v2 { color: #0b2a22; opacity: .75; }
.lock:hover .lk-icon { color: #0b0c0b; }
@media (max-width: 860px) { .lockgrid { grid-template-columns: 1fr; } .lock + .lock, .lockgrid > * + * { border-left: 0; border-top: 1px dashed rgba(11, 12, 11, .3); } }
.glitchwrap { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 18px; }

.glitch { position: relative; display: inline-block; background: #0b0c0b; color: var(--accent); text-decoration: none; padding: 10px 14px; box-shadow: 6px 6px 0 #0b2a22; animation: gljump 4s steps(1) infinite; }
.glitch:hover, .glitch:focus-visible { color: var(--accent); outline: none; box-shadow: 8px 8px 0 #0b2a22; }
.glitch:active { transform: translate(4px, 4px); box-shadow: 2px 2px 0 #0b2a22; animation: none; }
.glitch:focus-visible { outline: 2px dashed #0b0c0b; outline-offset: 6px; }
.gx { pointer-events: none; margin: 0; font-family: var(--mono); font-weight: 600; font-size: 15px; line-height: 1.3; letter-spacing: .06em; white-space: pre; color: var(--accent); }
.gx .e { color: #2f5a4e; }          /* resting frame */
.gx .h { color: #f4f1e8; }          /* snake head / bright pixel */
.gx .t { color: var(--accent); }    /* snake tail */
.gx .r { color: #f4f1e8; }          /* corrupted cell */
.gx .w { color: #f4f1e8; }          /* reforming cell */
.gx .d { color: #3c4a45; }          /* dead pixel */
/* stepped, whole-pixel jolts: no smoothing, no skew */
@keyframes gljump {
  0%, 36%, 42%, 84%, 100% { transform: none; }
  37% { transform: translate(-4px, 0); }
  39% { transform: translate(4px, -2px); }
  86% { transform: translate(-6px, 2px); }
  88% { transform: translate(4px, 0); }
  90% { transform: translate(-2px, -2px); }
  93% { transform: translate(2px, 0); }
}
@media (max-width: 860px) {
  .sumgrid { grid-template-columns: 1fr 1fr; }
  .sumgrid > div:nth-child(3) { border-left: 0; }
  .sumgrid > div:nth-child(n+3) { border-top: 1px solid rgba(11, 12, 11, .22); }
}
@media (max-width: 520px) {
  .ctawipe .cta .row.ctasum { padding-top: 88px; padding-bottom: 88px; gap: 22px; }
  .sumgrid { grid-template-columns: 1fr; }
  .sumgrid > div + div { border-left: 0; border-top: 1px solid rgba(11, 12, 11, .22); }
  .gx { font-size: 12.5px; letter-spacing: .03em; }
}
@media (prefers-reduced-motion: reduce) {
  .glitch { animation: none; }
}
