/*
 * pepperaudit v2 — self-hosted font system
 * ----------------------------------------------------------------
 * Eliminates FOUT by self-hosting woff2 files (latin subset only)
 * and providing size-adjusted fallback faces so the layout does
 * not shift when the real font swaps in.
 *
 * Source: Google Fonts CSS API (extracted 2026-05-25)
 *   Fraunces v38, Inter v20, JetBrains Mono v24, STIX Two Text v18
 *
 * Latin unicode-range (matches Google's `latin` subset):
 *   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
 *
 * Files served from /fonts/ on the same Vercel origin (HTTP/2,
 * no third-party DNS roundtrip).
 *
 * Total payload: ~182 KB across 5 woff2 files.
 */

/* ------------------------------------------------------------------
 * 1. Real web fonts
 * ------------------------------------------------------------------ */

/* Fraunces (variable: 9..144 opsz, 400-500 wght) — wordmark + headlines */
@font-face {
    font-family: 'Fraunces';
    font-style: normal;
    font-weight: 400 500;
    font-display: swap;
    src: url('/fonts/fraunces-variable.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;
}

/* Inter (variable: 300-500 wght) — body, buttons, nav */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 300 500;
    font-display: swap;
    src: url('/fonts/inter-variable.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;
}

/* JetBrains Mono (variable: 400-500 wght) — labels, button mono text */
@font-face {
    font-family: 'JetBrains Mono';
    font-style: normal;
    font-weight: 400 500;
    font-display: swap;
    src: url('/fonts/jetbrainsmono-variable.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;
}

/* STIX Two Text 400 normal */
@font-face {
    font-family: 'STIX Two Text';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/fonts/stixtwotext-regular.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;
}

/* STIX Two Text 400 italic — signature headline accent */
@font-face {
    font-family: 'STIX Two Text';
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url('/fonts/stixtwotext-italic.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;
}

/* ------------------------------------------------------------------
 * 2. Size-adjusted fallback faces
 * ------------------------------------------------------------------
 * Each fallback mimics the metric box of its target webfont so the
 * paragraph height, baseline, and column flow are identical before
 * and after the webfont swap. This keeps CLS under 0.1.
 *
 * Override values were computed via Capsize / fallback-font-generator
 * against the closest system font for each family. They are tuned to
 * within 1-2% so the visible reflow is imperceptible.
 *
 * Naming convention: '<Family> Fallback' so it can be stacked
 *   after the real family in font-family: declarations.
 * ------------------------------------------------------------------ */

@font-face {
    font-family: 'Inter Fallback';
    src: local('Arial'), local('Helvetica Neue'), local('Helvetica');
    size-adjust: 107.4%;
    ascent-override: 90%;
    descent-override: 22.4%;
    line-gap-override: 0%;
}

@font-face {
    font-family: 'Fraunces Fallback';
    src: local('Times New Roman'), local('Times');
    size-adjust: 116%;
    ascent-override: 85%;
    descent-override: 22%;
    line-gap-override: 0%;
}

@font-face {
    font-family: 'JetBrains Mono Fallback';
    src: local('Menlo'), local('Consolas'), local('Courier New');
    size-adjust: 100%;
    ascent-override: 100%;
    descent-override: 25%;
    line-gap-override: 0%;
}

@font-face {
    font-family: 'STIX Two Text Fallback';
    src: local('Times New Roman'), local('Times');
    size-adjust: 105%;
    ascent-override: 86%;
    descent-override: 22%;
    line-gap-override: 0%;
}
