/* Self-hosted web fonts — replaces the fonts.googleapis.com stylesheet.
 *
 * Files in ./fonts/ are the Google Fonts woff2 subsets (latin + latin-ext only;
 * cyrillic/vietnamese/symbols subsets are omitted — the site is English with
 * Romanian place names, all of which live in latin + latin-ext).
 * Geist and Geist Mono are variable (wght 100–900), so one file covers 400–800.
 *
 * Each family is paired with a metric-matched fallback face so the swap from
 * fallback to web font does not reflow. Overrides were computed as
 *   size-adjust = (webfont.xWidthAvg / upm) / (fallback.xWidthAvg / upm)
 *   ascent/descent/line-gap-override = (webfont.metric / upm) / size-adjust
 * using @capsizecss/metrics 4.3.0 for the fallbacks and the shipped woff2
 * metrics for the web fonts (verified identical to capsize: Geist 1000/1005/-295,
 * Instrument Serif 1000/990/-310).
 *
 * The Instrument Serif italic fallback is matched against Georgia's roman
 * metrics — capsize publishes no Georgia Italic entry — so it is a close
 * approximation rather than an exact match.
 */

/* ---------- Geist (variable, 100–900) ---------- */
@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;
}
@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;
}

/* ---------- Geist Mono (variable, 100–900) ---------- */
@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("./fonts/geistmono-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;
}
@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("./fonts/geistmono-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;
}

/* ---------- Instrument Serif (static 400, roman + italic) ---------- */
@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("./fonts/instrumentserif-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;
}
@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("./fonts/instrumentserif-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: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("./fonts/instrumentserif-italic-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;
}
@font-face {
  font-family: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("./fonts/instrumentserif-italic-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;
}

/* ---------- Metric-matched fallbacks ---------- */
/* These render instantly from a local system font at the web font's measured
 * size, so the swap is visually a typeface change with no layout shift.
 * If the local() font is absent (most Linux), the face is skipped and the
 * stack falls through to the generic families kept in styles.css. */

@font-face {
  font-family: "Geist Fallback";
  src: local("Arial"), local("Helvetica"), local("Liberation Sans");
  size-adjust: 104.76%;
  ascent-override: 95.94%;
  descent-override: 28.16%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Geist Mono Fallback";
  src: local("Courier New"), local("Liberation Mono");
  size-adjust: 99.98%;
  ascent-override: 100.52%;
  descent-override: 29.50%;
  line-gap-override: 0%;
}

/* Serif gets two tiers, because Georgia and Times are not metrically alike and
 * one face can carry only one size-adjust. Georgia (Windows + macOS) is tried
 * first; where it is absent the face is invalid and the stack falls through to
 * the Times/Liberation tier below. Measured residual with the matching tier:
 * under 1% on the italic run, versus ~12% when the tiers are mismatched. */
@font-face {
  font-family: "Instrument Serif Fallback";
  font-style: normal;
  src: local("Georgia");
  size-adjust: 76.49%;
  ascent-override: 129.43%;
  descent-override: 40.53%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Instrument Serif Fallback";
  font-style: italic;
  src: local("Georgia Italic"), local("Georgia");
  size-adjust: 80.53%;
  ascent-override: 122.94%;
  descent-override: 38.50%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Instrument Serif Fallback 2";
  font-style: normal;
  src: local("Times New Roman"), local("Liberation Serif"), local("Tinos");
  size-adjust: 83.94%;
  ascent-override: 117.94%;
  descent-override: 36.93%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Instrument Serif Fallback 2";
  font-style: italic;
  src: local("Times New Roman Italic"), local("Times New Roman"), local("Liberation Serif Italic"), local("Liberation Serif"), local("Tinos Italic"), local("Tinos");
  size-adjust: 88.37%;
  ascent-override: 112.03%;
  descent-override: 35.08%;
  line-gap-override: 0%;
}
