/* =====================================================================
   snowball — the whole visual identity is the :root block below.
   Nothing further down hardcodes a colour, a face or a size, so a
   reskin is these ~20 lines plus the PALETTE block in app.js (the
   pixel scene has its own palette, because canvas can't read CSS vars).
   ===================================================================== */

/* fonts are loaded by a <link> in index.html, not an @import — an @import
   here serialises the download behind this stylesheet, and the page then
   measures `ch` against the fallback face and wraps headings wrong. */

:root {
  --paper: #f2f4f6;   /* the light band                        */
  --ink:   #141a22;   /* text, every rule, the dark band       */
  --mute:  #5c6672;   /* secondary prose                       */
  --ice:   #8aa0b5;   /* the one accent: numerals, labels      */
  --line:  #141a22;

  --dark-panel: #0f141c;  /* boxes that stay dark on both bands */
  --dark-line:  #3a4552;
  --dark-ink:   #e8eef5;
  --dark-mute:  #8a97a8;

  --pump:  #00ff88;   /* the buy button, and only the buy button */
  --live:  #5dca8a;
  --bad:   #e07a7a;

  --pixel: "Silkscreen", monospace;   /* headings, labels, furniture */
  --mono:  "Space Mono", ui-monospace, monospace;  /* all prose      */

  --pad: clamp(1rem, 4vw, 2.75rem);
  --wrap: 920px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; }

/* ---------- nav ---------------------------------------------------- */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.85rem var(--pad);
  color: #f4f7fb;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}
.nav-brand { font-family: var(--pixel); font-size: 0.85rem; letter-spacing: 0.02em; }
.nav-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.35rem 1rem; font-size: 0.75rem; text-transform: lowercase; color: #d7e2ee; }
.nav-links a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- hero --------------------------------------------------- */

.hero { position: relative; display: grid; min-height: 100dvh; }
.hero-stage { position: absolute; inset: 0; z-index: 0; }

