/* WholeBodyPose: project page.
   Academic project-page layout (Nerfies style): white page, one centred column, large title, dark pill
   buttons, figures with captions, BibTeX in a grey block. Plain CSS, no build step, light theme only. */

:root {
  color-scheme: light;
  --ink: #1f2328;
  --ink-2: #3b4148;
  --muted: #5c636b;          /* 6.1:1 on white */
  --line: #e3e5e8;
  --line-2: #cfd3d8;
  --bg: #ffffff;
  --bg-soft: #f6f7f8;
  --bg-code: #f3f4f6;
  --link: #1d5fb4;           /* 6.3:1 on white */
  --btn: #363636;
  --btn-hover: #1a1a1a;
  --accent: #0f6f74;         /* 5.9:1 on white */
  --accent-soft: #e6f2f2;
  --good: #1a7f37;

  /* keypoint groups, used in the pipeline figure */
  --k-body: #d9731f;
  --k-feet: #3b6fa3;
  --k-face: #7a5bb5;
  --k-hand: #2e8b57;

  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Noto Sans", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --w: 960px;
  --w-text: 800px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--link); outline-offset: 2px; border-radius: 4px;
}
img, svg, video { max-width: 100%; }
code, pre { font-variant-ligatures: none; }
code { font-family: var(--mono); font-size: .86em; background: var(--bg-code); padding: .08em .35em; border-radius: 4px; }
sup { font-size: .68em; line-height: 0; }
b, strong { font-weight: 600; }

