:root {
  color-scheme: light;
  --ink: #13201c;
  --muted: #59665f;
  --paper: #f3f0e8;
  --panel: #fbfaf6;
  --line: #d2cec2;
  --line-dark: #394842;
  --green: #185c45;
  --green-soft: #dbe9df;
  --amber: #7b4613;
  --amber-soft: #f1e0c8;
  --blue: #174f70;
  --accent: #c85532;
  --dark: #14211d;
  --max: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.58;
  text-rendering: optimizeLegibility;
}

a { color: var(--blue); text-underline-offset: 0.18em; }
a:hover { color: var(--accent); }
a:focus-visible, button:focus-visible { outline: 3px solid #f3a183; outline-offset: 4px; }

.skip-link { position: fixed; z-index: 100; top: 0.75rem; left: 0.75rem; padding: 0.6rem 0.85rem; color: #fff; background: var(--dark); transform: translateY(-180%); }
.skip-link:focus { transform: translateY(0); }

.shell { width: min(calc(100% - 2rem), var(--max)); margin: 0 auto; }

.site-header {
  position: relative;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: rgba(243, 240, 232, 0.96);
}

.nav {
  min-height: 4.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.4rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  text-decoration: none;
}

.brand-mark { display: grid; width: 2.1rem; height: 2.1rem; place-items: center; border: 1px solid currentColor; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.68rem; letter-spacing: 0; }

.nav-links { display: flex; flex-wrap: wrap; gap: 1.1rem; }
.nav-links a { color: var(--muted); font-size: 0.92rem; text-decoration: none; }
.nav-links a:hover { color: var(--accent); }
.nav-links .nav-source { padding-left: 1.1rem; border-left: 1px solid var(--line); color: var(--ink); font-weight: 700; }

main { padding: 0; }
.page-shell { padding-top: clamp(3.5rem, 7vw, 6.5rem); padding-bottom: clamp(4.5rem, 8vw, 7rem); }

.eyebrow {
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1, h2, h3 {
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.08;
  letter-spacing: -0.025em;
}

h1 { max-width: 15ch; margin: 0.35rem 0 1.2rem; font-size: clamp(3rem, 7vw, 6.1rem); }
h2 { margin: 0 0 1.2rem; font-size: clamp(2rem, 4vw, 3.7rem); }
h3 { margin: 0 0 0.55rem; font-size: 1.3rem; }
p { margin: 0 0 1rem; }

.lede { max-width: 58rem; color: var(--muted); font-size: clamp(1.08rem, 2.2vw, 1.35rem); }
.hero { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(18rem, 0.55fr); gap: clamp(3rem, 8vw, 8rem); align-items: end; padding-top: clamp(4rem, 9vw, 8rem); padding-bottom: clamp(5rem, 9vw, 8rem); }
.hero-section { overflow: hidden; background: linear-gradient(90deg, transparent 0, transparent calc(100% - 1px)); }
.hero-copy h1 { max-width: 11ch; }
.hero-copy h1 span { display: block; color: var(--accent); font-style: italic; font-weight: 400; }
.hero-proposition { margin: 1.5rem 0 0.6rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: clamp(1rem, 2vw, 1.28rem); font-weight: 700; }
.hero-note { position: relative; padding: 1.5rem 0 1.5rem 1.5rem; border-left: 1px solid var(--ink); }
.hero-note::before { content: ""; position: absolute; top: 0; left: -0.28rem; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--accent); }
.hero-note p:not(.note-label) { max-width: 15ch; margin: 2rem 0; font-family: Georgia, serif; font-size: clamp(1.6rem, 3vw, 2.4rem); line-height: 1.15; }
.hero-note > span, .note-label { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 2rem; }

.button {
  display: inline-flex;
  align-items: center;
  min-height: 2.8rem;
  gap: 1.2rem;
  justify-content: space-between;
  padding: 0.72rem 1.05rem;
  border: 1px solid var(--ink);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.button.primary { color: #fff; background: var(--ink); }
.button:hover { color: var(--accent); border-color: var(--accent); }
.button.primary:hover { color: #fff; background: var(--accent); }

.section-head { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 1.5rem; }
.section-head p { max-width: 38rem; color: var(--muted); }

.story-section, .method-section, .history-section, .cases-section, .final-cta { padding: clamp(4.5rem, 9vw, 8rem) 0; }
.story-dark { color: #eef1ec; background: var(--dark); }
.story-dark .eyebrow { color: #f3a183; }
.story-dark code { color: #fff; background: #273731; }
.story-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(22rem, 0.75fr); gap: clamp(3rem, 8vw, 8rem); align-items: center; }
.story-grid h2 { max-width: 12ch; }
.story-lede { max-width: 36rem; color: #bcc7c0; font-size: 1.18rem; }
.clarifier { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 1.3rem; margin-top: 2.5rem; padding-top: 1.4rem; border-top: 1px solid var(--line-dark); }
.clarifier strong { color: #fff; font-family: Georgia, serif; font-size: 1.15rem; }
.clarifier span { color: #bcc7c0; }
.finding-card { padding: clamp(1.4rem, 4vw, 2.4rem); border: 1px solid #53615c; background: #192823; box-shadow: 1rem 1rem 0 #0e1915; }
.finding-label, .record-number { color: var(--accent); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.finding-card dl { margin: 1.5rem 0 0; }
.finding-card dl div { display: grid; grid-template-columns: 5.5rem 1fr; gap: 1rem; padding: 0.9rem 0; border-top: 1px solid var(--line-dark); }
.finding-card dt { color: #92a099; font-size: 0.78rem; text-transform: uppercase; }
.finding-card dd { margin: 0; overflow-wrap: anywhere; }
.record-links { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1.2rem; }
.record-links a { color: #fff; font-weight: 700; }

.method-section { background: var(--panel); }
.section-intro { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 1rem 4rem; align-items: end; margin-bottom: 3rem; }
.section-intro .eyebrow { grid-column: 1 / -1; }
.section-intro h2, .section-intro p { margin-bottom: 0; }
.section-intro p { max-width: 40rem; color: var(--muted); }
.method-flow { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); }
.flow-step { position: relative; min-height: 15rem; padding: 1.5rem; border-right: 1px solid var(--line); background: #f8f6f0; }
.flow-step:last-child { border-right: 0; }
.flow-step::after { content: "→"; position: absolute; z-index: 2; top: 50%; right: -0.75rem; display: grid; width: 1.5rem; height: 1.5rem; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); background: var(--panel); font-size: 0.8rem; }
.flow-step:last-child::after { display: none; }
.flow-step > span { color: var(--accent); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.72rem; }
.flow-step h3 { margin-top: 3.8rem; font-size: 1.65rem; }
.flow-step p { color: var(--muted); font-size: 0.92rem; }
.method-caption { margin-top: 1rem; color: var(--muted); font-size: 0.88rem; text-align: right; }
.method-flow.compact { margin: 3rem 0; }
.method-flow.compact .flow-step { min-height: 12rem; }
.method-flow.compact .flow-step h3 { margin-top: 2rem; }

.history-section { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.history-grid { display: grid; grid-template-columns: minmax(18rem, 0.75fr) minmax(0, 1.25fr); gap: clamp(3rem, 8vw, 8rem); }
.history-heading { align-self: start; position: sticky; top: 2rem; }
.history-heading h2 { max-width: 11ch; }
.history-pull { margin-top: 3rem; color: var(--accent); font-family: Georgia, serif; font-size: clamp(1.5rem, 3vw, 2.1rem); font-style: italic; }
.timeline > div:not(.timeline-links) { position: relative; padding: 0 0 2.4rem 4rem; border-left: 1px solid var(--line); }
.timeline > div:not(.timeline-links)::before { content: ""; position: absolute; top: 0.45rem; left: -0.28rem; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--accent); }
.timeline > div > span { position: absolute; left: 1.2rem; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.75rem; }
.timeline h3 { font-size: 1.5rem; }
.timeline p { color: var(--muted); }
.timeline-links { display: flex; flex-wrap: wrap; gap: 1.5rem; padding-left: 4rem; }
.timeline-links a { font-weight: 700; }

.cases-section { background: #e9e6dd; }
.case-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.case-card {
  min-height: 21rem;
  display: flex;
  flex-direction: column;
  padding: clamp(1.25rem, 3vw, 1.8rem);
  border: 1px solid var(--line);
  background: var(--panel);
  transition: border-color 160ms ease, transform 160ms ease;
}
.case-card:hover { border-color: var(--ink); transform: translateY(-2px); }
.case-card:first-child { grid-column: span 2; min-height: 18rem; }
.case-card-top { display: flex; justify-content: space-between; gap: 1rem; align-items: start; }
.case-card .surface { color: var(--muted); font-size: 0.83rem; }
.case-object { margin: 2.3rem 0 0.35rem; color: var(--muted); font-size: 0.82rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.case-card h3 { max-width: 26ch; font-size: clamp(1.45rem, 3vw, 2.1rem); }
.case-meta { display: flex; flex-wrap: wrap; gap: 1.5rem; margin: auto 0 1.4rem; padding-top: 2rem; }
.case-meta div { min-width: 5rem; }
.case-meta dt { color: var(--muted); font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; }
.case-meta dd { margin: 0.2rem 0 0; }

.status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 0.28rem 0.58rem;
  border-radius: 999px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: lowercase;
}
.status > span { width: 0.42rem; height: 0.42rem; margin-right: 0.4rem; border-radius: 50%; background: currentColor; }
.status.demonstrated { color: var(--green); background: var(--green-soft); }
.status.not-demonstrated { color: var(--amber); background: var(--amber-soft); }

.prose { max-width: 58rem; }
.prose h2 { margin-top: 3rem; font-size: 2rem; }
.prose li { margin-bottom: 0.45rem; }
.prose > .method-flow { width: min(1100px, calc(100vw - 2rem)); }

.case-hero { max-width: 68rem; margin-bottom: 3rem; }
.case-hero h1 { max-width: none; font-size: clamp(2.4rem, 6vw, 4.6rem); }
.case-hero .claim { max-width: 48rem; color: var(--muted); font-size: 1.25rem; }
.case-kicker { margin: 1.5rem 0 0.4rem; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.case-result-line { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; color: var(--muted); }
.listing-hero h1 { max-width: 12ch; }

.record-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.record-section { padding: clamp(1.4rem, 3vw, 2rem); border-top: 2px solid var(--ink); background: var(--panel); }
.record-section.wide { grid-column: span 2; }
.record-section h2 { font-size: 1.8rem; }
.record-lede { max-width: 58rem; font-family: Georgia, serif; font-size: 1.35rem; }
.record-section p:last-child, .record-section ul:last-child { margin-bottom: 0; }
.record-section ul { padding-left: 1.2rem; }
.record-section li { margin-bottom: 0.45rem; }
.envelope-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2rem 3rem; }
.envelope-grid h3 { padding-bottom: 0.6rem; border-bottom: 1px solid var(--line); }

code {
  padding: 0.12rem 0.3rem;
  background: #ece8dc;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.86em;
  overflow-wrap: anywhere;
}

.source-link { display: flex; justify-content: space-between; gap: 1rem; padding-top: 0.9rem; border-top: 1px solid var(--line); font-weight: 700; text-decoration: none; }
.source-link.inline { display: inline-flex; border-top: 0; }
.quiet { color: var(--muted); }

.final-cta { color: #fff; background: var(--accent); }
.final-cta .eyebrow { color: #2c1a14; }
.final-cta-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: end; }
.final-cta h2 { margin: 0; }
.final-cta p { max-width: 34rem; }
.button.light { color: var(--ink); border-color: #fff; background: #fff; }
.text-link { align-self: center; color: #fff; font-weight: 700; }
.request-sources { display: grid; grid-template-columns: repeat(4, 1fr); margin: 2.5rem 0 3rem; border: 1px solid var(--line); }
.request-sources span { padding: 1rem; border-right: 1px solid var(--line); text-align: center; }
.request-sources span:last-child { border-right: 0; }
.error-page { min-height: 58vh; }

.site-footer { padding: 3rem 0 4rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.9rem; }
.footer-grid { display: flex; justify-content: space-between; gap: 2rem; }
.footer-grid > div:last-child { text-align: right; }
.footer-grid p { margin: 0.4rem 0 0; }
.footer-brand { color: var(--ink); }
.site-footer a { color: inherit; }

@media (max-width: 720px) {
  .nav { align-items: flex-start; flex-direction: column; padding: 1rem 0; }
  .nav-links { gap: 0.75rem 1rem; }
  .nav-links .nav-source { padding-left: 0; border-left: 0; }
  .hero, .story-grid, .section-intro, .history-grid, .case-grid, .record-grid, .final-cta-inner { grid-template-columns: 1fr; }
  .hero { gap: 3rem; }
  .hero-note { max-width: 24rem; }
  .clarifier { grid-template-columns: 1fr; }
  .method-flow { grid-template-columns: 1fr; }
  .flow-step { min-height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .flow-step:last-child { border-bottom: 0; }
  .flow-step::after { top: auto; right: 50%; bottom: -0.75rem; content: "↓"; }
  .flow-step h3, .method-flow.compact .flow-step h3 { margin-top: 1.2rem; }
  .history-heading { position: static; }
  .timeline > div:not(.timeline-links) { padding-left: 3.2rem; }
  .timeline-links { padding-left: 0; }
  .envelope-grid { grid-template-columns: 1fr; }
  .request-sources { grid-template-columns: 1fr 1fr; }
  .request-sources span { border-bottom: 1px solid var(--line); }
  .request-sources span:nth-child(2) { border-right: 0; }
  .request-sources span:nth-child(3), .request-sources span:nth-child(4) { border-bottom: 0; }
  .case-card:first-child, .record-section.wide { grid-column: auto; }
  .section-head, .footer-grid { align-items: flex-start; flex-direction: column; }
  .footer-grid > div:last-child { text-align: left; }
  .prose > .method-flow { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
