/* ============================================================
   Snogi — site design system
   Palette: ink navy / instrument amber / semantic lift+bust
   Type: Archivo (variable width) display+body, IBM Plex Mono data
   ============================================================ */

:root {
  --ink: #0a0e16;
  --ink-2: #0d1220;
  --panel: #101624;
  --panel-2: #141b2c;
  --line: #232c3f;
  --line-soft: #1a2233;
  --paper: #e8ecf4;
  --dim: #8b95a9;
  --faint: #5a6478;
  --amber: #f2a93b;
  --amber-deep: #c77f18;
  --lift: #3adfa0;
  --bust: #ff5c5c;
  --radius: 10px;
  --font-body: 'Archivo', system-ui, -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --w-max: 1180px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: rgba(242, 169, 59, 0.28); }

a { color: inherit; }

img, canvas, svg { display: block; max-width: 100%; }

/* ---------- typography helpers ---------- */

.display {
  font-weight: 800;
  font-stretch: 112%;
  letter-spacing: -0.015em;
  line-height: 1.05;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--amber);
}

.mono { font-family: var(--font-mono); }

.num { font-variant-numeric: tabular-nums; font-family: var(--font-mono); }

/* ---------- layout ---------- */

.wrap {
  max-width: var(--w-max);
  margin: 0 auto;
  padding: 0 28px;
}

section { position: relative; }

.section-pad { padding: 96px 0; }

/* tick ruler — quiet instrument chrome between sections */
.ruler {
  height: 14px;
  background-image: repeating-linear-gradient(
    to right,
    var(--line) 0 1px,
    transparent 1px 24px
  );
  background-size: 24px 6px;
  background-repeat: repeat-x;
  background-position: bottom;
  border-bottom: 1px solid var(--line);
  opacity: 0.75;
}

.section-head { margin-bottom: 48px; max-width: 720px; }
.section-head h2 {
  font-size: clamp(26px, 3.4vw, 38px);
  margin: 14px 0 12px;
}
.section-head p { color: var(--dim); font-size: 17px; }

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 14, 22, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 64px;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 2px;
  text-decoration: none;
  font-weight: 800;
  font-stretch: 118%;
  font-size: 19px;
  letter-spacing: 0.02em;
}
.brand sup {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 12px;
  color: var(--amber);
  transform: translateY(-2px);
}

.site-nav {
  display: flex;
  gap: 24px;
  margin-left: auto;
  align-items: center;
}
.site-nav a {
  text-decoration: none;
  color: var(--dim);
  font-size: 14.5px;
  font-weight: 500;
  transition: color 0.15s ease;
}
.site-nav a:hover, .site-nav a[aria-current='page'] { color: var(--paper); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn-amber {
  background: var(--amber);
  color: #17110a;
}
.btn-amber:hover { background: #ffc25e; }
.btn-ghost {
  border-color: var(--line);
  color: var(--paper);
  background: transparent;
}
.btn-ghost:hover { border-color: var(--faint); background: var(--panel); }
.btn-sm { padding: 8px 14px; font-size: 14px; }

.site-nav .btn { margin-left: 4px; }

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

.hero { padding: 84px 0 72px; overflow: hidden; }

.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 56px;
  align-items: center;
}

.hero h1 {
  font-size: clamp(34px, 4.6vw, 56px);
  margin: 18px 0 20px;
}
.hero h1 .amber { color: var(--amber); }

.hero-sub {
  color: var(--dim);
  font-size: 17.5px;
  max-width: 52ch;
  margin-bottom: 30px;
}
.hero-sub strong { color: var(--paper); font-weight: 600; }

.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; }

.hero-note {
  margin-top: 26px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--faint);
}

/* live round instrument */
.sim {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px 20px 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.sim-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.sim-phase {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
}
.sim-phase .dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--faint);
  margin-right: 8px;
  transform: translateY(-1px);
}
.sim[data-phase='betting'] .sim-phase .dot { background: var(--amber); }
.sim[data-phase='running'] .sim-phase .dot { background: var(--lift); }
.sim[data-phase='crashed'] .sim-phase .dot { background: var(--bust); }

.sim-mult {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: clamp(30px, 3.2vw, 40px);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: var(--paper);
  transition: color 0.12s ease;
}
.sim[data-phase='running'] .sim-mult { color: var(--lift); }
.sim[data-phase='crashed'] .sim-mult { color: var(--bust); }

.sim-canvas-box { position: relative; }
.sim canvas { width: 100%; height: 230px; }

