/* --------------------------------------------------------------------------
 * CineOrchestra project site — dark theme with a 2-per-slide carousel.
 * -------------------------------------------------------------------------- */
:root {
  --accent:        #a855f7;
  --accent-rgb:    168 85 247;
  --accent-2:      #c084fc;
  --hot:           #f472b6;

  --bg:            #0b0d12;
  --bg-2:          #11141b;
  --surface:       #161a23;
  --surface-2:     #1d222e;
  --surface-3:     #232938;
  --border:        #2b3142;
  --border-2:      #3a4156;
  --text:          #e8ecf3;
  --text-2:        #c1c7d3;
  --muted:         #8b93a3;
  --accent-soft:   rgb(var(--accent-rgb) / 0.12);
  --accent-glow:   rgb(var(--accent-rgb) / 0.35);
  --link:          #c4b5fd;
  --shadow-sm:     0 1px 2px rgba(0,0,0,0.35);
  --shadow:        0 6px 24px rgba(0,0,0,0.45), 0 2px 6px rgba(0,0,0,0.35);
  --radius:        14px;
  --radius-sm:     8px;
  --font:          -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto,
                   Helvetica, Arial, sans-serif;

  /* Timeline label column width — derived values stay in sync via calc. */
  --tl-label-w:    130px;
  --tl-gap:        10px;

  color-scheme: dark;
}

:root[data-theme="light"] {
  --accent:        #7c3aed;
  --accent-rgb:    124 58 237;
  --accent-2:      #a78bfa;
  --hot:           #db2777;

  --bg:            #faf9f6;
  --bg-2:          #f3f1ec;
  --surface:       #ffffff;
  --surface-2:     #f7f5f0;
  --surface-3:     #ece9e2;
  --border:        #e5e1d8;
  --border-2:      #c9c4b8;
  --text:          #1c1917;
  --text-2:        #3f3a33;
  --muted:         #6b6b6b;
  --link:          #6d28d9;

  --shadow-sm:     0 1px 2px rgba(0,0,0,0.08);
  --shadow:        0 6px 22px rgba(0,0,0,0.10), 0 2px 6px rgba(0,0,0,0.06);

  color-scheme: light;
}
:root[data-theme="light"] .nav {
  background: rgba(255, 255, 255, 0.92);
}
:root[data-theme="light"] a:hover { color: var(--accent-2); }

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background:
    radial-gradient(1000px 520px at 50% 200px, rgb(var(--accent-rgb) / 0.22), transparent 70%),
    radial-gradient(700px 500px at 5% 320px, rgb(244 114 182 / 0.14), transparent 70%),
    radial-gradient(700px 500px at 95% 280px, rgb(147 197 253 / 0.12), transparent 70%),
    radial-gradient(1200px 800px at 20% -10%, rgb(var(--accent-rgb) / 0.04), transparent 60%),
    radial-gradient(1000px 700px at 110% 30%, rgba(147,197,253,0.04), transparent 65%),
    var(--bg);
  background-repeat: no-repeat;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}
