/* Plaintext — one stylesheet, no frameworks. */

:root {
  --bg: #fbfaf7;
  --surface: #f3f1ec;
  --text: #1b1b19;
  --muted: #66645e;
  --rule: #dedbd3;
  --accent: #8a3324;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --measure: 40rem;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151514;
    --surface: #1f1f1d;
    --text: #e6e3dc;
    --muted: #9a978f;
    --rule: #33322f;
    --accent: #e08a72;
  }
}

:root[data-theme="dark"] {
  --bg: #151514;
  --surface: #1f1f1d;
  --text: #e6e3dc;
  --muted: #9a978f;
  --rule: #33322f;
  --accent: #e08a72;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 1.5rem;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

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

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

.skip {
  position: absolute;
  left: -999rem;
}

.skip:focus {
  left: 1rem;
  top: 1rem;
  background: var(--bg);
  padding: 0.5rem 0.75rem;
  z-index: 10;
}

/* Layout */

.wrap {
  max-width: 68rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.site-header {
  border-bottom: 1px solid var(--rule);
}

.site-header .wrap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.1rem;
  padding-bottom: 1.1rem;
}

.brand {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.site-nav {
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
  font-family: var(--sans);
  font-size: 0.875rem;
}

.site-nav a {
  text-decoration: none;
  color: var(--muted);
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--text);
}

.theme-toggle {
  font: inherit;
  color: var(--muted);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.theme-toggle:hover {
  color: var(--text);
}

.site-footer {
  border-top: 1px solid var(--rule);
  margin-top: 5rem;
  padding: 2rem 0 3rem;
  font-family: var(--sans);
  font-size: 0.8125rem;
  color: var(--muted);
}

.site-footer p {
  margin: 0 0 0.4rem;
  max-width: var(--measure);
}

/* Reading progress */

.progress {
  position: fixed;
  inset: 0 auto auto 0;
  height: 2px;
  width: 0;
  background: var(--accent);
  z-index: 5;
}

/* Home */

.intro {
  max-width: var(--measure);
  padding: 4rem 0 2.5rem;
}

.intro h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
  line-height: 1.15;
  font-weight: 500;
  margin: 0 0 1rem;
  letter-spacing: -0.01em;
}

.intro p {
  color: var(--muted);
  margin: 0;
}

.series {
  border-top: 1px solid var(--rule);
  padding: 2.5rem 0 0;
  max-width: var(--measure);
}

.eyebrow {
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.5rem;
}

.series h2 {
  font-size: 1.6rem;
  font-weight: 500;
  line-height: 1.25;
  margin: 0 0 0.5rem;
}

.series > p {
  color: var(--muted);
  margin: 0 0 1.5rem;
}

.entries {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: entry;
}

.entries li {
  counter-increment: entry;
  border-top: 1px solid var(--rule);
  padding: 1.4rem 0;
  display: grid;
  grid-template-columns: 2.25rem 1fr;
}

.entries li::before {
  content: counter(entry, decimal-leading-zero);
  font-family: var(--sans);
  font-size: 0.8125rem;
  color: var(--muted);
  padding-top: 0.35rem;
}

.entries h3 {
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.3;
  margin: 0 0 0.35rem;
}

.entries h3 a {
  text-decoration: none;
}

.entries h3 a:hover {
  text-decoration: underline;
}

.entries p {
  margin: 0;
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.55;
}

.entries .meta {
  margin-top: 0.5rem;
}

.meta {
  font-family: var(--sans);
  font-size: 0.8125rem;
  color: var(--muted);
}

/* Article */

.article-grid {
  display: grid;
  grid-template-columns: minmax(0, var(--measure));
  gap: 0 4rem;
  padding-top: 3.5rem;
}

.article-head h1 {
  font-size: clamp(2rem, 5.5vw, 3rem);
  line-height: 1.12;
  font-weight: 500;
  letter-spacing: -0.015em;
  margin: 0 0 1.25rem;
}

.lede {
  font-size: 1.3rem;
  line-height: 1.5;
  color: var(--muted);
  margin: 0 0 1.5rem;
}

.article-head .meta {
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--rule);
  margin: 0;
}

.toc {
  font-family: var(--sans);
  font-size: 0.875rem;
  line-height: 1.45;
  border-bottom: 1px solid var(--rule);
  padding: 1.5rem 0;
}

.toc h2 {
  font-size: 0.75rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  margin: 0 0 0.75rem;
}

.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

.toc li {
  margin: 0.4rem 0;
}

.toc a {
  color: var(--muted);
  text-decoration: none;
}

.toc a:hover,
.toc a.active {
  color: var(--text);
}

