:root {
  --bg: #f8fafc;
  --bg-soft: #eef2f8;
  --ink: #0b1526;
  --ink-soft: #4a5872;
  --ink-faint: #8892a6;
  --line: #e2e7f0;
  --card: #ffffff;
  --sony-blue: #003366;
  --violet: #003366;
  --violet-2: #0072ce;
  --cyan: #00b4d8;
  --pink: #001f3f;
  --gradient: linear-gradient(120deg, #001f3f 0%, #003366 35%, #0072ce 70%, #00b4d8 100%);
  --gradient-2: linear-gradient(135deg, #001f3f 0%, #003366 50%, #00b4d8 100%);
  --shadow-sm: 0 2px 8px -2px rgb(11 21 38 / 0.06);
  --shadow-md: 0 12px 28px -10px rgb(11 21 38 / 0.14);
  --shadow-lg: 0 30px 60px -20px rgb(11 21 38 / 0.28);
  --radius: 18px;
  --radius-sm: 12px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

section[id] { scroll-margin-top: 5.5rem; }

body {
  font-family: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: rgba(0, 114, 206, 0.2); }

/* ---------- Nav ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(249, 250, 252, 0.72);
  backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid var(--line);
}

.site-nav .navbar-brand .navbar-item {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.site-nav .navbar-brand .navbar-item::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--gradient);
  box-shadow: 0 0 0 3px rgba(0, 114, 206, 0.14);
}

.site-nav .navbar-item {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink-soft);
  transition: color 0.2s ease;
}

.site-nav .navbar-item:hover { color: var(--violet); background: transparent; }

.navbar-burger span { background-color: var(--ink); }

/* ---------- Hero ---------- */
.hero-dark {
  position: relative;
  background: radial-gradient(ellipse 60% 50% at 20% 0%, rgba(0, 51, 102, 0.65), transparent 60%),
    radial-gradient(ellipse 55% 45% at 85% 15%, rgba(0, 180, 216, 0.4), transparent 60%),
    radial-gradient(ellipse 60% 60% at 50% 100%, rgba(27, 78, 155, 0.35), transparent 60%),
    #060a14;
  color: #f2f6fb;
  overflow: hidden;
  padding: 5.5rem 1.5rem 5rem;
}

.hero-dark::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 26px 26px;
  opacity: 0.35;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 880px;
  margin: 0 auto;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.95rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #e9e6ff;
  margin-bottom: 1.6rem;
}

.hero-badge .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px 2px rgba(34, 211, 238, 0.8);
}

.publication-title {
  font-weight: 800 !important;
  font-size: clamp(2.4rem, 5.5vw, 4rem) !important;
  letter-spacing: -0.035em;
  line-height: 1.06 !important;
  margin-bottom: 1.4rem !important;
  background: linear-gradient(115deg, #ffffff 15%, #a9c8f2 45%, #7fe3ff 75%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.aff {
  display: inline-flex;
  color: var(--violet-2);
  font-size: 0.72em;
  margin-right: 0.08em;
}

.hero-dark .aff { color: #7fe3ff; }

.publication-authors {
  font-weight: 500;
  line-height: 1.8;
  color: #cfd0e6;
  font-size: 1.02rem;
}

.publication-authors a {
  color: #ffffff;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
}

.publication-authors a:hover { border-color: var(--cyan); color: var(--cyan); }

.author-block { display: inline-block; margin: 0 0.3rem 0.15rem 0; }

.venue-line {
  margin-top: 1rem;
  color: #9ea1c4;
  font-weight: 600;
  font-size: 0.95rem;
}

.venue-line strong { color: #f5f5fb; }

.lead-note {
  margin-top: 0.35rem;
  font-size: 0.78rem;
  color: #7d80a3;
}

.publication-links {
  margin-top: 2.2rem;
  display: flex;
  justify-content: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.publication-links .button {
  margin: 0;
  font-weight: 700 !important;
  border-radius: 999px !important;
  padding: 1.55em 1.6em !important;
  border: none !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}

.publication-links .button.is-dark {
  background: var(--gradient) !important;
  color: #f5f9ff !important;
  box-shadow: 0 14px 32px -10px rgba(0, 51, 102, 0.6);
}

.publication-links .button.is-dark span,
.publication-links .button.is-dark i { color: #f5f9ff; }

.publication-links .button.is-dark:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 38px -8px rgba(0, 180, 216, 0.55);
}

.publication-links .button.is-outline {
  background: rgba(255, 255, 255, 0.06) !important;
  color: #f0f0fb !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
}

.publication-links .button.is-outline:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.5) !important;
  background: rgba(255, 255, 255, 0.1) !important;
}

/* ---------- Teaser ---------- */
.teaser-wrap {
  background: var(--bg);
  padding: 0 1.5rem 5.5rem;
  margin-top: -2.5rem;
  position: relative;
  z-index: 2;
}

.teaser-frame {
  max-width: 1080px;
  margin: 0 auto;
  background: var(--card);
  border-radius: 22px;
  padding: 0.6rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
}

.teaser-frame img {
  width: 100%;
  height: auto;
  border-radius: 16px;
  display: block;
}

.caption {
  margin-top: 1.1rem;
  color: var(--ink-soft);
  font-size: 0.98rem;
  line-height: 1.65;
  max-width: 760px;
}

.caption.centered { margin-left: auto; margin-right: auto; text-align: center; }

/* ---------- Sections ---------- */
.section-tight { padding: 5rem 1.5rem; }
.section-alt { background: var(--bg-soft); }

.section-kicker {
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--violet);
  margin-bottom: 0.6rem;
  display: inline-block;
}

.section-kicker::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 0.5rem;
  background: var(--gradient);
  vertical-align: middle;
}

.title.is-3 {
  font-weight: 800 !important;
  letter-spacing: -0.025em;
  color: var(--ink) !important;
  font-size: clamp(1.7rem, 3vw, 2.35rem) !important;
}

.title.is-4 {
  font-weight: 800 !important;
  color: var(--ink) !important;
  letter-spacing: -0.01em;
}

.title.is-5 {
  font-weight: 700 !important;
  color: var(--ink) !important;
}

.content.has-text-justified {
  font-size: 1.06rem;
  line-height: 1.8;
  color: var(--ink-soft);
  max-width: 820px;
}

.content.has-text-justified.centered { margin: 0 auto; text-align: center; }

/* ---------- Stat cards ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-top: 2.2rem;
}

.stat {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 1.4rem 1.1rem;
  text-align: center;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.stat::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--gradient);
}

.stat:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.stat .num {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: var(--gradient-2);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stat .label {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--ink-soft);
  line-height: 1.4;
}

.table-note {
  margin-top: 0.7rem;
  font-size: 0.87rem;
  color: var(--ink-faint);
  max-width: 820px;
}

.table-note.centered { margin: 0.9rem auto 0; text-align: center; }

/* ---------- Pipeline chips (method) ---------- */
.pipeline {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin: 1.8rem 0 2.2rem;
}

.pipeline .step {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.pipeline .step .chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gradient);
  flex-shrink: 0;
}

