@font-face {
  font-family: "STIX Two Text";
  src: url("fonts/STIXTwoText-Regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "STIX Two Text";
  src: url("fonts/STIXTwoText-Italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "STIX Two Text";
  src: url("fonts/STIXTwoText-Bold.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "STIX Two Math";
  src: url("fonts/STIXTwoMath-Regular.woff2") format("woff2");
  font-display: swap;
}

:root {
  font-family: "STIX Two Text", Georgia, serif;
  font-size: 19px;
  line-height: 1.55;
  color: #302c28;
  background: #fbf8f0;
}

* { box-sizing: border-box; }

body {
  max-width: 40rem;
  margin: 2.5rem auto;
  padding: 0 1.25rem;
}

a { color: #264f77; text-underline-offset: 0.15em; }
a:visited { color: #68466c; }
a:hover { text-decoration-thickness: 0.12em; }
a:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }

.site-header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  justify-content: space-between;
  font-size: 0.9rem;
  margin-bottom: 2.5rem;
}

.site-header nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; }
.downloads { margin-left: auto; }
.landing { margin-top: 18vh; }
.landing h1 { font-size: 3rem; }
.landing p { font-size: 0.9rem; }

.article-header { margin-bottom: 2rem; }
h1, h2, h3 { line-height: 1.2; font-weight: 400; }
h1 { font-size: 2.1rem; margin: 0 0 0.65rem; }
h2 { font-size: 1.4rem; margin: 2.2rem 0 0.8rem; }
h3 { font-size: 1.1rem; margin: 1.6rem 0 0.7rem; }
p { margin: 0 0 1rem; }
.byline, figcaption, caption, .site-footer { color: #645d53; font-size: 0.85rem; }
.byline { margin: 0; }

math { font-family: "STIX Two Math", math; }
p:has(> math[display="block"]) {
  overflow-x: auto;
  padding: 0.5rem 0;
  margin: 1.3rem 0;
}
math[display="block"] {
  min-width: max-content;
  margin: 0;
}

figure { margin: 1.8rem 0; }
img { display: block; max-width: 100%; height: auto; margin: 0 auto; }
figcaption { margin-top: 0.7rem; line-height: 1.45; }

.table-scroll { overflow-x: auto; margin: 1.8rem 0; }
table { width: 100%; border-collapse: collapse; font-size: 0.87rem; }
caption { text-align: left; margin-bottom: 0.65rem; }
th, td { padding: 0.45rem 0.55rem; vertical-align: top; }
thead { border-top: 1px solid #8e8576; border-bottom: 1px solid #bdb5a7; }
tbody { border-bottom: 1px solid #8e8576; }
th { font-weight: 400; }
th:first-child, td:first-child { padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
td:not(:first-child) { white-space: nowrap; font-variant-numeric: tabular-nums; }

code { font-family: "DejaVu Sans Mono", monospace; font-size: 0.78em; }
pre {
  overflow-x: auto;
  padding: 0.9rem 1rem;
  margin: 1.4rem 0;
  line-height: 1.55;
  background: #f1ede3;
}
pre code { font-size: 0.78rem; }
blockquote { margin: 1.4rem 0 1.4rem 1.2rem; font-style: italic; }
ul, ol { padding-left: 1.5rem; }
li { margin-bottom: 0.35rem; }
hr { border: 0; border-top: 1px solid #c9c1b4; margin: 2rem 0 1rem; }
.footnotes { font-size: 0.85rem; }
.footnote-ref { font-variant-numeric: lining-nums; }
.site-footer { border-top: 1px solid #c9c1b4; margin-top: 2.5rem; padding-top: 1rem; }

@media (max-width: 480px) {
  :root { font-size: 18px; }
  body { margin: 1.3rem auto; padding: 0 1rem; }
  h1 { font-size: 1.8rem; }
  .site-header { margin-bottom: 1.8rem; }
  table { min-width: 32rem; }
}

@media print {
  :root { font-size: 11pt; color: #000; background: #fff; }
  body { max-width: none; margin: 0; padding: 0; }
  .site-header, .site-footer, .footnote-back { display: none; }
  a { color: inherit; }
  h1, h2, h3 { break-after: avoid; }
  figure, pre { break-inside: avoid; }
  img { max-height: 20cm; width: auto; }
  pre { white-space: pre-wrap; overflow-wrap: anywhere; }
  table { min-width: 0; }
  .table-scroll, p:has(> math[display="block"]) { overflow: visible; }
  @page { margin: 25mm; }
}
