:root {
  --ink: #27272a;
  --muted: #666a70;
  --blue: #1769aa;
  --blue-dark: #0f4f83;
  --light: #f6f7f8;
  --line: #dedfe2;
  --white: #ffffff;
  --wide: 1120px;
  --reading: 850px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--white);
  font-family: "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); }
img { display: block; max-width: 100%; }
button, input { font: inherit; }
.skip-link { position: absolute; top: 8px; left: 8px; z-index: 10; padding: 8px 12px; color: white; background: var(--ink); transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
.container { width: min(calc(100% - 40px), var(--wide)); margin-inline: auto; }
.container.reading { max-width: var(--reading); }
.container.wide { max-width: var(--wide); }

.publication-hero { padding: 74px 0 44px; text-align: center; }
.hero-inner { width: min(calc(100% - 40px), 1260px); max-width: 1260px; }
h1 {
  max-width: 1220px;
  margin: 0 auto 20px;
  font-family: "Google Sans", "Helvetica Neue", Arial, sans-serif;
  font-size: 64px;
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: 0;
}
h1 span { color: #0868ce; }
.authors { margin: 0 0 10px; color: var(--blue); font-family: "Google Sans", sans-serif; font-size: 20px; }
.authors span { display: inline-block; }
.authors sup, .author-emails sup { margin-right: 2px; font-size: .62em; line-height: 0; vertical-align: super; }
.author-emails { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 38px; margin: 0 0 26px; font-size: 13px; }
.author-emails a { display: inline-flex; align-items: baseline; color: var(--muted); text-decoration: none; }
.author-emails a:hover { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.publication-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.publication-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  min-height: 40px;
  padding: 8px 16px;
  border-radius: 999px;
  color: var(--white);
  background: #36383b;
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
  transition: background-color .16s ease, transform .16s ease;
}
.publication-links a:hover { background: var(--blue-dark); transform: translateY(-1px); }

.figure-section { padding: 28px 0 64px; }
.hero-figure, .simulation-figure { margin: 0; }
figcaption { max-width: 980px; margin: 18px auto 0; color: var(--muted); font-size: 13px; line-height: 1.55; }

.method-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 44px;
  align-items: stretch;
}
.overview-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 320px;
  padding: 30px;
  border: 1px solid #d3d9de;
  border-radius: 5px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(31, 42, 51, .06);
}
.overview-stage:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -28px;
  width: 12px;
  height: 12px;
  border-top: 2px solid #68747c;
  border-right: 2px solid #68747c;
  transform: rotate(45deg);
}
.overview-stage h3 { min-height: 56px; margin-bottom: 24px; font-family: "Google Sans", sans-serif; font-size: 21px; font-weight: 400; text-align: center; }
.overview-stage p { margin: auto 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; text-align: center; }
.donor-stack { position: relative; width: 142px; height: 112px; margin: 4px auto 30px; }
.donor-stack > div { position: absolute; display: grid; grid-template-columns: repeat(2, 40px); grid-template-rows: repeat(2, 40px); gap: 4px; padding: 7px; border: 1px solid #bfc8ce; background: #fff; box-shadow: 0 3px 8px rgba(35,45,52,.08); }
.donor-stack > div:nth-child(1) { top: 0; left: 0; }
.donor-stack > div:nth-child(2) { top: 12px; left: 22px; }
.donor-stack > div:nth-child(3) { top: 24px; left: 44px; }
.donor-stack i:nth-child(1), .donor-stack i:nth-child(4) { background: #99bfdc; }
.donor-stack i:nth-child(2), .donor-stack i:nth-child(3) { background: #d5e3ed; }
.overview-equation { margin: 8px auto 16px; padding: 18px 24px; border: 1px solid #d8dfe4; border-radius: 3px; background: #fafbfc; font-family: Castoro, Georgia, serif; font-size: 18px; text-align: center; }
.donor-effects { position: relative; width: 190px; height: 58px; margin: 0 auto 20px; border-bottom: 1px solid #abb6bd; }
.donor-effects::before { content: ""; position: absolute; inset: 31px 12px auto; height: 1px; background: #7f8e97; transform: rotate(7deg); }
.donor-effects i { position: absolute; width: 9px; height: 9px; border-radius: 50%; background: #5d96cd; }
.donor-effects i:nth-child(1) { left: 16px; top: 18px; }
.donor-effects i:nth-child(2) { left: 56px; top: 27px; }
.donor-effects i:nth-child(3) { left: 92px; top: 35px; background: #16877f; }
.donor-effects i:nth-child(4) { left: 132px; top: 25px; }
.donor-effects i:nth-child(5) { right: 14px; top: 14px; }
.donor-effects b { position: absolute; left: 96px; top: 3px; height: 45px; border-left: 1px dashed #16877f; }
.recipient-overview { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 28px 0 42px; font-family: Castoro, Georgia, serif; }
.recipient-margins { display: grid; gap: 5px; }
.recipient-margins span, .population-odds { display: flex; align-items: center; justify-content: center; min-width: 48px; min-height: 38px; padding: 5px 8px; border: 1px solid #cbd3d8; border-radius: 3px; background: #fafbfc; }
.recipient-overview > b { color: #68747c; font-family: "Noto Sans", sans-serif; font-size: 18px; font-weight: 400; }
.recipient-grid { display: grid; grid-template-columns: repeat(2, 36px); grid-template-rows: repeat(2, 36px); gap: 4px; padding: 5px; border: 1px solid #bfc8ce; }
.recipient-grid i:nth-child(1), .recipient-grid i:nth-child(4) { background: #91c9c2; }
.recipient-grid i:nth-child(2), .recipient-grid i:nth-child(3) { background: #d6eae7; }

.section { padding: 74px 0; }
.section.light { background: var(--light); }
h2 {
  margin: 0 0 24px;
  font-family: "Google Sans", "Helvetica Neue", Arial, sans-serif;
  font-size: 36px;
  font-weight: 650;
  line-height: 1.2;
  text-align: center;
}
h3 { margin: 0 0 12px; font-size: 22px; line-height: 1.3; }
p { margin: 0 0 18px; }
p:last-child { margin-bottom: 0; }
.lead { font-size: 20px; line-height: 1.6; text-align: center; }
.reading h3 { margin-top: 36px; }
.paper-figure { margin: 42px 0; }
.figure-scroll { overflow-x: auto; background: white; }
.figure-scroll img { width: 100%; min-width: 720px; }
.figure-scroll a { display: block; }

.equation {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 34px 0;
  padding: 24px 16px;
  border-block: 1px solid var(--line);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
}
.fraction { display: inline-grid; grid-template-rows: auto auto; text-align: center; line-height: 1.2; }
.fraction i { padding: 0 5px 4px; border-bottom: 1px solid currentColor; font-weight: 400; }
.fraction b { padding-top: 4px; font-weight: 400; }

.interactive-table {
  display: grid;
  grid-template-columns: .86fr 1.14fr;
  gap: 46px;
  margin-top: 50px;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  box-shadow: 0 7px 24px rgba(32, 38, 45, .06);
}
.interactive-copy p { color: var(--muted); font-size: 14px; }
.control { margin-top: 25px; }
.control label { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 7px; font-size: 13px; font-weight: 650; }
.control output { color: var(--blue-dark); font-variant-numeric: tabular-nums; }
input[type="range"] { width: 100%; height: 4px; margin: 0; accent-color: var(--blue); cursor: pointer; }
.table-wrap { min-width: 0; }
.column-labels { display: grid; grid-template-columns: 76px repeat(2, 1fr); margin-bottom: 6px; }
.column-labels span { color: var(--muted); font-size: 11px; font-weight: 650; text-align: center; text-transform: uppercase; }
.joint-table { display: grid; grid-template-columns: 76px repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, 112px); gap: 6px; }
.row-label { display: grid; place-items: center; color: var(--muted); font-size: 11px; font-weight: 650; text-align: center; text-transform: uppercase; }
.table-cell { position: relative; display: grid; place-content: center; border: 1px solid rgba(0,0,0,.04); border-radius: 3px; overflow: hidden; text-align: center; }
.table-cell::before { content: ""; position: absolute; inset: 0; opacity: var(--fill, .5); transition: opacity .18s ease; }
.table-cell.same::before { background: #b8ddd8; }
.table-cell.different::before { background: #efcac3; }
.table-cell strong, .table-cell small { position: relative; z-index: 1; }
.table-cell strong { font-size: 27px; font-variant-numeric: tabular-nums; line-height: 1; }
.table-cell small { margin-top: 7px; color: var(--muted); font-size: 10px; text-transform: uppercase; }
.margin-summary { display: flex; justify-content: space-between; gap: 12px; margin: 14px 0 0 76px; color: var(--muted); font-size: 11px; }
.margin-summary b { color: var(--ink); font-variant-numeric: tabular-nums; }

.result-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 44px 0 38px;
  border-block: 1px solid var(--line);
}
.result-grid div { min-height: 132px; padding: 24px; text-align: center; }
.result-grid div + div { border-left: 1px solid var(--line); }
.result-grid strong { display: block; margin-bottom: 8px; color: var(--blue-dark); font-size: 31px; line-height: 1.1; }
.result-grid span { display: block; color: var(--muted); font-size: 12px; line-height: 1.45; }
.result-copy { margin-top: 8px; }
.method-detail { margin-top: 58px; padding-top: 48px; border-top: 1px solid var(--line); }
.method-detail h3 { margin-top: 38px; font-family: "Google Sans", sans-serif; font-weight: 400; }
.method-detail h3:first-child { margin-top: 0; }
.simulation-figure { margin-top: 42px; }
.simulation-figure img { width: 100%; min-height: 300px; object-fit: contain; }

.bottom-links { justify-content: flex-start; margin-top: 30px; }
footer { padding: 30px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; text-align: center; }
:focus-visible { outline: 3px solid #e5b64e; outline-offset: 3px; }

@media (max-width: 900px) {
  .method-overview { grid-template-columns: 1fr; gap: 18px; }
  .overview-stage { min-height: 290px; }
  .overview-stage:not(:last-child)::after { display: none; }
}

@media (max-width: 760px) {
  .publication-hero { padding-top: 52px; }
  h1 { font-size: 40px; }
  .authors { font-size: 16px; }
  .author-emails { gap: 5px 16px; font-size: 12px; }
  .figure-section { padding-top: 10px; }
  .overview-stage { min-height: 280px; padding: 24px 18px; }
  .overview-stage h3 { min-height: auto; }
  .section { padding: 58px 0; }
  .lead { font-size: 18px; }
  .interactive-table { grid-template-columns: 1fr; gap: 32px; padding: 24px 18px; }
  .joint-table { grid-template-columns: 58px repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, 94px); }
  .column-labels { grid-template-columns: 58px repeat(2, 1fr); }
  .margin-summary { margin-left: 58px; flex-wrap: wrap; }
  .result-grid { grid-template-columns: repeat(2, 1fr); }
  .result-grid div:nth-child(3) { border-top: 1px solid var(--line); border-left: 0; }
  .result-grid div:nth-child(4) { border-top: 1px solid var(--line); }
  .simulation-figure img { min-height: 190px; }
}

@media (max-width: 440px) {
  body { font-size: 15px; }
  .equation math { font-size: 18px; }
  .container { width: min(calc(100% - 28px), var(--wide)); }
  h1 { font-size: 34px; }
  h2 { font-size: 29px; }
  .publication-links a { flex: 1 1 calc(50% - 10px); }
  .hero-figure img { min-height: 130px; }
  .interactive-table { padding-inline: 12px; }
  .table-cell strong { font-size: 21px; }
  .margin-summary { display: grid; grid-template-columns: 1fr; }
  .result-grid strong { font-size: 25px; }
  .result-grid div { min-height: 124px; padding: 20px 12px; }
}

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