:root {
  --navy: #1b427d;
  --ink: #263445;
  --heading: #112846;
  --muted: #657080;
  --line: #e3e7ec;
  --link: #1672b8;
}

html { scroll-behavior: smooth; }
body {
  color: var(--ink);
  background: #fff;
  font-family: 'Noto Sans', sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); }
a:hover { color: var(--navy); }
a:focus-visible, summary:focus-visible, video:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 4px;
}
section, [id] { scroll-margin-top: 1.5rem; }
.container.is-max-desktop { max-width: 1040px !important; }

/* The compact navigation and centered header follow the LightSplat template. */
.research-hub { padding: 1.1rem 1.5rem 0; }
.research-hub-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}
.research-home, .research-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.42rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #4d5662;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease;
}
.research-home:hover, .research-toggle:hover { color: var(--navy); border-color: #aebccd; }
.research-home-icon, .research-toggle-icon { font-size: 0.75rem; }
.research-dropdown { display: inline-flex; }
.research-toggle { list-style: none; }
.research-toggle::-webkit-details-marker { display: none; }
.research-toggle::marker { content: ''; }
.research-toggle-icon { transition: transform 160ms ease; }
.research-dropdown[open] .research-toggle-icon { transform: rotate(180deg); }
.research-menu {
  position: absolute;
  top: calc(100% + 0.6rem);
  left: 50%;
  z-index: 10;
  width: min(360px, calc(100vw - 2rem));
  padding: 0.45rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgb(17 40 70 / 9%);
  transform: translateX(-50%);
}
.research-dropdown:not([open]) .research-menu { display: none; }
.research-card {
  display: grid;
  grid-template-columns: 1.2rem 1fr auto;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem;
  border-radius: 4px;
  color: var(--heading);
}
.research-card:hover { background: #f6f7f9; }
.research-card-icon, .research-card-arrow { color: var(--muted); }
.research-card-arrow { font-size: 0.75rem; }
.research-card-copy { display: grid; gap: 0.2rem; }
.research-card-kicker { font-size: 0.7rem; color: var(--muted); }
.research-card-title { font-size: 0.95rem; font-weight: 600; }
.research-card-desc { font-size: 0.77rem; color: var(--muted); }

.hero { background: #fff; }
.hero-body { padding: 2.4rem 1.5rem 1rem; animation: intro-in 450ms ease both; }
.eyebrow {
  margin-bottom: 1rem;
  color: #b12b2b;
  font-size: 1.4rem;
  font-weight: 700;
}
.publication-title {
  max-width: 1040px;
  margin: 0 auto 1.35rem !important;
  color: var(--heading) !important;
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
  font-size: clamp(1.85rem, 3.3vw, 2.625rem) !important;
  font-weight: 700;
  line-height: 1.16;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.title-line { display: block; }
.title-accent { position: relative; display: inline-block; color: var(--navy); }
.title-accent::after {
  position: absolute;
  right: 0;
  bottom: -0.055em;
  left: 0;
  height: 2px;
  background: currentColor;
  content: '';
  opacity: 0.25;
  transform-origin: left;
  animation: underline-in 650ms 150ms ease both;
}
.publication-authors { line-height: 1.7; }
.publication-authors.is-names { margin-bottom: 0.12rem; }
.publication-authors.is-names a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 4px;
  transition: color 160ms ease, text-decoration-color 160ms ease;
}
.publication-authors.is-names a:hover { color: var(--navy); text-decoration-color: currentColor; }
.author-block { display: inline-block; }
.publication-affiliations {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.2rem 2.5rem;
}
.publication-footnotes {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  margin-top: 0.4rem;
  color: var(--muted);
  font-size: 0.85rem;
}
.publication-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.3rem;
}
.publication-links .button {
  height: 2.45rem;
  border: 0;
  background: #363636;
  color: #fff;
  font-size: 0.95rem;
  transition: background-color 160ms ease, transform 160ms ease;
}
.publication-links a.button:hover { background: var(--navy); color: #fff; transform: translateY(-1px); }

.section-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem;
  margin: 1.15rem auto 0;
}
.section-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.55rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fafbfd;
  color: #536276;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.25;
  white-space: nowrap;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}
.section-nav i { width: 1em; font-size: 0.85em; text-align: center; }
.section-nav a:hover,
.section-nav a:focus-visible,
.section-nav a[aria-current='location'] { color: var(--navy); background: #edf3fb; border-color: #c5d5eb; }

.section { padding: 3rem 1.5rem; }
.teaser-section { padding-top: 1.5rem; }
.section-soft { background: #fafafa; }
.section-title {
  text-align: left;
  margin-bottom: 1.2rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--line);
  color: var(--heading);
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.25;
}
.section-lead, .content p { color: #4e5b6b; font-size: 1.03rem; line-height: 1.8; }
.section-lead { max-width: 940px; margin-bottom: 1.75rem; }
.content p { text-align: left; }
.minor-title, .card-title {
  color: var(--heading);
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
  font-weight: 600;
}
.minor-title { margin-bottom: 1rem; font-size: 1.2rem; }
.demo-section { padding-bottom: 2.75rem; }
.demo-panel { max-width: 960px; margin: 0 auto; }
.demo-video, .result-video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
}
.demo-panel .figure-caption { max-width: 890px; margin: 1rem auto 0; text-align: center; }
.figure-panel { margin: 0; padding: 0; }
.figure-panel img { display: block; width: 100%; height: auto; }
.teaser-panel { max-width: 880px; margin: 0 auto; }
.figure-caption {
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.8;
  text-align: left;
}
.caption-label, .caption-title { color: #3e4a5a; font-weight: 600; }

.grounding-flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 0 2rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  list-style: none;
  text-align: center;
}
.grounding-stage { position: relative; display: grid; gap: 0.3rem; padding: 0 1rem; }
.grounding-stage:not(:last-child)::after {
  position: absolute;
  top: 50%;
  right: -0.4rem;
  color: #a4adb9;
  content: '→';
  transform: translateY(-50%);
}
.stage-label { color: var(--muted); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; }
.stage-title { color: var(--navy); font-size: 1rem; }
.stage-detail { color: var(--muted); font-size: 0.8rem; line-height: 1.5; }
.story-grid, .step-list { display: grid; gap: 1.5rem; }
.story-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.step-list { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 2rem; }
.story-card, .step-card { padding-top: 1rem; border-top: 2px solid #d9e0e8; }
.signal-head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.7rem; color: var(--navy); }
.signal-icon { display: inline-flex; align-items: center; width: 1.2rem; font-size: 1rem; }
.card-kicker { font-size: 0.76rem; font-weight: 600; }
.card-title { margin-bottom: 0.55rem; font-size: 1.1rem; line-height: 1.4; }
.story-card p, .step-card p { color: var(--muted); font-size: 0.92rem; line-height: 1.7; }
.video-stack, .qual-stack, .table-stack { display: grid; gap: 2.5rem; }
.video-stack { margin-bottom: 2.75rem; }
.video-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 0.4rem 1rem; margin-bottom: 0.8rem; }
.video-heading .minor-title { margin: 0; }
.video-comparison { color: var(--muted); font-size: 0.85rem; }
.motion-legend { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; margin: -0.5rem 0 1.5rem; color: var(--muted); font-size: 0.85rem; }
.motion-legend span { display: inline-flex; align-items: center; gap: 0.45rem; }
.motion-legend span::before { width: 0.55rem; height: 0.55rem; border-radius: 50%; content: ''; }
.motion-legend .observed::before { background: #d5a91f; }
.motion-legend .ground-truth::before { background: #ba3152; }
.motion-legend .predicted::before { background: #24649e; }

/* Paper tables use typographic emphasis rather than colored score badges. */
.table-panel { overflow-x: auto; padding-bottom: 0.4rem; }
.paper-table-title { margin-bottom: 0.35rem; color: var(--heading); font-size: 1.03rem; font-weight: 600; }
.paper-table-subhead { margin-bottom: 0.9rem; color: var(--muted); font-size: 0.86rem; line-height: 1.7; }
.paper-results-table { width: 100%; min-width: 650px; border-collapse: collapse; font-size: 0.88rem; font-variant-numeric: tabular-nums; }
.paper-results-table th, .paper-results-table td { padding: 0.7rem 0.65rem; text-align: center; vertical-align: middle; white-space: nowrap; }
.paper-results-table th { border-top: 1.5px solid #8e9bab; border-bottom: 1px solid #aeb8c5; color: var(--heading); font-weight: 600; }
.paper-results-table td { border-bottom: 1px solid #e9ecf0; }
.paper-results-table tbody tr:last-child td { border-bottom: 1.5px solid #8e9bab; }
.paper-results-table th:first-child, .paper-results-table td:first-child { text-align: left; }
.paper-results-table tbody tr:hover { background: #f4f6f8; }
.paper-results-table .ours-row td:first-child { color: var(--navy); font-weight: 700; }
.score-mark.best { color: var(--navy); font-weight: 700; }
.score-mark.second { text-decoration: underline; text-underline-offset: 3px; }
.cue-results-table { min-width: 800px; }
.bibtex-section {
  padding: 1.3rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #f7f8fa;
  font-size: 0.86rem;
  line-height: 1.8;
  white-space: pre;
  overflow-x: auto;
}
.footer { padding: 2rem 1.5rem; border-top: 1px solid var(--line); background: #fff; }
.footer .content p { color: var(--muted); font-size: 0.8rem; line-height: 1.8; text-align: center; }

/* A short entrance, once per section. Content is visible without JavaScript. */
.reveal-pending { opacity: 0; transform: translateY(10px); transition: opacity 420ms ease, transform 420ms ease; }
.reveal-pending.is-visible { opacity: 1; transform: none; }
@keyframes intro-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes underline-in { from { transform: scaleX(0); } to { transform: scaleX(1); } }

@media (max-width: 1023px) {
  .step-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  .hero-body { padding: 1.8rem 1.1rem 0.85rem; }
  .publication-authors.is-names { font-size: 1.08rem !important; }
  .publication-footnotes { font-size: 0.76rem; }
  .section { padding: 2.4rem 1.1rem; }
  .teaser-section { padding-top: 1.25rem; }
  .section-title { font-size: 1.65rem; }
  .section-lead, .content p { font-size: 0.96rem; }
  .figure-caption { font-size: 0.86rem; }
  .story-grid { grid-template-columns: 1fr; gap: 1.3rem; }
  .video-stack, .qual-stack, .table-stack { gap: 2rem; }
  .grounding-stage { padding: 0 0.7rem; }
  .stage-title { font-size: 0.9rem; }
  .stage-detail { font-size: 0.73rem; }
}
@media (max-width: 480px) {
  .publication-title { font-size: 1.85rem !important; letter-spacing: -0.03em; }
  .publication-links { gap: 0.4rem; }
  .publication-links .button { font-size: 0.85rem; padding-right: 0.9rem; padding-left: 0.9rem; }
  .section-nav { max-width: 340px; gap: 0.45rem; margin-top: 1rem; }
  .section-nav a { min-height: 2.6rem; gap: 0.35rem; font-size: 0.85rem; padding: 0.55rem 0.6rem; }
  .step-list { grid-template-columns: 1fr; }
  .grounding-flow { grid-template-columns: 1fr; gap: 1.5rem; }
  .grounding-stage:not(:last-child)::after { top: auto; right: 50%; bottom: -1.2rem; content: '↓'; transform: translateX(50%); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal-pending { opacity: 1; transform: none; }
}