@media (min-width: 64rem) {
  .article-grid {
    grid-template-columns: minmax(0, var(--measure)) 14rem;
  }

  .article-head,
  .prose,
  .article-foot {
    grid-column: 1;
  }

  .toc {
    grid-column: 2;
    grid-row: 2;
    align-self: start;
    position: sticky;
    top: 2rem;
    border: 0;
    padding: 2.5rem 0 0;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
  }
}

.prose {
  padding-top: 1rem;
}

.prose h2 {
  font-size: 1.6rem;
  font-weight: 500;
  line-height: 1.25;
  margin: 3.25rem 0 1rem;
  letter-spacing: -0.005em;
}

.prose h3 {
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.35;
  margin: 2.25rem 0 0.5rem;
}

.prose p {
  margin: 0 0 1.25rem;
}

.prose ul,
.prose ol {
  margin: 0 0 1.25rem;
  padding-left: 1.25rem;
}

.prose li {
  margin-bottom: 0.5rem;
}

.prose blockquote {
  margin: 1.75rem 0;
  padding-left: 1.25rem;
  border-left: 2px solid var(--accent);
  font-style: italic;
}

.prose blockquote footer {
  font-style: normal;
  font-family: var(--sans);
  font-size: 0.8125rem;
  color: var(--muted);
  margin-top: 0.5rem;
}

sup.ref {
  font-family: var(--sans);
  font-size: 0.68em;
  line-height: 0;
  margin-left: 0.1em;
}

sup.ref a {
  text-decoration: none;
  color: var(--accent);
}

/* Key facts */

