/* ==========================================================================
   Fraunces — body serif (pair B)
   Variable WOFF2 (opsz + wght axes via this subset; the full file also
   ships custom SOFT and WONK axes for terminals and quirky alternates,
   reachable via font-variation-settings: "SOFT" 50, "WONK" 1 if swapped in).
   Latin only — no latin-ext subset downloaded.

   OpenType feature audit (fontkit, against fraunces-latin-opsz-normal.woff2):
     GSUB:  liga rvrn
     GPOS:  kern
   The Fraunces subset is MUCH leaner than the Literata one — most CSS-level
   feature references (calt onum pnum lnum tnum smcp c2sc dlig frac ordn
   sups subs ss01 swsh salt) are no-ops on this pair, and the small-caps /
   sup / sub demos rely entirely on browser synthesis. The SOFT and WONK
   custom axes the .wonky-demo span demonstrates DO survive in this subset
   (visible at runtime), so the alt-pair still pulls its weight as a
   variable-font demo even though it's thin on OT features. Re-subset from
   the full Fraunces source with pyftsubset --layout-features='*' if you
   want the OT-feature parity.
   ========================================================================== */

/* Metric overrides pinned to Fraunces's own hhea (ascent 1956, descent 510,
   line-gap 0, UPM 2000 → ratios below). Same rationale as Literata: without
   these, Safari can use the OS/2 Win metrics, which on Fraunces are taller
   than 1.6em and force the line-box past the baseline grid. */
@font-face {
    font-family: Fraunces;
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('fonts/fraunces-latin-opsz-normal.woff2') format('woff2-variations');
    unicode-range:
        U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F,
        U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
    ascent-override: 97.8%;
    descent-override: 25.5%;
    line-gap-override: 0%;
}

@font-face {
    font-family: Fraunces;
    font-style: italic;
    font-weight: 100 900;

    /* `fallback` rather than `swap` — same rationale as Literata italic.
     Italic body content is common above-the-fold (subtitle, <em>, <cite>),
     and a short block period + permanent fallback renders calmer than a
     mid-read font swap when the italic woff2 arrives late. */
    font-display: fallback;
    src: url('fonts/fraunces-latin-opsz-italic.woff2') format('woff2-variations');
    unicode-range:
        U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F,
        U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
    ascent-override: 97.8%;
    descent-override: 25.5%;
    line-gap-override: 0%;
}

/* Metric-matched Georgia fallback — measured by fontaine from Fraunces's
   own hhea table (ascent 1956, descent -510, UPM 2000) against Georgia's
   bundled system metrics. Note the much larger size-adjust (116%) compared
   to Literata (108%): Fraunces's per-character advance is wider, so Georgia
   needs more scaling to match. Regenerate with `npm run metrics`. */
@font-face {
    font-family: 'Fraunces Fallback';
    src: local('Georgia');
    size-adjust: 116.1954%;
    ascent-override: 84.1686%;
    descent-override: 21.9458%;
    line-gap-override: 0%;
}

:root {
    --font-body: 'Fraunces', 'Fraunces Fallback', 'Times New Roman', serif;

    /* Cap-to-baseline ratios for Fraunces, measured under text-box-trim.
     Same shape as Literata — the opsz axis pushes the display cap a bit
     taller than the text cap. The h3 reading lands dead-on at 0.700.
     Display value mirrors Literata's 0.726 as a starting point; re-measure
     against a single-line wrapping-free h2 if the values diverge. */
    --cap-height: 0.7; /* legacy single-token fallback */
    --cap-height-text: 0.7;
    --cap-height-display: 0.726;
}

.simulate-fout {
    --font-body: 'Fraunces Fallback', 'Times New Roman', serif;
}

/* SOFT + WONK demo — Fraunces-only custom axes. Lives in this sheet so the
   variation settings only apply when Pair B is active; if the page is on
   Literata the rule still parses but the axes don't exist there and the
   span renders identically to surrounding prose. SOFT 100 softens the
   terminals to their maximum; WONK 1 swaps in the quirky alternate set. */
.wonky-demo {
    font-variation-settings:
        'SOFT' 100,
        'WONK' 1;
    font-weight: 500;
}
