/*
 * Praesens shared design tokens — canonical color / spacing / radius / type.
 *
 * Wave 0 of the 2026-07 UX plan (docs/UX_IMPROVEMENT_PLAN_2026-07.md, item #6).
 * "Literal-for-token": every value below equals the literal the surfaces already
 * used, so adopting this file is a pure-plumbing change with NO visual difference
 * on day one. Later waves reference these tokens instead of hardcoded literals so
 * color work stays consistent and cannot drift again.
 *
 * Two surface themes consume these tokens:
 *   - Dark map hub (app/styles.css) — uses the dark neutral tiers + the shared
 *     status hues.
 *   - Light onboarding pages (app/provision, app/setup, and the edge wizard's
 *     calibration_ui.html) — keep their own :root neutrals but source the shared
 *     brand/status hues from here, including the ONE canonical stop color
 *     (--c-stop-ink) that resolves the previously-undefined / two-different-reds
 *     error color on the light surfaces.
 *
 * Status-hue tint alphas (e.g. rgba(47,179,122,0.18) fills/borders on the map)
 * are intentionally still literals for now; they derive from the solids below and
 * are a later-wave refinement, not part of the Wave 0 foundation.
 */

/* ---------- Brand font (Wave 4 #19) ----------
   Space Grotesk, self-hosted (variable weight 300-700, SIL OFL — see
   fonts/OFL.txt) so no surface depends on the Google Fonts CDN. Usage rule:
   display/headings ONLY via var(--font-brand); dense data, counts, tables,
   and copyable diagnostics stay on the system/monospace stacks. */
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("./fonts/space-grotesk-var-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("./fonts/space-grotesk-var-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* ---------- Brand + status hues (shared solids) ---------- */
  --c-good: #2fb37a; /* green — connected / accepted / People / mask */
  --c-warn: #f2a93b; /* amber — connecting / caution / Vehicle / anchor */
  --c-info: #508be8; /* blue  — upstream / selected (dark map) */
  --c-stop: #e05656; /* red   — rejected / error (dark map) */

  /* Light-surface renditions (tuned for contrast on white) */
  --c-info-ink: #2368d9; /* onboarding accent */
  --c-info-deep: #17458f; /* onboarding accent-dark */
  --c-good-ink: #217a52; /* "ok" text on light */
  --c-warn-ink: #99630a; /* "warn" text on light */
  --c-stop-ink: #b42318; /* CANONICAL stop/error color on light surfaces */

  /* Status-tinted text (dark map, paired with matching tint backgrounds) */
  --c-good-text: #adf0cf;
  --c-good-text-soft: #cbf7df;
  --c-warn-text: #fbd28a;
  --c-warn-text-soft: #ffe4ad;
  --c-warn-text-code: #fff3d8;
  --c-stop-text: #ffb3b3;
  --c-info-text: #cfe0ff;
  --c-info-text-strong: #eaf1ff;

  /* ---------- Neutral tiers — dark map ---------- */
  --ink-100: #f5f7fb; /* primary text */
  --ink-200: #eef2f8; /* labels */
  --ink-300: #dbe2ef; /* section headers / secondary body */
  --ink-400: #aeb8c8; /* muted */
  --ink-code-label: #cbd3df;
  --ink-invert: #111418; /* text on colored markers */

  /* Dark-surface fills + lines (white/black overlays) */
  --panel-bg: rgba(18, 20, 24, 0.92);
  --panel-bg-solid: rgba(18, 20, 24, 0.95);
  --surface-1: rgba(255, 255, 255, 0.05);
  --surface-2: rgba(255, 255, 255, 0.045);
  --surface-3: rgba(255, 255, 255, 0.07);
  --field-bg: rgba(10, 12, 16, 0.38);
  --field-bg-dark: rgba(0, 0, 0, 0.2);
  --pre-bg: rgba(0, 0, 0, 0.22);
  --line-1: rgba(255, 255, 255, 0.1);
  --line-2: rgba(255, 255, 255, 0.12);
  --line-3: rgba(255, 255, 255, 0.14);
  --line-hover: rgba(255, 255, 255, 0.32);
  --marker-halo: rgba(0, 0, 0, 0.28);

  /* ---------- Spacing scale ---------- */
  --space-1: 2px;
  --space-2: 4px;
  --space-3: 6px;
  --space-4: 8px;
  --space-5: 10px;
  --space-6: 12px;
  --space-7: 16px;

  /* ---------- Radius scale ---------- */
  --radius-xs: 5px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-pill: 999px;

  /* ---------- Shadow ---------- */
  --shadow-panel: 0 12px 30px rgba(0, 0, 0, 0.35);

  /* ---------- Type ---------- */
  --font-sans: "Segoe UI", Arial, sans-serif;
  --font-brand: "Space Grotesk", "Segoe UI", sans-serif;
  --font-mono: "Consolas", "SFMono-Regular", monospace;
  /* Floor for uppercase micro-labels (Wave 4 #21): 10px reads too small on
     dense dark surfaces; 11px is the minimum label size. */
  --type-label: 11px;
}
