:root {
  --paper: #f5f1e8;
  --paper-deep: #e9e2d4;
  --ink: #171716;
  --muted: #68645d;
  --line: #cfc6b8;
  --red: #d52b1e;
  --red-dark: #a91f16;
  --coral: #ed756a;
  --orange: #d77b2d;
  --blue: #42657a;
  --blue-light: #89a7b7;
  --white: #fffdf8;
  --content: 1160px;
  --reading: 860px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(23, 23, 22, 0.028) 1px, transparent 1px),
    var(--paper);
  background-size: 100% 8px;
  font-family:
    Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.62;
  text-rendering: optimizeLegibility;
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  background: radial-gradient(circle at 76% 9%, rgba(213, 43, 30, 0.08), transparent 24rem);
  content: "";
  pointer-events: none;
}

a {
  color: inherit;
  text-underline-offset: 0.2em;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.55rem 0.8rem;
  color: var(--white);
  background: var(--ink);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: relative;
  z-index: 2;
  display: flex;
  width: min(calc(100% - 2.5rem), var(--content));
  margin: 0 auto;
  padding: 1rem 0;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
}

.brand svg {
  width: 1.75rem;
  fill: var(--red);
}

.site-header nav {
  display: flex;
  gap: 1.35rem;
}

.site-header nav a {
  color: var(--muted);
  text-decoration: none;
}

.site-header nav a:hover,
.site-header nav a:focus-visible {
  color: var(--red);
}

article {
  overflow: hidden;
}

.hero {
  width: 100%;
  margin: 0;
  padding: clamp(2rem, 4vw, 3.25rem) max(1.25rem, calc((100vw - var(--content)) / 2));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.55);
}

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

.eyebrow,
.section-kicker {
  margin: 0 0 1rem;
  color: var(--red);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.03;
}

h1 {
  max-width: 720px;
  margin-bottom: 0.9rem;
  font-size: clamp(2.7rem, 4.8vw, 4.3rem);
}

h2 {
  margin-bottom: 0.75rem;
  font-size: clamp(1.75rem, 2.8vw, 2.7rem);
}

h3 {
  margin-bottom: 0.55rem;
  font-size: 1.32rem;
}

.dek {
  max-width: 760px;
  margin-bottom: 1.15rem;
  color: #35322e;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.12rem, 1.75vw, 1.38rem);
  line-height: 1.45;
}

.dek strong {
  color: var(--red-dark);
  font-weight: 500;
}

.byline {
  margin: 0.9rem 0 0;
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 700;
}

.hero-meta {
  display: flex;
  width: fit-content;
  max-width: 100%;
  flex-wrap: wrap;
  margin-top: 1.25rem;
  color: var(--muted);
  gap: 0.55rem;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.hero-meta span {
  padding: 0;
}

.hero-meta span:not(:last-child) {
  border-right: 0;
}

.hero-meta span:not(:last-child)::after {
  margin-left: 0.55rem;
  color: var(--muted);
  content: "·";
}

.read-this-first {
  padding: 1.6rem max(1.5rem, calc((100vw - var(--content)) / 2));
  color: var(--white);
  background: var(--ink);
}

.read-this-first h2 {
  max-width: 750px;
  margin-bottom: 0.5rem;
  color: var(--white);
  font-size: clamp(1.55rem, 2.4vw, 2.15rem);
}

.qualification-grid {
  display: grid;
  margin-top: 0.9rem;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
}

.qualification-grid p {
  margin: 0;
  color: #cfcac1;
  font-size: 0.86rem;
  line-height: 1.5;
}

.qualification-grid strong {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--white);
}

.narrative,
.strategy-section,
.results-section,
.economics,
.conclusion {
  width: min(calc(100% - 2.5rem), var(--content));
  margin: 0 auto;
  padding: clamp(2.7rem, 4.5vw, 4rem) 0;
}

.narrative {
  display: block;
}

.narrative .section-heading {
  max-width: 900px;
}

.section-heading > p:last-child {
  max-width: var(--reading);
  color: var(--muted);
  font-size: 1rem;
}

.prose {
  max-width: var(--reading);
  margin-top: 1rem;
  padding-top: 0;
  color: #34312d;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.08rem;
}

.prose p:first-child::first-letter {
  float: left;
  margin: 0.04em 0.12em 0 0;
  color: var(--red);
  font-size: 3.7rem;
  line-height: 0.8;
}

.strategy-section {
  padding-top: 1rem;
}

