:root {
  --bg: #020403;
  --ink: #eafff4;
  --dim: #8fb3a1;
  --mint: #2bff9a;
  --fire: #ff8a2b;
  --sol: #b06bff;
  --line: rgba(43, 255, 154, 0.22);
  --glass: rgba(4, 16, 10, 0.55);
  --display: 'Unbounded', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--mono); }
body { overflow-x: hidden; }
body.has-cursor, body.has-cursor a, body.has-cursor button { cursor: none; }
a { color: var(--mint); text-decoration: none; }
.track { height: 1000vh; position: relative; z-index: 0; }

/* ---------- the film ---------- */
.film { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: #000; }
.film video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; will-change: opacity, transform; transform: scale(1.04); }
.shade { position: fixed; inset: 0; z-index: 1; pointer-events: none; transition: background 0.8s;
  background: linear-gradient(90deg, rgba(2, 4, 3, 0.86) 0%, rgba(2, 4, 3, 0.55) 32%, rgba(2, 4, 3, 0) 58%),
              linear-gradient(0deg, rgba(2, 4, 3, 0.75) 0%, transparent 35%); }
.vignette { position: fixed; inset: 0; z-index: 1; pointer-events: none; background: radial-gradient(ellipse at 55% 50%, transparent 50%, rgba(0, 0, 0, 0.7) 100%); }
.grain { position: fixed; inset: -50%; z-index: 2; pointer-events: none; opacity: 0.08; animation: grain 0.9s steps(6) infinite;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }
@keyframes grain { 0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -3%); } 60% { transform: translate(-2%, -1%); } 80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); } }
.bars i { position: fixed; left: 0; right: 0; height: 4.5vh; background: #000; z-index: 3; pointer-events: none; transition: height 1.2s var(--ease); }
.bars i:first-child { top: 0; } .bars i:last-child { bottom: 0; }
body.started .bars i { height: 0; }

/* ---------- boot ---------- */
#boot { position: fixed; inset: 0; z-index: 50; display: grid; place-content: center; justify-items: center; gap: 22px; background: var(--bg); transition: opacity 1s, visibility 1s; }
#boot.done { opacity: 0; visibility: hidden; }
.boot-pill { width: 120px; height: 46px; border-radius: 99px; border: 2px solid var(--mint); overflow: hidden; box-shadow: 0 0 30px rgba(43, 255, 154, 0.5); }
.boot-pill i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--mint), #fff); transition: width 0.3s; }
.boot-txt { font-size: 12px; letter-spacing: 0.25em; text-transform: uppercase; color: var(--dim); }
.boot-txt b { color: var(--mint); }

/* ---------- top bar ---------- */
.bar { position: fixed; top: 0; left: 0; right: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; padding: 20px clamp(16px, 3.5vw, 44px); }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 800; font-size: 14px; letter-spacing: 0.05em; color: var(--ink); }
.brand .mark { width: 26px; height: 26px; border-radius: 50%; box-shadow: 0 0 16px rgba(43, 255, 154, 0.55); }
.live { display: flex; align-items: center; gap: 8px; font-size: 11px; letter-spacing: 0.2em; color: var(--dim); padding: 7px 12px; border: 1px solid var(--line); border-radius: 99px; background: rgba(2, 10, 6, 0.55); backdrop-filter: blur(8px); }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); }
.live.on i { background: var(--mint); box-shadow: 0 0 10px var(--mint); animation: blink 1.2s infinite; }
.live.on { color: var(--mint); }
@keyframes blink { 50% { opacity: 0.3; } }

