:root {
  --paper: #fbfaf7;
  --paper-tint: #f3f1eb;
  --card: #ffffff;
  --ink: #1d1d1b;
  --ink-2: #4f4e4a;
  --ink-3: #85837d;
  --rule: #e3e0d8;
  --accent: #a8243a;
  --accent-soft: #f6e7e9;
  --bar-base: #a9b0ba;
  --serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: 'IBM Plex Mono', Menlo, Consolas, monospace;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }

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

.wrap {
  max-width: 840px;
  margin: 0 auto;
  padding: 0 20px;
}

.wrap.wide { max-width: 1080px; }

h2 {
  font: 600 30px/1.2 var(--serif);
  letter-spacing: -0.01em;
  margin: 0 0 22px;
}

h3 { font-family: var(--serif); }

code {
  font-family: var(--mono);
  font-size: 0.88em;
}

/* Header ------------------------------------------------------------------ */

.hero {
  padding: 76px 0 44px;
  text-align: center;
}

.venue {
  display: inline-block;
  margin: 0 0 26px;
  color: var(--accent);
  text-decoration: none;
}

.venue-name {
  font-family: var(--serif);
  font-size: clamp(19px, 2.6vw, 23px);
  font-weight: 600;
  line-height: 1.35;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s;
}

.venue:hover .venue-name { border-bottom-color: currentColor; }

.venue-meta {
  margin-left: 12px;
  padding-left: 12px;
  border-left: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.72em;
  font-weight: 500;
  color: var(--ink-2);
  white-space: nowrap;
}

.title {
  margin: 0 0 26px;
  font-family: var(--serif);
  line-height: 1.15;
}

.title-name {
  display: block;
  font-size: clamp(44px, 8vw, 70px);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.title-rest {
  display: block;
  margin-top: 8px;
  font-size: clamp(21px, 3.3vw, 30px);
  font-weight: 500;
  color: var(--ink-2);
  text-wrap: balance;
}

.authors {
  margin: 0 auto 6px;
  max-width: 760px;
  font-size: 17px;
  line-height: 1.9;
}

.authors a {
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s, color 0.15s;
}

.authors a:hover {
  color: var(--accent);
  border-bottom-color: currentColor;
}

.authors sup,
.affiliations sup {
  font-size: 0.68em;
  margin-left: 1px;
}

.affiliations {
  margin: 0 0 24px;
  font-size: 14.5px;
  color: var(--ink-2);
}

.affiliations span { margin: 0 10px; white-space: nowrap; }

.links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s;
}

.link-btn i { font-size: 15px; }
.link-btn .ai { font-size: 17px; }
.link-btn:hover { background: var(--accent); }

/* Demo -------------------------------------------------------------------- */

.demo { padding: 8px 0 20px; }

.demo-figure { margin: 0; }

.video-frame {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 6px;
  overflow: hidden;
}

.video-frame video { width: 100%; }

.sound-toggle {
  position: absolute;
  top: 14px;
  right: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  border: 0;
  border-radius: 999px;
  background: rgba(29, 29, 27, 0.78);
  color: #fff;
  font: 500 13.5px/1 var(--sans);
  cursor: pointer;
}

.sound-toggle:hover { background: var(--accent); }

.video-stage {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
}

.unmute-cta {
  position: absolute;
  left: 50%;
  top: 45%;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 4px 16px 4px 4px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  white-space: nowrap;
  color: #fff;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  transition: background 0.15s;
}

.unmute-cta:hover { background: var(--accent); }

.cta-icon {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  font-size: 13px;
}

.cta-icon::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 2px solid var(--accent);
  border-radius: 50%;
  animation: cta-ring 1.8s ease-out infinite;
}

