/* Design tokens: fonts, colours, sizes. Every other stylesheet uses these variables, never raw values,
   so the whole look can be changed here in one place. Owned by the design team.
   Colour pairs are checked for WCAG AA contrast (text 4.5:1, controls 3:1) by scripts/check-contrast.js.

   THE RULE: white, black, and one colour per case ("the case colour", --case).
   Each case file names its own colour (content/caseN/case.json). The app sets --case and --case-ink when the case
   loads (app/brand.js). The case colour is only ever a FILL (a band, a tab, a button, a ribbon) with --case-ink text
   on it, never thin text on white, so any colour the writers choose stays readable.
   The only other colours in the app are puzzle pieces where colour IS the puzzle (Flood, Echo, Queens). */

/* ---------- fonts (self-hosted, see /fonts/LICENSE.md) ---------- */
@font-face{font-family:"Big Shoulders";src:url(/fonts/big-shoulders.woff2) format("woff2");font-weight:100 900;font-style:normal;font-display:swap}
@font-face{font-family:"Inter Tight";src:url(/fonts/inter-tight.woff2) format("woff2");font-weight:100 900;font-style:normal;font-display:swap}
@font-face{font-family:"Inter Tight";src:url(/fonts/inter-tight-italic.woff2) format("woff2");font-weight:100 900;font-style:italic;font-display:swap}
@font-face{font-family:"Newsreader";src:url(/fonts/newsreader.woff2) format("woff2");font-weight:200 800;font-style:normal;font-display:swap}
@font-face{font-family:"Newsreader";src:url(/fonts/newsreader-italic.woff2) format("woff2");font-weight:200 800;font-style:italic;font-display:swap}
@font-face{font-family:"Literata";src:url(/fonts/literata.woff2) format("woff2");font-weight:200 900;font-style:normal;font-display:swap}
@font-face{font-family:"Literata";src:url(/fonts/literata-italic.woff2) format("woff2");font-weight:200 900;font-style:italic;font-display:swap}
@font-face{font-family:"JetBrains Mono";src:url(/fonts/jetbrains-mono.woff2) format("woff2");font-weight:100 800;font-style:normal;font-display:swap}

:root{
  /* type: Big Shoulders for titles (always upper case), Inter Tight for the app, Newsreader for reading */
  --f-ui:"Inter Tight",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  --f-display:"Big Shoulders","Arial Narrow","Roboto Condensed",Impact,sans-serif;
  --f-read:"Newsreader",Georgia,"Times New Roman",serif;
  --f-mono:"JetBrains Mono",ui-monospace,Menlo,Consolas,monospace;
  --fs:16px; --lh:1.6; --w:960px;
  --t-xs:.75rem; --t-sm:.875rem; --t-md:1rem; --t-lg:1.125rem; --t-xl:1.5rem; --t-2xl:clamp(2.4rem,11vw,3.4rem); --t-3xl:clamp(3rem,15vw,4.6rem);
  /* space (4px steps) */
  --s1:4px; --s2:8px; --s3:12px; --s4:16px; --s5:20px; --s6:24px; --s8:32px; --s10:40px;
  /* shape */
  --r-sm:8px; --r:12px; --r-lg:16px; --r-pill:999px;
  --tap:48px; --tap-sm:44px;
  --sh-1:none; --sh-2:none;
  --sh-3:0 12px 40px rgb(0 0 0 / .25);
  --ease:cubic-bezier(.2,.7,.2,1);

  /* colour: white, black, and the case colour */
  --case:#ffc21a;      /* the case colour: overwritten from the case file when it loads */
  --case-ink:#000000;  /* text on the case colour: black or white, worked out from the colour */
  --bg:#ffffff;        /* page */
  --sf:#ffffff;        /* cards, bars */
  --sf2:#f0f0f0;       /* sunken areas, given cells, hover (a tint of black) */
  --ink:#000000;       /* text and outlines */
  --mut:#555555;       /* secondary text (black at about 67%) */
  --ln:#000000;        /* control borders */
  --edge:#000000;      /* card and tile outlines */
  --ln2:#d9d9d9;       /* soft dividers (decorative) */
  --bw:2px;            /* outline width */
  --ac:#000000;        /* links, selected outlines: black */
  --ac-soft:#ececec;   /* selected states */
  --on:#ffffff;        /* text on black */
  --hot:var(--case);   /* "live / now" marks use the case colour */
  --hot-ink:#000000;
  --mustard:var(--case);
  --gold:var(--case);
  --bad:#000000;       /* errors are black, bold, with a ✕ mark — no red */
  --bad-soft:#e6e6e6;
  --ok:#000000;        /* success is black with a ✓ mark */
  --ok-soft:color-mix(in srgb,var(--case) 40%,#ffffff);
  --warn:#000000;
  --focus:#000000;
  --on-banner:#ffffff;
}
/* The app always opens in this white look. It does not follow the device's dark mode:
   a reader who wants a dark page chooses "Black" inside the book. */

/* ---------- reading backgrounds: White (default), Paper, Black. Only inside the book (body.reading). ---------- */
/* Old saved choices (ivory, mist, sage, contrast, night, auto) are mapped to these three in app/settings.js. */
body.th-white,.swatch.th-white{--bg:#ffffff;--sf:#ffffff;--sf2:#f0f0f0;--ink:#000000;--mut:#555555;--ln:#000000;--ln2:#d9d9d9;--ac:#000000;--on:#ffffff;--bad:#000000;--ok:#000000}
body.th-paper,.swatch.th-paper{--bg:#f6f1e7;--sf:#fbf8f1;--sf2:#ebe4d6;--ink:#1a1712;--mut:#55503f;--ln:#1a1712;--ln2:#dcd3c1;--ac:#1a1712;--on:#ffffff;--bad:#1a1712;--ok:#1a1712}
body.th-black,.swatch.th-black{--bg:#000000;--sf:#000000;--sf2:#1c1c1c;--ink:#f2f2f2;--mut:#b3b3b3;--ln:#f2f2f2;--ln2:#333333;--ac:#f2f2f2;--on:#000000;--bad:#f2f2f2;--ok:#f2f2f2;--edge:#f2f2f2}
body.sz-s{--fs:15px}body.sz-m{--fs:17px}body.sz-l{--fs:19px}body.sz-xl{--fs:22px}body.sz-xxl{--fs:26px}
body.ln-tight{--lh:1.45}body.ln-normal{--lh:1.65}body.ln-airy{--lh:1.9}
body.wd-narrow{--w:600px}body.wd-normal{--w:720px}body.wd-wide{--w:1000px}
/* reading fonts (and their previews in settings) */
.ft-serif{--f-read:"Newsreader",Georgia,serif}.ft-sans{--f-read:var(--f-ui)}.ft-book{--f-read:"Literata",Georgia,serif}.ft-mono{--f-read:var(--f-mono)}
.sample.ft-sans,.sample.ft-serif,.sample.ft-book,.sample.ft-mono{font-family:var(--f-read)}
.sz-s.sample{font-size:15px}.sz-m.sample{font-size:17px}.sz-l.sample{font-size:19px}.sz-xl.sample{font-size:22px}.sz-xxl.sample{font-size:26px}
