/* Design tokens. Warm neutral canvas, quiet domain accents, editorial type.
   Domain accents are identity hues for grouping — never good/bad encodings. */
:root {
  /* canvas + ink */
  --bg: #faf8f3;
  --bg-panel: #ffffff;
  --bg-inset: #f1ede4;
  --bg-hover: #f4f1ea;
  --ink: #23272e;
  --ink-soft: #4d545e;
  /* #626973 clears WCAG 1.4.3 (≥4.5:1) on every surface incl. --bg-inset;
     the caption text that carries the atlas's caveats must be readable. */
  --ink-faint: #626973;
  --line: #ddd7cb;
  --line-soft: #e9e4da;
  --focus: #2456a6;
  --link: #2456a6;

  /* domain accents: the hero image's five panel hues (blue, violet, gold,
     green, coral), each darkened only as far as WCAG AA text needs (>=4.5:1 on
     white and on --bg-inset). Ecological substrate is not one of the five
     orders, so it takes teal, a hue the hero leaves free. */
  --formal: #436e8e;
  --institutional: #7c5e92;
  --economic: #896325;
  --relational: #4b714f;
  --civic: #a9503c;
  --ecological: #287573;
  --outcomes: #5b6472;
  --context: #6f685b;

  /* brand identity — the "Five Orders" mark: the hero image's panel mid-tones
     as sampled, for the logo/wordmark and swatches (not text). The domain
     accents above are the same hues made text-safe. Categorical, never a rank. */
  --brand-formal: #4b7c9f;
  --brand-institutional: #7d5f94;
  --brand-economic: #c79036;
  --brand-relational: #4b714f;
  --brand-civic: #c0634e;
  --brand-gold: #b07a2e;   /* CTA/emphasis accent only — never a domain swatch */

  /* map + charts */
  /* The choropleth ramp is warm (cream → gold → coral → plum) and holds no
     blue, so water — painted --map-water over every fill — can never be
     mistaken for a data value; the selection outline is a cool teal that
     stands off every ramp step. */
  --map-nodata: #c2c0bb;
  --map-water: #86b7dc;
  --seq-1: #f8f0d8;
  --seq-2: #ecd39a;
  --seq-3: #dfa862;
  --seq-4: #c9774a;
  --seq-5: #a14e4a;
  --seq-6: #6e2f3f;
  --select: #0b7285;

  /* status badge hues */
  --badge-measured: #3a6b48;
  --badge-modeled: #80559d;
  --badge-proxy: #8c5d27;
  --badge-crosswalk: #3d6b99;
  --badge-missing: #6b665b;

  /* type */
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;

  /* rhythm */
  --radius: 6px;
  --radius-lg: 10px;
  --shadow: 0 1px 3px rgba(35, 39, 46, 0.08), 0 4px 16px rgba(35, 39, 46, 0.06);
  --header-h: 3.5rem;
}

[data-theme="dark"] {
  --bg: #15171b;
  --bg-panel: #1d2026;
  --bg-inset: #24272e;
  --bg-hover: #262a32;
  --ink: #e8e6e0;
  --ink-soft: #b3b0a8;
  /* #96938b clears ≥4.5:1 on the dark inset/hover surfaces too (old #8b8880
     was 4.06–4.22 there). */
  --ink-faint: #96938b;
  --line: #363a42;
  --line-soft: #2b2f36;
  --focus: #7aa7e8;
  --link: #8ab2ec;

  --formal: #7aa5c4;
  --institutional: #a98fbe;
  --economic: #cf9c4b;
  --relational: #7aab7f;
  --civic: #d08571;
  --ecological: #4fb0ab;
  --outcomes: #98a1af;
  --context: #a89f8e;

  /* brand identity (dark): lightened so the mark holds contrast on ink panels */
  --brand-formal: #6f9cbd;
  --brand-institutional: #a088b5;
  --brand-economic: #d4a24f;
  --brand-relational: #6f9a72;
  --brand-civic: #d07f6a;
  --brand-gold: #c79552;

  --map-nodata: #2c2c2b;
  --map-water: #20527d;
  --seq-1: #5a3a44;
  --seq-2: #774250;
  --seq-3: #9a5049;
  --seq-4: #c27549;
  --seq-5: #dea65c;
  --seq-6: #f3d89e;
  --select: #3cc8dc;

  --badge-measured: #7fb890;
  --badge-modeled: #bb95d6;
  --badge-proxy: #cf9c5b;
  --badge-crosswalk: #7ba3cc;
  --badge-missing: #97948d;

  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 4px 16px rgba(0, 0, 0, 0.3);
}
