:root {
  --paper: #faf8f3;
  --ink: #151515;
  --muted: #55524c;
  --plum: #7a1f5c;
  --plum-soft: #f3e7ee;
  --rule: #dad5cb;
  --serif: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --sans: "Helvetica Neue", "Segoe UI", Arial, sans-serif;
  --measure: 38rem;
  --gutter: clamp(18px, 5vw, 48px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1.1875rem/1.7 var(--serif); }
[hidden] { display: none !important; }
a { color: var(--plum); text-underline-offset: 0.18em; }
h1, h2 { margin: 0; font-weight: 700; line-height: 1.15; }
p { margin: 0 0 1.15em; }
:focus-visible { outline: 2px solid var(--plum); outline-offset: 3px; }
.skip { position: absolute; left: var(--gutter); top: -80px; z-index: 30; background: var(--ink); color: var(--paper); padding: 0.6rem 1rem; font-family: var(--sans); }
.skip:focus { top: 14px; }

.progress { position: fixed; top: 0; left: 0; right: 0; height: 4px; z-index: 20; background: transparent; }
.progress span { display: block; height: 100%; width: 0; background: var(--plum); }

/* Masthead */
.masthead { text-align: center; padding: 34px var(--gutter) 14px; border-bottom: 1px solid var(--ink); margin: 0 auto; max-width: 1100px; }
.brand { font-size: clamp(2.2rem, 7vw, 3.6rem); font-weight: 700; color: var(--ink); text-decoration: none; letter-spacing: -0.02em; font-style: italic; }
.brand span { color: var(--plum); }
.masthead ul { display: flex; justify-content: center; gap: 1.75rem; margin: 0.75rem 0 0; padding: 0.6rem 0 0; list-style: none; border-top: 3px double var(--rule); }
.masthead nav a { font-family: var(--sans); font-size: 0.8rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink); text-decoration: none; }
.masthead nav a:hover { color: var(--plum); }

/* Essay */
.essay { max-width: 1100px; margin: 0 auto; padding: clamp(36px, 6vw, 72px) var(--gutter) 0; }
.essay > * { max-width: var(--measure); }
.essay-head { margin-bottom: 2.5rem; }
.kicker { font-family: var(--sans); font-size: 0.8rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--plum); margin-bottom: 0.8rem; }
.essay h1 { font-size: clamp(2.3rem, 6vw, 3.6rem); letter-spacing: -0.02em; margin-bottom: 1rem; }
.deck { font-size: 1.3rem; line-height: 1.5; color: var(--muted); font-style: italic; }
.byline { font-family: var(--sans); font-size: 0.85rem; color: var(--muted); border-top: 1px solid var(--rule); padding-top: 0.75rem; }

.essay section { margin-bottom: 2.4rem; }
.essay h2 { font-size: clamp(1.45rem, 3vw, 1.8rem); margin: 0 0 1rem; display: flex; align-items: baseline; gap: 0.75rem; }
.num { font-family: var(--sans); font-size: 0.8rem; letter-spacing: 0.14em; color: var(--plum); border: 1px solid var(--plum); border-radius: 999px; padding: 0.15rem 0.55rem; transform: translateY(-0.2em); flex: none; }
.first::first-letter { float: left; font-size: 4.4em; line-height: 0.82; padding: 0.06em 0.1em 0 0; color: var(--plum); font-weight: 700; }

.genesis { margin: 1.5rem 0 1.75rem; padding: 1.25rem 1.4rem; background: var(--ink); color: var(--paper); border-left: 6px solid var(--plum); }
.genesis p { margin: 0; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: clamp(0.95rem, 2.3vw, 1.15rem); line-height: 1.55; }
q { quotes: "“" "”"; font-style: italic; }

.questions { list-style: none; padding: 0; margin: 1.25rem 0 0; border-top: 1px solid var(--rule); }
.questions li { padding: 0.7rem 0 0.7rem 2rem; border-bottom: 1px solid var(--rule); position: relative; font-style: italic; }
.questions li::before { content: "?"; position: absolute; left: 0.3rem; color: var(--plum); font-weight: 700; font-style: normal; }

/* Sidenotes */
.ref { white-space: nowrap; }
.note-btn {
  font: 700 0.7rem/1 var(--sans); color: var(--plum); background: var(--plum-soft); border: 1px solid var(--plum);
  border-radius: 999px; min-width: 1.45rem; height: 1.45rem; padding: 0 0.3rem; margin-left: 0.15rem; vertical-align: 0.45em; cursor: pointer;
}
.note-btn[aria-expanded="true"] { background: var(--plum); color: #fff; }
.sidenote {
  display: none; font-family: var(--sans); font-size: 0.85rem; line-height: 1.5; color: var(--muted);
  background: var(--plum-soft); border-left: 3px solid var(--plum); padding: 0.6rem 0.8rem; margin: 0.6rem 0;
}
.sidenote.is-open { display: block; }
.sidenote b { color: var(--plum); margin-right: 0.3rem; }

@media (min-width: 1100px) {
  .essay > section > p, .essay > section > .questions { position: relative; }
  .note-btn { cursor: default; pointer-events: none; background: transparent; border-color: transparent; min-width: 0; padding: 0; }
  .sidenote, .sidenote.is-open {
    display: block; float: right; clear: right; width: 15rem; margin: 0.3rem -18.5rem 1rem 0;
    background: transparent; border-left: 2px solid var(--plum); padding: 0 0 0 0.75rem;
  }
}

/* Endnotes and about */
.endnotes, .about { max-width: 1100px; margin: 0 auto; padding: 0 var(--gutter); }
.endnotes > *, .about > * { max-width: var(--measure); }
.endnotes { border-top: 1px solid var(--ink); padding-top: 2rem; margin-top: 1rem; }
.endnotes h2, .about h2 { font-family: var(--sans); font-size: 0.85rem; letter-spacing: 0.16em; text-transform: uppercase; margin-bottom: 1rem; color: var(--plum); }
.endnotes ol { padding-left: 1.5rem; font-size: 1rem; color: var(--muted); }
.endnotes li { margin-bottom: 0.4rem; }
.about { padding-top: 2rem; padding-bottom: 3rem; }
.about p { font-size: 1.05rem; color: var(--muted); }

.site-footer { max-width: 1100px; margin: 0 auto; padding: 1.25rem var(--gutter) 2.5rem; border-top: 1px solid var(--ink); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem; font-family: var(--sans); font-size: 0.85rem; color: var(--muted); }
.site-footer p { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  .progress, .masthead nav, .note-btn { display: none; }
  .sidenote { display: inline; background: none; border: 0; padding: 0; font-size: 0.8em; }
}
