/* ============================================================
   Montserrat — self-hosted variable font (SIL Open Font License 1.1)
   Google serves one variable file per subset for every weight, so two
   files cover 300-600. Served from our own origin: no third-party
   request to Google, and no render-blocking hop to fonts.googleapis.com.
   ============================================================ */


@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../assets/fonts/montserrat-latin-ext.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: "Montserrat";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../assets/fonts/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;
}

/* Cyrillic — only fetched when the page actually renders Cyrillic, which is
   what unicode-range is for: an English or Lithuanian page never downloads it.
   Self-hosted like the rest, so no request leaves our origin.

   THERE ARE TWO OF THESE, and for a long time there was only the wrong one.
   Google splits Cyrillic in half: `cyrillic` is U+0400-045F, which is every
   letter Russian is written with, and `cyrillic-ext` is U+0460-052F, which is
   Old Church Slavonic and the minority languages. The file here was the ext
   subset under the plain name -- 138 glyphs, and not one of the 65 Russian
   letters among them. So every word of the Russian interface fell through to
   the metric-matched fallback and rendered in Helvetica while English and
   Lithuanian rendered in Montserrat. Same font-size, visibly different type.
   Nothing errors when a unicode-range simply never matches. */
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../assets/fonts/montserrat-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../assets/fonts/montserrat-cyrillic-ext.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

/* ============================================================
   METRIC-MATCHED FALLBACK
   Webfonts do not always arrive: Safari's Lockdown Mode disables them
   outright, content blockers can drop them, and a bad connection can
   time them out. When that happens the page should still look like
   itself rather than reflow into a different design.

   The numbers are measured, not derived. At 700/100px the string
   "Ship repair and maintenance all over the world" sets 2457px in
   Montserrat. size-adjust was then swept against that target in the
   browser — 110.8% gave 2298, 118% gave 2448, 125% gave 2593 — so
   118.4% is the value that actually lands, rather than the 110.8% a
   straight width ratio predicts. The overrides interact with the
   adjust, which is why this had to be measured end to end.

   Montserrat's own vertical metrics are 97% ascent / 25% descent, so
   the line box matches too and nothing shifts vertically.
   ============================================================ */
@font-face {
  font-family: "Montserrat Fallback";
  src: local("Helvetica Neue"), local("Helvetica"), local("Arial"),
       local("Liberation Sans"), local("Nimbus Sans");
  size-adjust: 118.4%;
  ascent-override: 97%;
  descent-override: 25%;
  line-gap-override: 0%;
}
