/* Design tokens — the single place every colour in the app is defined.
   Extracted 2026-08-27 from ~590 hardcoded hexes across index.html,
   draft.html and the eight stylesheets.

   WHY THIS EXISTS. Before this file, changing the accent meant a
   find-and-replace across ~6,000 lines, and two of the most-used colours
   were quietly failing WCAG AA as text with no single place to fix them.
   Now a restyle is a value change here, and contrast is auditable in one
   screen.

   THE CONTRAST FIX (measured, not judged — every ratio below is against
   the real surface it sits on):

     #64748b  was used 69x, 62 of them as `color:`   -> 3.07:1 on a card
     #475569  was used 22x, 15 of them as `color:`   -> 1.93:1 on a card

   Both fail AA for normal text (4.5:1). As TEXT they now resolve to
   --ink-muted (#94a3b8 = 5.71:1 on a card, 6.96:1 on the page). Their
   BORDER uses keep the original dark values under --line-mid / --line-dim,
   because a border is not text and 4.5:1 would make the UI shout.

   Nothing else changed value. This pass is deliberately invisible except
   that dim text became readable — the new look in design/ is a separate
   step that will change these values, not this structure.

   Known limit: --ink-muted is 4.04:1 on --bg-raised (#334155), under AA.
   Use --ink-2 (6.97:1) for text on a raised surface. A browser-side audit of
   the rendered pages found exactly one place doing this — the disabled
   Analyze button — and it now uses --ink-2. Re-run that audit rather than
   assuming, if you ever put muted text on a chip or a nested card.  */

:root {
  /* ── Surfaces ─────────────────────────────────────────────── */
  --bg-page:       #0f172a;   /* page background            */
  --bg-card:       #1e293b;   /* the standard card          */
  --bg-raised:     #334155;   /* a card on a card, chips    */
  --bg-sunken:     #16233b;   /* inset wells                */
  --bg-accent:     #0c2436;   /* active pill / info panel   */

  /* ── Ink ──────────────────────────────────────────────────── */
  --ink:           #e2e8f0;   /* primary text   14.5:1 on card */
  --ink-2:         #cbd5e1;   /* secondary       9.9:1         */
  --ink-muted:     #94a3b8;   /* muted           5.7:1  AA     */

  /* ── Lines (borders only — never text) ────────────────────── */
  --line:          #334155;
  --line-soft:     #283548;
  --line-mid:      #64748b;
  --line-dim:      #475569;

  /* ── Accent ───────────────────────────────────────────────── */
  --accent:        #38bdf8;
  --accent-bright: #7dd3fc;
  --accent-deep:   #0284c7;
  --accent-dark:   #0c4a6e;
  --accent-darker: #075985;

  /* ── Status (each also carries its own dark backing) ──────── */
  --good:          #4ade80;
  --good-bg:       #052e16;
  --bad:           #f87171;
  --bad-soft:      #fca5a5;
  --bad-strong:    #ef4444;
  --bad-bg:        #450a0a;
  --warn:          #f59e0b;
  --warn-bright:   #fcd34d;
  --warn-bg:       #422006;

  /* Crew League AI is violet so it reads as distinct from the app. */
  --violet:        #a78bfa;

  /* ── Data ramps (step 2 of design/README.md) ──────────────────
     These two encode NUMBERS the app already computes and never showed.
     They are FILL ramps — bars and chips, never text: the dark steps are
     nowhere near AA as type, and that is fine because a fill only needs
     3:1. Every place they are used also carries the number and a word, so
     stripping the colour loses nothing (design/README.md rule 1).

     RETUNED for TODAY's surfaces, and deliberately not the values in
     design/README.md. Those were picked against step 3's darker palette
     (page #0b1220, card #142033); on the current lighter #1e293b card the
     dark ends collapsed into the background — the sequential ramp's darkest
     step measured 1.93:1, under the 2:1 floor, and four of five diverging
     steps sat under 3:1. Re-validate both when step 3 moves the surfaces. */

  /* Value over wire — sequential, one hue, light end clears the card at
     2.47:1; monotone lightness with visible gaps (validated). Encodes
     eff_vor: how far a player beats the best available free agent. */
  --tier-replaceable: #0369a1;
  --tier-marginal:    #0284c7;
  --tier-solid:       #0ea5e9;
  --tier-strong:      #38bdf8;
  --tier-elite:       #7dd3fc;

  /* Which way it swings — diverging, grey midpoint, saturated poles.
     Encodes any signed number against its decision line: the trade verdict,
     a scoreboard margin. All five steps clear 3:1 on both card and page.
     Red/green is the CVD trap, so the word ALWAYS ships with it. */
  --step-hard-pass: #ef4444;
  --step-lean-no:   #fca5a5;
  --step-even:      #94a3b8;
  --step-lean-yes:  #86efac;
  --step-steal:     #4ade80;

  /* Decision BANDS on the verdict axis (why-panel rebuild, 2026-08-28).
     Muted siblings of the diverging ramp above: on the axis the ramp's
     saturated steps are the moving bars, and these are the fixed reject /
     even / accept regions behind them — a backdrop must not shout louder
     than the data drawn on it.

     They are still MEASURED, not dimmed by eye, because the band edges are
     where the accept and reject lines actually sit — that IS information.
     Against --bg-card 3.29 / 3.40 / 3.93, and higher on --bg-sunken and
     --bg-page, so all three clear the 3:1 fill floor on every surface they
     can land on. The numbers -2.0 / +2.0 are printed at the edges too, so
     the colour is never the only thing marking them. Re-measure if step 3
     moves the surfaces. */
  --band-reject: #b85c5c;
  --band-even:   #6b7b94;
  --band-accept: #54916a;

  /* ── Type scale (design review, 2026-09-03 — step 1 of the makeover) ──
     Five roles, nothing below 11px. On an iPhone 1 CSS px = 1 pt, and the
     platform minimum for any text style is 11pt; before this the league
     and rankings rows ran 8.8–9.9px (883 of 1,348 text nodes on the
     scoreboard). rem, not px, so Safari's text-size setting still scales
     the whole site. Sizes above the floor that already fit a role were
     mapped to it; the rest were left where they were. */
  --fs-caption: 0.6875rem;   /* 11px  slot, team · opp, column labels  */
  --fs-small:   0.8125rem;   /* 13px  player rows, meta, pills         */
  --fs-body:    0.9375rem;   /* 15px  team names, prose                */
  --fs-title:   1.0625rem;   /* 17px  card scores, totals              */
  --fs-display: 1.75rem;     /* 28px  the matchup screen's two scores  */
}
