:root {
  --bg: #e9e7e1;
  --ink: #1c1c1a;
  --muted: #8c8a80;
  --accent: #2f3e6e;
  --line: #b4b0c0;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Newsreader", Georgia, "Times New Roman", serif;
  line-height: 1.5;
  font-size: 18px;
}

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 11vh 28px 80px;
}

/* Masthead */
.masthead {
  max-width: 40rem;
}

.title {
  font-size: clamp(2.45rem, 7.4vw, 3.55rem);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.02em;
}

.subtitle {
  margin-top: 0.62em;
  font-size: clamp(1.22rem, 2.6vw, 1.42rem);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.35;
  color: var(--accent);
}

.meta-link {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(47, 62, 110, 0.35);
  transition: border-color 0.2s ease;
}

.meta-link:hover {
  border-color: var(--accent);
}

.accent {
  color: var(--accent);
  font-weight: 500;
}

.lede {
  margin-top: 48px;
  scroll-margin-top: 28px;
}

.lede-title {
  font-size: clamp(1.55rem, 3.6vw, 1.9rem);
  font-weight: 500;
  letter-spacing: -0.014em;
  line-height: 1.15;
  color: var(--ink);
  margin-bottom: 16px;
}

/* Compact index — not a chapter */
.contents {
  margin-top: 40px;
  padding-top: 36px;
  border-top: 1px solid var(--line);
}

.entry {
  display: grid;
  grid-template-columns: 1.7em minmax(0, 1fr);
  column-gap: 0.45em;
  align-items: baseline;
  padding: 7px 0;
  font-size: 1.14rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.35;
  text-decoration: none;
  color: var(--ink);
  transition: color 0.18s ease;
}

.entry:hover,
.entry:hover .num {
  color: var(--accent);
}

.entry .num {
  text-align: left;
  color: var(--ink);
}

.num {
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: lining-nums tabular-nums;
}

.issue {
  margin-top: 36px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.chapter {
  padding: 40px 0 8px;
  scroll-margin-top: 28px;
}

.chapter + .chapter {
  padding-top: 40px;
  border-top: 1px solid var(--line);
}

.chapter-title {
  font-size: clamp(1.7rem, 4.4vw, 2.2rem);
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.12;
  margin-bottom: 18px;
}

.chapter-title .num {
  padding-right: 0.46em;
  margin-right: 0.42em;
  border-right: 1px solid rgba(47, 62, 110, 0.42);
}

.prose {
  font-size: 1.06rem;
  line-height: 1.62;
  color: #34332f;
}

.prose p + p {
  margin-top: 1.05em;
}

.prose .dialogue {
  padding-left: 1.1em;
  font-style: italic;
}

.prose p.dialogue + p.dialogue {
  margin-top: 0.22em;
}

.signoff {
  margin-top: 1.8em;
  font-style: italic;
}

.signoff p + p {
  margin-top: 0.2em;
  color: var(--accent);
}

.chapter-body > .subchapter:first-of-type,
.chapter-body > .project:first-of-type,
.chapter-body > .note {
  margin-top: 0;
}

.subchapter {
  margin-top: 32px;
}

.subhead {
  font-size: clamp(1.18rem, 2.8vw, 1.4rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin-bottom: 10px;
  color: var(--accent);
}

.project {
  padding: 22px 0;
}

.project h3 {
  font-size: clamp(1.22rem, 3vw, 1.45rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin-bottom: 8px;
  color: var(--accent);
}

.note {
  margin: 0 0 22px;
  color: #45433d;
}

.group {
  margin-top: 28px;
}

.group-title {
  font-size: clamp(1.18rem, 2.8vw, 1.38rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}

.subgroup {
  margin-top: 18px;
}

.subgroup-title {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 8px;
}

.credits p {
  padding: 7px 0;
  font-size: 1.02rem;
  line-height: 1.45;
  color: #34332f;
}

.credits .break {
  height: 10px;
  padding: 0;
  border: none;
}

.footer {
  margin-top: 64px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.folio {
  color: var(--accent);
}

.footer a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.footer a:hover {
  color: var(--accent);
  border-bottom-color: rgba(47, 62, 110, 0.35);
}

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

@media (max-width: 560px) {
  .page { padding: 8vh 22px 60px; }
  .entry {
    padding: 6px 0;
    font-size: 1.08rem;
  }

  .footer {
    flex-direction: column;
    gap: 8px;
  }
}
