/* generic — font loading
 *
 * Import BEFORE tokens.css. Self-hosted WOFF2, no CDN round-trip.
 *
 * Licence: Chalet © House Industries / Brand Design Co. Inc.
 * Webfont licence, 25,000 pageviews per day — see design.md § Notes.
 * The cap is per-licence and this is a template: every project inheriting
 * this system draws on the same allowance. Track usage in aggregate.
 *
 * Converted from the supplied TTFs with fontTools. Format only — fsType (260)
 * and all embedded copyright strings are carried over unchanged, and the files
 * are NOT subsetted, because the no-subset bit is set on the source.
 */

/* --- Chalet London — the default display and body face -------------------- */
@font-face {
  font-family: "Chalet";
  src: url("./fonts/chalet/ChaletLondonNineteenSixty.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* --- Chalet New York — second cut, available but not wired to a token ----- */
@font-face {
  font-family: "Chalet New York";
  src: url("./fonts/chalet/ChaletNewYorkNineteenSixty.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* --- Metric-matched fallbacks --------------------------------------------
   `font-display: swap` paints fallback text immediately, then swaps. Without
   matched metrics that swap reflows the hero and spends the whole CLS budget
   in one frame. Values below are measured from the fonts themselves:
   ascent 750/1000, descent 170/1000, lineGap 0, xAvgCharWidth 0.465em.
   size-adjust is relative to Helvetica/Arial (xAvgCharWidth 0.5439em).

   The overrides are DIVIDED by the size-adjust factor, because per spec they
   resolve against the already-adjusted em. Using the raw 75%/17% leaves the
   fallback 14.4% short vertically — measured, not theorised.                */

@font-face {
  font-family: "Chalet Fallback";
  src: local("Helvetica Neue"), local("Helvetica"), local("Arial");
  ascent-override: 87.7%;    /* 75% / 0.855 — overrides resolve against the ADJUSTED em */
  descent-override: 19.9%;   /* 17% / 0.855 */
  line-gap-override: 0%;
  size-adjust: 85.5%;
}

@font-face {
  font-family: "Chalet New York Fallback";
  src: local("Helvetica Neue"), local("Helvetica"), local("Arial");
  ascent-override: 85.7%;    /* 75% / 0.875 */
  descent-override: 19.4%;   /* 17% / 0.875 */
  line-gap-override: 0%;
  size-adjust: 87.5%;
}

/* --- Chivo Mono — labels, buttons, tickers -------------------------------
   Variable, weight 100–900, so one file covers every weight the system uses.
   SIL Open Font License (fsType 0, fully installable) — vendored here rather
   than linked from fonts.googleapis.com, because the CDN round-trip costs
   more than the file. Licence text ships alongside at fonts/chivo-mono/OFL.txt,
   as the OFL requires.

   Split by unicode-range exactly as Google serves it: a Latin-only page
   downloads 26 KB and never fetches the extended set.                       */

@font-face {
  font-family: "Chivo Mono";
  src: url("./fonts/chivo-mono/ChivoMono-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  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: "Chivo Mono";
  src: url("./fonts/chivo-mono/ChivoMono-latin-ext.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  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;
}

/* --- Host Grotesk — the wordmark and display face ------------------------
   Chosen 2026-08-28 after three rounds of candidates. Element Type, SIL Open
   Font License (licence text ships alongside at fonts/host-grotesk/OFL.txt,
   as the OFL requires). Variable, weight 100–900, so one 31 KB file covers
   every weight the system asks for.

   Uniwidth: glyph advances do not change with weight, so the wordmark keeps
   its width when the nav brand goes semibold on hover or the hero goes heavy.
   That property is why it was picked over the other five finalists — nothing
   reflows when weight changes.

   NOT subsetted and NOT split by unicode-range, unlike Chivo Mono above: at
   31 KB whole, a split would add a second request to save a few KB.          */
@font-face {
  font-family: "Host Grotesk";
  src: url("./fonts/host-grotesk/HostGrotesk[wght].woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
