/* Bushwheel design tokens: the master copy.
   Colors, fonts, spacing, radii and shadows for bushwheel.com, the Loadout app
   and the shop theme start here. Change a value here first; site.css, the app
   and the brand book follow from it. Every page loads this file before site.css.

   Two layers:
   1. Palette: the site's ramps and named colors (the values).
   2. Semantic: the app's names (--bg, --ink, --btn, --link, --ok ...) pointing at palette steps.
   Then the night set.

   Design reset 2026-11-11, "Spruce Understory" (Dave approved; Shinrin-yoku theme):
   canvas daylight with Spruce for actions, forest-floor night with dusty sage,
   Schibsted Grotesk headings (Dave, 2026-11-11; replaced Bricolage Grotesque,
   which replaced Alegreya), Atkinson Hyperlegible Next for text, Caprasimo for the brand name only. Terracotta is retired. Token names are unchanged so markup doesn't
   change; "accent" now means the Spruce family and "accent-2" the leaf greens.
   Hue rules: green = action, selected and ok (status always has a shape or word);
   ochre = warn only; red = bad only. Every text pair passes WCAG AA (4.5:1),
   UI and focus pass 3:1, light and night.
   The logo keeps its own art colors (cream, rust, olive, lake, sky); only its
   sun moved to gold #e3b25e (Dave, 2026-11-11). Tire is black on light grounds
   and neutral-500 gray #9d988c on Spruce and night. */

