:root {
  color-scheme: light;
  --ink: #172026;
  --muted: #5c6870;
  --line: #d7e0e4;
  --paper: #f6f8f8;
  --white: #ffffff;
  --teal: #087f83;
  --teal-dark: #075e62;
  --red: #b2413a;
  --gold: #b98919;
  --soft-teal: #eaf6f5;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 15px clamp(20px, 5vw, 72px);
  border-bottom: 1px solid var(--line);
  background: rgba(246, 248, 248, 0.95);
  backdrop-filter: blur(12px);
}

.brand {
  color: var(--ink);
  font-size: 18px;
  font-weight: 850;
  text-decoration: none;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

nav a {
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}

nav a:hover,
nav a[aria-current="page"] {
  color: var(--teal);
}

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

.hero,
.section {
  padding-inline: clamp(20px, 5vw, 72px);
}

.paper-hero {
  display: flex;
  align-items: center;
  flex-direction: column;
  min-height: auto;
  padding-top: clamp(52px, 7vw, 88px);
  padding-bottom: 42px;
  text-align: center;
  background:
    linear-gradient(135deg, rgba(8, 127, 131, 0.12), transparent 38%),
    linear-gradient(20deg, rgba(178, 65, 58, 0.08), transparent 50%),
    var(--white);
}

.venue,
.eyebrow {
  margin: 0 0 12px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.paper-hero h1 {
  width: min(1060px, 100%);
  margin: 0;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.08;
  letter-spacing: 0;
}

.author-block {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 24px;
  width: min(980px, 100%);
  margin-top: 24px;
  color: var(--ink);
  font-size: clamp(17px, 1.8vw, 21px);
  font-weight: 720;
  line-height: 1.45;
}

.author-block span {
  white-space: nowrap;
}

.affiliation-line {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 20px;
  width: min(860px, 100%);
  margin-top: 8px;
  color: var(--muted);
  font-size: clamp(14px, 1.35vw, 16px);
  line-height: 1.45;
}

.author-note {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 16px;
  width: min(820px, 100%);
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.author-block sup,
.affiliation-line sup,
.author-note sup {
  margin-left: 2px;
  color: var(--teal);
  font-size: 0.68em;
  font-weight: 780;
}

.actions,
.pdf-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.paper-nav {
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}

.paper-nav a {
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 700;
}

.paper-nav a:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: var(--white);
  font-weight: 750;
  text-decoration: none;
}

.button.primary {
  color: var(--white);
  border-color: var(--teal);
  background: var(--teal);
}

.button:hover {
  border-color: var(--teal);
}

.button.disabled {
  color: #8a969d;
  cursor: default;
  pointer-events: none;
  background: #eef2f3;
}

.hero-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  width: min(1060px, 100%);
  margin-top: 44px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
  text-align: left;
}

.hero-summary article {
  min-height: 116px;
  padding: 22px;
  background: rgba(255, 255, 255, 0.92);
}

.hero-summary strong {
  display: block;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1;
}

.hero-summary span {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
}

.section {
  display: block;
  padding-top: 64px;
  padding-bottom: 64px;
  border-top: 1px solid var(--line);
}

.compact-section {
  padding-top: 52px;
  padding-bottom: 52px;
}

.section:nth-of-type(even) {
  background: var(--white);
}

.section-inner {
  width: min(1180px, 100%);
  margin-inline: auto;
}

.section-inner > h2 {
  width: 100%;
  margin-inline: 0;
  position: relative;
  margin-top: 0;
  margin-bottom: 28px;
  padding-bottom: 16px;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(24px, 2.4vw, 30px);
  line-height: 1.15;
  letter-spacing: 0;
  border-bottom: 1px solid var(--line);
}

.section-inner > h2::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 60px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, #3268e8, var(--teal));
}

.section-body {
  width: 100%;
  margin-inline: 0;
  min-width: 0;
}

.section-body > p {
  max-width: 1180px;
  margin: 0 0 18px;
  color: #65708a;
  font-size: clamp(16px, 1.5vw, 19px);
  line-height: 1.55;
}

.figure-block {
  margin: 0 0 24px;
}

.figure-block img {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.method-figure-stack img + img {
  margin-top: 18px;
}

.figure-block figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
}

