:root {
  --ink: #15171b;
  --ink-2: #4a505b;
  --ink-3: #8a909a;
  --rule: #e3e5e8;
  --paper: #ffffff;
  --tint: #f5f6f7;
  --navy: #1d3f94;

  --sans: "Jost", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --w: 760px;
  --w-wide: 1040px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }

.wrap {
  max-width: var(--w);
  margin: 0 auto;
  padding: 0 24px;
}
.wrap.wide { max-width: var(--w-wide); }

/* ---------- Hero ---------- */

.hero {
  padding: 96px 0 56px;
  text-align: center;
}

.title {
  margin: 0;
  color: var(--navy);
  font-weight: 500;
  font-size: clamp(40px, 7vw, 68px);
  letter-spacing: -0.01em;
  line-height: 1.05;
}

.subtitle {
  margin: 22px auto 0;
  max-width: 640px;
  font-weight: 400;
  font-size: clamp(18px, 2.4vw, 23px);
  line-height: 1.45;
  color: var(--ink-2);
}

.subtitle::after {
  content: "";
  display: block;
  width: 56px;
  height: 2px;
  margin: 30px auto 0;
  background: var(--navy);
}

.authors {
  margin: 30px 0 0;
  font-size: 17px;
  letter-spacing: 0.01em;
}
.authors span { display: inline-block; margin: 0 0.6em; }
.authors a { text-decoration: none; border-bottom: 1px solid transparent; }
.authors a:hover { border-color: currentColor; }
.authors sup { font-size: 0.65em; margin-left: 1px; color: var(--ink-3); }

.affil { margin: 6px 0 0; font-size: 15px; color: var(--ink-2); }

.links {
  margin-top: 36px;
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 132px;
  justify-content: center;
  padding: 11px 22px;
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: background 160ms ease, color 160ms ease;
}
.btn svg { width: 17px; height: 17px; flex: none; }
.btn:hover { background: var(--ink); color: var(--paper); }
.btn.is-pending { border-color: var(--rule); color: var(--ink-3); pointer-events: none; }

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

main > section.wrap { padding-top: 96px; }
main > section.wrap:first-child { padding-top: 8px; }

.label {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 0 0 28px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink);
}
.label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--rule);
}

.abstract {
  margin: 0;
  text-align: justify;
  hyphens: auto;
  color: #23262c;
}

.lead {
  margin: -8px 0 28px;
  color: var(--ink-2);
  max-width: 680px;
}

/* ---------- Video ---------- */

.video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--tint);
  overflow: hidden;
}
.video-frame iframe,
.video-frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}
.video-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--rule);
}
.video-placeholder span {
  font-size: 13px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ---------- Figures ---------- */

figure { margin: 0; }

figure img,
figure video {
  display: block;
  width: 100%;
  background: var(--tint);
}

figcaption {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 12px 0 0;
  font-size: 14.5px;
  border-top: 0;
}
figcaption .meta {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
}

.feature { margin-bottom: 40px; }
.feature video { aspect-ratio: 960 / 544; object-fit: cover; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px 20px;
}
.grid img { aspect-ratio: 4 / 3; object-fit: cover; }

/* ---------- Citation ---------- */

.bibtex {
  position: relative;
  background: var(--tint);
  border-left: 2px solid var(--ink);
}
.bibtex pre {
  margin: 0;
  padding: 24px 26px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.65;
  color: #2a2e35;
}
.copy {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 5px 12px;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
}
.copy:hover { border-color: var(--ink); color: var(--ink); }

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

footer {
  margin-top: 104px;
  padding-bottom: 56px;
}
footer p {
  margin: 0;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-3);
  text-align: center;
}

/* ---------- Small screens ---------- */

@media (max-width: 600px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .hero { padding: 64px 0 40px; }
  main > section.wrap { padding-top: 64px; }
  .subtitle br { display: none; }
  .abstract { text-align: left; hyphens: manual; }
  .grid { grid-template-columns: 1fr 1fr; gap: 24px 12px; }
  figcaption { flex-direction: column; gap: 2px; font-size: 14px; }
}

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

.slot {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  background: var(--tint);
  border: 1px solid var(--rule);
}
.slot span {
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.slot.banner { aspect-ratio: auto; height: 180px; }

.arch img { background: none; }

figcaption.note {
  display: block;
  padding-top: 16px;
  max-width: 760px;
  margin: 0 auto;
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink-2);
  text-align: center;
}

.sub {
  margin: 0 0 20px;
  font-size: 19px;
  font-weight: 500;
  color: var(--navy);
}
.sub span {
  display: block;
  margin-top: 2px;
  font-size: 14px;
  font-weight: 400;
  color: var(--ink-3);
}
.sub:not(:first-of-type) { margin-top: 64px; }

.strips { display: grid; gap: 28px; }
.strips video { aspect-ratio: 848 / 240; }

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

