/* Copyright The DeviceChain Authors */
/* SPDX-License-Identifier: Apache-2.0 */

/*
 * Self-hosted type: Geist (display and text) and Geist Mono, SIL Open Font License 1.1
 * (assets/fonts/OFL.txt). Variable WOFF2, Latin and Latin-Extended subsets cut from the
 * upstream variable TTFs with fontTools (keep every layout feature, drop everything outside the
 * two ranges). Chinese falls through to the system CJK face, as it did before.
 *
 * Loaded AFTER brand.css and overrides --sans / --mono. brand.css is a generated copy of the
 * monorepo token output and is not edited here; the stacks move into the tokens when the
 * typeface is signed off.
 *
 * font-display: swap, with a fallback face whose metrics are adjusted so the swap does not move
 * the layout: size-adjust scales the system face to Geist's average advance, and the ascent and
 * descent overrides pin the line box. Values measured against Arial / Courier New with fontTools
 * (frequency-weighted advance of a-z; hhea ascent and descent), not estimated:
 *   Geist       0.512 em avg advance, ascent 1.005, descent 0.295
 *   Arial       0.4755 em                    -> size-adjust 107.7%, ascent 93.3%, descent 27.4%
 *   Geist Mono  0.600 em advance (Courier New is also 0.600) -> size-adjust 100%
 */

@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/Geist-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2190-2193, U+2212, U+2215, U+FEFF, U+FFFD, U+2022, U+00D7, U+2713;
}
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/Geist-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/GeistMono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2190-2193, U+2212, U+2215, U+FEFF, U+FFFD, U+2022, U+00D7, U+2713;
}
@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/GeistMono-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Metric-adjusted stand-ins, used only until the real face arrives. */
@font-face {
  font-family: "Geist Fallback";
  src: local("Arial"), local("Liberation Sans"), local("Helvetica Neue"), local("Helvetica");
  size-adjust: 107.7%;
  ascent-override: 93.3%;
  descent-override: 27.4%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Geist Mono Fallback";
  src: local("Courier New"), local("Liberation Mono"), local("Courier");
  size-adjust: 100%;
  ascent-override: 100.5%;
  descent-override: 29.5%;
  line-gap-override: 0%;
}

:root {
  --sans: "Geist", "Geist Fallback", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Geist Mono", "Geist Mono Fallback", ui-monospace, "SF Mono", "DejaVu Sans Mono", "Liberation Mono", Menlo, Consolas, monospace;
}
