:root {
  --paper: #f7f5f0;
  --paper-deep: #ebe7df;
  --surface: #fffefa;
  --ink: #192126;
  --muted: #59636a;
  --rule: #d6d2ca;
  --accent: #c43d34;
  --accent-dark: #982a24;
  --accent-pale: #f2d9d4;
  --slate: #687278;
  --shadow: 0 18px 54px rgb(31 37 40 / 9%);
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: Iowan Old Style, Baskerville, "Times New Roman", ui-serif, Georgia, serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

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

html {
  overflow-x: clip;
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
}

body {
  min-width: 0;
  margin: 0;
  overflow-x: clip;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.62;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

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

button,
input,
a {
  font: inherit;
}

button,
input {
  touch-action: manipulation;
}

a {
  color: inherit;
  text-decoration-color: rgb(196 61 52 / 48%);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent-dark);
  text-decoration-color: currentColor;
}

:focus-visible {
  outline: 3px solid rgb(196 61 52 / 48%);
  outline-offset: 3px;
}

::selection {
  background: var(--accent-pale);
}

.shell {
  width: min(1120px, calc(100% - 3rem));
  margin-inline: auto;
}

.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: 100;
  top: 0.65rem;
  left: 0.65rem;
  padding: 0.65rem 0.9rem;
  transform: translateY(-160%);
  border: 1px solid var(--ink);
  border-radius: 4px;
  background: var(--surface);
  font-size: 0.85rem;
  font-weight: 700;
  transition: transform 150ms ease;
}

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

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid rgb(25 33 38 / 10%);
  background: rgb(247 245 240 / 92%);
  backdrop-filter: blur(14px);
}

.nav {
  display: grid;
  grid-template-columns: auto 1fr auto;
  min-height: 4rem;
  align-items: center;
  gap: 1.6rem;
}

.wordmark {
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-decoration: none;
}

.nav-links {
  display: flex;
  min-width: 0;
  justify-content: center;
  gap: clamp(0.75rem, 1.6vw, 1.45rem);
}

.nav-links a,
.nav-paper {
  color: var(--muted);
  font-size: 0.69rem;
  font-weight: 760;
  letter-spacing: 0.065em;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-paper:hover {
  color: var(--ink);
}

.nav-paper {
  color: var(--accent-dark);
}

.hero {
  padding-block: clamp(3.6rem, 7vw, 5.8rem) clamp(3.2rem, 6vw, 5rem);
}

.eyebrow-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: clamp(1.5rem, 3vw, 2.2rem);
}

.eyebrow,
.hero-kicker,
.section-index {
  margin: 0;
  color: var(--muted);
  font-size: 0.69rem;
  font-weight: 790;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.eyebrow {
  color: var(--accent-dark);
}

.hero h1 {
  max-width: none;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.85rem, 3.35vw, 3.2rem);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.title-line {
  display: block;
}

.title-line em {
  color: var(--accent);
  font-style: normal;
}

@media (min-width: 768px) {
  .title-line {
    white-space: nowrap;
  }
}

.dek {
  max-width: 700px;
  margin: 1.65rem 0 0;
  color: #3e484e;
  font-family: var(--serif);
  font-size: clamp(1.02rem, 1.45vw, 1.2rem);
  letter-spacing: -0.01em;
  line-height: 1.42;
}

.paper-identity {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  margin-top: 2.2rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--rule);
}

.authors {
  display: flex;
  max-width: 800px;
  flex-wrap: wrap;
  gap: 0.18rem 1.15rem;
  margin: 0;
  font-size: 0.9rem;
  font-weight: 650;
}

.authors a,
.authors span {
  white-space: nowrap;
}

.authors a {
  color: var(--accent-dark);
}

.affiliation {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  white-space: nowrap;
}

.resource-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.6rem;
}

.button {
  display: inline-flex;
  min-height: 2.7rem;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.62rem 1rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 760;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease;
}

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

.button--primary {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--surface);
}

.button--primary:hover {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
  color: white;
}

.button--disabled,
.button--disabled:hover {
  border-color: var(--rule);
  background: transparent;
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.72;
}

.demo-section {
  padding-bottom: clamp(3.8rem, 7vw, 6rem);
}

