/* ===== Base ===== */
html {
  scroll-behavior: smooth;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== Header ===== */
#site-header {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
}

#site-header.scrolled {
  border-bottom-color: #e5e7eb;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* ===== Nav Links ===== */
.nav-link {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #6b7280;
  border-radius: 0.5rem;
  transition: color 0.15s, background-color 0.15s;
  text-decoration: none;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-family: 'Rajdhani', sans-serif;
}

.nav-link:hover {
  color: #111827;
  background-color: #f3f4f6;
}

.nav-link.active {
  color: #7c3aed;
  font-weight: 700;
}

/* ===== Author Names (hero) ===== */
.author-name {
  font-weight: 600;
  color: #374151;
  text-decoration: none;
  position: relative;
  transition: color 0.2s;
}

.author-name::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 0;
  height: 1.5px;
  background: linear-gradient(90deg, #7c3aed, #a855f7);
  transition: width 0.25s ease;
}

.author-name:hover {
  color: #7c3aed;
}

.author-name:hover::after {
  width: 100%;
}

/* Light variant for dark/video backgrounds */
.author-name--light {
  color: rgba(255,255,255,0.8);
}

.author-name--light::after {
  background: linear-gradient(90deg, #fff, rgba(255,255,255,0.6));
}

.author-name--light:hover {
  color: #fff;
}

/* ===== Action Buttons ===== */
.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 1.125rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #374151;
  background: #fff;
  border: 1.5px solid #e5e7eb;
  border-radius: 0.5rem;
  text-decoration: none;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-family: 'Rajdhani', sans-serif;
  transition: color 0.2s, border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
}

.action-btn:hover {
  color: #7c3aed;
  border-color: #c4b5fd;
  background: #faf5ff;
  box-shadow: 0 2px 12px rgba(124, 58, 237, 0.12);
}

.action-btn:active {
  background: #f3eeff;
}

/* Glass variant for video/dark hero backgrounds */
.action-btn--glass {
  color: rgba(255,255,255,0.9);
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.action-btn--glass:hover {
  color: #fff;
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.5);
  box-shadow: 0 2px 16px rgba(0,0,0,0.25);
}

/* ===== Hero Full-Page ===== */
.hero-section {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

/* Background video */
.hero-bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  pointer-events: none;
}

/* Dark overlay: heavy center-clear vignette + gradient */
.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(to bottom, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.5) 50%, rgba(0,0,0,0.7) 100%),
    radial-gradient(ellipse 70% 60% at center, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.55) 100%);
}

/* Bubble layer */
#hero-bubbles {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

/* Ensure content sits above everything */
.hero-content,
.hero-scroll-cue {
  position: relative;
  z-index: 3;
}

/* ---- Centered content ---- */
.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 6rem 1.5rem 4rem;
  max-width: 52rem;
  width: 100%;
}

.hero-eyebrow {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  font-family: 'Rajdhani', sans-serif;
  margin-bottom: 1.25rem;
}

.hero-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: clamp(3.5rem, 10vw, 7rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1;
  color: #fff;
  text-shadow: 0 2px 32px rgba(0,0,0,0.5);
  /* Subtle purple gradient on the text */
  background: linear-gradient(135deg, #fff 40%, #c4b5fd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1.5rem;
}

.hero-subtitle {
  font-size: clamp(1.0625rem, 2vw, 1.3125rem);
  font-weight: 400;
  line-height: 1.7;
  color: rgba(255,255,255,0.65);
  max-width: 38rem;
  margin-bottom: 1.75rem;
}

.hero-authors {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 0.75rem;
  font-size: 0.9375rem;
  color: rgba(255,255,255,0.7);
  margin-bottom: 0.5rem;
}

.hero-author-sep {
  color: rgba(255,255,255,0.3);
  font-weight: 400;
  user-select: none;
}

/* ---- Scroll cue ---- */
.hero-scroll-cue {
  position: absolute;
  bottom: 1.75rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  color: rgba(255,255,255,0.35);
  font-size: 0.875rem;
  text-decoration: none;
  animation: bounce-cue 2s ease-in-out infinite;
  transition: color 0.2s;
}

.hero-scroll-cue:hover {
  color: rgba(255,255,255,0.8);
}

@keyframes bounce-cue {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(6px); }
}

