/* AIDARA Design System — tokens
   Direction: Clinical Authority (light-first). Modes: Sovereign Premium, Precision Warm.
   Everything downstream references these custom properties — never hard-code a hex. */

/* ---------- Fonts ---------- */
@font-face { font-family: "Newsreader"; src: url("../fonts/newsreader-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("../fonts/newsreader-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("../fonts/newsreader-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("../fonts/plex-sans-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("../fonts/plex-sans-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("../fonts/plex-sans-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("../fonts/plex-sans-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("../fonts/plex-mono-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("../fonts/plex-mono-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans Arabic"; src: url("../fonts/plex-arabic-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans Arabic"; src: url("../fonts/plex-arabic-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }

/* ---------- Tokens (light) ---------- */
:root {
  color-scheme: light;

  /* Surfaces */
  --paper: #f2f5f2;         /* page background — the default clinical canvas */
  --surface: #ffffff;       /* cards, panels, raised surfaces */
  --surface-sunk: #e9eee9;  /* wells, table stripes, inset fields */
  --forest: #0f3d2a;        /* brand base — authoritative hero bands / dark surfaces */

  /* Text */
  --ink: #0e1a13;           /* primary text on paper/surface */
  --muted: #4e5f57;         /* secondary text, small captions (AA) */
  --faint: #647468;         /* tertiary labels, >=18px muted text only */
  --on-forest: #f4f7f3;     /* text/marks on forest or dark surfaces */

  /* Brand / action */
  --signal: #006c35;        /* primary action */
  --on-signal: #ffffff;     /* text on signal fills */
  --gold: #a9822f;          /* premium accent — hairlines, one mark; <=5% of a screen */
  --teal: #0c6e72;          /* data, links, intelligence accent */

  /* Lines */
  --line: rgba(16, 34, 24, 0.12);
  --line-strong: rgba(16, 34, 24, 0.22);

  /* Semantic (separate from the accent set) */
  --good: #1c7a4a;
  --warn: #b5521e;
  --critical: #b22133;

  /* Type families */
  --font-serif: "Newsreader", Georgia, "Times New Roman", serif;
  --font-sans: "IBM Plex Sans", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --font-arabic: "IBM Plex Sans Arabic", "Noto Kufi Arabic", sans-serif;

  /* Spacing (4-based) */
  --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px; --space-5: 24px;
  --space-6: 32px; --space-7: 48px; --space-8: 64px; --space-9: 96px;

  /* Radius */
  --radius-sm: 6px; --radius-md: 10px; --radius-lg: 16px; --radius-pill: 999px;

  /* Elevation (used sparingly — this system prefers borders to shadows) */
  --shadow-sm: 0 1px 2px rgba(16, 34, 24, 0.06);
  --shadow-md: 0 8px 28px rgba(16, 34, 24, 0.10);

  /* Layout */
  --measure: 65ch;          /* ideal running-text width */
  --container: 1160px;
  --logo-h: 22px;           /* AIDARA / SmartCheck wordmark display height */
}

/* ---------- Tokens (dark) ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #0d1510;
    --surface: #121d16;
    --surface-sunk: #17241b;
    --forest: #14432f;
    --ink: #eaf0ea;
    --muted: #a7b4ab;
    --faint: #7c8a81;
    --on-forest: #f4f7f3;
    --signal: #2fa163;
    --on-signal: #07130c;
    --gold: #cba24c;
    --teal: #3fb0aa;
    --line: rgba(234, 240, 234, 0.13);
    --line-strong: rgba(234, 240, 234, 0.26);
    --good: #35b877;
    --warn: #e0824e;
    --critical: #e36a78;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.5);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0d1510;
  --surface: #121d16;
  --surface-sunk: #17241b;
  --forest: #14432f;
  --ink: #eaf0ea;
  --muted: #a7b4ab;
  --faint: #7c8a81;
  --on-forest: #f4f7f3;
  --signal: #2fa163;
  --on-signal: #07130c;
  --gold: #cba24c;
  --teal: #3fb0aa;
  --line: rgba(234, 240, 234, 0.13);
  --line-strong: rgba(234, 240, 234, 0.26);
  --good: #35b877;
  --warn: #e0824e;
  --critical: #e36a78;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.5);
}