:root[data-theme="light"] body {
  background:
    radial-gradient(1000px 520px at 50% 200px, rgb(var(--accent-rgb) / 0.10), transparent 70%),
    radial-gradient(700px 500px at 5% 320px, rgb(244 114 182 / 0.06), transparent 70%),
    radial-gradient(700px 500px at 95% 280px, rgb(147 197 253 / 0.06), transparent 70%),
    var(--bg);
  background-repeat: no-repeat;
}
::selection { background: rgb(var(--accent-rgb) / 0.30); color: #fff; }
a { color: var(--link); text-decoration: none; }
a:hover { color: #bfdbfe; text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* --------------------------------------------------------------------------
 * Header
 * -------------------------------------------------------------------------- */
.page-header {
  max-width: 1100px;
  margin: 0 auto;
  padding: 72px 32px 32px;
  text-align: center;
}
.paper-logo {
  display: flex;
  justify-content: center;
  margin: 0 auto 14px;
  color: var(--accent);
}
.paper-logo svg {
  width: 60px;
  height: auto;
  filter: drop-shadow(0 4px 14px rgb(var(--accent-rgb) / 0.4));
}

.kicker {
  margin: 0 0 10px 0;
  font-size: 11.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.page-header h1 {
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1.18;
  margin: 0 0 16px 0;
  letter-spacing: -0.015em;
  font-weight: 650;
  color: var(--text);
}
.title-brand {
  color: var(--accent);
  font-weight: 750;
  letter-spacing: 0.005em;
}
@supports (-webkit-background-clip: text) or (background-clip: text) {
  .title-brand {
    background: linear-gradient(100deg,
      var(--accent) 0%,
      var(--accent-2) 45%,
      var(--hot) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 1px 0 rgb(var(--accent-rgb) / 0.20);
  }
}

/* Author block */
.authors {
  margin: 8px auto 20px;
  max-width: 1100px;
}
.authors-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 24px;
  font-size: 18px;
  color: var(--text);
  line-height: 1.5;
}
.authors-row + .authors-row { margin-top: 6px; }
.author { white-space: nowrap; }
.author a { color: var(--text); text-decoration: none; }
.author a:hover { color: var(--accent); text-decoration: underline; }
.author.senior { font-weight: inherit; }
.author sup {
  font-size: 0.65em;
  color: inherit;
  margin-left: 1px;
  font-weight: 500;
}
.affiliations {
  text-align: center;
  color: var(--muted);
  font-size: 15px;
  margin: 12px 0 0 0;
}
.affiliations .contrib { font-size: 13px; }

.overview {
  text-align: center;
  color: var(--text);
  font-size: 16px;
  line-height: 1.65;
  width: 96%;
  max-width: 2000px;
  margin: 22px auto 0;
}
.overview strong { color: var(--accent); font-weight: 600; }

/* Paper buttons */
.paper-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 20px 0 10px;
}
.paper-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  background: var(--surface-2);
  border: 1.5px solid var(--border-2);
  border-radius: 999px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: all 160ms;
}
.paper-btn:hover {
  background: rgb(var(--accent-rgb) / 0.10);
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}
.paper-btn-icon { width: 16px; height: 16px; flex: 0 0 auto; }

/* Theme toggle */
.theme-toggle {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 100;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1.5px solid var(--border-2);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: all 180ms;
}
.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: rotate(15deg);
}
.theme-icon { width: 22px; height: 22px; display: none; }
:root .theme-toggle .icon-moon { display: inline-block; }
:root .theme-toggle .icon-sun  { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun  { display: inline-block; }

/* --------------------------------------------------------------------------
 * Section
 * -------------------------------------------------------------------------- */
main {
  max-width: 1800px;
  margin: 0 auto;
  padding: 0 32px 80px;
}
.section {
  margin: 48px 0;
  background:
    radial-gradient(70% 40% at 50% 0%, rgb(var(--accent-rgb) / 0.07), transparent 70%);
  background-repeat: no-repeat;
}
.section:nth-of-type(even) {
  background:
    radial-gradient(70% 40% at 50% 0%, rgb(var(--accent-rgb) / 0.05), transparent 70%),
    radial-gradient(60% 90% at 0% 50%,  rgb(244 114 182 / 0.05),    transparent 60%);
  background-repeat: no-repeat;
}
.section:nth-of-type(odd) {
  background:
    radial-gradient(70% 40% at 50% 0%, rgb(var(--accent-rgb) / 0.07), transparent 70%),
    radial-gradient(60% 90% at 100% 50%, rgb(147 197 253 / 0.05),    transparent 60%);
  background-repeat: no-repeat;
}
:root[data-theme="light"] .section,
:root[data-theme="light"] .section:nth-of-type(even),
:root[data-theme="light"] .section:nth-of-type(odd) {
  background-image:
    radial-gradient(70% 40% at 50% 0%,  rgb(var(--accent-rgb) / 0.04), transparent 70%),
    radial-gradient(60% 90% at 100% 50%, rgb(124 58 237 / 0.03),        transparent 60%);
  background-repeat: no-repeat;
}
.section h2 {
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.005em;
  margin: 0 0 8px 0;
  text-align: center;
  color: var(--text);
}
.section-desc {
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.65;
  text-align: center;
  width: min(90%, 1600px);
  max-width: 1600px;
  margin: 0 auto 26px;
}

/* --------------------------------------------------------------------------
 * Carousel
 * -------------------------------------------------------------------------- */
.carousel {
  margin: 0 auto;
  max-width: 1900px;
}
.carousel-stage {
  position: relative;
  padding: 0 60px;
}
.carousel-top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  padding: 0 2px;
}
.carousel-top > .dots { grid-column: 2; justify-self: center; }
.carousel-top > .play-all { grid-column: 3; justify-self: end; }
.slides-viewport {
  overflow: hidden;
  border-radius: var(--radius);
}
.slides-track {
  display: flex;
  transition: transform 380ms cubic-bezier(0.2, 0.7, 0.2, 1.0);
  will-change: transform;
}
.slide {
  flex: 0 0 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding: 6px;
}
.slide.single { grid-template-columns: 1fr; max-width: 780px; margin: 0 auto; }

