/* =====================================================================
   MMHU project page
   Layout: hero -> sections (title with a rule, lede, content) -> BibTeX
   Theme tokens: colours, typography and spacing are managed here.
   ===================================================================== */
:root {
  color-scheme: light;

  /* warm neutrals for text, lines and surfaces */
  --paper: #ffffff;
  --surface-soft: #f5f5f3;
  --surface-2: #ecece9;
  --line: #e2e2e0;
  --line-2: #ccccc7;
  --ink: #343434;
  --ink-strong: #262625;
  --accent: #5c5c59;
  --accent-dark: #373735;
  --muted: #70706d;

  /* the three task colours of the teaser figure, used as accents */
  --gen: #6a4ce2;   /* motion generation */
  --vqa: #257de0;   /* behavior VQA */
  --pred: #c2317a;  /* motion prediction */
  --brand-gradient: linear-gradient(100deg, var(--gen) 5%, var(--pred) 50%, var(--vqa) 95%);

  --good: #2e6b34;
  --good-bg: #edf3ea;

  /* type: a humanist sans for reading, a serif for the title and numerals */
  --body-font: "Optima", "Candara", "Noto Sans", "Segoe UI", sans-serif;
  --display-font: "Lora", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --mono-font: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --radius: 12px;
  --section-gap: 84px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 12px; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 16px/1.65 var(--body-font); font-variant-numeric: lining-nums;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
button { font-family: var(--body-font); }
img, video { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); text-decoration: underline; text-underline-offset: 3px; }
strong, b { font-weight: 700; }
sup { font-size: .66em; }
::selection { background: rgba(106, 76, 226, .2); }
:focus-visible { outline: 2px solid var(--gen); outline-offset: 3px; border-radius: 6px; }

