/* =========================================================================
   Founder Mode — marketing site
   -------------------------------------------------------------------------
   Every colour in this file comes from one of two palettes that already
   ship in this repo. Nothing here is invented:

     DARK  = DESIGN.md "Color" section (the web app's palette).
     LIGHT = mobile/DESIGN-MOBILE.md §4 `color` (the palette the iOS app
             actually renders — "paper", ink, blue accent).

   The light palette is the ONLY one that renders, because it is what the
   shipping app looks like — `mobile/app.json` sets
   `userInterfaceStyle: "light"`, so the game has no dark mode on any device.
   DESIGN.md's dark palette is kept below as an opt-in `[data-theme="dark"]`
   and nothing sets that attribute; see the note above that block for why it
   stopped following `prefers-color-scheme`.

   Contrast was measured, not eyeballed (WCAG 2.1 relative luminance).
   Every text pair used below is >= 4.5:1; every focus ring is >= 3:1.
   Two results that shaped the design:
     - LIGHT accent #3D6DF5 as body text on paper is only 4.17:1, so accent
       TEXT in light mode is `--accent-ink` #22417F (9.21:1) instead.
     - a blue button with white text is also 4.17:1, so the light-mode
       primary button is ink-on-paper (16.95:1), which is also what the
       app's own inverted CTA cards do.
   ========================================================================= */

/* ---------- LIGHT (default) — mobile/DESIGN-MOBILE.md §4 ---------------- */
:root {
  --bg:            #FAF7F0;   /* paper */
  --bg-deep:       #EDE9E0;   /* paperDeep */
  --surface:       #FFFFFF;   /* card */
  --surface-sunk:  #F7F5EF;   /* cardSunk */
  --border:        rgba(23, 22, 15, 0.12);
  --border-soft:   rgba(23, 22, 15, 0.08);

  --text:          #17160F;   /* ink */
  --text-body:     #4A463B;   /* inkSoft */
  --text-muted:    #6E6A5E;   /* inkMuted */

  --accent:        #3D6DF5;   /* accent — rules, marks, focus rings */
  --accent-ink:    #22417F;   /* accentInk — accent TEXT (measured 9.21:1) */
  --accent-wash:   #EFF2FE;

  --good:          #14804A;
  --good-wash:     #E7F0E9;
  --bad:           #C4362B;
  --bad-wash:      #FBF2F0;
  --warn:          #8A6412;
  --warn-wash:     #F5EBD9;
  --info:          #22417F;

  /* primary button: ink fill, paper text */
  --btn-bg:        #17160F;
  --btn-text:      #FAF7F0;

  --glow-a:        rgba(61, 109, 245, 0.10);
  --glow-b:        rgba(23, 22, 15, 0.04);
  --shadow-card:   0 1px 2px rgba(23, 22, 15, 0.04), 0 8px 24px rgba(23, 22, 15, 0.05);

  --font-display: "Space Grotesk", "Satoshi", ui-sans-serif, system-ui, -apple-system,
                  "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-body:    "Instrument Sans", ui-sans-serif, system-ui, -apple-system,
                  "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* DESIGN.md "Spacing": base unit 4px */
  --s-xs: 4px; --s-sm: 8px; --s-md: 16px; --s-lg: 24px;
  --s-xl: 32px; --s-2xl: 48px; --s-3xl: 64px;

  /* DESIGN.md "Layout": border radius — 2xl:16px for cards */
  --r-sm: 4px; --r-md: 8px; --r-lg: 12px; --r-2xl: 16px;

  color-scheme: light;
}

