/* Shared site palette: plain white (light) and soft near-black (dark), one blue accent.
   Every page links this before its own <style>, so pages only keep layout and page-only tokens.
   Light is the default. Dark applies on :root[data-theme=dark] (homepage, calendar, private apps)
   and html.dark (Library), and on prefers-color-scheme: dark when a page has not set light.
   Both naming schemes are covered: the homepage set (--text, --hair, --card, --gold, --btn ...)
   and the app set (--ink, --muted, --line, --surface, --accent ...).
   Light: page, cards and fields are white; cards read through hairline borders and soft shadows,
   and wells behind chips and segments are a neutral light gray (#f2f2f2) with no warm tint.
   Contrast (WCAG): see test/theme.test.mjs, which checks AA for text, muted, faint, accent,
   links and button labels on the page, card and well colours in both modes. */
@font-face{font-family:"Geist";src:url(/fonts/geist-var.woff2) format("woff2");font-weight:100 900;font-display:swap}

:root{
  color-scheme:light;
  --font-ui:"Geist","Geist Variable",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  --font-mono:"JetBrains Mono",ui-monospace,SFMono-Regular,Menlo,monospace;

  /* Page and surfaces: plain white, neutral gray wells */
  --bg:#ffffff;
  --hero-bg:#ffffff;
  --bg2:#f2f2f2;
  --surface:#ffffff;
  --surface-2:#f2f2f2;
  --card:#ffffff;
  --card-2:#f2f2f2;
  --field:#ffffff;

  /* Ink */
  --text:#171614;
  --ink:#171614;
  --text-2:#5c5b57;
  --muted:#5c5b57;
  --text-3:#62615d;
  --faint:#62615d;

  /* Hairlines */
  --hair:rgba(23,22,20,.12);
  --hair-2:rgba(23,22,20,.18);
  --line:rgba(23,22,20,.12);
  --line-2:rgba(23,22,20,.18);
  --card-border:rgba(23,22,20,.12);

  /* The one accent: Rams' blue */
  --accent:#0b5cc2;
  --accent-ink:#0b5cc2;
  --accent-soft:rgba(11,92,194,.10);
  --on-accent:#fff;
  --gold:#1166c0;
  --gold2:#0b4f9e;
  --label:#0b5cc2;
  --btn:#0b2a4a;
  --on-btn:#fff;

  /* Glass and depth */
  --nav-bg:rgba(255,255,255,.78);
  --glass:rgba(255,255,255,.85);
  --glass-2:rgba(255,255,255,.6);
  --shadow:0 1px 2px rgba(23,22,20,.05),0 4px 16px rgba(23,22,20,.05);
  --sh-rest:0 .5px 1px rgba(23,22,20,.06),0 3px 12px rgba(23,22,20,.05);
  --sh-float:0 1px 2px rgba(23,22,20,.06),0 10px 40px rgba(23,22,20,.08);
  --sh-btn:0 .5px 1px rgba(23,22,20,.10),0 2px 6px rgba(23,22,20,.06);
  /* Hairline for white-on-white cards and pills that have no border of their own (paired with --shadow). */
  --ring:inset 0 0 0 1px rgba(23,22,20,.10);
}

:root[data-theme=dark],html.dark{
  color-scheme:dark;
  --bg:#1d1d1f;
  --hero-bg:#1d1d1f;
  --bg2:#2c2c2e;
  --surface:#2c2c2e;
  --surface-2:#323234;
  --card:#2c2c2e;
  --card-2:#323234;
  --field:#232325;

  --text:#f5f5f7;
  --ink:#f5f5f7;
  --text-2:#a8a8ad;
  --muted:#a8a8ad;
  --text-3:#9d9da2;
  --faint:#9d9da2;

  --hair:rgba(255,255,255,.08);
  --hair-2:rgba(255,255,255,.14);
  --line:rgba(255,255,255,.08);
  --line-2:rgba(255,255,255,.14);
  --card-border:rgba(255,255,255,.08);

  --accent:#8fc3ff;
  --accent-ink:#8fc3ff;
  --accent-soft:rgba(143,195,255,.14);
  --on-accent:#0b2a4a;
  --gold:#8fc3ff;
  --gold2:#b5d7ff;
  --label:#8fc3ff;
  --btn:#8fc3ff;
  --on-btn:#0b2a4a;

  --nav-bg:rgba(29,29,31,.72);
  --glass:rgba(44,44,46,.82);
  --glass-2:rgba(44,44,46,.55);
  --shadow:0 1px 2px rgba(0,0,0,.30);
  --sh-rest:0 .5px 1px rgba(0,0,0,.30),0 3px 12px rgba(0,0,0,.22);
  --sh-float:0 1px 2px rgba(0,0,0,.30),0 10px 40px rgba(0,0,0,.35);
  --sh-btn:0 .5px 1px rgba(0,0,0,.30),0 2px 6px rgba(0,0,0,.22);
  --ring:0 0 #0000;
}

/* Pages that have not chosen light follow the device before their boot script runs (or if it cannot). */
@media (prefers-color-scheme: dark){
  :root:not([data-theme=light]):not([data-theme=dark]):not(.dark){
    color-scheme:dark;
    --bg:#1d1d1f;--hero-bg:#1d1d1f;--bg2:#2c2c2e;--surface:#2c2c2e;--surface-2:#323234;
    --card:#2c2c2e;--card-2:#323234;--field:#232325;
    --text:#f5f5f7;--ink:#f5f5f7;--text-2:#a8a8ad;--muted:#a8a8ad;--text-3:#9d9da2;--faint:#9d9da2;
    --hair:rgba(255,255,255,.08);--hair-2:rgba(255,255,255,.14);--line:rgba(255,255,255,.08);--line-2:rgba(255,255,255,.14);
    --card-border:rgba(255,255,255,.08);
    --accent:#8fc3ff;--accent-ink:#8fc3ff;--accent-soft:rgba(143,195,255,.14);--on-accent:#0b2a4a;
    --gold:#8fc3ff;--gold2:#b5d7ff;--label:#8fc3ff;--btn:#8fc3ff;--on-btn:#0b2a4a;
    --nav-bg:rgba(29,29,31,.72);--glass:rgba(44,44,46,.82);--glass-2:rgba(44,44,46,.55);
    --shadow:0 1px 2px rgba(0,0,0,.30);
    --sh-rest:0 .5px 1px rgba(0,0,0,.30),0 3px 12px rgba(0,0,0,.22);
    --sh-float:0 1px 2px rgba(0,0,0,.30),0 10px 40px rgba(0,0,0,.35);
    --sh-btn:0 .5px 1px rgba(0,0,0,.30),0 2px 6px rgba(0,0,0,.22);
    --ring:0 0 #0000;
  }
}
