/* HINT-VLM project page. Phone layout first; wider screens add columns and a side table of contents. */

:root {
  --bg: #141a1c;                         /* page background under the backdrop */
  --panel: rgba(28, 36, 39, 0.78);       /* cards, video frames */
  --panel-solid: #1c2427;
  --text: #e8eded;
  --muted: #a3afb1;
  --line: rgba(255, 255, 255, 0.12);
  --green: #46d37f;                      /* interactive path colour in our figures/videos */
  --orange: #ff7a3d;                     /* detouring path colour */
  --radius: 12px;
  --gutter: 18px;                        /* side margin on phones */
  --toc-h: 48px;                         /* height of the sticky chip bar on phones */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16.5px/1.65 var(--font);
  overflow-x: hidden;
}

/* Fixed, pre-blurred garden photo behind everything, darkened so text stays readable. */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(20, 26, 28, 0.78) 0%, rgba(20, 26, 28, 0.9) 45%, rgba(20, 26, 28, 0.96) 100%),
    url("../images/backdrop_garden.jpg") center / cover no-repeat;
}

a { color: var(--green); }
img, video { display: block; max-width: 100%; }

/* ---------- Table of contents: sticky chip bar on phones ---------- */
.toc {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  gap: 6px;
  height: var(--toc-h);
  align-items: center;
  padding: 0 var(--gutter);
  overflow-x: auto;
  scrollbar-width: none;
  background: rgba(20, 26, 28, 0.88);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.toc::-webkit-scrollbar { display: none; }
.toc a {
  flex: none;
  padding: 5px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}
.toc a.is-active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
}

/* ---------- Page column ---------- */
main {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 var(--gutter) 48px;
}
section, .project-heading { scroll-margin-top: calc(var(--toc-h) + 12px); }
section { padding-top: 56px; }

/* ---------- Header ---------- */
.project-heading {
  padding-top: 40px;
  text-align: center;
}
.project-heading h1 {
  margin: 0;
  font-size: clamp(2.6rem, 12vw, 5rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.title-full {
  max-width: 760px;
  margin: 14px auto 0;
  font-size: clamp(1.1rem, 4.4vw, 1.6rem);
  line-height: 1.35;
}
.authors {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 16px;
  margin: 24px auto 0;
  padding: 0;
  max-width: 720px;
  list-style: none;
  font-size: 1.05rem;
}
.affiliations {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px 14px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}
.venue {
  max-width: 640px;
  margin: 14px auto 0;
  color: var(--muted);
  font-size: 0.95rem;
}
.pub-note {                              /* arXiv / proceedings status, shown as a small badge under the venue */
  display: inline-block;
  margin: 10px auto 0;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;                   /* wraps to two lines on narrow screens: a box, not a capsule */
  font-size: 0.85rem;
}
sup { font-size: 0.7em; }

/* Paper / Code / Video / BibTeX buttons: 2x2 grid on phones, one row on wider screens. */
.links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  max-width: 420px;
  margin: 26px auto 0;
}
.pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;                      /* comfortable touch target */
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  font-size: 0.98rem;
  text-decoration: none;
}
a.pill:hover { border-color: rgba(255, 255, 255, 0.35); }
.pill svg { width: 18px; height: 18px; flex: none; }
.pill.is-soon { color: var(--muted); cursor: default; }
.pill-text { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.pill small { font-size: 0.7rem; opacity: 0.85; }

/* ---------- Section headings ---------- */
.kicker {
  margin: 0 0 6px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
h2 {
  margin: 0 0 14px;
  font-size: clamp(1.45rem, 6vw, 2.1rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
h3 {
  margin: 28px 0 10px;
  font-size: 1.15rem;
  font-weight: 600;
}
.prose { max-width: 760px; }
.prose p { margin: 0 0 14px; }
.lead { font-size: 1.07rem; }

/* ---------- Media ---------- */
.media {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #000;
}
.media video { width: 100%; height: auto; }
.caption {
  margin: 10px 2px 0;
  color: var(--muted);
  font-size: 0.93rem;
}
.figure-light {                          /* the teaser figure has a white background: give it a light card */
  max-width: 760px;                      /* tall figure: keep it from filling a wide screen */
  margin: 0 auto;
  padding: 10px;
  border-radius: var(--radius);
  background: #fff;
}
.figure-light img { width: 100%; height: auto; }
.legend-green { color: var(--green); font-weight: 600; }
.legend-orange { color: var(--orange); font-weight: 600; }

/* ---------- Abstract (folded) ---------- */
details.abstract {
  margin-top: 6px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
details.abstract summary {
  padding: 12px 0;
  cursor: pointer;
  font-weight: 600;
}
details.abstract p { margin: 0 0 16px; }

/* ---------- Method cards ---------- */
.steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.steps li {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  counter-increment: step;
}
.steps li::before {
  content: "0" counter(step);
  display: block;
  margin-bottom: 2px;
  color: var(--green);
  font: 600 0.8rem/1.4 var(--mono);
}
.steps h3 { margin: 0 0 6px; font-size: 1.05rem; }
.steps p { margin: 0; color: #cfd7d8; font-size: 0.95rem; }
.formula {
  margin-top: 8px !important;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.28);
  font: 0.86rem/1.5 var(--mono);
  overflow-x: auto;
}

/* ---------- BibTeX ---------- */
.bibtex {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.32);
}
.bibtex pre {
  margin: 0;
  padding: 46px 16px 16px;
  font: 0.8rem/1.55 var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  min-height: 34px;
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-solid);
  color: var(--text);
  font: 0.85rem var(--font);
  cursor: pointer;
}

/* ---------- Footer ---------- */
footer {
  max-width: 980px;
  margin: 0 auto;
  padding: 20px var(--gutter) 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
footer a { color: var(--muted); white-space: nowrap; }

/* ---------- Tablets and up ---------- */
@media (min-width: 700px) {
  :root { --gutter: 28px; }
  section { padding-top: 72px; }
  .links { grid-template-columns: repeat(4, auto); max-width: none; justify-content: center; }
  .steps { grid-template-columns: 1fr 1fr; }
  .sim-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
  .sim-grid > div:first-child { grid-column: 1 / -1; }
}

/* ---------- Wide screens: table of contents becomes a fixed left column ---------- */
@media (min-width: 1280px) {
  :root { --toc-h: 0px; }
  .toc {
    position: fixed;
    top: 96px;
    left: max(16px, calc(50% - 490px - 200px));
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    width: 170px;
    height: auto;
    padding: 0;
    overflow: visible;
    background: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    border: 0;
    border-left: 1px solid var(--line);
  }
  .toc a { border-radius: 0 8px 8px 0; padding: 7px 14px; }
  .toc a.is-active { box-shadow: inset 2px 0 0 var(--green); }
}

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