/* ---------- DARK — DESIGN.md "Color" -----------------------------------
   ⚠️ NOT APPLIED AUTOMATICALLY, AND THAT IS THE POINT (2026-09-01).

   This used to be `@media (prefers-color-scheme: dark)`, so a reader on a
   dark-mode device got the dark palette — while the GAME cannot render it at
   all. `mobile/app.json` sets `userInterfaceStyle: "light"`, so the shipping
   app is light in every circumstance, on every device, with no setting to
   change it. A site that goes dark on its own is therefore advertising a
   product that does not look like that, which the owner reported on the live
   site the day it went up: "it seems like its dark while game is light".

   The palette is kept rather than deleted because it is DESIGN.md's own and
   is measured (every pair >= 4.5:1, every focus ring >= 3:1). It is now
   OPT-IN ONLY, via `[data-theme="dark"]` below. ⚠️ Nothing in the site sets
   that attribute — there is no toggle in `index.html` or `privacy.html` — so
   in practice this block is unreachable until somebody builds one. If you
   build that toggle, the thing to decide first is whether a marketing site
   SHOULD be able to look unlike the app it is selling.
   ----------------------------------------------------------------------- */

:root[data-theme="dark"] {
  --bg:            #0D1117;
  --bg-deep:       #010409;
  --surface:       #161B22;
  --surface-sunk:  #1C2128;
  --border:        #30363D;
  --border-soft:   rgba(240, 246, 252, 0.08);
  --text:          #E6EDF3;
  --text-body:     #C9D1D9;
  --text-muted:    #8B949E;
  --accent:        #F0883E;
  --accent-ink:    #F0883E;
  --accent-wash:   rgba(240, 136, 62, 0.15);
  --good:          #3FB950;
  --good-wash:     rgba(63, 185, 80, 0.15);
  --bad:           #F85149;
  --bad-wash:      rgba(248, 81, 73, 0.15);
  --warn:          #F0883E;
  --warn-wash:     rgba(240, 136, 62, 0.15);
  --info:          #58A6FF;
  --btn-bg:        #F0883E;
  --btn-text:      #0D1117;
  --glow-a:        rgba(240, 136, 62, 0.10);
  --glow-b:        rgba(88, 166, 255, 0.06);
  --shadow-card:   0 1px 2px rgba(1, 4, 9, 0.5), 0 12px 32px rgba(1, 4, 9, 0.35);
  color-scheme: dark;
}

/* ---------- reset ------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

/* LOAD-BEARING. An author `display:` beats the UA sheet's `[hidden]{display:none}`
   regardless of specificity, so `.signup-form { display:flex }` would render the
   signup form even with no endpoint configured — i.e. a form that posts nowhere.
   That is precisely the dishonest state this page exists to avoid. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  /* the body must never scroll sideways at 390pt */
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text-body);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--text);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0;
  font-weight: 700;
  text-wrap: balance;
}
p { margin: 0; }
a { color: var(--accent-ink); }
a:hover { color: var(--text); }

/* Visible focus everywhere. */
:where(a, button, input, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

.skip-link {
  position: absolute; left: var(--s-md); top: -100px; z-index: 20;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--r-md);
  padding: var(--s-sm) var(--s-md); font-weight: 600;
}
.skip-link:focus { top: var(--s-md); }

/* ---------- layout ------------------------------------------------------ */
.wrap { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 var(--s-lg); }
.wrap--narrow { max-width: 760px; }

section { padding: var(--s-3xl) 0; }
@media (max-width: 640px) { section { padding: var(--s-2xl) 0; } }

/* DESIGN.md: 11px uppercase kicker label above section titles */
.kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin: 0 0 var(--s-sm);
  font-weight: 500;
}
.lede { font-size: 18px; color: var(--text-body); max-width: 62ch; }
.small { font-size: 14px; color: var(--text-muted); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ---------- header ------------------------------------------------------ */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: var(--bg);   /* fallback for engines without color-mix() */
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border-soft);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-md); min-height: 62px; flex-wrap: wrap;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand:hover { color: var(--text); }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 17px; letter-spacing: -0.02em; }
.site-nav { display: flex; align-items: center; gap: var(--s-md); font-size: 14px; }
.site-nav a { color: var(--text-muted); text-decoration: none; }
.site-nav a:hover, .site-nav a:focus-visible { color: var(--text); text-decoration: underline; }