.slot svg { width: 44px; height: 44px; color: #c9cdd3; }

.task {
  margin: 0 0 12px;
  text-align: center;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.task span {
  display: block;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.strips { gap: 44px; }
.grid.two { gap: 40px 24px; }
@media (max-width: 600px) {
  .grid.two { grid-template-columns: 1fr; }
  .task { font-size: 19px; }
}

.grid.three { grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid video { aspect-ratio: 4 / 3; object-fit: cover; }
@media (max-width: 600px) {
  .grid.three { grid-template-columns: 1fr; gap: 28px; }
}

/* ---------- Results charts ---------- */

.charts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; align-items: end; }
.chart .sub { margin: 0 0 10px; }
.chart .sub:not(:first-of-type) { margin-top: 0; }
.chart .plot { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: var(--rule); stroke-width: 1; }
.chart .axis { stroke: var(--ink-3); stroke-width: 1; }
.chart .tick { font-size: 10.5px; fill: var(--ink-3); }
.chart .cat { font-size: 11.5px; fill: var(--ink-2); }
.chart .val { font-size: 12px; font-weight: 500; fill: var(--ink); font-variant-numeric: tabular-nums; }
.chart .na { font-size: 10.5px; fill: var(--ink-3); }
.chart .bar { cursor: default; outline: none; transition: opacity 120ms ease; }
.chart .bar:hover, .chart .bar:focus { opacity: 0.82; }
.chart .tip {
  position: absolute; transform: translate(-50%, calc(-100% - 22px)); padding: 5px 10px; background: var(--ink); color: var(--paper);
  font-size: 12px; line-height: 1.4; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity 120ms ease; z-index: 2;
}
.chart .tip.on { opacity: 1; }
.legend { display: flex; gap: 16px; margin: 0 0 4px; min-height: 22px; font-size: 13px; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; margin-right: 7px; border-radius: 2px; }
.chart-n {
  margin: 6px 0 0; padding-top: 10px; border-top: 1px solid var(--rule); text-align: center;
  font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3);
}
.chart-note { margin: 22px 0 0; font-size: 14px; color: var(--ink-3); text-align: center; }
/* side by side on anything wider than a phone; the plots scale with their column */
@media (max-width: 900px) { .charts { gap: 16px; } .chart .sub { font-size: 16px; } .chart .sub span { font-size: 12px; min-height: 3.4em; } .legend { font-size: 11.5px; gap: 10px; } .chart-n { font-size: 10px; letter-spacing: 0.1em; } }
@media (max-width: 560px) { .charts { grid-template-columns: 1fr; gap: 44px; max-width: 460px; margin: 0 auto; } .chart .sub { font-size: 19px; } .chart .sub span { font-size: 14px; min-height: 0; } .legend { font-size: 13px; } .chart-n { font-size: 12px; } }

/* ---------- Data strip ---------- */

.stats { display: flex; flex-wrap: wrap; gap: 8px 36px; margin: -6px 0 30px; font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); }
.stats b { margin-right: 8px; font-size: 22px; font-weight: 500; letter-spacing: 0; color: var(--navy); }
.strip-label { margin: 0 0 10px; font-size: 12px; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-2); }
.strip + .strip-label { margin-top: 26px; }
.strip {
  overflow: hidden;
  padding: 8px 0;                 /* room for the hovered tile to grow */
  margin: -8px 0;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 7%, #000 93%, transparent);
          mask-image: linear-gradient(to right, transparent, #000 7%, #000 93%, transparent);
}
.strip-track { display: flex; gap: 14px; width: max-content; animation: strip-drift 60s linear infinite; }
.strip.rev .strip-track { animation-direction: reverse; }
.strip:hover .strip-track { animation-play-state: paused; }
@keyframes strip-drift { from { transform: translateX(0); } to { transform: translateX(calc(-50% - 7px)); } }
.tile { position: relative; flex: none; width: 224px; border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; background: var(--paper); transition: transform 180ms ease, border-color 180ms ease; }
.tile video { display: block; width: 100%; aspect-ratio: 4 / 3; background: var(--paper); }
.tile span { position: absolute; left: 10px; bottom: 8px; font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-2); }
.tile:hover { transform: scale(1.04); border-color: var(--navy); z-index: 1; }
@media (prefers-reduced-motion: reduce) { .strip { overflow-x: auto; -webkit-mask-image: none; mask-image: none; } .strip-track { animation: none; } }
@media (max-width: 600px) { .tile { width: 168px; } }

/* ---------- 3D explorer ---------- */

