/* Self-hosted fonts (all SIL Open Font License 1.1). Latin subset, woff2.
   Fraunces: variable, optical-size axis kept, weight pinned to 500, SOFT pinned to 50.
   Source Sans 3: variable, weight 400-600. IBM Plex Mono: 400 only.
   To swap a font: replace its file in /fonts, update the @font-face and the matching
   --font-* variable in tokens.css, and recompute the fallback metrics below.
   Recipe and rationale: design-system/MASTER.md section 3. */

@font-face {
  font-family: "Fraunces";
  src: url("/fonts/fraunces.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("/fonts/source-sans-3.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}
/* Four IPA glyphs (ə ʃ ˈ ː) for the pronunciation line; the main subset has no IPA */
@font-face {
  font-family: "Source Sans 3";
  src: url("/fonts/source-sans-3-ipa.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0259, U+0283, U+02C8, U+02D0;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/ibm-plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* Metric-matched fallbacks: keep line boxes and text width close while web fonts load (no layout shift) */
@font-face {
  font-family: "Fraunces Fallback";
  src: local("Georgia");
  size-adjust: 110%;
  ascent-override: 88.9%;
  descent-override: 23.2%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Source Sans 3 Fallback";
  src: local("Arial");
  size-adjust: 96.5%;
  ascent-override: 106.1%;
  descent-override: 41.5%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "IBM Plex Mono Fallback";
  src: local("Courier New");
  size-adjust: 100%;
  ascent-override: 102.5%;
  descent-override: 27.5%;
  line-gap-override: 0%;
}