/* ---------- hero -------------------------------------------------------- */
.hero { padding-top: var(--s-2xl); padding-bottom: var(--s-xl); }
.hero-grid {
  display: grid; gap: var(--s-xl);
  grid-template-columns: 1fr;
  align-items: center;
}
@media (min-width: 900px) {
  .hero-grid { grid-template-columns: 1.05fr 0.95fr; gap: var(--s-2xl); }
}
.hero h1 {
  font-size: clamp(38px, 8vw, 64px);
  letter-spacing: -0.035em;
  margin-bottom: var(--s-md);
}
.hero .lede { font-size: clamp(17px, 2.4vw, 20px); }

.status-pill {
  display: inline-flex; align-items: center; gap: var(--s-sm);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--accent-ink);
  background: var(--accent-wash);
  border: 1px solid var(--border);
  border-radius: 999px; padding: 5px 12px; margin-bottom: var(--s-lg);
}
.status-pill .dot {
  width: 6px; height: 6px; border-radius: 999px; background: var(--accent);
  flex: none;
}

/* ---------- cards / bento ---------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  padding: var(--s-lg);
  box-shadow: var(--shadow-card);
  /* DESIGN.md hallmark: subtle radial gradient on cards */
  background-image: radial-gradient(120% 90% at 100% 0%, var(--glow-b), transparent 60%);
}
.card--accent { background-image: radial-gradient(120% 90% at 100% 0%, var(--glow-a), transparent 62%); }

