@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/newsreader-400.woff2") format("woff2");
}

@font-face {
  font-family: "Newsreader";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/newsreader-400-italic.woff2") format("woff2");
}

@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/newsreader-500.woff2") format("woff2");
}

@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/newsreader-600.woff2") format("woff2");
}

@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/source-sans-3-400.woff2") format("woff2");
}

@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/source-sans-3-600.woff2") format("woff2");
}

@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/source-sans-3-greek-400.woff2") format("woff2");
  unicode-range: U+0370-03FF, U+1F00-1FFF;
}

@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/source-sans-3-greek-600.woff2") format("woff2");
  unicode-range: U+0370-03FF, U+1F00-1FFF;
}

@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/source-serif-4-greek-400.woff2") format("woff2");
  unicode-range: U+0370-03FF, U+1F00-1FFF;
}

@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/source-serif-4-greek-500.woff2") format("woff2");
  unicode-range: U+0370-03FF, U+1F00-1FFF;
}

@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/source-serif-4-greek-600.woff2") format("woff2");
  unicode-range: U+0370-03FF, U+1F00-1FFF;
}

:root {
  --paper: #f4efe4;
  --paper-2: #ebe4d4;
  --card: #fbf7ef;
  --ink: #1c1714;
  --muted: #5c564c;
  --faint: #8a8174;
  --line: #d8d0c2;
  --oxide: #8c341c;
  --oxide-dark: #6d2614;
  --pine: #1c5c3e;
  --gold: #8a5a12;
  --blue: #1e4f86;
  --shadow: 0 1px 0 rgba(28, 23, 20, 0.04);
  --glow: rgba(140, 52, 28, 0.06);
  --serif: "Newsreader", "Source Serif 4", "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, serif;
  --sans: "Source Sans 3", "Segoe UI", sans-serif;
  --measure: 40rem;
  --wide: 52rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  color-scheme: light;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --paper: #12100e;
  --paper-2: #221c17;
  --card: #1c1916;
  --ink: #f6f0e6;
  --muted: #cbbba8;
  --faint: #a89886;
  --line: #3d362e;
  --oxide: #e7b2a3;
  --oxide-dark: #f3c7ba;
  --pine: #9dceb0;
  --gold: #e6c98a;
  --blue: #a9c7ea;
  --shadow: none;
  --glow: rgba(231, 178, 163, 0.08);
}

body {
  margin: 0;
  background:
    radial-gradient(1200px 480px at 50% -80px, var(--glow), transparent 60%),
    var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-x: clip;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--oxide-dark);
  text-underline-offset: 0.16em;
}

a:hover {
  color: var(--oxide);
}

:focus-visible {
  outline: 2px solid var(--oxide);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--ink);
  color: var(--paper);
  padding: 0.5rem 0.8rem;
  z-index: 10;
}

.skip:focus {
  top: 0.6rem;
}

.wrap {
  width: min(var(--wide), calc(100% - 2.4rem));
  margin-inline: auto;
}

.measure {
  width: min(var(--measure), 100%);
}

header.site {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0 0.35rem;
}

.langbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.8rem 1.2rem;
  padding: 0 0 0.7rem;
}

.langs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.9rem;
}

.langs a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
}

.langs a[aria-current="page"] {
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--oxide);
}

.theme {
  appearance: none;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.35rem 0.7rem;
  min-height: 44px;
  cursor: pointer;
}

.theme:hover {
  border-color: var(--oxide);
}

.schematic .rail { stroke: var(--line); stroke-width: 2; }
.schematic .places { stroke: var(--ink); stroke-width: 1.6; }
.schematic .places .hot,
.schematic .hands .hot { stroke: var(--oxide); stroke-width: 2; }
.schematic .hands { stroke: var(--ink); stroke-width: 1.6; }
.schematic .dots { fill: var(--oxide); }
.schematic .front { stroke: var(--blue); stroke-width: 1.6; stroke-dasharray: 4 4; }
.schematic .lab,
.schematic .frontlab {
  font-family: "Source Sans 3", sans-serif;
  font-size: 13px;
  font-weight: 600;
}
.schematic .lab { fill: var(--oxide); }
.schematic .frontlab { fill: var(--blue); }

