:root {
  --paper: #f1ede3;
  --paper-deep: #e5dfd2;
  --paper-light: #faf8f1;
  --ink: #18282c;
  --ink-soft: #64706e;
  --green: #294f45;
  --green-deep: #1d3b35;
  --rust: #b6573b;
  --rust-deep: #8e3e2a;
  --gold: #d5ae52;
  --line: #beb8aa;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.62;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .25;
  background-image: repeating-linear-gradient(0deg, transparent 0 7px, rgba(24,40,44,.025) 7px 8px);
  mix-blend-mode: multiply;
  z-index: 20;
}
a { color: inherit; text-underline-offset: .16em; }
a:hover { color: var(--rust-deep); }
button, input { font: inherit; }
button { color: inherit; }
.shell { width: min(100% - 3rem, 71rem); margin: 0 auto; }
.shell-wide { width: min(100% - 3rem, 79rem); margin: 0 auto; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }

.topbar {
  width: min(100% - 3rem, 79rem);
  margin: 0 auto;
  padding: 1.25rem 0 1.1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: .73rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.brand { text-decoration: none; font-weight: 700; }
.langsw { color: var(--ink-soft); }
.langsw a { text-decoration: none; }
.langsw a[aria-current="page"] { color: var(--rust-deep); font-weight: 700; }

.hero {
  padding: clamp(4rem, 9vw, 8rem) 0 3.5rem;
  border-bottom: 1px solid var(--line);
  background: radial-gradient(circle at 78% 27%, rgba(213,174,82,.17), transparent 28rem);
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(15rem, .82fr);
  gap: 2.5rem 5rem;
  align-items: center;
}
.kicker {
  margin: 0 0 1.25rem;
  color: var(--rust-deep);
  font-family: var(--mono);
  font-size: .69rem;
  font-weight: 700;
  letter-spacing: .12em;
  line-height: 1.45;
  text-transform: uppercase;
}
h1, h2, blockquote { font-family: var(--serif); font-weight: 400; }
h1 {
  max-width: 10ch;
  margin: 0;
  font-size: clamp(4rem, 9.8vw, 8.9rem);
  letter-spacing: -.075em;
  line-height: .82;
}
h1 em, h2 em { color: var(--rust); font-style: normal; }
.standfirst {
  max-width: 42rem;
  margin: 2rem 0 0;
  font-family: var(--serif);
  font-size: clamp(1.18rem, 2vw, 1.55rem);
  line-height: 1.35;
}
.hero-mark {
  position: relative;
  min-height: 20rem;
  transform: rotate(-7deg);
}
.hero-mark::before {
  content: "";
  position: absolute;
  left: 13%;
  right: 8%;
  top: 50%;
  height: 1px;
  background: var(--green);
  box-shadow: 0 -2.8rem 0 rgba(41,79,69,.18), 0 2.8rem 0 rgba(41,79,69,.18);
}
.ring-slice {
  position: absolute;
  display: flex;
  align-items: stretch;
  gap: .23rem;
  width: 80%;
  height: 4.9rem;
  padding: .55rem .6rem;
  border: 1px solid var(--green);
  background: #d5c7a8;
  box-shadow: .35rem .35rem 0 var(--green);
}
.ring-slice-a { top: 27%; left: 8%; }
.ring-slice-b { top: 53%; left: 19%; background: #c99a68; box-shadow: .35rem .35rem 0 var(--rust-deep); }
.ring-slice i { display: block; flex: 1; background: var(--rust); opacity: .84; }
.ring-slice i:nth-child(2) { flex: .43; background: var(--green); }
.ring-slice i:nth-child(3) { flex: .76; background: var(--gold); }
.ring-slice i:nth-child(4) { flex: .28; background: var(--green-deep); }
.ring-slice i:nth-child(5) { flex: .63; background: var(--rust-deep); }
.ring-slice i:nth-child(6) { flex: .35; background: var(--green); }
.mark-label {
  position: absolute;
  right: 4%;
  bottom: 7%;
  color: var(--green-deep);
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .12em;
}
.ledgerline {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
  padding-top: 2.2rem;
  border-top: 1px solid var(--line);
}
.ledgerline > div { min-width: 0; }
.ledgerline .n {
  display: block;
  color: var(--green-deep);
  font-family: var(--mono);
  font-size: clamp(1.05rem, 2.1vw, 1.5rem);
  font-weight: 700;
  letter-spacing: -.06em;
  line-height: 1.1;
}
.ledgerline .l { display: block; max-width: 17rem; margin-top: .55rem; color: var(--ink-soft); font-size: .82rem; line-height: 1.42; }

.alignment-section {
  padding: clamp(4rem, 8vw, 7rem) 0;
  color: var(--paper);
  background: var(--green);
}
.section-intro { max-width: 51rem; margin-bottom: 2.5rem; }
.section-intro.narrow { max-width: 46rem; }
.alignment-section .kicker, .mechanism-section .kicker { color: var(--gold); }
h2 {
  margin: 0;
  font-size: clamp(2.45rem, 5.2vw, 5rem);
  letter-spacing: -.065em;
  line-height: .93;
}
.section-intro p:last-child { max-width: 41rem; margin: 1.35rem 0 0; color: rgba(241,237,227,.76); font-size: 1.08rem; }
.lab-frame {
  max-width: 71rem;
  margin: 0 auto;
  padding: clamp(1rem, 2.3vw, 2rem);
  color: var(--ink);
  border: 1px solid rgba(241,237,227,.55);
  background: var(--paper);
  box-shadow: .8rem .8rem 0 rgba(16,37,31,.25);
}
.lab-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--green-deep);
  font-family: var(--mono);
  font-size: .69rem;
  font-weight: 700;
  letter-spacing: .1em;
}
.lab-head-lower { margin-top: 1.9rem; }
.lab-scroll { width: 100%; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-color: var(--rust) var(--paper-deep); }
.strip-track {
  --cell-size: clamp(22px, 3.5vw, 38px);
  --cell-gap: clamp(3px, .55vw, 7px);
  position: relative;
  width: calc(var(--cell-size) * 14 + var(--cell-gap) * 13);
  min-width: calc(var(--cell-size) * 14 + var(--cell-gap) * 13);
  height: 10rem;
  margin-top: .75rem;
  background: repeating-linear-gradient(90deg, transparent 0 calc(var(--cell-size) - 1px), rgba(41,79,69,.1) calc(var(--cell-size) - 1px) var(--cell-size), transparent var(--cell-size) calc(var(--cell-size) + var(--cell-gap)));
  border-top: 1px solid rgba(41,79,69,.25);
  border-bottom: 1px solid rgba(41,79,69,.25);
}
.ring-strip {
  position: absolute;
  top: .55rem;
  left: calc(var(--cell-size) * 2 + var(--cell-gap) * 2);
  display: grid;
  grid-template-columns: repeat(10, var(--cell-size));
  gap: var(--cell-gap);
  height: 7.1rem;
  transition: transform .35s cubic-bezier(.2,.8,.25,1);
}
.ring-cell {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 100%;
  min-width: 0;
}
.ring-bar {
  display: block;
  width: 72%;
  height: var(--bar-height);
  min-height: 8px;
  border: 1px solid rgba(24,40,44,.38);
  border-bottom: 0;
  border-radius: 2px 2px 0 0;
  background: var(--rust);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.11);
}
.reference-strip .ring-bar { background: var(--green-deep); }
.movable-strip .ring-bar { background: var(--rust); }
.ring-year, .ring-question {
  position: absolute;
  top: calc(100% + .2rem);
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: .63rem;
  line-height: 1;
  white-space: nowrap;
}
.ring-question { color: var(--rust-deep); font-size: .8rem; }
.lab-axis { display: flex; justify-content: space-between; margin: .75rem 0 0; color: var(--ink-soft); font-family: var(--mono); font-size: .63rem; letter-spacing: .08em; text-transform: uppercase; }
.alignment-controls {
  display: grid;
  grid-template-columns: auto minmax(15rem, 30rem) auto;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 2.7rem auto 1.4rem;
}
.step-button {
  width: 2.65rem;
  height: 2.65rem;
  border: 1px solid rgba(241,237,227,.6);
  border-radius: 50%;
  color: var(--paper);
  background: transparent;
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
}
.step-button:hover { background: rgba(241,237,227,.12); }
.range-wrap { display: grid; gap: .55rem; color: rgba(241,237,227,.74); font-family: var(--mono); font-size: .68rem; letter-spacing: .1em; text-align: center; text-transform: uppercase; }
input[type="range"] { width: 100%; accent-color: var(--gold); cursor: ew-resize; }
.alignment-result {
  display: grid;
  grid-template-columns: minmax(10rem, 14rem) 1fr auto;
  align-items: center;
  gap: 1.2rem;
  max-width: 71rem;
  margin: 0 auto;
  padding: 1.15rem 1.3rem;
  border-top: 1px solid rgba(241,237,227,.4);
  border-bottom: 1px solid rgba(241,237,227,.4);
}
.result-label, .result-correlation span { display: block; color: rgba(241,237,227,.58); font-family: var(--mono); font-size: .63rem; letter-spacing: .1em; text-transform: uppercase; }
.result-readout strong { display: block; color: var(--gold); font-family: var(--mono); font-size: 1.12rem; }
.result-message { font-family: var(--serif); font-size: 1.34rem; line-height: 1.18; }
.result-correlation { text-align: right; }
.result-correlation strong { display: block; color: var(--paper); font-family: var(--mono); font-size: 1rem; }
.alignment-result.is-match { border-color: var(--gold); }
.alignment-result.is-match .result-message { color: var(--gold); }
.alignment-result.is-match .result-readout strong { color: var(--paper); }
.caption { max-width: 61rem; margin: 1.4rem auto 0; color: rgba(241,237,227,.64); font-size: .8rem; line-height: 1.5; }
.fallback-table { margin-top: 1.5rem; padding: 1rem; color: var(--paper); border: 1px solid rgba(241,237,227,.4); }
.fallback-table p { margin-top: 0; }
table { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: .76rem; }
caption { margin-bottom: .7rem; color: rgba(241,237,227,.72); font-family: var(--sans); font-size: .8rem; text-align: left; }
th, td { padding: .42rem .55rem; border-bottom: 1px solid rgba(241,237,227,.2); text-align: right; }
th:first-child, td:first-child { text-align: left; }

