/* ── fonts.css — self-hosted, offline, Ukrainian-complete. NO CDN. ───────────
   Every bundled file is glyph-checked for ґ Ґ є Є і І ї Ї before shipping
   (Opus-verified). No Google/CDN @import — the portal is offline-first + CSP-safe.

   DEFAULT = Tempora LGC Unicode (Alexej Kryukov, GPL v2) — a Latin-Greek-Cyrillic
   serif built for Cyrillic; the owner's pick, replacing Literata (2026-07-08).
   Subset to Latin + Cyrillic (Greek dropped), 4 static weights, ~192KB total.
   The weights below say 400 and 700 because that is what the two files ARE. They
   used to claim `100 550` and `551 900` — bands invented to steer the portal's
   500/600 requests onto Regular/Bold, which is exactly where CSS's own weight
   matching sends them anyway. The invented bands changed nothing except to make
   650 mean full bold on this face and a true semibold on every variable one.
   ──────────────────────────────────────────────────────────────────────────── */

/* Tempora — the default serif (Latin + full-Ukrainian Cyrillic) */
@font-face{font-family:'Tempora';font-style:normal;font-weight:400;font-display:swap;src:url('fonts/Tempora-Regular.woff2') format('woff2');}
@font-face{font-family:'Tempora';font-style:normal;font-weight:700;font-display:swap;src:url('fonts/Tempora-Bold.woff2') format('woff2');}
@font-face{font-family:'Tempora';font-style:italic;font-weight:400;font-display:swap;src:url('fonts/Tempora-Italic.woff2') format('woff2');}
@font-face{font-family:'Tempora';font-style:italic;font-weight:700;font-display:swap;src:url('fonts/Tempora-BoldItalic.woff2') format('woff2');}

/* ── Alternate switcher roster («Оформлення» ▸ Font) — self-hosted, offline, OFL ──
   The 7 opt-in alternate faces the Look-panel Font picker offers beside the default
   Tempora. Formerly lazy-loaded from the Google-Fonts CDN (broke offline + violated
   the no-CDN rule); now bundled here the same way. Each was subset to Latin + full
   Ukrainian Cyrillic (ґ Ґ є Є і І ї Ї + the U+2019 apostrophe/U+0301 stress accent)
   from the canonical google/fonts sources via build_alt_fonts.py, which lives in
   this tree at generators/fonts/build_alt_fonts.py since 2026-09-06 — it was
   Riverlight's, and Riverlight stopped moving, so the only builder for a shelf
   this app owns came over whole. Rebuild a face there and copy the .woff2 over,
   copying ONLY what you meant to change: a fresh run is not byte-identical to
   what ships, so a blanket copy silently replaces every proven face. The five
   variable faces span weights 400–700 in a single file (opsz/wdth axes pinned to the
   text design value); PT Serif, PT Sans + Andika ship as static Regular/Bold. Upright only —
   the roster never uses italic (the browser obliques where a page asks for it, exactly
   as the CDN behaved). All OFL 1.1 except Roboto Slab, which is Apache 2.0 —
   both permit subsetting + self-hosting, and google/fonts files a family under its
   licence, which is why the build script's key for it reads apache/ and not ofl/. */