.pipeline .arrow {
  color: var(--ink-faint);
  font-size: 1.1rem;
}

/* ---------- Figures ---------- */
.figure-frame {
  margin-top: 1.5rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem;
  box-shadow: var(--shadow-sm);
}

.figure-frame img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  display: block;
}

/* ---------- OmniCHOIR example carousel ---------- */
.example-carousel {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 2.2rem;
}

.example-track {
  display: flex;
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.example-track::-webkit-scrollbar { display: none; }

.example-track .example-card {
  flex: 0 0 100%;
  min-width: 100%;
  margin-bottom: 0;
}

.carousel-arrow {
  flex: 0 0 auto;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--violet);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.carousel-arrow:hover {
  background: var(--gradient);
  color: #f5f9ff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.carousel-dots {
  position: absolute;
  left: 50%;
  bottom: -1.6rem;
  transform: translateX(-50%);
  display: flex;
  gap: 0.5rem;
}

.carousel-dots button {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: var(--line);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.carousel-dots button.is-active {
  background: var(--violet);
  transform: scale(1.25);
}

/* ---------- OmniCHOIR example cards ---------- */
.example-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.4rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.example-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.example-card h3 {
  font-size: 1.08rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
  color: var(--ink);
}

.prompt-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 0.9rem;
  align-items: start;
  margin-top: 1rem;
}

.prompt-grid video,
.prompt-grid img {
  width: 100%;
  border-radius: var(--radius-sm);
  background: #000;
  border: 1px solid var(--line);
  display: block;
}

.prompt-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.4rem;
}