/* ---- Question bubbles ---- */
.hero-bubble {
  position: absolute;
  max-width: 320px;
  padding: 0.5rem 0.875rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: rgba(255,255,255,0.75);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  white-space: normal;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px) scale(0.96);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.hero-bubble.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@media (max-width: 640px) {
  .hero-bubble {
    display: none;
  }
  .hero-title {
    font-size: clamp(2.75rem, 14vw, 4rem);
  }
}

/* ===== Side Nav ===== */
#side-nav {
  position: fixed;
  left: 1.75rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  opacity: 0;
  transition: opacity 0.3s ease;
}

#side-nav.visible {
  opacity: 1;
}

#side-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.side-nav-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  cursor: pointer;
}

.side-nav-dash {
  display: block;
  height: 2px;
  background: #d1d5db;
  border-radius: 2px;
  width: 1.25rem;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              background-color 0.3s ease;
  flex-shrink: 0;
}

.side-nav-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: #9ca3af;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease, color 0.2s ease;
  pointer-events: none;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family: 'Rajdhani', sans-serif;
}

.side-nav-item:hover .side-nav-dash {
  background: #a855f7;
  width: 1.75rem;
}

.side-nav-item:hover .side-nav-label {
  opacity: 1;
  transform: translateX(0);
  color: #374151;
}

.side-nav-item.active .side-nav-dash {
  width: 2.25rem;
  background: linear-gradient(90deg, #7c3aed, #a855f7);
}

.side-nav-item.active .side-nav-label {
  opacity: 1;
  transform: translateX(0);
  color: #7c3aed;
}

@media (max-width: 1280px) {
  #side-nav {
    display: none;
  }
}

/* ===== Section Titles ===== */
.section-title {
  font-size: 2.25rem;
  font-weight: 700;
  color: #111827;
  text-align: center;
  letter-spacing: 0.01em;
  font-family: 'Rajdhani', sans-serif;
  text-transform: uppercase;
  position: relative;
  display: inline-block;
  width: 100%;
}

.section-title::after {
  content: '';
  display: block;
  width: 3rem;
  height: 3px;
  background: linear-gradient(90deg, #7c3aed, #a855f7);
  border-radius: 2px;
  margin: 0.5rem auto 0;
}

/* ===== Feature Cards ===== */
.feature-card {
  padding: 1.75rem;
  border: 1px solid #f3f4f6;
  border-radius: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  background: #fff;
}

.feature-card:hover {
  border-color: #ddd6fe;
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.08);
  transform: translateY(-2px);
}

.feature-icon {
  width: 2.75rem;
  height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
  font-size: 1.125rem;
}

/* ===== Finding Cards ===== */
.finding-card {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}

.finding-number {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3eeff;
  color: #7c3aed;
  font-weight: 700;
  font-size: 0.875rem;
  border-radius: 0.625rem;
  margin-top: 0.125rem;
}

/* ===== Author Cards ===== */
.author-card {
  text-align: center;
}

.author-photo {
  width: 6rem;
  height: 6rem;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto;
  display: block;
  border: 3px solid #ede9fe;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  background-color: #f9fafb;
}

.author-photo:hover {
  border-color: #a855f7;
  transform: scale(1.05);
  box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.15);
}

/* ===== BibTeX ===== */
pre {
  tab-size: 2;
}

pre code {
  font-family: 'JetBrains Mono', monospace;
}

/* ===== QA Slider ===== */
.qa-code {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7c3aed;
  background: #f3eeff;
  padding: 0.25rem 0.625rem;
  border-radius: 0.375rem;
  width: fit-content;
  font-family: 'Rajdhani', sans-serif;
  border: 1px solid #ddd6fe;
}

.qa-option {
  display: flex;
  align-items: baseline;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid #f3f4f6;
  font-size: 0.9rem;
  color: #374151;
  transition: background-color 0.15s, border-color 0.15s;
}

.qa-option.correct {
  background: #f0fdf4;
  border-color: #86efac;
  color: #166534;
}