.essay-section, .mechanism-section, .limits-section, .sources-section { padding: clamp(4.3rem, 9vw, 8rem) 0; }
.essay-section { border-bottom: 1px solid var(--line); }
.essay-grid { display: grid; grid-template-columns: minmax(0, .95fr) minmax(20rem, 1.05fr); gap: clamp(2.5rem, 8vw, 7rem); align-items: center; }
.prose { max-width: 43rem; }
.prose p { margin: 1.3rem 0 0; }
.prose strong { color: var(--rust-deep); font-weight: 700; }
.period-figure { margin: 0; }
.period-plot { padding: 1.3rem 1rem 1rem; border: 1px solid var(--line); background: var(--paper-light); }
.period-row { position: relative; display: grid; grid-template-columns: repeat(10, 1fr); gap: .35rem; min-height: 10.5rem; padding-top: 1.1rem; align-items: end; border-bottom: 1px solid var(--line); background: repeating-linear-gradient(0deg, transparent 0 2.05rem, rgba(41,79,69,.08) 2.05rem calc(2.05rem + 1px)); }
.period-row + .period-row { margin-top: 1.2rem; }
.period-row::before { content: attr(data-label); position: absolute; top: .25rem; left: 0; color: var(--green-deep); font-family: var(--mono); font-size: .64rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.period-row::after { content: ""; position: absolute; top: 0; bottom: 0; left: calc(30% + .1rem); border-left: 1px solid var(--rust); opacity: .8; }
.period-bar { position: relative; display: flex; min-width: 0; height: 100%; align-items: flex-end; justify-content: center; }
.period-bar i { display: block; width: 58%; min-height: 4px; background: var(--green); }
.period-bar:nth-child(n+4) i { background: var(--rust); }
.period-bar span { position: absolute; bottom: -.95rem; color: var(--ink-soft); font-family: var(--mono); font-size: .55rem; }
.period-key { display: flex; justify-content: space-between; margin-top: 1.7rem; color: var(--ink-soft); font-family: var(--mono); font-size: .62rem; text-transform: uppercase; }
figcaption { margin-top: .9rem; color: var(--ink-soft); font-size: .78rem; line-height: 1.45; }

.mechanism-section { color: var(--paper); background: var(--green-deep); }
.sequence { display: grid; grid-template-columns: 1fr minmax(2rem, 8rem) 1fr minmax(2rem, 8rem) 1fr; align-items: center; margin-top: 4rem; }
.sequence-item { display: grid; gap: .55rem; max-width: 14rem; }
.sequence-item strong { color: var(--gold); font-family: var(--serif); font-size: 1.75rem; font-weight: 400; line-height: 1; }
.sequence-item span:last-child { color: rgba(241,237,227,.7); font-size: .87rem; line-height: 1.45; }
.sequence-number { color: var(--rust); font-family: var(--mono); font-size: .7rem; font-weight: 700; letter-spacing: .12em; }
.sequence-line { height: 1px; background: var(--rust); }
blockquote { max-width: 43rem; margin: 5rem 0 0 auto; padding-left: 1.6rem; color: var(--paper); border-left: 2px solid var(--gold); font-size: clamp(1.65rem, 3.6vw, 3.2rem); line-height: 1.05; }

.limits-section { background: var(--paper-deep); }
.limits-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(15rem, .55fr); gap: clamp(3rem, 9vw, 9rem); align-items: start; }
.limit-note { margin-top: 1rem; padding: 1.6rem 1.7rem; border: 1px solid var(--line); background: rgba(250,248,241,.55); }
.limit-mark { display: block; color: var(--rust); font-family: var(--serif); font-size: 4rem; line-height: .65; }
.limit-note p { margin: 1.3rem 0 0; font-size: .95rem; }
.limit-note strong { color: var(--green-deep); font-family: var(--mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; }

.sources-section { padding-bottom: 5rem; }
.sources-section h2 { max-width: 15ch; }
.source-ledger { margin-top: 3rem; border-top: 1px solid var(--line); }
.source-row { display: grid; grid-template-columns: 10rem minmax(0, 1fr); gap: 1.5rem; padding: 1.25rem 0; border-bottom: 1px solid var(--line); }
.source-row p { max-width: 50rem; margin: 0; font-size: .92rem; }
.source-label { color: var(--rust-deep); font-family: var(--mono); font-size: .67rem; font-weight: 700; letter-spacing: .1em; line-height: 1.4; text-transform: uppercase; }
.source-meta { margin: 1.5rem 0 0; color: var(--ink-soft); font-family: var(--mono); font-size: .7rem; }
.site-footer { padding: 1.2rem 0 2rem; border-top: 1px solid var(--line); color: var(--ink-soft); font-family: var(--mono); font-size: .68rem; }
.site-footer .shell { display: flex; justify-content: space-between; gap: 1rem; }
.totop { display: grid; width: 2.75rem; height: 2.75rem; margin: 1rem auto 0; place-items: center; color: var(--paper); border: 1px solid var(--green); border-radius: 50%; background: var(--green); font-family: var(--mono); text-decoration: none; }
.has-js .totop { position: fixed; right: 1.2rem; bottom: calc(var(--footer-height, 0px) + 1rem); margin: 0; opacity: 0; pointer-events: none; transform: translateY(.45rem); transition: opacity .2s ease, transform .2s ease; z-index: 25; }
.has-js .totop.is-visible { opacity: .88; pointer-events: auto; transform: translateY(0); }
.totop:hover { color: var(--paper); background: var(--rust-deep); }

.no-js .alignment-controls, .no-js .alignment-result { display: none; }
.no-js .lab-frame { display: none; }
.no-js .fallback-table { display: block; }
.fallback-table { display: none; }

@media (max-width: 760px) {
  .shell, .shell-wide, .topbar { width: min(100% - 2rem, 71rem); }
  .topbar { padding-top: 1rem; }
  .hero { padding-top: 3.7rem; }
  .hero-grid { grid-template-columns: 1fr; gap: 2rem; }
  h1 { font-size: clamp(3.9rem, 19vw, 6.8rem); }
  .standfirst { margin-top: 1.55rem; font-size: 1.2rem; }
  .hero-mark { min-height: 13rem; width: min(100%, 25rem); margin: 0 auto; transform: rotate(-5deg); }
  .ledgerline { grid-template-columns: 1fr; gap: 1.1rem; padding-top: 1.7rem; }
  .ledgerline .l { max-width: 24rem; }
  .alignment-section, .essay-section, .mechanism-section, .limits-section, .sources-section { padding: 4.2rem 0; }
  h2 { font-size: clamp(2.65rem, 12.5vw, 4rem); }
  .section-intro { margin-bottom: 1.9rem; }
  .section-intro p:last-child { font-size: 1rem; }
  .lab-frame { padding: 1rem .75rem; box-shadow: .45rem .45rem 0 rgba(16,37,31,.25); }
  .alignment-controls { grid-template-columns: auto minmax(0, 1fr) auto; gap: .65rem; margin-top: 2.2rem; }
  .alignment-result { grid-template-columns: 1fr auto; gap: .8rem; padding: 1rem .2rem; }
  .result-message { grid-column: 1 / -1; grid-row: 1; padding-bottom: .75rem; font-size: 1.2rem; }
  .result-readout { grid-column: 1; grid-row: 2; }
  .result-correlation { grid-column: 2; grid-row: 2; }
  .essay-grid, .limits-grid { grid-template-columns: 1fr; gap: 2.8rem; }
  .period-figure { width: 100%; }
  .period-plot { padding-left: .55rem; padding-right: .55rem; }
  .sequence { display: block; margin-top: 3rem; }
  .sequence-item { max-width: 24rem; }
  .sequence-line { width: 1px; height: 2.1rem; margin: .9rem 0 .9rem .45rem; }
  blockquote { margin-top: 3.7rem; font-size: 2.1rem; }
  .source-row { grid-template-columns: 1fr; gap: .45rem; }
  .site-footer .shell { display: grid; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .001ms !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
}
