/* Static paper site styling inspired by beyond-llms.github.io. */
:root {
  --bg: #faf8f2;
  --paper: #fffdf8;
  --ink: #25221d;
  --muted: #686159;
  --line: rgba(37, 34, 29, 0.13);
  --teal: #1f7a73;
  --gold: #be7d32;
  --blue: #355d9f;
  --violet: #66307f;
  --rose: #b85263;
  --shadow: 0 18px 50px rgba(46, 37, 24, 0.08);
  --display: "Cormorant Garamond", Georgia, serif;
  --body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 8% 10%, rgba(190, 125, 50, 0.12), transparent 28%),
    radial-gradient(circle at 92% 18%, rgba(31, 122, 115, 0.12), transparent 30%),
    var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration-thickness: 0.08em; text-underline-offset: 0.18em; }
img { max-width: 100%; height: auto; }

.container-narrow {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 22px;
}

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

.kicker {
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  margin-bottom: 18px;
  text-transform: uppercase;
}

.paper-title {
  font-family: var(--display);
  font-size: clamp(3rem, 8vw, 6.2rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 0.94;
  margin: 0 auto 20px;
  max-width: 1080px;
}

.paper-subtitle {
  color: var(--muted);
  font-family: var(--display);
  font-size: clamp(1.8rem, 4vw, 3.1rem);
  line-height: 1.05;
  margin: 0 auto 28px;
  max-width: 980px;
}

.author-line,
.affiliation-line,
.meta-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 14px;
  margin: 7px auto;
  max-width: 940px;
}

.author-link {
  color: var(--ink);
  text-decoration: none;
}

.author-link:hover { color: var(--teal); }
.author-link sup, .meta-line { color: var(--muted); font-size: 0.9rem; }

.logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin: 28px auto 30px;
}

.logo-card {
  align-items: center;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid var(--line);
  border-radius: 16px;
  display: inline-flex;
  gap: 12px;
  padding: 12px 18px;
}

.logo-card img {
  max-height: 34px;
  object-fit: contain;
  width: auto;
}

.logo-card span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.paper-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.paper-btn {
  align-items: center;
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 999px;
  color: #fff !important;
  display: inline-flex;
  font-size: 0.95rem;
  font-weight: 700;
  gap: 8px;
  padding: 10px 20px;
  text-decoration: none;
  transition: transform 0.2s ease, background 0.2s ease;
}

.paper-btn.secondary {
  background: transparent;
  color: var(--ink) !important;
}

.paper-btn:hover {
  transform: translateY(-2px);
  text-decoration: none;
}

.tldr-box,
.content-card,
.carousel-shell,
.citation-block {
  background: rgba(255, 253, 248, 0.82);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.tldr-box {
  margin: 0 auto 28px;
  max-width: 1040px;
  padding: 28px clamp(22px, 5vw, 48px);
}

.tldr-headline {
  font-size: clamp(1.35rem, 2.7vw, 2rem);
  font-weight: 800;
  line-height: 1.45;
  margin: 0 0 14px;
  text-align: center;
}

.keyword {
  border-bottom: 2px dashed currentColor;
  color: var(--teal);
  cursor: help;
  position: relative;
}

.keyword.gold { color: var(--gold); }
.keyword.blue { color: var(--blue); }

.keyword span {
  background: #fff;
  border: 1px solid var(--line);
  border-top: 3px solid currentColor;
  border-radius: 12px;
  box-shadow: var(--shadow);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 500;
  left: 50%;
  line-height: 1.55;
  opacity: 0;
  padding: 14px 16px;
  pointer-events: none;
  position: absolute;
  top: calc(100% + 12px);
  transform: translateX(-50%) translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  visibility: hidden;
  width: min(340px, 80vw);
  z-index: 20;
}

.keyword:hover span {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  visibility: visible;
}

.tldr-copy {
  color: var(--muted);
  font-size: 1.05rem;
  margin: 0;
}

.section-nav {
  backdrop-filter: blur(14px);
  background: rgba(250, 248, 242, 0.86);
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
  margin: 28px 0 42px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.section-nav-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  justify-content: center;
  padding: 12px 18px;
}

.section-nav a {
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 800;
  padding: 6px 12px;
  text-decoration: none;
}

.section-nav a:hover,
.section-nav a.active {
  background: var(--ink);
  color: #fff;
}

section { scroll-margin-top: 84px; }

.section-title {
  font-family: var(--display);
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0 auto 22px;
  max-width: 920px;
  text-align: center;
}

.section-title::after {
  background: var(--teal);
  content: "";
  display: block;
  height: 2px;
  margin: 18px auto 0;
  width: 86px;
}

.sec-gold .section-title::after { background: var(--gold); }
.sec-blue .section-title::after { background: var(--blue); }
.sec-violet .section-title::after { background: var(--violet); }

.body-text {
  color: #3d3933;
  margin: 0 auto 24px;
  max-width: 880px;
}

.content-card {
  margin: 0 auto 34px;
  max-width: 1060px;
  padding: 28px clamp(20px, 4vw, 40px);
}

.metric-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 24px auto;
  max-width: 980px;
}