.candidate-list {
  margin-top: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.candidate {
  display: grid;
  grid-template-columns: 9.5rem 1fr;
  gap: 0.7rem;
  align-items: center;
  background: var(--bg-soft);
  border-radius: 10px;
  padding: 0.4rem 0.6rem;
}

.candidate audio { width: 100%; height: 34px; }

.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.tag-gold { background: #d1fae5; color: #047857; }
.tag-bg { background: #ffedd5; color: #c2410c; }
.tag-same { background: #dbeafe; color: #1d4ed8; }
.tag-diff { background: #e2e8f0; color: #475569; }

/* ---------- Results tables ---------- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  margin-top: 0.8rem;
  box-shadow: var(--shadow-sm);
}

table.results {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  min-width: 760px;
}

table.results th,
table.results td {
  padding: 0.6rem 0.7rem;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}

table.results th:first-child,
table.results td:first-child {
  text-align: left;
  position: sticky;
  left: 0;
  background: var(--card);
  min-width: 15.5rem;
}

table.results thead th {
  background: #071a3d;
  color: #e7f1ff;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 700;
  border-bottom: none;
}

table.results thead th:first-child { background: #071a3d; }

table.results tbody tr:hover td { background: rgba(0, 114, 206, 0.045); }
table.results tbody tr.ours:hover td { background: #dde9f9; }

table.results tr.group td {
  background: var(--bg-soft);
  text-align: left;
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

table.results tr.ours td {
  background: #eaf1fb;
  font-weight: 650;
}

table.results tr.ours td:first-child {
  background: #eaf1fb;
  box-shadow: inset 3px 0 0 0 var(--violet);
}

table.results tr.ours td:first-child::after {
  content: "Ours";
  margin-left: 0.55rem;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: var(--gradient);
  color: #f5f9ff;
  vertical-align: middle;
}

table.results td.best { font-weight: 800; color: var(--violet); }
table.results tr.ours td.best { color: #001f3f; }

/* ---------- BibTeX ---------- */
.bibtex-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.copy-bibtex-btn {
  background: var(--gradient);
  color: #f5f9ff;
  border: none;
  border-radius: 999px;
  padding: 0.6rem 1.1rem;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.copy-bibtex-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

#bibtex-code {
  background: #0a1830;
  color: #dbe7fb;
  border: 1px solid #1b3a63;
  border-radius: var(--radius);
  padding: 1.3rem 1.4rem;
  font-size: 0.87rem;
  overflow-x: auto;
  margin-top: 1rem;
}

#bibtex-code code {
  font-family: "SF Mono", "Roboto Mono", ui-monospace, Menlo, Consolas, monospace;
  color: #d9dcfb;
}

/* ---------- Footer ---------- */
.footer {
  background: var(--bg-soft);
  border-top: 1px solid var(--line);
  padding: 2.4rem 1.5rem;
}

.footer .content { color: var(--ink-faint); font-size: 0.88rem; }
.footer a { color: var(--violet); text-decoration: none; }
.footer a:hover { text-decoration: underline; }

/* ---------- Reveal on scroll ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .prompt-grid { grid-template-columns: 1fr; }
  .candidate { grid-template-columns: 1fr; }
  .content.has-text-justified { text-align: left; }
  .pipeline { justify-content: flex-start; }
  .carousel-arrow { width: 2.2rem; height: 2.2rem; font-size: 0.9rem; }
  .example-carousel { gap: 0.4rem; }
}

@media (max-width: 560px) {
  .hero-dark { padding: 4rem 1.1rem 3.5rem; }
  .publication-title { font-size: 2.1rem !important; }
  .teaser-wrap { padding: 0 1rem 3.5rem; }
  .section-tight { padding: 3.4rem 1.1rem; }
}
