/* The application's typeface, served by this application.
 *
 * ⚠️⚠️ IT USED TO BE A REMOTE STYLESHEET, and the venue has no internet. The
 * day of the tournament every screen -- the operator's control, the mat
 * display, the contest order projected on the wall -- fell back to whatever
 * the system font happened to be, silently and only there. A dependency that
 * works everywhere except at the event is worse than one that never works,
 * because nothing in testing shows it.
 *
 * Two files and no network. Variable faces, so one file covers every weight
 * the interface asks for instead of one request per weight.
 *
 * ⓘ Inter, by The Inter Project Authors, under the SIL Open Font License 1.1.
 * The licence travels with the files in `../fonts/LICENSE.txt`, which is what
 * that licence asks for.
 *
 * The `font-family` declarations live in `auth.css`, `public.css` and the
 * screen sheets, unchanged: this file only makes the faces exist. Keeping the
 * two apart is what let the swap be a one-line edit per template instead of a
 * rewrite of every stack.
 */

@font-face {
  font-family: 'InterVariable';
  font-style: normal;
  font-weight: 100 900;
  /* The face is there before it has painted, rather than the text being
     invisible while the file loads. On a laptop reading from its own disk the
     wait is a few milliseconds; on the one screen that matters it is the
     difference between a blank scoreboard and a correct one. */
  font-display: swap;
  src: url('/static/fonts/InterVariable.woff2') format('woff2');
}

@font-face {
  font-family: 'InterVariable';
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url('/static/fonts/InterVariable-Italic.woff2') format('woff2');
}

/* IBM Plex Mono — the numbers. Four static weights rather than a variable
 * face, because that is what the family ships. ⚠️ THIS ONE MATTERS MOST AT
 * THE VENUE: it is the clock, the scores and the contest numbers, and a
 * proportional fallback makes a running clock jitter on every digit change.
 * Latin subset only -- the mono family is used for figures. IBM Plex, by IBM,
 * under the SIL Open Font License 1.1. */
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/IBMPlexMono-400.woff2') format('woff2');
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/static/fonts/IBMPlexMono-500.woff2') format('woff2');
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/static/fonts/IBMPlexMono-600.woff2') format('woff2');
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/static/fonts/IBMPlexMono-700.woff2') format('woff2');
}

/* Noto Serif JP — SUBSET to the thirteen characters this product actually
 * writes, which is why it is four kilobytes instead of a megabyte and a half.
 * The full family is a CJK font; shipping all of it to render the kana beside
 * the wordmark would cost more than every other face here put together.
 *
 * ⚠️ Regenerate it if a Japanese character is ADDED to a template -- a
 * character with no glyph falls back to the system serif, silently and only
 * in the one place it was added. The set was taken from the templates, not
 * written by hand:
 *   python -m fontTools.subset NotoSerifJP.woff2 \
 *     --text="ありジハメ一効始導技指有本" --flavor=woff2 --no-hinting \
 *     --output-file=NotoSerifJP-subset.woff2
 * Noto, by the Noto Project Authors, under the SIL Open Font License 1.1. */
@font-face {
  font-family: 'Noto Serif JP';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/static/fonts/NotoSerifJP-subset.woff2') format('woff2');
}

/* ⓘ `Inter` as well as `InterVariable`, because the stacks name both: the
   variable family is used only inside the `@supports` guard in `auth.css`,
   and everything outside it asks for `Inter`. Pointing the static name at the
   same variable file means the guard decides which STACK wins, never whether
   a face exists at all -- which is the state that produced the system-font
   fallback in the first place. */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/static/fonts/InterVariable.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url('/static/fonts/InterVariable-Italic.woff2') format('woff2');
}