/* PT Serif — pan-Cyrillic transitional serif (ParaType, OFL) */
@font-face{font-family:'PT Serif';font-style:normal;font-weight:400;font-display:swap;src:url('fonts/PTSerif-Regular.woff2') format('woff2');}
@font-face{font-family:'PT Serif';font-style:normal;font-weight:700;font-display:swap;src:url('fonts/PTSerif-Bold.woff2') format('woff2');}
/* Lora — editorial brushed-curve serif (Cyreal, OFL) */
@font-face{font-family:'Lora';font-style:normal;font-weight:400 700;font-display:swap;src:url('fonts/Lora-VF.woff2') format('woff2');}
/* Merriweather — screen-tuned serif (Sorkin Type, OFL); GPOS kerning dropped (see build script) */
@font-face{font-family:'Merriweather';font-style:normal;font-weight:400 700;font-display:swap;src:url('fonts/Merriweather-VF.woff2') format('woff2');}
/* Montserrat — geometric sans (Julieta Ulanovsky, OFL) */
@font-face{font-family:'Montserrat';font-style:normal;font-weight:400 700;font-display:swap;src:url('fonts/Montserrat-VF.woff2') format('woff2');}
/* Inter — neutral grotesque UI sans (Rasmus Andersson, OFL) */
@font-face{font-family:'Inter';font-style:normal;font-weight:400 700;font-display:swap;src:url('fonts/Inter-VF.woff2') format('woff2');}
/* Andika — SIL's hyperlegible literacy sans (OFL) */
@font-face{font-family:'Andika';font-style:normal;font-weight:400;font-display:swap;src:url('fonts/Andika-Regular.woff2') format('woff2');}
@font-face{font-family:'Andika';font-style:normal;font-weight:700;font-display:swap;src:url('fonts/Andika-Bold.woff2') format('woff2');}
/* PT Sans — pan-Cyrillic humanist sans (ParaType, OFL); PT Serif's partner, and
   drawn for Cyrillic rather than extended into it. Bundled 2026-08-19 — before that
   the roster's sans stacks NAMED it as a fallback and never shipped it, so it only
   ever appeared for readers who happened to own it. */
@font-face{font-family:'PT Sans';font-style:normal;font-weight:400;font-display:swap;src:url('fonts/PTSans-Regular.woff2') format('woff2');}
@font-face{font-family:'PT Sans';font-style:normal;font-weight:700;font-display:swap;src:url('fonts/PTSans-Bold.woff2') format('woff2');}
/* ── THREE MORE CYRILLIC-DRAWN SANS (2026-09-06, owner ask) ──────────────────
   The sans half of the shelf was PT Sans · Montserrat · Inter · Rubik, and only
   the first was DRAWN for Cyrillic rather than extended into it — which shows in
   exactly the letters a learner is forming: the и/й breve, щ's descender, the
   width of ж. These three are Cyrillic-first or Cyrillic-native, and each is a
   different silhouette, so the shelf gains three choices rather than three of
   one. All OFL 1.1, all subset and accent-repaired by the same pipeline.
   A FOURTH WAS REFUSED. Manrope was the third face asked for and the build gate
   turned it down: it carries no U+0301 at all, so «держа́ва» would print with no
   stress mark. Onest stands in its place. The refusal is recorded in
   generators/fonts/build_alt_fonts.py beside Atkinson Hyperlegible's. */
/* Fira Sans — humanist sans, Cyrillic by Carrois with native review (OFL) */
@font-face{font-family:'Fira Sans';font-style:normal;font-weight:400;font-display:swap;src:url('fonts/FiraSans-Regular.woff2') format('woff2');}
@font-face{font-family:'Fira Sans';font-style:normal;font-weight:700;font-display:swap;src:url('fonts/FiraSans-Bold.woff2') format('woff2');}
/* Golos Text — ParaType's contemporary UI neutral, Cyrillic-FIRST (OFL); the same
   house as the PT pair above, drawn a generation later for screens */
@font-face{font-family:'Golos Text';font-style:normal;font-weight:400 700;font-display:swap;src:url('fonts/GolosText-VF.woff2') format('woff2');}
/* Onest — geometric semi-grotesque, Cyrillic-first (OFL); 90KB, the smallest face
   on the shelf, which is its own argument on a metered phone plan */
@font-face{font-family:'Onest';font-style:normal;font-weight:400 700;font-display:swap;src:url('fonts/Onest-VF.woff2') format('woff2');}
/* Literata — book serif for long screen reading (TypeTogether, OFL). The portal's
   DEFAULT until 2026-07-08, when Tempora replaced it; back as an alternate so the
   choice is the reader's. opsz pinned to the 18pt text master. */
@font-face{font-family:'Literata';font-style:normal;font-weight:400 700;font-display:swap;src:url('fonts/Literata-VF.woff2') format('woff2');}
/* Roboto Slab — slab serif (Christian Robertson, Apache 2.0). The one texture the
   shelf had none of: square stems that hold their shape at small sizes and on the
   cheap screens a lot of this app is read on. */
@font-face{font-family:'Roboto Slab';font-style:normal;font-weight:400 700;font-display:swap;src:url('fonts/RobotoSlab-VF.woff2') format('woff2');}
/* Rubik — rounded-corner sans (Hubert & Fischer, OFL) */
@font-face{font-family:'Rubik';font-style:normal;font-weight:400 700;font-display:swap;src:url('fonts/Rubik-VF.woff2') format('woff2');}

