/* ============================================================================
   OneMediaKit — self-hosted webfonts (package B).
   Two variable files, Latin subset, WOFF2, both under the SIL Open Font
   License 1.1 (see LICENSE-BricolageGrotesque.txt and LICENSE-Inter.txt).

   Display: Bricolage Grotesque  opsz 12–96, wght 200–800   (~75 KB)
   Text:    Inter                opsz 14–32, wght 100–900   (~71 KB)

   Loading contract:
   - font-display: swap, so text is never invisible.
   - Preload both files from the page <head>:
       <link rel="preload" href=".../assets/fonts/Inter-latin.woff2"
             as="font" type="font/woff2" crossorigin>
       <link rel="preload" href=".../assets/fonts/BricolageGrotesque-latin.woff2"
             as="font" type="font/woff2" crossorigin>
   - Size-adjusted local fallbacks (Arial / Helvetica) below carry the real
     metrics of each webfont, measured from the font tables against Arial,
     so the swap causes no layout shift (CLS 0). Use the stacks exactly as
     tokens.css does: 'Bricolage Grotesque', 'Bricolage Fallback', ...
                      'Inter', 'Inter Fallback', ...
   - No Google Fonts CSS, no third-party origin. Ever.
   - unicode-range is the Google Fonts "latin" subset: covers every string in
     docs/copy.md including €, £, curly quotes, en/em dashes and the middle dot.
   ============================================================================ */

@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 200 800;
  font-stretch: 100%;
  font-display: swap;
  src: url('BricolageGrotesque-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: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('Inter-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-compatible fallbacks. Values computed on 7 Sept 2026 from the
   hhea/hmtx tables of BricolageGrotesque[opsz,wdth,wght].ttf and
   Inter[opsz,wght].ttf versus Arial.ttf, weighted by English letter
   frequency (tools: see docs/design-tokens.md, "Fonts"). */

@font-face {
  font-family: 'Bricolage Fallback';
  src: local('Arial'), local('Helvetica Neue'), local('Helvetica');
  size-adjust: 100.66%;
  ascent-override: 92.39%;
  descent-override: 26.82%;
  line-gap-override: 0%;
}

@font-face {
  font-family: 'Inter Fallback';
  src: local('Arial'), local('Helvetica Neue'), local('Helvetica');
  size-adjust: 107.04%;
  ascent-override: 90.50%;
  descent-override: 22.53%;
  line-gap-override: 0%;
}

/* --------------------------------------------------------------------------
   Design presets (8 Sept). Two more display faces, same contract: Latin
   subset, variable WOFF2, SIL Open Font License 1.1, no third-party origin.
   Montserrat carries Noir and Studio; Playfair Display carries Atelier.
   They load only on a kit rendered in one of those designs.
   -------------------------------------------------------------------------- */

@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('Montserrat-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: 'Playfair Display';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('PlayfairDisplay-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 so the swap shifts nothing. */
@font-face {
  font-family: 'Montserrat Fallback';
  src: local('Arial');
  ascent-override: 92.4%;
  descent-override: 24.0%;
  line-gap-override: 0%;
  size-adjust: 104.7%;
}

@font-face {
  font-family: 'Playfair Fallback';
  src: local('Georgia'), local('Times New Roman');
  ascent-override: 96.5%;
  descent-override: 23.2%;
  line-gap-override: 0%;
  size-adjust: 103.1%;
}
