/*
 * Aisle fonts (SPEC 4b): self-hosted, SIL OFL, variable woff2, Latin subset, font-display: swap.
 * Owned by WP-07a. URLs are relative to this file, so it works from the source tree
 * (docs/style-guide.html) and from dist/assets/fonts/ (Trunk copies assets/ as-is).
 *
 * In crates/web/index.html, load it with a plain link plus the two preloads (see README.md):
 *   <link rel="preload" href="assets/fonts/fraunces-var-latin.woff2" as="font" type="font/woff2" crossorigin>
 *   <link rel="preload" href="assets/fonts/inter-var-latin.woff2" as="font" type="font/woff2" crossorigin>
 *   <link rel="stylesheet" href="assets/fonts/fonts.css">
 *
 * The font stacks are in style/tokens.css: --font-display, --font-serif and --font-sans.
 */

/* Fraunces, pinned SOFT 50 and WONK 0; variable wght 400-600 and opsz 18-96. */
@font-face {
  font-family: "Fraunces";
  src: url("fraunces-var-latin.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

/* Inter 4.1, opsz pinned at 14 (text); variable wght 400-600. */
@font-face {
  font-family: "Inter";
  src: url("inter-var-latin.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

/*
 * Metric-matched fallbacks shown until the web fonts swap in, so text keeps its width and lines
 * don't reflow. size-adjust is fitted on Aisle's UI copy with linear metrics (base.css sets
 * text-rendering: geometricPrecision; CoreText is linear anyway) against Liberation Serif and
 * Liberation Sans, which are metric-compatible with Times New Roman and Arial. ascent-override and
 * descent-override give the web font's own vertical metrics after size-adjust (Fraunces 0.978 and
 * 0.255 em, Inter 0.969 and 0.241 em). Inter has two faces because Inter 500-600 runs about 1% wider
 * than Inter 400, and font-synthesis is off, so every weight falls back to the regular local face.
 * README.md has the corpus, the fit and the measured layout shift.
 */
@font-face {
  font-family: "Fraunces Display Fallback";
  src: local("Times New Roman"), local("TimesNewRomanPSMT"), local("Liberation Serif"), local("Tinos");
  size-adjust: 99.5%;
  ascent-override: 98.29%;
  descent-override: 25.63%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Fraunces Fallback";
  src: local("Times New Roman"), local("TimesNewRomanPSMT"), local("Liberation Serif"), local("Tinos");
  size-adjust: 117.25%;
  ascent-override: 83.41%;
  descent-override: 21.75%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Inter Fallback";
  src: local("Arial"), local("ArialMT"), local("Liberation Sans"), local("Arimo");
  font-weight: 100 450;
  size-adjust: 107.5%;
  ascent-override: 90.12%;
  descent-override: 22.44%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Inter Fallback";
  src: local("Arial"), local("ArialMT"), local("Liberation Sans"), local("Arimo");
  font-weight: 451 900;
  size-adjust: 108.5%;
  ascent-override: 89.29%;
  descent-override: 22.23%;
  line-gap-override: 0%;
}
