/* ─────────────────────────────────────────────────────────────────────────
   Geist — SELF-HOSTED. Intended as the single source of truth for BOTH
   renderers.
   STATUS 2026-07-13: the SSR marketing pages (all 12, via _base.html) link
   this file. The React SPA (portal + chat) still links the Google Fonts CDN
   and still names a font it never loads ("Inter") in tailwind.config.js —
   migrating it is the pending "generalize" step. Until then the two renderers
   are NOT yet unified; do not assume they are.

   Was: two different <link>s to fonts.googleapis.com — the SSR asked for six
   static weights, the SPA asked for the variable axis. That meant a
   render-blocking third-party request in front of the LCP element (the hero
   <h1>), a double download for anyone who visited both, and a third-party
   call that sat badly with a cookieless product.

   Now: one variable woff2 per subset, all weights 100-900, served from our
   own origin and preloaded. Latin + latin-ext only (latin covers French
   accents AND the Œ/œ ligature at U+0152-0153).

   The font files are the EXACT ones Google serves — same bytes, same
   subsetting — just hosted by us.
   ───────────────────────────────────────────────────────────────────────── */

/* Geist Sans — variable, 100..900 in one file per subset */
@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/geist-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: 'Geist';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/geist-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;
}

/* Geist Mono — code blocks */
@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/geist-mono-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: 'Geist Mono';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/geist-mono-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 — this is the CLS fix ────────────────────────
   `font-display: swap` means the browser paints the fallback first, then
   swaps Geist in. If the fallback occupies a DIFFERENT box, the text reflows
   on swap and that reflow IS your Cumulative Layout Shift. On 2026-07-13 the
   French homepage measured CLS 0.1133 — a Core Web Vitals FAILURE (>0.10),
   because the longer French headline had more to reflow.

   So we wrap the system fallback in an @font-face whose metrics are adjusted
   to match Geist's. Values MEASURED in Chromium against the real font (not
   taken from a metrics table — the naive OS/2 numbers were wrong by 15%):
     Geist renders at 93.89% of Arial's width for the same string
     Geist ascent 100.5%, descent 29.5%, lineGap 0% (unitsPerEm 1000)
   Overrides are the target metric divided by size-adjust.

   Result: the fallback and Geist occupy the same box, so the swap is
   invisible and CLS stays ~0. Arial is used because Liberation Sans (Linux)
   and Helvetica (mac) are metric-compatible with it.
   ───────────────────────────────────────────────────────────────────────── */
@font-face {
  font-family: 'Geist Fallback';
  src: local('Arial'), local('Helvetica'), local('Liberation Sans');
  size-adjust: 93.89%;
  ascent-override: 107.03%;
  descent-override: 31.42%;
  line-gap-override: 0%;
}

/* The ONE font stack. Anything that needs Geist should use var(--font-sans)
   rather than re-declaring the family — that is how the two renderers drifted
   apart in the first place (tailwind.config.js still names a font, Inter, that
   is not loaded anywhere). */
:root {
  /* --font-display  →  h1 / h2 ONLY. The voice.
     --font-sans     →  everything else. The workhorse.
     Keep that split. If --font-display starts showing up on buttons and nav,
     the personality stops being a signal and becomes noise. */
  /* Currently: NO separate display face. The hero's problem was never the
     typeface — it was font-weight 800. We tested 28 faces (Bricolage, Fraunces,
     Syne, serifs, the lot); every grotesque read as identical to Geist, and the
     serifs read as hand-written. Geist at the right weight was the answer all
     along. Left as a token so a display face can be dropped in later without
     touching a single template. */
  --font-display: var(--font-sans);
  --font-sans: 'Geist', 'Geist Fallback', system-ui, -apple-system,
               BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, 'SF Mono', 'Cascadia Mono',
               Menlo, Consolas, monospace;
}