.qa-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: #f3f4f6;
  color: #6b7280;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
  font-family: 'Rajdhani', sans-serif;
  letter-spacing: 0;
}

.qa-option.correct .qa-letter {
  background: #22c55e;
  color: #fff;
}

.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1.5px solid #ddd6fe;
  border-radius: 50%;
  color: #7c3aed;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.1);
  transition: background-color 0.15s, box-shadow 0.15s, transform 0.15s;
  z-index: 10;
}

.slider-btn:hover {
  background: #f3eeff;
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.2);
}

.slider-btn.left-0 {
  left: 0;
  transform: translateY(-50%) translateX(-50%);
}

.slider-btn.right-0 {
  right: 0;
  transform: translateY(-50%) translateX(50%);
}

.qa-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #ddd6fe;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background-color 0.2s, transform 0.2s;
}

.qa-dot.active {
  background: #7c3aed;
  transform: scale(1.3);
}

/* ===== Leaderboard Table ===== */
.lb-th {
  padding: 0.625rem 0.75rem;
  text-align: center;
  font-weight: 700;
  font-size: 0.75rem;
  color: #374151;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s;
  position: relative;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-family: 'Rajdhani', sans-serif;
}

.lb-th:hover {
  background-color: #f3eeff;
}

.lb-th::after {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 4px;
  vertical-align: middle;
  border-left: 3px solid transparent;
  border-right: 3px solid transparent;
  border-top: 4px solid #ddd6fe;
  transition: transform 0.15s;
}

.lb-th.sort-asc::after {
  border-top-color: #7c3aed;
  transform: rotate(180deg);
}

.lb-th.sort-desc::after {
  border-top-color: #7c3aed;
}

.lb-td {
  padding: 0.5rem 0.75rem;
  text-align: center;
  font-size: 0.8125rem;
  font-family: 'JetBrains Mono', monospace;
  color: #4b5563;
  white-space: nowrap;
}

.lb-td-model {
  padding: 0.5rem 0.75rem;
  text-align: left;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #111827;
  white-space: nowrap;
  min-width: 160px;
  font-family: 'Rajdhani', sans-serif;
  letter-spacing: 0.02em;
}

.lb-td.best {
  background: #fef3c7;
  color: #92400e;
  font-weight: 700;
}

.lb-td.second {
  background: #f9fafb;
  color: #374151;
  font-weight: 600;
}

.lb-row-human {
  background: #f0fdf4;
}

.lb-row-human .lb-td,
.lb-row-human .lb-td-model {
  color: #166534;
  font-weight: 700;
}

.lb-section-header td {
  padding: 0.375rem 0.75rem;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9ca3af;
  background: #fafafa;
  font-family: 'Rajdhani', sans-serif;
}

/* ===== Bar Charts ===== */
.bar-chart-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.375rem;
}

.bar-label {
  font-size: 0.6875rem;
  color: #6b7280;
  min-width: 80px;
  text-align: right;
  flex-shrink: 0;
}

.bar-track {
  flex: 1;
  height: 22px;
  background: #f3f4f6;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
  background: linear-gradient(90deg, #7c3aed, #a855f7);
}

.bar-value {
  font-size: 0.6875rem;
  font-family: 'JetBrains Mono', monospace;
  color: #374151;
  min-width: 36px;
  text-align: left;
  flex-shrink: 0;
}

/* ===== Related Dropdown Open State ===== */
#related-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

#related-arrow.open {
  transform: rotate(180deg);
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .action-btn {
    padding: 0.4375rem 0.75rem;
    font-size: 0.75rem;
  }

  .author-photo {
    width: 4.5rem;
    height: 4.5rem;
  }

  .slider-btn {
    width: 2rem;
    height: 2rem;
    font-size: 0.75rem;
  }

  .slider-btn.left-0 {
    transform: translateY(-50%) translateX(-30%);
  }

  .slider-btn.right-0 {
    transform: translateY(-50%) translateX(30%);
  }
}

/* ===== Print ===== */
@media print {
  #site-header,
  .action-btn,
  #copy-btn {
    display: none;
  }

  section {
    break-inside: avoid;
  }
}
