/* מודד design tokens v1 (2026-11-11). Shared by site/ and app/.
 *
 * CONTRACT: variable names are stable. Add new ones; never rename or delete.
 * Import:  <link rel="stylesheet" href="brand/tokens.css"> (site) or @import from app CSS.
 * Font:    load Heebo yourself (Google Fonts, wght 400;500;700) — this file only names it.
 * Themes:  light is default on :root.  Dark/map variant: [data-theme="dark"] on <html> or any container
 *          (use it around map views; MapLibre basemaps read better on it).
 *
 * Colour      --aw-color-primary | -primary-hover | -on-primary | -accent | -on-accent
 *             --aw-color-bg | -surface | -surface-2 | -text | -text-2 | -text-muted
 *             --aw-color-border | -border-strong | -focus | -link
 *             --aw-color-success | -warning | -error (+ -bg variants, text-safe on bg)
 * Status      --aw-status-ontrack | -behind | -stalled  (+ -bg).  בזמן / פיגור / עומד.
 *             Always pair with an icon shape (circle / triangle / square) and the word.
 * Data viz    --aw-viz-measured | -declared | -planned | -band (confidence band fill)
 * Type        --aw-font-sans | -mono ; --aw-fs-display|h1|h2|h3|body|small|label|caption ; --aw-lh-tight|-body ; --aw-fw-*
 * Space       --aw-space-1..10 (8px grid: 4 8 12 16 24 32 48 64 96 128)
 * Shape       --aw-radius-sm|md|lg|pill ; --aw-shadow-1|2 ; --aw-target (44px min) ; --aw-maxw
 * Motion      --aw-dur-fast|base ; --aw-ease  (zeroed under prefers-reduced-motion)
 */
:root {
  /* brand */
  --aw-color-primary: #1d3f63;       /* deep ledger blue: buttons, headings accents. 10.8:1 on white */
  --aw-color-primary-hover: #15304d;
  --aw-color-on-primary: #ffffff;
  --aw-color-accent: #0f6b66;        /* survey teal: links in UI, chart "measured". 6.3:1 on white */
  --aw-color-on-accent: #ffffff;
  --aw-color-link: #0f5d8c;

  /* neutrals */
  --aw-color-bg: #f6f7f9;
  --aw-color-surface: #ffffff;
  --aw-color-surface-2: #eef1f5;
  --aw-color-text: #14202e;          /* 16.5:1 on white */
  --aw-color-text-2: #44515f;        /* 8.1:1 on white */
  --aw-color-text-muted: #5b6878;    /* 5.7:1 on white, 5.3:1 on bg — still AA for body */
  --aw-color-border: #d4dae2;
  --aw-color-border-strong: #8a96a5; /* 3:1 for input borders (non-text contrast) */
  --aw-color-focus: #1a5fd0;         /* focus ring, used as 3px outline + 2px offset */

  /* feedback */
  --aw-color-success: #1d6b3f;  --aw-color-success-bg: #e3f2e8;
  --aw-color-warning: #8a5300;  --aw-color-warning-bg: #fdf0d5;
  --aw-color-error:   #b3261e;  --aw-color-error-bg:   #fbe6e4;

  /* site status (colour is never the only cue) */
  --aw-status-ontrack: var(--aw-color-success);  --aw-status-ontrack-bg: var(--aw-color-success-bg);
  --aw-status-behind:  var(--aw-color-warning);  --aw-status-behind-bg:  var(--aw-color-warning-bg);
  --aw-status-stalled: var(--aw-color-error);    --aw-status-stalled-bg: var(--aw-color-error-bg);

  /* data viz */
  --aw-viz-measured: #0f6b66;
  --aw-viz-declared: #8a5300;
  --aw-viz-planned:  #8a96a5;
  --aw-viz-band:     rgba(15, 107, 102, .16);

  /* type */
  --aw-font-sans: "Heebo", "Segoe UI", "Arial Hebrew", Arial, sans-serif;
  --aw-font-mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --aw-fs-display: clamp(2rem, 1.35rem + 2.8vw, 3.25rem);
  --aw-fs-h1: clamp(1.75rem, 1.4rem + 1.4vw, 2.5rem);
  --aw-fs-h2: clamp(1.375rem, 1.2rem + .8vw, 1.875rem);
  --aw-fs-h3: 1.1875rem;
  --aw-fs-body: 1.0625rem;           /* 17px: Hebrew reads small */
  --aw-fs-small: .9375rem;
  --aw-fs-label: .9375rem;
  --aw-fs-caption: .8125rem;
  --aw-lh-tight: 1.2;
  --aw-lh-body: 1.65;
  --aw-fw-regular: 400; --aw-fw-medium: 500; --aw-fw-bold: 700;

  /* space (8px grid with a 4px half-step) */
  --aw-space-1: 4px;  --aw-space-2: 8px;  --aw-space-3: 12px; --aw-space-4: 16px; --aw-space-5: 24px;
  --aw-space-6: 32px; --aw-space-7: 48px; --aw-space-8: 64px; --aw-space-9: 96px; --aw-space-10: 128px;

  /* shape */
  --aw-radius-sm: 4px; --aw-radius-md: 8px; --aw-radius-lg: 14px; --aw-radius-pill: 999px;
  --aw-shadow-1: 0 1px 2px rgba(20, 32, 46, .06), 0 1px 3px rgba(20, 32, 46, .08);
  --aw-shadow-2: 0 4px 16px rgba(20, 32, 46, .10);
  --aw-target: 44px;
  --aw-maxw: 1160px;

  /* motion */
  --aw-dur-fast: 120ms; --aw-dur-base: 200ms; --aw-ease: cubic-bezier(.2, .6, .2, 1);

  color-scheme: light;
}

/* Dark, map-friendly variant: low-glare neutrals so imagery and status markers carry the colour. */
[data-theme="dark"] {
  --aw-color-primary: #7fb0e6;
  --aw-color-primary-hover: #a3c7ef;
  --aw-color-on-primary: #0d1620;
  --aw-color-accent: #4fc2b7;
  --aw-color-on-accent: #0d1620;
  --aw-color-link: #8cc4f2;
  --aw-color-bg: #0d1620;
  --aw-color-surface: #15212e;
  --aw-color-surface-2: #1c2a39;
  --aw-color-text: #e7edf3;
  --aw-color-text-2: #b8c3cf;
  --aw-color-text-muted: #98a5b3;
  --aw-color-border: #2b3a4b;
  --aw-color-border-strong: #6b7b8d;
  --aw-color-focus: #8fb8ff;
  --aw-color-success: #6fd39a;  --aw-color-success-bg: #12301f;
  --aw-color-warning: #f2bd5c;  --aw-color-warning-bg: #352710;
  --aw-color-error:   #ff8a80;  --aw-color-error-bg:   #3a1714;
  --aw-viz-measured: #4fc2b7;
  --aw-viz-declared: #f2bd5c;
  --aw-viz-planned:  #6b7b8d;
  --aw-viz-band:     rgba(79, 194, 183, .20);
  --aw-shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
  --aw-shadow-2: 0 6px 20px rgba(0, 0, 0, .45);
  color-scheme: dark;
}

@media (prefers-reduced-motion: reduce) {
  :root { --aw-dur-fast: 0ms; --aw-dur-base: 0ms; }
}
