:root {
  --night: #100425; --navy: #0b1233; --violet: #6b5aa8; --near: #00ec97; --glow: #8ff59a;
  --gold: #f4b728; --cream: #e9dcc0; --sand: #e8c58a; --tan: #b89a6c; --dark: #2b1a12; --red: #ff6b5c;
  --ink: #f1e6cf; --ink-2: #cdbfa0; --ink-3: #9a8bb5; --line: rgba(255,255,255,.08); --surface: rgba(255,255,255,.04);
  --display: "Bricolage Grotesque", "Instrument Sans", system-ui, sans-serif;
  --body: "Instrument Sans", system-ui, -apple-system, sans-serif;
  --px: "Silkscreen", "Courier New", monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--night); color: var(--ink); font-family: var(--body); font-size: 17px; line-height: 1.55; overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { color: var(--near); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); margin: 0; line-height: 1.05; letter-spacing: -0.02em; text-wrap: balance; }
h2 { font-size: clamp(30px, 6.5vw, 46px); font-weight: 800; }
h3 { font-size: 20px; font-weight: 700; }
p { margin: 12px 0; max-width: 60ch; }
.px { font-family: var(--px); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.eyebrow { color: var(--near); margin: 0 0 10px; }
.intro { color: var(--ink-2); font-size: 18px; }
.pixel, .slot, .room .kat img, .foragers img, .hawk img, .step-list img, .item img, .coin, .beetle, .particle { image-rendering: pixelated; image-rendering: crisp-edges; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }

#sky { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.hero, .section, .live, .foot { position: relative; z-index: 1; }

/* ── hero ── */
.hero { min-height: 92svh; display: grid; grid-template-rows: auto 1fr; grid-template-columns: minmax(0, 1fr); }
.hero-copy, .hero-art { min-width: 0; }
.hero-art { position: relative; height: 52svh; overflow: hidden; }
.hero-art img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 34%; image-rendering: pixelated; }
.hero-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(16,4,37,.15) 0%, rgba(16,4,37,0) 35%, rgba(16,4,37,.85) 85%, var(--night) 100%); }
.hero-copy { padding: 8px 22px 40px; margin-top: -40px; position: relative; }
h1 { display: grid; gap: 6px; }
h1 .glow { font-size: clamp(56px, 15vw, 120px); font-weight: 800; color: var(--near); text-shadow: 0 0 18px rgba(0,236,151,.55), 0 0 60px rgba(0,236,151,.25); line-height: .95; }
h1 .sub { font-family: var(--display); font-weight: 700; font-size: clamp(20px, 5vw, 30px); color: var(--cream); letter-spacing: 0; }
.lede { font-size: 18px; color: var(--ink-2); margin-top: 16px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 14px 20px; border-radius: 14px; font-weight: 600; font-size: 16px; border: 1px solid transparent; cursor: pointer; font-family: var(--body); transition: transform .12s ease, background .2s; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary { background: var(--near); color: #06301f; box-shadow: 0 0 0 0 rgba(0,236,151,.6); animation: pulse 2.6s ease-out infinite; }
.btn-primary:hover { text-decoration: none; background: var(--glow); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { text-decoration: none; background: rgba(255,255,255,.08); }
.btn-small { padding: 10px 14px; font-size: 14px; border-radius: 10px; }
.platform { margin-top: 16px; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(0,236,151,.45); } 70% { box-shadow: 0 0 0 14px rgba(0,236,151,0); } 100% { box-shadow: 0 0 0 0 rgba(0,236,151,0); } }

/* ── live strip ── */
.live { margin: 0 16px; padding: 18px 16px 14px; border: 1px solid rgba(0,236,151,.25); background: rgba(0,236,151,.06); border-radius: 18px; }
.live-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 10px; }
.stat { display: grid; gap: 2px; }
.stat .num { font-family: var(--display); font-weight: 800; font-size: 28px; color: var(--glow); font-variant-numeric: tabular-nums; line-height: 1; }
.live-note { margin: 12px 0 0; font-size: 14px; color: var(--ink-2); max-width: none; }

/* ── sections ── */
.section { padding: 64px 22px 24px; max-width: 760px; margin: 0 auto; }
.section h2 { margin-bottom: 8px; }

/* ── demo ── */
.demo { margin-top: 20px; min-width: 0; border: 1px solid var(--line); border-radius: 22px; overflow: hidden; background: rgba(11,18,51,.55); backdrop-filter: blur(8px); }
.hud { display: flex; align-items: flex-end; justify-content: space-between; padding: 12px 14px 8px; }
.hud-bal { display: grid; line-height: 1.05; }
.hud-bal strong { font-family: var(--display); font-weight: 800; font-size: 34px; color: var(--near); font-variant-numeric: tabular-nums; }
.hud-bal small { color: var(--ink-3); font-size: 12px; }
.hud-split { display: grid; gap: 4px; text-align: right; }
.hud-split .exposed { color: var(--red); } .hud-split .shielded { color: var(--gold); }
.hud-split b { color: inherit; font-family: var(--display); font-size: 14px; }
.room { position: relative; width: 100%; aspect-ratio: 360 / 400; max-height: 460px; margin: 0 auto; background: linear-gradient(#1a0e3a, #241448); overflow: hidden; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.slot { position: absolute; object-fit: contain; pointer-events: none; transition: opacity .16s ease; }
.slot.swap { animation: poof .42s ease; }
@keyframes poof { 0% { opacity: 0; transform: scale(.85); } 60% { opacity: 1; transform: scale(1.06); } 100% { transform: scale(1); } }
/* RoomLayout fractions: bottom = y, height = h (SpriteKit y-up) */
.wall     { left: 0;    bottom: 30%; width: 100%; height: 70%; object-fit: cover; }
.window   { left: 36%;  bottom: 63%; width: 28%;  height: 24%; }
.tunnel   { left: 3%;   bottom: 36%; width: 30%;  height: 32%; }
.vault    { left: 67%;  bottom: 36%; width: 30%;  height: 30%; }
.floor    { left: 0;    bottom: 0;   width: 100%; height: 30%; object-fit: cover; }
.terminal { left: 2%;   bottom: 12%; width: 24%;  height: 20%; }
.lambo    { left: 68%;  bottom: 12%; width: 30%;  height: 18%; }
.room .kat { position: absolute; left: 35%; bottom: 10%; width: 30%; height: 32%; background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.room .kat img { width: 100%; height: 100%; object-fit: contain; animation: bob 2.4s ease-in-out infinite; filter: drop-shadow(0 0 6px rgba(0,236,151,.35)); }
.room .kat.tap img { animation: squash .18s ease; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes squash { 0% { transform: scale(1); } 40% { transform: scale(1.12, .9); } 100% { transform: scale(1); } }
.foragers { position: absolute; left: 4%; bottom: 8%; width: 30%; height: 12%; display: flex; gap: 2px; align-items: flex-end; pointer-events: none; }
.foragers img { width: 22%; animation: dig .9s steps(2) infinite; }
@keyframes dig { 0% { transform: translateY(0); } 100% { transform: translateY(-2px); } }
.fx { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.float { position: absolute; font-family: var(--px); font-size: 12px; color: var(--glow); animation: rise .8s ease-out forwards; text-shadow: 0 0 6px rgba(0,236,151,.6); }
.float.gold { color: var(--gold); } .float.red { color: var(--red); }
@keyframes rise { 0% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(-46px); } }
.particle { position: absolute; width: 8px; height: 8px; animation: dirt .6s ease-out forwards; }
@keyframes dirt { 0% { opacity: 1; transform: translate(0,0); } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)); } }
.coin { position: absolute; width: 32px; height: 32px; top: -40px; cursor: pointer; pointer-events: auto; animation: fall var(--dur) linear forwards; filter: drop-shadow(0 0 4px rgba(0,236,151,.5)); }
@keyframes fall { to { transform: translateY(calc(100% + 520px)) rotate(180deg); } }
.beetle { position: absolute; width: 28px; height: 28px; bottom: 6%; cursor: pointer; pointer-events: auto; animation: scurry 5s linear forwards; }
@keyframes scurry { from { left: -30px; } to { left: 105%; } }
.hawk { position: absolute; top: 6%; left: -20%; width: 64px; height: 64px; cursor: pointer; animation: glide 8s linear forwards; }
.hawk img { width: 100%; height: 100%; filter: drop-shadow(0 6px 4px rgba(0,0,0,.5)); animation: flap .3s steps(1) infinite; }
.hawk .px { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); color: var(--red); white-space: nowrap; }
@keyframes glide { 0% { left: -20%; } 45% { left: 40%; } 55% { left: 42%; } 100% { left: 110%; } }
@keyframes flap { 0% { transform: translateY(0); } 50% { transform: translateY(2px); } }
.bubble { position: absolute; left: 50%; bottom: 44%; transform: translateX(-50%); background: var(--cream); color: var(--dark); padding: 6px 9px; border-radius: 10px; text-transform: none; letter-spacing: 0; font-size: 11px; max-width: 70%; text-align: center; }
.bubble::after { content: ""; position: absolute; left: 50%; bottom: -6px; width: 10px; height: 10px; background: var(--cream); transform: translateX(-50%) rotate(45deg); }
.banner { position: absolute; left: 10px; right: 10px; top: 10px; padding: 8px 10px; border-radius: 10px; background: rgba(16,4,37,.85); border: 1px solid var(--line); font-size: 13px; text-align: center; }
.banner.rain { border-color: rgba(0,236,151,.5); color: var(--glow); }
.banner.raid { border-color: rgba(255,107,92,.6); color: var(--red); }
.banner.gold { border-color: rgba(244,183,40,.6); color: var(--gold); }
.shop { padding: 12px 12px 14px; border-top: 1px solid var(--line); }
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.tab { padding: 10px 6px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-family: var(--body); font-weight: 600; font-size: 14px; cursor: pointer; }
.tab.is-on { background: var(--sand); color: var(--dark); }
.tab.is-locked { opacity: .55; }
.items { display: grid; gap: 8px; margin-top: 10px; }
.item { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); text-align: left; color: var(--ink); font-family: var(--body); cursor: pointer; width: 100%; }
.item:disabled { opacity: .55; cursor: default; }
.item .t { font-weight: 600; } .item .e { font-size: 13px; color: var(--ink-2); } .item .lock { font-size: 12px; color: var(--red); }
.item .cost { font-family: var(--display); font-weight: 800; font-size: 16px; color: var(--near); white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.item.owned .cost { color: var(--gold); }
.item .lvl { font-family: var(--px); font-size: 10px; color: var(--gold); margin-left: 6px; }
.demo-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.demo-foot .px { margin-left: auto; }

/* ── steps ── */
.step-list { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 14px; }
.step-list li { display: grid; grid-template-columns: 56px 1fr; gap: 14px; align-items: start; padding: 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.step-list img { width: 56px; height: 56px; object-fit: contain; }
.step-list p { margin: 6px 0 0; color: var(--ink-2); font-size: 15.5px; }

/* ── tree ── */
.branches { display: grid; gap: 14px; margin-top: 20px; }
.branch { border-radius: 16px; border: 1px solid var(--line); background: var(--surface); overflow: hidden; }
.branch header { padding: 12px 14px; display: flex; align-items: center; gap: 10px; }
.branch header img { width: 36px; height: 36px; }
.branch h3 { font-size: 18px; }
.branch header .px { margin-left: auto; }
.branch.rail header { background: rgba(0,236,151,.08); } .branch.shield header { background: rgba(244,183,40,.08); } .branch.burrow header { background: rgba(232,197,138,.08); }
.branch ol { list-style: none; margin: 0; padding: 4px 14px 10px; counter-reset: n; }
.branch li { padding: 10px 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 26px 1fr; gap: 8px; }
.branch li::before { counter-increment: n; content: counter(n); font-family: var(--px); font-size: 11px; color: var(--ink-3); padding-top: 3px; }
.branch li b { display: block; } .branch li span { color: var(--ink-2); font-size: 14px; } .branch li em { display: block; color: var(--ink-3); font-size: 13.5px; margin-top: 3px; }
.branch.shield .gate { padding: 10px 14px; font-size: 13px; color: var(--gold); border-top: 1px dashed rgba(244,183,40,.4); }

/* ── split ── */
.split { display: grid; gap: 18px; }
.split-art img { border-radius: 18px; border: 1px solid var(--line); image-rendering: pixelated; }
.split-copy p { color: var(--ink-2); }
.split-copy em { color: var(--glow); font-style: normal; }

/* ── katdex ── */
.cards { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 16px 0 12px; margin: 0 -22px; padding-left: 22px; padding-right: 22px; -webkit-overflow-scrolling: touch; }
.card { flex: 0 0 78%; max-width: 320px; scroll-snap-align: start; border-radius: 18px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.card img { width: 100%; aspect-ratio: 16/10; object-fit: cover; image-rendering: pixelated; }
.card .body { padding: 12px 14px 14px; } .card h3 { font-size: 17px; } .card p { margin: 6px 0 0; font-size: 14.5px; color: var(--ink-2); }
.card .px { display: block; margin-top: 8px; }
.card.rail .px { color: var(--near); } .card.shield .px { color: var(--gold); } .card.burrow .px, .card.kat .px { color: var(--sand); }

/* ── faq ── */
.faq dl { margin: 20px 0 0; display: grid; gap: 12px; }
.faq dt { font-weight: 600; } .faq dd { margin: 4px 0 0; color: var(--ink-2); padding-bottom: 12px; border-bottom: 1px solid var(--line); }

/* ── footer ── */
.foot { padding: 48px 22px 56px; max-width: 760px; margin: 0 auto; text-align: center; }
.foot-brand { display: inline-flex; align-items: center; gap: 12px; text-align: left; }
.foot-brand img { border-radius: 10px; image-rendering: pixelated; }
.foot-brand div { display: grid; } .foot-brand strong { font-family: var(--display); font-size: 20px; }
.official { font-size: 13px; color: var(--ink-3); margin: 18px auto 12px; max-width: 52ch; }
.foot-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; }
.copy { margin-top: 18px; }

/* ── reveal ── */
.reveal { opacity: 1; transform: none; }
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
  .reveal.in { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) { .room .kat img, .btn-primary, .foragers img, .hawk img { animation: none !important; } }

/* ── desktop ── */
@media (min-width: 760px) {
  body { font-size: 18px; }
  .hero { grid-template-rows: none; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: center; min-height: 88vh; max-width: 1180px; margin: 0 auto; padding: 40px 32px; gap: 32px; }
  .hero-art { height: 72vh; border-radius: 28px; order: 2; }
  .hero-art::after { background: linear-gradient(to right, rgba(16,4,37,.35), rgba(16,4,37,0) 40%), linear-gradient(to bottom, rgba(16,4,37,0) 60%, rgba(16,4,37,.6)); }
  .hero-copy { margin-top: 0; padding: 0; }
  .live { max-width: 1116px; margin: 0 auto; }
  .live-inner { grid-template-columns: repeat(4, 1fr); }
  .section { padding: 96px 32px 32px; }
  .demo { display: grid; grid-template-columns: 1.05fr 1fr; }
  .demo .hud { grid-column: 1; } .demo .room { grid-column: 1; max-height: none; } .demo .shop { grid-column: 2; grid-row: 1 / span 2; border-top: 0; border-left: 1px solid var(--line); }
  .section#burrow { max-width: 1000px; }
  .step-list { grid-template-columns: 1fr 1fr; }
  .branches { grid-template-columns: repeat(3, 1fr); max-width: 1100px; }
  .section#tree { max-width: 1100px; }
  .split { grid-template-columns: 1fr 1fr; align-items: center; max-width: 1000px; }
  .split.flip .split-art { order: 2; }
  .card { flex-basis: 300px; }
}

/* ── signup ── */
.signup-form { margin-top: 18px; display: grid; gap: 12px; max-width: 460px; padding: 18px; border-radius: 18px; border: 1px solid rgba(0,236,151,.3); background: rgba(0,236,151,.05); }
.signup-form label { display: grid; gap: 6px; }
.signup-form label em { font-style: normal; color: var(--ink-3); text-transform: none; letter-spacing: 0; }
.signup-form input { width: 100%; padding: 13px 14px; border-radius: 12px; border: 1px solid var(--line); background: rgba(16,4,37,.7); color: var(--ink); font: inherit; font-size: 16px; }
.signup-form input:focus { outline: 2px solid var(--near); outline-offset: 0; border-color: transparent; }
.signup-form .at { display: grid; grid-template-columns: auto 1fr; align-items: center; border-radius: 12px; border: 1px solid var(--line); background: rgba(16,4,37,.7); }
.signup-form .at span { padding: 0 0 0 14px; color: var(--ink-3); font-weight: 600; }
.signup-form .at input { border: 0; background: transparent; padding-left: 4px; }
.signup-form .at:focus-within { outline: 2px solid var(--near); }
.signup-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.signup-form button { justify-content: center; }
.signup-form button[disabled] { opacity: .6; animation: none; }
.signup-note { font-size: 13px; color: var(--ink-3); margin: 0; }
.signup-msg { margin: 0; font-weight: 600; min-height: 1.4em; }
.signup-msg.ok { color: var(--glow); } .signup-msg.err { color: var(--red); }
.signup-form.done label, .signup-form.done button, .signup-form.done .signup-note { display: none; }
