:root {
  --blue-950: #061b45;
  --blue-900: #082761;
  --blue-800: #0a3b91;
  --blue-700: #0b4fc4;
  --blue-600: #1769e0;
  --blue-500: #3a83ee;
  --blue-200: #c8dcff;
  --blue-100: #e9f1ff;
  --blue-50: #f5f8ff;
  --ink: #101828;
  --muted: #536174;
  --line: #dce5f2;
  --white: #ffffff;
  --success: #147a52;
  --failure: #b42318;
  --shadow: 0 20px 60px rgba(15, 48, 101, 0.09);
  --font: "Montserrat", "Times New Roman", serif;
  --radius: 20px;
  --shell: 1220px;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 17px;
  scroll-behavior: auto;
  scroll-padding-top: 84px;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--white);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

.shell {
  width: min(calc(100% - 40px), var(--shell));
  margin-inline: auto;
}

.narrow {
  max-width: 980px;
}

.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;
  z-index: 1000;
  top: 8px;
  left: 8px;
  padding: 10px 16px;
  color: var(--white);
  background: var(--blue-900);
  border-radius: 8px;
  transform: translateY(-150%);
}

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

.site-header {
  position: sticky;
  z-index: 50;
  top: 0;
  height: 70px;
  border-bottom: 1px solid rgba(220, 229, 242, 0.85);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
}

.nav-links {
  display: flex;
  gap: 28px;
  align-items: center;
}

.nav-links a {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 160ms ease;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--blue-700);
}

.nav-links .nav-paper {
  padding: 8px 16px;
  color: var(--white);
  background: var(--blue-700);
  border-radius: 999px;
}

.nav-links .nav-paper:hover,
.nav-links .nav-paper:focus-visible {
  color: var(--white);
  background: var(--blue-800);
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  padding: 9px;
  border: 0;
  background: transparent;
}

.nav-toggle span {
  display: block;
  height: 2px;
  margin: 5px 0;
  background: var(--blue-950);
  border-radius: 2px;
}

.hero {
  overflow: hidden;
  padding: 72px 0 58px;
  background:
    radial-gradient(circle at 18% 8%, rgba(58, 131, 238, 0.13), transparent 30%),
    linear-gradient(180deg, var(--blue-50) 0%, var(--white) 56%);
}

.hero-inner {
  text-align: center;
}

.section-kicker {
  margin: 0 0 12px;
  color: var(--blue-700);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

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

h1 {
  margin: 0;
  color: var(--blue-950);
  font-size: clamp(2.1rem, 3.4vw, 2.5rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.055em;
  white-space: nowrap;
}

h1 span {
  color: var(--blue-600);
}

.hero-subtitle {
  max-width: 980px;
  margin: 24px auto 0;
  color: var(--blue-950);
  font-size: clamp(1.1rem, 2.2vw, 1.65rem);
  font-weight: 600;
  line-height: 1.28;
  letter-spacing: -0.035em;
}

.hero-question {
  max-width: 750px;
  margin: 20px auto 0;
  color: var(--muted);
  font-family: "Times New Roman", serif;
  font-size: clamp(1rem, 1.7vw, 1.2rem);
  font-style: italic;
}

.authors {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  justify-content: center;
  max-width: 980px;
  margin: 30px auto 0;
  color: var(--blue-900);
  font-size: 0.88rem;
  font-weight: 600;
}

.authors sup,
.affiliations sup {
  color: var(--blue-600);
}

.affiliations {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 22px;
  justify-content: center;
  margin: 12px auto 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.venue-note {
  margin: 14px auto 0;
  color: var(--blue-700);
  font-size: clamp(1rem, 1.7vw, 1.2rem);
  font-weight: 600;
}

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

.button {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  justify-content: center;
  min-width: 132px;
  padding: 11px 20px;
  border: 1px solid var(--blue-700);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.button.secondary svg {
  fill: currentColor;
  stroke: none;
}

.button.primary {
  color: var(--white);
  background: var(--blue-700);
}

.button.secondary {
  color: var(--blue-700);
  background: var(--white);
}

.button:hover,
.button:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(11, 79, 196, 0.18);
}

.headline-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  max-width: 900px;
  margin: 52px auto 0;
  border-block: 1px solid var(--line);
}

.hero-video {
  max-width: 760px;
  margin: 42px auto 0;
}

.hero-video video {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: #05070c;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.headline-metrics > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 22px 18px;
}

.headline-metrics > div + div {
  border-left: 1px solid var(--line);
}

.metric-value {
  color: var(--blue-800);
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  font-weight: 800;
  letter-spacing: -0.045em;
}

.metric-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
}

.hero-figure,
.paper-figure {
  margin: 52px auto 0;
}

.hero-figure img,
.paper-figure img {
  width: 100%;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

figcaption {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.72rem;
  text-align: center;
}

.section {
  padding: 84px 0;
}

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

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.65fr);
  gap: 60px;
  align-items: end;
  margin-bottom: 42px;
}