.section-heading {
  margin-bottom: clamp(1.5rem, 3vw, 2.1rem);
}

.section-heading h2 {
  max-width: 820px;
  margin: 0.48rem 0 0;
  font-family: var(--serif);
  font-size: clamp(1.65rem, 2.4vw, 2.3rem);
  font-weight: 500;
  letter-spacing: -0.028em;
  line-height: 1.1;
  text-wrap: balance;
}

.section-heading--split {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.7fr);
  align-items: end;
  gap: clamp(2rem, 6vw, 4.5rem);
}

.section-heading--split > p {
  margin: 0 0 0.15rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.interactive-demo {
  width: 100%;
}

.examples-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(0.8rem, 2vw, 1.25rem);
}

.examples-note {
  max-width: 850px;
  margin: 1.1rem auto 0;
  color: #465057;
  font-family: var(--serif);
  font-size: clamp(0.94rem, 1.2vw, 1.04rem);
  line-height: 1.52;
  text-align: center;
}

.example-card {
  min-width: 0;
  padding: clamp(0.7rem, 1.4vw, 1rem);
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.example-card h3 {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 0.65rem;
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 780;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.swatch {
  width: 0.6rem;
  height: 0.6rem;
  flex: 0 0 auto;
  border: 1px solid rgb(25 33 38 / 20%);
  border-radius: 50%;
}

.swatch--i {
  background: #7455a0;
}

.swatch--ii {
  background: #78b6ce;
}

.media-stack {
  width: 100%;
  overflow: hidden;
  border: 1px solid #30383d;
  border-radius: 8px;
  background: #15191b;
}

.video-frame {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #15191b;
}

.video-frame video {
  width: 100%;
  height: 100%;
  background: #15191b;
  object-fit: contain;
}

.chart-panel {
  width: 100%;
  height: 168px;
  padding: 0.5rem 0.45rem 0.2rem;
  border-top: 1px solid var(--rule);
  background: #fcfaf6;
}

.curve-legend {
  display: flex;
  height: 1rem;
  align-items: center;
  justify-content: flex-end;
  gap: 0.85rem;
  color: #4e585e;
  font-size: clamp(0.53rem, 1vw, 0.65rem);
  font-weight: 650;
}

.curve-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
}

.legend-line {
  display: inline-block;
  width: 1.15rem;
  height: 2px;
  border-radius: 2px;
  background: var(--slate);
}

.legend-line--corrected {
  background: var(--accent);
}

.progress-chart {
  width: 100%;
  height: calc(100% - 1rem);
  overflow: visible;
  cursor: ew-resize;
  touch-action: none;
  user-select: none;
}

.progress-chart:focus-visible {
  outline-offset: -2px;
}

.chart-grid,
.chart-labels,
.curve,
.cursor-layer {
  pointer-events: none;
}

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

.chart-labels {
  fill: #596268;
  font-family: var(--mono);
  font-size: 11px;
}

.curve {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
}

.curve--proxy {
  stroke: var(--slate);
}

.curve--corrected {
  stroke: var(--accent);
}

.curve--ghost {
  opacity: 0.22;
  stroke-width: 2;
}

.cursor-layer line {
  stroke: #20292e;
  stroke-dasharray: 3 4;
  stroke-width: 1.25;
  vector-effect: non-scaling-stroke;
}

.cursor-point {
  stroke: #fcfaf6;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.cursor-point--proxy {
  fill: var(--slate);
}

.cursor-point--corrected {
  fill: var(--accent);
}

.player-controls {
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr) auto;
  min-height: 2.25rem;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.7rem;
  border-top: 1px solid #30383d;
  background: #171d20;
  color: white;
}

.play-toggle {
  display: grid;
  width: 2rem;
  height: 1.65rem;
  place-items: center;
  padding: 0;
  border: 1px solid rgb(255 255 255 / 35%);
  border-radius: 4px;
  background: transparent;
  color: white;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.72rem;
}

.play-toggle:hover {
  border-color: white;
  background: rgb(255 255 255 / 10%);
}