/* ---------- rail + timeline ---------- */
.rail { position: fixed; right: clamp(12px, 2.5vw, 34px); top: 50%; transform: translateY(-50%); z-index: 20; display: flex; flex-direction: column; gap: 14px; }
.rail button { all: unset; display: flex; align-items: center; gap: 10px; justify-content: flex-end; font-size: 10px; letter-spacing: 0.18em; color: var(--dim); text-transform: uppercase; }
.rail button span { opacity: 0; transform: translateX(6px); transition: 0.3s; }
.rail button:hover span, .rail button.on span { opacity: 1; transform: none; }
.rail button i { width: 9px; height: 9px; border-radius: 99px; border: 1px solid var(--mint); transition: 0.3s; }
.rail button.on i { height: 26px; background: var(--mint); box-shadow: 0 0 12px var(--mint); }
.timeline { position: fixed; left: 0; right: 0; bottom: 0; height: 2px; z-index: 21; background: rgba(43, 255, 154, 0.12); }
.timeline i { display: block; height: 100%; width: 0; background: var(--mint); box-shadow: 0 0 12px var(--mint); }

/* ---------- captions ---------- */
.chapters { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
.cap { position: absolute; left: clamp(18px, 5vw, 76px); bottom: clamp(70px, 13vh, 150px); width: min(560px, calc(100vw - 36px)); pointer-events: none; }
.cap.on { pointer-events: auto; }
.cap.end { width: min(620px, calc(100vw - 36px)); }

.cap .num { font-family: var(--display); font-weight: 900; font-size: clamp(56px, 7vw, 108px); line-height: 0.8; color: transparent; -webkit-text-stroke: 1px rgba(43, 255, 154, 0.22);
  position: absolute; left: -0.06em; bottom: calc(100% - 0.25em); opacity: 0; transform: translateY(30px); transition: 0.9s var(--ease); z-index: -1; }
.cap.end .num { left: 50%; transform: translate(-50%, 30px); }
.cap .k, .cap p, .cap .meter, .cap .duo, .cap .ctas, .cap .feed, .cap .lastpull, .cap .scrollhint { opacity: 0; transform: translateY(24px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.cap.on .num { opacity: 1; transform: none; } .cap.end.on .num { transform: translateX(-50%); }
.cap:first-child .num, .cap.end .num { display: none; } /* hero + finale speak for themselves */
.cap.on .k { opacity: 1; transform: none; transition-delay: 0.05s; }
.cap.on p, .cap.on .scrollhint { opacity: 1; transform: none; transition-delay: 0.35s; }
.cap.on .meter, .cap.on .duo, .cap.on .ctas, .cap.on .lastpull { opacity: 1; transform: none; transition-delay: 0.5s; }
.cap.on .feed { opacity: 1; transform: none; transition-delay: 0.65s; }
.cap .k { font-size: 11px; letter-spacing: 0.32em; text-transform: uppercase; color: var(--mint); margin-bottom: 14px; }
.cap h1, .cap h2 { font-family: var(--display); font-weight: 900; line-height: 0.92; margin: 0 0 18px; letter-spacing: -0.02em; text-shadow: 0 2px 30px rgba(0, 0, 0, 0.6); }
.cap h1.big { font-size: clamp(42px, 7.2vw, 108px); }
.cap h2 { font-size: clamp(34px, 5vw, 76px); }
.cap h2.huge { font-size: clamp(42px, 6vw, 96px); margin-bottom: 14px; }
.cap p { color: #c4e2d2; font-size: 14px; line-height: 1.7; margin: 0 0 20px; max-width: 470px; text-shadow: 0 1px 12px rgba(0, 0, 0, 0.8); }
.cap.end p { margin: 18px 0 0; }
.cap p b { color: var(--ink); }

/* kinetic headline: letters rise in */
.split .w { display: inline-block; white-space: nowrap; }
.split .ch { display: inline-block; opacity: 0; transform: translateY(0.6em) rotate(6deg); filter: blur(6px); transition: opacity 0.6s var(--ease), transform 0.8s var(--ease), filter 0.6s; }
.cap.on .split .ch { opacity: 1; transform: none; filter: none; }

.meter { display: inline-flex; flex-direction: column; gap: 4px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--glass); backdrop-filter: blur(14px); min-width: 210px; }
.meter span { font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--dim); }
.meter b { font-family: var(--display); font-size: clamp(26px, 3vw, 40px); color: var(--ink); text-shadow: 0 0 18px rgba(43, 255, 154, 0.5); }
.meter.fire { border-color: rgba(255, 138, 43, 0.4); } .meter.fire b { text-shadow: 0 0 18px rgba(255, 138, 43, 0.6); }
.meter.sol { border-color: rgba(176, 107, 255, 0.4); } .meter.sol b { text-shadow: 0 0 18px rgba(176, 107, 255, 0.65); }
.duo { display: flex; gap: 12px; flex-wrap: wrap; }
.lastpull { margin-top: 14px; font-size: 12px; color: var(--dim); min-height: 18px; }
.lastpull b { color: var(--mint); }
.scrollhint { display: flex; align-items: center; gap: 10px; font-size: 11px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--dim); }
.scrollhint span { width: 22px; height: 36px; border: 1px solid var(--mint); border-radius: 12px; position: relative; }
.scrollhint span::after { content: ''; position: absolute; left: 50%; top: 7px; width: 3px; height: 7px; margin-left: -1.5px; border-radius: 2px; background: var(--mint); animation: wheel 1.6s infinite; }
@keyframes wheel { to { transform: translateY(12px); opacity: 0; } }

.feed { display: flex; flex-direction: column; gap: 6px; max-width: 560px; font-size: 12px; }
.feed a, .feed div { display: grid; grid-template-columns: 110px 1fr auto; gap: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--glass); backdrop-filter: blur(10px); color: var(--ink); }
.feed .t { color: var(--mint); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; }
.feed .n { color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctas { display: flex; gap: 12px; flex-wrap: wrap; margin: 6px 0 22px; }
.fine { font-size: 11px !important; color: var(--dim) !important; max-width: 680px !important; }

/* ---------- buttons ---------- */
.btn { display: inline-block; position: relative; font-family: var(--display); font-weight: 800; font-size: 13px; letter-spacing: 0.07em; text-transform: uppercase;
  padding: 16px 26px; border-radius: 999px; border: 1px solid var(--mint); background: var(--mint); color: var(--bg);
  box-shadow: 0 0 26px rgba(43, 255, 154, 0.45); transition: box-shadow 0.25s, background 0.25s, color 0.25s; will-change: transform; }
.btn:hover { box-shadow: 0 0 46px rgba(43, 255, 154, 0.85); }
.btn.ghost { background: rgba(2, 10, 6, 0.55); color: var(--mint); box-shadow: none; backdrop-filter: blur(8px); }
.btn.ghost:hover { background: var(--mint); color: var(--bg); }
.btn.sm { padding: 10px 18px; font-size: 11px; }
button.btn { font-family: var(--display); }

/* ---------- glitch ---------- */
.glitch { position: relative; display: inline-block; }
.glitch::before, .glitch::after { content: attr(data-text); position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.glitch::before { color: #ff2bd6; clip-path: inset(0 0 55% 0); }
.glitch::after { color: #2bf4ff; clip-path: inset(45% 0 0 0); }
.glitch.zap::before, .brand:hover .glitch::before { opacity: 0.75; animation: g1 0.35s steps(2) 2; }
.glitch.zap::after, .brand:hover .glitch::after { opacity: 0.75; animation: g2 0.35s steps(2) 2; }
@keyframes g1 { 0% { transform: translate(-3px, -1px); clip-path: inset(0 0 70% 0); } 50% { transform: translate(3px, 1px); clip-path: inset(30% 0 40% 0); } 100% { transform: translate(-1px, 0); clip-path: inset(60% 0 5% 0); } }
@keyframes g2 { 0% { transform: translate(3px, 1px); clip-path: inset(50% 0 20% 0); } 50% { transform: translate(-3px, -1px); clip-path: inset(10% 0 60% 0); } 100% { transform: translate(1px, 0); clip-path: inset(80% 0 0 0); } }

/* ---------- cursor ---------- */
.cursor, .cursor-dot { position: fixed; top: 0; left: 0; z-index: 60; pointer-events: none; opacity: 0; transition: opacity 0.3s; }
body.has-cursor .cursor, body.has-cursor .cursor-dot { opacity: 1; }
.cursor { width: 46px; height: 46px; margin: -23px 0 0 -23px; display: grid; place-items: center; }
.cursor-pill { width: 34px; height: 16px; border-radius: 99px; border: 1.5px solid var(--mint); background: linear-gradient(90deg, rgba(43, 255, 154, 0.25) 50%, rgba(255, 255, 255, 0.12) 50%);
  box-shadow: 0 0 14px rgba(43, 255, 154, 0.6); transition: width 0.25s, height 0.25s, background 0.25s, transform 0.25s; transform: rotate(-35deg); }
.cursor.hover .cursor-pill { width: 64px; height: 64px; background: rgba(43, 255, 154, 0.12); transform: rotate(0); }
.cursor.down .cursor-pill { transform: rotate(-35deg) scale(0.75); }
.cursor-dot { width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 8px var(--mint); }

/* ---------- toast ---------- */
.toast { position: fixed; top: 78px; left: 50%; z-index: 30; transform: translate(-50%, -20px); opacity: 0; pointer-events: none;
  padding: 12px 18px; border-radius: 14px; border: 1px solid var(--mint); background: rgba(2, 14, 8, 0.85); backdrop-filter: blur(10px);
  font-size: 12px; letter-spacing: 0.06em; transition: 0.45s; box-shadow: 0 0 30px rgba(43, 255, 154, 0.35); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast b { color: var(--mint); }

@media (max-width: 760px) {
  .rail { display: none; }
  .cap { bottom: 58px; }
  .cap p { font-size: 13px; }
  .live span { display: none; }
  /* portrait: the film lives in the top of the screen (a wider slice of each 16:9 shot), captions below */
  .film video { height: 64vh; bottom: auto; }
  .film::after { content: ''; position: absolute; left: 0; right: 0; top: 44vh; height: 21vh; background: linear-gradient(180deg, transparent, var(--bg)); pointer-events: none; z-index: 2; }
  .shade { background: linear-gradient(0deg, rgba(2, 4, 3, 0.95) 0%, rgba(2, 4, 3, 0.4) 40%, transparent 55%); }
  .feed a, .feed div { grid-template-columns: 1fr auto; } .feed .n { display: none; }
}
@media (prefers-reduced-motion: reduce) { .grain { animation: none; } .split .ch { transition: opacity 0.3s; transform: none; filter: none; } .glitch::before, .glitch::after { display: none; } }

/* ---------- records (after the film) ---------- */
.records { position: relative; z-index: 15; padding: 18vh clamp(18px, 5vw, 76px) 60px; background: linear-gradient(180deg, transparent 0, var(--bg) 16vh); }
.rec-head { max-width: 760px; margin-bottom: 40px; }
.rec-head .k { font-size: 11px; letter-spacing: 0.32em; text-transform: uppercase; color: var(--mint); margin-bottom: 14px; }
.rec-head h2 { font-family: var(--display); font-weight: 900; font-size: clamp(36px, 5.4vw, 80px); line-height: 0.95; margin: 0 0 16px; letter-spacing: -0.02em; }
.rec-head h2 span { color: transparent; -webkit-text-stroke: 1.5px var(--mint); }
.rec-head p { color: #b8d8c7; font-size: 14px; line-height: 1.7; margin: 0 0 16px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat { padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: rgba(6, 22, 14, 0.6); }
.stat span { display: block; font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--dim); margin-bottom: 8px; }
.stat b { font-family: var(--display); font-size: clamp(26px, 3vw, 42px); text-shadow: 0 0 18px rgba(43, 255, 154, 0.4); }
.stat.fire { border-color: rgba(255, 138, 43, 0.4); } .stat.sol { border-color: rgba(176, 107, 255, 0.4); }
.stat-note { color: var(--dim); font-size: 12px; margin: 14px 0 0; }
.sub { font-family: var(--display); font-size: clamp(22px, 2.4vw, 32px); margin: 64px 0 18px; }
.pulls { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.pull { padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: rgba(6, 22, 14, 0.6); display: flex; flex-direction: column; gap: 8px; transition: transform 0.2s, border-color 0.2s; }
.pull:hover { transform: translateY(-3px); border-color: var(--mint); }
.pull .rar { font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--mint); }
.pull .rar.epic { color: #ffd35a; } .pull .rar.rare { color: #c49bff; } .pull .rar.uncommon { color: #6cc9ff; }
.pull .name { font-family: var(--display); font-size: 14px; line-height: 1.3; min-height: 36px; }
.pull .money { display: flex; justify-content: space-between; font-size: 12px; color: var(--dim); }
.pull .money b { color: var(--mint); font-weight: 500; }
.pull .links { display: flex; gap: 12px; font-size: 11px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip { font-family: var(--mono); font-size: 11px; padding: 8px 13px; border-radius: 99px; border: 1px solid var(--line); background: transparent; color: var(--dim); cursor: pointer; }
.chip.on { border-color: var(--mint); color: var(--mint); background: rgba(43, 255, 154, 0.08); }
.ledger { border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: rgba(4, 16, 10, 0.6); }
.lrow { display: grid; grid-template-columns: 110px 170px 1fr 150px 90px; gap: 14px; padding: 12px 20px; font-size: 12px; align-items: center; border-bottom: 1px solid rgba(43, 255, 154, 0.1); }
.lrow:last-child { border-bottom: 0; }
.lhead { font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--dim); background: rgba(43, 255, 154, 0.05); }
.lrow .act { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; }
.lrow .act::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 8px; background: currentColor; box-shadow: 0 0 8px currentColor; }
.lrow .det { color: #b8d8c7; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrow .amt { font-weight: 500; }
.lrow .t { color: var(--dim); }
.foot { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-top: 80px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--dim); font-size: 11px; }
body.past .chapters, body.past .rail, body.past .timeline, body.past .shade { opacity: 0; pointer-events: none; }
.chapters, .rail, .timeline { transition: opacity 0.5s; }
body.past .film { opacity: 0.25; }
.film { transition: opacity 0.8s; }
@media (max-width: 760px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .lrow { grid-template-columns: 70px 1fr 90px; }
  .lrow .det, .lrow .tx { display: none; }
}
/* the glitch flicker only ever shows on the active chapter (no ghosts while scrolling fast) */
.cap:not(.on) .glitch::before, .cap:not(.on) .glitch::after { display: none; }

/* ---------- X links + live badge ---------- */
.bar-actions { display: flex; align-items: center; gap: 10px; }
.xbtn { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: rgba(2, 10, 6, 0.55); color: var(--ink); backdrop-filter: blur(8px); transition: border-color 0.25s, color 0.25s, box-shadow 0.25s; }
.xbtn svg { width: 16px; height: 16px; }
.xbtn:hover { border-color: var(--mint); color: var(--mint); box-shadow: 0 0 20px rgba(43, 255, 154, 0.4); }
.xbtn.sm { width: 30px; height: 30px; } .xbtn.sm svg { width: 13px; height: 13px; }
.xcta { display: inline-flex; align-items: center; gap: 10px; }
.xcta svg { width: 15px; height: 15px; }
.foot-l { display: inline-flex; align-items: center; gap: 14px; }
.live { visibility: hidden; } /* only shown while the machine is actually live */
.live.on { visibility: visible; }
.empty-state { padding: 26px 20px; color: var(--dim); font-size: 13px; text-align: center; border: 1px dashed rgba(43, 255, 154, 0.25); border-radius: 16px; grid-column: 1 / -1; }
