 :root {
  --ink: #11110f;
  --muted: #5f5a50;
  --faint: #e9e2d5;
  --paper: #fbfaf6;
  --panel: #fffef9;
  --rule: #cfc5b5;
  --red: #a83f2d;
  --blue: #24607a;
  --green: #4f7f56;
  --gold: #a56e1d;
  --shadow: 0 18px 46px rgba(50, 42, 31, 0.08);
}

* { box-sizing: border-box; }

html {
  background: var(--paper);
  color: var(--ink);
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 17px;
  line-height: 1.5;
}

body {
  margin: 0;
  background:
    linear-gradient(90deg, rgba(207, 197, 181, 0.16) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(180deg, rgba(207, 197, 181, 0.11) 1px, transparent 1px) 0 0 / 44px 44px,
    var(--paper);
}

a { color: var(--blue); text-underline-offset: 0.16em; }

.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 30px 28px 72px;
}

.topnav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 18px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.topnav div {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topnav a { color: var(--ink); text-decoration-color: var(--rule); }

header.hero {
  min-height: 72vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 44px;
  align-items: center;
  border-bottom: 1px solid var(--rule);
  padding: 34px 0 50px;
}

header.subhero {
  display: grid;
  grid-template-columns: minmax(0, 820px) minmax(210px, 290px);
  gap: 52px;
  padding: 52px 0 38px;
  border-bottom: 1px solid var(--rule);
}

.kicker, figcaption, .note-title, .label {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.kicker { margin: 0 0 22px; }

h1, h2, h3 {
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: 0;
  margin: 0;
}

h1 { font-size: clamp(3rem, 7.4vw, 7rem); max-width: 900px; }
h2 { font-size: clamp(2rem, 4vw, 4rem); margin-bottom: 20px; }
h3 { font-size: 1.42rem; margin-bottom: 10px; }
p { margin: 0 0 1.1rem; }

.lede {
  max-width: 760px;
  margin-top: 28px;
  font-size: 1.34rem;
  line-height: 1.4;
  color: #292724;
}

.proof-card, .diagram, .card, .table-wrap {
  border: 1px solid var(--rule);
  background: rgba(255, 254, 249, 0.86);
  border-radius: 4px;
  box-shadow: var(--shadow);
}

.proof-card, .card { padding: 22px; }

.proof-stack {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
}

.formula {
  font-size: 1.45rem;
  line-height: 1.25;
  margin: 16px 0;
  font-variant-numeric: lining-nums;
}

.metrics, .cards, .spines {
  display: grid;
  gap: 16px;
}

.metrics {
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  border: 1px solid var(--rule);
  background: var(--rule);
  margin-top: 26px;
  max-width: 820px;
}

.metric {
  background: rgba(255, 254, 249, 0.88);
  padding: 18px 16px;
  min-height: 118px;
}

.metric strong {
  display: block;
  font-size: 1.65rem;
  line-height: 1;
  margin-bottom: 10px;
  font-weight: 500;
}

.metric span, .card p, .spine p, .tile p { color: var(--muted); }

section {
  display: grid;
  grid-template-columns: minmax(0, 820px) minmax(210px, 300px);
  gap: 52px;
  padding: 62px 0;
  border-bottom: 1px solid var(--rule);
}

.full { grid-template-columns: 1fr; }
.body-copy { font-size: 1.05rem; }
.body-copy > p:first-of-type { font-size: 1.22rem; line-height: 1.42; }

.margin-notes {
  border-left: 1px solid var(--rule);
  padding-left: 22px;
  color: var(--muted);
  font-size: 0.92rem;
}

.diagram {
  padding: 20px;
  margin: 26px 0 10px;
  overflow: hidden;
}

.plot {
  padding: 16px;
}

.plot img {
  display: block;
  width: 100%;
  height: auto;
}

.evidence-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--rule);
  background: var(--rule);
  margin: 28px 0;
}

.evidence-strip div {
  background: rgba(255, 254, 249, 0.88);
  padding: 16px;
}

.evidence-strip strong {
  display: block;
  font-size: 1.45rem;
  line-height: 1;
  font-weight: 500;
  margin-bottom: 8px;
}

.evidence-strip span {
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.3;
}

svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.svg-label { fill: var(--ink); font-size: 13px; }
.svg-small { fill: var(--muted); font-size: 10.5px; }

.cards { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 30px; }
.card { min-height: 230px; display: flex; flex-direction: column; }
.card a { margin-top: auto; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.82rem; }

.card.wide {
  grid-column: span 2;
}

.spines { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 30px; }
.spine {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 20px;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.spine:nth-child(1) { border-top: 4px solid var(--blue); }
.spine:nth-child(2) { border-top: 4px solid var(--green); }
.spine:nth-child(3) { border-top: 4px solid var(--red); }

.num {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: var(--panel);
  background: var(--ink);
  display: grid;
  place-items: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
}

.guarantee {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--faint);
  font-size: 0.92rem;
  color: var(--ink);
}

.grid-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 28px 0;
}

.tile { border-top: 2px solid var(--ink); padding: 14px 0 0; }

.callout {
  border-left: 4px solid var(--blue);
  padding: 8px 0 8px 18px;
  margin: 28px 0;
  font-size: 1.18rem;
  line-height: 1.4;
}

.compact-list {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.compact-list li {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 10px;
}

.compact-list li::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink);
  margin-top: 0.55em;
}

.table-wrap { overflow-x: auto; margin-top: 24px; }
table { width: 100%; border-collapse: collapse; min-width: 760px; font-size: 0.94rem; }
th, td { text-align: left; vertical-align: top; padding: 14px 16px; border-bottom: 1px solid var(--faint); }
th {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  background: #f4efe5;
  font-weight: 500;
}
tr:last-child td { border-bottom: 0; }

.roadmap { display: grid; gap: 16px; margin-top: 28px; }
.roadmap-step {
  display: grid;
  grid-template-columns: 116px 1fr;
  gap: 20px;
  border-top: 1px solid var(--rule);
  padding-top: 18px;
}
.time { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--red); font-size: 0.86rem; }

.codeblock {
  background: #171612;
  color: #f7f0e6;
  border: 1px solid #2a261f;
  border-radius: 4px;
  padding: 18px;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.48;
  box-shadow: var(--shadow);
}

.sequence {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

.sequence-step {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 14px;
  align-items: start;
  padding: 14px 0;
  border-top: 1px solid var(--rule);
}

.sequence-step strong {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--red);
  font-size: 0.82rem;
}

footer {
  padding-top: 34px;
  color: var(--muted);
  font-size: 0.88rem;
  display: flex;
  justify-content: space-between;
  gap: 24px;
}

@media (max-width: 920px) {
  .page { padding: 22px 18px 54px; }
  .topnav { align-items: flex-start; flex-direction: column; }
  .topnav div { justify-content: flex-start; }
  header.hero, header.subhero, section { grid-template-columns: 1fr; gap: 26px; }
  header.hero { min-height: auto; }
  .margin-notes { border-left: 0; padding-left: 0; border-top: 1px solid var(--rule); padding-top: 18px; }
  .metrics, .cards, .spines, .grid-two, .evidence-strip { grid-template-columns: 1fr; }
  .card.wide { grid-column: auto; }
  .roadmap-step { grid-template-columns: 1fr; gap: 6px; }
  footer { flex-direction: column; }
}

@media print {
  body { background: #fff; }
  .page { max-width: none; padding: 16mm; }
  .proof-card, .diagram, .card, .spine, .table-wrap { box-shadow: none; }
  section { break-inside: avoid; }
}