.player-controls input[type="range"] {
  width: 100%;
  min-width: 0;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.time-output {
  min-width: 7.8rem;
  font-family: var(--mono);
  font-size: 0.65rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.no-js-teaser,
.demo-error {
  margin: 1.2rem 0 0;
  padding: 0.9rem;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--surface);
}

.no-js-teaser figcaption,
.demo-error {
  color: var(--muted);
  font-size: 0.82rem;
}

.no-js-teaser figcaption {
  margin-top: 0.65rem;
}

.content-section {
  padding-block: clamp(3.8rem, 7vw, 6rem);
  border-top: 1px solid var(--rule);
}

.prose {
  color: #3e484e;
}

.prose p {
  margin: 0 0 1.15rem;
}

.prose p:last-child {
  margin-bottom: 0;
}

.prose--abstract {
  font-family: var(--serif);
  font-size: clamp(1rem, 1.2vw, 1.1rem);
  letter-spacing: -0.004em;
  line-height: 1.58;
}

.prose strong {
  color: var(--ink);
  font-weight: 650;
}

.method-section {
  background: #f0ede7;
}

.method-flow {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 2.4rem 0 0;
  padding: 0;
  list-style: none;
}

.method-flow > li {
  min-width: 0;
  padding: clamp(1.2rem, 2.4vw, 1.75rem);
  border: 1px solid var(--rule);
  border-radius: 9px;
  background: var(--surface);
}

.method-step {
  margin: 0 0 1rem !important;
  color: var(--accent-dark) !important;
  font-family: var(--mono);
  font-size: 0.62rem !important;
  font-weight: 780;
  letter-spacing: 0.08em;
}

.method-visual {
  display: flex;
  min-height: 4rem;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  margin-bottom: 1.2rem;
  border-radius: 6px;
  background: #f3f0ea;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.7rem;
}

.method-visual b {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-weight: 700;
}

.method-visual--time i {
  width: 20%;
  height: 1px;
  background: var(--rule);
}

.method-visual--match i {
  width: 18%;
  height: 1px;
  background: var(--accent);
}

.method-visual--match span {
  display: grid;
  width: 1.8rem;
  height: 1.8rem;
  place-items: center;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: white;
}

.method-visual--correct i {
  color: var(--accent-dark);
  font-style: normal;
  font-size: 1rem;
}

.method-flow h3 {
  margin: 0 0 0.55rem;
  font-family: var(--serif);
  font-size: 1.28rem;
  font-weight: 550;
  letter-spacing: -0.015em;
}

.method-flow li > p:not(.method-step, .method-formula) {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.55;
}

.method-formula {
  margin: 1rem 0 0;
  overflow-wrap: anywhere;
  color: #293238;
  font-family: var(--serif);
  font-size: 0.9rem;
  line-height: 1.45;
}

.method-formula + .method-formula {
  margin-top: 0.35rem;
}

.method-formula var {
  color: var(--accent-dark);
}

.method-formula sub {
  font-size: 0.72em;
}

.results-table-wrap {
  margin-top: 2.2rem;
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.results-table th,
.results-table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}

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

.results-table thead th {
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 780;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.results-table thead th:first-child,
.results-table tbody th {
  width: 25%;
}

.results-table thead th:nth-child(2),
.results-table .result-value {
  width: 24%;
}

.results-table tbody th {
  font-size: 0.82rem;
  font-weight: 730;
}

.results-table td {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.results-table .result-value {
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(1.1rem, 1.8vw, 1.45rem);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  line-height: 1.2;
}

.evidence-figure {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: 9px;
  background: white;
}

.evidence-figure--wide {
  margin-top: 0;
}

.evidence-figure img {
  width: 100%;
  height: auto;
}

.evidence-figure figcaption {
  padding: 0.9rem 1rem 1rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.79rem;
  line-height: 1.5;
}

.evidence-figure figcaption span {
  display: block;
  margin-bottom: 0.16rem;
  color: var(--ink);
  font-size: 0.67rem;
  font-weight: 790;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.figure-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

.figure-pair .evidence-figure {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.figure-pair .evidence-figure img {
  aspect-ratio: 720 / 430;
  flex: 1;
  object-fit: contain;
}

.limitations-section {
  background: var(--paper-deep);
}

.limitations-layout {
  display: grid;
  grid-template-columns: minmax(220px, 0.55fr) minmax(0, 1.45fr);
  align-items: start;
  gap: clamp(2.5rem, 7vw, 6rem);
}

.limitation-list {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 1rem;
}

.limitation-list article {
  padding-left: 1rem;
  border-left: 2px solid var(--accent);
}

.limitation-list h3 {
  margin: 0 0 0.5rem;
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 600;
}

.limitation-list p {
  margin: 0;
  color: #465057;
  font-size: 0.88rem;
  line-height: 1.58;
}

.citation-section {
  border-top: 0;
}

.text-button {
  justify-self: end;
  padding: 0 0 0.12rem;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  color: var(--accent-dark);
  cursor: pointer;
  font-size: 0.71rem;
  font-weight: 790;
  letter-spacing: 0.065em;
  text-transform: uppercase;
}

.citation-box {
  max-width: 100%;
  overflow: hidden;
  border: 1px solid #3d454a;
  border-radius: 9px;
  background: var(--ink);
  color: #f0efeb;
  box-shadow: var(--shadow);
}

.citation-box pre {
  max-width: 100%;
  margin: 0;
  padding: clamp(1rem, 2.5vw, 1.8rem);
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  word-break: normal;
  font-family: var(--mono);
  font-size: clamp(0.65rem, 1.2vw, 0.73rem);
  line-height: 1.7;
}

.site-footer {
  padding-block: 2rem;
  border-top: 1px solid var(--rule);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.footer-inner p {
  margin: 0;
  color: var(--muted);
  font-size: 0.69rem;
}

.footer-inner strong {
  color: var(--ink);
  letter-spacing: 0.07em;
}

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

.footer-inner a:hover {
  color: var(--ink);
}

@media (max-width: 900px) {
  .section-heading--split {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }

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

  .method-flow > li:last-child {
    grid-column: 1 / -1;
  }

  .limitations-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 1.5rem, 1120px);
  }

  .nav {
    gap: 1rem;
  }

  .nav-links {
    justify-content: flex-end;
  }

  .nav-links a:nth-child(-n + 2) {
    display: none;
  }

  .paper-identity {
    display: block;
  }

  .affiliation {
    margin-top: 0.7rem;
    white-space: normal;
  }

  .chart-panel {
    height: 154px;
  }

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

  .method-flow > li:last-child {
    grid-column: auto;
  }

  .figure-pair {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .nav {
    grid-template-columns: 1fr auto;
  }

  .nav-links {
    display: none;
  }

  .hero {
    padding-top: 3.2rem;
  }

  .hero-kicker {
    display: none;
  }

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

  .chart-panel {
    height: 180px;
    padding-inline: 0.35rem;
  }

  .curve-legend {
    justify-content: flex-start;
    gap: 0.6rem;
  }

  .time-output {
    min-width: 6.9rem;
    font-size: 0.58rem;
  }

  .results-table,
  .results-table tbody,
  .results-table tr,
  .results-table th,
  .results-table td {
    display: block;
    width: 100% !important;
  }

  .results-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .results-table tr {
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--rule);
  }

  .results-table tr:last-child {
    border-bottom: 0;
  }

  .results-table th,
  .results-table td {
    padding: 0.16rem 0.25rem;
    border: 0 !important;
  }

  .results-table .result-value {
    margin-block: 0.18rem;
  }

  .limitation-list {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .footer-inner {
    display: block;
  }

  .footer-inner p + p {
    margin-top: 0.35rem;
  }
}

@media (max-width: 420px) {
  .resource-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .button {
    padding-inline: 0.7rem;
  }

  .chart-panel {
    height: 165px;
  }

  .curve-legend {
    font-size: 0.48rem;
  }

  .player-controls {
    grid-template-columns: 1.9rem minmax(0, 1fr) auto;
    gap: 0.4rem;
    padding-inline: 0.4rem;
  }

  .play-toggle {
    width: 1.75rem;
  }
}

@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;
  }
}

@media print {
  .site-header,
  .resource-row,
  .player-controls,
  .text-button,
  .site-footer {
    display: none;
  }

  body {
    background: white;
  }

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

  .interactive-demo,
  .media-stack,
  .citation-box {
    box-shadow: none;
  }
}