.metric-card {
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
}

.metric-card strong {
  display: block;
  font-size: 1.5rem;
  line-height: 1.2;
}

.metric-card span {
  color: var(--muted);
  display: block;
  font-size: 0.88rem;
  line-height: 1.45;
  margin-top: 6px;
}

.figure-row {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 20px auto 10px;
  max-width: 1080px;
}

.figure-card,
.section-figure {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px;
  text-align: center;
}

.figure-card img,
.section-figure img {
  border-radius: 12px;
  cursor: zoom-in;
  max-height: 420px;
  object-fit: contain;
  width: 100%;
}

.section-figure {
  margin: 24px auto 10px;
  max-width: 940px;
}

.caption {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
  margin: 10px auto 22px;
  max-width: 820px;
  text-align: center;
}

.callout {
  border-left: 3px solid var(--teal);
  border-radius: 0 14px 14px 0;
  margin: 24px auto 0;
  max-width: 880px;
  padding: 14px 18px;
}

.callout.teal { background: rgba(31, 122, 115, 0.07); border-left-color: var(--teal); }
.callout.gold { background: rgba(190, 125, 50, 0.08); border-left-color: var(--gold); }
.callout.blue { background: rgba(53, 93, 159, 0.08); border-left-color: var(--blue); }
.callout.violet { background: rgba(102, 48, 127, 0.08); border-left-color: var(--violet); }
.callout p { margin: 0; }

.section-divider {
  border: 0;
  height: 1px;
  margin: 42px auto;
  max-width: 280px;
  position: relative;
}

.section-divider::before {
  background: var(--line);
  content: "";
  height: 1px;
  left: 50%;
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  width: 80px;
}

.carousel-shell {
  margin: 0 auto 34px;
  max-width: 1100px;
  overflow: hidden;
}

.carousel-header {
  align-items: center;
  background: rgba(37, 34, 29, 0.04);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 14px 18px;
}

.carousel-title {
  font-weight: 900;
}

.carousel-subtitle {
  color: var(--muted);
  display: block;
  font-size: 0.86rem;
  font-style: italic;
  font-weight: 500;
  line-height: 1.35;
  margin-top: 2px;
}

.carousel-controls {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.icon-btn,
.play-all-btn,
.copy-citation-btn {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  font-family: var(--body);
  font-size: 0.86rem;
  font-weight: 800;
  gap: 6px;
  justify-content: center;
  padding: 7px 12px;
}

.icon-btn {
  height: 36px;
  padding: 0;
  width: 36px;
}

.icon-btn:hover,
.play-all-btn:hover,
.copy-citation-btn:hover {
  background: var(--ink);
  color: #fff;
}

.carousel-body { padding: 18px; }

.carousel-slide { display: none; }
.carousel-slide.active { display: block; }

.vid-group { margin-bottom: 16px; }
.vid-group:last-child { margin-bottom: 0; }

.vid-group-label {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  margin-bottom: 7px;
  text-transform: uppercase;
}

.vid-group-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.vid-group-grid[data-count="1"] .vid-item { grid-column: 2; }
.vid-group-grid[data-count="2"] .vid-item:first-child { grid-column: 1; }
.vid-group-grid[data-count="2"] .vid-item:nth-child(2) { grid-column: 2; }

#carousel-multi .vid-group-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#carousel-multi .vid-group-grid[data-count="1"] .vid-item:not(.gt) {
  grid-column: 1;
}

.ground-truth-group .vid-group-label {
  text-align: center;
}

.ground-truth-group .vid-group-grid[data-count="1"] .vid-item.gt {
  grid-column: 1 / -1;
  justify-self: center;
  width: calc((100% - 12px) / 2);
}

.split-video-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(var(--total-count), minmax(0, 1fr));
}

.split-heading {
  margin-bottom: 0;
  text-align: center;
}

.split-heading-left {
  grid-column: 1 / span var(--left-count);
}

