/* PiHand project page. Layout and type follow the Nerfies/ActionPlan template (Bulma, Google Sans,
   Noto Sans); colours follow the paper's renders: blue object, skin-tone hands, red reference. */
:root {
  --ink: #1f2430;
  --ink-soft: #4a5160;
  --muted: #6b7280;
  --rule: #e3e6eb;
  --tint: #f7f8fa;
  --tint-2: #f1f3f6;
  --accent: #2f5bd3;        /* object blue in every figure */
  --accent-deep: #2449b0;
  --accent-wash: #eaf0fd;
  --skin: #e9b896;          /* hand colour in every figure */
  --skin-wash: #fbf1ea;
  --ref: #d64545;           /* reference ghost */
}

html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; }
body { font-family: 'Noto Sans', sans-serif; color: var(--ink); background: #fff; }
.title, .subtitle, .navbar, .publication-title, .publication-authors, .button, .stat, .tabs, table {
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
}
h1, h2, h3, .title { text-wrap: balance; }
a { color: var(--accent); }
a:hover { color: var(--accent-deep); }
.content p, .prose p { line-height: 1.7; }
.prose { max-width: 62rem; margin: 0 auto; }
.prose p { color: var(--ink-soft); font-size: 1.08rem; }

/* ---- navbar ---- */
.navbar { border-bottom: 1px solid var(--rule); background: rgba(255,255,255,0.94); backdrop-filter: blur(6px); }
.navbar-item { color: var(--ink-soft); font-size: 1.02rem; }
.navbar-item:hover, .navbar-item.is-current { color: var(--accent) !important; background: transparent !important; }
.navbar-brand .brand { font-weight: 700; color: var(--ink); letter-spacing: 0.01em; }
.navbar-brand .brand span { color: var(--accent); }

/* ---- hero ---- */
.hero.page-hero { margin-top: 3.25rem; }
.hero.page-hero .hero-body { padding-top: 3.5rem; padding-bottom: 1.5rem; }
.publication-title { font-weight: 700; line-height: 1.12; color: var(--ink); }
.publication-title .name { display: block; font-size: 4.2rem; letter-spacing: -0.01em; }
.publication-title .name .pi { color: var(--accent); }
.publication-title .tagline { display: block; font-size: 2.05rem; font-weight: 500; color: var(--ink-soft); margin-top: 0.4rem; }
.publication-authors { margin-top: 1.4rem; color: var(--ink-soft); }
.publication-authors .placeholder { color: var(--muted); font-style: italic; }
.publication-links { margin-top: 1.2rem; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; }
.publication-links .button { background: var(--ink); color: #fff; border: 0; }
.publication-links .button:hover { background: var(--accent); color: #fff; }
.publication-links .button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (max-width: 768px) {
  .publication-title .name { font-size: 3rem; }
  .publication-title .tagline { font-size: 1.45rem; }
}

/* ---- teaser ---- */
.teaser-video { border-radius: 12px; overflow: hidden; background: #0f1115;
  box-shadow: 0 2px 4px rgba(20,30,60,0.06), 0 18px 40px rgba(20,30,60,0.14); }
.teaser-video video { display: block; width: 100%; height: auto; }
.figure-caption { color: var(--muted); font-size: 0.98rem; margin-top: 0.75rem; line-height: 1.6; }
.figure-caption strong { color: var(--ink-soft); }

/* ---- sections ---- */
.section.alt { background: var(--tint); }
.section-title { text-align: center; margin-bottom: 0.6rem !important; }
.section-lede { text-align: center; color: var(--muted); font-size: 1.12rem; max-width: 46rem; margin: 0 auto 2.2rem; line-height: 1.6; }
.eyebrow { display: block; text-align: center; font-family: 'Google Sans', sans-serif; font-size: 0.82rem;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.35rem; }
.subhead { font-family: 'Google Sans', sans-serif; font-size: 1.35rem; font-weight: 600; color: var(--ink);
  margin: 2.6rem 0 0.6rem; }
.subhead + p { color: var(--ink-soft); margin-bottom: 1rem; line-height: 1.65; }

/* ---- TL;DR ---- */
.tldr { max-width: 52rem; margin: 0 auto 1.8rem; padding: 1rem 1.3rem; border-radius: 10px;
  background: var(--accent-wash); color: var(--ink); font-size: 1.12rem; line-height: 1.6;
  border: 1px solid #d6e1fb; }
.tldr .label { font-family: 'Google Sans', sans-serif; font-weight: 700; color: var(--accent); margin-right: 0.35rem; }

/* ---- key numbers ---- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; max-width: 70rem; margin: 2.2rem auto 0; }
.stat { background: #fff; border: 1px solid var(--rule); border-radius: 12px; padding: 1.15rem 1.1rem 1rem; }
.stat .value { font-size: 2.1rem; font-weight: 700; color: var(--accent); line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .value small { font-size: 1.05rem; font-weight: 500; color: var(--muted); }
.stat .what { margin-top: 0.45rem; color: var(--ink); font-weight: 600; font-size: 0.98rem; }
.stat .detail { margin-top: 0.25rem; color: var(--muted); font-size: 0.88rem; line-height: 1.45; font-family: 'Noto Sans', sans-serif; }
@media (max-width: 1023px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px)  { .stats { grid-template-columns: 1fr; } }

/* ---- method stages ---- */
.figure-card { background: #fff; border: 1px solid var(--rule); border-radius: 12px; padding: 1rem; }
.figure-card img { display: block; width: 100%; height: auto; }
.stages { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-top: 1.4rem; }
.stage { background: #fff; border: 1px solid var(--rule); border-radius: 12px; padding: 1.1rem 1.2rem; }
.stage .stage-tag { font-family: 'Google Sans', sans-serif; font-size: 0.8rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--accent); font-weight: 700; }
.stage h3 { font-family: 'Google Sans', sans-serif; font-size: 1.15rem; font-weight: 600; margin: 0.25rem 0 0.5rem; color: var(--ink); }
.stage p { color: var(--ink-soft); font-size: 0.97rem; line-height: 1.6; }
@media (max-width: 900px) { .stages { grid-template-columns: 1fr; } }

/* ---- tables ---- */
.table-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: 12px; background: #fff; }
table.results { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 0.98rem; }
table.results th, table.results td { padding: 0.62rem 0.85rem; text-align: center; white-space: nowrap; border-bottom: 1px solid var(--rule); }
table.results th:first-child, table.results td:first-child { text-align: left; }
table.results thead th { color: var(--muted); font-weight: 600; font-size: 0.86rem; background: var(--tint-2); }
table.results thead tr.group th { color: var(--ink); font-size: 0.95rem; }
table.results tbody tr:last-child td { border-bottom: 0; }
table.results tr.ours td { background: var(--accent-wash); font-weight: 600; }
table.results tr.ours td:first-child { color: var(--accent); }
table.results td.best { color: var(--accent); }
table.results tr.sep td { border-top: 2px solid var(--rule); }
.table-caption { color: var(--muted); font-size: 0.92rem; margin-top: 0.6rem; line-height: 1.55; }
.arrow { color: var(--muted); font-size: 0.8em; }

/* ---- interactive viewers ---- */
.viewer-frame { width: 100%; height: 560px; border-radius: 12px; background: var(--tint-2);
  display: flex; align-items: center; justify-content: center; color: var(--muted); }
.viewer-frame:not([data-gv-mounted])::before { content: 'Loading interactive viewer…'; font-style: italic; }
.viewer-frame.cmp { height: 600px; }
@media (max-width: 900px) { .viewer-frame { height: 520px; } .viewer-frame.cmp { height: 760px; } }
.viewer-hint { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; color: var(--muted); font-size: 0.9rem; margin: 0.6rem 0 0; }
.viewer-hint i { color: var(--accent); margin-right: 0.3rem; }
.legend-dot { display: inline-block; width: 0.75em; height: 0.75em; border-radius: 50%; vertical-align: -0.05em; margin: 0 0.25rem 0 0.1rem; }

/* ---- tabs over viewers ---- */
.tabs.task-tabs { margin-bottom: 0.9rem; }
.tabs.task-tabs a { font-size: 1.02rem; }
.tabs.is-toggle.task-tabs li.is-active a { background: var(--accent); border-color: var(--accent); }
.tab-pane { display: none; }
.tab-pane.is-active { display: block; }

/* ---- video gallery (one clip at a time) ---- */
.gallery { position: relative; }
.gallery .stage-box { position: relative; border-radius: 12px; overflow: hidden; background: #0f1115; aspect-ratio: 16 / 9; }
.gallery video { display: none; width: 100%; height: 100%; object-fit: contain; }
.gallery video.is-active { display: block; }
.gallery .nav-btn { position: absolute; top: 50%; transform: translateY(-50%); width: 2.6rem; height: 2.6rem;
  border-radius: 50%; border: 0; background: rgba(15,17,21,0.6); color: #fff; cursor: pointer; font-size: 1.1rem; }
.gallery .nav-btn:hover { background: rgba(15,17,21,0.85); }
.gallery .nav-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.gallery .prev { left: 0.7rem; } .gallery .next { right: 0.7rem; }
.gallery .meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 0.92rem; margin-top: 0.5rem; }
.gallery .meta .count { font-variant-numeric: tabular-nums; }

/* ---- misc ---- */
.ablation-figs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.ablation-figs figure { background: #fff; border: 1px solid var(--rule); border-radius: 12px; padding: 0.8rem; margin: 0; }
.ablation-figs img { display: block; width: 100%; height: auto; }
.ablation-figs figcaption { color: var(--muted); font-size: 0.9rem; text-align: center; margin-top: 0.4rem; }
@media (max-width: 900px) { .ablation-figs { grid-template-columns: 1fr; } }

pre.bibtex { background: var(--tint); border: 1px solid var(--rule); border-radius: 10px; min-height: 6rem;
  font-size: 0.9rem; color: var(--ink-soft); white-space: pre-wrap; }
.footer { background: var(--tint); padding: 2rem 1.5rem; color: var(--muted); font-size: 0.9rem; }
.footer a { color: var(--ink-soft); text-decoration: underline; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ---- authors ---- */
.publication-authors { font-size: 1.15rem; }
.author-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.2rem 1.4rem; color: var(--ink); }
.author-list a { color: var(--accent); }
.author-list sup, .affiliation-list sup { font-size: 0.7em; margin-left: 0.05em; }
.affiliation-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.1rem 1.2rem; margin-top: 0.5rem;
  font-size: 0.98rem; color: var(--muted); }
pre.bibtex { min-height: 0; padding: 1.1rem 1.25rem; overflow-x: auto; white-space: pre; }
