:root {
  --navy: #16283b;
  --navy-2: #223b51;
  --paper: #f5f6f1;
  --paper-2: #e8ebe4;
  --ink: #18242f;
  --muted: #586675;
  --line: #c6cec7;
  --moss: #56745d;
  --moss-dark: #315540;
  --amber: #e9bd57;
  --coral: #d8664f;
  --blue: #8fc7cc;
  --white: #ffffff;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  --body: "Manrope", system-ui, sans-serif;
  --display: "Newsreader", Georgia, serif;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--body);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body { margin: 0; min-width: 320px; background: var(--paper); }

.not-found {
  box-sizing: border-box;
  max-width: 48rem;
  min-height: 100svh;
  margin: 0 auto;
  padding: 12rem 1.5rem 4rem;
}

.not-found h1 { max-width: 12ch; }

.not-found p:not(.eyebrow) {
  max-width: 36rem;
  font-size: 1.2rem;
}

.button {
  display: inline-flex;
  align-items: center;
  min-height: 2.8rem;
  padding: 0.7rem 1rem;
  border: 1px solid var(--ink);
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.button:hover,
.button:focus-visible {
  background: var(--ink);
  color: var(--paper);
}

a { color: inherit; }

button, summary { font: inherit; }

button { cursor: pointer; }

:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 4px;
}

.shell {
  width: min(1120px, calc(100% - 48px));
  margin-inline: auto;
}

.narrow { width: min(700px, calc(100% - 48px)); }

.skip-link {
  position: absolute;
  left: 18px;
  top: -50px;
  z-index: 50;
  background: var(--amber);
  color: var(--navy);
  padding: 10px 14px;
  text-decoration: none;
  font-weight: 800;
}

.skip-link:focus { top: 12px; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  border-bottom: 1px solid var(--line);
  font-size: 0.82rem;
}

.site-header nav, .site-footer { display: flex; align-items: center; gap: 22px; }

.site-header a, .site-footer a { text-decoration: none; }

.site-header nav a:first-child { border-bottom: 1px solid currentColor; padding-bottom: 3px; }

.wordmark {
  font-family: var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 600;
}

.header-projects { color: var(--muted); }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(330px, 0.8fr);
  align-items: end;
  gap: clamp(40px, 8vw, 120px);
  min-height: 650px;
  padding-top: 76px;
  padding-bottom: 92px;
}

.hero-copy { max-width: 700px; }

.kicker, .section-marker, .control-label, .readout-kicker, .stamp, .certificate-top, .certificate-bottom, .updated {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  line-height: 1.4;
  text-transform: uppercase;
}

.kicker, .section-marker { color: var(--moss-dark); margin: 0 0 18px; }

h1, h2 { font-family: var(--display); font-weight: 400; letter-spacing: -0.04em; }

h1 { max-width: 720px; margin: 0; font-size: clamp(4rem, 9vw, 8.75rem); line-height: 0.84; }

h2 { max-width: 740px; margin: 0 0 24px; font-size: clamp(2.7rem, 5vw, 5.25rem); line-height: 0.94; }

.deck { max-width: 650px; margin: 34px 0 0; font-size: clamp(1.05rem, 1.8vw, 1.3rem); line-height: 1.62; }

.hero-note { display: flex; align-items: center; gap: 12px; max-width: 610px; margin: 28px 0 0; color: var(--muted); font-size: 0.8rem; line-height: 1.5; }

.stamp { flex: none; color: var(--navy); border: 1px solid var(--navy); padding: 5px 7px; font-size: 0.58rem; }

.certificate {
  position: relative;
  min-height: 360px;
  padding: 25px;
  color: var(--paper);
  background: var(--navy);
  box-shadow: 14px 14px 0 var(--amber);
  transform: rotate(1.3deg);
}

.certificate::before {
  content: "";
  position: absolute;
  inset: 11px;
  border: 1px solid rgba(245, 246, 241, 0.3);
  pointer-events: none;
}

