/* Project page styles. Layout adapted from the Nerfies project-page template (CC BY-SA 4.0).
   Colors follow the paper figures: object = purple, position = orange, match = green. */

:root {
  --ink: #1f2430;
  --text: #3a4150;
  --muted: #687083;
  --faint: #98a0b3;
  --line: #e6e9f0;
  --paper: #ffffff;
  --wash: #f7f8fc;
  --slate-bg: #eff3f9;

  --object: #6f2f9f;
  --object-tint: #e4d3f5;
  --position: #e8692d;
  --position-text: #d65f22;
  --position-tint: #ffd9c4;
  --match: #186b23;

  --radius: 14px;
  --shadow: 0 1px 2px rgba(31, 36, 48, 0.04), 0 8px 24px rgba(31, 36, 48, 0.07);
}

html { scroll-behavior: smooth; background: var(--paper); }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--object); }
a:hover { color: #55237b; }

.obj { color: var(--object); font-weight: 600; }
.pos { color: var(--position-text); font-weight: 600; }
.mat { color: var(--match); font-weight: 600; }

/* ---------- hero ---------- */
.hero.page-hero {
  background:
    radial-gradient(900px 380px at 12% 0%, rgba(228, 211, 245, 0.55), transparent 70%),
    radial-gradient(900px 380px at 88% 0%, rgba(255, 217, 196, 0.55), transparent 70%),
    var(--paper);
}
.hero-body { padding: 4.5rem 1.5rem 2.5rem; }

.publication-title {
  font-family: 'Inter', sans-serif;
  font-size: clamp(2.1rem, 4.2vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.12;
  color: var(--ink);
}
.publication-subtitle { margin-top: 1rem; font-size: 1.15rem; color: var(--muted); }
.publication-subtitle b { color: var(--ink); font-weight: 700; }
.publication-subtitle .obj, .publication-subtitle .pos { font-weight: 700; }
.publication-authors {
  margin-top: 1.3rem;
  font-size: 1.08rem;
  color: var(--ink);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  column-gap: 1.1rem;
  row-gap: 0.25rem;
}
.publication-authors sup, .publication-affiliations sup { font-size: 0.68em; margin-left: 1px; color: var(--muted); }
.publication-affiliations {
  margin-top: 0.55rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  column-gap: 1.4rem;
  font-size: 0.95rem;
  color: var(--muted);
}
.author-notes {
  margin-top: 0.35rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  column-gap: 1.4rem;
  font-size: 0.85rem;
  color: var(--faint);
}
.author-notes sup { font-size: 0.75em; margin-right: 2px; }
.affiliation-logos {
  margin-top: 1.4rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1rem 2.6rem;
}
.affiliation-logos img { display: block; width: auto; }
.affiliation-logos .logo-kaist { height: 36px; }
.affiliation-logos .logo-eth { height: 26px; }
.affiliation-logos .logo-kaust { height: 60px; }

.publication-links { margin-top: 1.6rem; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem; }
.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.15rem;
  border-radius: 999px;
  background: var(--ink);
  color: #fff !important;
  font-weight: 500;
  font-size: 0.95rem;
  transition: transform 0.12s ease, background-color 0.2s ease;
  box-shadow: 0 2px 8px rgba(31, 36, 48, 0.15);
}
.btn-link:hover { transform: translateY(-2px); background: #000; }
/* Links that are not available yet */
.btn-link.is-pending {
  background: #fff;
  color: var(--faint) !important;
  border: 1px dashed #c9cfdc;
  box-shadow: none;
  cursor: not-allowed;
}
.btn-link.is-pending:hover { transform: none; }

/* ---------- sections ---------- */
.section { padding: 4rem 1.5rem; }
.section.tight-top { padding-top: 1rem; }
.section.wash { background: var(--wash); }
.section-title {
  text-align: center;
  margin-bottom: 1.5rem;
  font-size: clamp(1.6rem, 2.6vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.sub-title {
  margin: 2.75rem 0 0.9rem;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.section-title + .sub-title { margin-top: 0.5rem; }
.prose { font-size: 1.04rem; line-height: 1.75; color: var(--text); }
.prose b { color: var(--ink); }
.lead {
  max-width: 760px;
  margin: 0 auto 1.75rem;
  font-size: 1.1rem;
  line-height: 1.7;
  text-align: center;
  color: var(--text);
}

/* ---------- figures ---------- */
.fig-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem;
  margin: 1.25rem auto 0;
}
.fig-card img { display: block; width: 100%; height: auto; border-radius: 8px; }
.fig-card.narrow { max-width: 760px; }
.fig-caption {
  margin: 0.9rem auto 0;
  max-width: 820px;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--muted);
  text-align: center;
}

/* Wide blocks break out of the text column on large screens. */
.bleed {
  width: min(1180px, calc(100vw - 3rem));
  max-width: none;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
}

/* ---------- tables ---------- */
.table-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-top: 1.25rem;
  overflow: hidden;
}
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.rtable {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}
.rtable.compact { min-width: 560px; }
.rtable th, .rtable td { padding: 0.55rem 0.7rem; white-space: nowrap; border: 0; }
.rtable thead tr.top th { background: var(--wash); font-weight: 700; color: var(--ink); text-align: center; border-bottom: 1px solid var(--line); }
.rtable thead tr.sub th { background: var(--wash); font-weight: 600; text-align: right; border-bottom: 1px solid #d9deea; font-size: 0.82rem; }
.rtable th.left { text-align: left !important; }
.rtable th.hs { color: var(--position-text); }
.rtable th.ho { color: var(--object); }
.rtable th.hm { color: var(--faint); }
.rtable td { text-align: right; color: var(--text); border-bottom: 1px solid #f1f3f7; }
.rtable td.pol { text-align: left; font-weight: 600; color: var(--ink); }
.rtable tbody tr.first td { border-top: 1px solid #d9deea; }
.rtable tbody tr:hover td { background: #fafbfe; }
.rtable .gap { width: 0.8rem; padding: 0; }
.rtable .ref { color: #a7adbb; }
.rtable td.bs, .rtable td.bo { font-weight: 700; color: var(--ink); }
.rtable td.bs { background: rgba(255, 217, 196, 0.38); }
.rtable td.bo { background: rgba(228, 211, 245, 0.45); }
.table-caption {
  padding: 0.85rem 1.1rem 1rem;
  font-size: 0.86rem;
  line-height: 1.6;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

/* ---------- signals that combine both abilities ---------- */
.signal-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.25rem;
}
.signal-card {
  background: #fff;
  border: 1px solid var(--line);
  border-top: 3px solid var(--match);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.2rem 1.15rem;
}
.signal-card .s-name { font-weight: 700; font-size: 1.02rem; color: var(--match); }
.signal-card .s-what { margin-top: 0.45rem; font-size: 0.9rem; line-height: 1.55; color: var(--muted); }
.signal-card .s-result { margin-top: 0.6rem; padding-top: 0.6rem; border-top: 1px solid #f1f3f7; font-size: 0.93rem; line-height: 1.6; color: var(--text); }
.signal-card .s-result b { color: var(--ink); }

/* ---------- videos ---------- */
.video-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.2rem;
  margin-top: 1.5rem;
}
.video-card .v-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem; margin-bottom: 0.9rem; }
.video-card .v-title { font-weight: 700; font-size: 1.05rem; color: var(--ink); }
.video-card video { display: block; width: 100%; height: auto; border-radius: 8px; background: #f2f3f6; }
.video-card .v-note { margin-top: 0.75rem; font-size: 0.88rem; line-height: 1.6; color: var(--muted); }
.seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.25rem;
  border-radius: 999px;
  background: var(--slate-bg);
}
.seg button {
  border: 0;
  background: transparent;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.seg button.is-active { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(31, 36, 48, 0.12); }
.video-tab-panel { display: none; }
.video-tab-panel.is-active { display: block; }

/* ---------- bibtex ---------- */
.bib-wrap { position: relative; }
pre.bibtex {
  background: #1f2430;
  color: #e7eaf2;
  border-radius: var(--radius);
  padding: 1.3rem 1.4rem;
  overflow-x: auto;
  font-size: 0.86rem;
  line-height: 1.6;
}
pre.bibtex code { background: transparent; color: inherit; padding: 0; font-size: inherit; }
.copy-btn {
  position: absolute; top: 0.8rem; right: 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #e7eaf2;
  border-radius: 8px;
  padding: 0.3rem 0.7rem;
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}
.copy-btn:hover { background: rgba(255, 255, 255, 0.16); }

.footer { padding: 2.5rem 1.5rem; background: var(--paper); border-top: 1px solid var(--line); }
.footer p { color: var(--muted); font-size: 0.82rem; }

/* ---------- small screens ---------- */
@media screen and (max-width: 768px) {
  .hero-body { padding: 3rem 1rem 1.5rem; }
  .section { padding: 2.75rem 1rem; }
  .publication-title { font-size: 1.85rem; }
  .publication-subtitle { font-size: 1rem; }
  .fig-card { padding: 0.6rem; }
  .video-card { padding: 0.75rem; }
  .bleed { width: calc(100vw - 2rem); }
  .has-text-justified { text-align: left !important; }
  .prose { font-size: 0.98rem; line-height: 1.7; }
  .lead { font-size: 1rem; }
  .signal-cards { grid-template-columns: 1fr; }
  .publication-authors { font-size: 0.98rem; column-gap: 0.8rem; }
  .affiliation-logos { gap: 0.8rem 1.6rem; }
  .affiliation-logos .logo-kaist { height: 28px; }
  .affiliation-logos .logo-eth { height: 20px; }
  .affiliation-logos .logo-kaust { height: 42px; }
}
