:root {
  --accent: #3b6fb6;
  --muted: #6b7280;
  --rule: #e5e7eb;
}

html {
  overflow-x: clip;
}

body {
  font-family: 'Figtree', "Helvetica Neue", Arial, sans-serif;
  color: #4b5563;
  line-height: 1.65;
  background: #f0f6ff;
  overflow-x: clip;
}

.publication-title {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1.5rem;
}

.publication-authors {
  margin-bottom: 0;
}

/* header dot-grid pattern */
.publication-header {
  position: relative;
  overflow: hidden;
  background: linear-gradient(to bottom, #f0f6ff 0%, #f0f6ff 80%, #ffffff 100%);
}

.publication-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, #bfdbfe 2px, transparent 2px);
  background-size: 36px 36px;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,0.2) 70%, transparent 100%);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,0.2) 70%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

.publication-header .hero-body {
  position: relative;
  z-index: 1;
  padding-bottom: 0;
}

.publication-header + .section {
  padding-top: 0.75rem;
}

/* "Will It Render?" title accent */
.title-wir {
  color: var(--accent);
}

/* WACV venue badge — sits inline with Paper/arXiv/Code buttons */
.venue-badge {
  display: inline-flex;
  align-items: center;
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 800;
  font-size: 0.88rem;
  padding: 0.42rem 1rem;
  border-radius: 20px;
  margin: 0 0.4rem;
  vertical-align: middle;
  letter-spacing: 0.03em;
}

/* TL;DR block */
.tldr-box {
  border-left: 4px solid var(--accent);
  padding: 0.9rem 1.2rem;
  background: #f0f7ff;
  border-radius: 0 8px 8px 0;
  font-size: 1.05rem;
  color: #1f2937;
  max-width: 60vw;
  margin: 0 auto 1.8rem;
  line-height: 1.6;
}

.tldr-label {
  font-weight: 800;
  color: var(--accent);
  margin-right: 0.5rem;
  font-size: 1rem;
  letter-spacing: 0.04em;
}

/* Full-width teaser (TL;DR + carousel) */
.section-teaser {
  background: #fff !important;
  border-top: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  max-width: 100% !important;
  margin: 0 !important;
}

/* Bubble sections */
.section {
  background: #fff;
  border-top: 3px solid var(--accent);
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
  max-width: 60%;
  margin: 1.5rem auto;
  padding: 2.5rem 2rem !important;
}

/* Let content fill the section — override Bulma's is-max-desktop cap */
.section > .container {
  max-width: 100% !important;
  width: 100% !important;
}

/* Section separators are now just spacing — bubbles provide visual separation */
.section-rule {
  border: none;
  margin: 0;
}

.publication-links {
  margin-top: 0.75rem;
}

.publication-links .link-block {
  margin: 0 0.25rem;
}

.publication-links .button.is-dark:hover {
  background-color: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #fff !important;
}

.publication-banner {
  display: block;
  margin: 0 auto;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.teaser .content {
  margin-top: 1.25rem;
  color: var(--muted);
}

.title.is-3 {
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.result-video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  background: #fff;
}

.video-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 1.5rem auto 0.5rem;
}