.highlight-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.highlight-grid article {
  min-height: 250px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.highlight-grid span {
  display: inline-flex;
  margin-bottom: 12px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.highlight-grid h3 {
  margin: 0 0 10px;
  min-height: 74px;
  font-size: 22px;
  line-height: 1.12;
}

.highlight-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.48;
}

.resource-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.resource-strip a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: var(--white);
  font-size: 14px;
  font-weight: 750;
  text-decoration: none;
}

.resource-strip a:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.citation-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.copy-button {
  position: absolute;
  top: 14px;
  right: 14px;
  min-height: 34px;
  padding: 7px 12px;
  font-size: 13px;
}

.citation-card pre {
  margin: 0;
  padding: 24px;
  padding-right: 150px;
  overflow-x: auto;
  color: #26323a;
  background: #fbfcfc;
  font-size: 14px;
  line-height: 1.5;
}

.benchmark-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
  margin-top: 22px;
}

.benchmark-page {
  min-height: calc(100vh - 54px);
  border-top: 0;
}

.benchmark-standalone {
  margin-top: 28px;
}

.benchmark-chart-card {
  margin-bottom: 0;
}

.chart-panel {
  display: grid;
  grid-template-columns: minmax(420px, 1.05fr) minmax(400px, 0.95fr);
  gap: 22px;
  align-items: stretch;
  width: min(1500px, 100%);
  margin-inline: auto;
  padding: clamp(18px, 3vw, 30px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.chart-canvas {
  position: relative;
  display: grid;
  place-items: center;
  min-height: clamp(520px, 62vh, 720px);
  overflow: hidden;
  border: 1px solid rgba(215, 224, 228, 0.75);
  border-radius: 8px;
  cursor: grab;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 18px 38px rgba(23, 32, 38, 0.08);
  touch-action: none;
}

.chart-canvas.dragging {
  cursor: grabbing;
}

.chart-canvas svg {
  width: min(620px, 96%);
  height: auto;
  overflow: visible;
  transform: translate(var(--pan-x, 0px), var(--pan-y, 0px)) scale(var(--zoom, 1));
  transform-origin: center;
  transition: transform 120ms ease-out;
}

.domain-slice {
  cursor: pointer;
  opacity: 0;
  stroke: var(--white);
  stroke-width: 4;
  transform-box: fill-box;
  transform-origin: center;
  animation: slice-in 620ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: opacity 160ms ease, transform 160ms ease, filter 160ms ease;
}

.domain-slice:hover,
.domain-slice.active {
  opacity: 1;
  transform: scale(1.045);
  filter: drop-shadow(0 12px 12px rgba(23, 32, 38, 0.16));
}

.domain-label {
  fill: #314049;
  font-size: 13px;
  font-weight: 750;
  pointer-events: none;
}

.chart-core {
  fill: #e8f5f3;
  stroke: #cddfe1;
  stroke-width: 2;
}

.chart-core-title {
  fill: var(--ink);
  font-size: 15px;
  font-weight: 850;
}

.chart-core-count {
  fill: var(--teal);
  font-size: 36px;
  font-weight: 900;
}

.chart-core-subtitle {
  fill: var(--muted);
  font-size: 13px;
}

.chart-info {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
}

.chart-kicker {
  color: var(--teal);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chart-info h3 {
  margin-top: 10px;
  font-size: clamp(22px, 2.4vw, 30px);
}

.chart-info p {
  margin: 0;
  color: var(--muted);
  font-size: 17px;
}

.chart-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.chart-metrics div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft-teal);
}

.chart-metrics b,
.chart-metrics span {
  display: block;
}

.chart-metrics b {
  color: var(--teal-dark);
  font-size: 26px;
  line-height: 1;
}

.chart-metrics span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.chart-info {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.risk-bars {
  display: grid;
  gap: 12px;
  width: min(100%, 560px);
  margin-top: 0;
  padding-top: 0;
}

.risk-bars span {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  isolation: isolate;
  min-height: 36px;
  padding: 7px 12px;
  border-radius: 6px;
  color: #26323a;
  background: rgba(255, 255, 255, 0.88);
  font-size: 13px;
  font-weight: 750;
}

.risk-bars span::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  z-index: -1;
  width: 25%;
  border-radius: inherit;
  background: var(--bar);
}

.risk-bars span::after {
  content: "25%";
  flex: 0 0 auto;
  margin-left: 18px;
  color: var(--muted);
}

.anonymous-host .chart-canvas {
  min-height: clamp(400px, 42vw, 560px);
}

.anonymous-host .chart-canvas svg {
  width: min(820px, 112%);
}

.anonymous-host .chart-info {
  justify-content: flex-start;
  gap: clamp(20px, 3vw, 36px);
}

.benchmark-table table {
  min-width: 0;
}

.benchmark-tables {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  gap: 18px;
}

.benchmark-tables .table-card {
  height: 100%;
}

.benchmark-tables td:not(:first-child),
.benchmark-tables th:not(:first-child) {
  text-align: right;
}

@keyframes slice-in {
  from {
    opacity: 0;
    transform: scale(0.86) rotate(-5deg);
  }
  to {
    opacity: 0.92;
    transform: scale(1) rotate(0);
  }
}

.method-grid,
.note-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.method-grid article,
.note-grid article,
.table-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.method-grid article,
.note-grid article {
  padding: 20px;
}

.method-grid span {
  color: var(--red);
  font-weight: 850;
}

h3 {
  margin: 8px 0 8px;
  font-size: 18px;
  line-height: 1.2;
}

.method-grid p,
.note-grid p,
.table-title p {
  margin: 0;
  color: var(--muted);
}

.note-grid {
  margin-bottom: 18px;
}

.experiment-table-main {
  margin-top: 18px;
}

.note-grid b {
  display: block;
  margin-bottom: 8px;
  font-size: 18px;
}

.table-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
  margin-top: 18px;
}