.strategy-grid {
  display: grid;
  margin-top: 2rem;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.strategy-note {
  max-width: var(--reading);
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.strategy-card {
  display: flex;
  min-height: 310px;
  padding: 1.5rem;
  flex-direction: column;
  border-left: 1px solid var(--line);
}

.strategy-card:last-child {
  border-right: 1px solid var(--line);
}

.strategy-card-paired {
  color: var(--white);
  background: var(--red);
  border-color: var(--red);
}

.strategy-index {
  margin-bottom: 1.75rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.strategy-card-paired .strategy-index,
.strategy-card-paired .strategy-type {
  color: rgba(255, 255, 255, 0.76);
}

.strategy-card p:not(.strategy-type) {
  font-size: 0.94rem;
}

.strategy-type {
  margin-top: -0.3rem;
  color: var(--red-dark);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.flow {
  display: flex;
  margin-top: auto;
  padding-top: 1.25rem;
  gap: 0.45rem;
  align-items: center;
  border-top: 1px solid currentColor;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.2;
}

.flow i {
  color: var(--red);
  font-style: normal;
}

.strategy-card-paired .flow i {
  color: var(--white);
}

.results-section {
  width: 100%;
  padding-right: max(1.5rem, calc((100vw - var(--content)) / 2));
  padding-left: max(1.5rem, calc((100vw - var(--content)) / 2));
  background: var(--white);
}

.chart-block {
  width: 100%;
  margin: 2rem auto 0;
  padding: clamp(1.1rem, 2vw, 1.6rem);
  border: 1px solid var(--line);
  background: var(--white);
}

.results-section .chart-block {
  background: var(--paper);
}

.results-story {
  display: grid;
  width: 100%;
  margin: 2rem auto 0;
  grid-template-columns: minmax(250px, 0.62fr) minmax(0, 1.38fr);
  border: 1px solid var(--line);
  background: var(--paper);
}

.results-story-copy {
  padding: clamp(1.3rem, 2.5vw, 2rem);
  align-self: center;
}

.score-comparison {
  display: flex;
  margin: 0.9rem 0 1.35rem;
  gap: 1.5rem;
}

.score-comparison p {
  display: flex;
  margin: 0;
  flex-direction: column;
  gap: 0.2rem;
}

.score-comparison strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  line-height: 1;
}

.score-comparison p:first-child strong {
  color: var(--red);
}

.score-comparison span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.results-story-copy h3 {
  margin: 0 0 0.65rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.25rem, 2vw, 1.55rem);
  line-height: 1.2;
}

.results-story-copy > p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.65;
}

.task-breakdown {
  min-width: 0;
  margin: 0;
  padding: clamp(1.15rem, 2.3vw, 1.8rem);
  border-left: 1px solid var(--line);
  background: var(--white);
}

.task-breakdown .chart {
  min-height: 0;
}

.leaderboard-story {
  display: grid;
  width: 100%;
  margin: 3rem auto 0;
  grid-template-columns: minmax(0, 1.55fr) minmax(240px, 0.6fr);
  border: 1px solid var(--line);
  background: var(--paper);
}

.leaderboard-figure {
  min-width: 0;
  margin: 0;
  padding: clamp(1.1rem, 2vw, 1.55rem);
  border-right: 1px solid var(--line);
  background: var(--white);
}

.leaderboard-figure .chart {
  min-height: 0;
}

.chart-header sup {
  margin-left: 0.1rem;
  color: var(--red);
  font-size: 0.65em;
}

.snapshot-note {
  margin-top: 0.35rem;
  font-size: 0.68rem;
}

.leaderboard-copy {
  padding: clamp(1.3rem, 2.5vw, 2rem);
  align-self: center;
}

.leaderboard-copy h3 {
  margin: 0.4rem 0 0.7rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.25rem, 2vw, 1.55rem);
  line-height: 1.2;
}

.leaderboard-copy > p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.65;
}

.cost-story {
  display: grid;
  width: 100%;
  margin: 2rem auto 0;
  grid-template-columns: minmax(250px, 0.62fr) minmax(0, 1.38fr);
  border: 1px solid var(--line);
  background: var(--paper);
}

.cost-copy {
  padding: clamp(1.3rem, 2.5vw, 2rem);
  align-self: center;
}

.cost-copy h3 {
  margin: 0.4rem 0 0.7rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.25rem, 2vw, 1.55rem);
  line-height: 1.2;
}

.cost-copy > p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.65;
}

.cost-figure {
  min-width: 0;
  margin: 0;
  padding: clamp(1.1rem, 2vw, 1.55rem);
  border-left: 1px solid var(--line);
  background: var(--white);
}

.cost-figure .chart {
  min-height: 0;
}

.chart-header {
  display: flex;
  margin-bottom: 1.15rem;
  gap: 2rem;
  align-items: flex-start;
  justify-content: space-between;
}