@media screen and (min-width: 1024px) {
  .video-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.caption {
  color: var(--muted);
  margin-bottom: 2.5rem;
}

.stat-row {
  margin-top: 1rem;
}

.stat-number {
  font-size: 3.2rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.stat-unit {
  font-size: 1.6rem;
  margin-left: 0.15rem;
}

.stat-label {
  margin-top: 0.6rem;
  color: #374151;
}

.stat-base {
  color: var(--muted);
  font-size: 0.9rem;
}

figure.image {
  margin: 2rem auto;
}

figure.image img {
  display: block;
  margin: 0 auto;
  border-radius: 6px;
}

figure.image figcaption {
  margin-top: 0.75rem;
  color: var(--muted);
}

.results-table thead th {
  text-align: center;
  white-space: nowrap;
}

.results-table th,
.results-table td {
  padding: 0.2rem 0.35rem !important;
}

.results-table td b {
  font-weight: 700;
  color: #111;
}

/* Blue line at bottom of header — box-shadow bypasses border-collapse */
.results-table thead tr:first-child th[rowspan],
.results-table thead tr:last-child th {
  box-shadow: inset 0 -3px 0 0 var(--accent);
}

.results-table td {
  text-align: center;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.results-table td:first-child {
  text-align: left;
}

/* Separator rows — hairline via box-shadow (immune to border-collapse) */
.results-table tr.rule-row td {
  height: 0;
  padding: 0;
  background: transparent;
  border: none !important;
  box-shadow: 0 2px 0 0 var(--accent);
  font-size: 0;
  line-height: 0;
}

.bibtex-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.copy-bibtex-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.5rem 0.9rem;
  cursor: pointer;
}

.copy-bibtex-btn.copied {
  background: #10b981;
}

pre {
  border-radius: 6px;
  font-size: 0.85rem;
}

/* ---- Qualitative carousel ---- */
.carousel-wrap {
  max-width: 70%;
  margin: 0 auto;
  user-select: none;
}

.carousel-pills {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 0.9rem;
}

.carousel-pill {
  padding: 0.35rem 1.1rem;
  border-radius: 20px;
  border: 2px solid #d1d5db;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  background: #fff;
  letter-spacing: 0.04em;
  transition: background .15s, border-color .15s, color .15s;
}

.carousel-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.carousel-pill:hover:not(.active) {
  border-color: var(--accent);
  color: var(--accent);
}

.carousel-prompt-row {
  position: relative;
  text-align: center;
  min-height: 2em;
  margin-top: 0.75rem;
  margin-bottom: 0.4rem;
}

.carousel-prompt {
  font-family: 'Kalam', cursive;
  font-weight: 700;
  font-size: 1.1rem;
  color: #1f2937;
  margin: 0;
  line-height: 1.3;
}

.noun-blue    { color: #3b82f6; font-weight: 700; }
.noun-red     { color: #ef4444; font-weight: 700; }
.noun-yellow  { color: #d97706; font-weight: 700; }
.noun-and     { color: #9ca3af; }


.carousel-backend {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.carousel-caption {
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
  margin-top: 0.75rem;
}

.carousel-col-headers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 4px;
}

.carousel-col-header {
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: .06em;
  color: #6b7280;
  padding: 2px 0;
}

.tempo-ex-name .label-word { font-weight: 400; font-size: 0.82em; }

.carousel-col-header.ours {
  color: var(--accent);
}

.carousel-video-wrap {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0,0,0,.12);
  aspect-ratio: 960 / 276;
  background: #000;
}

.carousel-video-wrap video {
  display: block;
  width: 100%;
  height: auto;
  transition: opacity 0.12s ease;
}

.carousel-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: rgba(255,255,255,.45);
  pointer-events: none;
}

.carousel-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}

.carousel-btn {
  background: none;
  border: 2px solid #d1d5db;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  font-size: 1.1rem;
  cursor: pointer;
  color: #374151;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .15s, color .15s;
  flex-shrink: 0;
}

.carousel-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.carousel-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  max-width: 320px;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d1d5db;
  cursor: pointer;
  border: none;
  padding: 0;
  transition: background .2s;
}

.carousel-dot.active {
  background: var(--accent);
}


.carousel-counter {
  font-size: 0.85rem;
  color: #9ca3af;
  text-align: center;
  margin-top: 0.4rem;
}

/* Wrapper that lets col-headers overlay the video on mobile */
.carousel-media-wrap {
  position: relative;
}

/* ---- end carousel ---- */

/* ---- Temporal control timelines ---- */
.tempo-example {
  min-width: 0;
}

.tempo-video-wrap {
  position: relative;
  overflow: hidden;
}

.tempo-video-wrap::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1.5px;
  background: rgba(255, 255, 255, 0.55);
  pointer-events: none;
  z-index: 1;
}

.tempo-video-wrap video {
  display: block;
  width: 100%;
  height: auto;
}

.tempo-video-wrap a {
  display: block;
}

.tempo-video-wrap img.result-video {
  display: block;
  width: 100%;
  border-radius: 0;
  box-shadow: none;
}

.timeline-rows-wrap {
  position: relative;
}

/* Cursor: spans only the track area, not the labels */
.timeline-cursor {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(96px + 0.6rem);
  right: 0;
  pointer-events: none;
  overflow: hidden;
}

/* JS-driven cursor line — position updated via video timeupdate */
.cursor-line {
  position: absolute;
  top: -2px;
  bottom: -2px;
  left: 0%;
  width: 2px;
  background: rgba(55, 65, 81, 0.5);
  pointer-events: none;
}

.timeline-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1px;
}