/* ── METRIC-MATCHED FALLBACKS — the swap must repaint, not reflow ─────────────
   Tempora loads with font-display:swap, so the first paint of every page is a
   system serif and the second is Tempora. Measured in the browser against a
   Ukrainian sample, the fallbacks this stack names are 8–10% WIDER than Tempora
   (Iowan Old Style 4937 vs 4526 at 100px, Palatino 4994, Georgia 4991, Charter
   4718). So the swap did not just recolour the page — it re-wrapped it, and on a
   drill page the card, its options and the rail all moved under the reader's eye.
   Each fallback below is the SAME system face, declared with size-adjust that
   divides that width difference out and with Tempora's own vertical metrics
   (hhea 915/-218/26 on a 1000 upem). They cost no bytes: every src is local().
   One family per face rather than one family with four srcs, because same-name
   @font-face rules with matching descriptors REPLACE each other instead of
   chaining — the browser must fall through the font-family list to try the next.
   Each local() lists the POSTSCRIPT and full names before the family name: a
   family name is what the font-family property matches, but local() matches only
   the other two, so `local('Iowan Old Style')` and `local('Charter')` silently
   resolved to nothing and the alias fell through to plain serif — a fallback that
   was measured, declared, and never once used.
   Numbers are per face and were measured, not assumed; re-measure if the default
   face is ever replaced. ─────────────────────────────────────────────────────── */
@font-face{font-family:'Tempora fb Iowan';src:local('IowanOldStyle-Roman'),local('Iowan Old Style Roman'),local('Iowan Old Style');size-adjust:91.7%;ascent-override:91.5%;descent-override:21.8%;line-gap-override:2.6%;}
@font-face{font-family:'Tempora fb Palatino';src:local('Palatino'),local('Palatino Linotype');size-adjust:90.6%;ascent-override:91.5%;descent-override:21.8%;line-gap-override:2.6%;}
@font-face{font-family:'Tempora fb Georgia';src:local('Georgia');size-adjust:90.7%;ascent-override:91.5%;descent-override:21.8%;line-gap-override:2.6%;}
@font-face{font-family:'Tempora fb Charter';src:local('Charter-Roman'),local('Charter Roman'),local('Charter'),local('Bitstream Charter');size-adjust:95.9%;ascent-override:91.5%;descent-override:21.8%;line-gap-override:2.6%;}

/* ── The portal-wide default type. This file is @imported by every skin, so
   these tokens are the default everywhere. Fallbacks are Ukrainian-verified
   system serifs (Iowan Old Style / Palatino / Charter / Georgia), each reached
   through its metric-matched alias above; the bare names stay at the tail so a
   machine that has the face but blocks local() still gets a serif. */
:root{
  /* THE ONE PLACE the default stack is written. It used to be written in five:
     here, ivory.css (whose :root re-declared all three of these AFTER @importing
     this file, so its copy is the one that won on every skin that imports it),
     ivory's --iv-mono, and blackout.css twice. The metric-matched fallbacks added
     on 2026-08-30 went in here only — so on a real drill page they were declared,
     correct, and never once reached. Everything else now reads var(--iv-serif) or
     var(--iv-text) from here, and verify_type_system.py's STACK limb fails any
     sheet but this one that spells a Tempora-led stack out again.
     Spelled out rather than routed through a shared token on purpose: a var() in
     this file makes it read another sheet's tokens, which is exactly the test
     verify_skin_paper.py uses to decide a stylesheet is a page CARRIER and owes
     the page its paper. This sheet supplies FACES. It owes no paper. */
  --iv-display: 'Tempora','Tempora fb Iowan','Tempora fb Palatino','Tempora fb Georgia','Iowan Old Style',Palatino,Georgia,serif;
  --iv-serif:   'Tempora','Tempora fb Iowan','Tempora fb Palatino','Tempora fb Georgia','Iowan Old Style',Palatino,Georgia,serif;
  --iv-text:    'Tempora','Tempora fb Iowan','Tempora fb Charter','Tempora fb Georgia','Iowan Old Style',Charter,Georgia,serif;
}
