@font-face {
  font-family: "Source Serif 4";
  src: url("fonts/source-serif-4-latin-wght-normal.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
}

@font-face {
  font-family: "Source Serif 4";
  src: url("fonts/source-serif-4-latin-wght-italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 200 900;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --paper: #f5f1e8;
  --ink: #26241f;
  --muted: #6d6960;
  --rule: #8a857a;
  --accent: #7a2e2e;
  --reader-size: 1.125rem;
  --measure: 34em;
  --wide: 68rem;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  color: var(--ink);
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  line-height: 1.6;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}

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

a:hover {
  text-decoration-thickness: 2px;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

button {
  font: inherit;
}

.skip-link {
  position: fixed;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 20;
  padding: 0.45rem 0.65rem;
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header,
.site-footer,
.page-shell,
.reading-shell,
.evidence-shell {
  width: min(100% - 2rem, var(--wide));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.25rem;
  border-bottom: 1px solid var(--rule);
}

.site-name,
.eyebrow,
.section-label,
.metadata,
.quiet-nav,
.font-controls,
.source-label {
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.site-name {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
}

.quiet-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1rem;
  letter-spacing: 0.08em;
}

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

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  margin-top: 5rem;
  padding-block: 1.25rem 2.5rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.88rem;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: var(--accent);
}

.landing {
  display: grid;
  min-height: 100svh;
  place-items: center;
  padding: 2rem 1rem;
}

.landing-card {
  width: min(100%, 40rem);
  padding-block: clamp(1rem, 4vw, 3rem);
  text-align: center;
}

.landing-card .eyebrow {
  margin: 0 0 2.75rem;
  color: var(--muted);
}

.landing-card h1 {
  margin: 0;
  font-size: clamp(2.55rem, 10vw, 5.25rem);
  font-style: italic;
  font-weight: 430;
  letter-spacing: -0.035em;
  line-height: 0.98;
}

.landing-card .subtitle {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.landing-premise {
  max-width: 28rem;
  margin: 1.35rem auto 0;
  font-size: clamp(1.05rem, 2.5vw, 1.25rem);
  line-height: 1.45;
}

.landing-card blockquote {
  margin: clamp(2.5rem, 7vw, 3.5rem) 0;
  font-size: clamp(1.15rem, 3vw, 1.45rem);
  line-height: 1.55;
}

.landing-entry {
  margin: 0 auto 2.25rem;
}

.landing-entry h2,
.entry-time {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.entry-time {
  margin-top: 0.2rem;
  color: var(--muted);
  font-weight: 500;
}

.entry-list {
  margin-top: 1rem;
  border-top: 1px solid var(--rule);
}

.entry-list a {
  display: flex;
  min-height: 3.25rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--rule);
  color: var(--ink);
  text-align: left;
  text-decoration: none;
}

.entry-list a:hover span {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.entry-list small {
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

.enter-link {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  margin-bottom: 2.5rem;
  padding-block: 0.2rem;
  font-size: 1.05rem;
  font-weight: 650;
}

.enter-link span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
}

.disclosure {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.disclosure a {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  color: inherit;
  vertical-align: middle;
}

.page-shell,
.evidence-shell {
  padding-block: clamp(4rem, 10vw, 8rem) 1rem;
}

.page-intro {
  max-width: 44rem;
  margin-bottom: clamp(3rem, 7vw, 5rem);
}

.page-intro h1,
.colophon h1 {
  max-width: 13ch;
  margin: 0.35rem 0 1.25rem;
  font-size: clamp(1.75rem, 5vw, 3.25rem);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.08;
}

.page-intro blockquote {
  max-width: 34em;
  margin: 2rem 0 0;
  color: var(--muted);
  font-style: italic;
}

.archive-list {
  max-width: 48rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: archive;
  border-top: 1px solid var(--rule);
}

.archive-list li {
  counter-increment: archive;
  display: grid;
  grid-template-columns: 3.4rem 1fr;
  gap: 0.5rem;
  padding-block: 0.85rem;
  border-bottom: 1px solid var(--rule);
}

.archive-list li::before {
  content: counter(archive, upper-roman) ".";
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
}

.archive-list a {
  display: flex;
  min-height: 2.75rem;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
}

.archive-list a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.archive-links {
  display: flex;
  gap: 1.25rem;
  margin-top: 2.5rem;
}

.archive-links a,
.quiet-nav a,
.source-links a {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
}

.site-footer a,
.continue-prompt a,
.end-note a,
.colophon a {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  vertical-align: middle;
}

.reading-toolbar {
  position: sticky;
  top: 0;
  z-index: 5;
  border-bottom: 1px solid var(--rule);
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: blur(8px);
}

.reading-toolbar-inner {
  display: flex;
  width: min(100% - 2rem, var(--wide));
  margin-inline: auto;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.65rem;
}

.reading-toolbar a {
  color: var(--ink);
  font-size: 0.9rem;
}

.font-controls {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--muted);
  letter-spacing: 0.05em;
}

.font-controls button,
.continue-prompt button {
  border: 1px solid var(--accent);
  border-radius: 2px;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
}

.font-controls button {
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0.25rem;
}

.continue-prompt {
  display: flex;
  width: min(100% - 2rem, var(--measure));
  margin: 1rem auto 0;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0.9rem;
  border-block: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.95rem;
}

.continue-prompt[hidden] {
  display: none;
}

.continue-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.65rem;
}

.continue-prompt button {
  min-height: 2.75rem;
  padding: 0.4rem 0.65rem;
}

.reading-shell {
  max-width: var(--measure);
  padding-block: clamp(3rem, 9vw, 7rem) 1rem;
  font-size: var(--reader-size);
}

.reading-title {
  margin: 0 0 7rem;
  font-size: clamp(2.2rem, 9vw, 4.75rem);
  font-style: italic;
  font-weight: 430;
  letter-spacing: -0.035em;
  line-height: 1;
}

.story-section {
  min-height: 12rem;
  scroll-margin-top: 5rem;
}

.story-section + .story-section {
  margin-top: 6rem;
}

.story-section h2 {
  margin: 0 0 2.5rem;
  color: var(--muted);
  font-size: 0.8em;
  font-weight: 650;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.story-section p {
  margin: 0 0 1.25em;
}

.story-section:not(:last-of-type)::after {
  display: block;
  width: 100%;
  margin-top: 5rem;
  border-top: 1px solid var(--rule);
  content: "";
}

.document {
  overflow-x: auto;
  margin: 2rem 0;
  padding: 1.25rem;
  border: 1px solid var(--rule);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82em;
  white-space: pre-wrap;
}

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

.end-note {
  margin-top: 5rem;
  font-size: 1rem;
}

.evidence-shell {
  max-width: 72rem;
}

.evidence-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.evidence-table th,
.evidence-table td {
  padding: 1.15rem 1rem 1.35rem 0;
  border-top: 1px solid var(--rule);
  vertical-align: top;
  text-align: left;
}

.evidence-table th {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.evidence-table td:first-child,
.evidence-table th:first-child {
  width: 35%;
  padding-right: 2.5rem;
}

.evidence-table p {
  margin: 0;
}

.source-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  margin-top: 0.6rem;
  font-size: 0.9rem;
}

.source-links a::after {
  content: " ↗";
}

.characters-note {
  max-width: 46rem;
  margin-top: 4rem;
  font-style: italic;
}

.colophon {
  max-width: 42rem;
}

.colophon p {
  margin: 0 0 1.5rem;
  font-size: 1.08rem;
}

.colophon strong {
  font-weight: 700;
}

@media (max-width: 42rem) {
  .site-header {
    align-items: flex-start;
  }

  .quiet-nav {
    justify-content: flex-end;
    font-size: 0.7rem;
  }

  .archive-list li {
    grid-template-columns: 2.7rem 1fr;
  }

  .continue-prompt {
    align-items: flex-start;
  }

  .evidence-table,
  .evidence-table tbody,
  .evidence-table tr,
  .evidence-table td {
    display: block;
    width: 100%;
  }

  .evidence-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .evidence-table tr {
    padding-block: 1rem;
    border-top: 1px solid var(--rule);
  }

  .evidence-table td,
  .evidence-table td:first-child {
    width: 100%;
    padding: 0;
    border: 0;
  }

  .evidence-table td + td {
    margin-top: 0.85rem;
  }

  .evidence-table td::before {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 650;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  .evidence-table td:first-child::before {
    content: "In the story";
  }

  .evidence-table td:last-child::before {
    content: "In the record";
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1c1b18;
    --ink: #d8d3c8;
    --muted: #aaa59b;
    --rule: #68645c;
  }

  a,
  .site-footer a {
    color: var(--ink);
    text-decoration-color: var(--accent);
    text-decoration-thickness: 2px;
  }

  .font-controls button,
  .continue-prompt button {
    background: var(--accent);
    color: #f5f1e8;
  }
}

@media print {
  :root {
    --paper: #ffffff;
    --ink: #000000;
    --muted: #333333;
    --rule: #777777;
  }

  html,
  body {
    background: #ffffff;
    color: #000000;
  }

  .site-header,
  .site-footer,
  .reading-toolbar,
  .continue-prompt {
    display: none;
  }

  .reading-shell {
    width: 100%;
    max-width: none;
    padding: 0;
  }
}
