/*
  NCD brand kit - fonts (self-hosted)
  Families : Bricolage Grotesque (display) + Newsreader (serif). Both SIL OFL 1.1, see FONTS.md.
  Files    : variable WOFF2, Latin subset as served by Google Fonts (latin-ext for Bricolage only).
  Use      : <link rel="stylesheet" href="fonts/fonts.css"> and reference var(--disp) / var(--serif).
  Optical sizing: both families carry an `opsz` axis. Keep `font-optical-sizing:auto` (the browser
  default) so opsz follows the rendered font-size automatically. Do not hard-set
  font-variation-settings:"opsz" unless a design needs it; it overrides the automatic mapping.
  Bricolage opsz 12..96, wght 200..800 (site uses 300..800). Newsreader opsz 6..72, wght 200..800
  (site uses 300..500 plus italic 300..400).
*/

/* ---------- Bricolage Grotesque (display) ---------- */
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("bricolage-grotesque-latin-ext-var.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: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("bricolage-grotesque-latin-var.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;
}

/* ---------- Newsreader (serif) ---------- */
/* Latin-ext is not shipped (about 87 KB upright / 95 KB italic, over the 60 KB budget);
   characters outside Latin fall through to Georgia / Times New Roman. */
@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("newsreader-latin-var.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: "Newsreader";
  font-style: italic;
  font-weight: 200 800;
  font-display: swap;
  src: url("newsreader-italic-latin-var.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 (cut layout shift while the web fonts load) ----------
   Computed with fontTools: size-adjust = avg advance of the web font / avg advance of the local
   font, over English letter frequencies plus ~18% spaces (the Capsize / Next.js method).
   ascent/descent/line-gap overrides = web font hhea metric / size-adjust. Measured instances:
   Bricolage wght 400 + 700 at opsz 48; Newsreader wght 400 at opsz 18. Figures are mid-range
   compromises; see FONTS.md for the sensitivity table. Local fonts measured: Arial, Arial Bold,
   Georgia, Georgia Italic from macOS system fonts. */
@font-face {
  font-family: "Bricolage Grotesque Fallback";
  font-style: normal;
  font-weight: 200 599;
  src: local("Arial"), local("ArialMT"), local("Helvetica Neue"), local("HelveticaNeue");
  size-adjust: 102.02%;
  ascent-override: 91.16%;
  descent-override: 26.46%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Bricolage Grotesque Fallback";
  font-style: normal;
  font-weight: 600 800;
  src: local("Arial Bold"), local("Arial-BoldMT"), local("Helvetica Neue Bold"), local("HelveticaNeue-Bold");
  size-adjust: 98.08%;
  ascent-override: 94.82%;
  descent-override: 27.53%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Newsreader Fallback";
  font-style: normal;
  font-weight: 200 800;
  src: local("Georgia"), local("Times New Roman"), local("TimesNewRomanPSMT");
  size-adjust: 91.54%;
  ascent-override: 80.29%;
  descent-override: 28.95%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Newsreader Fallback";
  font-style: italic;
  font-weight: 200 800;
  src: local("Georgia Italic"), local("Georgia-Italic"), local("Times New Roman Italic"), local("TimesNewRomanPS-ItalicMT");
  size-adjust: 82.46%;
  ascent-override: 89.14%;
  descent-override: 32.14%;
  line-gap-override: 0%;
}

/* ---------- Stacks ---------- */
:root {
  --disp: "Bricolage Grotesque", "Bricolage Grotesque Fallback", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --serif: "Newsreader", "Newsreader Fallback", Georgia, "Times New Roman", serif;
}