.sim-bust-flash {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 15px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--bust);
  background: radial-gradient(ellipse at center, rgba(255, 92, 92, 0.12), transparent 70%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.sim[data-phase='crashed'] .sim-bust-flash { opacity: 1; }

.sim-history {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 14px 0 12px;
  min-height: 26px;
}
.sim-chip {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--dim);
}
.sim-chip.hi { color: var(--lift); border-color: rgba(58, 223, 160, 0.35); }
.sim-chip.lo { color: var(--bust); border-color: rgba(255, 92, 92, 0.3); }

.sim-fair {
  border-top: 1px solid var(--line-soft);
  padding-top: 12px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--faint);
  display: flex;
  gap: 10px;
  align-items: baseline;
  overflow: hidden;
  white-space: nowrap;
}
.sim-fair .k { color: var(--dim); letter-spacing: 0.12em; text-transform: uppercase; flex: none; }
.sim-fair .h { text-overflow: ellipsis; overflow: hidden; }
.sim-fair.revealed .h { color: var(--amber); }

.sim-caption {
  margin-top: 14px;
  font-size: 13px;
  color: var(--faint);
}

/* ---------- stat strip ---------- */

.stats {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--ink-2);
}
.stats .wrap {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.stat {
  padding: 28px 24px;
  border-left: 1px solid var(--line);
}
.stat:first-child { border-left: none; }
.stat .v {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--paper);
}
.stat .v em { font-style: normal; color: var(--amber); }
.stat .l {
  margin-top: 4px;
  font-size: 13px;
  color: var(--dim);
}

/* ---------- integration steps ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.step {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 24px;
}
.step .n {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--amber);
  letter-spacing: 0.15em;
}
.step h3 { font-size: 19px; margin: 12px 0 10px; font-stretch: 108%; }
.step p { font-size: 14.5px; color: var(--dim); }
.step code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--paper);
  background: var(--ink);
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  padding: 1px 6px;
  white-space: nowrap;
}

/* ---------- games ---------- */

.games-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.game-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.game-card:hover { border-color: var(--faint); transform: translateY(-2px); }

.game-art {
  height: 150px;
  position: relative;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.game-art svg { position: absolute; inset: 0; width: 100%; height: 100%; }

.game-body { padding: 20px 22px 22px; display: flex; flex-direction: column; flex: 1; }
.game-tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--amber);
}
.game-body h3 { font-size: 21px; margin: 8px 0 8px; font-stretch: 110%; }
.game-body p { font-size: 14px; color: var(--dim); flex: 1; }

.game-chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 14px 0 18px; }
.game-chips span {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--dim);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 9px;
  font-variant-numeric: tabular-nums;
}

.games-note {
  margin-top: 26px;
  font-size: 14.5px;
  color: var(--dim);
}
.games-note a { color: var(--amber); }

/* ---------- features ---------- */

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.feature-group {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
.feature-group h3 {
  font-size: 16px;
  font-stretch: 110%;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.feature-group h3 .ic {
  width: 26px; height: 26px;
  border-radius: 7px;
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--amber);
  flex: none;
}
.feature-group ul { list-style: none; }
.feature-group li {
  font-size: 14px;
  color: var(--dim);
  padding: 6px 0;
  border-top: 1px solid var(--line-soft);
}
.feature-group li:first-child { border-top: none; }
.feature-group li strong { color: var(--paper); font-weight: 500; }

.features-foot {
  margin-top: 26px;
  font-size: 14.5px;
  color: var(--dim);
  max-width: 74ch;
}
.features-foot code {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--amber);
}

/* ---------- fairness ---------- */

.fair-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}

.fair-steps { display: flex; flex-direction: column; gap: 0; }
.fair-step {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 16px;
  padding: 18px 0;
  border-top: 1px solid var(--line-soft);
}
.fair-step:first-child { border-top: none; }
.fair-step .g {
  width: 40px; height: 40px;
  border: 1px solid var(--line);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  color: var(--amber);
  font-family: var(--font-mono);
  font-size: 13px;
}
.fair-step h4 { font-size: 16px; margin-bottom: 4px; }
.fair-step p { font-size: 14px; color: var(--dim); }
.fair-step code { font-family: var(--font-mono); font-size: 12.5px; color: var(--paper); }

