/* Self-hosted webfonts + metric-matched local fallbacks.
 *
 * Why this file exists (and why it is standalone, not part of input.css):
 * base.html and translate/join.html both need these @font-face rules, but
 * join.html deliberately does NOT extend base.html and neither template's
 * inline <style> is shared. A standalone stylesheet is the one thing both
 * heads can <link> without inheriting each other.
 *
 * Why the fallback faces below carry size-adjust / *-override:
 * they make the local fallback (Arial/Helvetica) paint at the SAME advance
 * widths and line-box height as the real webfont, so when `font-display: swap`
 * swaps the webfont in there is zero layout shift. That is what makes `swap`
 * safe here — it replaces the old `display=optional` hack that suppressed the
 * nav tab-row FOUT width shift by never swapping at all.
 *
 * Every numeric override value is copied verbatim from
 * frontend_new/static/fonts/font-metrics.json (families.*.overrides.RECOMMENDED).
 * Do not round, re-derive, or hand-edit these numbers — regenerate the JSON.
 */

/* ============================================================
 * REAL FACES — self-hosted woff2, font-display: swap.
 * unicode-range keeps latin-ext from being fetched unless a
 * page actually renders those glyphs.
 * ============================================================ */

/* --- Public Sans (body) — variable, normal, 300..800 --- */
@font-face {
    font-family: 'Public Sans';
    font-style: normal;
    font-weight: 300 800;
    font-display: swap;
    src: url('/static/fonts/public-sans-normal-wght-latin.woff2') format('woff2');
    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;
}
@font-face {
    font-family: 'Public Sans';
    font-style: normal;
    font-weight: 300 800;
    font-display: swap;
    src: url('/static/fonts/public-sans-normal-wght-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* --- Public Sans (body) — variable, italic, 300..800 --- */
@font-face {
    font-family: 'Public Sans';
    font-style: italic;
    font-weight: 300 800;
    font-display: swap;
    src: url('/static/fonts/public-sans-italic-wght-latin.woff2') format('woff2');
    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;
}
@font-face {
    font-family: 'Public Sans';
    font-style: italic;
    font-weight: 300 800;
    font-display: swap;
    src: url('/static/fonts/public-sans-italic-wght-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* --- Anton (screen titles) — 400 --- */
@font-face {
    font-family: 'Anton';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/static/fonts/anton-400-latin.woff2') format('woff2');
    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;
}
@font-face {
    font-family: 'Anton';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/static/fonts/anton-400-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* --- JetBrains Mono (eyebrows) — ONE variable woff2 for 400/500/600 --- */
@font-face {
    font-family: 'JetBrains Mono';
    font-style: normal;
    font-weight: 400 600;
    font-display: swap;
    src: url('/static/fonts/jetbrains-mono-wght-latin.woff2') format('woff2');
    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;
}
@font-face {
    font-family: 'JetBrains Mono';
    font-style: normal;
    font-weight: 400 600;
    font-display: swap;
    src: url('/static/fonts/jetbrains-mono-wght-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ============================================================
 * METRIC-MATCHED FALLBACK FACES — no download, layout-neutral.
 * These sit over the local system face and are pre-sized so the
 * swap to the real webfont shifts nothing.
 *
 * Values from font-metrics.json families.*.overrides.RECOMMENDED.
 * ============================================================ */

/* Public Sans over Arial (Liberation Sans is Arial's metric-compatible proxy;
 * measured advance widths and vertical metrics are identical). Liberation Sans
 * is listed explicitly because it is the font font-metrics.json actually
 * measured (Arial/Helvetica are absent on typical Linux/Android, where Liberation
 * Sans is the common install), so the override numbers below are grounded over it
 * directly — DejaVu Sans / Roboto are deliberately omitted: their advance widths
 * differ, so these numbers would not hold over them. */
@font-face {
    font-family: 'Public Sans Fallback';
    src: local('Arial'), local('Helvetica'), local('Liberation Sans');
    size-adjust: 105.2082%;
    ascent-override: 90.2971%;
    descent-override: 21.3862%;
    line-gap-override: 0.0%;
}

/* Anton over Arial (same Liberation Sans grounding as Public Sans above). */
@font-face {
    font-family: 'Anton Fallback';
    src: local('Arial'), local('Helvetica'), local('Liberation Sans');
    size-adjust: 92.1117%;
    ascent-override: 127.7004%;
    descent-override: 35.7285%;
    line-gap-override: 0.0%;
}
