/* STIX Two web fonts for the web edition.
 *
 * Same family the print build typesets with (the `stix2` LaTeX package), so the
 * site mirrors the book: STIX Two Text for body/headings, STIX Two Math for the
 * MathML. Self-hosted WOFF2 (SIL OFL licensed) -> works offline and under a
 * strict CSP, no CDN. Files live in `fonts/` next to the HTML (the build script
 * copies bookwww/webfonts there).
 *
 * STIX Two Math is a true OpenType MATH font: setting it on <math> makes modern
 * browsers (Firefox; Chromium MathML-Core 109+; Safari 18+) use its MATH table
 * for stretchy delimiters, integral sizing and script positioning -- the same
 * metrics as print, not the browser's default math font.
 */

@font-face {
  font-family: "STIX Two Text";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/STIXTwoText-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "STIX Two Text";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/STIXTwoText-Italic.woff2") format("woff2");
}
@font-face {
  font-family: "STIX Two Text";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/STIXTwoText-Medium.woff2") format("woff2");
}
@font-face {
  font-family: "STIX Two Text";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/STIXTwoText-SemiBold.woff2") format("woff2");
}
@font-face {
  font-family: "STIX Two Text";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/STIXTwoText-Bold.woff2") format("woff2");
}
@font-face {
  font-family: "STIX Two Text";
  font-style: italic;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/STIXTwoText-BoldItalic.woff2") format("woff2");
}
@font-face {
  font-family: "STIX Two Math";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/STIXTwoMath-Regular.woff2") format("woff2");
}

/* Body, headings, everything textual -> STIX Two Text. */
:root {
  --stix-text: "STIX Two Text", "STIX Two", Georgia, "Times New Roman", serif;
  --stix-math: "STIX Two Math", "STIX Two", "STIX", serif;
}
html, body,
.ltx_document,
.ltx_title, .ltx_title_chapter, .ltx_title_section,
.ltx_title_subsection, .ltx_title_subsubsection,
.ltx_caption, .ltx_p, .ltx_para, .ltx_note {
  font-family: var(--stix-text);
}

/* The MathML. Apply broadly so every operator/identifier/number inherits the
 * STIX Two Math glyphs and the OpenType MATH metrics. */
math,
.ltx_Math, .ltx_equation, .ltx_eqn_table,
math * {
  font-family: var(--stix-math);
}