.bento { display: grid; gap: var(--s-md); grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 780px) { .bento { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.bento > * { grid-column: span 2; }
@media (min-width: 780px) {
  .span-2 { grid-column: span 2; }
  .span-3 { grid-column: span 3; }
  .span-4 { grid-column: span 4; }
  .span-6 { grid-column: span 6; }
}
@media (max-width: 779px) { .bento > * { grid-column: 1 / -1; } }

/* `:where()` contributes ZERO specificity, so these are element-level defaults
   (0,0,1) that ANY utility class beats regardless of source order. Written as
   plain `.card p` they were (0,1,1) and silently overrode `.kicker`,
   `.metric-label`, `.metric-foot` and `.small` wherever those appear inside a
   card — which is most places they appear. */
:where(.card) h3 { font-size: 18px; margin-bottom: var(--s-sm); }
:where(.card) p  { font-size: 15px; color: var(--text-body); }
:where(.card) p + p { margin-top: var(--s-sm); }

/* DESIGN.md "BigMetric": tiny uppercase label + huge number */
.metric-label {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px;
}
.metric-value {
  font-family: var(--font-display);
  font-size: clamp(34px, 6vw, 48px);
  font-weight: 700; line-height: 1; letter-spacing: -0.03em;
  color: var(--text); font-variant-numeric: tabular-nums;
}
.metric-foot { margin-top: var(--s-sm); font-size: 14px; color: var(--text-muted); }
.metric-value.is-bad  { color: var(--bad); }
.metric-value.is-good { color: var(--good); }

/* ---------- buttons ----------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-sm);
  font-family: var(--font-body); font-size: 15px; font-weight: 600;
  padding: 12px 20px; border-radius: var(--r-lg);
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: transform 100ms ease-out, background-color 150ms ease-out;
}
.btn:active { transform: scale(0.97); }   /* DESIGN.md motion: press 0.97 */
.btn--primary { background: var(--btn-bg); color: var(--btn-text); }
.btn--primary:hover { opacity: 0.88; color: var(--btn-text); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn--ghost:hover { background: var(--surface-sunk); color: var(--text); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
@media (prefers-reduced-motion: reduce) { .btn:active { transform: none; } }

/* ---------- signup ------------------------------------------------------ */
.signup { margin-top: var(--s-lg); }
.signup-form { display: flex; gap: var(--s-sm); flex-wrap: wrap; }
.signup-form label {
  flex: 1 1 220px; display: block;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text-muted);
}
.signup-form input[type="email"] {
  display: block; width: 100%; margin-top: 6px;
  font-family: var(--font-body); font-size: 16px;
  padding: 11px 14px; border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
}
.signup-form input::placeholder { color: var(--text-muted); }
.signup-form .btn { align-self: flex-end; flex: 0 0 auto; }
.signup-note { margin-top: var(--s-sm); font-size: 13px; color: var(--text-muted); }

.signup-soon {
  border: 1px dashed var(--text-muted);
  border-radius: var(--r-2xl);
  padding: var(--s-md) var(--s-lg);
  background: var(--surface-sunk);
}
.signup-soon strong { color: var(--text); font-family: var(--font-display); }

/* ---------- lists ------------------------------------------------------- */
.plain-list { list-style: none; margin: 0; padding: 0; }
.rule-list { list-style: none; margin: 0; padding: 0; }
.rule-list li {
  display: grid; grid-template-columns: auto 1fr; gap: var(--s-md);
  padding: var(--s-md) 0; border-top: 1px solid var(--border-soft);
  align-items: baseline;
}
.rule-list li:first-child { border-top: 0; padding-top: 0; }
.rule-list .term {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-muted); white-space: nowrap;
}
@media (max-width: 640px) {
  .rule-list li { grid-template-columns: 1fr; gap: var(--s-xs); }
}

.endings { display: grid; gap: var(--s-sm); grid-template-columns: 1fr; margin-top: var(--s-lg); }
@media (min-width: 620px) { .endings { grid-template-columns: 1fr 1fr; } }
.ending {
  display: grid; grid-template-columns: 10px 1fr; gap: var(--s-md);
  padding: var(--s-md); border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--border);
  align-items: start;
}
.ending .bar { width: 4px; border-radius: 999px; height: 100%; min-height: 34px; background: var(--text-muted); }
.ending.is-win  .bar { background: var(--good); }
.ending.is-half .bar { background: var(--warn); }
.ending.is-loss .bar { background: var(--bad); }
.ending h3 { font-size: 15px; font-family: var(--font-body); font-weight: 600; }
.ending p { font-size: 14px; color: var(--text-muted); margin-top: 2px; }

/* ---------- figures ----------------------------------------------------- */
figure { margin: 0; }
figcaption { margin-top: var(--s-sm); font-size: 13px; color: var(--text-muted); }
.chart-card { padding: var(--s-lg); }
.chart-card svg { display: block; width: 100%; height: auto; }
.legend { display: flex; gap: var(--s-md); flex-wrap: wrap; margin-top: var(--s-md); font-size: 13px; color: var(--text-muted); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 12px; height: 3px; border-radius: 999px; display: inline-block; }
.legend .sw-good { background: var(--good); }
.legend .sw-info { background: var(--info); }
.legend .sw-bad  { background: var(--bad); opacity: 0.4; height: 8px; border-radius: var(--r-sm); }

/* SVG is styled from here, not from presentation attributes: `var()` inside a
   presentation attribute is not reliably resolved, but a CSS rule always is. */
.fig { font-family: var(--font-mono); }
.fig .fig-label  { font-size: 10px; fill: var(--text-muted); }
.fig .fig-danger { font-size: 10px; fill: var(--bad); }
.fig .grid line  { stroke: var(--border); stroke-width: 1; opacity: 0.6; }
.fig .axis       { stroke: var(--text-muted); stroke-width: 1; }
.fig .gap        { fill: url(#gapFill); }
.fig .gap-top    { stop-color: var(--bad); stop-opacity: 0.28; }
.fig .gap-bottom { stop-color: var(--bad); stop-opacity: 0.02; }
.fig .line-in, .fig .line-out {
  fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round;
}
.fig .line-in  { stroke: var(--good); }
.fig .line-out { stroke: var(--info); }
.fig .cross-dot  { fill: var(--surface); stroke: var(--good); stroke-width: 2.5; }
.fig .cross-line { stroke: var(--good); stroke-width: 1; stroke-dasharray: 3 4; opacity: 0.8; }

/* Ordered single-hue ramp — DESIGN.md's four hues cannot supply categorical
   slots that survive colour-vision simulation, so ownership is encoded by
   length and by a text label, with opacity only reinforcing the order. */
.fig .dil-track  { fill: var(--border); }
.fig .dil-fill   { fill: var(--accent); }
.fig .dil-fill.f1 { opacity: 0.95; }
.fig .dil-fill.f2 { opacity: 0.78; }
.fig .dil-fill.f3 { opacity: 0.62; }
.fig .dil-fill.f4 { opacity: 0.46; }
.fig .dil-fill.f5 { opacity: 0.32; }
.fig .dil-danger { stroke: var(--bad); stroke-width: 1.5; stroke-dasharray: 4 4; }

/* The brand mark, same technique. */
.mark { flex: none; }
.mark .mark-tile { fill: var(--surface); stroke: var(--border); stroke-width: 2; }
.mark text { font-family: var(--font-display); font-size: 28px; font-weight: 700; }
.mark .mark-f { fill: var(--text); }
.mark .mark-m { fill: var(--accent); }
.mark .mark-dot-a { fill: var(--text-muted); }
.mark .mark-dot-b { fill: var(--accent); opacity: 0.5; }
.mark .mark-dot-c { fill: var(--accent); }

/* ---------- section headings ------------------------------------------- */
.section-title { font-size: clamp(26px, 4.5vw, 34px); }
.section-lede  { margin-top: var(--s-md); margin-bottom: var(--s-xl); }
.card-title-lg { font-size: 20px; margin-bottom: var(--s-sm); }

/* Table that must never push the body sideways. */
.scroller { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data {
  width: 100%; border-collapse: collapse; font-size: 14px; min-width: 420px;
}
table.data th, table.data td {
  text-align: left; padding: 10px 14px 10px 0; border-bottom: 1px solid var(--border-soft);
  vertical-align: top;
}
table.data th {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-muted); font-weight: 500;
}
table.data td.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ---------- prose (privacy page) --------------------------------------- */
.prose h2 { font-size: 24px; margin: var(--s-2xl) 0 var(--s-md); }
.prose h3 { font-size: 18px; margin: var(--s-xl) 0 var(--s-sm); }
/* Zero-specificity for the same reason as `:where(.card)` above. */
:where(.prose) p, :where(.prose) li { color: var(--text-body); }
:where(.prose) p { margin: var(--s-md) 0; }
.prose ul { margin: var(--s-md) 0; padding-left: 1.25em; }
:where(.prose) li { margin: var(--s-sm) 0; }
.prose code {
  font-family: var(--font-mono); font-size: 0.9em;
  background: var(--surface-sunk); border: 1px solid var(--border-soft);
  border-radius: var(--r-sm); padding: 1px 5px;
}
.prose .card { margin: var(--s-lg) 0; }
.callout {
  border-left: 3px solid var(--accent);
  background: var(--accent-wash);
  border-radius: 0 var(--r-lg) var(--r-lg) 0;
  padding: var(--s-md) var(--s-lg);
  margin: var(--s-lg) 0;
}
.callout p { margin: var(--s-sm) 0; }
.callout p:first-child { margin-top: 0; }
.callout p:last-child { margin-bottom: 0; }

/* ---------- footer ------------------------------------------------------ */
.site-footer {
  border-top: 1px solid var(--border-soft);
  margin-top: var(--s-2xl);
  padding: var(--s-xl) 0 var(--s-2xl);
  font-size: 14px; color: var(--text-muted);
}
.site-footer .wrap { display: flex; justify-content: space-between; gap: var(--s-md); flex-wrap: wrap; }
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--text); }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