.code-panel {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.code-panel .bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}
.code-panel pre {
  padding: 18px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.65;
  color: var(--paper);
}
.code-panel .c { color: var(--faint); }
.code-panel .a { color: var(--amber); }
.code-panel .g { color: var(--lift); }
.code-panel .s { color: #9ecbff; }

/* ---------- CTA band ---------- */

.cta-band {
  background: linear-gradient(180deg, var(--panel-2), var(--ink-2));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.cta-band .wrap {
  padding-top: 72px;
  padding-bottom: 72px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 28px;
  justify-content: space-between;
}
.cta-band h2 { font-size: clamp(24px, 3vw, 34px); margin-top: 12px; }
.cta-band p { color: var(--dim); margin-top: 8px; max-width: 56ch; }
.cta-band .hero-ctas { flex: none; }

/* ---------- footer ---------- */

.site-footer { padding: 52px 0 64px; color: var(--faint); font-size: 13.5px; }
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: space-between;
  align-items: baseline;
}
.site-footer a { color: var(--dim); text-decoration: none; }
.site-footer a:hover { color: var(--paper); }
.site-footer nav { display: flex; gap: 20px; flex-wrap: wrap; }

/* ---------- demo modal ---------- */

.demo-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  background: rgba(6, 9, 15, 0.86);
  backdrop-filter: blur(6px);
  padding: 4vh 4vw;
}
.demo-modal.open { display: flex; }

.demo-shell {
  margin: auto;
  width: min(1080px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 92vh;
}

.demo-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.demo-bar .title {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--amber);
  margin-right: 8px;
}
.demo-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.demo-tab {
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--dim);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 6px 13px;
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}
.demo-tab:hover { color: var(--paper); }
.demo-tab.active {
  color: #17110a;
  background: var(--amber);
  border-color: var(--amber);
}
.demo-close {
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--dim);
  border-radius: 7px;
  width: 32px; height: 32px;
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
}
.demo-close:hover { color: var(--paper); border-color: var(--faint); }

.demo-frame-box { position: relative; background: var(--ink); flex: 1; min-height: 0; }
.demo-frame-box iframe {
  display: block;
  width: 100%;
  height: min(640px, 72vh);
  border: 0;
}
.demo-offline {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px;
  color: var(--dim);
  font-size: 14.5px;
}
.demo-offline.show { display: flex; }
.demo-offline code { font-family: var(--font-mono); font-size: 13px; color: var(--amber); }

.demo-foot {
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--faint);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.demo-foot .fun { color: var(--lift); }

/* ---------- scroll reveal ---------- */

.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- docs layout ---------- */

.docs-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 56px;
  padding: 48px 0 120px;
}

.docs-nav {
  position: sticky;
  top: 88px;
  align-self: start;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  padding-right: 8px;
}
.docs-nav .grp {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--amber);
  margin: 22px 0 8px;
}
.docs-nav .grp:first-child { margin-top: 0; }
.docs-nav a {
  display: block;
  font-size: 13.5px;
  color: var(--dim);
  text-decoration: none;
  padding: 4px 0 4px 12px;
  border-left: 1px solid var(--line);
  transition: color 0.12s, border-color 0.12s;
}
.docs-nav a:hover { color: var(--paper); }
.docs-nav a.active { color: var(--paper); border-left-color: var(--amber); }

.docs-body { min-width: 0; }
.docs-body > h1 {
  font-size: clamp(30px, 3.6vw, 40px);
  font-stretch: 112%;
  font-weight: 800;
  letter-spacing: -0.015em;
  margin: 10px 0 14px;
}
.docs-lead { color: var(--dim); font-size: 17px; max-width: 70ch; }

.docs-body section { margin-top: 72px; scroll-margin-top: 90px; }
.docs-body h2 {
  font-size: 25px;
  font-stretch: 110%;
  letter-spacing: -0.01em;
  padding-top: 26px;
  border-top: 1px solid var(--line);
  margin-bottom: 14px;
}
.docs-body h3 { font-size: 18px; margin: 30px 0 10px; font-stretch: 108%; }
.docs-body p { color: var(--dim); margin: 10px 0; max-width: 76ch; }
.docs-body p strong, .docs-body li strong { color: var(--paper); font-weight: 600; }
.docs-body ul, .docs-body ol { margin: 12px 0 12px 22px; color: var(--dim); }
.docs-body li { margin: 6px 0; max-width: 72ch; }
.docs-body code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 5px;
  padding: 1px 6px;
  color: var(--paper);
  overflow-wrap: anywhere;
}
.docs-body pre {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  overflow-x: auto;
  margin: 16px 0;
}
.docs-body pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 13px;
  line-height: 1.65;
  overflow-wrap: normal;
}
.docs-body pre .c { color: var(--faint); }
.docs-body pre .a { color: var(--amber); }
.docs-body pre .g { color: var(--lift); }
.docs-body pre .s { color: #9ecbff; }

.docs-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 13.5px;
}
.docs-body th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 500;
  padding: 8px 14px 8px 0;
  border-bottom: 1px solid var(--line);
}
.docs-body td {
  padding: 9px 14px 9px 0;
  border-bottom: 1px solid var(--line-soft);
  color: var(--dim);
  vertical-align: top;
}
.docs-body td:first-child { color: var(--paper); white-space: nowrap; }
.docs-body td code { font-size: 12.5px; }
.table-scroll { overflow-x: auto; }

