/* ============================================================
   UniIntervene — project page styles
   ============================================================ */

:root {
  --violet-50:  #f5f2fe;
  --violet-100: #ece5fd;
  --violet-200: #d8cbfb;
  --violet-300: #bda6f6;
  --violet-400: #9b7ef0;
  --violet-500: #7c5cdc;
  --violet-600: #6a45cf;
  --violet-700: #5733b0;
  --violet-800: #432888;
  --magenta:    #e1208a;
  --magenta-soft:#fbe6f2;

  --ink:      #1b1830;
  --ink-soft: #4a4762;
  --ink-mute: #807c98;

  --bg:       #ffffff;
  --bg-soft:  #faf8ff;
  --line:     #ece9f5;

  --radius:   18px;
  --radius-sm:12px;
  --shadow-sm: 0 2px 10px rgba(67, 40, 136, .06);
  --shadow:    0 14px 40px rgba(67, 40, 136, .10);
  --shadow-lg: 0 28px 70px rgba(67, 40, 136, .16);

  --font-head: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, video { max-width: 100%; display: block; }
a { color: var(--violet-600); text-decoration: none; }
a:hover { color: var(--violet-700); }

.container { width: min(1140px, 92vw); margin-inline: auto; }
.narrow { width: min(820px, 92vw); }

/* ---------------- NAV ---------------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: saturate(180%) blur(14px);
  background: rgba(255,255,255,.78);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  width: min(1140px, 92vw); margin-inline: auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 62px;
}
.nav-brand {
  font-family: var(--font-head); font-weight: 700; font-size: 1.2rem;
  color: var(--ink); letter-spacing: -.02em;
}
.nav-brand .brand-mark { color: var(--violet-600); }
.nav-links { display: flex; gap: 4px; }
.nav-links a {
  color: var(--ink-soft); font-weight: 500; font-size: .92rem;
  padding: 8px 13px; border-radius: 9px; transition: .18s;
}
.nav-links a:hover { color: var(--violet-700); background: var(--violet-50); }
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { width: 24px; height: 2px; background: var(--ink); border-radius: 2px; transition: .25s; }

/* ---------------- HERO ---------------- */
.hero {
  position: relative; overflow: hidden;
  padding: 66px 0 8px;
  background:
    radial-gradient(1100px 460px at 50% -120px, var(--violet-100), transparent 70%),
    linear-gradient(180deg, var(--bg-soft), var(--bg));
}
.hero-glow {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(420px 300px at 12% 8%, rgba(124,92,220,.18), transparent 60%),
    radial-gradient(420px 300px at 88% 0%, rgba(225,32,138,.12), transparent 60%);
}
.hero-grid {
  position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(900px 380px at 50% 60px, #000 10%, transparent 75%);
  -webkit-mask-image: radial-gradient(900px 380px at 50% 60px, #000 10%, transparent 75%);
}
.hero-content { position: relative; text-align: center; }

.badge {
  display: inline-block; font-size: .82rem; font-weight: 600;
  color: var(--violet-700); background: #fff;
  border: 1px solid var(--violet-200);
  padding: 7px 16px; border-radius: 999px; box-shadow: var(--shadow-sm);
}
.hero-title {
  font-family: var(--font-head); font-weight: 700;
  font-size: clamp(2.2rem, 10vw, 5.6rem); line-height: 1;
  margin: 22px 0 4px; letter-spacing: -.03em;
  overflow-wrap: break-word;
}
.grad {
  background: linear-gradient(100deg, var(--violet-600) 10%, var(--magenta) 92%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-subtitle {
  font-family: var(--font-head); font-weight: 600;
  font-size: clamp(1.15rem, 2.6vw, 1.6rem); color: var(--ink);
  margin: 6px auto 0; max-width: 780px; letter-spacing: -.01em;
}
.hero-tagline {
  font-size: 1.05rem; color: var(--ink-soft);
  max-width: 700px; margin: 18px auto 0;
}
.hero-tagline strong { color: var(--violet-700); font-weight: 600; }

.hero-logo {
  width: min(440px, 78vw); margin: 26px auto 0;
  filter: drop-shadow(0 18px 32px rgba(67,40,136,.18));
}

.authors { margin-top: 26px; font-size: 1.05rem; font-weight: 500; }
.author { color: var(--ink); }
.affil { color: var(--ink-mute); font-size: .92rem; margin-top: 4px; }

.hero-buttons { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 30px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 22px; border-radius: 999px;
  font-weight: 600; font-size: .96rem; letter-spacing: .01em;
  transition: transform .15s, box-shadow .2s, background .2s;
  border: 1px solid transparent;
}
.btn .ic { width: 18px; height: 18px; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--violet-600); color: #fff; box-shadow: 0 10px 24px rgba(106,69,207,.32); }
.btn-primary:hover { background: var(--violet-700); color: #fff; }
.btn-dark { background: var(--ink); color: #fff; box-shadow: 0 10px 24px rgba(27,24,48,.22); }
.btn-dark:hover { background: #000; color: #fff; }
.btn-accent { background: var(--magenta); color: #fff; box-shadow: 0 10px 24px rgba(225,32,138,.3); }
.btn-accent:hover { color: #fff; filter: brightness(1.05); }
.btn[aria-disabled="true"] { opacity: .82; }

/* teaser */
.teaser-figure {
  margin: 48px auto 0; max-width: 1000px;
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px;
  box-shadow: var(--shadow-lg);
}
.teaser-figure img { border-radius: 10px; }
.teaser-figure figcaption,
.figure-card figcaption,
.video-card figcaption {
  font-size: .9rem; color: var(--ink-soft); padding: 14px 10px 4px;
  text-align: center; line-height: 1.6;
}

/* ---------------- STATS ---------------- */
.stats-band {
  background: linear-gradient(180deg, var(--bg), var(--violet-50));
  padding: 46px 0;
  border-top: 1px solid var(--line);
}
.stats-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px; }
.stat {
  text-align: center; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 22px 12px; box-shadow: var(--shadow-sm);
}
.stat-num {
  font-family: var(--font-head); font-weight: 700;
  font-size: clamp(1.7rem, 3.4vw, 2.5rem);
  background: linear-gradient(120deg, var(--violet-600), var(--magenta));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  line-height: 1;
}
.stat-num span { font-size: .6em; }
.stat-label { font-size: .82rem; color: var(--ink-soft); margin-top: 8px; line-height: 1.4; }

/* ---------------- SECTIONS ---------------- */
.section { padding: 74px 0; }
.section-alt { background: var(--bg-soft); border-block: 1px solid var(--line); }
.section-title {
  font-family: var(--font-head); font-weight: 700;
  font-size: clamp(1.6rem, 3.4vw, 2.2rem); letter-spacing: -.02em;
  margin: 0 0 6px; display: flex; align-items: baseline; gap: 14px;
}
.kicker {
  font-size: .8rem; font-weight: 700; color: var(--violet-500);
  background: var(--violet-100); border-radius: 8px;
  padding: 3px 9px; letter-spacing: .04em;
}
.section-sub { color: var(--ink-soft); font-size: 1.05rem; max-width: 760px; margin: 6px 0 32px; }
.section-sub.small { font-size: .98rem; margin-bottom: 18px; }
.lead { font-size: 1.12rem; color: var(--ink); }
.section p { color: var(--ink-soft); }
.section .lead, .section p strong { color: var(--ink); }
.narrow p { font-size: 1.04rem; }
.subsection-title {
  font-family: var(--font-head); font-weight: 600; font-size: 1.35rem;
  margin: 56px 0 4px; letter-spacing: -.01em;
}

/* ---------------- FIGURES ---------------- */
.figure-card {
  margin: 0; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow);
}
.figure-card img { border-radius: 10px; width: 100%; }
.figure-card.slim { max-width: 640px; margin-inline: auto; }

/* ---------------- VIDEO EMBED ---------------- */
.video-embed {
  position: relative; padding-bottom: 56.25%; height: 0;
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg);
  border: 1px solid var(--line); background: #000;
}
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ---------------- METHOD COMPONENTS ---------------- */
.component-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 30px;
}
.comp-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 24px; box-shadow: var(--shadow-sm); transition: .2s;
  position: relative; overflow: hidden;
}
.comp-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 4px;
  background: linear-gradient(90deg, var(--violet-500), var(--magenta));
}
.comp-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.comp-num {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center; font-family: var(--font-head);
  font-weight: 700; font-size: 1.2rem; color: #fff;
  background: linear-gradient(135deg, var(--violet-500), var(--violet-700));
  margin-bottom: 16px;
}
.comp-card h3 { font-family: var(--font-head); font-size: 1.18rem; margin: 0 0 8px; letter-spacing: -.01em; }
.comp-card p { font-size: .96rem; margin: 0; }

/* ---------------- TASKS ---------------- */
.task-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-top: 28px; }
.task-chip {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 18px 16px; box-shadow: var(--shadow-sm); transition: .2s;
}
.task-chip:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.task-chip h4 { font-family: var(--font-head); margin: 10px 0 6px; font-size: 1.02rem; }
.task-chip p { font-size: .86rem; margin: 0; color: var(--ink-soft); }
.tag {
  display: inline-block; font-size: .68rem; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; padding: 3px 9px; border-radius: 999px;
}
.tag-multi    { color: #0d7a6b; background: #d7f5ee; }
.tag-contact  { color: var(--violet-700); background: var(--violet-100); }
.tag-nonrigid { color: var(--magenta); background: var(--magenta-soft); }

/* ---------------- DEMO + VIDEO CARDS ---------------- */
.demo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.video-card {
  margin: 0; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 10px; box-shadow: var(--shadow-sm); transition: .2s;
}
.video-card:hover { box-shadow: var(--shadow); }
.video-card video { border-radius: 10px; width: 100%; background: #0b0b14; aspect-ratio: 16/9; object-fit: cover; }
.video-card figcaption { font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 8px; justify-content: center; }

/* ---------------- COMPARISON ---------------- */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.tab {
  font-family: var(--font-body); font-weight: 600; font-size: .92rem;
  padding: 9px 18px; border-radius: 999px; cursor: pointer;
  background: #fff; color: var(--ink-soft); border: 1px solid var(--line);
  transition: .18s;
}
.tab:hover { color: var(--violet-700); border-color: var(--violet-200); }
.tab.active { background: var(--violet-600); color: #fff; border-color: var(--violet-600); box-shadow: 0 8px 20px rgba(106,69,207,.28); }

.compare-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.compare-col {
  margin: 0; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow-sm);
}
.compare-col.ours { border-color: var(--violet-300); box-shadow: 0 14px 40px rgba(124,92,220,.16); }
.compare-col video { border-radius: 10px; width: 100%; background: #0b0b14; aspect-ratio: 4/3; object-fit: cover; }
.compare-label {
  font-weight: 700; font-family: var(--font-head); font-size: 1rem;
  margin-bottom: 10px; display: flex; align-items: center; gap: 9px;
}
.dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.dot-ours { background: var(--violet-600); box-shadow: 0 0 0 4px var(--violet-100); }
.dot-base { background: var(--ink-mute); box-shadow: 0 0 0 4px var(--line); }
.compare-col.ours .compare-label { color: var(--violet-700); }
.compare-col.base .compare-label { color: var(--ink-soft); }

/* ---------------- TABLES ---------------- */
.table-scroll { overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); }
.results-table {
  width: 100%; border-collapse: collapse; background: #fff;
  font-size: .94rem; min-width: 680px;
}
.results-table th, .results-table td {
  padding: 12px 14px; text-align: center; border-bottom: 1px solid var(--line);
}
.results-table thead th { font-family: var(--font-head); font-weight: 600; color: var(--ink); background: var(--violet-50); }
.results-table .subhead th { font-weight: 500; font-size: .82rem; color: var(--ink-soft); background: #fff; }
.results-table .left { text-align: left; font-weight: 500; color: var(--ink); white-space: nowrap; }
.results-table .grp-multi    { color: #0d7a6b; }
.results-table .grp-contact  { color: var(--violet-700); }
.results-table .grp-nonrigid { color: var(--magenta); }
.results-table .grp-avg      { color: var(--ink); }
.results-table tbody tr:last-child td { border-bottom: 0; }
.results-table .ours-row { background: linear-gradient(90deg, var(--violet-50), #fff); }
.results-table .ours-row td { color: var(--violet-800); }
.results-table .ours-row .left { color: var(--violet-800); }
.results-table .ours-row b { color: var(--violet-700); }
.ablation { min-width: 520px; }
.table-note { font-size: .84rem; color: var(--ink-mute); margin-top: 12px; }

.takeaways { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 30px; }
.takeaway {
  background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--violet-500);
  border-radius: var(--radius-sm); padding: 20px 22px; box-shadow: var(--shadow-sm);
}
.takeaway h4 { font-family: var(--font-head); margin: 0 0 6px; font-size: 1.05rem; color: var(--ink); }
.takeaway p { font-size: .92rem; margin: 0; }

/* ---------------- BIBTEX ---------------- */
.bibtex-wrap { position: relative; }
.bibtex-wrap pre {
  background: #16132a; color: #e8e3ff; border-radius: var(--radius);
  padding: 26px 24px; overflow-x: auto; font-family: var(--font-mono);
  font-size: .88rem; line-height: 1.65; box-shadow: var(--shadow);
  margin: 0;
}
.copy-btn {
  position: absolute; top: 14px; right: 14px;
  background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.25);
  padding: 6px 14px; border-radius: 8px; font-size: .82rem; font-weight: 600;
  cursor: pointer; transition: .18s; backdrop-filter: blur(6px);
}
.copy-btn:hover { background: rgba(255,255,255,.22); }
.copy-btn.copied { background: var(--violet-500); border-color: var(--violet-500); }

/* ---------------- FOOTER ---------------- */
.footer { padding: 44px 0; text-align: center; color: var(--ink-soft); border-top: 1px solid var(--line); background: var(--bg-soft); }
.footer p { margin: 6px 0; font-size: .92rem; }
.footer .muted { color: var(--ink-mute); font-size: .84rem; }

/* ---------------- REVEAL ANIM ---------------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------------- RESPONSIVE ---------------- */
@media (max-width: 960px) {
  .component-grid, .demo-grid, .takeaways { grid-template-columns: 1fr; }
  .task-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .nav-links {
    position: absolute; top: 62px; left: 0; right: 0;
    flex-direction: column; gap: 0; background: #fff;
    border-bottom: 1px solid var(--line); padding: 8px 16px 16px;
    box-shadow: var(--shadow); display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 8px; border-radius: 8px; }
  .nav-toggle { display: flex; }
  .compare-wrap { grid-template-columns: 1fr; }
  .section { padding: 56px 0; }
  .badge { font-size: .72rem; padding: 7px 14px; line-height: 1.5; max-width: 92vw; }
  .hero { padding-top: 46px; }
}
@media (max-width: 480px) {
  .task-grid, .stats-grid { grid-template-columns: 1fr; }
}