/* Nav arrows */
.nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(22, 26, 35, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 2px solid var(--border-2);
  color: var(--text);
  padding: 0;
  line-height: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 160ms, border-color 160ms, transform 160ms, box-shadow 160ms;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}
.nav svg { width: 24px; height: 24px; display: block; }
.nav:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 6px 22px rgb(var(--accent-rgb) / 0.20);
}
.nav:active { transform: translateY(-50%) scale(0.95); }
.nav-prev { left: 0; }
.nav-next { right: 0; }
.nav[disabled] { opacity: 0.30; cursor: not-allowed; }

/* Dots */
.dots {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}
.dots button {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 0;
  background: var(--border-2);
  cursor: pointer;
  padding: 0;
  transition: background 160ms, transform 160ms;
}
.dots button:hover { background: var(--text-2); transform: scale(1.2); }
.dots button.is-current {
  background: var(--accent);
  width: 22px;
  border-radius: 5px;
}

/* Play-all button */
.play-all {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: all 160ms;
}
.play-all .icon { width: 12px; height: 12px; display: none; flex: 0 0 auto; }
.play-all.is-paused {
  background: rgb(var(--accent-rgb) / 0.10);
  border: 1.5px solid var(--accent);
  color: var(--accent);
}
.play-all.is-paused:hover { background: rgb(var(--accent-rgb) / 0.18); }
.play-all.is-paused .icon-play { display: inline-block; }
.play-all.is-playing {
  background: rgba(248, 113, 113, 0.10);
  border: 1.5px solid #f87171;
  color: #f87171;
}
.play-all.is-playing:hover { background: rgba(248, 113, 113, 0.18); }
.play-all.is-playing .icon-pause { display: inline-block; }

@keyframes playall-shimmer {
  from { transform: translateX(0%); }
  to   { transform: translateX(300%); }
}
@keyframes playall-glow {
  0%, 100% { box-shadow: 0 0 0   0   rgb(var(--accent-rgb) / 0); }
  40%      { box-shadow: 0 0 14px 5px rgb(var(--accent-rgb) / 0.60),
                         0 0  6px 1px rgb(var(--accent-rgb) / 0.35); }
}
.play-all.is-hinting {
  transition: none;
  animation: playall-glow 1.1s ease-in-out 2;
}
.play-all.is-hinting::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  left: -100%;
  width: 60%;
  background: linear-gradient(90deg,
    transparent 0%, rgba(255,255,255,0.22) 35%,
    rgba(255,255,255,0.65) 50%, rgba(255,255,255,0.22) 65%, transparent 100%);
  pointer-events: none;
  animation: playall-shimmer 0.55s ease-in-out 2;
  animation-delay: 0.08s;
  animation-fill-mode: backwards;
}

/* --------------------------------------------------------------------------
 * More Results
 * -------------------------------------------------------------------------- */
