:root {
  --ink: #1b1512;
  --paper: #f5eee5;
  --plaster: #d8b2a5;
  --tan: #c47f3c;
  --tan-dark: #87532a;
  --glass: #9fd3c7;
  --glass-deep: #2f6f66;
  --dark: #16120f;
  --rec: #ff3b30;
  --pix: "Pixelify Sans", "Courier New", monospace;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --sans: Inter, system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 17px/1.6 var(--sans); overflow-x: hidden; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--pix); font-weight: 700; line-height: 1.02; margin: 0; letter-spacing: 0.01em; }
.wrap { width: min(1120px, 100% - 32px); margin: 0 auto; }
.kicker { font: 700 13px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.16em; color: var(--tan-dark); margin: 0 0 14px; }

/* nav */
.nav { position: fixed; inset: 0 0 auto 0; z-index: 20; display: flex; align-items: center; gap: 18px; padding: 12px 18px; background: rgba(22, 18, 15, 0.78); color: #fff; backdrop-filter: blur(10px); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 700 19px var(--pix); }
.brand img { image-rendering: pixelated; border: 2px solid #fff; }
.links { display: flex; gap: 18px; margin-left: auto; font: 500 14px var(--mono); }
.links a { text-decoration: none; opacity: 0.85; }
.links a:hover { opacity: 1; text-decoration: underline; }

/* buttons */
.btn, .dock button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 0 16px; border: 2px solid var(--ink); background: #fff; color: var(--ink); font: 700 15px var(--pix); text-decoration: none; cursor: pointer; box-shadow: 4px 4px 0 var(--ink); transition: transform 0.08s, box-shadow 0.08s; }
.btn:hover, .dock button:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
.btn:active, .dock button:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn-main { background: var(--tan); color: #fff; }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 14px; box-shadow: 3px 3px 0 #000; border-color: #000; }
.btn[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }

/* hero */
.hero { position: relative; height: 100svh; min-height: 620px; background: var(--dark); }
.stage-wrap { position: absolute; inset: 0; overflow: hidden; }
#stage { display: block; width: 100%; height: 100%; touch-action: pan-y; cursor: grab; }
#stage:active { cursor: grabbing; }
.hud { position: absolute; top: 70px; right: 18px; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font: 500 12px/1.3 var(--mono); color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8); pointer-events: none; text-transform: uppercase; letter-spacing: 0.06em; }
.hud b { color: var(--glass); }
.rec { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.rec::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--rec); animation: rec 1.2s steps(2) infinite; }
@keyframes rec { 50% { opacity: 0; } }
.hint { position: absolute; left: 50%; bottom: 92px; transform: translateX(-50%); margin: 0; font: 500 12px var(--mono); color: #fff; opacity: 0.75; text-shadow: 0 1px 2px #000; white-space: nowrap; pointer-events: none; }
.toast { position: absolute; left: 50%; top: 22%; transform: translate(-50%, -8px); padding: 10px 16px; background: var(--ink); color: #fff; font: 700 16px var(--pix); border: 2px solid #fff; box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.5); opacity: 0; transition: opacity 0.2s, transform 0.2s; pointer-events: none; text-align: center; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.dock { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 10px; background: rgba(22, 18, 15, 0.72); border: 2px solid rgba(255, 255, 255, 0.18); backdrop-filter: blur(8px); flex-wrap: nowrap; }
.dock button { min-height: 38px; padding: 0 12px; font-size: 14px; white-space: nowrap; }
.dock button[aria-pressed="true"] { background: var(--glass); }
.dock .enhance { background: #1f2a26; color: #7dffc0; border-color: #7dffc0; box-shadow: 4px 4px 0 #000; font-family: var(--mono); letter-spacing: 0.08em; text-transform: uppercase; font-size: 13px; }
.dock .snd { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.5); box-shadow: none; font-family: var(--mono); font-size: 12px; }
.res { display: flex; align-items: center; gap: 8px; color: #fff; font: 500 12px var(--mono); text-transform: uppercase; }
.res input { width: 110px; accent-color: var(--glass); }
.nogl { display: none; position: absolute; inset: 40% 16px auto; color: #fff; text-align: center; font: 700 18px var(--pix); }
.no-webgl .nogl { display: block; }
.no-webgl .dock, .no-webgl .hint, .no-webgl .hud { display: none; }

.hero-card { position: absolute; left: max(24px, calc((100vw - 1240px) / 2)); top: 50%; transform: translateY(-46%); width: 370px; padding: 26px 26px 22px; background: rgba(245, 238, 229, 0.94); border: 3px solid var(--ink); box-shadow: 8px 8px 0 var(--ink); z-index: 2; }
.tag { display: inline-block; margin-bottom: 14px; padding: 4px 8px; background: var(--ink); color: #fff; font: 700 11px var(--mono); letter-spacing: 0.12em; text-transform: uppercase; text-decoration: none; }
.tag[hidden] { display: none; }
h1 { font-size: 58px; line-height: 0.92; text-shadow: 3px 3px 0 var(--glass); }
.ticker { margin: 10px 0 0; font: 700 18px var(--mono); color: var(--tan-dark); }
.lead { margin: 10px 0 16px; font-size: 16px; }
.ca { display: flex; align-items: center; border: 2px solid var(--ink); background: #fff; font: 500 13px var(--mono); }
.ca span { padding: 0 10px; align-self: stretch; display: flex; align-items: center; background: var(--ink); color: #fff; font-weight: 700; }
.ca code { flex: 1; min-width: 0; padding: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ca button { align-self: stretch; padding: 0 12px; border: 0; border-left: 2px solid var(--ink); background: var(--glass); font: 700 13px var(--mono); cursor: pointer; }
.ca button:disabled { opacity: 0.5; cursor: default; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.actions .btn { min-height: 38px; padding: 0 12px; font-size: 14px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; border-top: 2px dashed rgba(27, 21, 18, 0.3); padding-top: 12px; }
.stats dt { font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.7; }
.stats dd { margin: 2px 0 0; font: 700 17px var(--pix); }

/* story */
.story { padding: 110px 0; background:
  linear-gradient(rgba(245, 238, 229, 0.86), rgba(245, 238, 229, 0.86)),
  repeating-linear-gradient(0deg, rgba(47, 111, 102, 0.35) 0 2px, transparent 2px 46px),
  repeating-linear-gradient(90deg, rgba(47, 111, 102, 0.35) 0 2px, transparent 2px 46px),
  linear-gradient(var(--glass), #cfe9e1); }
.story-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 56px; align-items: start; }
.story h2 { font-size: clamp(34px, 5vw, 54px); }
.story-text p { margin: 0 0 16px; font-size: 18px; }
.story-text p:first-child::first-letter { font: 700 3.1em/0.8 var(--pix); float: left; margin: 6px 8px 0 0; color: var(--tan); }

/* specs */
.specs { padding: 100px 0; background: var(--dark); color: #f5eee5; }
.specs .kicker { color: var(--glass); }
.specs h2 { font-size: clamp(32px, 4.6vw, 50px); margin-bottom: 36px; }
.spec-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.spec { padding: 20px; border: 2px solid rgba(159, 211, 199, 0.4); background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 2px, transparent 2px 7px); }
.spec span { font: 500 12px var(--mono); text-transform: uppercase; letter-spacing: 0.1em; color: var(--glass); }
.spec b { display: block; margin: 6px 0; font: 700 28px var(--pix); }
.spec p { margin: 0; opacity: 0.75; font-size: 15px; }

/* buy */
.buy { padding: 100px 0; background: var(--plaster); }
.buy h2 { font-size: clamp(32px, 4.6vw, 50px); margin-bottom: 32px; }
.steps { list-style: none; counter-reset: s; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.steps li { counter-increment: s; padding: 22px 18px; background: var(--paper); border: 3px solid var(--ink); box-shadow: 6px 6px 0 var(--ink); }
.steps li::before { content: counter(s); display: inline-grid; place-items: center; width: 34px; height: 34px; margin-bottom: 12px; background: var(--tan); color: #fff; font: 700 18px var(--pix); }
.steps h3 { font-size: 22px; margin-bottom: 6px; }
.steps p { margin: 0; font-size: 15px; }

.foot { padding: 40px 0 60px; background: var(--dark); color: rgba(245, 238, 229, 0.75); font-size: 14px; }
.foot p { margin: 0 0 10px; max-width: 760px; }
.foot [hidden] { display: none; }
.domain { font: 500 13px var(--mono); color: var(--glass); }

/* tablet */
@media (max-width: 980px) {
  .hero { height: auto; min-height: 0; display: flex; flex-direction: column; }
  .stage-wrap { position: relative; height: 74svh; min-height: 480px; }
  .hero-card { position: relative; left: auto; top: auto; transform: none; width: auto; margin: -28px 16px 28px; }
  .dock { left: 12px; right: 12px; bottom: 40px; transform: none; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 8px; }
  .hint { bottom: 150px; }
  .story-grid { grid-template-columns: 1fr; gap: 20px; }
  .spec-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
}

/* phone */
@media (max-width: 640px) {
  body { font-size: 16px; }
  .links { display: none; }
  .nav { padding: 10px 12px; gap: 10px; }
  .nav .btn.small { margin-left: auto; }
  .brand span { font-size: 16px; }
  .stage-wrap { height: 78svh; min-height: 520px; }
  .hud { top: 62px; right: 12px; font-size: 10px; }
  .hint { bottom: 132px; font-size: 11px; }
  .dock { left: 12px; right: 12px; bottom: 12px; transform: none; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 8px; }
  .dock button { min-height: 36px; padding: 0 10px; font-size: 13px; box-shadow: 3px 3px 0 var(--ink); }
  .res input { width: 90px; }
  .hero-card { padding: 20px 18px; box-shadow: 6px 6px 0 var(--ink); }
  h1 { font-size: 48px; }
  .stats dd { font-size: 15px; }
  .story, .specs, .buy { padding: 70px 0; }
  .spec-grid, .steps { grid-template-columns: 1fr; }
  .spec b { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .rec::before { animation: none; } }
