:root {
  --ink: #363636;
  --muted: #555;
  --paper: #fff;
  --soft: #f5f5f5;
  --line: #dbdbdb;
  --link: #209cee;
  --max: 960px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Noto Sans", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }
a { color: var(--link); }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.5rem;
  left: 0.5rem;
  padding: 0.75rem 1rem;
  color: #fff;
  background: #363636;
  border-radius: 4px;
  transform: translateY(-150%);
}

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

.hero { padding: 3rem 1.5rem; text-align: center; }
.hero-copy { width: min(100%, var(--max)); margin-inline: auto; }
.eyebrow { display: none; }
h1, h2, h3, p { overflow-wrap: break-word; }

h1 {
  max-width: 58rem;
  margin: 0 auto;
  font-family: "Google Sans", "Noto Sans", sans-serif;
  font-size: clamp(2.35rem, 4vw, 3rem);
  font-weight: 600;
  letter-spacing: normal;
  line-height: 1.125;
}

.identity { margin: 1.5rem 0 1.25rem; }
.identity p { margin: 0; }

.author-list,
.affiliation-list {
  font-family: "Google Sans", "Noto Sans", sans-serif;
  font-size: 1.2rem;
  font-weight: 400;
}

.affiliation-list { margin-top: 0.2rem !important; color: var(--muted); }

.acceptance-status {
  margin-top: 0.45rem !important;
  color: #b83b4b;
  font-family: "Google Sans", "Noto Sans", sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
}

.resource-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; }

.resource {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  padding: 0.55rem 1rem;
  color: #fff;
  background: #363636;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
}

.resource i { width: 1rem; font-size: 1rem; text-align: center; }
.resource-icon { width: 1rem; height: 1rem; object-fit: contain; }

