/* ===== HALO project page — custom styles ===== */
:root {
  --bg: #f7f8fb;          /* soft off-white page */
  --bg-soft: #eef1f6;     /* panels / code blocks */
  --card: #ffffff;        /* cards, tables */
  --border: #e2e6ec;      /* light hairline */
  --fg: #1a1f26;          /* near-black text */
  --fg-soft: #5b6572;     /* muted text */
  --accent: #7c3aed;      /* motion violet */
  --accent-2: #0891b2;    /* structure teal-cyan */
  --good: #1f9d55;
  --gold: #c98a00;
  --max-w: 1040px;
  --radius: 14px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Inter", "Google Sans", system-ui, -apple-system, "Noto Sans", sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: rgba(124,58,237,.10); color: var(--accent); padding: 1px 6px; border-radius: 6px; font-size: .88em; }
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 22px; }

/* ===== sticky nav ===== */
nav.topnav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
nav.topnav .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 56px;
}
nav.topnav .brand {
  font-weight: 800; letter-spacing: .06em;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
nav.topnav .links a {
  color: var(--fg-soft); margin-left: 20px; font-size: .92rem; font-weight: 500;
}
nav.topnav .links a:hover { color: var(--fg); text-decoration: none; }
@media (max-width: 720px){ nav.topnav .links a{ margin-left:12px; font-size:.8rem; } }
@media (max-width: 520px){ nav.topnav .links{ display:none; } }

/* ===== hero ===== */
header.hero { padding: 64px 0 36px; text-align: center; }
.hero h1 {
  font-size: 2.35rem; line-height: 1.18; margin: 0 0 6px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
@media (max-width: 640px){ .hero h1{ font-size: 1.7rem; } }
.hero .venue { color: var(--fg-soft); font-weight: 600; letter-spacing:.05em; margin-bottom: 22px; }
.authors { font-size: 1.06rem; margin: 4px 0; line-height: 1.9; }
.authors a { color: var(--fg); }
.authors a[href="#"] { cursor: default; }
.authors sup { color: var(--accent); }
.affil { color: var(--fg-soft); font-size: .95rem; margin: 12px auto 0; max-width: 860px; line-height: 1.6; }
.affil .aff-item { display: inline-block; margin: 2px 6px; }
.affil .aff-item sup { color: var(--accent); }
.affil .aff-sep { color: var(--border); }
.corr { color: var(--fg-soft); font-size: .82rem; margin-top: 8px; }

.btn-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 26px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--border); color: var(--fg);
  padding: 10px 18px; border-radius: 999px; font-weight: 600; font-size: .95rem;
  transition: .15s;
}
.btn:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-1px); }
.btn svg { width: 18px; height: 18px; fill: currentColor; }

/* ===== sections ===== */
section { padding: 48px 0; border-top: 1px solid var(--border); }
section h2 {
  font-size: 1.6rem; margin: 0 0 6px; text-align: center;
}
section h3 { font-size: 1.12rem; }
section .lead { color: var(--fg-soft); text-align: center; max-width: 760px; margin: 0 auto 30px; }
.abstract p { color: var(--fg); font-size: 1.02rem; }

