:root {
  color-scheme: light;
  --ink: #20211f;
  --muted: #646860;
  --paper: #fbfbf8;
  --surface: #ffffff;
  --line: #deded7;
  --line-strong: #bfc7bd;
  --teal: #1b7c72;
  --teal-dark: #105f58;
  --brick: #a54836;
  --gold: #c4952f;
  --shadow: 0 18px 45px rgba(32, 33, 31, 0.08);
}

* {
  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.65;
}

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

button,
a {
  font: inherit;
}

.container {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.wide {
  width: min(1680px, calc(100% - 32px));
}

.medium {
  width: min(1040px, calc(100% - 40px));
}

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

.site-header {
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(251, 251, 248, 0.98)),
    radial-gradient(circle at top left, rgba(27, 124, 114, 0.14), transparent 34%);
}

.hero {
  padding: 58px 0 38px;
  text-align: center;
}

.eyebrow {
  margin: 0;
  color: var(--teal-dark);
  font-size: 0.78rem;
  font-weight: 760;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 1040px;
  margin: 0 auto 20px;
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
  font-size: clamp(1.95rem, 5.4vw, 3.55rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.title-emoji {
  display: inline-block;
  margin-right: 0.16em;
  color: initial;
  -webkit-text-fill-color: initial;
}

.title-text {
  background: linear-gradient(90deg, #479ff8 0%, #ffa094 100%);
  background-clip: text;
  color: transparent;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

h2 {
  margin: 0 0 22px;
  font-size: clamp(1.55rem, 3.6vw, 2.35rem);
  line-height: 1.15;
  letter-spacing: 0;
}

h3 {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.22;
  letter-spacing: 0;
}

.authors {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 6px 18px;
  max-width: 900px;
  margin: 0 auto;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 650;
}

.authors span {
  white-space: nowrap;
}

.authors a {
  color: inherit;
  text-decoration: none;
}

.authors a:hover {
  color: var(--teal-dark);
  text-decoration: underline;
}

.authors sup {
  font-size: 0.68em;
  line-height: 1;
  vertical-align: super;
}

.affiliations,
.note {
  margin: 12px auto 0;
  color: var(--muted);
}

.note {
  margin-top: 4px;
  font-size: 0.9rem;
}

.paper-links {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
}

.paper-links a,
.paper-links .disabled-link,
.video-controls button {
  min-height: 42px;
  padding: 8px 16px;
  border: 1px solid var(--teal);
  border-radius: 999px;
  background: var(--teal);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

.paper-links .disabled-link {
  border-color: var(--line-strong);
  background: #f4f5f1;
  color: var(--muted);
  cursor: not-allowed;
}

.paper-links a:hover,
.video-controls button:hover {
  border-color: var(--teal-dark);
  background: var(--teal-dark);
  transform: translateY(-1px);
}

.section {
  padding: 46px 0;
}

.teaser-section {
  background: var(--surface);
  padding-bottom: 28px;
}

.teaser-section h2 {
  margin-bottom: 10px;
}

.teaser {
  margin: 0;
}

.teaser img {
  width: 100%;
  height: auto;
  margin-top: -4px;
}

.abstract-section p {
  margin: 0;
  color: #343630;
  font-size: 1.04rem;
  text-align: justify;
}

.methods-section {
  background: var(--surface);
  border-top: 1px solid var(--line);
}

.method-animation-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}

.method-animation {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 100%;
}

.method-animation h3 {
  margin-bottom: 10px;
  font-size: 1.08rem;
  font-weight: 760;
}

.method-animation video {
  width: 100%;
  height: clamp(260px, 27vw, 420px);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  object-fit: contain;
}

.interactive-results {
  margin-top: 36px;
}

.wrapper-results {
  margin-top: 36px;
}

.results-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.results-heading h3 {
  margin: 0;
  font-size: clamp(1.35rem, 2.7vw, 1.9rem);
  font-weight: 760;
}

.results-subtitle {
  margin: 2px 0 0;
  color: var(--teal-dark);
  font-size: 0.78rem;
  font-weight: 760;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.result-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.result-tabs button {
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.result-tabs button.active,
.result-tabs button:hover {
  border-color: var(--teal);
  background: rgba(27, 124, 114, 0.09);
  color: var(--teal-dark);
}

.chart-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 18px;
  align-items: stretch;
}

.chart-wrap,
.chart-details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.chart-wrap {
  min-height: 360px;
  padding: 10px 12px 8px;
}

.assistive-chart {
  display: block;
  width: 100%;
  height: 380px;
}

.chart-bar {
  cursor: pointer;
  transition:
    opacity 140ms ease,
    filter 140ms ease;
}

.chart-bar:hover,
.chart-bar:focus {
  filter: brightness(0.94);
  outline: none;
}

.chart-axis text,
.chart-value,
.chart-label {
  fill: var(--muted);
  font-family: inherit;
}

.chart-value {
  fill: var(--ink);
  font-size: 12px;
  font-weight: 680;
}

.chart-label {
  font-size: 11px;
}

.chart-details {
  padding: 16px;
}

.chart-details h4 {
  margin: 0;
  font-size: 1.05rem;
}

.chart-details p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.chart-note,
.leaderboard-note {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.leaderboard-note {
  margin: 8px 12px 10px;
}

.chart-selection {
  min-height: 76px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.chart-selection strong {
  display: block;
  margin-bottom: 4px;
}

.chart-legend {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.88rem;
}

.legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  flex: 0 0 auto;
}

.leaderboard-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.leaderboard-controls label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 720;
  text-transform: uppercase;
}

.leaderboard-controls select {
  min-height: 38px;
  padding: 6px 32px 6px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  text-transform: none;
}

.leaderboard-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.summary-tile {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.summary-tile strong {
  display: block;
  font-size: 1.35rem;
  line-height: 1.15;
}

.summary-tile span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.88rem;
}

.leaderboard-layout {
  --leaderboard-card-height: 400px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 14px;
  align-items: stretch;
}

.leaderboard-card,
.condition-card {
  height: var(--leaderboard-card-height);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.leaderboard-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: visible;
}

.leaderboard-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.84rem;
  line-height: 1.2;
}

.leaderboard-table th,
.leaderboard-table td {
  padding: 8px 6px;
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.leaderboard-table th {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 780;
  text-transform: uppercase;
  white-space: nowrap;
}

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

.leaderboard-table tbody tr:hover {
  background: rgba(27, 124, 114, 0.05);
}

.method-pill {
  display: inline-grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  justify-content: center;
}

.method-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.group-label {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.68rem;
}

.condition-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: 14px;
  min-height: 0;
  overflow: hidden;
}

.condition-card h4 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.condition-list {
  display: block;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 4px;
}

.condition-row {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.condition-row + .condition-row {
  margin-top: 10px;
}

.condition-row:first-child {
  padding-top: 0;
  border-top: 0;
}

.condition-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 740;
}

.condition-source {
  color: var(--muted);
  font-size: 0.8rem;
}

.rank-list {
  display: grid;
  gap: 5px;
  margin-top: 8px;
}

.rank-item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 0.84rem;
}

.rank-medal {
  color: var(--ink);
  font-weight: 780;
}

.video-section {
  background: #eef3f0;
  border-top: 1px solid var(--line);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.section-heading h2 {
  margin-bottom: 0;
}

.experiment-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 14px;
}

.experiment + .experiment {
  margin-top: 36px;
}

.experiment-heading h3 {
  color: #30332d;
  font-size: clamp(1.2rem, 2.1vw, 1.55rem);
  font-weight: 760;
}

.video-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.video-controls button {
  border-color: var(--ink);
  background: var(--ink);
}

.video-controls button:last-child {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink);
}

.video-controls button:last-child:hover {
  border-color: var(--ink);
  background: #f4f4ef;
}

.method-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(280px, 1fr));
  gap: 14px;
  align-items: start;
}

