/*
 * type.css - cube's two typefaces, self hosted.
 *
 * Fraunces for anything that speaks, Instrument Sans for anything that explains, and the
 * existing --mono stack for anything that is data. The first two are the pairing from
 * prentice.homes, which is where this came from.
 *
 * Self hosted rather than pulled from Google's CDN on purpose. The Worker ships
 * default-src 'none' and a product whose whole pitch is provenance should not be making a
 * third party request on every page load, or asking every visitor's browser to announce
 * itself to one. Same origin costs one CSP token, font-src 'self', instead of two exceptions
 * pointing at somebody else's infrastructure.
 *
 * Both faces are SIL Open Font License 1.1, which permits this. See OFL.txt beside them.
 *
 * These are the variable latin subsets, 66K and 29K. One file per family covers every weight
 * the site uses, so there is no second request when a heading turns bold.
 */

@font-face {
  font-family: "Fraunces";
  src: url("/fonts/fraunces-latin-var.woff2") format("woff2-variations");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Sans";
  src: url("/fonts/instrument-sans-latin-var.woff2") format("woff2-variations");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

/*
 * Headings take the serif. This sits in the shared sheet rather than in each page so the
 * pairing is decided once, and it is deliberately weak: any page that already gives a heading
 * its own font-family, like the mono uppercase labels in the console, still wins on the
 * cascade because its rules load after this file.
 */
h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 300;
  letter-spacing: -0.01em;
}

h3 {
  font-weight: 500;
}