.callout {
  border: 1px solid var(--line);
  border-left: 3px solid var(--amber);
  border-radius: 8px;
  background: var(--panel);
  padding: 14px 18px;
  margin: 18px 0;
  font-size: 14.5px;
  color: var(--dim);
  max-width: 76ch;
}
.callout strong { color: var(--paper); }
.callout.warn { border-left-color: var(--bust); }

/* ---------- responsive ---------- */

@media (max-width: 1000px) {
  /* minmax(0,…) everywhere: a replaced element (hero canvas) or long token must
     never inflate a track's min-content and push the page past the viewport */
  .hero .wrap { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .steps, .games-grid, .features-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fair-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .stats .wrap { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(3) { border-left: none; }
  .stat { border-top: 1px solid var(--line-soft); }
  .stat:nth-child(-n + 2) { border-top: none; }
  .docs-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .docs-nav {
    position: static;
    max-height: none;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 18px;
    background: var(--panel);
  }
  .docs-nav .grp { width: 100%; margin: 10px 0 2px; }
  .docs-nav a { border-left: none; padding-left: 0; }
}

@media (max-width: 680px) {
  .section-pad { padding: 64px 0; }
  .hero { padding: 52px 0 48px; }
  .steps, .games-grid, .features-grid { grid-template-columns: minmax(0, 1fr); }
  .stats .wrap { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-nav a:not(.btn) { display: none; }
  .demo-modal { padding: 0; }
  .demo-shell { border-radius: 0; max-height: 100vh; height: 100%; }
  .demo-frame-box iframe { height: 100%; min-height: 420px; }
}

/* visible focus for keyboard users */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ============================================================
   WOW layer — glow, motion, spectacle. One accent, more voltage.
   ============================================================ */

/* hero atmosphere: faint engineering grid + amber dawn behind the sim */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(600px 420px at 78% 18%, rgba(242, 169, 59, 0.09), transparent 65%),
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: auto, 56px 56px, 56px 56px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 92%);
  mask-image: linear-gradient(180deg, #000 0%, transparent 92%);
  opacity: 0.55;
}
.hero .wrap { position: relative; }

/* staggered headline entrance */
.hero-title .line { display: block; }
.hero-title .line.amber {
  color: var(--amber);
  text-shadow: 0 0 34px rgba(242, 169, 59, 0.35);
}
@media (prefers-reduced-motion: no-preference) {
  .hero-title .line {
    opacity: 0;
    transform: translateY(22px);
    animation: line-rise 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
  }
  .hero-title .line:nth-child(2) { animation-delay: 0.12s; }
  .hero-title .line:nth-child(3) { animation-delay: 0.24s; }
  @keyframes line-rise { to { opacity: 1; transform: none; } }
}

/* the instrument earns a heartbeat */
.sim {
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.45),
    0 0 90px rgba(242, 169, 59, 0.05);
  transition: box-shadow 0.4s ease;
}
.sim[data-phase='running'] {
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.45),
    0 0 110px rgba(58, 223, 160, 0.09);
}
.sim[data-phase='crashed'] {
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.45),
    0 0 110px rgba(255, 92, 92, 0.12);
}
.sim[data-phase='running'] .sim-mult { text-shadow: 0 0 26px rgba(58, 223, 160, 0.45); }
.sim[data-phase='crashed'] .sim-mult { text-shadow: 0 0 26px rgba(255, 92, 92, 0.5); }
@media (prefers-reduced-motion: no-preference) {
  .sim[data-phase='crashed'] .sim-canvas-box { animation: bust-shake 0.32s ease; }
  @keyframes bust-shake {
    0%, 100% { transform: none; }
    20% { transform: translate(-5px, 2px); }
    45% { transform: translate(4px, -3px); }
    70% { transform: translate(-3px, 1px); }
  }
  .sim-chip { animation: chip-pop 0.28s cubic-bezier(0.2, 0.8, 0.3, 1.4); }
  @keyframes chip-pop { from { transform: scale(0.5); opacity: 0; } }
  .sim-bust-flash { letter-spacing: 0.3em; }
  .sim[data-phase='crashed'] .sim-bust-flash { animation: flash-in 0.25s ease; }
  @keyframes flash-in { from { transform: scale(1.35); opacity: 0; } }
}