.unmute-cta:hover .cta-icon { background: #fff; color: var(--accent); }

@keyframes cta-ring {
  from { transform: scale(1); opacity: 0.9; }
  to { transform: scale(1.7); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .cta-icon::after { animation: none; }
}

.cta-text {
  display: flex;
  align-items: baseline;
  gap: 10px;
  line-height: 1.25;
}

.cta-text strong { font-size: 14px; font-weight: 600; }

.cta-text span {
  padding-left: 10px;
  border-left: 1px solid rgba(255, 255, 255, 0.28);
  font-size: 13px;
  color: #d3d1ca;
}

.sound-toggle[hidden],
.unmute-cta[hidden] { display: none; }

.demo-figure figcaption {
  max-width: 800px;
  margin: 14px auto 0;
  font-size: 15px;
  color: var(--ink-2);
  text-align: center;
}

/* Sections ---------------------------------------------------------------- */

.block { padding: 64px 0; }

.block.tinted {
  background: var(--paper-tint);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.prose p {
  margin: 0 0 14px;
  font-size: 16.5px;
  line-height: 1.72;
}

.abstract p {
  text-align: justify;
  hyphens: auto;
}

.lead {
  margin: 0 0 26px;
  color: var(--ink-2);
}

.figure { margin: 36px 0 0; }

.figure img {
  width: 100%;
  background: #fff;
  border-radius: 4px;
}

.figure figcaption {
  max-width: 800px;
  margin-top: 12px;
  font-size: 14.5px;
  color: var(--ink-2);
}

.figure-method { margin-top: 4px; }

.zoom { display: block; cursor: zoom-in; }

.figure-method img {
  padding: 10px;
  border: 1px solid var(--rule);
}

/* Method ------------------------------------------------------------------ */

.method-steps { margin-top: 40px; }

.step {
  padding: 26px 0;
  border-top: 1px solid var(--rule);
}

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

.step h3 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 10px;
  font-size: 21px;
  font-weight: 600;
}

.step p { margin: 0 0 10px; }

.step-tag {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1.5px solid var(--accent);
  border-radius: 4px;
  color: var(--accent);
  font-size: 16px;
  font-weight: 700;
}

.step-figure {
  max-width: 700px;
  margin: 22px auto 6px;
}

.step-figure img {
  width: 100%;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 12px;
}

.step-note {
  font-size: 14.5px;
  color: var(--ink-2);
}

.math { font-family: var(--serif); font-style: italic; }
.math sub { font-style: normal; font-size: 0.72em; }

/* Qualitative ------------------------------------------------------------- */

.clip { max-width: 900px; margin: 0 auto 52px; }
.clip:last-child { margin-bottom: 0; }

.clip-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  max-width: 800px;
  margin: 0 0 14px;
}

.clip-no {
  font: 600 30px/1 var(--serif);
  color: var(--accent);
}

.clip-head h3 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
}

.clip-head p {
  margin: 2px 0 0;
  color: var(--ink-2);
  font-size: 15px;
}

.clip-audio {
  flex: none;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-3);
  white-space: nowrap;
}

/* Charts ------------------------------------------------------------------ */

.sub {
  margin: 56px 0 8px;
  font-size: 23px;
  font-weight: 600;
}

.chart-card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 6px 22px 16px;
}

.chart-top {
  border-bottom: 1px solid var(--rule);
  margin-bottom: 18px;
}

.tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs button {
  flex: none;
  padding: 12px 10px 10px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--ink-3);
  font: 500 14.5px/1 var(--sans);
  cursor: pointer;
}

.tabs button:hover { color: var(--ink); }

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

.chart-desc {
  margin: 10px 0 12px;
  min-height: 1.6em;
  font-size: 14px;
  color: var(--ink-2);
}

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

.panel-title {
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 600;
}

.panel-title .dir {
  margin-left: 4px;
  font-weight: 500;
  color: var(--ink-3);
}

.chart-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  font-family: var(--sans);
}