.more-results-bar {
  display: flex;
  justify-content: center;
  margin: 28px 0 0;
}
.more-results-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 9px 22px;
  border-radius: 999px;
  cursor: pointer;
  letter-spacing: 0.03em;
  background: var(--surface-2);
  border: 1.5px solid var(--border-2);
  color: var(--text-2);
  /* Exclude transform so the scale keyframes aren't interrupted by hover */
  transition: background 180ms, border-color 180ms, color 180ms, box-shadow 180ms;
}
.more-results-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.more-results-btn[aria-expanded="true"] .more-results-chevron {
  transform: rotate(180deg);
}
.more-results-chevron {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  transition: transform 240ms ease;
}

/* One-time hint animation for "More results / More comparisons" buttons */
@keyframes mr-btn-hint {
  0%   { box-shadow: 0 0 0   0   rgb(var(--accent-rgb) / 0); transform: scale(1); }
  25%  { box-shadow: 0 0 0   5px rgb(var(--accent-rgb) / 0.45); transform: scale(1.04); }
  55%  { box-shadow: 0 0 14px 8px rgb(var(--accent-rgb) / 0.20); transform: scale(1); }
  80%  { box-shadow: 0 0 0   3px rgb(var(--accent-rgb) / 0.28); transform: scale(1.02); }
  100% { box-shadow: 0 0 0   0   rgb(var(--accent-rgb) / 0); transform: scale(1); }
}
.more-results-btn.is-hinting {
  animation: mr-btn-hint 1.0s ease-in-out 2;
  transition: none;
  border-color: var(--accent);
  color: var(--accent);
}

.more-results-section {
  margin-top: 28px;
  animation: mr-expand 260ms ease;
}
@keyframes mr-expand {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.more-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
  padding: 4px 2px;
}

/* Compact "more results" video card — no timeline, no refs */
.mr-card {
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}
.mr-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--border-2);
}
.mr-card-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  background: var(--bg-2);
  object-fit: cover;
  cursor: pointer;
}
.mr-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 8px 12px;
}
.mr-card-desc {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mr-card-play {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--border-2);
  background: var(--surface-2);
  color: var(--text-2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all 160ms;
}
.mr-card-play:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
.mr-card-play svg { width: 10px; height: 10px; display: none; }
.mr-card-play.is-paused .icon-play { display: inline-block; }
.mr-card-play.is-playing .icon-pause { display: inline-block; }
.mr-card-play.is-playing {
  border-color: #f87171; color: #f87171;
  background: rgba(248,113,113,0.08);
}
.mr-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}
.mr-card-tl-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  background: var(--surface-2);
  border: 1.5px solid var(--border-2);
  color: var(--text-2);
  letter-spacing: 0.03em;
  white-space: nowrap;
  transition: all 160ms;
}
.mr-card-tl-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.mr-tl-icon {
  font-style: normal;
  font-size: 0.75em;
}

/* --------------------------------------------------------------------------
 * More-results detail modal
 * -------------------------------------------------------------------------- */
.mr-modal {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}
.mr-modal[hidden] { display: none; }

.mr-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.52);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.mr-modal-box {
  position: relative;
  background: linear-gradient(175deg, var(--surface) 0%, var(--bg-2) 100%);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  box-shadow: 0 32px 100px rgba(0,0,0,0.65),
              0 0 0 1px rgb(var(--accent-rgb) / 0.08);
  width: min(96vw, 960px);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  padding: 28px 28px 24px;
  animation: mr-modal-in 260ms cubic-bezier(0.2, 0.8, 0.2, 1.0);
  outline: none;
}
/* Wide variant for comparison tiles (6 videos + refs + timeline) */
.mr-modal--cmp .mr-modal-box {
  width: min(98vw, 1480px);
}
/* Ref columns use the same 190 px width as the carousel so images fill the
   full 2-row video height exactly as they do inline.  No align-self/row
   overrides — the base .cmp-ref-grid rules (align-self:stretch,
   grid-template-rows:1fr 1fr) already do the right thing. */
/* Keep 3×2 video grid and override the 1100 px breakpoint that would
   otherwise stack refs above videos. */