.timeline-row:last-child {
  margin-bottom: 0;
}

.timeline-label {
  font-size: 0.68rem;
  font-weight: 700;
  width: 96px;
  flex-shrink: 0;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  color: #374151;
  letter-spacing: 0.03em;
}

.timeline-label.ours-label {
  color: var(--accent);
}

.timeline-row.row-tc .timeline-label {
  color: #fb923c;
}

.timeline-track {
  display: flex;
  flex: 1;
  gap: 2px;
}

.timeline-cell {
  flex: 1;
  height: 8px;
  border-radius: 2px;
  background: #dde4ee;
}

/* Per-row present-cell colors */
.timeline-row.row-requested .timeline-cell.present { background: #94a3b8; }
.timeline-row.row-tc        .timeline-cell.present { background: #fb923c; }
.timeline-row.row-ours      .timeline-cell.present { background: #60a5fa; }
/* ---- end temporal timelines ---- */

/* Temporal pill switcher */
.tempo-pill-wrap {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-bottom: 1.25rem;
}
.tempo-pill {
  padding: 5px 16px;
  border-radius: 999px;
  border: 1.5px solid #d1d5db;
  background: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  color: #6b7280;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.tempo-pill.active {
  border-color: var(--accent);
  color: var(--accent);
  background: #eff6ff;
}

/* Example list — 2-column grid */
.tempo-examples-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
}

.tempo-mobile-nav  { display: none; }

/* Per-example header */
.tempo-ex-head {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.tempo-ex-name {
  font-size: 1rem;
  font-weight: 700;
  color: #1f2937;
}
.tempo-ex-tags {
  font-size: 0.78rem;
  color: var(--muted);
}

/* Media wrapper: video + timeline block as one unit */
.tempo-media {
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0,0,0,.12);
}

/* Three-column variant for base model + TC + ours headers */
.carousel-col-headers.three-cols {
  grid-template-columns: 1fr 1fr 1fr;
}

/* v2 is the default; v3 visible only when body.tempo-v3 */
.v3-headers { display: none; }
body.tempo-v3 .v2-headers { display: none; }
body.tempo-v3 .v3-headers { display: grid; }

/* Timeline below video */
.timeline-block {
  background: #f1f5f9;
  padding: 3px 10px 4px;
}

.footer {
  background: transparent;
  border: none;
}

/* Dataset bullet tooltip */
.tooltip-wrap {
  position: relative;
  display: inline-block;
}
.tooltip-box {
  display: none;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(100% + 0.5rem);
  top: auto;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.13);
  padding: 0.5rem 0.85rem;
  font-size: 0.82rem;
  color: #374151;
  white-space: nowrap;
  z-index: 100;
  line-height: 1.7;
  font-style: italic;
  font-weight: 400;
}
.tooltip-wrap:hover .tooltip-box {
  display: block;
}

@media screen and (max-width: 768px) {
  /* ── Typography ── */
  .publication-title {
    font-size: 1.75rem !important;
  }

  .stat-number {
    font-size: 2.4rem;
  }

  /* ── Section bubbles: full-width on mobile ── */
  .section:not(.section-teaser) {
    max-width: calc(100% - 1.5rem);
    padding: 1.5rem 1rem !important;
    margin: 0.75rem auto;
  }

  /* ── TL;DR ── */
  .tldr-box {
    max-width: 100%;
  }

  /* ── Publication link buttons: wrap cleanly ── */
  .publication-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 0.5rem;
  }
  .publication-links .link-block {
    margin: 0;
  }

  /* ── Carousel ── */
  .carousel-wrap {
    max-width: 100%;
  }
  /* Remove the forced widescreen ratio; let the mobile video determine its own height */
  .carousel-video-wrap {
    aspect-ratio: unset;
  }
  /* Col headers: overlay each half of the stacked mobile video — compact badge only */
  .carousel-col-headers {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
  }
  .carousel-col-header {
    position: absolute;
    left: 8px;
    padding: 2px 7px;
    color: rgba(255,255,255,0.95) !important;
    text-shadow: none;
    background: rgba(0,0,0,0.52);
    border-radius: 3px;
    font-size: 0.78rem;
    line-height: 1.5;
  }
  .carousel-col-header:nth-child(1) { top: 6px; }
  .carousel-col-header:nth-child(2) { top: calc(50% + 6px); }
  .carousel-col-header:nth-child(3) { top: calc(66.67% + 6px); }
  .carousel-main-video {
    height: auto !important;
    max-height: 80vh;
  }
  /* Horizontal divider for stacked portrait clips */
  .carousel-divider {
    top: 50%;
    left: 0;
    right: 0;
    bottom: auto;
    width: 100%;
    height: 2px;
  }
  /* Backend label: unpin from absolute so it doesn't overlap the prompt */
  .carousel-backend {
    position: static;
    transform: none;
    display: block;
    text-align: center;
    margin-top: 0.3rem;
  }

  /* ── Key Results summary grid: scale numbers down to fit ── */
  .key-results-grid {
    gap: 0.15rem 0.4rem !important;
  }
  /* column headers: LTX-2, Wan 2.1, CogVideoX */
  .key-results-grid > div:nth-child(2),
  .key-results-grid > div:nth-child(3),
  .key-results-grid > div:nth-child(4) {
    font-size: 0.72rem !important;
    padding-bottom: 0.1rem !important;
  }
  /* row labels */
  .key-results-grid > div:nth-child(5),
  .key-results-grid > div:nth-child(13),
  .key-results-grid > div:nth-child(21) {
    font-size: 0.68rem !important;
    padding-right: 0.3rem !important;
  }
  /* un-steered numbers */
  .key-results-grid > div:nth-child(6),
  .key-results-grid > div:nth-child(7),
  .key-results-grid > div:nth-child(8) {
    font-size: 0.9rem !important;
    line-height: 1.1 !important;
  }
  /* A&E numbers */
  .key-results-grid > div:nth-child(14),
  .key-results-grid > div:nth-child(15),
  .key-results-grid > div:nth-child(16) {
    font-size: 1.1rem !important;
    line-height: 1.1 !important;
  }
  /* AttnSteer numbers */
  .key-results-grid > div:nth-child(22),
  .key-results-grid > div:nth-child(23),
  .key-results-grid > div:nth-child(24) {
    font-size: 1.4rem !important;
    line-height: 1.1 !important;
  }

  /* ── Results tables: smaller text, horizontal scroll via .table-container ── */
  .results-table {
    font-size: 0.65rem;
  }
  .results-table th,
  .results-table td {
    padding: 0.15rem 0.25rem !important;
  }

  /* ── Temporal control: mobile carousel ── */
  .tempo-examples-list {
    display: flex !important;
    flex-direction: row;
    overflow-x: scroll;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 1rem;
    padding-bottom: 0.5rem;
  }
  .tempo-examples-list::-webkit-scrollbar { display: none; }
  .tempo-example {
    width: calc(100vw - 3rem);
    min-width: calc(100vw - 3rem);
    max-width: calc(100vw - 3rem);
    flex-shrink: 0;
    overflow: hidden;
    scroll-snap-align: start;
  }
  .tempo-mobile-nav { display: flex; margin-top: 0.75rem; }
  .tempo-video-wrap { width: 100%; }
  .tempo-video-wrap video { width: 100%; height: auto; }
  /* On mobile the video is stacked (TC top / Ours bottom) — show horizontal divider */
  .tempo-video-wrap::after {
    display: block;
    top: 50%; left: 0; right: 0; bottom: auto;
    width: 100%; height: 2px;
  }

  /* ── Dataset layout: stack columns vertically ── */
  .dataset-layout {
    flex-direction: column !important;
    gap: 1.5rem !important;
    align-items: stretch !important;
  }
  .dataset-layout > div {
    flex: none !important;
  }

  /* ── Tooltip: prevent overflow when shown on mobile ── */
  .tooltip-box {
    white-space: normal;
    max-width: 85vw;
    left: 0;
    transform: none;
  }
}