.section-heading h2,
.narrow h2 {
  max-width: 760px;
  margin: 0;
  color: var(--blue-950);
  font-size: clamp(1.35rem, 2.2vw, 1.8rem);
  font-weight: 700;
  line-height: 1.16;
  letter-spacing: -0.035em;
}

.section-heading > p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.motivation-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 54px;
  margin-top: 36px;
}

.motivation-grid p {
  margin: 0;
  color: var(--muted);
}

.motivation-grid .lead {
  color: var(--ink);
  font-size: 1.14rem;
  font-weight: 500;
}

blockquote {
  margin: 34px 0 0;
  padding: 12px 0 12px 20px;
  border-left: 3px solid var(--blue-500);
  color: var(--blue-900);
  font-family: "Times New Roman", serif;
  font-size: clamp(1rem, 1.7vw, 1.25rem);
  line-height: 1.45;
}

.method-section {
  background: var(--white) !important;
}

.paper-figure {
  max-width: 1160px;
}

.method-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
  margin-top: 56px;
}

.method-step {
  padding-top: 20px;
  border-top: 2px solid var(--blue-200);
}

.method-step > span {
  color: var(--blue-500);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.method-step h3 {
  margin: 14px 0 8px;
  color: var(--blue-950);
  font-size: 1rem;
}

.method-step p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.results-section {
  background: var(--blue-50);
}

.results-chart-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(330px, 0.9fr);
  gap: 18px;
  align-items: stretch;
}

.chart-panel {
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: 0 10px 30px rgba(18, 57, 112, 0.045);
}

.chart-panel .panel-heading {
  margin-bottom: 12px;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-height: 31px;
  margin-bottom: 8px;
}

.chart-legend-button {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-height: 29px;
  padding: 5px 8px;
  color: var(--muted);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--font);
  font-size: 0.58rem;
  font-weight: 650;
  cursor: pointer;
}

.chart-legend-button[aria-pressed="false"] {
  color: #8995a6;
  background: #f8faff;
}

.chart-legend-swatch {
  width: 17px;
  height: 2px;
  background: var(--series-color);
  border-radius: 999px;
}

.chart-legend-button[aria-pressed="false"] .chart-legend-swatch {
  opacity: 0.28;
}

.chart-canvas {
  position: relative;
  width: 100%;
  scrollbar-color: var(--blue-200) transparent;
}

.results-chart {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  font-family: var(--font);
  touch-action: pan-y;
}

.chart-grid-line {
  stroke: #e5ebf4;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.chart-axis-line {
  stroke: #aeb9c8;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.chart-axis-label {
  fill: #657287;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.chart-axis-title {
  fill: #657287;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.chart-series {
  transition: opacity 150ms ease;
}