.mr-modal--cmp .cmp-video-grid {
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, auto);
}
@media (max-width: 1100px) {
  .mr-modal--cmp .cmp-media-row { grid-template-columns: auto 1fr; }
  .mr-modal--cmp .cmp-video-grid {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, auto);
  }
}
@keyframes mr-modal-in {
  from { opacity: 0; transform: scale(0.93) translateY(16px); }
  to   { opacity: 1; transform: scale(1)    translateY(0); }
}
@media (max-width: 600px) {
  .mr-modal { padding: 12px; }
  .mr-modal-box { padding: 20px 16px 16px; max-height: calc(100dvh - 24px); }
  /* On mobile, release the wide-modal 3-col lock and let the grid collapse normally */
  .mr-modal--cmp .cmp-media-row { grid-template-columns: 1fr; }
  .mr-modal--cmp .cmp-video-grid { grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(3, auto); }
}

.mr-modal-close {
  position: sticky;
  top: 0;
  float: right;
  margin: -4px -4px 8px 12px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--border-2);
  background: var(--surface-2);
  color: var(--text-2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  z-index: 10;
  transition: all 160ms;
}
.mr-modal-close:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
.mr-modal-close svg { width: 14px; height: 14px; }

.mr-modal-hint {
  font-size: 11.5px;
  color: var(--muted);
  margin: 0 0 16px 0;
  text-align: center;
  letter-spacing: 0.01em;
}
.mr-modal-hint kbd {
  display: inline-block;
  font: inherit;
  font-size: 10.5px;
  padding: 1px 5px;
  border: 1px solid var(--border-2);
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text-2);
}

/* Entry / comparison tiles inside the modal: strip the outer card wrapper visuals */
.mr-modal-content .entry-tile,
.mr-modal-content .cmp-tile {
  box-shadow: none;
  border: none;
  background: transparent;
  padding: 0;
}
.mr-modal-content .entry-tile::before { display: none; }

/* --------------------------------------------------------------------------
 * Entry tile
 * -------------------------------------------------------------------------- */
.entry-tile {
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  overflow: hidden;
}
.entry-tile::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: var(--radius);
  padding: 1px;
  background: linear-gradient(135deg, rgb(var(--accent-rgb) / 0.18), transparent 30%, transparent 70%, rgba(147,197,253,0.12));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0;
  transition: opacity 220ms;
}
.entry-tile:hover::before { opacity: 1; }

.entry-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.entry-desc {
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.entry-controls { display: flex; gap: 6px; align-items: center; flex: 0 0 auto; }
.entry-controls button {
  font: inherit;
  font-size: 12px;
  padding: 4px 10px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: 7px;
  color: var(--text-2);
  cursor: pointer;
  transition: all 160ms;
  white-space: nowrap;
}
.entry-controls button:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.entry-controls .play-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.entry-controls .play-toggle .icon {
  width: 12px; height: 12px; display: none; flex: 0 0 auto;
}
.entry-controls .play-toggle.is-paused {
  border-color: var(--accent); color: var(--accent);
  background: rgb(var(--accent-rgb) / 0.08);
}
.entry-controls .play-toggle.is-paused .icon-play { display: inline-block; }
.entry-controls .play-toggle.is-playing {
  border-color: #f87171; color: #f87171;
  background: rgba(248, 113, 113, 0.08);
}
.entry-controls .play-toggle.is-playing .icon-pause { display: inline-block; }

/* Timeline toggle button */
.timeline-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.timeline-toggle .tl-arrow {
  display: inline-block;
  font-style: normal;
  font-size: 0.8em;
  transition: transform 200ms ease;
}
.timeline-toggle.is-open .tl-arrow { transform: rotate(90deg); }

/* Media row */
.media-row {
  display: flex;
  gap: 14px;
  align-items: stretch;
}
.tile-video {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  background: var(--bg-2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  object-fit: cover;
}

.ref-column {
  display: grid;
  gap: 10px;
  flex: 0 0 auto;
  align-self: stretch;
  grid-template-rows: 1fr 1fr;
}
.ref-column.cols-1 { grid-template-columns: 1fr; flex-basis: 22%; }
.ref-column.cols-2 { grid-template-columns: 1fr 1fr; flex-basis: 36%; }
.ref-cell {
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: stretch;
  --ent-color: var(--border-2);
}
.ref-cell.is-empty {
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.015);
  opacity: 0.30;
}
.ref-image-wrap {
  flex: 1 1 auto;
  min-height: 0;
  aspect-ratio: 1 / 1;
  max-width: 100%;
  max-height: 100%;
  align-self: center;
  border-radius: 7px;
  border: 2px solid var(--ent-color);
  background: var(--bg-2);
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4) inset;
  transition: transform 220ms cubic-bezier(0.2, 0.7, 0.2, 1.0),
              box-shadow 220ms ease-out, border-color 220ms ease-out;
  will-change: transform;
}
.ref-image-wrap:hover {
  transform: translateY(-4px);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4) inset,
              0 10px 22px rgba(0, 0, 0, 0.55),
              0 0 0 2px var(--ent-color);
}
.ref-image {
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
}
.ref-name {
  flex: 0 0 auto;
  font-size: 10.5px;
  line-height: 1.15;
  font-weight: 600;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--ent-color);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 2px;
}

