/**
 * Self-hosted webfonts.
 *
 * Inter came from fonts.googleapis.com and General Sans from api.fontshare.com.
 * Two third-party stylesheets, each of which had to be fetched and parsed before
 * the browser even learned the URL of a font file, on two hosts that needed
 * their own DNS and TLS. Lighthouse measured 1.5-2.0s of render blocking from
 * the pair on every mobile page, and the swap when they finally arrived was the
 * whole of the home page's 0.159 CLS.
 *
 * Both families now ship from this theme. The three faces that draw above the
 * fold are preloaded in php/_perf.php, so they are in flight with the HTML
 * rather than two round trips behind it.
 *
 * Inter is served as one variable file per subset: Google's css2 endpoint hands
 * back a separate @font-face per weight, but all four point at the same file,
 * so 400-700 is one 48KB download rather than four.
 *
 * Regenerate by re-fetching the two upstream stylesheets and re-downloading the
 * woff2 they name; the filenames here are ours, not theirs.
 */

/* ---------------------------------------------------------------- Inter --- */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../assets/fonts/inter-var-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: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../assets/fonts/inter-var-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;
}

/**
 * Arial, re-proportioned to Inter's metrics. Body text is set in Inter, so this
 * is what holds the line boxes still in the window between first paint and the
 * font arriving. Numbers are the standard Inter-over-Arial overrides.
 */
@font-face {
  font-family: 'Inter Fallback';
  src: local('Arial');
  ascent-override: 90%;
  descent-override: 22.43%;
  line-gap-override: 0%;
  size-adjust: 107.12%;
}

/* --------------------------------------------------------- General Sans --- */

@font-face {
  font-family: 'General Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../assets/fonts/generalsans-400-all.woff2') format('woff2');
}

@font-face {
  font-family: 'General Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../assets/fonts/generalsans-500-all.woff2') format('woff2');
}

@font-face {
  font-family: 'General Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../assets/fonts/generalsans-600-all.woff2') format('woff2');
}

@font-face {
  font-family: 'General Sans';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../assets/fonts/generalsans-700-all.woff2') format('woff2');
}