.method-card {
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 34px rgba(32, 33, 31, 0.08);
}

.method-card.highlight {
  border-color: rgba(27, 124, 114, 0.45);
}

.method-card header {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 82px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.method-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(164, 72, 54, 0.1);
  color: var(--brick);
  font-weight: 800;
}

.method-card.highlight .method-index {
  background: rgba(27, 124, 114, 0.12);
  color: var(--teal-dark);
}

.method-card header p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

.video-pair {
  display: grid;
  gap: 0;
}

.video-pair figure {
  margin: 0;
  border-bottom: 1px solid var(--line);
}

.video-pair figure:last-child {
  border-bottom: 0;
}

.single-video {
  grid-template-columns: 1fr;
}

.video-pair video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #111;
  object-fit: cover;
}

.video-pair figcaption {
  padding: 8px 12px 10px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 680;
  line-height: 1.25;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.site-footer .container {
  padding: 26px 0;
}

.site-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  text-align: center;
}

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

@media (max-width: 840px) {
  .method-animation-grid {
    grid-template-columns: 1fr;
  }

  .method-animation video {
    height: min(82vw, 560px);
  }

  .results-heading {
    display: block;
  }

  .result-tabs {
    justify-content: flex-start;
    margin-top: 12px;
  }

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

  .assistive-chart {
    height: 420px;
  }

  .leaderboard-controls {
    justify-content: flex-start;
    margin-top: 12px;
  }

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

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

@media (max-width: 720px) {
  .container,
  .narrow,
  .medium,
  .wide {
    width: min(100% - 28px, 1180px);
  }

  .hero {
    padding-top: 38px;
  }

  .section {
    padding: 34px 0;
  }

  .authors span {
    white-space: normal;
  }

  .section-heading {
    display: block;
  }

  .experiment-heading {
    display: block;
  }

  .video-controls {
    justify-content: flex-start;
    margin-top: 16px;
  }

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

  .abstract-section p {
    text-align: left;
  }
}
