/* ==========================================================================
   Edilis — the three typefaces of the identity, hosted from this repository
   --------------------------------------------------------------------------
   The identity names three roles and three families: Spectral for headings, the
   logotype and print, Inter for the whole interface, JetBrains Mono for sums,
   identifiers and dates (docs/decisions/vizualna-identita-edilis.md). All three
   are under the SIL Open Font License; the licence files sit next to the fonts
   in static/web/fonts/, the same way htmx.LICENSE.txt sits next to htmx.

   SELF-HOSTED, NEVER FROM A FOREIGN SERVER. The delivered identity pulls the
   fonts from Google Fonts. In an application for building managers that is an
   outgoing request to somebody else's server on every screen load — so the files
   live here, subset to Latin plus the Slovak and Czech diacritics.

   WHY `font-display: optional` AND NOT `swap`. The requirement is that the text
   does not reflow while loading. `swap` paints the fallback and then re-lays out
   the page the moment the font arrives — on a form that is a line of fields
   jumping under the cursor. `optional` gives the browser a short window: if the
   font is there, it is used from the first paint; if it is not, this page load
   stays in the system stack and swaps nothing. Combined with the preload in
   base.html, the first paint has the fonts on all but the slowest first visit,
   and NO paint ever moves.

   The family names are declared in tokens.css with the system stack still behind
   them. The stack is not decoration: `optional` deliberately leaves a load in the
   fallback, and a missing fallback would render that load in Times.

   Which files exist and how they were subset: static/web/fonts/README.md.
   ========================================================================== */

/* --- Inter: one variable file for 400/500/600/700. Four static cuts would be
       four requests and four times the bytes for the same four weights. */
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-variable.1896ba67d79d.woff2") format("woff2-variations"),
       url("../fonts/inter-variable.1896ba67d79d.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: optional;
}

/* --- JetBrains Mono: variable as well, 400 and 500 — the two cuts the identity
       names for sums and identifiers. */
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono-variable.52c18111903a.woff2") format("woff2-variations"),
       url("../fonts/jetbrains-mono-variable.52c18111903a.woff2") format("woff2");
  font-weight: 400 500;
  font-style: normal;
  font-display: optional;
}

/* --- Spectral has no variable cut upstream, so it is three static files — and
       only three: 300 for large quiet settings, 500 for headings and the print
       logotype, 600 where the heading has to carry weight. A cut nobody uses is
       a downloaded file nobody sees. */
@font-face {
  font-family: "Spectral";
  src: url("../fonts/spectral-light.48bcfd7fc6f6.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: optional;
}

@font-face {
  font-family: "Spectral";
  src: url("../fonts/spectral-medium.5ca34f7ec8cd.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: optional;
}

@font-face {
  font-family: "Spectral";
  src: url("../fonts/spectral-semibold.1d4b52976c45.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: optional;
}