.snowball-canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #070b12;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.hero-plate {
  position: relative;
  z-index: 2;
  place-self: end start;
  max-width: min(38rem, 92vw);
  padding: 0 var(--pad) clamp(2rem, 6vh, 3.5rem);
  color: #f4f7fb;
  animation: rise 0.7s steps(8, end) both;
}
.hero-kicker {
  margin: 0 0 0.65rem;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #b8c9db;
}
.brand {
  margin: 0 0 0.85rem;
  font-family: var(--pixel);
  font-size: clamp(3rem, 11vw, 5.6rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
  color: #fff;
  text-shadow: 0 1px #0a1018, 0 2px #0a1018, 0 0 28px rgba(0, 0, 0, 0.65);
}
.claim {
  margin: 0 0 1rem;
  max-width: 18ch;
  font-family: var(--pixel);
  font-size: clamp(1.15rem, 3.6vw, 2rem);
  line-height: 1.35;
  color: #fff;
  text-shadow: 0 1px #0a1018, 0 0 20px rgba(0, 0, 0, 0.55);
}
.tag {
  margin: 0 0 1.5rem;
  max-width: 32ch;
  font-size: clamp(0.95rem, 2.1vw, 1.2rem);
  line-height: 1.55;
  color: #d5e2f0;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.75);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- buttons ------------------------------------------------ */

.cta-row { display: flex; flex-wrap: wrap; gap: 0.6rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 0.95rem;
  border: 2px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--pixel);
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  cursor: pointer;
}
.btn:hover:not(:disabled) { translate: 2px 2px; }
.btn:disabled { opacity: 0.35; cursor: not-allowed; }

.btn-ink  { background: var(--ink); color: var(--paper); }
.btn-line { background: none; }
.btn-pump { background: var(--pump); border-color: var(--pump); color: #0a0f0c; }

.hero .btn-line { background: none; border-color: #f4f7fb; color: #f4f7fb; }
.hero .btn-ink  { background: #f4f7fb; border-color: #f4f7fb; color: var(--ink); }
.hero .btn-pump:hover { background: #3dffaa; border-color: #3dffaa; }

/* ---------- bands -------------------------------------------------- */

.strip { padding: clamp(4.5rem, 12vw, 7.5rem) 0; border-top: 2px solid var(--ink); }
.strip-ink { background: var(--ink); color: var(--paper); border-top-color: var(--ink); }
.strip-end { border-bottom: 2px solid var(--ink); }
.strip-grid {
  background-image: radial-gradient(var(--ink) 0.6px, transparent 0.6px);
  background-size: 10px 10px;
  background-position: 0 0;
}

.wrap { width: min(var(--wrap), calc(100% - 2 * var(--pad))); margin: 0 auto; }

.phrase {
  margin: 0 0 1.75rem;
  max-width: 14ch;
  font-family: var(--pixel);
  font-size: clamp(1.35rem, 4.2vw, 2.35rem);
  line-height: 1.35;
  letter-spacing: 0.01em;
}
.phrase-light { color: var(--paper); }

.slim { margin: 0 0 2rem; max-width: 34ch; font-size: 0.92rem; color: var(--mute); }
.slim.wide { max-width: 48ch; font-size: 1rem; }
.slim.light, .strip-ink .slim { color: #a8b4c0; }

/* ---------- the six facts ------------------------------------------ */

.plain-list { display: grid; margin: 0 0 2rem; padding: 0; list-style: none; border-top: 2px solid var(--ink); }
.plain-list li {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr);
  gap: 0.85rem 1.1rem;
  padding: 1.35rem 0;
  border-bottom: 2px solid var(--ink);
}
.plain-n { padding-top: 0.15rem; font-family: var(--pixel); font-size: 0.72rem; letter-spacing: 0.04em; color: var(--ice); }
.plain-list h3 {
  margin: 0 0 0.45rem;
  max-width: 22ch;
  font-family: var(--pixel);
  font-size: clamp(0.85rem, 2.4vw, 1.05rem);
  line-height: 1.35;
}
.plain-list p { margin: 0; max-width: 48ch; font-size: 0.95rem; line-height: 1.65; color: var(--mute); }
.plain-cta { margin-top: 0.25rem; }

/* ---------- the ledger --------------------------------------------- */

.ledger { border: 2px solid var(--ink); background: var(--paper); }
.ledger-head, .ledger-foot {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0.85rem;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 2px solid var(--ink);
}
.ledger-foot { border-bottom: 0; border-top: 2px solid var(--ink); color: var(--mute); }
.ledger-rows { margin: 0; padding: 0; list-style: none; }
.ledger-rows li {
  display: grid;
  grid-template-columns: 7.5rem 1fr 1fr;
  gap: 0.5rem;
  padding: 0.7rem 0.85rem;
  font-size: 0.82rem;
  border-bottom: 1px solid #c5ccd4;
}
.ledger-rows li:last-child { border-bottom: 0; }
.ledger-rows .k { align-self: center; font-family: var(--pixel); font-size: 0.58rem; letter-spacing: 0.04em; }
.ledger-rows .v { font-size: 1.05rem; font-weight: 700; }
.ledger-rows .n { text-align: right; font-size: 0.75rem; color: var(--mute); }
.ledger-status { font-family: var(--pixel); font-size: 0.7rem; }
.ledger-status.bad { color: #8b2e2e; }

/* ---------- panic ---------------------------------------------------- */

.thesis-grid { display: grid; gap: 1.25rem; max-width: 52ch; }
.thesis-grid p { margin: 0; font-size: 1.05rem; line-height: 1.65; color: var(--mute); }
.thesis-grid strong { color: var(--ink); font-weight: 700; }
.strip-ink .thesis-grid p { color: #a8b4c0; }
.strip-ink .thesis-grid strong { color: var(--paper); }

.giant-eq {
  margin: 2.5rem 0 0;
  padding-top: 1.25rem;
  border-top: 2px dashed var(--dark-line);
  font-family: var(--pixel);
  font-size: clamp(1rem, 3.5vw, 1.65rem);
  letter-spacing: 0.02em;
}

/* ---------- the log -------------------------------------------------- */

.txlog { border: 2px solid var(--dark-line); background: var(--dark-panel); color: var(--dark-ink); }
.txlog-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid var(--dark-line);
  font-family: var(--pixel);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
}
.txlog-sub { margin-left: auto; font-family: var(--mono); font-size: 0.72rem; font-weight: 400; letter-spacing: 0; color: var(--dark-mute); }
.live-dot { width: 8px; height: 8px; border-radius: 0; background: var(--live); animation: pulse 1.6s steps(2, end) infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }

.txlog-list { max-height: 22rem; margin: 0; padding: 0; list-style: none; overflow: auto; }
.txlog-list li {
  display: grid;
  grid-template-columns: 5.5rem 1fr auto;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  font-size: 0.82rem;
  border-bottom: 1px solid #2a3340;
}
.txlog-list li:last-child { border-bottom: 0; }
.txlog-list li.bad .txlog-label { color: var(--bad); }
.txlog-when { font-size: 0.75rem; color: var(--dark-mute); }
.txlog-label { color: var(--dark-ink); }
.txlog-sig { font-family: var(--mono); color: #8eb4d8; border-bottom: 1px solid #3d5a80; }
.txlog-sig:hover { color: #fff; }
.txlog-status { margin: 0; padding: 1rem; font-size: 0.85rem; color: var(--dark-mute); }
.txlog-status.bad { color: var(--bad); }

/* ---------- the writeup ---------------------------------------------- */

.tech { display: grid; border: 2px solid var(--ink); background: var(--paper); }
/* grid items default to min-width:auto and refuse to shrink below their
   content, which stops .tech-code from ever scrolling inside itself and
   pushes the whole page sideways on a phone */
.tech-block { min-width: 0; padding: 1.35rem 1.2rem; border-bottom: 2px solid var(--ink); }
.tech-block:last-child { border-bottom: 0; }
.tech-block h3 { margin: 0 0 0.65rem; font-family: var(--pixel); font-size: 0.78rem; letter-spacing: 0.02em; }
.tech-block p { margin: 0 0 0.75rem; max-width: 62ch; font-size: 0.95rem; line-height: 1.65; color: var(--mute); }
.tech-block p:last-child { margin-bottom: 0; }
.tech-code {
  margin: 0 0 0.85rem;
  padding: 0.85rem 1rem;
  background: var(--ink);
  color: var(--dark-ink);
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.55;
  white-space: pre;
  overflow-x: auto;
}
.tech-list { margin: 0 0 0.85rem; padding: 0 0 0 1.1rem; font-size: 0.95rem; line-height: 1.65; color: var(--mute); }
.tech-list li { margin-bottom: 0.45rem; }
.tech-list strong { color: var(--ink); }

/* ---------- the three regimes ---------------------------------------- */

.regimes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 2px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
}
.regimes-dark { background: var(--dark-panel); border-color: var(--dark-line); color: var(--dark-ink); }
.regimes > div { display: grid; gap: 0.35rem; padding: 1.1rem 1rem; border-right: 2px solid var(--ink); }
.regimes-dark > div { border-right-color: var(--dark-line); }
.regimes > div:last-child { border-right: 0; }
.r-name { font-family: var(--pixel); font-size: 0.7rem; }
.r-rule { font-size: 0.8rem; color: var(--ice); }
.r-split { margin-top: 0.35rem; font-size: 1.25rem; font-weight: 700; }
.r-note { font-size: 0.75rem; color: var(--mute); }
.regimes-dark .r-note { color: var(--dark-mute); }

/* ---------- the crank ------------------------------------------------ */

.crank-layout { display: grid; grid-template-columns: 1.2fr 0.8fr; align-items: end; gap: 2rem; }
.crank-box { padding: 1.1rem; border: 2px solid var(--dark-line); background: var(--dark-panel); color: var(--dark-ink); }
.crank-copy { margin: 0 0 1rem; font-size: 0.85rem; color: var(--dark-mute); }
.crank-box .btn-ink  { background: #f4f7fb; border-color: #f4f7fb; color: var(--ink); }
.crank-box .btn-line { border-color: #f4f7fb; color: #f4f7fb; }
.fine { margin: 0.75rem 0 0; font-size: 0.75rem; color: var(--dark-mute); word-break: break-word; }

/* ---------- genesis + links ------------------------------------------ */

.gen-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; border-top: 2px solid var(--ink); }
.gen-list li {
  display: grid;
  grid-template-columns: 3rem 1fr;
  align-items: baseline;
  gap: 1rem;
  padding: 1.1rem 0;
  border-bottom: 2px solid var(--ink);
}
.gen-list i { font-family: var(--pixel); font-size: 0.7rem; font-style: normal; color: var(--ice); }
.gen-list b { display: block; margin-bottom: 0.2rem; font-family: var(--pixel); font-size: 0.85rem; }
.gen-list span { font-size: 0.85rem; color: var(--mute); }
.strip-ink .gen-list, .strip-ink .gen-list li { border-color: var(--dark-line); }
.strip-ink .gen-list span { color: var(--dark-mute); }

.prog-id {
  display: block;
  margin: 0 0 1.25rem;
  font-family: var(--mono);
  font-size: clamp(0.7rem, 1.8vw, 0.9rem);
  line-height: 1.6;
  word-break: break-all;
  cursor: pointer;
}
.prog-id:hover { color: var(--ice); }

.link-rail { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; font-family: var(--pixel); font-size: 0.65rem; }
.link-rail a { padding-bottom: 2px; border-bottom: 2px solid; }
.link-rail a:hover { color: var(--ice); }

.end-phrase { max-width: 16ch; }

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding: 1.25rem var(--pad) 1.75rem;
  font-family: var(--pixel);
  font-size: 0.72rem;
  color: var(--mute);
}

/* ---------- narrow --------------------------------------------------- */

@media (width <= 820px) {
  .regimes, .crank-layout, .ledger-rows li, .txlog-list li { grid-template-columns: 1fr; }
  .txlog-sub { margin-left: 0; }
  .regimes > div { border-right: 0; border-bottom: 2px solid var(--ink); }
  .regimes > div:last-child { border-bottom: 0; }
  .regimes-dark > div { border-bottom-color: var(--dark-line); }
  .ledger-rows .n { text-align: left; }
  .nav { background: rgba(15, 20, 28, 0.72); text-shadow: none; }
  .plain-list li > div, .crank-layout > div, .thesis-grid { min-width: 0; }
}

@media (width <= 440px) {
  .nav { align-items: flex-start; }
  .nav-brand { font-size: 0.72rem; }
  .nav-links { gap: 0.3rem 0.7rem; font-size: 0.68rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-plate { animation: none; }
  .btn:hover:not(:disabled) { translate: none; }
}