.chart-series.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.chart-series-line {
  fill: none;
  stroke: var(--series-color);
  stroke-width: var(--series-width, 2);
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.chart-marker {
  fill: var(--marker-fill, var(--white));
  stroke: var(--series-color);
  stroke-width: var(--marker-width, 1.8);
  vector-effect: non-scaling-stroke;
}

.chart-direct-label {
  fill: var(--blue-900);
  font-size: 12px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  paint-order: stroke;
  stroke: var(--white);
  stroke-linejoin: round;
  stroke-width: 4px;
}

.chart-direct-delta {
  fill: #6f7d90;
  font-size: 9px;
  font-weight: 600;
}

.chart-hit-area {
  fill: transparent;
  cursor: crosshair;
}

.chart-hit-area:focus-visible {
  outline: none;
}

.chart-hover-guide {
  stroke: #8494aa;
  stroke-width: 1;
  stroke-dasharray: 3 4;
  vector-effect: non-scaling-stroke;
}

.chart-hover-layer[hidden] {
  display: none;
}

.chart-tooltip {
  position: absolute;
  z-index: 4;
  width: max-content;
  min-width: 148px;
  max-width: min(230px, calc(100% - 12px));
  padding: 10px 11px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(18, 57, 112, 0.12);
  font-size: 0.61rem;
  line-height: 1.4;
  pointer-events: none;
}

.chart-tooltip strong {
  display: block;
  color: var(--blue-950);
  font-size: 0.66rem;
}

.chart-tooltip-unit {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.55rem;
}

.chart-tooltip ul {
  display: grid;
  gap: 3px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chart-tooltip li {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
}

.chart-tooltip-dot {
  width: 6px;
  height: 6px;
  background: var(--series-color);
  border-radius: 50%;
}

.chart-tooltip-value {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.table-panel {
  min-width: 0;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: 0 10px 30px rgba(18, 57, 112, 0.045);
}

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

.panel-heading p {
  margin: 0;
  color: var(--blue-600);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.panel-heading h3 {
  margin: 4px 0 0;
  color: var(--blue-950);
  font-size: 1.1rem;
}

.panel-heading > span {
  padding: 5px 9px;
  color: var(--blue-700);
  background: var(--blue-100);
  border-radius: 999px;
  font-size: 0.6rem;
  font-weight: 700;
  white-space: nowrap;
}

.table-scroll {
  overflow-x: auto;
  scrollbar-color: var(--blue-200) transparent;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  font-size: 0.72rem;
  line-height: 1.35;
}

th,
td {
  padding: 10px 11px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}

thead tr:first-child > th:first-child,
tbody th[scope="row"] {
  position: sticky;
  left: 0;
  z-index: 1;
  text-align: left;
}

thead th {
  color: var(--muted);
  background: #f8faff;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

tbody th {
  background: var(--white);
  font-weight: 600;
}

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

tbody tr:hover > * {
  background: var(--blue-50);
}

tr.ours > * {
  color: var(--blue-900);
  background: var(--blue-100);
  font-weight: 800;
}

tr.ours:hover > * {
  background: #dce9ff;
}

tr.baseline > * {
  background: #f7f8fa;
}

.table-note {
  margin: 15px 0 0;
  color: var(--muted);
  font-size: 0.67rem;
}

.touch-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 28px;
}

.touch-comparison > div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
}

.touch-comparison video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-top: 10px;
  object-fit: contain;
  background: #000;
  border-radius: 9px;
}

.sequence-label {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: baseline;
  font-size: 0.92rem;
  font-weight: 700;
}

.sequence-label strong {
  font-size: 1rem;
}

.sequence-label small {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
}

.success-label {
  color: var(--success);
}

.failure-label {
  color: var(--failure);
}

.consistency-section {
  background: var(--white) !important;
}

.real-section {
  background: var(--blue-50);
}

.citation-section {
  background: var(--blue-50) !important;
}

.citation-simple {
  max-width: 1100px;
}

.citation-simple > .section-kicker {
  margin-bottom: 16px;
  color: var(--blue-700);
  font-size: 1.2rem;
}

.bibtex-wrap {
  position: relative;
  min-width: 0;
}

pre {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 24px;
  overflow-x: auto;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  font-size: 0.82rem;
  line-height: 1.55;
}

.copy-button {
  position: absolute;
  z-index: 2;
  top: 12px;
  right: 12px;
  padding: 8px 13px;
  color: var(--blue-700);
  background: var(--blue-100);
  border: 1px solid var(--blue-200);
  border-radius: 8px;
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.copy-status {
  min-height: 1.2em;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  text-align: right;
}

footer {
  padding: 24px 0;
  color: var(--muted);
  background: var(--white);
  border-top: 1px solid var(--line);
  font-size: 0.68rem;
}

.footer-inner {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
}

.footer-inner div {
  display: flex;
  gap: 20px;
}

.footer-inner a {
  text-decoration: none;
}

.footer-inner a:hover,
.footer-inner a:focus-visible {
  color: var(--blue-700);
}

.reveal {
  opacity: 1;
  transform: none;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

:focus-visible {
  outline: 3px solid rgba(23, 105, 224, 0.38);
  outline-offset: 3px;
}

@media (max-width: 900px) {
  .nav-toggle {
    display: block;
  }

  .nav-links {
    position: absolute;
    top: 70px;
    right: 20px;
    left: 20px;
    display: none;
    flex-direction: column;
    gap: 4px;
    align-items: stretch;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--white);
    box-shadow: var(--shadow);
  }

  .nav-links.is-open {
    display: flex;
  }

  .nav-links a {
    padding: 10px 12px;
  }

  .nav-links .nav-paper {
    border-radius: 9px;
    text-align: center;
  }

  .section-heading,
  .motivation-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .method-steps {
    grid-template-columns: repeat(2, 1fr);
  }

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

}

@media (max-width: 620px) {
  .shell {
    width: min(calc(100% - 28px), var(--shell));
  }

  .site-header {
    height: 62px;
  }

  .nav-links {
    top: 62px;
    right: 14px;
    left: 14px;
  }

  .hero {
    padding: 54px 0 42px;
  }

  h1 {
    font-size: 2.1rem;
  }

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

  .authors {
    gap: 5px 13px;
    font-size: 0.74rem;
  }

  .affiliations {
    display: block;
  }

  .affiliations span {
    display: block;
  }

  .headline-metrics {
    grid-template-columns: 1fr;
    margin-top: 38px;
  }

  .headline-metrics > div {
    padding: 16px 8px;
  }

  .headline-metrics > div + div {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .metric-value {
    font-size: 1.15rem;
  }

  .metric-label {
    font-size: 0.58rem;
  }

  .hero-figure,
  .paper-figure {
    margin-top: 34px;
  }

  .hero-video {
    margin-top: 32px;
  }

  .section {
    padding: 64px 0;
  }

  .method-steps,
  .touch-comparison {
    grid-template-columns: 1fr;
  }

  .table-panel {
    padding: 18px;
    border-radius: 15px;
  }

  .chart-panel {
    padding: 16px 12px;
    border-radius: 15px;
  }

  .chart-canvas {
    overflow-x: auto;
    overflow-y: hidden;
  }

  .chart-panel-wide .results-chart {
    min-width: 560px;
  }

  .chart-panel-compact .results-chart {
    min-width: 0;
  }

  .chart-legend {
    gap: 5px;
  }

  .chart-legend-button {
    min-height: 27px;
    padding: 4px 7px;
  }

  th,
  td {
    padding: 9px 8px;
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }
}

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

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
