/* Let's Live There design tokens: the ONE source (design set 3, docs/design/sets/SET-03-05-TOKENS-TYPE-FIGURES.md).
   Everything that carries a color, radius, duration, type size or font lives here and nowhere else.
   - src/app/globals.css imports this file; tailwind.config.ts reads the variables through token().
   - `pnpm build:tokens` (run by the build and by the Dockerfile's build) copies it to public/design/tokens.css, which the journal links as
     /design/tokens.css?v=<release> (docs/JOURNAL-SERVICE-CONTRACT.md "Stage 3 authorized"), and writes src/styles/tokens.json, the machine-readable
     copy for diffing against the Design Director's Design System tokens.json (version 1).
   - src/lib/figures/palette.ts and src/lib/palette.ts mirror the colors for code that draws SVG or images (src/__tests__/palette.test.ts asserts they match).
   Colors are space-separated RGB channels so rgb(var(--x) / .5) and Tailwind's /alpha keep working. American spellings: "ocher", "color". */

/* ── Fonts: self-hosted variable WOFF2 Latin subsets (axes cut to Newsreader opsz 10-72 wght 400-600, Public Sans wght 400-700; italics are separate faces, never preloaded, fetched only when italic text renders) (SIL OFL; public/fonts/). The ?v= number is bumped when a file changes, so /fonts/* can be cached for a year. ── */
@font-face {
  font-family: 'Newsreader';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/fonts/newsreader-var.woff2?v=2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD, U+00B0, U+2026;
}
@font-face {
  font-family: 'Newsreader';
  font-style: italic;
  font-weight: 400 600;
  font-display: swap;
  src: url('/fonts/newsreader-italic-var.woff2?v=2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD, U+00B0, U+2026;
}
@font-face {
  font-family: 'Public Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/public-sans-var.woff2?v=2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD, U+00B0, U+2026;
}
@font-face {
  font-family: 'Public Sans';
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/public-sans-italic-var.woff2?v=2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD, U+00B0, U+2026;
}
/* Size-adjusted fallbacks (values computed once with @capsizecss/metrics: Newsreader against Georgia, Public Sans against Arial; committed as values). */
@font-face {
  font-family: 'Newsreader Fallback';
  src: local('Georgia');
  size-adjust: 91.75%;
  ascent-override: 80.11%;
  descent-override: 28.88%;
  line-gap-override: 0%;
}
@font-face {
  font-family: 'Public Sans Fallback';
  src: local('Arial');
  size-adjust: 102.18%;
  ascent-override: 92.98%;
  descent-override: 22.02%;
  line-gap-override: 0%;
}

:root {
  /* Paper and surfaces (unchanged) */
  --paper:   246 243 236; /* #F6F3EC */
  --canvas:  246 243 236; /* alias of paper; keep for existing classes */
  --surface: 251 249 244; /* #FBF9F4 */
  --well:    239 234 224; /* #EFEAE0 = ink-100 */

  /* Ink (unchanged) */
  --ink-50:  243 240 233;  --ink-100: 239 234 224;  --ink-200: 218 212 200;
  --ink-300: 169 163 152;  /* decorative only */
  --ink-400: 109 103 94;   --ink-500: 104 98 90;   /* 5.4:1 on paper */
  --ink-600: 88 83 75;     --ink-700: 58 54 49;     --ink-800: 42 39 35;    --ink-900: 28 26 23;

  /* Spruce: action, link, "your priority" */
  --spruce-50:  240 245 243; /* #F0F5F3 */
  --spruce-100: 227 237 232; /* #E3EDE8 selected chip, best-in-row tint */
  --spruce-200: 201 220 211; /* #C9DCD3 lines */
  --spruce-300: 163 194 181; /* #A3C2B5 decorative */
  --spruce-400: 110 158 139; /* #6E9E8B decorative */
  --spruce-500:  60 138 114; /* #3C8A72 3.7:1  large text or non-text only */
  --spruce-600:  42 107  88; /* #2A6B58 5.7:1  bar fill, focus ring */
  --spruce-700:  30  82  68; /* #1E5244 8.1:1  links, primary buttons, selected */
  --spruce-800:  23  63  52; /* #173F34 10.6:1 */
  --spruce-900:  15  43  36; /* #0F2B24 13.6:1 dark panels, share grounds */

  /* Clay: trade-off, watch-out, gap */
  --clay-100: 246 230 223; /* #F6E6DF watch-out well */
  --clay-200: 234 199 184; /* #EAC7B8 lines */
  --clay-300: 217 160 138; /* #D9A08A decorative */
  --clay-500: 201 100  63; /* #C9643F 3.5:1  non-text */
  --clay-600: 181  71  43; /* #B5472B 4.9:1  gap marker, large text */
  --clay-700: 154  59  34; /* #9A3B22 6.3:1  trade-off text */
  --clay-800: 126  46  25; /* #7E2E19 8.3:1 */

  /* Ocher: sun, rank one (never text below 800) */
  --ocher-500: 200 150  46; /* #C8962E */
  --ocher-600: 176 127  30; /* #B07F1E */
  --ocher-800: 122  84  16; /* #7A5410 6.1:1 text */

  /* Map */
  --water-300: 213 221 230; /* #D5DDE6 water fill */
  --water-500: 127 157 179; /* #7F9DB3 coast, river strokes */
  --water-600:  91 127 153; /* #5B7F99 */
  --contour:   184 154 122; /* #B89A7A borders, hairlines on maps; decorative, never a text color */

  /* Brand alias: every existing brand-N class becomes spruce on the day. New code uses spruce-N. */
  --brand-50:  var(--spruce-50);  --brand-100: var(--spruce-100); --brand-200: var(--spruce-200);
  --brand-300: var(--spruce-300); --brand-400: var(--spruce-400); --brand-500: var(--spruce-500);
  --brand-600: var(--spruce-700); /* the old action shade maps to the AA-safe link shade */
  --brand-700: var(--spruce-800); --brand-800: var(--spruce-900); --brand-900: var(--spruce-900);

  /* Semantic */
  --pos: var(--spruce-600);  --pos-soft: var(--spruce-50);  --pos-line: var(--spruce-200);  --pos-ink: var(--spruce-800);
  --warn: var(--clay-600);   --warn-soft: var(--clay-100);  --warn-line: var(--clay-200);   --warn-ink: var(--clay-800);
  --neg: 200 48 60; --neg-soft: 254 241 242; --neg-line: 250 205 209; --neg-ink: 158 32 44; /* destructive admin only */

  /* Field colors (regions, washes) re-pointed at the system */
  --field-sage: var(--spruce-300); --field-blue: var(--water-600); --field-clay: var(--clay-500);
  --field-sun: var(--ocher-500);   --field-water: var(--water-500); --field-water-soft: var(--water-300);

  /* Shape, line, motion */
  --radius-control: 6px;  --radius-card: 8px;  --radius-panel: 12px;
  --hairline: 1px solid rgb(var(--ink-200));
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-press: 120ms; --dur-move: 250ms; --dur-camera: 450ms; --dur-fade-fast: 100ms; --dur-fade: 220ms;
  --dur-count: 600ms; --dur-bar: 400ms;
  --thumb: 24px; --track: 8px;

  /* Typefaces */
  --font-display: 'Newsreader', 'Newsreader Fallback', Georgia, serif;
  --font-sans: 'Public Sans', 'Public Sans Fallback', Arial, system-ui, sans-serif;

  /* Type scale (Tailwind text-<name> reads these; the journal uses them directly). Phone values are the clamp minima, desktop the maxima. */
  --text-display: clamp(2.5rem, 1.5rem + 3.2vw, 3.5rem);        --text-display-line: 1.07; --text-display-weight: 500; --text-display-tracking: -0.015em;
  --text-h1:      clamp(2rem, 1.5rem + 1.6vw, 2.5rem);          --text-h1-line: 1.1;       --text-h1-weight: 500;      --text-h1-tracking: -0.01em;
  --text-h2:      clamp(1.5rem, 1.25rem + 0.8vw, 1.75rem);      --text-h2-line: 1.15;      --text-h2-weight: 500;      --text-h2-tracking: -0.005em;
  --text-score:   clamp(2.5rem, 2rem + 1.6vw, 3rem);            --text-score-line: 1;      --text-score-weight: 500;   --text-score-tracking: -0.02em;
  --text-dek:     clamp(1.1875rem, 1rem + 0.6vw, 1.375rem);     --text-dek-line: 1.36;     --text-dek-weight: 400;     --text-dek-tracking: 0em;
  --text-prose:   clamp(1.0625rem, 1rem + 0.4vw, 1.1875rem);    --text-prose-line: 1.58;   --text-prose-weight: 400;   --text-prose-tracking: 0em;
  --text-h3:      clamp(1rem, 0.95rem + 0.2vw, 1.0625rem);      --text-h3-line: 1.4;       --text-h3-weight: 600;      --text-h3-tracking: -0.005em;
  --text-body:    clamp(0.9375rem, 0.9rem + 0.2vw, 1rem);       --text-body-line: 1.5;     --text-body-weight: 400;    --text-body-tracking: 0em;
  --text-small:   0.875rem;                                     --text-small-line: 1.43;   --text-small-weight: 400;   --text-small-tracking: 0em;
  --text-caption: 0.75rem;                                      --text-caption-line: 1.33; --text-caption-weight: 400; --text-caption-tracking: 0.005em;
  --text-specimen: 0.6875rem;                                   --text-specimen-line: 1.27; --text-specimen-weight: 500; --text-specimen-tracking: 0.06em;
}