.chart-header h3 {
  margin-bottom: 0.3rem;
  font-family: inherit;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.chart-header p,
.chart-unit {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.chart-unit {
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--line);
  white-space: nowrap;
}

.chart {
  min-height: 300px;
}

.chart svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart svg text {
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

.chart [tabindex="0"]:focus {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

figcaption {
  max-width: 880px;
  margin-top: 0.9rem;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.55;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  color: var(--muted);
  font-size: 0.72rem;
}

.legend span {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
}

.legend-swatch {
  display: inline-block;
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 50%;
}

.legend-swatch.redis {
  background: var(--red);
}

.legend-swatch.instruct {
  background: var(--blue);
}

.legend-swatch.reproduced {
  background: var(--orange);
}

.legend-swatch.published {
  background: #918b82;
}

.legend-swatch.qualified {
  background: #918b82;
}

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

.extraction-study {
  width: 100%;
  padding: clamp(2.7rem, 4.5vw, 4rem) max(1.5rem, calc((100vw - var(--content)) / 2));
  background: var(--paper-deep);
}

.extraction-study .section-heading {
  max-width: 920px;
}

.extraction-story {
  display: grid;
  width: 100%;
  margin: 2rem auto 0;
  grid-template-columns: minmax(0, 1.55fr) minmax(240px, 0.6fr);
  border: 1px solid var(--line);
  background: var(--paper);
}

.extraction-plot {
  min-width: 0;
  margin: 0;
  padding: clamp(1.1rem, 2vw, 1.55rem);
  border-right: 1px solid var(--line);
  background: var(--white);
}

.extraction-copy {
  padding: clamp(1.3rem, 2.5vw, 2rem);
  align-self: center;
}

.extraction-copy h3 {
  margin: 0.4rem 0 0.7rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.25rem, 2vw, 1.55rem);
  line-height: 1.2;
}

.extraction-copy > p:not(.section-kicker) {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.65;
}

.extraction-figure {
  display: block;
  width: 100%;
  height: auto;
}

.figure-scroll {
  width: 100%;
}

.economics .section-heading {
  max-width: 900px;
}

.cost-chart {
  min-height: 430px;
}

.conclusion {
  width: 100%;
  padding-right: max(1.5rem, calc((100vw - var(--content)) / 2));
  padding-left: max(1.5rem, calc((100vw - var(--content)) / 2));
  color: var(--white);
  background: var(--red);
}

.conclusion .section-kicker {
  color: var(--white);
}

.conclusion h2,
.conclusion > p:last-child {
  max-width: 960px;
}

.conclusion > p:last-child {
  margin: 1rem 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.1rem;
}

.article-footer {
  display: grid;
  padding: 2.75rem max(1.5rem, calc((100vw - var(--content)) / 2)) 1.75rem;
  color: #cbc7bf;
  background: var(--ink);
  grid-template-columns: minmax(0, 1.6fr) minmax(220px, 0.6fr);
  gap: 3rem;
  font-size: 0.85rem;
}

.article-footer > div:first-child {
  max-width: var(--reading);
}

.footer-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.footer-links a {
  padding: 0.5rem 0;
  color: var(--white);
}

.copyright {
  margin: 2rem 0 0;
  padding-top: 1.25rem;
  grid-column: 1 / -1;
  border-top: 1px solid #3b3936;
  color: #8d8982;
  font-size: 0.72rem;
}

.tooltip {
  position: fixed;
  z-index: 50;
  width: min(270px, calc(100vw - 2rem));
  padding: 0.75rem 0.9rem;
  color: var(--white);
  background: var(--ink);
  font-size: 0.75rem;
  line-height: 1.45;
  opacity: 0;
  transform: translate(-50%, calc(-100% - 12px));
  transition: opacity 120ms ease;
  pointer-events: none;
}

.tooltip.visible {
  opacity: 1;
}

@media (max-width: 900px) {
  .hero {
    padding-top: 2rem;
  }

  .qualification-grid,
  .strategy-grid {
    grid-template-columns: 1fr;
  }

  .results-story {
    grid-template-columns: 1fr;
  }

  .task-breakdown {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .leaderboard-story {
    grid-template-columns: 1fr;
  }

  .leaderboard-figure {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .cost-story {
    grid-template-columns: 1fr;
  }

  .cost-figure {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .extraction-story {
    grid-template-columns: 1fr;
  }

  .extraction-plot {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .strategy-card {
    min-height: auto;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  .strategy-index {
    margin-bottom: 1.5rem;
  }

  .flow {
    margin-top: 2rem;
  }

  .chart {
    overflow-x: auto;
    padding-bottom: 0.4rem;
    scrollbar-color: var(--red) var(--paper-deep);
  }

  .chart svg {
    min-width: 700px;
  }

  #per-task-chart svg {
    min-width: 620px;
  }

  .figure-scroll {
    overflow-x: auto;
    padding-bottom: 0.4rem;
    scrollbar-color: var(--red) var(--paper-deep);
  }

  .extraction-figure {
    min-width: 720px;
  }

}

@media (max-width: 640px) {
  body {
    font-size: 16px;
  }

  .hero {
    padding-right: 1rem;
    padding-left: 1rem;
  }

  .site-header {
    width: min(calc(100% - 2rem), var(--content));
  }

  .site-header nav {
    display: none;
  }

  .narrative,
  .strategy-section,
  .economics {
    width: min(calc(100% - 2rem), var(--content));
  }

  h1 {
    font-size: clamp(2.55rem, 11vw, 3.4rem);
  }

  .qualification-grid {
    gap: 1.5rem;
  }

  .chart-header {
    flex-direction: column;
    gap: 0.75rem;
  }

  .score-comparison {
    flex-wrap: wrap;
  }

  .article-footer {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

@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 {
  body {
    background: white;
  }

  .site-header,
  .tooltip {
    display: none;
  }

  .hero {
    min-height: 0;
  }

  .chart-block,
  .strategy-card {
    break-inside: avoid;
  }
}