/* every section shares one width so the title rules line up down the page */
.wrap, .wrap-wide { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

/* ---------- sections ---------- */
.section { padding: var(--section-gap) 0 0; }
h1, h2, h3, h4 { margin: 0; font-family: var(--body-font); font-weight: 700; line-height: 1.3; }
/* section title: a hairline with a short gradient tick under it */
h2 {
  position: relative; margin: 0 0 26px; padding: 0 0 14px; border-bottom: 1px solid var(--line);
  color: var(--ink-strong); font-size: clamp(26px, 2.7vw, 32px); line-height: 1.2; letter-spacing: .005em;
}
h2::after { content: ""; position: absolute; left: 0; bottom: -2px; width: 64px; height: 3px; border-radius: 2px; background: var(--brand-gradient); }
h3 { font-size: 16.5px; color: var(--ink-strong); }
p { margin: 0 0 12px; }

.lede { font-size: 17px; line-height: 1.65; max-width: 780px; margin-bottom: 30px; }
.lede b { color: var(--ink-strong); }
/* sub-section title: small, with a rule running to the right edge */
.sub-head {
  display: flex; align-items: center; gap: 16px; margin: 46px 0 10px;
  color: var(--ink-strong); font-size: 18px; font-weight: 700; letter-spacing: .01em;
}
.sub-head::after { content: ""; flex: 1; height: 1px; background: linear-gradient(to right, rgba(106, 76, 226, .45), var(--line) 45%); }
.sub-head.first { margin-top: 0; }
.sub-lede { max-width: 780px; margin-bottom: 22px; font-size: 15.5px; }

/* small uppercase label used for metadata */
.meta, .anno-label, .res-task, .tasks-label, .cmp-case figcaption .n {
  font: 700 11.5px/1.3 var(--body-font); letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}

/* ---------- scroll reveal (only when JS is running) ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: var(--d, 0s); }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- brand wordmark ---------- */
.brand { background: var(--brand-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- progress bar + floating nav ---------- */
.progress { position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 60; pointer-events: none; }
.progress span { display: block; height: 100%; transform-origin: 0 50%; transform: scaleX(0); background: var(--brand-gradient); }
.topnav {
  position: fixed; top: 12px; left: 50%; z-index: 50; transform: translate(-50%, -160%); transition: transform .45s var(--ease);
  display: flex; align-items: center; gap: 14px; padding: 6px 6px 6px 16px; border-radius: 10px; max-width: calc(100vw - 24px);
  background: rgba(250, 250, 249, .9); border: 1px solid var(--line);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 8px 28px rgba(52, 51, 48, .09);
}
.topnav.show { transform: translate(-50%, 0); }
.nav-brand { font: 700 17px/1 var(--display-font); }
.nav-brand:hover { text-decoration: none; }
.nav-links { display: flex; gap: 2px; }
.nav-links a {
  color: var(--muted); font-size: 13.5px; letter-spacing: .01em; padding: 7px 11px; border-radius: 6px;
  border: 1px solid transparent; transition: color .15s, background-color .15s, border-color .15s; white-space: nowrap;
}
.nav-links a:hover { color: var(--accent-dark); text-decoration: none; }
.nav-links a.active { color: var(--accent-dark); background: #fff; border-color: var(--line); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 8px;
  border: 1px solid var(--line-2); background: #fff; color: var(--accent-dark); font: 700 14px/1.2 var(--body-font); letter-spacing: .01em;
  cursor: pointer; transition: background-color .15s, border-color .15s;
}
.btn svg { width: 16px; height: 16px; flex: none; }
.btn:hover { background: var(--surface-soft); border-color: #b9b9b3; color: var(--accent-dark); text-decoration: none; }
.btn-sm { padding: 7px 13px; font-size: 13px; }
.btn-primary { background: var(--accent-dark); color: #fff; border-color: var(--accent-dark); }
.btn-primary:hover { background: #262625; border-color: #262625; color: #fff; }

/* ---------- hero ---------- */
.hero {
  text-align: center; padding: 58px 24px 8px;
  background:
    radial-gradient(60% 380px at 12% 0%, rgba(106, 76, 226, .11), transparent 70%),
    radial-gradient(50% 340px at 92% 2%, rgba(37, 125, 224, .10), transparent 70%),
    radial-gradient(45% 300px at 55% 0%, rgba(194, 49, 122, .06), transparent 70%),
    var(--paper);
}
.hero-title { margin: 0 auto 22px; max-width: 800px; font-family: var(--display-font); color: var(--ink-strong); }
.hero-title .brand { display: block; font-size: clamp(46px, 6.6vw, 72px); font-weight: 700; line-height: 1.1; letter-spacing: .01em; padding-bottom: .04em; }
.hero-title .subtitle { display: block; text-wrap: balance; margin-top: 6px; font-size: clamp(19px, 2.3vw, 25px); font-weight: 600; line-height: 1.35; }

.authors { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 22px; max-width: 1100px; margin: 0 auto 16px; font-size: 16.5px; color: var(--ink-strong); }
.authors span { white-space: nowrap; }
.authors sup { color: var(--muted); margin-left: 1px; }
.authors a { color: inherit; }
.authors a:hover { color: var(--gen); }
.affils { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px 30px; margin: 0 auto 12px; }
.affil { display: inline-flex; align-items: flex-start; gap: 4px; }
.affil sup { color: var(--muted); font-size: 11px; font-weight: 700; line-height: 1; }
/* each mark gets its own height so the four read as the same visual size */
.logo { width: auto; height: var(--h); }
.logo-tamu { --h: 30px; }
.logo-brown { --h: 14px; margin-top: 8px; }
.logo-jhu { --h: 25px; margin-top: 3px; }
.logo-ut { --h: 28px; }
.notes { font-size: 12.5px; color: var(--muted); margin: 0 0 22px; }
.notes span + span { margin-left: 16px; }
.buttons { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-bottom: 34px; }

.fig.teaser { margin: 0 auto; width: min(940px, 100%); }
/* the teaser has no frame: its white background melts into the page */
.teaser .fig-zoom, .teaser .fig-zoom:hover { padding: 0; border: 0; border-radius: 0; background: none; }
.teaser .fig-zoom img {
  border-radius: 0; mix-blend-mode: multiply;
  /* soften the hard left and right edges of the rendered scene */
  -webkit-mask-image: linear-gradient(90deg, transparent .3%, #000 4.5%, #000 93%, transparent 97.4%);
  mask-image: linear-gradient(90deg, transparent .3%, #000 4.5%, #000 93%, transparent 97.4%);
}
.teaser .fig-zoom::after { display: none; }

.hero-stats { display: grid; grid-template-columns: repeat(4, 1fr); max-width: 860px; margin: 40px auto 0; padding: 22px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stat { padding: 2px 16px; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat b { display: block; font: 600 36px/1.1 var(--display-font); color: var(--ink-strong); margin-bottom: 6px; }
.stat > span { font-size: 13.5px; color: var(--muted); }

/* ---------- figures (click to enlarge) ---------- */
.fig { margin: 0; position: relative; }
.fig-zoom {
  display: block; width: 100%; padding: 10px; margin: 0; font: inherit; cursor: zoom-in; position: relative;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .15s;
}
.fig-zoom:hover { border-color: var(--line-2); }
.fig-zoom img { width: 100%; height: auto; border-radius: 6px; }
.fig-zoom::after {
  content: "Click to enlarge"; position: absolute; right: 18px; bottom: 18px; padding: 6px 9px; border-radius: 6px;
  font: 400 12px/1 var(--body-font); letter-spacing: .02em; color: #fff; background: rgba(38, 38, 37, .8); opacity: 0; transition: opacity .2s;
}
.fig-zoom:hover::after, .fig-zoom:focus-visible::after { opacity: 1; }
.fig figcaption { margin-top: 10px; font-size: 13.5px; color: var(--muted); text-align: center; }
.fig-lg { margin-top: 28px; }

/* ---------- cards ---------- */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 6px 24px rgba(52, 51, 48, .035); }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid3 > :nth-child(2) { --d: .08s; }
.grid3 > :nth-child(3) { --d: .16s; }
/* cards that carry a task colour get a thin fading line along the top */
.anno, .step, .res-card { position: relative; overflow: hidden; }
.anno::before, .step::before, .res-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: linear-gradient(90deg, var(--c), transparent 80%); }

/* annotation cards (overview) */
.anno { padding: 20px 22px; }
.anno-label { display: block; margin-bottom: 10px; color: var(--c); }
.anno h3 { margin-bottom: 6px; }
.anno p { font-size: 14.5px; line-height: 1.6; margin: 0; }

.tasks { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 22px; }
.tasks-label { margin-right: 6px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-soft); font-size: 13.5px; color: var(--accent-dark); }
.chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--muted)); flex: none; }

/* ---------- dataset ---------- */
.data-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); gap: 14px; align-items: stretch; }
.data-col { display: grid; gap: 14px; align-content: start; }
.panel { padding: 20px 22px; min-width: 0; display: flex; flex-direction: column; }
.panel h3 { font-size: 15.5px; margin-bottom: 2px; }
.panel-sub { font-size: 13.5px; color: var(--muted); margin: 0 0 14px; }
.panel .fig-zoom { padding: 0; border: 0; border-radius: 8px; }
.panel .fig-zoom::after { right: 10px; bottom: 10px; }
.clouds { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.clouds figcaption { text-align: left; margin-top: 8px; font-size: 13px; line-height: 1.45; }
.clouds figcaption b { display: block; color: var(--ink-strong); }

/* ranked bars: one hue, value printed at the end of every row */
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; flex: 1; align-content: space-between; }
.bars li { display: grid; grid-template-columns: minmax(150px, 190px) minmax(0, 1fr) 54px; align-items: center; gap: 12px; padding: 5px 8px; margin: 0 -8px; border-radius: 6px; transition: background-color .15s; }
.bars li:hover { background: var(--surface-soft); }
.bar-name { font-size: 14px; color: var(--ink-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-name abbr { font: 400 10.5px/1 var(--body-font); letter-spacing: .06em; color: var(--muted); margin-left: 6px; text-decoration: none; }
.bar-track { height: 9px; position: relative; }
.bar-track i {
  position: absolute; inset: 0 auto 0 0; width: max(2px, calc(var(--v) / 50 * 100%)); background: var(--gen);
  border-radius: 0 4px 4px 0; transform-origin: 0 50%;
}
.js .bars .bar-track i { transform: scaleX(0); transition: transform 1.1s var(--ease) .15s; }
.js .bars.in .bar-track i { transform: none; }
.bar-val { font-size: 13.5px; font-weight: 700; color: var(--ink-strong); text-align: right; font-variant-numeric: lining-nums tabular-nums; }
.panel-note { font-size: 12.5px; color: var(--muted); margin: 12px 0 0; }

/* ---------- examples viewer ---------- */
.seg { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.seg button {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: var(--accent); font-size: 13.5px; line-height: 1.2;
  transition: background-color .15s, color .15s, border-color .15s;
}
.seg button .n { font-size: 11px; color: var(--muted); font-variant-numeric: lining-nums tabular-nums; }
.seg button:hover { background: var(--surface-soft); border-color: var(--line-2); color: var(--accent-dark); }
.seg button[aria-selected="true"] { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.seg button[aria-selected="true"] .n { color: rgba(255, 255, 255, .6); }

.viewer { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(260px, 1fr); gap: 14px; align-items: stretch; }
.video-frame { position: relative; border-radius: var(--radius); overflow: hidden; background: #1b1b1a; border: 1px solid var(--line); }
.video-frame video { width: 100%; aspect-ratio: 16 / 9; background: #1b1b1a; }
.viewer-side { padding: 22px; display: flex; flex-direction: column; }
.meta { margin: 0 0 8px; }
.viewer-side .tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 20px; padding: 0; list-style: none; }
.viewer-side .tags li { padding: 4px 11px; border-radius: 999px; font-size: 13.5px; font-weight: 700; color: var(--gen); background: rgba(106, 76, 226, .08); border: 1px solid rgba(106, 76, 226, .24); }
.viewer-desc { font-size: 16px; line-height: 1.6; color: var(--ink-strong); margin: 0 0 18px; }
.viewer-nav { margin-top: auto; display: flex; align-items: center; gap: 8px; }
.viewer-nav .count { margin-left: auto; font-size: 12.5px; color: var(--muted); font-variant-numeric: lining-nums tabular-nums; }
.icon-btn { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line-2); background: #fff; color: var(--accent-dark); cursor: pointer; display: grid; place-items: center; transition: background-color .15s; }
.icon-btn:hover { background: var(--surface-soft); }
.icon-btn svg { width: 16px; height: 16px; }

/* ---------- pipeline steps ---------- */
.steps { list-style: none; margin: 0; padding: 0; }
.step { padding: 20px 22px; display: flex; flex-direction: column; }
.step-n { font: 700 32px/1 var(--display-font); color: var(--c); margin-bottom: 12px; }
.step h3 { margin-bottom: 6px; }
.step p { font-size: 14.5px; line-height: 1.6; margin-bottom: 14px; }
.step-tag { margin-top: auto; font-size: 12px; letter-spacing: .02em; color: var(--muted); }

/* ---------- results: motion generation comparison ---------- */
.cmp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cmp-case { margin: 0; padding: 16px; }
.cmp-case figcaption { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0 2px 12px; font-size: 15px; font-weight: 700; color: var(--ink-strong); }
.cmp-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cmp-pane { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fdfdfd; }
.cmp-pane img { width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: contain; }
.cmp-pane.ours { border-color: rgba(106, 76, 226, .5); }
/* the label sits in its own bar above the clip, so it never covers the animation */
.tag { display: block; padding: 8px 12px; font: 700 12.5px/1.2 var(--body-font); letter-spacing: .01em; }
.tag-base { background: var(--surface-soft); color: var(--accent); border-bottom: 1px solid var(--line); }
.tag-ours { background: var(--gen); color: #fff; }

/* ---------- results: stat cards with their tables ---------- */
.res-card { padding: 20px 22px; display: flex; flex-direction: column; }
.res-task { margin: 0 0 4px; color: var(--c); }
.res-setup { font-size: 13.5px; color: var(--muted); margin: 0 0 16px; }
.res-value { margin: 0 0 10px; color: var(--ink-strong); line-height: 1; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.res-value b { font: 600 40px/1 var(--display-font); }
.res-value span { font-size: 13px; font-weight: 700; color: var(--accent); }
.res-delta { display: inline-flex; align-self: flex-start; align-items: center; gap: 6px; margin: 0 0 18px; padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; color: var(--good); background: var(--good-bg); }
.res-delta svg { width: 13px; height: 13px; flex: none; }
.res-table { margin-top: auto; width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: lining-nums tabular-nums; }
.res-table th, .res-table td { padding: 7px 0 7px 10px; text-align: right; border-top: 1px solid var(--line); color: var(--ink); white-space: nowrap; }
.res-table th:first-child, .res-table td:first-child { text-align: left; padding-left: 0; }
.res-table thead th { border-top: 0; font-weight: 700; font-size: 12px; color: var(--muted); padding-top: 0; }
.res-table tr.best td { color: var(--ink-strong); font-weight: 700; }
.res-note { font-size: 12.5px; color: var(--muted); margin: 14px 0 0; }

/* ---------- bibtex / footer ---------- */
.bib { position: relative; background: var(--surface-soft); border: 1px solid var(--line); border-radius: var(--radius); }
.bib pre { margin: 0; padding: 18px 20px; overflow-x: auto; font: 12.5px/1.7 var(--mono-font); color: var(--ink); }
.copy { position: absolute; top: 10px; right: 10px; border: 1px solid var(--line-2); background: #fff; color: var(--accent-dark); border-radius: 6px; padding: 5px 11px; cursor: pointer; font-size: 12.5px; font-weight: 700; }
.copy:hover { background: var(--surface-2); }
#bibtex { padding-bottom: var(--section-gap); }
footer { text-align: center; padding: 26px 20px 44px; border-top: 1px solid var(--line); }
footer p { font-size: 12.5px; color: var(--muted); margin: 0; }
footer .brand { font-family: var(--display-font); font-weight: 700; }

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 4vw; cursor: zoom-out;
  background: rgba(27, 27, 26, .88); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); animation: fade .25s ease;
}
.lightbox img { max-width: 100%; max-height: 92vh; border-radius: 10px; background: #fff; box-shadow: 0 40px 120px rgba(0, 0, 0, .6); }
.lb-close { position: absolute; top: 18px; right: 22px; width: 40px; height: 40px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .12); color: #fff; font-size: 22px; line-height: 1; cursor: pointer; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .grid3, .data-grid, .viewer, .cmp-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
}
@media (max-width: 720px) {
  body { font-size: 15.5px; }
  :root { --section-gap: 60px; }
  .wrap, .wrap-wide { padding: 0 16px; }
  .hero { padding: 40px 16px 4px; }
  .authors { font-size: 15.5px; gap: 2px 14px; }
  .affils { gap: 10px 22px; }
  .logo { height: calc(var(--h) * .88); }
  .lede { font-size: 16px; }
  .hero-stats { grid-template-columns: 1fr 1fr; gap: 22px 0; margin-top: 32px; }
  .stat:nth-child(3) { border-left: 0; }
  .fig-zoom { padding: 6px; }
  .bars li { grid-template-columns: minmax(0, 1fr) 54px; gap: 3px 12px; }
  .bar-track { grid-column: 1 / -1; grid-row: 2; }
  .seg { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px 14px; padding: 0 16px 4px; scrollbar-width: none; }
  .seg::-webkit-scrollbar { display: none; }
  .seg button { flex: none; white-space: nowrap; }
  .cmp-case { padding: 12px; }
  .tag { padding: 7px 10px; font-size: 11.5px; white-space: nowrap; }
  .bib pre { padding: 46px 14px 16px; font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .js .bars .bar-track i { transform: none; transition: none; }
  .topnav, .lightbox { transition: none; animation: none; }
}