/* --------------------------------------------------------------------------
 * Timeline — collapsible. Hidden by default, visible when .is-open.
 * -------------------------------------------------------------------------- */
.timeline-wrap {
  margin: 4px 0 0;
  padding: 12px 0 0;
  border-top: 1px solid var(--border);
  position: relative;
  /* Hidden by default */
  display: none;
}
.timeline-wrap.is-open { display: block; }

.timeline {
  position: relative;
  padding-bottom: 4px;
}
.timeline-row {
  display: grid;
  grid-template-columns: var(--tl-label-w) 1fr;
  gap: var(--tl-gap);
  padding: 4px 0 40px 0;
  align-items: start;
  border-bottom: 1px dashed var(--border);
}
.timeline-row > .row-label { align-self: center; padding-top: 6px; }
.timeline-row > .timeline-track { align-self: start; }
.timeline-row:last-child { border-bottom: none; }
.row-label {
  font-size: 11.5px;
  font-weight: 500;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  word-break: break-word;
  line-height: 1.2;
}
.timeline-track {
  position: relative;
  height: 28px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  cursor: pointer;
  overflow: visible;
}
.timeline-track:hover { border-color: var(--border-2); }
.timeline-bar {
  position: absolute;
  top: 4px;
  height: 14px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.10);
  font-size: 0;
  cursor: pointer;
  transition: filter 200ms, box-shadow 200ms;
}
.timeline-bar:hover {
  filter: brightness(1.30) saturate(1.10);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.18);
  z-index: 3;
}
.timeline-bar.is-active {
  filter: brightness(1.40) saturate(1.18);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.30);
  z-index: 4;
}
.timeline-bar.is-current {
  outline: 1.5px solid rgba(244,114,182,0.65);
  outline-offset: -1px;
  filter: brightness(1.20) saturate(1.10);
}
.timeline-caption {
  position: absolute;
  top: 20px;
  font-size: 10px;
  color: var(--text);
  line-height: 1.25;
  padding: 2px 6px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 4px;
  white-space: normal;
  max-width: min(240px, calc(100vw - 80px));
  pointer-events: auto;
  cursor: pointer;
  z-index: 7;
  box-shadow: 0 4px 10px rgba(0,0,0,0.35);
  display: none;
}
.timeline-caption.anchor-right { text-align: right; }
.timeline-caption.is-active { display: block; }

/* Single shared playhead spanning every track */
.timeline-playhead-overlay {
  position: absolute;
  left: calc(var(--tl-label-w) + var(--tl-gap));
  right: 0;
  top: 12px;
  bottom: 22px;
  pointer-events: none;
  z-index: 6;
}
.timeline-playhead {
  position: absolute;
  top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, rgba(244,114,182,0.0) 0%, var(--hot) 8%, var(--hot) 92%, rgba(244,114,182,0.0) 100%);
  box-shadow: 0 0 6px rgba(244,114,182,0.55);
  transform: translateX(-1px);
  will-change: left;
}

