:root {
  --ink: #0e0c1c;
  --ink-2: #15122a;
  --panel: #1c1934;
  --line: #2f2a52;
  --fg: #f1eeff;
  --muted: #b0aacf;
  --dim: #77719a;
  --teal: #3fd0c9;
  --teal-2: #8ff0e8;
  --sunset: #ff9f43;
  --gold: #ffc93c;
  --pink: #ff6f91;
  --rainbow: linear-gradient(90deg, #ff5d73 0%, #ff9f43 20%, #ffc93c 38%, #5cdb95 56%, #3fb8f5 76%, #8b6cff 100%);
  --round: "Baloo 2", "Inter", system-ui, sans-serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --brand-wasmad: "Chakra Petch", "Inter", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--ink); color: var(--fg); font: 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: var(--teal-2); text-decoration: none; }
a:hover { color: var(--fg); }
img { image-rendering: pixelated; }
kbd { font: 500 12px var(--mono); color: var(--fg); background: var(--panel); border: 1px solid var(--line); border-bottom-width: 2px; padding: 1px 5px; border-radius: 4px; margin: 0 1px; }

.rainbow { background: var(--rainbow); -webkit-background-clip: text; background-clip: text; color: transparent; }
.river { color: #8fd3ff; }

/* ---- Nav ----------------------------------------------------------------- */

.nav {
  position: fixed; inset: 0 0 auto; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px clamp(16px, 4vw, 48px);
  background: linear-gradient(var(--ink) 0%, rgba(14, 12, 28, 0.72) 70%, transparent);
  backdrop-filter: blur(6px);
}
.brand { font: 800 28px/1 var(--round); letter-spacing: -0.01em; white-space: nowrap; }
.nav-links { display: flex; gap: clamp(12px, 2.4vw, 28px); font-size: 15px; }
.nav-links a { color: var(--muted); }
.nav-links a:hover, .nav-links .gh { color: var(--fg); }

/* ---- Hero ---------------------------------------------------------------- */

:root { --cw: max(min(1000px, calc(100vw - 32px), calc((100svh - 514px) * 2.7)), min(560px, calc(100vw - 32px))); --ch: calc(var(--cw) * 0.56); }
.hero { position: relative; min-height: calc(100svh - 64px); display: grid; grid-template-rows: 1fr auto; justify-items: center; padding: 84px clamp(16px, 4vw, 48px) 0; isolation: isolate; overflow: hidden; }
.hero-sky {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(14, 12, 28, 0.55) 0%, rgba(14, 12, 28, 0) 22%, rgba(14, 12, 28, 0) 70%, rgba(14, 12, 28, 0.55) 100%),
    url("assets/hero.png") center 62% / cover no-repeat;
  image-rendering: pixelated;
}
.hero-copy { max-width: 820px; text-align: center; align-self: start; padding: 2vh 0 24px; }
.hero-copy::before {
  content: ""; position: absolute; z-index: -1; left: 50%; top: 60px; width: min(1100px, 120vw); height: 560px; transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(14, 12, 28, 0.6), rgba(14, 12, 28, 0)); pointer-events: none;
}
.eyebrow { font: 600 13px var(--sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); margin: 0 0 10px; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.5); }
h1 { font: 800 clamp(38px, min(5vw, 7.4svh), 68px)/1 var(--round); margin: 0 0 14px; letter-spacing: -0.02em; text-wrap: balance; text-shadow: 0 2px 18px rgba(0, 0, 0, 0.55), 0 1px 2px rgba(0, 0, 0, 0.6); }
.lede { font-size: clamp(16px, 1.3vw, 18px); color: #f0ecff; max-width: 40em; margin: 0 auto 22px; text-shadow: 0 2px 6px rgba(0, 0, 0, 0.7); }
.ctas { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.ctas.left { justify-content: flex-start; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px;
  font: 700 16px var(--round); color: var(--fg);
  background: rgba(28, 25, 52, 0.8); border: 2px solid var(--line); border-radius: 999px;
  box-shadow: 0 4px 0 #000; transition: transform 0.08s, box-shadow 0.08s, border-color 0.15s;
}
.btn:hover { border-color: var(--teal); color: var(--fg); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #000; }
.btn.primary { background: var(--teal); border-color: var(--teal-2); color: #082a2c; }
.btn.primary:hover { background: var(--teal-2); }

/* The console peeks out of the separator; it rises when played. */
.dock { width: var(--cw); height: calc(var(--ch) * 0.58); overflow: hidden; scroll-margin-top: 80px; transition: height 0.7s cubic-bezier(0.2, 0.9, 0.25, 1.08); }
.dock.raised { height: calc(var(--ch) + 28px); }
.console { position: relative; width: var(--cw); height: var(--ch); margin-top: 14px; user-select: none; -webkit-user-select: none; touch-action: none; }
.console svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.console .screen { position: absolute; left: 26%; top: 14.2857%; width: 48%; height: 57.1429%; background: #000; }
.console .screen::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(125deg, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0.015) 38%, transparent 38.5%); }
.console canvas { width: 100%; height: 100%; display: block; image-rendering: pixelated; image-rendering: crisp-edges; }
.engage {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  padding: 10px 18px; border-radius: 999px; cursor: pointer;
  background: rgba(14, 12, 28, 0.78); color: var(--fg); border: 2px solid rgba(255, 255, 255, 0.3);
  font: 700 16px var(--round); box-shadow: 0 4px 0 #000; transition: opacity 0.2s; white-space: nowrap;
}
.console.engaged .engage { opacity: 0; pointer-events: none; }
.console .key { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.console .hit { fill: #000; fill-opacity: 0; pointer-events: all; }
.console .hit.pressed { fill-opacity: 0.3; }
.console .btn-round { transition: transform 0.05s; transform-box: fill-box; transform-origin: center; }
.console .btn-round.pressed { transform: translateY(3px) scale(0.96); filter: brightness(0.82); }
.console path.key.pressed { transform: translateY(4px); }
.console .emboss { font: italic 700 22px var(--brand-wasmad); fill: rgba(255, 255, 255, 0.6); }
.console .small-label { font: 600 13px var(--sans); letter-spacing: 0.12em; fill: rgba(255, 255, 255, 0.7); }
.console .lens-label { font: 600 10px var(--sans); letter-spacing: 0.24em; fill: #7d7e96; text-anchor: middle; }
.console .lens-logo { font: italic 700 36px var(--brand-wasmad); fill: #e4e0f7; }
.console .lens-chip { font: italic 700 19px var(--brand-wasmad); letter-spacing: 1px; fill: #15122a; }
.console .led { filter: drop-shadow(0 0 6px #3dff9a); }

.separator { height: 6px; background: var(--rainbow); box-shadow: 0 0 24px rgba(63, 184, 245, 0.45); position: relative; z-index: 2; }
.status { display: grid; justify-items: center; gap: 6px; padding: 18px 16px 0; text-align: center; }
.now-playing { margin: 0; font: 600 15px var(--sans); }
.now-playing .err { color: var(--pink); }
.keys { margin: 0; font-size: 13px; color: var(--muted); }

/* ---- Sections ------------------------------------------------------------ */

.section { max-width: 1200px; margin: 0 auto; padding: 96px clamp(16px, 4vw, 48px) 24px; scroll-margin-top: 40px; }
.section-head { max-width: 44em; margin-bottom: 36px; }
h2 { font: 800 clamp(32px, 3.8vw, 48px)/1.05 var(--round); letter-spacing: -0.02em; margin: 0 0 12px; }
h3 { font: 700 20px/1.25 var(--round); margin: 0 0 6px; }
.section-head p:not(.eyebrow) { color: var(--muted); font-size: 17px; margin: 0; }

/* How to fish */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin: 0; }
.step { margin: 0; background: var(--ink-2); border: 2px solid var(--line); border-radius: 18px; overflow: hidden; }
.step img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; border-bottom: 2px solid var(--line); }
.step figcaption { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; padding: 20px 20px 22px; }
.step figcaption > span { width: 36px; height: 36px; display: grid; place-items: center; background: var(--teal); color: #082a2c; font: 800 20px var(--round); border-radius: 50%; box-shadow: 0 3px 0 #000; }
.step p { margin: 0; color: var(--muted); font-size: 15px; }

/* Fish log */
.fish-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 20px; }
.fish { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 18px; padding: 18px; background: var(--ink-2); border: 2px solid var(--line); border-radius: 18px; position: relative; }
.fish-art { width: 128px; height: 128px; border-radius: 14px; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 40%, rgba(63, 184, 245, 0.28), rgba(63, 184, 245, 0.06) 70%), #13213a; }
.fish-art img { width: 128px; height: 128px; filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.35)); }
.fish p { margin: 0 0 10px; color: var(--muted); font-size: 14.5px; }
.fish dl { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; }
.fish dl div { display: grid; }
.fish dt { font: 600 11px var(--sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); }
.fish dd { margin: 0; font: 600 14px var(--sans); }
.chip { display: inline-block; padding: 0 9px; border-radius: 999px; font-size: 12.5px; }
.chip.river { background: rgba(63, 184, 245, 0.18); color: #9fdcff; }
.chip.pond { background: rgba(92, 219, 149, 0.18); color: #9df0c2; }
.pips { display: flex; gap: 4px; align-items: center; padding-top: 5px; }
.pips i { width: 14px; height: 8px; border-radius: 2px; background: var(--line); }
.pips i.on { background: var(--sunset); }
.rarity { color: var(--muted); }
.uncommon .rarity { color: #8fd3ff; }
.rare .rarity { color: #c3a6ff; }
.legendary { border-color: rgba(255, 201, 60, 0.6); box-shadow: 0 0 0 1px rgba(255, 201, 60, 0.25), 0 0 36px rgba(255, 201, 60, 0.12); }
.legendary .rarity { color: var(--gold); }
.legendary .fish-art { background: radial-gradient(circle at 50% 40%, rgba(255, 201, 60, 0.35), rgba(255, 201, 60, 0.05) 70%), #2a2030; }

/* Controls */
.controls table { width: 100%; max-width: 820px; border-collapse: collapse; font-size: 15px; background: var(--ink-2); border: 2px solid var(--line); border-radius: 14px; overflow: hidden; }
.controls th, .controls td { text-align: left; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.controls th { font: 700 15px var(--round); color: var(--fg); background: var(--panel); }
.controls tr:last-child td { border-bottom: 0; }
.controls td:first-child { font-weight: 600; }
.note { color: var(--muted); font-size: 15px; }

/* Built on WASM-AD */
.built { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 40px; align-items: center; padding: 36px; background: linear-gradient(135deg, #1a1638, #12102a); border: 2px solid var(--line); border-radius: 22px; }
.built p { color: var(--muted); }
.built-shot { width: 100%; height: auto; border-radius: 12px; border: 2px solid var(--line); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5); }
.wasmad { display: inline-flex; align-items: center; gap: 6px; font-family: var(--brand-wasmad); font-style: italic; font-weight: 700; white-space: nowrap; vertical-align: baseline; }
.wasmad b { font-weight: 700; }
.wasmad i { font-style: italic; font-size: 0.55em; padding: 3px 10px 2px 9px; background: #b7a4ff; color: #0c0a18; clip-path: polygon(16% 0, 100% 0, 84% 100%, 0 100%); }

/* Footer */
.footer { max-width: 1200px; margin: 72px auto 0; padding: 32px clamp(16px, 4vw, 48px) 56px; display: grid; justify-items: center; gap: 6px; text-align: center; color: var(--muted); font-size: 14px; }
.footer p { margin: 0; }
.foot-brand { font: 800 36px/1.1 var(--round); margin-bottom: 10px !important; }
.dim { color: var(--dim); }

/* ---- Responsive ---------------------------------------------------------- */

@media (max-width: 960px) {
  .steps { grid-template-columns: minmax(0, 1fr); max-width: 560px; }
  .built { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .nav-links a:not(.gh):not([href="#log"]) { display: none; }
  .nav-links { gap: 16px; font-size: 14px; }
  .brand { font-size: 23px; }
  .hero { padding-top: 80px; }
  .dock { height: calc(var(--ch) * 0.62); }
  .keys { display: none; }
  .engage { font-size: 12px; padding: 6px 10px; }
  .fish-grid { grid-template-columns: minmax(0, 1fr); }
  .fish { grid-template-columns: 96px minmax(0, 1fr); }
  .fish-art, .fish-art img { width: 96px; height: 96px; }
  .controls th, .controls td { padding: 10px 12px; }
  .built { padding: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .dock { transition: none; }
}
