/* Cogent Systems site theme (Phase 3, owner decision D3: the new look on the site first, the apps at Beta).
   A layer between iq-ui.css and site.css: it maps iq-ui's tokens onto the site palette, adds the site's own
   tokens, and declares the self-hosted fonts. site.css takes every colour from these tokens.

   Palette (owner, 2026-10-30): ink #111827, counsel navy #12284C, warm cream #FFFBF2, saffron #F5A524
   (calls to action, always with ink text), marigold #FFC94D, teal #0F766E (built), amber #B45309
   (in progress), slate #475569 (planned). Every text pair is checked for WCAG 2.2 AA by
   tests/test_theme_contrast.py, which reads the two token blocks below.

   Fonts: WOFF2 files from the fontsource npm packages (Latin subset), each with its SIL Open Font
   Licence beside it in static/fonts: Figtree 5.2.10 (400, 600), Barlow Condensed 5.2.8 (700),
   JetBrains Mono 5.2.8 (500), Source Serif 4 5.2.9 (400). Served from this origin (font-src 'self'). */

@font-face { font-family: "Figtree"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/figtree-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 500 700; font-display: swap; src: url("../fonts/figtree-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/barlow-condensed-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400 600; font-display: swap; src: url("../fonts/jetbrains-mono-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/source-serif-4-latin-400-normal.woff2") format("woff2"); }

:root {
  --font-sans: "Figtree", system-ui, "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: var(--font-sans);
  --font-headline: "Barlow Condensed", "Arial Narrow", var(--font-sans);
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Menlo, Consolas, monospace;
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --radius-lg: 14px;
}

/* The high-contrast theme stays iq-ui's: the site palette applies only when the visitor has not asked
   for more contrast. */
@media not all and (prefers-contrast: more) {
  /* tokens: light */
  :root {
    color-scheme: light;
    --bg: #FFFBF2;
    --surface: #FFFFFF;
    --surface-2: #F8F1E3;
    --selected: #FBE7BA;
    --mark: #FFE7A3;
    --text: #111827;
    --text-2: #374151;
    --muted: #475569;
    --line: #E7DECB;
    --line-strong: #857A66;
    --accent: #12284C;
    --accent-hover: #1F3D6E;
    --on-accent: #FFFFFF;
    --focus: #12284C;
    --ok: #0F766E;
    --warn: #B45309;
    --danger: #B42318;
    --info: #1E4E8C;
    --ok-bg: #E8F5F2;
    --warn-bg: #FEF5E8;
    --danger-bg: #FCE9E7;
    --info-bg: #E6EDF7;
    --lexiq: #3346B8;
    --practiceiq: #0F6F62;
    --codexiq: #805600;
    --aegisiq: #A8283F;
    --navy: #12284C;
    --on-navy: #FFFBF2;
    --on-navy-2: #D5DCE8;
    --on-navy-accent: #FFC94D;
    --cta: #F5A524;
    --cta-hover: #FFC94D;
    --on-cta: #111827;
    --marker: #FFC94D;
    --status-built: #0F766E;
    --status-progress: #B45309;
    --status-planned: #475569;
  }
}

/* With more contrast asked for, the site tokens fall back to iq-ui's high-contrast values. */
@media (prefers-contrast: more) {
  :root {
    --navy: var(--surface);
    --on-navy: var(--text);
    --on-navy-2: var(--text);
    --on-navy-accent: var(--accent);
    --cta: var(--accent);
    --cta-hover: var(--accent-hover);
    --on-cta: var(--on-accent);
    --marker: var(--line-strong);
    --status-built: var(--ok);
    --status-progress: var(--warn);
    --status-planned: var(--muted);
  }
}
