/* ============================================================================
   FUNDIS shared design tokens - THE single source of truth for colour, type,
   radius and motion across every surface: the admin SPA, the worker PWA, and
   the standalone EJS portals (risk, incidents, complaints, SA, shiftplay).

   HOW TO TUNE (the whole point): change a value ONCE here and it flows to every
   surface that loads this file. To restyle the brand accent, edit --accent (and
   its dark override) and nothing else.

   These values MIRROR public/fundis-roster/styles.css :root (the admin SPA still
   defines its own copy for now). Keep the two in step until the SPA is switched
   to @import this file; see docs/DESIGN-SYSTEM.md.

   Dark mode: driven by html[data-theme="dark"] (same hook as the SPA and the
   portals' a11y.js widget). Everything is defined through tokens so a surface
   that uses var(--bg)/var(--ink)/... gets dark mode for free.
   ========================================================================== */

:root {
  /* surfaces */
  --bg:        oklch(98.5% 0.005 250);
  --bg-2:      oklch(96% 0.005 250);
  --card:      #ffffff;

  /* ink scale */
  --ink:       oklch(20% 0.01 260);
  --ink-2:     oklch(38% 0.01 260);
  --ink-3:     oklch(50% 0.01 260);   /* lifted vs the SPA's 58% so muted text clears WCAG AA on white */
  --ink-4:     oklch(64% 0.008 260);

  /* lines */
  --line:      oklch(91% 0.005 260);
  --line-2:    oklch(86% 0.005 260);

  /* the one brand accent (edit this to restyle every primary/active/focus) */
  --accent:      oklch(55% 0.10 200);
  --accent-fg:   #ffffff;
  --accent-soft: oklch(94% 0.03 200);

  /* semantic status - level + soft background pair */
  --ok:        oklch(52% 0.13 150);  --ok-soft:   oklch(94% 0.05 150);
  --warn:      oklch(52% 0.13 75);   --warn-soft: oklch(95% 0.06 85);
  --high:      oklch(55% 0.15 55);   --high-soft: oklch(94% 0.06 55);
  --crit:      oklch(52% 0.19 25);   --crit-soft: oklch(94% 0.07 25);

  /* radius / motion / elevation */
  --radius-sm: 4px;
  --radius:    6px;
  --radius-lg: 12px;
  --shadow-1:  0 1px 2px rgba(16,24,40,.06);
  --shadow-2:  0 6px 20px rgba(16,24,40,.12), 0 1px 3px rgba(16,24,40,.06);
  --motion-fast: 120ms;
  --motion:      180ms;
  --ease:        cubic-bezier(0.32, 0.72, 0.18, 1);

  /* type - Lexend is the intended UI face; the chain falls back to a real
     system font so there is never a silent broken fallback if Lexend is not
     loaded on a given surface. --font-mono for data/IDs. */
  --font:      'Lexend', 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* Aliases for the older var names the portals + a11y.js use, so those surfaces
     resolve to the shared tokens without renaming their component CSS. a11y.js
     themes via --text/--surface/--border, so its dark toggle still overrides
     these. var() resolves at use, so these track the dark --ink/--card too. */
  --text:     var(--ink);
  --surface:  var(--card);
  --surface2: var(--bg-2);
  --border:   var(--line);
}

html[data-theme="dark"] {
  --bg:        oklch(16% 0.012 260);
  --bg-2:      oklch(20% 0.014 260);
  --card:      oklch(22% 0.014 260);
  --ink:       oklch(94% 0.005 260);
  --ink-2:     oklch(78% 0.008 260);
  --ink-3:     oklch(62% 0.010 260);
  --ink-4:     oklch(45% 0.012 260);
  --line:      oklch(28% 0.014 260);
  --line-2:    oklch(34% 0.014 260);

  --accent:      oklch(72% 0.12 200);
  --accent-fg:   oklch(15% 0.02 260);
  --accent-soft: oklch(28% 0.06 200);

  --ok:   oklch(70% 0.14 150); --ok-soft:   oklch(26% 0.06 150);
  --warn: oklch(72% 0.13 80);  --warn-soft: oklch(28% 0.06 85);
  --high: oklch(70% 0.15 55);  --high-soft: oklch(28% 0.07 40);
  --crit: oklch(68% 0.17 25);  --crit-soft: oklch(28% 0.08 25);

  --shadow-1: 0 1px 2px rgba(0,0,0,.30);
  --shadow-2: 0 8px 24px rgba(0,0,0,.55), 0 1px 3px rgba(0,0,0,.40);
}
