/* ============================================================
   chateloin.com — self-hosted webfonts
   Loaded before tokens.css. Replaces the Google Fonts CDN
   (issue #1). No third-party request is made for type.

   Both files are Google's latin subset in variable-weight form:
     ibm-plex-sans-latin-var.woff2    wght 100–700   45.7 KB
     jetbrains-mono-latin-var.woff2   wght 400–800   31.4 KB
   One file per family covers every weight the site uses
   (Plex 400/600, JetBrains 400/500), so this is two requests
   where the CDN needed a stylesheet plus four font files.

   The "… Fallback" families are metric-adjusted stand-ins used
   during the font-display: swap window so text does not reflow
   when the real face arrives. Every override below was computed
   from the actual font tables with fontTools, not estimated:

     face             size-adjust  ascent   descent  line-gap
     Plex → Arial        99.13%    103.40%   27.74%    0%
     JetBrains → Courier 99.98%    102.02%   30.00%    0%

   Both webfonts set the USE_TYPO_METRICS flag, so ascent and
   descent come from the OS/2 sTypo values (1025/-275 and
   1020/-300 per 1000 upem), matching what browsers use.

   Glyph note: ↗ (U+2197), ▪ (U+25AA) and ▾ (U+25BE) are absent
   from the latin subset and fall through to a system font. That
   was already true on the CDN, whose latin and latin-ext subsets
   also lack them, so this is not a change in behaviour.
   ============================================================ */

/* --- real faces --- */

@font-face {
  font-family: "IBM Plex Sans";
  src: url("../assets/fonts/ibm-plex-sans-latin-var.woff2") format("woff2");
  font-weight: 100 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("../assets/fonts/jetbrains-mono-latin-var.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

/* --- metric-adjusted fallbacks (swap window only) --- */

@font-face {
  font-family: "IBM Plex Sans Fallback";
  src: local("Arial"), local("Helvetica Neue"), local("Liberation Sans");
  size-adjust: 99.13%;
  ascent-override: 103.40%;
  descent-override: 27.74%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "JetBrains Mono Fallback";
  src: local("Courier New"), local("Liberation Mono"), local("DejaVu Sans Mono");
  size-adjust: 99.98%;
  ascent-override: 102.02%;
  descent-override: 30.00%;
  line-gap-override: 0%;
}