.chart-svg .grid { stroke: #ecebe5; stroke-width: 1; }
.chart-svg .axis { stroke: #c9c6bd; stroke-width: 1; }
.chart-svg .tick { fill: var(--ink-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart-svg .row-label {
  fill: var(--ink-2);
  font-size: 12.5px;
  paint-order: stroke;
  stroke: var(--card);
  stroke-width: 4px;
  stroke-linejoin: round;
}
.chart-svg .bar { fill: var(--bar-base); }
.chart-svg .whisker { stroke: var(--ink-2); stroke-width: 1.2; }
.chart-svg .value { fill: var(--ink-2); font-size: 12px; font-variant-numeric: tabular-nums; }
.chart-svg .value.is-best { fill: var(--ink); font-weight: 600; }
.chart-svg .hit { fill: transparent; }

.chart-svg .is-ours .bar { fill: var(--accent); }
.chart-svg .is-ours .row-label { fill: var(--ink); font-weight: 600; }

.chart-svg .bar-row { outline: none; cursor: default; }
.chart-svg .bar-row:hover .hit,
.chart-svg .bar-row:focus-visible .hit { fill: rgba(29, 29, 27, 0.04); }

.tooltip {
  position: fixed;
  z-index: 10;
  display: flex;
  flex-direction: column;
  padding: 7px 10px;
  border-radius: 5px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  line-height: 1.35;
  pointer-events: none;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.tooltip[hidden] { display: none; }
.tooltip strong { font-weight: 600; }
.tooltip span { color: #d9d7d0; }

.table-view { margin-top: 16px; }

.table-view summary {
  font-size: 13.5px;
  color: var(--ink-3);
  cursor: pointer;
}

.table-view summary:hover { color: var(--ink); }

.table-scroll { overflow-x: auto; margin-top: 10px; }

.table-scroll table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.table-scroll th,
.table-scroll td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--rule);
  text-align: right;
  white-space: nowrap;
}

.table-scroll th:first-child { text-align: left; }
.table-scroll thead th { font-weight: 600; }
.table-scroll tbody th { font-weight: 400; }
.table-scroll small { color: var(--ink-3); }
.table-scroll tr.is-ours th,
.table-scroll tr.is-ours td { background: var(--accent-soft); font-weight: 600; }

/* BibTeX ------------------------------------------------------------------ */

.bibtex {
  position: relative;
  background: var(--paper-tint);
  border: 1px solid var(--rule);
  border-radius: 6px;
}

.bibtex pre {
  margin: 0;
  padding: 20px 22px;
  overflow-x: auto;
  font: 13.5px/1.6 var(--mono);
}

.copy {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border: 1px solid var(--rule);
  border-radius: 5px;
  background: var(--card);
  color: var(--ink-2);
  font: 500 13px/1.2 var(--sans);
  cursor: pointer;
}

.copy:hover { color: var(--ink); border-color: var(--ink-3); }

/* Footer ------------------------------------------------------------------ */

.footer {
  padding: 30px 0 40px;
  border-top: 1px solid var(--rule);
  text-align: center;
  font-size: 13.5px;
  color: var(--ink-2);
}

.footer p { margin: 0 0 6px; }
.footer .muted { color: var(--ink-3); }

/* Narrow screens ---------------------------------------------------------- */

@media (max-width: 760px) {
  .unmute-cta {
    position: static;
    transform: none;
    display: flex;
    width: fit-content;
    margin: 12px auto 0;
  }
}

@media (max-width: 560px) {
  .unmute-cta { padding: 6px 18px 6px 6px; white-space: normal; }
  .cta-icon { width: 34px; height: 34px; font-size: 15px; }
  .cta-text { flex-direction: column; align-items: flex-start; gap: 0; }
  .cta-text span { padding-left: 0; border-left: 0; }
}

@media (max-width: 820px) {
  .panels { grid-template-columns: minmax(0, 1fr); gap: 22px; }
}

@media (max-width: 560px) {
  .hero { padding: 48px 0 32px; }
  .venue-meta { display: block; margin: 2px 0 0; padding-left: 0; border-left: 0; }
  .block { padding: 48px 0; }
  h2 { font-size: 26px; }
  .affiliations span { display: inline-block; margin: 0 6px; }
  .figure-method img { padding: 4px; }
  .step-figure img { padding: 6px; }
  .sound-toggle { top: 8px; right: 8px; padding: 6px 10px; font-size: 12.5px; }
  .chart-card { padding: 4px 14px 14px; }
}
