/*
 * Font-face set trimmed for perf: we ship Regular (400) and Bold (700)
 * for Inter and OpenSans and let the browser synthesise intermediate
 * weights (500/600) from the closest face. Six preloaded font files on
 * the critical path (~487 KB) dominated mobile LCP on throttled 4G.
 */

@font-face {
  font-family: "Inter";
  src: url("/files/fonts/Inter/Inter-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("/files/fonts/Inter/Inter-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "OpenSans";
  src: url("/files/fonts/OpenSans/OpenSans-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "OpenSans";
  src: url("/files/fonts/OpenSans/OpenSans-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* Roboto Mono kept for docs code blocks (--sp-font-mono). */
@font-face {
  font-family: "Roboto Mono";
  src: url("/files/fonts/RobotoMono/roboto-mono-v31-latin-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Roboto Mono";
  src: url("/files/fonts/RobotoMono/roboto-mono-v31-latin-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/*
 * Metric-matched fallback faces. While Inter/OpenSans woff2s are loading
 * (font-display: swap), the browser renders text with the system fallback.
 * These fallback faces alias local Arial with size-adjust + ascent/descent
 * overrides tuned to match the web font's box, so the swap is
 * geometrically invisible (no CLS). Values derived via Capsize.
 */

@font-face {
  font-family: "Inter Fallback";
  src: local("Arial");
  size-adjust: 107.4%;
  ascent-override: 90%;
  descent-override: 22.43%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "OpenSans Fallback";
  src: local("Arial");
  size-adjust: 106.27%;
  ascent-override: 101.39%;
  descent-override: 27.78%;
  line-gap-override: 0%;
}
