:root {
  --text-primary: #18232d;
  --text-secondary: #2c3b46;
  --muted: #5c6973;
  --bg: #fbfaf7;
  --surface: #fff;
  --bg-alt: #eef3f4;
  --border: #cad4d8;
  --accent: #2d6473;
  --accent-dark: #1d4857;
  --accent-warm: #a65335;
  --accent-light: #dfecef;
  --code-bg: #17252f;
  --code-text: #e0edf0;
  --display-font: Georgia, "Times New Roman", serif;
  --wide: 1180px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

section[id] {
  scroll-margin-top: 5.5rem;
}

body {
  margin: 0;
  color: var(--text-primary);
  background: var(--bg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg {
  display: block;
  max-width: 100%;
}

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

a:hover {
  color: var(--accent);
}

button,
input,
textarea,
select {
  font: inherit;
}

:focus-visible {
  outline: 3px solid #8766bd;
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 200;
  padding: 0.55rem 0.85rem;
  color: #fff;
  text-decoration: none;
  background: #111;
  border-radius: 4px;
  transform: translateY(-180%);
  transition: transform 0.15s ease;
}

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

.site-header {
  position: sticky;
  top: 0.65rem;
  z-index: 100;
  height: 0;
  pointer-events: none;
}

.header-inner {
  position: relative;
  display: flex;
  min-height: 3.8rem;
  padding: 0.55rem 0.7rem;
  gap: 2rem;
  align-items: center;
  justify-content: space-between;
  pointer-events: auto;
  background: rgb(255 255 255 / 92%);
  border: 1px solid rgb(45 100 115 / 20%);
  border-radius: 0.9rem;
  box-shadow: 0 0.65rem 1.8rem rgb(24 35 45 / 9%);
  backdrop-filter: blur(14px);
}

.site-brand {
  display: inline-flex;
  flex: 0 0 auto;
  min-height: 44px;
  gap: 0.65rem;
  align-items: center;
  color: var(--text-primary);
  font-family: var(--display-font);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}

.site-brand:hover {
  color: var(--accent-dark);
}

.brand-mark {
  display: grid;
  width: 2.1rem;
  height: 2.1rem;
  color: #fff;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.05em;
  background: linear-gradient(145deg, var(--accent), var(--accent-dark));
  border-radius: 0.55rem 0.55rem 0.55rem 0.15rem;
  place-items: center;
}

.site-nav {
  display: flex;
  gap: 1.35rem;
  align-items: center;
}

.site-nav a {
  position: relative;
  color: var(--text-secondary);
  font-size: 0.86rem;
  font-weight: 650;
  text-decoration: none;
}

.site-nav a:not(.lab-link)::after {
  position: absolute;
  right: 0;
  bottom: -0.38rem;
  left: 0;
  height: 2px;
  content: "";
  background: var(--accent-warm);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.18s ease;
}

.site-nav a:hover {
  color: var(--accent-dark);
}

.site-nav a:not(.lab-link):hover::after,
.site-nav a:not(.lab-link):focus-visible::after {
  transform: scaleX(1);
  transform-origin: left;
}

.site-nav .lab-link {
  padding: 0.48rem 0.75rem;
  color: var(--accent-dark);
  background: var(--accent-light);
  border-radius: 999px;
}

.site-nav .lab-link:hover {
  color: #fff;
  background: var(--accent-dark);
}

.nav-toggle {
  display: none;
  min-height: 44px;
  gap: 0.5rem;
  align-items: center;
  padding: 0.45rem 0.65rem;
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 650;
  cursor: pointer;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
}

.nav-toggle-icon,
.nav-toggle-icon::before,
.nav-toggle-icon::after {
  display: block;
  width: 1rem;
  height: 2px;
  content: "";
  background: currentColor;
  transition: transform 0.18s ease;
}

.nav-toggle-icon {
  position: relative;
}

.nav-toggle-icon::before {
  position: absolute;
  top: -5px;
}

.nav-toggle-icon::after {
  position: absolute;
  top: 5px;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon {
  background: transparent;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon::before {
  top: 0;
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon::after {
  top: 0;
  transform: rotate(-45deg);
}

.container {
  width: min(calc(100% - 3rem), var(--wide));
  margin-inline: auto;
}

.wide-container {
  max-width: var(--wide);
}

.prose-container {
  max-width: 850px;
}

.narrow-container {
  max-width: 700px;
}

.section {
  padding: 4.5rem 1.5rem;
}

.section-alt {
  background: var(--bg-alt);
  border-block: 1px solid rgb(45 100 115 / 10%);
}

.hero-section {
  position: relative;
  padding-top: 5.5rem;
  padding-bottom: 5rem;
  overflow: hidden;
  background:
    radial-gradient(circle at 88% 12%, rgb(179 95 62 / 12%), transparent 27rem),
    linear-gradient(135deg, #edf4f3 0%, #f8f4ee 100%);
  border-bottom: 1px solid rgb(45 100 115 / 16%);
}

.hero-section::before {
  position: absolute;
  top: -9rem;
  left: -8rem;
  width: 24rem;
  height: 24rem;
  pointer-events: none;
  content: "";
  border: 1px solid rgb(45 100 115 / 14%);
  border-radius: 50%;
  box-shadow:
    0 0 0 3rem rgb(45 100 115 / 4%),
    0 0 0 7rem rgb(45 100 115 / 3%);
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(290px, 0.75fr);
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: center;
}

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

.hero-eyebrow {
  margin: 0 0 0.8rem;
  color: var(--accent-warm);
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero-title {
  margin: 0;
  color: var(--accent-dark);
  font-family: var(--display-font);
  font-size: clamp(3.6rem, 7vw, 5.5rem);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 0.95;
}

.hero-subtitle {
  max-width: 720px;
  margin: 1rem 0 1.5rem;
  color: var(--text-secondary);
  font-family: var(--display-font);
  font-size: 1.45rem;
  line-height: 1.4;
}

.author-list {
  margin: 0 0 0.3rem;
  font-size: 1.03rem;
}

.author-list a {
  color: var(--text-primary);
  text-decoration: none;
  border-bottom: 1px dashed var(--border);
}

.author-list a:hover {
  color: var(--accent-dark);
  border-bottom-color: var(--accent-dark);
}

.author-list sup,
.equal-note sup {
  color: var(--accent);
}

.equal-note {
  margin: 0 0 0.45rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.affiliation-list {
  max-width: 760px;
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.86rem;
  line-height: 1.55;
}

.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-start;
  margin-top: 1.35rem;
}

.link-row a {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
  padding: 0.58rem 1.1rem;
  color: var(--text-primary);
  font-size: 0.94rem;
  font-weight: 650;
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition:
    background-color 0.18s,
    border-color 0.18s;
}

.link-row a:hover {
  color: var(--accent-dark);
  background: #fff;
  border-color: var(--accent);
}

.link-row a:first-child {
  color: #fff;
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.link-row a:first-child:hover {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
  background: rgb(255 255 255 / 76%);
  border: 1px solid rgb(45 100 115 / 24%);
  border-radius: 1.5rem 1.5rem 1.5rem 0.35rem;
  box-shadow: 0 1.4rem 3.5rem rgb(29 72 87 / 10%);
  backdrop-filter: blur(8px);
}

.stat-card {
  min-width: 0;
  padding: 1.45rem 1.25rem;
  text-align: left;
  border-right: 1px solid rgb(45 100 115 / 18%);
  border-bottom: 1px solid rgb(45 100 115 / 18%);
}

.stat-card:nth-child(2n) {
  border-right: 0;
}

.stat-card:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.stat-number {
  display: block;
  color: var(--accent-dark);
  font-family: var(--display-font);
  font-size: 1.65rem;
  font-weight: 600;
  line-height: 1.2;
}

.stat-label {
  display: block;
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.4;
}

.section-heading {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  margin: 0 0 2rem;
  color: var(--accent-dark);
  font-family: var(--display-font);
  font-size: clamp(2rem, 4vw, 2.55rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
  text-align: left;
}

.section-heading::before {
  width: 2.25rem;
  height: 3px;
  flex: 0 0 auto;
  content: "";
  background: var(--accent-warm);
  border-radius: 999px;
}

.section-intro {
  max-width: 850px;
  margin: -0.7rem 0 2rem;
  color: var(--text-secondary);
  font-size: 1.02rem;
  line-height: 1.75;
  text-align: left;
}

.code-block {
  padding: 1.5rem 1.7rem;
  margin: 0;
  overflow-x: auto;
  color: var(--code-text);
  background: var(--code-bg);
  border-top: 4px solid var(--accent);
  border-radius: 0.25rem 1rem 1rem 1rem;
  box-shadow: 0 1.2rem 2.8rem rgb(23 37 47 / 12%);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.85rem;
  line-height: 1.8;
  white-space: pre;
}

.code-block .comment {
  color: #9399b2;
}

.center-note {
  margin: 1rem auto 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
  text-align: center;
}

.center-note a,
.inline-links a {
  color: var(--text-primary);
}

.abstract-text {
  margin: 0;
  color: var(--text-primary);
  font-family: var(--display-font);
  font-size: 1.17rem;
  line-height: 1.9;
}

.paper-figure {
  padding: clamp(0.65rem, 2vw, 1.15rem);
  margin: 0;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1.1rem 1.1rem 1.1rem 0.3rem;
  box-shadow: 0 1rem 2.8rem rgb(29 72 87 / 7%);
}

.figure-button {
  display: block;
  width: 100%;
  padding: 0;
  margin: 0;
  cursor: zoom-in;
  background: transparent;
  border: 0;
  border-radius: 0.75rem;
}

.figure-button img {
  width: 100%;
  height: auto;
  border-radius: 0.75rem;
  transition: opacity 0.18s;
}

.figure-button:hover img {
  opacity: 0.9;
}

.fig-caption {
  max-width: 1050px;
  padding-left: 0.75rem;
  margin: 0.9rem 0 0;
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.55;
  text-align: left;
  border-left: 3px solid var(--accent);
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: 2.75rem;
  align-items: center;
}

.column-copy {
  padding: 1.5rem;
  color: var(--text-primary);
  font-size: 1rem;
  line-height: 1.75;
  background: rgb(255 255 255 / 72%);
  border-left: 4px solid var(--accent-warm);
  border-radius: 0 0.8rem 0.8rem 0;
}

.column-copy p {
  margin: 0 0 1rem;
}

.inline-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  font-size: 0.92rem;
}

.tabs-component {
  padding: clamp(1rem, 2vw, 1.5rem);
  margin-top: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem 1rem 1rem 0.25rem;
  box-shadow: 0 1rem 2.8rem rgb(29 72 87 / 6%);
}

.tabs {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 1.25rem;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  -webkit-overflow-scrolling: touch;
}

.tabs button {
  min-height: 44px;
  padding: 0.6rem 1.05rem;
  color: var(--text-primary);
  font-size: 0.88rem;
  font-weight: 650;
  cursor: pointer;
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
}

.tabs button:hover {
  color: var(--accent-dark);
  background: var(--bg-alt);
}

.tabs button[aria-selected="true"] {
  color: var(--accent-dark);
  background: var(--accent-light);
  border-bottom-color: var(--accent-warm);
}

.tab-panel {
  max-width: 1050px;
  margin-inline: auto;
}

.js .tab-panel {
  display: none;
}

.js .tab-panel.is-active {
  display: block;
}

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  -webkit-overflow-scrolling: touch;
}

.results-table {
  width: 100%;
  min-width: 850px;
  color: var(--text-primary);
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
  border-collapse: collapse;
}

.efficiency-table {
  min-width: 640px;
}

.results-table th,
.results-table td {
  padding: 0.7rem 0.75rem;
  text-align: center;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}

.results-table thead th {
  color: #fff;
  font-size: 0.82rem;
  font-weight: 650;
  background: var(--accent-dark);
}

.results-table tbody th {
  text-align: left;
}

.results-table tbody tr:last-child th,
.results-table tbody tr:last-child td {
  border-bottom: 0;
}

.results-table .highlight-row th,
.results-table .highlight-row td {
  background: var(--accent-light);
}

.tab-note {
  max-width: 820px;
  margin: 0.85rem auto 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.6;
  text-align: center;
}

.evidence-audit-wrap {
  max-width: 1120px;
  margin: 3rem auto 0;
}

.evidence-audit {
  display: grid;
  gap: 1.25rem;
}

.evidence-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: end;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.evidence-kicker {
  margin: 0 0 0.45rem;
  color: var(--accent-warm);
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.evidence-intro h3 {
  margin: 0;
  color: var(--accent-dark);
  font-family: var(--display-font);
  font-size: clamp(1.7rem, 3vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.18;
}

.evidence-intro > p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.94rem;
  line-height: 1.7;
}

.evidence-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(310px, 0.65fr);
  gap: 1rem;
  align-items: stretch;
}

.evidence-card {
  padding: clamp(1rem, 2vw, 1.4rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem 1rem 1rem 0.25rem;
  box-shadow: 0 1rem 2.5rem rgb(29 72 87 / 6%);
}

.evidence-card-heading {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.evidence-card-heading h4 {
  margin: 0;
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 750;
  line-height: 1.3;
}

.evidence-card-heading p {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.45;
}

.preference-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  justify-content: flex-end;
}

.preference-legend span {
  display: inline-flex;
  gap: 0.3rem;
  align-items: center;
  color: var(--muted);
  font-size: 0.72rem;
  white-space: nowrap;
}

.preference-legend i {
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 2px;
}

.legend-win,
.bar-win {
  background: var(--accent);
}

.legend-tie,
.bar-tie {
  background: #8f9694;
}

.legend-loss,
.bar-loss {
  background: var(--accent-warm);
}

.preference-rows {
  display: grid;
  gap: 1rem;
  margin-top: 1.15rem;
}

.preference-row {
  display: grid;
  grid-template-columns: 8rem minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
}

.preference-label {
  display: grid;
  gap: 0.1rem;
}

.preference-label strong {
  color: var(--text-primary);
  font-size: 0.82rem;
  line-height: 1.35;
}

.preference-label sup {
  color: var(--accent-warm);
}

.preference-label span {
  color: var(--muted);
  font-size: 0.72rem;
}

.preference-visual {
  min-width: 0;
}

.stacked-bar {
  display: flex;
  width: 100%;
  height: 1.15rem;
  overflow: hidden;
  background: var(--bg-alt);
  border: 1px solid rgb(45 100 115 / 14%);
  border-radius: 999px;
}

.stacked-bar .bar-win {
  flex: 0 0 var(--win);
}

.stacked-bar .bar-tie {
  flex: 0 0 var(--tie);
}

.stacked-bar .bar-loss {
  flex: 0 0 var(--loss);
}

.preference-counts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem;
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
}

.preference-counts span:nth-child(2) {
  text-align: center;
}

.preference-counts span:last-child {
  text-align: right;
}

.preference-counts strong {
  color: var(--text-primary);
  font-size: 0.75rem;
}

.evidence-takeaway {
  padding: 0.75rem 0.85rem;
  margin: 1.1rem 0 0;
  color: var(--text-secondary);
  font-size: 0.8rem;
  line-height: 1.55;
  background: var(--accent-light);
  border-radius: 0.55rem;
}

.evidence-footnote {
  margin: 0.8rem 0 0;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.55;
}

.evidence-footnote sup {
  color: var(--accent-warm);
}

.audit-card {
  display: flex;
  flex-direction: column;
}

.audit-scores {
  display: grid;
  gap: 1rem;
  margin-top: 1.2rem;
}

.audit-score-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}

.audit-score-label span {
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 650;
}

.audit-score-label strong {
  color: var(--accent-dark);
  font-family: var(--display-font);
  font-size: 1.4rem;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.audit-score-comparator .audit-score-label strong {
  color: #6b7780;
}

.audit-meter {
  height: 0.62rem;
  overflow: hidden;
  background: var(--bg-alt);
  border-radius: 999px;
}

.audit-meter span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
}

.audit-score-comparator .audit-meter span {
  background: #7f8a92;
}

.audit-secondary {
  display: grid;
  gap: 0.85rem;
  padding-top: 1rem;
  margin-top: 1.15rem;
  border-top: 1px solid var(--border);
}

.audit-secondary > div {
  padding: 0.75rem;
  background: var(--bg-alt);
  border-radius: 0.6rem;
}

.audit-secondary-label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.audit-secondary p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.77rem;
}

.audit-secondary p strong {
  color: var(--accent-dark);
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

.audit-secondary p span {
  margin-inline: 0.25rem;
  color: var(--muted);
}

.audit-triplet {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem;
}

.audit-triplet span {
  display: grid;
  gap: 0.05rem;
  color: var(--muted);
  font-size: 0.7rem;
  text-align: center;
}

.audit-triplet strong {
  color: var(--text-primary);
  font-family: var(--display-font);
  font-size: 1.12rem;
  font-variant-numeric: tabular-nums;
}

.audit-note {
  margin: auto 0 0;
  padding-top: 1rem;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.55;
}

.evidence-method {
  padding: 0.85rem 1rem;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.7rem;
}

.evidence-method summary {
  color: var(--accent-dark);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.evidence-method p {
  max-width: 920px;
  margin: 0.65rem 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.65;
}

.schema-block {
  max-width: 520px;
  padding: 1.2rem 1.5rem;
  margin: 0 auto;
  overflow-x: auto;
  color: var(--code-text);
  background: var(--code-bg);
  border-top: 4px solid var(--accent);
  border-radius: 0.25rem 0.9rem 0.9rem 0.9rem;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.95rem;
  line-height: 1.8;
}

.bibtex-block {
  position: relative;
  padding: 1rem 1.2rem 0.55rem;
  color: var(--text-primary);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 0.2rem 0.9rem 0.9rem 0.2rem;
  box-shadow: 0 1rem 2.8rem rgb(29 72 87 / 6%);
}

.bibtex-block pre {
  margin: 0;
  overflow-x: auto;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.8rem;
  line-height: 1.6;
  white-space: pre;
}

.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
  padding: 0.3rem 0.7rem;
  color: var(--text-primary);
  font-size: 0.75rem;
  cursor: pointer;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 4px;
}

.copy-btn:hover {
  color: var(--accent-dark);
  border-color: var(--accent);
}

.copy-btn.is-copied {
  color: #fff;
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.copy-status {
  min-height: 1rem;
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.research-note {
  padding-top: 1rem;
  margin: 1.2rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.6;
  border-top: 1px solid var(--border);
}

.footer {
  padding: 2.4rem 1.5rem;
  color: #c7d4d8;
  text-align: center;
  background: #132f3b;
}

.footer-content p {
  margin: 0;
  font-size: 0.88rem;
}

.footer-content a {
  color: #f4f7f7;
}

.lightbox {
  width: min(96vw, 1500px);
  max-width: none;
  max-height: 95vh;
  padding: 2.5rem 1rem 1rem;
  overflow: auto;
  background: transparent;
  border: 0;
}

.lightbox::backdrop {
  background: rgb(0 0 0 / 86%);
}

.lightbox img {
  width: auto;
  max-width: 100%;
  max-height: calc(95vh - 3.5rem);
  margin: 0 auto;
  object-fit: contain;
  border-radius: 6px;
}

.lightbox-close {
  position: fixed;
  top: 0.8rem;
  right: 1rem;
  display: grid;
  width: 2.3rem;
  height: 2.3rem;
  padding: 0;
  color: #fff;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  background: rgb(0 0 0 / 70%);
  border: 1px solid rgb(255 255 255 / 55%);
  border-radius: 50%;
  place-items: center;
}

@media (max-width: 1040px) {
  .site-nav {
    gap: 0.8rem;
  }

  .site-nav a {
    font-size: 0.8rem;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

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

  .hero-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    max-width: 900px;
  }

  .stat-card,
  .stat-card:nth-child(2n),
  .stat-card:nth-last-child(-n + 2) {
    border-right: 1px solid rgb(45 100 115 / 18%);
    border-bottom: 0;
  }

  .stat-card:last-child {
    border-right: 0;
  }
}

@media (max-width: 900px) {
  .two-column {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .column-copy {
    max-width: 760px;
    margin-inline: auto;
  }

  .evidence-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .site-header {
    top: 0.45rem;
  }

  .header-inner {
    min-height: 3.5rem;
    padding: 0.45rem 0.55rem;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    position: absolute;
    top: calc(100% + 0.45rem);
    right: 0;
    left: 0;
    display: grid;
    gap: 0.2rem;
    padding: 0.55rem;
    pointer-events: none;
    visibility: hidden;
    background: rgb(255 255 255 / 97%);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    box-shadow: 0 1rem 2.5rem rgb(24 35 45 / 16%);
    opacity: 0;
    transform: translateY(-0.4rem);
    transition:
      opacity 0.18s ease,
      transform 0.18s ease,
      visibility 0.18s;
    backdrop-filter: blur(14px);
  }

  .site-nav.is-open {
    pointer-events: auto;
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
  }

  .evidence-intro {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .site-nav a,
  .site-nav .lab-link {
    display: flex;
    min-height: 44px;
    padding: 0.65rem 0.75rem;
    align-items: center;
    font-size: 0.9rem;
    border-radius: 0.5rem;
  }

  .site-nav a:not(.lab-link)::after {
    display: none;
  }

  html:not(.js) .nav-toggle {
    display: none;
  }

  html:not(.js) .site-nav {
    position: static;
    display: flex;
    padding: 0;
    pointer-events: auto;
    visibility: visible;
    border: 0;
    box-shadow: none;
    opacity: 1;
    transform: none;
  }

  .container {
    width: min(calc(100% - 2rem), var(--wide));
  }

  .section {
    padding: 3.5rem 1rem;
  }

  .hero-section {
    padding-top: 5.4rem;
    padding-bottom: 3.75rem;
  }

  .hero-title {
    font-size: clamp(3rem, 14vw, 4.3rem);
  }

  .hero-subtitle {
    font-size: 1.22rem;
  }

  .author-list {
    font-size: 1rem;
  }

  .affiliation-list {
    font-size: 0.86rem;
  }

  .stat-card {
    min-width: 0;
    padding: 1rem 0.85rem;
  }

  .stat-number {
    font-size: 1.3rem;
  }

  .stat-label {
    font-size: 0.75rem;
  }

  .section-heading {
    margin-bottom: 1.5rem;
    font-size: 1.85rem;
  }

  .abstract-text,
  .column-copy {
    font-size: 1rem;
  }

  .code-block {
    padding: 1rem;
    font-size: 0.78rem;
  }

  .tabs {
    justify-content: flex-start;
  }

  .tabs button {
    flex: 1 0 auto;
  }

  .bibtex-block {
    padding-right: 0.8rem;
    padding-left: 0.8rem;
  }

  .bibtex-block pre {
    padding-top: 1.8rem;
    font-size: 0.72rem;
  }
}

@media (max-width: 620px) {
  .hero-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat-card,
  .stat-card:nth-child(2n),
  .stat-card:nth-last-child(-n + 2) {
    border-right: 1px solid rgb(45 100 115 / 18%);
    border-bottom: 1px solid rgb(45 100 115 / 18%);
  }

  .stat-card:nth-child(2n) {
    border-right: 0;
  }

  .stat-card:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .evidence-audit-wrap {
    margin-top: 2.25rem;
  }

  .evidence-card-heading {
    display: grid;
  }

  .preference-legend {
    justify-content: flex-start;
  }

  .preference-row {
    grid-template-columns: 1fr;
    gap: 0.45rem;
  }

  .preference-label {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
  }

  .preference-counts {
    font-size: 0.68rem;
  }

}

@media (max-width: 430px) {
  .hero-grid {
    width: 100%;
  }

  .site-brand {
    font-size: 1.08rem;
  }

  .brand-mark {
    width: 1.9rem;
    height: 1.9rem;
  }

  .nav-toggle {
    padding: 0.42rem 0.55rem;
  }

  .hero-title {
    font-size: clamp(2.6rem, 12vw, 3.25rem);
  }

  .link-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }

  .link-row a {
    justify-content: center;
    min-width: 0;
    padding: 0.45rem 0.3rem;
    font-size: 0.8rem;
  }

  .stat-card {
    min-width: 0;
  }

  .stat-number {
    font-size: 1.22rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .link-row,
  .copy-btn,
  .lightbox,
  .footer {
    display: none !important;
  }

  .section,
  .hero-section {
    padding-block: 1.5rem;
  }

  .section-alt,
  .footer,
  .results-table .highlight-row th,
  .results-table .highlight-row td {
    background: #fff;
  }

  .js .tab-panel {
    display: block;
    margin-bottom: 1.5rem;
  }

  .tabs {
    display: none;
  }
}