.split-heading-right {
  grid-column: calc(var(--left-count) + 1) / span var(--right-count);
}

.vla-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ood-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(34px, 0.16fr) repeat(var(--total-count), minmax(0, 1fr));
}

.ood-heading {
  margin-bottom: 0;
  text-align: center;
}

.ood-reconstruction-heading {
  grid-column: 2 / span var(--reconstruction-count);
}

.ood-semantic-heading {
  grid-column: calc(var(--reconstruction-count) + 2) / span var(--semantic-count);
}

.ood-row-label {
  align-self: stretch;
  background: rgba(37, 34, 29, 0.045);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0;
  padding: 2px 2px;
  font-size: 0.7rem;
  line-height: 1;
  text-align: center;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.group-divider {
  position: relative;
}

.group-divider::before {
  background: var(--line);
  content: "";
  bottom: 0;
  pointer-events: none;
  position: absolute;
  left: -6px;
  top: 0;
  width: 2px;
  transform: translateX(-50%);
}

.vid-item {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.vid-model-label {
  border-radius: 10px 10px 0 0;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 900;
  overflow: hidden;
  padding: 5px 8px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vid-item.gt .vid-model-label { background: #59534d; }

.vid-video-wrapper {
  display: flex;
  flex: 1;
  flex-direction: column;
  position: relative;
}

video {
  aspect-ratio: 1 / 1;
  background: #080808;
  border-radius: 0 0 10px 10px;
  display: block;
  object-fit: contain;
  width: 100%;
}

#carousel-multi video { aspect-ratio: 3 / 1; }

.vid-score-overlay {
  border-radius: 8px;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 1000;
  line-height: 1.2;
  padding: 3px 8px;
  position: absolute;
  right: 7px;
  top: 7px;
}

.overlay-success { background: rgba(34, 151, 74, 0.9); }
.overlay-failure { background: rgba(190, 54, 54, 0.9); }

.carousel-footer {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 12px 18px;
}

.dots {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dot {
  background: rgba(37, 34, 29, 0.18);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  height: 9px;
  padding: 0;
  width: 9px;
}

.dot.active {
  background: var(--teal);
  width: 26px;
}

.carousel-count {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.citation-block {
  margin: 0 auto 42px;
  max-width: 920px;
  overflow: hidden;
  position: relative;
}

.citation-block pre {
  margin: 0;
  overflow-x: auto;
  padding: 26px;
}

.citation-block code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.88rem;
}

.copy-citation-btn {
  position: absolute;
  right: 14px;
  top: 14px;
}

.footer {
  color: var(--muted);
  padding: 34px 0 56px;
  text-align: center;
}

.lightbox {
  align-items: center;
  background: rgba(18, 16, 14, 0.88);
  cursor: zoom-out;
  display: none;
  inset: 0;
  justify-content: center;
  padding: 28px;
  position: fixed;
  z-index: 50;
}

.lightbox.open { display: flex; }

.lightbox img {
  background: #fff;
  border-radius: 14px;
  max-height: 92vh;
  max-width: 94vw;
  object-fit: contain;
  padding: 10px;
}

@media (max-width: 860px) {
  body { font-size: 16px; }
  .hero { padding-top: 54px; }
  .metric-grid,
  .figure-row,
  .vid-group-grid,
  #carousel-multi .vid-group-grid,
  .split-video-grid,
  .vla-grid,
  .ood-grid {
    grid-template-columns: 1fr;
  }
  .vid-group-grid[data-count="1"] .vid-item,
  .vid-group-grid[data-count="2"] .vid-item:first-child,
  .vid-group-grid[data-count="2"] .vid-item:nth-child(2) {
    grid-column: auto;
  }
  .split-heading-left,
  .split-heading-right,
  .ood-reconstruction-heading,
  .ood-semantic-heading {
    grid-column: auto;
  }
  .group-divider::before {
    display: none;
  }
  .ground-truth-group .vid-group-grid[data-count="1"] .vid-item.gt {
    width: 100%;
  }
  .ood-row-label {
    writing-mode: horizontal-tb;
    transform: none;
  }
  .carousel-header,
  .carousel-footer {
    align-items: flex-start;
    flex-direction: column;
  }
  .logos { flex-direction: column; }
}

@media (max-width: 560px) {
  .container-narrow { padding: 0 14px; }
  .content-card,
  .carousel-body,
  .tldr-box { padding: 18px; }
  .section-nav { position: static; }
  .paper-buttons { align-items: stretch; flex-direction: column; }
  .paper-btn { justify-content: center; }
}