.table-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.table-card-compact {
  width: min(760px, 100%);
  margin: 24px auto 0;
}

.table-2-card {
  box-shadow: 0 18px 42px rgba(23, 32, 38, 0.06);
}

.table-title {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--soft-teal);
}

.table-title h3 {
  margin: 0 0 4px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  background: var(--white);
}

.distribution-table {
  min-width: 0;
}

.framework-table {
  min-width: 920px;
}

.framework-table .model-cell {
  width: 150px;
  color: var(--ink);
  font-weight: 850;
  text-align: center;
  vertical-align: middle;
  background: rgba(234, 246, 245, 0.42);
}

.framework-table td {
  text-align: right !important;
}

.framework-table th:first-child,
.framework-table th:nth-child(2),
.framework-table tr:has(.model-cell) td:nth-child(2),
.framework-table tr:not(:has(.model-cell)) td:first-child {
  text-align: left !important;
}

.framework-table th:nth-child(n+3) {
  text-align: right !important;
}

.framework-table .model-cell {
  text-align: center !important;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tr.ours td {
  color: var(--teal-dark);
  background: #f0faf8;
  font-weight: 850;
}

tr.risk-row td:first-child {
  color: var(--muted);
}

tr.risk-row td:last-child {
  font-weight: 750;
}

.table-grid .table-title {
  min-height: 124px;
}

.table-grid .table-wrap {
  flex: 1;
  overflow-x: hidden;
}

.table-grid table {
  height: 100%;
  min-width: 0;
  table-layout: auto;
}

.table-grid th,
.table-grid td {
  padding-inline: 14px;
}

.table-grid td:not(:first-child),
.table-grid th:not(:first-child) {
  text-align: right;
}

@media (max-width: 980px) {
  .section {
    grid-template-columns: 1fr;
  }

  .method-grid,
  .highlight-grid,
  .note-grid,
  .table-grid,
  .benchmark-layout {
    grid-template-columns: 1fr;
  }

  .chart-panel {
    grid-template-columns: 1fr;
  }

  .benchmark-tables {
    grid-template-columns: 1fr;
  }

  .hero-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .table-grid .table-title {
    min-height: 0;
  }

  .table-grid .table-wrap {
    overflow-x: auto;
  }

  .table-grid table {
    min-width: 560px;
  }
}

@media (max-width: 620px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  nav {
    gap: 12px;
  }

  .paper-hero h1 {
    font-size: 38px;
  }

  .hero-summary {
    grid-template-columns: 1fr;
  }

  .section {
    padding-top: 46px;
    padding-bottom: 46px;
  }

  .citation-card pre {
    padding-top: 64px;
    padding-right: 20px;
  }

}