/* ── 1. Palette ─────────────────────────────────────────────────────────── */
:root {
  /* Grounds and roles */
  --color-bg: #f6f2e9;
  --color-surface: #ece6d9;
  --color-text: #22201c;
  --color-accent: #2f4a3a;      /* Spruce; also the site's link color (8.7:1 on bg) */
  --color-accent-2: #6b8545;    /* leaf, for ticks and small marks */
  --color-divider: color-mix(in srgb, #22201c 14%, transparent);

  /* Tonal ramps in OKLCH. Neutral keeps the old shared lightness scale; Spruce
     and leaf put 700 on the action and ok colors. */
  --color-neutral-100: #f8f4ed;
  --color-neutral-200: #ebe7df;
  --color-neutral-300: #d8d4ca;
  --color-neutral-400: #bcb7ac;
  --color-neutral-500: #9d988c;
  --color-neutral-600: #807a6d;
  --color-neutral-700: #625d52;
  --color-neutral-800: #464239;
  --color-neutral-900: #2e2b24;

  --color-accent-100: #eff8f2;
  --color-accent-200: #ddece3;
  --color-accent-300: #c3d7ca;
  --color-accent-400: #9fb8a8;
  --color-accent-500: #799885;
  --color-accent-600: #527560;
  --color-accent-700: #2f4a3a;
  --color-accent-800: #243a2d;
  --color-accent-900: #17241c;

  --color-accent-2-100: #f3f7ee;
  --color-accent-2-200: #e3ecd8;
  --color-accent-2-300: #ccdabb;
  --color-accent-2-400: #adbf95;
  --color-accent-2-500: #8ba16d;
  --color-accent-2-600: #6b8545;
  --color-accent-2-700: #4f6b1c;
  --color-accent-2-800: #3a5016;
  --color-accent-2-900: #26330f;

  /* Site named colors */
  --ground: #ece6d9;        /* body behind the page */
  --paper: #fcfaf5;
  --cream: #f6f2e9;         /* light text on dark tiles and panels */
  --mist: #e4e9de;          /* sage mist bands and panels */
  --lake: #3c5a66;          /* quiet slate blue: one plan card and charts only */
  --sky: #e5ecee;
  --sky-deep: #9db3bd;

  /* Brand constants: these never change at night. Use them for brand-colored
     tiles and for text that sits on them. Names kept for site.css; values moved
     to the new palette (rust is now a brick red used only in data marks). */
  --rust: #a3402f;
  --olive: #587236;
  --olive-deep: #3f5230;
  --spruce: #2f4a3a;
  --lake-deep: #3c5a66;     /* constant: same in both themes; brand tiles only. Cream text 6.6:1 */
  --charcoal: #22201c;

  /* Fonts. Schibsted Grotesk for headings, taglines, prices and specs (weight
     600 at most, so headings stay calm); Atkinson Hyperlegible Next for body
     and UI; Caprasimo only for the Bushwheel name.
     Number columns set font-variant-numeric: tabular-nums. */
  --font-heading: "Schibsted Grotesk", system-ui, sans-serif;
  --font-heading-weight: 600;
  --font-body: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", system-ui, sans-serif;
  --font-brand: "Caprasimo", Georgia, serif;

  --space-1: 4.4px;
  --space-2: 8.8px;
  --space-3: 13.2px;
  --space-4: 17.6px;
  --space-6: 26.4px;
  --space-8: 35.2px;

  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 28px;        /* app: 24px */

  /* Elevation: soft ink-tinted shadows on the light theme. */
  --shadow-sm: 0 1px 2px color-mix(in srgb, #2e2b24 14%, transparent);
  --shadow-md: 0 3px 10px color-mix(in srgb, #2e2b24 16%, transparent);
  --shadow-lg: 0 12px 32px color-mix(in srgb, #2e2b24 22%, transparent);
  --shadow-page: 0 12px 32px color-mix(in srgb, #2e2b24 18%, transparent);   /* the page sheet */
  --shadow-badge: 0 3px 6px color-mix(in srgb, #2e2b24 22%, transparent);    /* header badge drop-shadow */
  --scrim: rgba(20,22,18,.92);    /* photo lightbox backdrop */
}

/* ── 2. Semantic (the app's names) ──────────────────────────────────────── */
:root {
  --bg: var(--color-bg);
  --surface: var(--color-surface);
  --ink: var(--color-text);
  --muted: #5f594e;                      /* 6.2:1 on bg */
  --line: var(--color-divider);
  --accent: var(--btn);                  /* retired as its own hue; kept so old uses work */
  --accent-soft: #dde6da;
  --link: var(--color-accent-700);       /* links in running text are underlined */
  --link-hover: var(--color-accent-800);
  --btn: var(--color-accent-700);        /* Spruce #2f4a3a, 9.3:1 with --btn-ink */
  --btn-hover: #466a55;   /* hover is lighter (1.60 step from rest) */
  --btn-active: #16241c;  /* pressed is darker (1.66 step); Dave 2026-11-11 */
  --btn-ink: var(--paper);
  --btn-olive: #2f4a3a;          /* home banner (now Spruce; same in both themes) */
  --btn-olive-ring: #5c7a66;     /* home banner circle */
  --focus: var(--color-accent-700);

  /* Selected chips, rows and filters: sage tint, Spruce ink, 2px edge. */
  --sel-bg: #dde6da;
  --sel-ink: #2f4a3a;
  --sel-line: #2f4a3a;

  /* Field and secondary-button borders (WCAG 1.4.11, 3:1 on paper, bg and surface). */
  --line-strong: #827a6c;

  /* Deep panels (footer, home call-out): a dark Spruce panel
     in both themes, with light text on it. */
  --deep: var(--spruce);
  --on-deep: var(--paper);          /* headings and strong text, 9.3:1 */
  --on-deep-soft: #d6e2d8;          /* body text, 7.3:1 */

  /* Header bar (app): dark Spruce (Dave, 2026-11-11). */
  --bar: var(--spruce);
  --bar-ink: var(--cream);          /* 8.7:1 */
  --bar-muted: #d6e2d8;

  /* Status: hue + shape + word, never hue alone. */
  --ok: var(--color-accent-2-700);  /* leaf #4f6b1c */
  --ok-fill: var(--color-accent-2-600);
  --ok-soft: #e6edd5;
  --warn: #85600f;
  --warn-soft: #f6ecd3;
  --bad: #a3402f;
  --bad-soft: #f8e3dd;
  --idle: #615c53;
  --idle-soft: #ebe6dc;

  /* Trip day types (Loadout Days grid, ITN-23). Fills are a second cue only: the
     cell always names its type. Each passes AA for --ink, --muted, --ok and --warn text. */
  --day-travel: #e0e8ec;
  --day-trail: #e1ead7;
  --day-layover: #eee8db;
  --day-rest: #f4f1ea;

  --scrim-sheet: rgba(22,25,20,.40);   /* behind modal sheets */
  --shadow: var(--shadow-md), var(--shadow-lg);

  /* --f-title and --f-name are legacy app names kept as aliases; new code uses
     --font-heading, --font-brand and --f-ui. */
  --f-title: var(--font-brand);
  --f-name: var(--font-heading);
  --f-ui: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ── 3. Night ──────────────────────────────────────────────────────────────
   Forest floor with a little ember. Pattern: bare :root is light; dark follows
   the device unless data-theme="light"; data-theme="dark" forces night. The site
   has no toggle (no JavaScript), so it follows the device.
   The two blocks below are identical; keep them in step. */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #161914; --paper: #1f221c; --surface: #282c25;
  --bar: #1e2b22; --bar-ink: #eae9dc; --bar-muted: #b9c6b5;
  --ink: #eae9dc; --muted: #aeb0a2; --line: rgba(234,233,220,.14);
  --accent: var(--btn); --accent-soft: #2b3326;
  --link: #bcc6a6; --link-hover: #d3dbc2;
  --btn: #a7b796; --btn-hover: #c5d2b5; --btn-active: #7f9070; --btn-ink: #161914;
  --focus: #bcc6a6;
  --sel-bg: #2b3326; --sel-ink: #dfe6cf; --sel-line: #a7b796;
  --line-strong: #7e8174;
  --ok: #b8d38a; --ok-fill: #8fa86a; --ok-soft: #232d19;
  --warn: #e3b25e; --warn-soft: #3a2f17;
  --day-travel: #24303a; --day-trail: #283322; --day-layover: #332e25; --day-rest: #1c1f19;
  --bad: #f0907d; --bad-soft: #44221d;
  --idle: #a0a095; --idle-soft: #2c2e28;
  --lake: #9db3bd; --sky: #232b2e;
  --scrim-sheet: rgba(0,0,0,.60);
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 30px rgba(0,0,0,.4);
  color-scheme: dark;

  /* Site palette at night, mapped onto the shared night names above.
     Grounds and text follow the shared set; the tonal ramps flip end for end
     (100 <-> 900, with 700 landing on the shared --muted, --link and --ok), so a
     light tint becomes a dark one and dark text turns light. */
  --color-bg: var(--bg); --color-surface: var(--surface); --color-text: var(--ink);
  --color-accent: var(--link); --color-divider: var(--line);
  --ground: var(--bg); --mist: #22281f;
  --color-neutral-100: #2e2b24; --color-neutral-200: #464239; --color-neutral-300: #625d52; --color-neutral-400: #807a6d; --color-neutral-500: #9d988c; --color-neutral-600: #bcb7ac; --color-neutral-700: #aeb0a2; --color-neutral-800: #ebe7df; --color-neutral-900: #f8f4ed;
  --color-accent-100: #17241c; --color-accent-200: #243a2d; --color-accent-300: #2f4a3a; --color-accent-400: #527560; --color-accent-500: #799885; --color-accent-600: #9fb8a8; --color-accent-700: #bcc6a6; --color-accent-800: #ddece3; --color-accent-900: #eff8f2;
  --color-accent-2-100: #26330f; --color-accent-2-200: #3a5016; --color-accent-2-300: #4f6b1c; --color-accent-2-400: #6b8545; --color-accent-2-500: #8ba16d; --color-accent-2-600: #adbf95; --color-accent-2-700: #b8d38a; --color-accent-2-800: #e3ecd8; --color-accent-2-900: #f3f7ee;
  --deep: #1e2b22; --on-deep: #eae9dc; --on-deep-soft: #b9c6b5;
} }
:root[data-theme="dark"] {
  --bg: #161914; --paper: #1f221c; --surface: #282c25;
  --bar: #1e2b22; --bar-ink: #eae9dc; --bar-muted: #b9c6b5;
  --ink: #eae9dc; --muted: #aeb0a2; --line: rgba(234,233,220,.14);
  --accent: var(--btn); --accent-soft: #2b3326;
  --link: #bcc6a6; --link-hover: #d3dbc2;
  --btn: #a7b796; --btn-hover: #c5d2b5; --btn-active: #7f9070; --btn-ink: #161914;
  --focus: #bcc6a6;
  --sel-bg: #2b3326; --sel-ink: #dfe6cf; --sel-line: #a7b796;
  --line-strong: #7e8174;
  --ok: #b8d38a; --ok-fill: #8fa86a; --ok-soft: #232d19;
  --warn: #e3b25e; --warn-soft: #3a2f17;
  --day-travel: #24303a; --day-trail: #283322; --day-layover: #332e25; --day-rest: #1c1f19;
  --bad: #f0907d; --bad-soft: #44221d;
  --idle: #a0a095; --idle-soft: #2c2e28;
  --lake: #9db3bd; --sky: #232b2e;
  --scrim-sheet: rgba(0,0,0,.60);
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 30px rgba(0,0,0,.4);
  color-scheme: dark;

  /* Site palette at night, mapped onto the shared night names above.
     Grounds and text follow the shared set; the tonal ramps flip end for end
     (100 <-> 900, with 700 landing on the shared --muted, --link and --ok), so a
     light tint becomes a dark one and dark text turns light. */
  --color-bg: var(--bg); --color-surface: var(--surface); --color-text: var(--ink);
  --color-accent: var(--link); --color-divider: var(--line);
  --ground: var(--bg); --mist: #22281f;
  --color-neutral-100: #2e2b24; --color-neutral-200: #464239; --color-neutral-300: #625d52; --color-neutral-400: #807a6d; --color-neutral-500: #9d988c; --color-neutral-600: #bcb7ac; --color-neutral-700: #aeb0a2; --color-neutral-800: #ebe7df; --color-neutral-900: #f8f4ed;
  --color-accent-100: #17241c; --color-accent-200: #243a2d; --color-accent-300: #2f4a3a; --color-accent-400: #527560; --color-accent-500: #799885; --color-accent-600: #9fb8a8; --color-accent-700: #bcc6a6; --color-accent-800: #ddece3; --color-accent-900: #eff8f2;
  --color-accent-2-100: #26330f; --color-accent-2-200: #3a5016; --color-accent-2-300: #4f6b1c; --color-accent-2-400: #6b8545; --color-accent-2-500: #8ba16d; --color-accent-2-600: #adbf95; --color-accent-2-700: #b8d38a; --color-accent-2-800: #e3ecd8; --color-accent-2-900: #f3f7ee;
  --deep: #1e2b22; --on-deep: #eae9dc; --on-deep-soft: #b9c6b5;
}