.resource small { margin-left: 0.1rem; color: #cfcfcf; font-weight: 400; }

.teaser {
  width: min(calc(100% - 3rem), var(--max));
  margin-inline: auto;
  padding: 0 0 3rem;
  text-align: center;
}

.teaser-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.teaser-video { min-width: 0; }
.teaser-video h2 { display: flex; align-items: center; justify-content: center; gap: 0.3rem; margin: 0.5rem 0 0; font-family: "Google Sans", "Noto Sans", sans-serif; font-size: 1rem; font-weight: 600; line-height: 1.25; }
.video-frame { position: relative; overflow: hidden; background: #111; border-radius: 10px; }
.video-frame::after {
  content: "5x";
  position: absolute;
  z-index: 4;
  right: 0.55rem;
  bottom: 2.35rem;
  padding: 0.16rem 0.42rem;
  color: #fff;
  background: rgb(20 20 20 / 72%);
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
  pointer-events: none;
}
.teaser-video video { display: block; width: 100%; aspect-ratio: 960 / 536; background: #111; }
.failure-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 0.2rem;
  color: #fff;
  background: rgb(20 20 20 / 62%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}
.failure-overlay.is-visible { opacity: 1; }
.failure-overlay strong { font-family: "Google Sans", "Noto Sans", sans-serif; font-size: clamp(1.35rem, 3vw, 2rem); font-weight: 600; }
.failure-overlay span { font-size: 0.95rem; }
#conclusion-statement {
  width: min(100%, 56rem);
  margin: 0 auto;
  color: var(--muted);
  text-align: center;
}

.section {
  width: min(calc(100% - 3rem), var(--max));
  margin-inline: auto;
  padding: 3rem 0;
}

.section-heading {
  width: min(100%, 48rem);
  margin: 0 auto 2rem;
  text-align: center;
}

.section-heading h2,
.paper h2 {
  margin: 0;
  font-family: "Google Sans", "Noto Sans", sans-serif;
  font-size: clamp(1.75rem, 3vw, 2rem);
  font-weight: 600;
  letter-spacing: normal;
  line-height: 1.2;
}

.split-heading > p { margin: 1rem auto 0; color: var(--muted); text-align: center; }

.method-interactive {
  padding: 1.25rem;
  background: #fafafa;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.cone-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem 1.4rem;
  min-height: 1.05rem;
  margin-bottom: 0.45rem;
  color: var(--muted);
  font-size: 0.78rem;
}
.cone-legend > span { display: inline-flex; align-items: center; gap: 0.45rem; }
.legend-swatch { display: inline-block; width: 2rem; border-top: 2.5px solid #4f5c66; }
.margin-swatch { border-color: #e58b32; border-top-style: dashed; }
.margin-legend-item { transition: opacity 160ms ease; }

.method-stage {
  display: grid;
  width: 90%;
  margin-inline: auto;
  grid-template-areas: "left model right";
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.25fr) minmax(0, 0.9fr);
  gap: 1rem;
  align-items: start;
}

.method-stage figure,
.demand-view { margin: 0; min-width: 0; }
.method-stage figcaption,
.demand-view figcaption {
  margin-bottom: 0.45rem;
  font-family: "Google Sans", "Noto Sans", sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
}

.contact-left { grid-area: left; }
.tilt-view { grid-area: model; }
.contact-right { grid-area: right; }
.method-stage svg,
.demand-view svg { display: block; width: 100%; height: auto; overflow: visible; }

.contact-view svg {
  background: transparent;
}

.cone-fill { fill: #e8eef5; }
.cone-boundary { fill: none; stroke: #4f5c66; stroke-width: 2.5; stroke-linejoin: round; }
.margin-boundary { fill: none; stroke: #e58b32; stroke-width: 2.5; stroke-dasharray: 6 5; stroke-linejoin: round; }
.cone-axis { stroke: #bfc7c9; stroke-width: 1.25; }
.force-vector { stroke: #4f7398; stroke-width: 4; stroke-linecap: round; }
.contact-view marker path { fill: #4f7398; }
.axis-label { fill: #777; font-family: "Noto Sans", sans-serif; font-size: 10px; }
.contact-reading {
  display: grid;
  gap: 0.1rem;
  margin: 0 0 0.45rem;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
  text-align: center;
}

.tilt-view svg { background: transparent; }
.ground-hatch { fill: url(#ground-hatch); }
#ground-hatch line { stroke: #aeb4b8; stroke-width: 4; }
.floor-line { stroke: #2d3236; stroke-width: 4.5; stroke-linecap: square; }
.tilt-object rect { fill: #f8f7f5; stroke: #292e32; stroke-width: 4; }
.finger-stem { stroke: #4f7398; stroke-width: 12; stroke-linecap: round; opacity: 0.8; }
.contact-hemisphere { fill: #5e86ae; stroke: #292e32; stroke-width: 3.5; stroke-linejoin: round; opacity: 0.92; }
.contact-marker { fill: #fff; stroke: #292e32; stroke-width: 3; }
.left-marker,
.right-marker { fill: #fff; }
.center-marker { fill: #b83b4b; stroke: #fff; stroke-width: 2; }
.contact-connector { fill: none; stroke-width: 2; stroke-dasharray: 5 5; opacity: 0.65; }
.left-connector,
.right-connector { stroke: #4f7398; }
.pivot-marker { fill: #292e32; }
.gravity-line { stroke: #b83b4b; stroke-width: 3; stroke-linecap: round; }
.tilt-view marker path { fill: #b83b4b; }
.model-label { fill: var(--muted); font-family: "Noto Sans", sans-serif; font-size: 12px; }
.demand-view { margin-top: 1.25rem; }
.demand-view svg { height: 140px; }
.chart-axis { stroke: #c5cbcd; stroke-width: 1.5; }
.demand-area { fill: #e8eef5; }
.demand-line { fill: none; stroke: #4f7398; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.demand-guide { stroke: #4f7398; stroke-width: 1.5; stroke-dasharray: 4 4; }
.demand-point { fill: #4f7398; stroke: #fff; stroke-width: 2.5; }
.chart-label { fill: #777; font-family: "Noto Sans", sans-serif; font-size: 11px; }

.method-controls {
  display: grid;
  grid-template-columns: auto minmax(10rem, 1fr) auto;
  gap: 1rem;
  align-items: center;
  margin-top: 0.8rem;
  padding: 0.9rem 1rem;
  background: #fff;
  border: 1px solid #e7e7e7;
  border-radius: 12px;
}
.method-controls label { font-size: 0.9rem; font-weight: 600; white-space: nowrap; }
.method-controls output { display: inline-block; min-width: 2.8rem; color: #4f7398; font-variant-numeric: tabular-nums; }
.method-controls input[type="range"] { width: 100%; accent-color: #4f7398; cursor: pointer; }
.margin-toggle {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.75rem;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: 600 0.85rem/1 "Noto Sans", sans-serif;
  cursor: pointer;
}
.toggle-track { position: relative; display: block; width: 2.3rem; height: 1.3rem; background: #4f7398; border-radius: 999px; }
.toggle-track span { position: absolute; top: 0.18rem; left: 1.18rem; width: 0.94rem; height: 0.94rem; background: #fff; border-radius: 50%; }
.margin-toggle[aria-pressed="false"] .toggle-track { background: #a7afb1; }
.margin-toggle[aria-pressed="false"] .toggle-track span { left: 0.18rem; }
.margin-toggle:disabled,
.method-controls input:disabled { cursor: wait; opacity: 0.65; }
.method-interactive.margin-off .margin-boundary { opacity: 0; }
.method-interactive.margin-off .margin-legend-item { opacity: 0.35; }
.method-error { margin: 0.75rem 0 0; color: #a63d2d; font-size: 0.88rem; text-align: center; }

.video-group { padding: 2.5rem 0; }
.video-group + .video-group { border-top: 1px solid var(--line); }
.video-group-heading { width: min(100%, 48rem); margin: 0 auto 1.5rem; text-align: center; }
.video-group-heading h3 { margin: 0; font-family: "Google Sans", "Noto Sans", sans-serif; font-size: 1.5rem; font-weight: 600; }
.video-group-heading p { margin: 0.6rem 0 0; color: var(--muted); }
.evidence-grid { display: grid; gap: 1rem; }
.evidence-grid.two-column { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.evidence-video { min-width: 0; text-align: center; }
.evidence-video video { display: block; width: 100%; aspect-ratio: 960 / 536; background: #111; }
.evidence-video h4 { display: flex; align-items: center; justify-content: center; gap: 0.3rem; margin: 0.55rem 0 0; font-family: "Google Sans", "Noto Sans", sans-serif; font-size: 0.95rem; font-weight: 600; line-height: 1.25; }
.comparison-video video { display: block; width: 100%; aspect-ratio: 1440 / 804; background: #111; }
.model-mismatch-comparison video { display: block; width: 100%; aspect-ratio: 1920 / 358; background: #111; }
.fixed-margin-comparison video { display: block; width: 100%; aspect-ratio: 1440 / 402; background: #111; }
.video-takeaway { width: min(100%, 46rem); margin: 1rem auto 0; color: var(--muted); text-align: center; }
.summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem; width: min(100%, 56rem); margin-inline: auto; align-items: start; }
.summary-panel { min-width: 0; }
.summary-panel h4 { margin: 0 0 0.75rem; font-family: "Google Sans", "Noto Sans", sans-serif; font-size: 1.1rem; font-weight: 600; text-align: center; }
.comparison-summary .summary-table + h4 { margin-top: 2rem; }
.summary-table { width: 100%; border-collapse: collapse; color: var(--ink); font-family: "Noto Sans", sans-serif; font-size: 0.9rem; font-weight: 400; }
.summary-table th,
.summary-table td { padding: 0.7rem 0.8rem; border-bottom: 1px solid var(--line); text-align: left; }
.summary-table thead th { color: var(--ink); background: var(--soft); font-size: inherit; font-weight: 400; }
.summary-table th:last-child,
.summary-table td:last-child { text-align: center; white-space: nowrap; }
.summary-result { font-weight: 400; }
.summary-note { width: min(100%, 56rem); margin: 0.9rem auto 0; color: var(--muted); font-size: 0.9rem; text-align: center; }

.abstract-section article { width: min(100%, 48rem); margin-inline: auto; }
.paper article > h2 { text-align: center; }
.paper article > p:not(.eyebrow) { color: var(--muted); text-align: justify; }
pre {
  margin: 0;
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  color: var(--ink);
  background: var(--soft);
  border-radius: 6px;
  font-size: 0.9rem;
  line-height: 1.5;
}

footer {
  margin-top: 2rem;
  padding: 3rem 1.5rem;
  color: var(--muted);
  background: var(--soft);
  font-size: 0.85rem;
}

.footer-content { width: min(100%, 40rem); margin-inline: auto; }
footer p { margin: 0 0 0.75rem; }
footer p:last-child { margin-bottom: 0; }
footer a { text-decoration: none; }
footer a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 3px; }

@media (max-width: 650px) {
  .hero { padding: 2.5rem 1rem; }
  h1 { font-size: clamp(2rem, 9vw, 2.5rem); }
  .teaser { width: calc(100% - 2rem); padding-bottom: 2.5rem; }
  .teaser-grid { grid-template-columns: 1fr; gap: 1.75rem; }
  .section { width: calc(100% - 2rem); padding: 2.5rem 0; }
  .evidence-grid.two-column { grid-template-columns: 1fr; gap: 2rem; }
  .video-group { padding: 2rem 0; }
  .summary-grid { grid-template-columns: 1fr; gap: 2rem; }
  .summary-table th,
  .summary-table td { padding: 0.6rem 0.55rem; }
  .method-interactive { padding: 0.85rem; }
  .method-stage {
    width: 100%;
    grid-template-areas:
      "model model"
      "left right";
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem 0.65rem;
  }
  .tilt-view { width: min(100%, 29rem); margin-inline: auto !important; }
  .contact-reading { font-size: 0.7rem; }
  .method-controls { grid-template-columns: 1fr auto; gap: 0.65rem; }
  .method-controls input[type="range"] { grid-column: 1 / -1; grid-row: 2; }
  .margin-toggle { grid-column: 2; grid-row: 1; }
  .demand-view svg { height: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .failure-overlay { transition: none; }
  .toggle-track span,
  .margin-boundary,
  .margin-legend-item { transition: none; }
}