/* buttons: charged */
.btn-amber {
  box-shadow: 0 0 0 rgba(242, 169, 59, 0);
  transition: background 0.15s ease, box-shadow 0.25s ease, transform 0.15s ease;
}
.btn-amber:hover {
  box-shadow: 0 6px 30px rgba(242, 169, 59, 0.35);
  transform: translateY(-1px);
}

/* cashout ticker — simulated feed between hero and stats */
.ticker {
  border-top: 1px solid var(--line);
  background: var(--ink-2);
  overflow: hidden;
  position: relative;
  padding: 11px 0;
}
.ticker::before, .ticker::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 90px;
  z-index: 2;
  pointer-events: none;
}
.ticker::before { left: 0; background: linear-gradient(90deg, var(--ink-2), transparent); }
.ticker::after { right: 0; background: linear-gradient(-90deg, var(--ink-2), transparent); }
.ticker-track {
  display: inline-flex;
  gap: 34px;
  white-space: nowrap;
  will-change: transform;
  animation: ticker-scroll 48s linear infinite;
}
.ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes ticker-scroll { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; }
}
.ticker-item {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  color: var(--dim);
}
.ticker-item .m { color: var(--lift); }
.ticker-item.bust .m { color: var(--bust); }
.ticker-item .who { color: var(--faint); }
.ticker-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--amber);
  border: 1px solid rgba(242, 169, 59, 0.35);
  border-radius: 999px;
  padding: 2px 9px;
  transform: translateY(-1px);
}

/* stats: numbers land with a pop */
@media (prefers-reduced-motion: no-preference) {
  .stat .v { opacity: 0; transform: translateY(10px) scale(0.94); }
  .stats.in .stat .v {
    animation: stat-land 0.5s cubic-bezier(0.2, 0.8, 0.3, 1.15) forwards;
  }
  .stats.in .stat:nth-child(2) .v { animation-delay: 0.08s; }
  .stats.in .stat:nth-child(3) .v { animation-delay: 0.16s; }
  .stats.in .stat:nth-child(4) .v { animation-delay: 0.24s; }
  @keyframes stat-land { to { opacity: 1; transform: none; } }
}

/* game cards: curve draws itself on hover, amber breath */
.game-card:hover {
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.4), 0 0 60px rgba(242, 169, 59, 0.07);
}
@media (prefers-reduced-motion: no-preference) {
  .game-art path.curve { stroke-dasharray: 1; stroke-dashoffset: 0; }
  .game-card:hover .game-art path.curve { animation: draw-curve 1.1s ease; }
  @keyframes draw-curve { from { stroke-dashoffset: 1; } }
}

/* feature groups join the hover language */
.feature-group { transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.25s ease; }
.feature-group:hover {
  border-color: var(--faint);
  transform: translateY(-2px);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
}

/* fairness: hash chain gets the grid treatment too */
#fairness::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(520px 320px at 15% 20%, rgba(242, 169, 59, 0.06), transparent 65%);
}
#fairness .wrap { position: relative; }

/* CTA band: a landing strip, not a grey box */
.cta-band {
  background:
    radial-gradient(700px 300px at 50% 120%, rgba(242, 169, 59, 0.1), transparent 70%),
    linear-gradient(180deg, var(--panel-2), var(--ink-2));
}

/* header CTA: `.site-nav a` link color must not repaint the amber button */
.site-nav a.btn-amber,
.site-nav a.btn-amber:hover { color: #17110a; }

/* ============================================================
   Mobile fit & polish
   ============================================================ */

/* long launch URLs must wrap inside step cards, not widen the page */
.step code { white-space: normal; overflow-wrap: anywhere; }

@media (max-width: 680px) {
  .wrap { padding: 0 20px; }

  .hero { padding: 44px 0 40px; }
  .hero .wrap { gap: 34px; }
  .hero h1 {
    font-size: clamp(28px, 8vw, 40px);
    font-stretch: 105%;
    margin: 14px 0 16px;
  }
  .hero-sub { font-size: 15.5px; margin-bottom: 24px; }
  .hero-note { font-size: 11.5px; overflow-wrap: anywhere; }

  .sim { padding: 14px 14px 12px; }
  .sim canvas { height: 190px; }
  .sim-mult { font-size: 30px; }

  .section-head h2 { font-size: clamp(23px, 6.4vw, 30px); }
  .section-head { margin-bottom: 34px; }

  .stat { padding: 18px 16px; }
  .stat .v { font-size: 21px; }

  .cta-band .wrap { padding-top: 56px; padding-bottom: 56px; }

  /* nothing may widen the viewport on a phone */
  body { overflow-x: hidden; }
}