.skip { position: absolute; left: -9999px; top: 8px; background: #fff; padding: 6px 12px; z-index: 10; }
.skip:focus { left: 8px; }

.container { max-width: var(--w); margin: 0 auto; padding: 0 24px; }
.container.narrow { max-width: calc(var(--w-text) + 48px); }
.container.wide { max-width: 1120px; }

/* ---------------- header ---------------- */
.hero { padding: 64px 0 8px; text-align: center; }
.title {
  font-family: var(--serif); font-weight: 600;
  font-size: 50px; line-height: 1.1; letter-spacing: -.015em;
  margin: 0 auto 8px; color: #111417;
}
.subtitle {
  font-family: var(--serif); font-weight: 500;
  font-size: 25px; line-height: 1.3; color: var(--ink-2);
  margin: 0 auto 22px; max-width: 760px; text-wrap: balance;
}
.authors { text-wrap: balance; font-size: 19px; margin: 0 0 4px; line-height: 1.6; }
.author { display: inline-block; margin: 0 .2em; }
.affils { text-wrap: balance; font-size: 15.5px; color: var(--ink-2); margin: 0; line-height: 1.6; }
.affils span { display: inline-block; margin: 0 .5em; }
.venue {
  font-size: 13px; font-weight: 600; color: var(--accent); margin: 0 0 14px;
  letter-spacing: .12em; text-transform: uppercase;
}

.links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 26px 0 0; }
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  height: 40px; padding: 0 18px;
  border-radius: 999px; border: 0;
  background: var(--btn); color: #fff;
  font: 500 15px/1 var(--sans);
  cursor: pointer; text-decoration: none;
  transition: background-color .15s ease;
}
.btn:hover { background: var(--btn-hover); text-decoration: none; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-soon { background: #fff; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line-2); cursor: default; }
.btn-soon:hover { background: #fff; }
.btn-soon small { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
  background: var(--bg-soft); border-radius: 999px; padding: 3px 7px; margin-left: 2px; }
.btn-light { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn-light:hover { background: var(--bg-soft); }

/* ---------------- hero figure ---------------- */
.hero-fig { padding: 44px 0 8px; }
.hero-fig .fig { margin: 0 auto; }
.hero-fig figcaption { text-align: center; }

/* ---------------- sections ---------------- */
.section { padding: 46px 0; }
.section + .section { border-top: 1px solid #eef0f2; }
h2 {
  font-family: var(--serif); font-weight: 600; font-size: 32px; line-height: 1.25;
  text-align: center; margin: 0 0 22px; color: #111417; letter-spacing: -.005em;
}
h3 { font-family: var(--serif); font-weight: 600; font-size: 22px; margin: 32px 0 12px; color: #111417; }
.prose p { margin: 0 0 16px; }
.prose p:last-child { margin-bottom: 0; }
.justify { text-align: justify; hyphens: auto; }
.lead { text-align: center; color: var(--ink-2); max-width: var(--w-text); margin: -6px auto 26px; }
.small { font-size: 14.5px; color: var(--muted); line-height: 1.6; }
.center { text-align: center; }
.fig-note { max-width: var(--w-text); margin: 14px auto 0; }
.keywords { margin-top: 14px; }

.tldr {
  margin: 0 0 40px; padding: 16px 20px; background: var(--accent-soft); border-radius: 8px;
  border-left: 4px solid var(--accent); font-size: 17px; line-height: 1.6;
}
.tldr .tag { margin-right: .4em; color: var(--accent); }

/* contributions */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.card { border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; background: #fff; }
.card h3 { margin: 0 0 6px; font-size: 19px; display: flex; align-items: baseline; gap: 10px; }
.card .n, .step .n {
  flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent); color: #fff; font: 600 13.5px/1 var(--sans); transform: translateY(-2px);
}
.card p { margin: 0; font-size: 15.5px; color: var(--ink-2); line-height: 1.6; }

/* figures */
.fig { margin: 28px auto 0; text-align: center; }
.fig figcaption { text-align: left; max-width: var(--w-text); margin: 14px auto 0; font-size: 15px; color: var(--ink-2); line-height: 1.6; }
.pipe-svg { display: block; width: 100%; height: auto; }
.pipe-narrow { display: none; max-width: 420px; margin: 0 auto; }
@media (max-width: 680px) {
  .pipe-wide { display: none; }
  .pipe-narrow { display: block; }
}
.pipe-svg text { font-family: var(--sans); fill: var(--ink); }
.pipe-svg .t-head { font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; fill: var(--muted); }
.pipe-svg .t-main { font-size: 15px; font-weight: 600; }
.pipe-svg .t-sub { font-size: 12.5px; fill: var(--ink-2); }
.pipe-svg .t-mono { font-family: var(--mono); font-size: 11.5px; fill: var(--ink-2); }
.pipe-svg .box { fill: #fff; stroke: var(--line-2); stroke-width: 1.2; }
.pipe-svg .box-soft { fill: var(--bg-soft); stroke: var(--line); stroke-width: 1; }
.pipe-svg .box-accent { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.4; }
.pipe-svg .chip { fill: #fff; stroke: var(--line-2); stroke-width: 1; }
.pipe-svg .arrow { stroke: #9aa3ad; stroke-width: 1.6; fill: none; }
.pipe-svg .arrow-head { fill: #9aa3ad; }

.kp-row { display: grid; grid-template-columns: repeat(2, minmax(0, 230px)); justify-content: center; gap: 28px; margin: 44px 0 0; }
.kp-row figure { margin: 0; }
.kp-row img { display: block; width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--line); }
.kp-row figcaption { margin-top: 8px; font-size: 14px; color: var(--ink-2); text-align: center; }

/* tables */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 15.5px; font-variant-numeric: tabular-nums; }
.tbl-fig { margin: 0; }
.tbl-fig figcaption { margin: 12px 0 0; font-size: 14.5px; color: var(--muted); line-height: 1.55; }
.tbl tbody th { white-space: nowrap; }
.tbl th, .tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tbl thead th { border-bottom: 2px solid var(--ink-2); font-weight: 600; font-size: 14.5px; color: var(--ink); white-space: nowrap; }
.tbl tbody tr:last-child th, .tbl tbody tr:last-child td { border-bottom: 2px solid var(--ink-2); }
.tbl tbody th { font-weight: 600; }
.tbl .c { text-align: center; }
.tbl .r { text-align: right; }
.tbl tr.ours td, .tbl tr.ours th { background: var(--accent-soft); }
.tbl .best { font-weight: 700; }
.tbl .gain { color: var(--good); font-weight: 600; white-space: nowrap; }
.tbl code { white-space: nowrap; }
.tbl .grp th { border-bottom: 0; padding-bottom: 0; }
.tbl .grp th[rowspan] { border-bottom: 2px solid var(--ink-2); vertical-align: bottom; padding-bottom: 9px; }

/* code */
.code {
  position: relative; margin: 0 0 18px; background: var(--bg-code); border: 1px solid var(--line);
  border-radius: 8px; overflow: hidden;
}
.code pre { margin: 0; padding: 16px 18px; overflow-x: auto; font: 13.5px/1.6 var(--mono); color: #24292f; }
.code .lbl {
  display: block; padding: 7px 14px; border-bottom: 1px solid var(--line); background: #eceef1;
  font-size: 12.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted);
}
.code pre code { padding: 0; background: none; border-radius: 0; font-size: inherit; }
.code .cm { color: #6a737d; }
.code .kw { color: #a3175d; }
.code .st { color: #0a6640; }
.copy-btn {
  position: absolute; right: 8px; top: 6px;
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px;
  border: 1px solid var(--line-2); border-radius: 6px; background: #fff; color: var(--ink);
  font: 500 12.5px/1 var(--sans); cursor: pointer;
}
.copy-btn:hover { background: var(--bg-soft); }
.copy-btn svg { width: 13px; height: 13px; }
.code.has-lbl .copy-btn { top: 4px; height: 24px; }

/* demo */
.demo-box { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--bg-soft); }
.demo-ph { display: grid; place-items: center; text-align: center; gap: 14px; padding: 44px 20px; }
.demo-ph p { margin: 0; color: var(--ink-2); max-width: 520px; }
.demo-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.demo-box iframe { display: block; width: 100%; height: 820px; border: 0; background: #fff; }

/* paper + bibtex */
.paper-row { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 28px; align-items: center; }
.paper-thumb { display: block; border: 1px solid var(--line-2); border-radius: 4px; box-shadow: 0 6px 18px rgba(0,0,0,.08); overflow: hidden; }
.paper-thumb img { display: block; width: 100%; height: auto; }
.paper-meta p { margin: 0 0 8px; }
.paper-meta .ptitle { font-family: var(--serif); font-weight: 600; font-size: 19px; line-height: 1.35; }
.bib.paper-gap { margin-top: 28px; }

/* footer */
.footer { padding: 34px 0 48px; border-top: 1px solid var(--line); background: var(--bg-soft); font-size: 14.5px; color: var(--muted); }
.footer p { margin: 0 0 8px; text-align: center; }
.footer a { color: var(--link); }

/* datasets table */
.tbl.ds { font-size: 15px; }
.tbl.ds tbody th a { color: var(--ink); font-weight: 600; border-bottom: 1px dotted var(--line-2); }
.tbl.ds tbody th a:hover { color: var(--link); text-decoration: none; border-bottom-color: var(--link); }
.tbl.ds td[data-l="Size"] { color: var(--muted); white-space: nowrap; }
.tbl.ds .grp-row th {
  padding: 20px 12px 8px; border-bottom: 1px solid var(--line-2); white-space: normal;
  font-weight: 400; font-size: 14px; color: var(--muted);
}
.tbl.ds tbody:first-of-type .grp-row th { padding-top: 12px; }
.tbl.ds .grp-row b { font-family: var(--serif); font-size: 17px; font-weight: 600; color: var(--ink); margin-right: 8px; }
.tbl.ds .grp-row a { color: var(--link); }
.tbl.ds tbody:not(:last-of-type) tr:last-child th, .tbl.ds tbody:not(:last-of-type) tr:last-child td { border-bottom: 1px solid var(--line); }
.tbl.ds .files { white-space: nowrap; }
.f {
  display: inline-block; padding: 1px 9px; margin: 0 2px 0 0; border-radius: 999px;
  font-size: 13px; line-height: 1.6; color: var(--accent); background: var(--accent-soft);
}
.f:hover { background: var(--accent); color: #fff; text-decoration: none; }

.ds-notes { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 40px; margin-top: 40px; }
.ds-notes h3 { font-size: 19px; margin: 0 0 8px; }
.ds-notes h3 + p { margin-top: 0; }
.ds-notes p { margin: 0 0 14px; font-size: 15.5px; color: var(--ink-2); line-height: 1.65; }
.ds-notes p + h3 { margin-top: 26px; }
.ds-snippet { margin-top: 30px; }
.ds-snippet h3 { font-size: 19px; margin: 0 0 8px; }
.ds-snippet p { margin: 0 0 12px; font-size: 15.5px; color: var(--ink-2); }
.ds-snippet .code { margin: 0; }

/* data processing */
.steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.step { border: 1px solid var(--line); border-radius: 10px; padding: 20px 22px 18px; background: #fff; }
.step h3 { margin: 0 0 10px; font-size: 19px; display: flex; align-items: baseline; gap: 10px; }
.step ul { margin: 0; padding: 0 0 0 18px; font-size: 15px; color: var(--ink-2); line-height: 1.6; }
.step li { margin: 0 0 7px; }
.step li::marker { color: var(--line-2); }
.step .more { margin: 10px 0 0; font-size: 14.5px; }
.step .more a::after { content: " \2192"; }

/* results */
.tbl.res .code-link { vertical-align: middle; font-size: 14px; border-bottom: 1px solid var(--line); line-height: 1.45; }
.tbl.res .code-link a { word-break: break-word; }
.tbl.res tr.base th, .tbl.res tr.base td:not(.code-link) { border-bottom: 0; }
.tbl.res .code-link .small { font-size: 13px; }
.tbl.res thead .code-link { vertical-align: bottom; font-size: 14.5px; border-bottom: 2px solid var(--ink-2); }
.tbl.res tbody tr:nth-last-child(2) .code-link { border-bottom: 2px solid var(--ink-2); }
.code pre.wrap { white-space: pre-wrap; overflow-wrap: anywhere; }

.code-list { display: none; }
.footer-h { font-size: 20px; margin: 0 0 12px; }

/* ---------------- responsive ---------------- */
@media (max-width: 760px) {
  .cards, .steps { grid-template-columns: 1fr; }
  .ds-notes { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .paper-row { grid-template-columns: 110px minmax(0, 1fr); gap: 18px; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .container { padding: 0 16px; }
  .hero { padding: 38px 0 10px; }
  .title { font-size: 36px; }
  .justify { text-align: left; hyphens: manual; }
  .subtitle { font-size: 19px; }
  .authors { font-size: 16.5px; }
  .affils { font-size: 14px; }
  h2 { font-size: 26px; }
  .section { padding: 36px 0; }
  .btn { height: 36px; padding: 0 14px; font-size: 14px; }
  .kp-row { gap: 12px; }
  .tbl th, .tbl td { padding: 8px 8px; }
  table.tbl { font-size: 14px; }
  .demo-box iframe { height: 700px; }
  .paper-row { grid-template-columns: 1fr; }
  .paper-thumb { max-width: 150px; margin: 0 auto; }
  .paper-meta { text-align: center; }
}

/* datasets table as stacked cards on phones */
@media (max-width: 640px) {
  .ds-wrap { overflow: visible; }
  .tbl.ds thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tbl.ds, .tbl.ds tbody, .tbl.ds tr, .tbl.ds .grp-row th { display: block; }
  .tbl.ds .grp-row th { padding: 26px 0 8px; border-bottom: 2px solid var(--ink-2); }
  .tbl.ds tbody:first-of-type .grp-row th { padding-top: 4px; }
  .tbl.ds .grp-row span { display: block; margin-top: 2px; }
  .tbl.ds tbody tr:not(.grp-row) {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 12px;
    padding: 14px 0; border-bottom: 1px solid var(--line);
  }
  .tbl.ds tbody tr:not(.grp-row) > * { border: 0 !important; padding: 0; text-align: left; }
  .tbl.ds tbody th[scope="row"] { grid-column: 1 / -1; font-size: 16px; }
  .tbl.ds td[data-l]::before {
    content: attr(data-l); display: block; font-size: 11px; font-weight: 600; letter-spacing: .06em;
    text-transform: uppercase; color: var(--muted); line-height: 1.4;
  }
  .tbl.ds td[data-l="Language"] { order: 1; }
  .tbl.ds td[data-l="Classes"] { order: 2; }
  .tbl.ds td[data-l="Size"] { order: 3; color: var(--ink); }
  .tbl.ds td[data-l="Train"] { order: 4; }
  .tbl.ds td[data-l="Val"] { order: 5; }
  .tbl.ds td[data-l="Test"] { order: 6; }
  .tbl.ds .files { order: 7; grid-column: 1 / -1; white-space: normal; margin-top: 4px; }
  .f { padding: 3px 12px; margin: 0 4px 4px 0; font-size: 13.5px; }
}

@media (max-width: 640px) {
  .lead { text-align: left; }
  .tbl.res .code-link { display: none; }
  .code-list { display: block; margin: 14px 0 0; padding: 0; list-style: none; overflow-wrap: anywhere; }
  .code-list li { margin: 0 0 4px; }
  .code-list::before { content: "Original code"; display: block; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
  .tbl.res th, .tbl.res td { padding-left: 5px; padding-right: 5px; }
  .tbl.res { font-size: 13px; }
  .tbl.res .dlt { display: none; }
  .tbl.res th, .tbl.res td { padding-top: 7px; padding-bottom: 7px; }
}

@media (max-width: 680px) {
  .code.bib pre { white-space: pre-wrap; overflow-wrap: anywhere; }
  .footer p { text-align: left; }
}