.explorer { border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; background: var(--paper); }
.ex-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 32px; padding: 14px 18px; border-bottom: 1px solid var(--rule); }
.ex-foot { border-bottom: 0; border-top: 1px solid var(--rule); gap: 14px; }
.ex-group { display: flex; align-items: center; gap: 12px; }
.ex-group > span { font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-3); }
.ex-clips, .ex-hands { display: flex; flex-wrap: wrap; gap: 6px; }
.explorer button {
  padding: 6px 13px; border: 1px solid var(--rule); border-radius: 999px; background: var(--paper); color: var(--ink-2);
  font-family: var(--sans); font-size: 13px; cursor: pointer; transition: border-color 140ms ease, color 140ms ease, background 140ms ease;
}
.explorer button:hover { border-color: var(--ink-3); color: var(--ink); }
.explorer button.on { border-color: var(--navy); background: var(--navy); color: var(--paper); }
.explorer button i { display: inline-block; width: 9px; height: 9px; margin-right: 7px; border-radius: 50%; }
.ex-stage { position: relative; aspect-ratio: 16 / 9; background: linear-gradient(#ffffff, #f4f6f9); cursor: grab; touch-action: none; }
.ex-stage:active { cursor: grabbing; }
.ex-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ex-note { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); pointer-events: none; }
.explorer.is-loading .ex-note::after { content: "Loading"; }
.ex-time { flex: 1; min-width: 120px; accent-color: var(--navy); }
.ex-clock { width: 46px; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ex-hint { margin: 0; padding: 10px 18px 12px; border-top: 1px solid var(--rule); font-size: 12px; letter-spacing: 0.08em; color: var(--ink-3); }
@media (max-width: 600px) { .ex-stage { aspect-ratio: 4 / 3; } .ex-bar { gap: 10px 16px; padding: 12px; } }

/* ---------- Simulation gallery ---------- */

.thumbs { display: flex; gap: 6px; margin-top: 8px; padding-bottom: 6px; overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--rule) transparent; }
.thumbs button { flex: none; width: 64px; padding: 0; border: 2px solid transparent; border-radius: 6px; overflow: hidden; background: var(--tint); cursor: pointer; opacity: 0.72; transition: opacity 140ms ease, border-color 140ms ease; }
.thumbs button img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.thumbs button:hover { opacity: 1; }
.thumbs button.on { border-color: var(--navy); opacity: 1; }
.grid > figure { min-width: 0; }      /* lets the thumbnail row scroll inside its column instead of widening it */

/* ---------- Results: charts grow in when scrolled into view ---------- */

.chart .bar { transform-box: fill-box; transform-origin: 50% 100%; transform: scaleY(0); transition: transform 900ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 120ms ease; }
.chart .val, .chart .na { opacity: 0; transition: opacity 500ms ease; }
.chart.in .bar { transform: scaleY(1); }
.chart.in .val, .chart.in .na { opacity: 1; }
.chart { opacity: 0; transform: translateY(14px); transition: opacity 600ms ease, transform 600ms ease; }
.chart.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .chart, .chart .bar, .chart .val, .chart .na { transition: none; } }
.charts.two { grid-template-columns: 0.72fr 1fr; margin-top: 56px; }
.charts.two .legend { flex-wrap: wrap; gap: 4px 16px; }
@media (max-width: 560px) { .charts.two { grid-template-columns: 1fr; } }


/* ---------- Real world ---------- */

.grid.real video { aspect-ratio: 16 / 9; }
.speed { margin: 8px 0 0; text-align: center; font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); }

/* Players: one clip with its title above; a rail of choices to its right (below on phones) */
.picker { display: grid; grid-template-columns: minmax(0, 1fr) 256px; grid-template-areas: "title ." "video rail" "speed ."; gap: 0 20px; }
.picker .task { grid-area: title; }
.picker .task b { font-weight: 500; }
.picker .task span:empty { display: none; }
.picker video { grid-area: video; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; }
.picker[data-set="real"] video, .picker[data-set="real"] .rail img { aspect-ratio: 16 / 9; }
.picker .speed { grid-area: speed; }
.rail { grid-area: rail; contain: size; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--rule) transparent; padding-right: 4px; }
.rail button { padding: 0; border: 2px solid transparent; border-radius: 6px; background: none; cursor: pointer; opacity: 0.7; transition: opacity 140ms ease, border-color 140ms ease, background 140ms ease; text-align: left; font: inherit; color: inherit; }
.rail button:hover { opacity: 1; }
.rail button.on { opacity: 1; border-color: var(--navy); }
.rail img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 4px; background: var(--tint); }
.rail.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-content: start; }
.rail.list { display: flex; flex-direction: column; gap: 10px; }
.rail.list button { display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: center; padding: 4px; }
.rail.list button.on { background: var(--tint); }
.rail.list b { display: block; font-size: 15px; font-weight: 500; line-height: 1.3; }
.rail.list small { display: block; margin-top: 2px; font-size: 10.5px; letter-spacing: 0.08em; white-space: nowrap; text-transform: uppercase; color: var(--ink-3); }
@media (max-width: 760px) {
  .picker { display: flex; flex-direction: column; }
  .picker .task { order: 1; } .picker video { order: 2; } .picker .speed { order: 3; } .picker .rail { order: 4; }
  .rail { contain: none; display: flex !important; flex-direction: row !important; gap: 8px; overflow-x: auto; overflow-y: hidden; margin-top: 10px; padding: 0 0 6px; }
  .rail button { flex: none; width: 84px; }
  .rail.list button { display: block; width: 116px; padding: 3px; }
  .rail.list span { display: block; padding: 6px 2px 2px; }
  .rail.list b { font-size: 13px; }
  .rail.list small { font-size: 10px; }
}