.timeline-axis {
  position: relative;
  height: 14px;
  margin-left: calc(var(--tl-label-w) + var(--tl-gap));
  margin-top: 2px;
  border-top: 1px solid var(--border);
}
.tick {
  position: absolute;
  top: 0;
  width: 1px;
  height: 5px;
  background: var(--border-2);
}
.tick-label {
  position: absolute;
  top: 6px;
  font-size: 9.5px;
  color: var(--muted);
  transform: translateX(-50%);
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
 * Comparison sections
 * -------------------------------------------------------------------------- */
.comparison-section { margin-top: 64px; }
.cmp-carousel { max-width: 1900px; }
.cmp-carousel .slide.single { max-width: none; }
.cmp-tile {
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.cmp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.cmp-label {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.10em;
  text-transform: uppercase;
}
.cmp-media-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: stretch;
}
.cmp-ref-grid {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 10px;
  align-self: stretch;
}
.cmp-ref-grid.cols-1 { grid-template-columns: 190px; }
.cmp-ref-grid.cols-2 { grid-template-columns: 190px 190px; }
.cmp-video-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: 1fr 1fr;
  gap: 10px;
}
.cmp-video-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px 8px;
}
.cmp-video-cell.is-ours {
  border-color: var(--accent);
  background: linear-gradient(180deg, rgb(var(--accent-rgb) / 0.10), var(--surface-2));
  box-shadow: 0 0 0 1px var(--accent) inset, 0 6px 14px rgb(var(--accent-rgb) / 0.12);
}
.cmp-variant-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-2);
  text-align: center;
}
.cmp-video-cell.is-ours .cmp-variant-label { color: var(--accent); }
.cmp-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  background: var(--bg-2);
  border-radius: 6px;
  object-fit: cover;
}

/* --------------------------------------------------------------------------
 * Cinematic flair
 * -------------------------------------------------------------------------- */
.h-flair {
  display: inline-block;
  margin-right: 10px;
  filter: drop-shadow(0 0 6px rgb(var(--accent-rgb) / 0.35));
  transform: translateY(-1px);
  font-size: 0.92em;
}
.kicker-icon {
  margin-right: 6px;
  filter: drop-shadow(0 0 4px rgb(var(--accent-rgb) / 0.45));
}

.page-header h1 { position: relative; }
.page-header h1::after {
  content: "";
  display: block;
  margin: 16px auto 0;
  width: 120px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent) 30%, var(--hot) 70%, transparent);
  border-radius: 2px;
  opacity: 0.75;
}

/* Abstract */
.abstract-section { margin-top: 64px; }
.abstract-body {
  width: min(80%, 820px);
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 22px 28px;
  font-size: 14.5px;
  line-height: 1.72;
  color: var(--text-2);
  box-shadow: var(--shadow-sm);
}
.abstract-body strong { color: var(--text); font-weight: 700; }
.abstract-body em { color: var(--accent); font-style: italic; }

/* Architecture / User Study */
.arch-section { margin-top: 64px; }
.arch-figure {
  width: min(95%, 1600px);
  margin: 10px auto 0;
  padding: 18px;
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.arch-figure--narrow { width: min(88%, 960px); }
.arch-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}

