/* tw-fonts.css - the TriviaWorks HOUSE FONT FAMILY, self-hosted.
 *
 * Andrew, 2026-07-14: "The Gotham font family is the TriviaWorks house font family.
 * Remove all Google fonts."
 *
 * Load this on any surface that needs type. It declares the faces AND the family
 * tokens, so a page does not need tw-tokens.css as well (most player surfaces did
 * not load it, which is how Google Fonts drifted back in).
 *
 * NO EXTERNAL FETCHES. Everything here is served from /fonts/ by
 * server/routes/sync.js:531. That is what makes offline play, the desktop program
 * and white-label embedding possible - see _handoff/specs/DEPLOYMENT-TARGETS.md.
 *
 * MONO: Gotham has no monospace cut, so JetBrains Mono is the house mono. It IS
 * self-hosted and declared below (Regular + Bold), under the SIL Open Font
 * Licence - JetBrainsMono-OFL.txt sits beside the files.
 *
 * ★ CORRECTED 2026-08-20. This comment previously said "we have no house mono.
 * Mono falls back to the SYSTEM stack" - contradicted 29 lines further down by
 * the @font-face rules that load it. The font was there and disowned by its own
 * file, so surfaces avoided a face they already had. Andrew, same day, asked for
 * "a courier-style house font": we have one.
 */

/* ---- Gotham (UI + display) ---- */
@font-face { font-family: 'Gotham'; src: url('/fonts/Gotham-Thin.woff2')   format('woff2'); font-weight: 100; font-style: normal; font-display: swap; }
@font-face { font-family: 'Gotham'; src: url('/fonts/Gotham-XLight.woff2') format('woff2'); font-weight: 200; font-style: normal; font-display: swap; }
@font-face { font-family: 'Gotham'; src: url('/fonts/Gotham-Light.woff2')  format('woff2'); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: 'Gotham'; src: url('/fonts/Gotham-Book.woff2')   format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Gotham'; src: url('/fonts/Gotham-Medium.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Gotham'; src: url('/fonts/Gotham-Bold.woff2')   format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Gotham'; src: url('/fonts/Gotham-Black.woff2')  format('woff2'); font-weight: 800; font-style: normal; font-display: swap; }
@font-face { font-family: 'Gotham'; src: url('/fonts/Gotham-Ultra.woff2')  format('woff2'); font-weight: 900; font-style: normal; font-display: swap; }

/* ---- Gotham Narrow (game surfaces - the condensed cut) ---- */
@font-face { font-family: 'Gotham Narrow'; src: url('/fonts/GothamNarrow-Book.woff2')   format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Gotham Narrow'; src: url('/fonts/GothamNarrow-Medium.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Gotham Narrow'; src: url('/fonts/GothamNarrow-Bold.woff2')   format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Gotham Narrow'; src: url('/fonts/GothamNarrow-Black.woff2')  format('woff2'); font-weight: 900; font-style: normal; font-display: swap; }
/* ★★ REAL ITALICS, NOT A SKEW (Andrew, 2026-08-28: "We have Gotham Narrow
 * Italic"). Until now every declared face was font-style:normal and no italic
 * file existed anywhere in the repo, so every `font-style="italic"` the slide
 * renderer emitted produced a BROWSER-SYNTHESISED OBLIQUE: the upright glyphs
 * skewed by an angle each engine picks for itself. Two consequences, both
 * measured on 2026-08-28 - the lean differed between engines, so the same
 * slide could lean differently in the Editor, the Venue Display and the
 * Presenter, against the rule that a laid-out question renders identically
 * everywhere; and a skew moves glyphs without touching their side bearings or
 * kern pairs, so an italic word kept upright spacing and collided with its
 * neighbours. Real faces fix both at the source: correct drawn italic forms,
 * correct metrics, correct kerning WITHIN the run.
 * ⚠ Kerning ACROSS a tspan boundary is a separate defect and is NOT fixed by
 *   these files - tw-element-text.js emits one <tspan> per emphasis segment
 *   and browsers do not kern across them. */
@font-face { font-family: 'Gotham Narrow'; src: url('/fonts/GothamNarrow-BookItalic.woff2')   format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Gotham Narrow'; src: url('/fonts/GothamNarrow-MediumItalic.woff2') format('woff2'); font-weight: 500; font-style: italic; font-display: swap; }
@font-face { font-family: 'Gotham Narrow'; src: url('/fonts/GothamNarrow-BoldItalic.woff2')   format('woff2'); font-weight: 700; font-style: italic; font-display: swap; }
@font-face { font-family: 'Gotham Narrow'; src: url('/fonts/GothamNarrow-BlackItalic.woff2')  format('woff2'); font-weight: 900; font-style: italic; font-display: swap; }

/* ---- JetBrains Mono (the house MONO) ----
 * SIL OFL 1.1 - licence at /fonts/JetBrainsMono-OFL.txt, which MUST travel with the
 * font into the desktop program and any white-label embed.
 * Regular + Bold only; we have no italic mono usage.
 *
 * Chosen for DISAMBIGUATION, not taste: slashed zero, tailed l, serifed I, 1 with a
 * full base. This is load-bearing - players TYPE ROOM CODES THEY WERE READ ALOUD from
 * a TV, so 0/O and 1/l/I confusion is a support call, not a style nit.
 */
@font-face { font-family: 'JetBrains Mono'; src: url('/fonts/JetBrainsMono-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('/fonts/JetBrainsMono-Bold.woff2')    format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }

/* ---- Family tokens ---- */
:root {
  /* ★ MONTSERRAT WAS MISSING FROM THE STACK THAT ACTUALLY WINS (2026-09-07).
     The ruling is Gotham, falling back to Montserrat, then system - and
     metro/tw-metro-tokens.css --m-sans says exactly that. This token did not,
     and it feeds tw-tokens.css --type-family-sans, whose own written-out
     'Gotham','Montserrat',... list is only the var() FALLBACK and therefore
     never fires while this token exists. So on any surface reading
     --type-family-sans, a machine without Gotham dropped straight to Segoe UI
     and the site and the PDF renderer stopped agreeing about the house face.
     One stack, spelled the same way in both homes. */
  --tw-font:      'Gotham', 'Gotham Narrow', 'Montserrat', 'Segoe UI', system-ui, sans-serif;
  --tw-game-font: 'Gotham Narrow', 'Gotham', 'Arial Narrow', sans-serif;
  --tw-mono:     'JetBrains Mono',  ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