.facts {
  background: var(--surface);
  padding: 1.5rem;
  margin: 2rem 0 2.5rem;
  font-family: var(--sans);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.facts h2 {
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  margin: 0 0 1rem;
}

.facts ul {
  margin: 0;
  padding-left: 1.1rem;
}

.facts li {
  margin-bottom: 0.6rem;
}

.facts li:last-child {
  margin-bottom: 0;
}

/* Callout */

.note {
  border: 1px solid var(--rule);
  padding: 1.1rem 1.25rem;
  margin: 2rem 0;
  font-family: var(--sans);
  font-size: 0.9375rem;
  line-height: 1.55;
}

.note strong:first-child {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.note p {
  margin: 0;
}

/* Timeline */

.timeline {
  list-style: none;
  margin: 1.5rem 0 2rem;
  padding: 0;
  font-size: 1rem;
  line-height: 1.55;
}

.timeline li {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 1rem;
  padding: 0.8rem 0;
  border-top: 1px solid var(--rule);
  margin: 0;
}

.timeline li:last-child {
  border-bottom: 1px solid var(--rule);
}

.timeline time,
.timeline .when {
  font-family: var(--sans);
  font-size: 0.8125rem;
  color: var(--muted);
  padding-top: 0.2rem;
}

/* Tables */

.table-scroll {
  overflow-x: auto;
  margin: 1.5rem 0 2rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: 0.875rem;
  line-height: 1.45;
}

caption {
  text-align: left;
  color: var(--muted);
  font-size: 0.8125rem;
  padding-bottom: 0.6rem;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.65rem 0.9rem 0.65rem 0;
  border-top: 1px solid var(--rule);
}

thead th {
  border-top: 0;
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

tbody tr:last-child td,
tbody tr:last-child th {
  border-bottom: 1px solid var(--rule);
}

tbody th {
  font-weight: 600;
}

@media (min-width: 40rem) {
  tbody th {
    white-space: nowrap;
  }
}

td.num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

code {
  font-family: ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace;
  font-size: 0.85em;
  background: var(--surface);
  padding: 0.1em 0.3em;
  overflow-wrap: anywhere;
}

table.chrono th {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* Glossary */

.glossary {
  margin: 1.5rem 0 2rem;
  font-size: 1rem;
  line-height: 1.55;
}

.glossary dt {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.9375rem;
  border-top: 1px solid var(--rule);
  padding-top: 0.8rem;
}

.glossary dd {
  margin: 0.15rem 0 0.8rem;
  color: var(--muted);
}

/* Sources and footer of article */

.sources {
  font-family: var(--sans);
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--muted);
  padding-left: 1.25rem;
  overflow-wrap: anywhere;
}

.sources li {
  margin-bottom: 0.6rem;
}

.sources li:target {
  color: var(--text);
}

.article-foot {
  border-top: 1px solid var(--rule);
  margin-top: 3.5rem;
  padding-top: 1.75rem;
}

.next {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  font-family: var(--sans);
  font-size: 0.875rem;
}

.next a {
  text-decoration: none;
  display: block;
  max-width: 18rem;
}

.next a span {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.next a:last-child {
  text-align: right;
  margin-left: auto;
}

/* In plain terms (newcomer summary) */

.brief {
  border-left: 2px solid var(--accent);
  padding: 0.1rem 0 0.1rem 1.25rem;
  margin: 2rem 0;
}

.brief h2 {
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.brief p {
  margin: 0 0 0.6rem;
}

.brief p:last-child {
  margin-bottom: 0;
}

/* Labels: evidence status and source grade */

.tag {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  line-height: 1;
  padding: 0.25rem 0.4rem;
  border: 1px solid currentColor;
  white-space: nowrap;
  vertical-align: 0.1em;
}

.tag.alleged {
  border-style: dashed;
  color: var(--accent);
}

.tag.observed {
  border-style: dotted;
  color: var(--muted);
}

.src-meta {
  display: block;
  margin-top: 0.3rem;
  font-family: var(--sans);
  font-size: 0.75rem;
  color: var(--muted);
}

/* Audience entry points (home) */

.doors {
  display: grid;
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  margin: 0 0 3rem;
  max-width: 62rem;
}

@media (min-width: 48rem) {
  .doors {
    grid-template-columns: repeat(3, 1fr);
  }
}

.doors a {
  display: block;
  background: var(--bg);
  padding: 1.4rem 1.4rem 1.5rem;
  text-decoration: none;
}

.doors a:hover {
  background: var(--surface);
  color: inherit;
}

.doors .eyebrow {
  color: var(--accent);
}

.doors strong {
  display: block;
  font-weight: 500;
  font-size: 1.25rem;
  line-height: 1.3;
  margin-bottom: 0.4rem;
}

.doors span {
  display: block;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--muted);
}

/* Link to the game (home) */

.play-cta {
  display: block;
  max-width: 62rem;
  margin: -1.5rem 0 3rem;
  padding: 1.4rem 1.4rem 1.5rem;
  border: 1px solid var(--accent);
  text-decoration: none;
}

.play-cta:hover {
  background: var(--surface);
  color: inherit;
}

.play-cta .eyebrow {
  color: var(--accent);
}

.play-cta strong {
  display: block;
  font-weight: 500;
  font-size: 1.25rem;
  line-height: 1.3;
  margin-bottom: 0.4rem;
}

.play-cta span {
  display: block;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--muted);
}

.reference-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 1rem;
  line-height: 1.5;
}

.reference-list li {
  border-top: 1px solid var(--rule);
  padding: 0.9rem 0;
}

.reference-list span {
  display: block;
  color: var(--muted);
  font-size: 0.9375rem;
}

/* Source register records */

.record {
  border-top: 1px solid var(--rule);
  padding: 1.25rem 0 0.5rem;
}

.record h3 {
  margin: 0 0 0.75rem;
}

.record-id {
  font-family: var(--sans);
  font-size: 0.75rem;
  color: var(--muted);
  margin-right: 0.4rem;
}

.record dl {
  display: grid;
  grid-template-columns: 6rem 1fr;
  gap: 0.35rem 1rem;
  margin: 0;
  font-family: var(--sans);
  font-size: 0.875rem;
  line-height: 1.5;
}

.record dt {
  color: var(--muted);
}

.record dd {
  margin: 0;
  overflow-wrap: anywhere;
}

/* Cite box */

.cite {
  font-family: var(--sans);
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--muted);
  margin: 0 0 1.75rem;
}

.cite strong {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  font-weight: 500;
  margin-bottom: 0.3rem;
}

.cite span {
  color: var(--text);
  user-select: all;
}

/* Plain page (about) */

.page {
  max-width: var(--measure);
  padding-top: 3.5rem;
}

.page h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 500;
  line-height: 1.15;
  margin: 0 0 1.5rem;
}

.page.wide {
  max-width: 48rem;
}

.page .lede {
  margin-bottom: 1rem;
}

.site-header .wrap,
.site-nav {
  flex-wrap: wrap;
  row-gap: 0.4rem;
}

@media (max-width: 30rem) {
  body {
    font-size: 1.0625rem;
  }

  .record dl {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .record dd {
    margin-bottom: 0.5rem;
  }

  .timeline li {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }

  .next {
    flex-direction: column;
    gap: 1.25rem;
  }

  .next a:last-child {
    text-align: left;
    margin-left: 0;
  }
}

@media print {
  .site-header,
  .site-footer,
  .toc,
  .progress,
  .play-cta,
  .next {
    display: none;
  }

  body {
    font-size: 11pt;
  }
}
