/* Self-hosted fonts, SIL OFL 1.1 — licences in ../fonts/OFL-*.txt. Latin subset. */

@font-face {
  font-family: "Barlow Semi Condensed";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/barlow-sc-400.woff2") format("woff2");
}
@font-face {
  font-family: "Barlow Semi Condensed";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/barlow-sc-400-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Barlow Semi Condensed";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/barlow-sc-500.woff2") format("woff2");
}
@font-face {
  font-family: "Barlow Semi Condensed";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/barlow-sc-600.woff2") format("woff2");
}

/* Display serif — Fraunces. Used via --font-display in tokens.css */
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 300 600;
  font-display: optional;
  src: url("../fonts/fraunces-var.woff2") format("woff2");
}
@font-face {
  font-family: "Fraunces";
  font-style: italic;
  font-weight: 300 600;
  font-display: optional;
  src: url("../fonts/fraunces-var-italic.woff2") format("woff2");
}

/* Metric-matched fallback for the display serif.
   Numbers are measured, not guessed: tools/diag_font_metrics.py compares the width and
   vertical metrics of Fraunces with the local fallback (Georgia 85.5% width) and prints
   the overrides. Without this, swapping in Fraunces after the first paint re-breaks the
   hero lines and moves everything below (measured CLS 0.12-0.16). Re-run the tool if the
   display font ever changes. */
@font-face {
  font-family: "Fraunces Fallback";
  src: local("Georgia"), local("Times New Roman");
  size-adjust: 85.5%;
  ascent-override: 98%;
  descent-override: 26%;
  line-gap-override: 0%;
}
/* Italic needs its own declaration: a face without font-style is only used for normal. */
@font-face {
  font-family: "Fraunces Fallback";
  font-style: italic;
  src: local("Georgia Italic"), local("Georgia");
  size-adjust: 85.5%;
  ascent-override: 98%;
  descent-override: 26%;
  line-gap-override: 0%;
}

/* Metric-matched fallback for the condensed text face: keeps line breaks stable while
   Barlow Semi Condensed is still loading. Numbers measured with tools/diag_text_metrics.py
   (Barlow width 10016 px vs Arial 11501 px -> size-adjust 87.1%). Arial is first because
   it is present on Windows and macOS alike; a condensed local face would need its own
   size-adjust and would break on systems where it is missing. */
@font-face {
  font-family: "Barlow Fallback";
  src: local("Arial"), local("Helvetica");
  size-adjust: 87.1%;
  ascent-override: 100%;
  descent-override: 20%;
  line-gap-override: 0%;
}