.brand {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  font-size: 1.15rem;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
}

nav a:hover {
  color: var(--ink);
}

.hero {
  padding: 4.2rem 0 2.4rem;
}

.kicker {
  margin: 0 0 0.8rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--oxide);
}

h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.4rem, 6vw, 4.6rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
}

h1,
h2,
h3,
p,
li,
figcaption {
  overflow-wrap: break-word;
}

.lede {
  margin: 1.4rem 0 0;
  font-family: var(--serif);
  font-size: clamp(1.25rem, 2.2vw, 1.55rem);
  line-height: 1.4;
  font-weight: 400;
}

.byline {
  margin: 1.3rem 0 0;
  color: var(--muted);
}

.byline strong {
  color: var(--ink);
  font-weight: 600;
}

section {
  padding: 2.6rem 0;
  border-top: 1px solid var(--line);
}

h2 {
  margin: 0 0 0.9rem;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.8rem, 3vw, 2.35rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

h3 {
  margin: 0 0 0.4rem;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.35rem;
  letter-spacing: -0.015em;
}

p {
  margin: 0.75rem 0 0;
}

.intro {
  color: var(--ink);
}

.note {
  color: var(--muted);
  font-size: 0.95rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 1.05rem 1.1rem 1.15rem;
}

.card p {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.num {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 0.45rem;
}

.schematic {
  margin-top: 1.6rem;
  background: var(--card);
  border: 1px solid var(--line);
  padding: 1rem 1rem 0.7rem;
}

.schematic svg {
  display: block;
  width: 100%;
  height: auto;
}

.schematic figcaption,
figure.plot figcaption {
  margin-top: 0.55rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.ledger {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.4rem;
}

.ledger article {
  padding: 1rem 1rem 1.1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 3px solid var(--line);
}

.ledger article.tested { border-top-color: var(--pine); }
.ledger article.excluded { border-top-color: var(--oxide); }
.ledger article.open { border-top-color: var(--gold); }

.ledger h3 {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tested h3 { color: var(--pine); }
.excluded h3 { color: var(--oxide); }
.open h3 { color: var(--gold); }

.ledger ul {
  margin: 0.7rem 0 0;
  padding-left: 1.1rem;
  color: var(--ink);
}

.ledger li + li {
  margin-top: 0.45rem;
}

.example + .example {
  margin-top: 2.4rem;
}

figure.plot {
  margin: 1.1rem 0 0;
  background: #fff;
  color: #1c1714;
  border: 1px solid var(--line);
  padding: 0.8rem 0.8rem 0.7rem;
}

figure.plot figcaption {
  color: #5c564c;
}

figure.plot img {
  display: block;
  width: 100%;
}

.statrow {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-top: 1rem;
}

.stat {
  padding: 0.75rem 0.8rem;
  background: var(--paper-2);
}

.stat b {
  display: block;
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.stat span {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.papers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1.3rem;
}

.paper {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  padding: 1.15rem 1.15rem 1.2rem;
}

.tag {
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid #e2c98a;
  background: #f8f0dc;
  padding: 0.15rem 0.45rem;
}

.paper h3 {
  margin-top: 0.75rem;
}

.paper p {
  color: var(--muted);
  flex: 1;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  align-items: center;
  margin-top: 1rem;
}

.btn {
  display: inline-block;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.55rem 0.85rem;
}

.btn:hover {
  background: var(--oxide-dark);
  color: #fff;
}

footer.site {
  border-top: 1px solid var(--line);
  padding: 1.6rem 0 2.4rem;
  color: var(--muted);
  font-size: 0.92rem;
}

footer.site p {
  margin: 0.35rem 0 0;
}

@media (max-width: 800px) {
  .grid-3,
  .ledger,
  .papers,
  .statrow {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 1.8rem;
  }

  .bar,
  .langbar {
    flex-direction: column;
    align-items: flex-start;
  }

  nav a,
  .langs a,
  .btn,
  .theme {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  .langs {
    gap: 0.2rem 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