/* Magic-wand playhead */
.timeline-playhead::before {
  content: "";
  position: absolute;
  left: 1px;
  top: -34px;
  width: 44px;
  height: 44px;
  margin-left: -10px;
  background: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 44 44'>\
  <line x1='5' y1='39' x2='29' y2='15' stroke='%231f1410' stroke-width='3.4' stroke-linecap='round'/>\
  <line x1='5' y1='39' x2='29' y2='15' stroke='%23a8a29e' stroke-width='1.1' stroke-linecap='round' stroke-dasharray='2.4 3.2'/>\
  <path d='M29 9 L30.2 12.3 L33.6 13 L31.1 15.4 L31.7 18.9 L29 17.1 L26.3 18.9 L26.9 15.4 L24.4 13 L27.8 12.3 Z' fill='%23facc15' stroke='%23d97706' stroke-width='0.5'/>\
  <circle cx='28.2' cy='12.2' r='0.9' fill='%23ffffff' opacity='0.85'/>\
</svg>") center/contain no-repeat;
  transform: rotate(-6deg);
  transform-origin: bottom left;
  filter: drop-shadow(0 1px 4px rgba(252, 211, 77, 0.45));
  border-radius: 0;
  background-color: transparent;
  box-shadow: none;
}
.timeline-playhead {
  background: linear-gradient(180deg,
    rgba(252, 211, 77, 0.0) 0%,
    var(--hot) 12%,
    var(--hot) 88%,
    rgba(244, 114, 182, 0.0) 100%);
}
.timeline-playhead::after {
  content: "";
  position: absolute;
  left: 1px;
  margin-left: -2.5px;
  bottom: -3px;
  width: 5px;
  height: 5px;
  background: var(--hot);
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(244, 114, 182, 0.7);
}

/* --------------------------------------------------------------------------
 * Footer
 * -------------------------------------------------------------------------- */
.page-footer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px 40px;
  color: var(--muted);
  font-size: 12.5px;
  border-top: 1px solid var(--border);
  text-align: center;
}

/* --------------------------------------------------------------------------
 * Responsive
 * -------------------------------------------------------------------------- */
@media (max-width: 1100px) {
  .cmp-media-row { grid-template-columns: 1fr; }
  .cmp-video-grid { grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  /* Global timeline label width override for mobile */
  :root { --tl-label-w: 88px; }

  main { padding: 0 16px 60px; }
  .slide { grid-template-columns: 1fr; gap: 16px; }
  .carousel-stage { padding: 0 44px; }
  .nav { width: 38px; height: 38px; }
  .nav svg { width: 18px; height: 18px; }
  .nav-prev { left: 2px; }
  .nav-next { right: 2px; }
  .ref-column.cols-1 { flex-basis: 26%; }
  .ref-column.cols-2 { flex-basis: 42%; }
  .timeline-row { padding-bottom: 32px; }
  .cmp-ref-grid.cols-1 { grid-template-columns: minmax(0, 160px); }
  .cmp-ref-grid.cols-2 { grid-template-columns: minmax(0, 140px) minmax(0, 140px); }
  .more-results-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
}

@media (max-width: 600px) {
  :root { --tl-label-w: 68px; }

  .page-header { padding: 56px 16px 24px; }
  main { padding: 0 12px 48px; }
  .section { margin: 32px 0; }
  .carousel-stage { padding: 0 36px; }
  .nav { width: 32px; height: 32px; }
  .nav svg { width: 15px; height: 15px; }
  .entry-tile { padding: 14px; gap: 10px; }
  .cmp-tile { padding: 14px 16px; }
  .media-row { gap: 10px; }
  .ref-column.cols-1 { flex-basis: 24%; }
  .ref-column.cols-2 { flex-basis: 40%; }
  .ref-column { gap: 8px; }
  /* On very narrow screens, stack the ref column below the video */
  .tile-video { min-height: 0; }
  .timeline-row { padding-bottom: 22px; }
  .more-results-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .abstract-body { padding: 16px 18px; font-size: 14px; }
  .authors-row { font-size: 15px; gap: 4px 16px; }
}

@media (max-width: 440px) {
  :root { --tl-label-w: 58px; }

  .carousel-stage { padding: 0 28px; }
  .nav { width: 28px; height: 28px; }
  .nav svg { width: 13px; height: 13px; }
  .media-row { flex-direction: column; }
  .ref-column { flex-basis: auto !important; width: 100%; grid-template-rows: none; grid-auto-flow: column; grid-auto-columns: 1fr; }
  .ref-column.cols-2 { grid-template-columns: repeat(4, 1fr); }
  .ref-column.cols-1 { grid-template-columns: repeat(2, 1fr); }
  .more-results-grid { grid-template-columns: 1fr; }
  .entry-head { flex-wrap: wrap; }
  .entry-desc { width: 100%; }
}
