:root {
  --ink: #1a0b24; --ink2: #24102f; --plum: #3a1648;
  --cream: #fff4e2; --muted: #d9bfd0;
  --coral: #ff3d6e; --pink: #ff8fb8; --gold: #ffc94a; --gold2: #ffe7a0; --teal: #2ee6d0;
  --line: rgba(255, 228, 200, 0.16);
  --display: "Playfair Display", Georgia, serif; --neon: "Anton", Impact, sans-serif;
  --body: "Space Grotesk", system-ui, sans-serif; --mono: "JetBrains Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--ink); color: var(--cream); font: 400 16px/1.55 var(--body); overflow-x: hidden; }
a { color: inherit; }
h1, h2 { margin: 0; }
.wrap { width: min(1180px, 100% - 32px); margin: 0 auto; }
.small { font-size: 0.85rem; color: var(--muted); }
.eyebrow { margin: 0 0 10px; font: 700 0.78rem/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.chip { background: var(--coral); color: #fff; padding: 5px 9px; border-radius: 999px; letter-spacing: 0.04em; }

/* wire */
.wire { display: flex; align-items: stretch; background: var(--gold); color: var(--ink); font: 700 0.78rem/1 var(--mono); overflow: hidden; }
.wire-tag { flex: none; background: var(--coral); color: #fff; padding: 9px 12px; letter-spacing: 0.1em; }
.wire-track { overflow: hidden; flex: 1; display: flex; align-items: center; }
.wire-run { display: flex; gap: 40px; white-space: nowrap; animation: run 60s linear infinite; padding-left: 20px; }
.wire-run span::before { content: "◆ "; color: var(--coral); }
@keyframes run { to { transform: translateX(-50%); } }

/* nav */
.nav { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 16px; background: rgba(26, 11, 36, 0.86); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 900 italic 1.15rem/1 var(--display); color: var(--gold2); min-width: 0; }
.brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand img { width: 30px; height: 30px; }
.links { display: flex; gap: 22px; }
.links a { text-decoration: none; color: var(--muted); font-weight: 500; }
.links a:hover { color: var(--cream); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 12px 18px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.06); color: var(--cream); font: 700 0.95rem/1 var(--body); text-decoration: none; cursor: pointer; transition: transform 0.15s, background 0.15s; }
.btn:hover { transform: translateY(-1px); background: rgba(255, 255, 255, 0.12); }
.btn.small { padding: 9px 14px; font-size: 0.85rem; }
.btn-gold { background: linear-gradient(180deg, var(--gold2), var(--gold) 55%, #e09a1e); color: #2a1400; border-color: transparent; box-shadow: 0 6px 24px rgba(255, 180, 60, 0.3); }
.btn-gold:hover { background: linear-gradient(180deg, #fff3c8, var(--gold2) 50%, var(--gold)); }
.btn[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.actions.center { justify-content: center; margin-top: 28px; }

/* hero */
.hero { position: relative; }
.stage-wrap { position: relative; height: min(86vh, 860px); min-height: 600px; overflow: hidden; background: #f29a86; }
.stage-box { position: absolute; inset: 0; }
#stage { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: pan-y; cursor: grab; }
#stage:active { cursor: grabbing; }
body.playing #stage { cursor: pointer; touch-action: none; }
.stage-wrap::after { content: ""; position: absolute; inset: auto 0 0 0; height: 120px; background: linear-gradient(transparent, var(--ink)); pointer-events: none; }
.hero-copy { position: absolute; left: max(16px, calc((100% - 1180px) / 2)); top: 28px; width: min(520px, calc(100% - 32px)); z-index: 2; }
.hero-copy h1 { font: 900 italic clamp(2.6rem, 6.4vw, 5.4rem)/0.92 var(--display); letter-spacing: -0.01em; background: linear-gradient(180deg, #fff9e6 10%, var(--gold2) 45%, var(--gold) 62%, #c9761a); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 3px 0 rgba(58, 22, 72, 0.9)) drop-shadow(0 10px 30px rgba(58, 22, 72, 0.5)); }
.lead { margin: 14px 0 16px; font-size: 1.08rem; max-width: 30em; color: #fff; text-shadow: 0 2px 12px rgba(40, 10, 50, 0.7); }
.lead b { color: var(--gold2); }
.ca { display: flex; align-items: center; gap: 8px; max-width: 100%; padding: 6px 6px 6px 14px; margin-bottom: 14px; border-radius: 999px; background: rgba(26, 11, 36, 0.78); border: 1px solid var(--line); backdrop-filter: blur(6px); }
.ca > span { font: 700 0.75rem var(--mono); color: var(--gold); }
.ca code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 500 0.85rem var(--mono); }
.ca button { flex: none; border: 0; border-radius: 999px; padding: 8px 14px; background: var(--gold); color: #2a1400; font: 700 0.8rem var(--body); cursor: pointer; }
.ca button:disabled { opacity: 0.45; cursor: default; }
.hero-copy .btn:not(.btn-gold) { background: rgba(26, 11, 36, 0.62); backdrop-filter: blur(6px); }

.cards { position: absolute; right: max(16px, calc((100% - 1180px) / 2)); top: 28px; z-index: 2; width: 250px; display: grid; gap: 10px; }
.card { padding: 12px 14px; border-radius: 16px; background: rgba(26, 11, 36, 0.8); border: 1px solid var(--line); backdrop-filter: blur(8px); display: grid; gap: 2px; }
.card span { font: 700 0.7rem var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.card b { font: 700 1.5rem/1.15 var(--mono); }
.card small { color: var(--muted); font-size: 0.8rem; }
.card-gold b { color: var(--gold); text-shadow: 0 0 18px rgba(255, 201, 74, 0.45); }
.card-level b { font: 900 italic 1.35rem/1.15 var(--display); color: var(--gold2); }
.badge { font: 700 0.7rem var(--mono); font-style: normal; padding: 3px 7px; border-radius: 6px; background: var(--plum); color: var(--gold2); }
body[data-mode="live"] .badge { background: var(--teal); color: var(--ink); }
.bar { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, 0.12); margin: 6px 0 2px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--coral), var(--gold)); border-radius: inherit; transition: width 0.4s; }
.next { font-family: var(--mono); }

.quip { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -10px); margin: 0; z-index: 3; padding: 10px 16px; border-radius: 18px 18px 18px 4px; background: var(--cream); color: var(--ink); font: 700 1rem/1.3 var(--body); max-width: min(320px, 80%); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; }
.quip.show { opacity: 1; transform: translate(-50%, -24px); }
.stage-hint { position: absolute; left: 50%; bottom: 82px; transform: translateX(-50%); z-index: 3; margin: 0; font: 500 0.78rem var(--mono); color: rgba(255, 244, 226, 0.85); text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5); white-space: nowrap; }
.play-pill { position: absolute; left: 50%; bottom: 34px; transform: translateX(-50%); z-index: 3; border: 0; border-radius: 999px; padding: 10px 18px; background: rgba(26, 11, 36, 0.82); color: var(--gold2); font: 700 0.9rem var(--body); letter-spacing: 0.02em; cursor: pointer; border: 1px solid rgba(255, 201, 74, 0.5); backdrop-filter: blur(6px); }
.play-pill:hover { background: var(--gold); color: #2a1400; }
body.playing .hero-copy, body.playing .cards, body.playing .play-pill, body.playing .stage-hint { opacity: 0; pointer-events: none; }
.hero-copy, .cards, .play-pill, .stage-hint { transition: opacity 0.3s; }

.game-hud { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); z-index: 4; display: flex; gap: 8px; align-items: center; }
.game-hud > div { padding: 8px 12px; border-radius: 12px; background: rgba(26, 11, 36, 0.82); border: 1px solid var(--line); display: grid; min-width: 92px; }
.game-hud span { font: 700 0.62rem var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.game-hud b { font: 700 1.1rem var(--mono); }
.lives { color: var(--coral); letter-spacing: 0.15em; }
.game-over { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 5; width: min(380px, calc(100% - 32px)); padding: 20px; border-radius: 20px; background: rgba(26, 11, 36, 0.92); border: 1px solid rgba(255, 201, 74, 0.4); text-align: center; display: grid; gap: 6px; justify-items: center; }
.game-over > b { font: 900 italic 2.6rem/1 var(--display); color: var(--gold); }
.game-over .row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 8px; }
.toast { position: absolute; left: 50%; top: 20px; transform: translate(-50%, -80px); z-index: 6; margin: 0; padding: 10px 18px; border-radius: 999px; background: linear-gradient(180deg, var(--gold2), var(--gold)); color: #2a1400; font: 800 0.95rem var(--body); white-space: nowrap; transition: transform 0.35s cubic-bezier(.2, 1.4, .4, 1); box-shadow: 0 8px 30px rgba(255, 180, 60, 0.4); }
.toast.show { transform: translate(-50%, 0); }
body.playing .toast { top: 90px; }

/* simulator */
.sim { position: relative; z-index: 3; margin-top: -48px; padding: 18px 20px; border-radius: 20px; background: var(--ink2); border: 1px solid var(--line); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35); }
.sim-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; }
.sim-head h2 { font: 900 italic 1.5rem var(--display); }
.sim-head h2 em { font: 500 0.9rem var(--mono); color: var(--muted); font-style: normal; }
.sim-head .small { margin: 0; flex: 1; }
.sim-row { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; margin: 14px 0; }
.sim-row label { font: 700 0.75rem var(--mono); text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.sim-row output { font: 700 1.1rem var(--mono); color: var(--gold); min-width: 80px; text-align: right; }
input[type="range"] { width: 100%; accent-color: var(--gold); }
.sim-buttons { display: flex; flex-wrap: wrap; gap: 8px; }

/* sections */
.zone { padding: 90px 0 30px; }
.zone h2 { font: 900 italic clamp(2rem, 4.4vw, 3.2rem)/1.05 var(--display); color: var(--cream); }
.section-lead { max-width: 44em; color: var(--muted); font-size: 1.05rem; }
.section-lead b { color: var(--gold2); }
.formula { margin: 18px 0 26px; }
.formula code { display: inline-block; padding: 10px 16px; border-radius: 12px; background: var(--ink2); border: 1px solid var(--line); font: 500 0.95rem var(--mono); color: var(--gold2); }
.ladder { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.ladder li button { width: 100%; height: 100%; text-align: left; display: grid; gap: 4px; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--ink2); color: var(--cream); font: inherit; cursor: pointer; transition: border-color 0.2s, transform 0.2s, background 0.2s; }
.ladder li button:hover { transform: translateY(-2px); border-color: rgba(255, 201, 74, 0.5); }
.ladder .mc { font: 700 0.8rem var(--mono); color: var(--gold); }
.ladder .nm { font: 900 italic 1.2rem var(--display); }
.ladder .ln { font-size: 0.88rem; color: var(--muted); }
.ladder li.on button { background: linear-gradient(160deg, rgba(255, 201, 74, 0.16), rgba(255, 61, 110, 0.1)); border-color: rgba(255, 201, 74, 0.45); }
.ladder li.now button { outline: 2px solid var(--gold); outline-offset: 2px; }
.seen { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: baseline; color: var(--muted); }
.seen b { font: 700 1rem var(--mono); color: var(--gold); }

.story { background: radial-gradient(800px 400px at 80% 0%, rgba(255, 61, 110, 0.16), transparent 70%), radial-gradient(700px 400px at 0% 100%, rgba(46, 230, 208, 0.1), transparent 70%); }
.story-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 40px; align-items: start; }
.story-copy p { margin: 0 0 14px; font-size: 1.08rem; }

.steps { list-style: none; counter-reset: s; margin: 26px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.steps li { counter-increment: s; padding: 18px; border-radius: 18px; background: var(--ink2); border: 1px solid var(--line); display: grid; gap: 8px; align-content: start; min-width: 0; }
.steps li::before { content: counter(s); width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--gold); color: #2a1400; font: 900 italic 1.1rem var(--display); }
.steps b { font-size: 1.05rem; }
.steps span { color: var(--muted); }
.ca-inline { margin: 0; }
.tokenomics { margin-top: 18px; display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.tokenomics div { padding: 14px 16px; border-radius: 14px; border: 1px dashed rgba(255, 201, 74, 0.35); display: grid; gap: 2px; }
.tokenomics span { font: 700 0.7rem var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.tokenomics b { font: 700 1.05rem var(--mono); }

.foot { margin-top: 70px; padding: 30px 0 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.85rem; }
.foot p { margin: 0 0 10px; max-width: 70em; }
.foot b { color: var(--cream); }
[hidden] { display: none !important; }

@media (max-width: 900px) {
  .links { display: none; }
  .stage-wrap { height: auto; min-height: 0; display: flex; flex-direction: column; background: var(--ink); }
  .stage-box { position: relative; inset: auto; height: 64vh; min-height: 430px; order: 2; }
  .stage-wrap::after { display: none; }
  .hero-copy { position: relative; left: auto; top: auto; width: auto; padding: 22px 16px 14px; order: 1; }
  .lead { text-shadow: none; }
  .cards { position: relative; right: auto; top: auto; width: auto; padding: 14px 16px 0; grid-template-columns: 1fr 1fr; order: 3; }
  .card-level { grid-column: 1 / -1; }
  .stage-hint { bottom: 64px; }
  .play-pill { bottom: 20px; }
  .game-hud { top: 10px; flex-wrap: wrap; justify-content: center; width: calc(100% - 20px); gap: 6px; }
  .game-hud > div { min-width: 0; flex: 1; padding: 6px 8px; }
  body.playing .hero-copy, body.playing .cards { opacity: 1; pointer-events: auto; }
  .sim { margin-top: 18px; }
  .sim-row { grid-template-columns: 1fr auto; }
  .sim-row input { grid-column: 1 / -1; grid-row: 2; }
  .story-grid { grid-template-columns: 1fr; gap: 10px; }
}
@media (prefers-reduced-motion: reduce) { .wire-run { animation: none; } }