.certificate-top, .certificate-bottom { display: flex; justify-content: space-between; gap: 20px; position: relative; z-index: 1; }

.certificate-top { color: var(--blue); }

.certificate-bars { display: grid; gap: 31px; margin-top: 78px; position: relative; z-index: 1; }

.certificate-row { display: grid; grid-template-columns: 1fr auto; gap: 10px 12px; align-items: baseline; }

.certificate-row span { color: #d4dedb; font-size: 0.78rem; }

.certificate-row strong { font-family: var(--mono); font-size: clamp(1.7rem, 3vw, 2.4rem); font-weight: 500; color: var(--amber); }

.mini-track { grid-column: 1 / -1; height: 8px; background: rgba(255, 255, 255, 0.15); }

.mini-track span { display: block; width: 10%; height: 100%; background: var(--coral); }

.mini-track.male span { background: var(--blue); }

.certificate-bottom { position: absolute; bottom: 25px; left: 25px; right: 25px; color: #d4dedb; }

.certificate-bottom strong { color: var(--coral); font-family: var(--mono); font-size: 1rem; }

.prose-section { padding-top: 110px; padding-bottom: 118px; }

.prose-section p:not(.section-marker), .receipts-section > p:not(.section-marker), .method-copy > p:not(.section-marker), .sources-section p { font-size: 1rem; line-height: 1.8; }

.prose-section h2, .receipts-section h2, .limits-section h2, .method-section h2, .sources-section h2 { margin-bottom: 28px; }

.prose-section p + p { margin-top: 24px; }

.lens-section { padding: 92px 0 110px; color: var(--paper); background: var(--navy-2); }

.lens-section .section-marker { color: var(--blue); }

.section-lead { max-width: 640px; color: #d6e1dd; font-size: 1.05rem; line-height: 1.7; }

.lens-object { margin-top: 56px; padding: clamp(22px, 4vw, 44px); background: var(--paper); color: var(--ink); }

.lens-controls { display: grid; grid-template-columns: 1fr auto; gap: 24px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }

.control-group { display: grid; gap: 10px; }

.control-label { color: var(--muted); }

.segmented { display: flex; flex-wrap: wrap; gap: 7px; }

.segmented button { border: 1px solid var(--line); background: transparent; color: var(--ink); padding: 9px 11px; font-size: 0.78rem; }

.segmented button[aria-pressed="true"] { border-color: var(--navy); background: var(--navy); color: var(--paper); }

.lens-readout { display: grid; grid-template-columns: auto 1fr; align-items: end; gap: 8px 18px; padding: 34px 0 26px; }

.readout-kicker { grid-column: 1 / -1; color: var(--muted); margin: 0; }

.readout-number { font-family: var(--mono); font-size: clamp(3rem, 7vw, 5.6rem); line-height: 0.9; color: var(--coral); }

.readout-copy { max-width: 330px; margin: 0 0 4px; color: var(--muted); font-size: 0.9rem; line-height: 1.5; }

.visual-row { display: grid; grid-template-columns: minmax(150px, 0.35fr) minmax(0, 1fr); gap: 18px; align-items: center; }

.visual-row + .visual-row { margin-top: 22px; }

.row-label { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; font-size: 0.78rem; }

.row-label strong { font-family: var(--mono); font-weight: 500; white-space: nowrap; }

.bar-track { display: flex; overflow: hidden; height: 32px; background: var(--paper-2); }

.bar-segment { display: block; min-width: 0; height: 100%; }

.bar-segment span { display: block; padding: 8px 9px; color: var(--navy); font-family: var(--mono); font-size: 0.66rem; white-space: nowrap; }

.bar-specific { background: var(--moss); color: var(--paper); }
.bar-specific span { color: var(--paper); }
.bar-residual { background: var(--amber); }
.bar-mechanism { background: var(--coral); }
.bar-ill-defined { background: #7d7b9f; }
.bar-unknown { background: var(--navy); }

.legend { display: flex; flex-wrap: wrap; gap: 11px 18px; margin: 27px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 0.72rem; line-height: 1.4; }

.legend li { display: flex; align-items: center; gap: 7px; }

.legend-dot { width: 9px; height: 9px; flex: none; }
.dot-specific { background: var(--moss); }
.dot-residual { background: var(--amber); }
.dot-mechanism { background: var(--coral); }
.dot-ill-defined { background: #7d7b9f; }
.dot-unknown { background: var(--navy); }

.lens-table-wrap { margin-top: 44px; border-top: 1px solid var(--line); }

.lens-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }

.lens-table caption { padding: 22px 0 11px; text-align: left; font-family: var(--display); font-size: 1.8rem; }

.lens-table th, .lens-table td { padding: 12px 8px 12px 0; border-bottom: 1px solid var(--line); text-align: left; }

.lens-table thead th { color: var(--muted); font-family: var(--mono); font-size: 0.63rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; }

.lens-table tbody th { font-weight: 700; }

.interaction-note { max-width: 700px; margin: 26px 0 0; color: #d6e1dd; font-size: 0.8rem; line-height: 1.65; }

.receipts-section { padding-top: 124px; padding-bottom: 122px; }

.receipts-list { margin-top: 42px; border-top: 1px solid var(--line); }

.receipt { border-bottom: 1px solid var(--line); }

.receipt summary { display: grid; grid-template-columns: 80px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 18px 0; list-style: none; }

.receipt summary::-webkit-details-marker { display: none; }

.receipt summary::after { content: "+"; font-family: var(--mono); color: var(--muted); }

.receipt[open] summary::after { content: "−"; }

.receipt summary code { color: var(--coral); font-family: var(--mono); font-size: 0.76rem; }

.receipt summary span { font-size: 0.86rem; }

.receipt summary strong { font-family: var(--mono); font-size: 0.78rem; font-weight: 500; color: var(--muted); }

.receipt-body { padding: 0 40px 24px 94px; }

.receipt-body dl { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 0; }

.receipt-body dl div { border-left: 3px solid var(--amber); padding-left: 15px; }
.receipt-body dl div + div { border-left-color: var(--coral); }

.receipt-body dt { font-family: var(--mono); color: var(--muted); font-size: 0.65rem; letter-spacing: 0.08em; text-transform: uppercase; }

.receipt-body dd { margin: 8px 0 0; font-size: 0.86rem; line-height: 1.6; }

.receipt-count { margin: 24px 0 0; color: var(--muted); font-family: var(--mono); font-size: 0.67rem; text-transform: uppercase; }

.limits-section { padding: 112px 0 118px; background: #ebdfb8; }

.limits-section .section-marker { color: #7a5f23; }

.limits-lead { max-width: 690px; font-size: 1.05rem; line-height: 1.75; }

.limits-list { max-width: 650px; margin: 35px 0 0; padding: 0; list-style: none; }

.limits-list li { padding: 15px 0 15px 28px; border-top: 1px solid rgba(22, 40, 59, 0.28); font-size: 0.88rem; line-height: 1.6; position: relative; }

.limits-list li::before { content: ""; position: absolute; left: 0; top: 22px; width: 10px; height: 10px; background: var(--coral); }

.method-section { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(330px, 1.1fr); gap: clamp(50px, 9vw, 130px); padding-top: 122px; padding-bottom: 132px; }

.method-steps { margin: 0; padding: 0; list-style: none; }

.method-steps li { display: grid; grid-template-columns: 46px 1fr; gap: 16px; align-items: center; min-height: 70px; border-top: 1px solid var(--line); }

.method-steps li:last-child { border-bottom: 1px solid var(--line); }

.method-steps span { font-family: var(--mono); color: var(--coral); font-size: 0.7rem; }

.method-steps strong { font-family: var(--display); font-size: 1.65rem; font-weight: 400; }

.sources-section { padding: 100px 0 108px; color: var(--paper); background: var(--navy); }

.sources-section .section-marker { color: var(--blue); }

.sources-section h2 { color: var(--paper); }

.sources-section p { color: #d6e1dd; }

.sources-list { margin: 35px 0 0; padding-left: 24px; }

.sources-list li { padding: 12px 0 12px 6px; font-size: 0.82rem; line-height: 1.6; }

.sources-list a { color: var(--paper); text-decoration-thickness: 1px; text-underline-offset: 3px; }

.source-status { margin-top: 36px; padding-top: 22px; border-top: 1px solid rgba(245, 246, 241, 0.3); font-size: 0.78rem !important; }

.updated { color: var(--blue) !important; margin-top: 28px; }

.site-footer { justify-content: space-between; min-height: 92px; color: var(--muted); font-size: 0.72rem; }

.site-footer .wordmark { color: var(--ink); }

.back-to-top { position: fixed; right: 24px; bottom: 24px; z-index: 20; display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid var(--paper); background: var(--navy); color: var(--paper); text-decoration: none; opacity: 0; pointer-events: none; transform: translateY(10px); transition: opacity 180ms ease, transform 180ms ease; }

.back-to-top.is-visible { opacity: 1; pointer-events: auto; transform: translateY(0); }

@media (max-width: 820px) {
  .shell, .narrow { width: min(100% - 36px, 700px); }
  .site-header { min-height: 68px; }
  .header-projects { display: none; }
  .hero { grid-template-columns: 1fr; min-height: auto; padding-top: 66px; gap: 68px; }
  .certificate { max-width: 520px; width: calc(100% - 14px); }
  .lens-controls, .method-section { grid-template-columns: 1fr; }
  .lens-controls { gap: 18px; }
  .visual-row { grid-template-columns: 1fr; gap: 8px; }
  .row-label { justify-content: flex-start; gap: 18px; }
  .receipt-body { padding-left: 0; }
}

@media (max-width: 520px) {
  .shell, .narrow { width: min(100% - 28px, 700px); }
  h1 { font-size: clamp(3.3rem, 17vw, 5.5rem); }
  h2 { font-size: clamp(2.45rem, 12vw, 4.2rem); }
  .hero { padding-top: 50px; padding-bottom: 72px; }
  .hero-note { align-items: flex-start; flex-direction: column; }
  .certificate { min-height: 330px; padding: 20px; box-shadow: 9px 9px 0 var(--amber); }
  .certificate-bars { margin-top: 60px; }
  .certificate-bottom { left: 20px; right: 20px; bottom: 20px; }
  .prose-section, .receipts-section, .method-section { padding-top: 84px; padding-bottom: 88px; }
  .lens-section, .limits-section { padding: 80px 0 84px; }
  .sources-section { padding: 80px 0 86px; }
  .lens-object { padding: 18px; margin-top: 40px; }
  .lens-readout { grid-template-columns: 1fr; gap: 12px; }
  .readout-copy { max-width: 100%; }
  .bar-track { height: 26px; }
  .bar-segment span { padding: 6px 7px; font-size: 0.6rem; }
  .legend { display: grid; grid-template-columns: 1fr 1fr; }
  .receipt summary { grid-template-columns: 62px minmax(0, 1fr) 12px; gap: 10px; }
  .receipt summary strong { grid-column: 2; grid-row: 2; }
  .receipt summary::after { grid-column: 3; grid-row: 1 / span 2; }
  .receipt-body dl { grid-template-columns: 1fr; gap: 18px; }
  .site-footer { align-items: flex-start; flex-direction: column; gap: 11px; padding-top: 26px; padding-bottom: 28px; }
  .back-to-top { right: 14px; bottom: 14px; }
}

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

@media print {
  .site-header nav, .back-to-top, .skip-link, .lens-controls { display: none !important; }
  .hero, .prose-section, .lens-section, .receipts-section, .limits-section, .method-section, .sources-section { break-inside: avoid; }
  .lens-section, .sources-section { color: var(--ink); background: white; }
}