figure { margin: 0; }
figure img { width: 100%; border-radius: var(--radius); border: 1px solid var(--border); background:#fff; display:block; }
figcaption { color: var(--fg-soft); font-size: .88rem; text-align: center; margin-top: 10px; }

/* ===== TL;DR box ===== */
.tldr {
  position: relative;
  max-width: 860px; margin: 0 auto;
  background: linear-gradient(135deg, rgba(124,58,237,.08), rgba(8,145,178,.07));
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 20px 24px;
}
.tldr-badge {
  display: inline-block; margin-bottom: 8px;
  font-weight: 800; font-size: .78rem; letter-spacing: .08em;
  padding: 3px 10px; border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff;
}
.tldr p { margin: 0; color: var(--fg); font-size: 1.02rem; line-height: 1.6; }

/* ===== teaser video carousel ===== */
.teaser-carousel { display:flex; align-items:center; gap:12px; }
.tcar-viewport { flex:1; overflow:hidden; border-radius: var(--radius); }
.tcar-track { display:flex; transition: transform .4s ease; }
.tcar-slide { min-width:100%; box-sizing:border-box; }
.tcar-pair { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
@media (max-width:600px){ .tcar-pair{ grid-template-columns:1fr; } }
.teaser-cell { position:relative; }
.teaser-cell video, .teaser-cell img {
  width:100%; aspect-ratio:16/10; object-fit:cover; display:block;
  border-radius:12px; border:1px solid var(--border); background:#000;
}
.teaser-cell.ours video, .teaser-cell.ours img { border-color: var(--accent); box-shadow:0 0 0 2px rgba(124,58,237,.30); }
.teaser-cell .tag { position:absolute; top:8px; left:8px; z-index:2; margin:0; }
.teaser-cell .cell-ph { aspect-ratio:16/10; min-height:0; }
.tcar-slide .slide-prompt { text-align:center; font-style:italic; color:var(--fg); margin:12px auto 0; max-width:760px; }

.tcar-arrow {
  flex:0 0 auto; width:44px; height:44px; border-radius:50%;
  border:1px solid var(--border); background:var(--card); color:var(--fg);
  font-size:1.5rem; line-height:1; cursor:pointer; transition:.15s;
  display:flex; align-items:center; justify-content:center;
}
.tcar-arrow:hover { border-color:var(--accent); color:var(--accent); transform:translateY(-1px); }
@media (max-width:600px){ .tcar-arrow{ width:36px; height:36px; font-size:1.2rem; } }

.tcar-dots { display:flex; gap:9px; justify-content:center; margin-top:16px; }
.tcar-dot {
  width:9px; height:9px; border-radius:50%; border:none; padding:0; cursor:pointer;
  background:var(--border); transition:.15s;
}
.tcar-dot.active { background:linear-gradient(135deg,var(--accent),var(--accent-2)); transform:scale(1.15); }
.teaser-cap { text-align:center; color:var(--fg-soft); font-size:.95rem; max-width:820px; margin:16px auto 0; }

/* ===== claim cards ===== */
.cards { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; margin-top: 8px; }
@media (max-width: 760px){ .cards{ grid-template-columns:1fr; } }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px;
}
.card .num {
  display:inline-flex; min-width:30px; height:30px; padding:0 8px; align-items:center; justify-content:center;
  border-radius: 8px; background: linear-gradient(135deg,var(--accent),var(--accent-2));
  color:#fff; font-weight:700; margin-bottom: 12px; text-transform: uppercase;
}
.card h3 { margin: 0 0 6px; font-size: 1.06rem; }
.card p { margin: 0; color: var(--fg-soft); font-size: .94rem; }

/* ===== metric callouts ===== */
.metrics { display:grid; grid-template-columns: repeat(3,1fr); gap:18px; margin: 4px 0 30px; }
@media (max-width: 760px){ .metrics{ grid-template-columns:1fr; } }
.metric { background: var(--bg-soft); border:1px solid var(--border); border-radius: var(--radius); padding: 20px; text-align:center; }
.metric .v { font-size: 2rem; font-weight: 800; color: var(--good); }
.metric .k { color: var(--fg-soft); font-size: .9rem; margin-top: 4px; }

/* ===== generic grids ===== */
.grid2 { display:grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid3 { display:grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
@media (max-width: 760px){ .grid2,.grid3{ grid-template-columns:1fr; } }
.analysis-grid .tag { margin-bottom: 8px; }

/* ===== tags ===== */
.tag { display:inline-block; font-size:.72rem; font-weight:700; letter-spacing:.03em;
       padding:2px 9px; border-radius:6px; margin-bottom:6px; }
.tag.mot { background:rgba(124,58,237,.13); color:#6d28d9; }
.tag.str { background:rgba(8,145,178,.13); color:#0e7490; }
.tag.ref { background:rgba(240,192,64,.18); color:var(--gold); }
.tag.base{ background:rgba(154,167,180,.14); color:var(--fg-soft); }
.tag.ours{ background:linear-gradient(135deg,var(--accent),var(--accent-2)); color:#fff; }

/* ===== video results: method grid ===== */
.prompt-line {
  text-align:center; color: var(--fg); font-size:1.02rem; font-style: italic;
  max-width: 820px; margin: 0 auto 22px; min-height: 1.6em;
}
.method-grid {
  display:grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
}
@media (max-width: 900px){ .method-grid{ grid-template-columns: repeat(2,1fr); } }
@media (max-width: 520px){ .method-grid{ grid-template-columns: 1fr; } }
/* Movie Scene: Reference + HALO only */
.method-grid.cols-2 { grid-template-columns: repeat(2,1fr); max-width: 900px; margin-left:auto; margin-right:auto; }
@media (max-width: 520px){ .method-grid.cols-2{ grid-template-columns: 1fr; } }
.method-cell { position: relative; }
.method-cell video {
  width:100%; aspect-ratio: 16/10; object-fit: cover;
  border-radius:12px; border:1px solid var(--border); background:#000; display:block;
}
.method-cell.ours video { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(124,92,255,.35); }
.method-cell .tag { position:absolute; top:8px; left:8px; z-index:2; margin:0; }
/* overlay tags must stay legible on top of (dark) video */
.method-cell .tag.base, .teaser-cell .tag.base { background: rgba(0,0,0,.6); color:#f1f5f9; backdrop-filter: blur(2px); }
.method-cell .tag.ref,  .teaser-cell .tag.ref  { background: rgba(0,0,0,.6); color:#ffd166; backdrop-filter: blur(2px); }
.cell-ph { min-height: 0; aspect-ratio: 16/10; font-size:.82rem; line-height:1.4; }

.note { text-align:center; color: var(--fg-soft); font-size:.85rem; margin-top: 16px; }
.chip { display:inline-block; padding:1px 8px; border-radius:6px; font-weight:700; font-size:.8rem; }
.chip.ours { background:linear-gradient(135deg,var(--accent),var(--accent-2)); color:#fff; }

/* ===== result tables ===== */
.table-wrap { overflow-x:auto; border-radius: var(--radius); border:1px solid var(--border); }
table.restable {
  width:100%; border-collapse: collapse; background: var(--bg-soft); font-size:.92rem;
  min-width: 460px;
}
table.restable th, table.restable td {
  padding: 9px 14px; text-align:center; border-bottom:1px solid var(--border);
}
table.restable thead th {
  background: var(--card); color: var(--fg); font-weight:700; position: sticky; top:0;
}
table.restable td:nth-child(1), table.restable td.grp, table.restable td.model { text-align:left; }
table.restable td.grp { color: var(--fg-soft); font-weight:600; vertical-align: middle; border-right:1px solid var(--border); }
table.restable tbody tr:last-child td { border-bottom:none; }
table.restable .vn { color: var(--fg-soft); font-size:.74rem; font-weight:500; margin-left:4px; }
table.restable td.b { font-weight:800; color: var(--fg); }
table.restable td.u { text-decoration: underline; text-underline-offset: 3px; }
table.restable tr.ours-row { background: rgba(124,58,237,.08); }
table.restable tr.ours-row td { color: var(--fg); font-weight:600; }
.sw { padding:0 6px; }
.sw.b { font-weight:800; }
.sw.u { text-decoration: underline; text-underline-offset: 3px; }

/* ===== bibtex ===== */
pre.bibtex {
  background: var(--bg-soft); border:1px solid var(--border); border-radius: var(--radius);
  padding: 18px; overflow-x:auto; color: var(--fg); font-size: .86rem; line-height:1.55;
}

footer { padding: 40px 0; text-align:center; color: var(--fg-soft); font-size:.85rem; border-top:1px solid var(--border); }

/* ===== selector pills ===== */
.pills { display:flex; gap:8px; justify-content:center; flex-wrap:wrap; margin: 0 0 18px; }
.pill {
  background: var(--card); border:1px solid var(--border); color: var(--fg-soft);
  padding: 7px 16px; border-radius: 999px; font-weight:600; font-size:.9rem; cursor:pointer; transition:.15s;
}
.pill:hover { color: var(--fg); border-color: var(--accent); }
.pill.active { background: linear-gradient(135deg,var(--accent),var(--accent-2)); color:#fff; border-color:transparent; }
.pill-group { display:inline-flex; gap:8px; padding:4px; background:var(--bg-soft); border:1px solid var(--border); border-radius:999px; flex-wrap:wrap; }

.hidden { display:none; }

/* ===== placeholder (missing asset) ===== */
.placeholder {
  display:flex; align-items:center; justify-content:center; text-align:center;
  min-height: 220px; border: 1px dashed var(--accent); border-radius: var(--radius);
  color: var(--fg-soft); background: var(--bg-soft); padding: 16px; font-size:.9rem;
}
.placeholder code { display:inline-block; margin-top:4px; }
