/* ==========================================================================
   Inter — body sans (pair C)
   Variable WOFF2 (opsz + wght axes), latin only. Sourced from the upstream
   rsms/inter v4.1 release (the full-featured TTF) and resubset locally with
   pyftsubset --layout-features='*' so the OT tables survive — Google Fonts'
   own CSS endpoint strips most of them.
   Pairs with JetBrains Mono (already loaded for Pair A) — no extra mono
   request for this pair.

   OpenType feature audit (fontkit, against inter-latin-wght-opsz-normal.woff2):
     aalt calt case ccmp cpsp cv01-cv13 dlig dnom frac kern mark mkmk numr
     ordn pnum salt sinf ss01-ss08 subs sups tnum zero
   What Inter brings that the serif pairs can't:
     - case  : punctuation auto-raises when surrounded by caps
     - zero  : slashed zero (no other pair in this project has it)
     - ss01-ss08 : eight stylistic sets — open digits, disambiguation,
                   curved r, single-storey alternates, square punctuation, …
     - cv01-cv13 : finer-grained one-glyph swaps, addressable via
                   font-feature-settings: "cv01" 1
   What's MISSING (vs. the project's CSS surface):
     - smcp / c2sc : Inter doesn't ship small caps; browsers synthesize.
     - onum / lnum : figures are lining by default, no oldstyle option.
     - liga / clig : Inter uses calt for the same ligature behavior;
                     font-variant-ligatures: common-ligatures still resolves
                     against calt where appropriate.
   ========================================================================== */

/* Real-face metric overrides pinned to Inter's own hhea (ascent 1984,
   descent 494, line-gap 0, UPM 2048). Same defensive shape as Literata
   and Fraunces: prevents Safari's OS/2 Win metrics from inflating the
   line-box past --baseline. */
@font-face {
    font-family: Inter;
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('fonts/inter-latin-wght-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: 96.88%;
    descent-override: 24.12%;
    line-gap-override: 0%;
}

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

    /* `fallback` rather than `swap` — same rationale as Literata/Fraunces
     italic. Above-the-fold italic content (subtitle, <em>, <cite>) reads
     better in the metric-matched fallback for the whole pageload than as
     a mid-read swap. */
    font-display: fallback;
    src: url('fonts/inter-latin-wght-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: 96.88%;
    descent-override: 24.12%;
    line-gap-override: 0%;
}

/* Metric-matched system fallback. Inter's geometric humanist sans is
   close in proportion to Helvetica Neue / Arial / Segoe UI — use those
   in order, with measured size-adjust against Helvetica Neue's metrics.
   The xWidthAvg of Inter is wider than Helvetica's, so size-adjust pulls
   the fallback slightly wider to match advance width during FOUT. */
@font-face {
    font-family: 'Inter Fallback';
    src: local('Helvetica Neue'), local('Arial'), local('Segoe UI');
    size-adjust: 107%;
    ascent-override: 90.5%;
    descent-override: 22.6%;
    line-gap-override: 0%;
}

:root {
    --font-body: 'Inter', 'Inter Fallback', -apple-system, blinkmacsystemfont, 'Segoe UI', system-ui, sans-serif;

    /* Cap-to-baseline ratios for Inter under text-box-trim.
     Same size-tier split as the serif pairs — opsz auto selects a
     slightly taller-cap optical variant at display sizes. Inter's
     cap-height is notably taller relative to body than the serif pairs
     (geometric humanist sans, tall x-height), so the ratios are higher. */
    --cap-height: 0.73; /* legacy single-token fallback */
    --cap-height-text: 0.728; /* measured under text-box-trim at h3 size */
    --cap-height-display: 0.754; /* measured under text-box-trim at h2 size */
}

/* FOUT simulation. Drops Inter out of the stack so the metric-matched
   sans fallback renders during the simulated swap window. */
.simulate-fout {
    --font-body: 'Inter Fallback', -apple-system, blinkmacsystemfont, 'Segoe UI', system-ui, sans-serif;
}
