/* Humanoids at Home: project page
   Dark ground so the black-backed renders dissolve into the page. */
:root {
  --ground: #0b0a09;
  --raised: #171412;
  --line: #2e2824;
  --ink: #ece5da;
  --dim: #a2978a;
  --amber: #e0a458;      /* lamp light in the renders */
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --col: 41rem;
  --wide: 66rem;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--ground); color: var(--ink);
  font: 400 1.1875rem/1.6 var(--serif);
  -webkit-font-smoothing: antialiased;
}
img, video { display: block; width: 100%; height: auto; }
a { color: inherit; text-decoration-color: var(--amber); text-underline-offset: .2em; }
a:hover { color: var(--amber); }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }

.label, .kicker, .n, figcaption, .note, .affil, .links a, .readon, button, footer, .viewer-cap {
  font-family: var(--mono); font-size: .78rem; letter-spacing: .04em;
}
.label, .kicker { text-transform: uppercase; color: var(--amber); margin: 0 0 .9rem; }
.note { color: var(--dim); }

/* ── Masthead ── */
.masthead {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  align-items: center; gap: 1rem;
  max-width: 80rem; margin: 0 auto; padding: 2rem 2rem 1rem; min-height: 88vh;
}
.masthead-media { order: 2; }
.masthead-text { padding-left: clamp(0rem, 3vw, 3rem); }
h1 {
  font-weight: 300; font-size: clamp(3rem, 7.2vw, 6.25rem); line-height: .95;
  letter-spacing: -.025em; margin: 0 0 1.4rem;
}
.dek { font-size: 1.4rem; line-height: 1.35; font-style: italic; color: var(--dim); max-width: 30rem; margin: 0 0 2rem; }
.authors { margin: 0 0 .3rem; font-size: 1.05rem; }
.authors span + span::before { content: " · "; color: var(--dim); }
.affil { color: var(--dim); margin: 0 0 1.8rem; }
.links { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.8rem; }
.links a {
  text-decoration: none; padding: .5rem .9rem; border: 1px solid var(--line); border-radius: 2px;
}
.links a:hover { border-color: var(--amber); }
.readon { color: var(--dim); text-decoration: none; }

/* ── Article column ── */
main { padding: 2rem 1.5rem 0; }
.prose { max-width: var(--col); margin: 0 auto; }
.wide { max-width: var(--wide); margin: 2.75rem auto; }
section[id] { scroll-margin-top: 2rem; }
.prose + .prose { margin-top: 0; }
section.prose[id] { margin-top: 6.5rem; }
h2 { font-weight: 400; font-size: clamp(1.9rem, 3.6vw, 2.6rem); line-height: 1.12; letter-spacing: -.015em; margin: 0 0 1.2rem; text-wrap: balance; }
h3 { font-weight: 500; font-size: 1.3rem; line-height: 1.25; margin: 2.2rem 0 .5rem; }
p { margin: 0 0 1.1rem; }
.lede { font-size: 1.45rem; line-height: 1.5; }
.lede em { color: var(--amber); }

figure { margin-left: auto; margin-right: auto; }
figcaption { color: var(--dim); margin-top: .8rem; }

ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: .8rem 0; border-top: 1px solid var(--line); }
ul.plain b { font-weight: 500; }

/* ── Pipeline ── */
.stages { list-style: none; padding: 0; margin: 1.5rem 0 0; }
.stages a {
  display: grid; grid-template-columns: 3.2rem 1fr; padding: 1rem 0;
  border-top: 1px solid var(--line); text-decoration: none; color: var(--dim);
}
.stages li:last-child a { border-bottom: 1px solid var(--line); }
.stages b { color: var(--ink); font-weight: 500; }
.stages a:hover b { color: var(--amber); }
.n { color: var(--amber); padding-top: .35em; }

/* ── Stats ── */
.stats {
  max-width: var(--wide); margin: 2.5rem auto; display: grid;
  grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.stats div { padding: 1.6rem 1.2rem 1.4rem 0; }
.stats div + div { padding-left: 1.4rem; border-left: 1px solid var(--line); }
.stats dt { font-size: clamp(2.2rem, 4.6vw, 3.6rem); font-weight: 300; line-height: 1; letter-spacing: -.02em; }
.stats dd { margin: .6rem 0 0; font-family: var(--mono); font-size: .78rem; color: var(--dim); }

/* ── Split figures ── */
.split { display: grid; grid-template-columns: 1.15fr 1fr; gap: 2.5rem; align-items: center; }
.split.flip img { order: 2; }
.split figcaption { grid-column: 1 / -1; margin-top: -1rem; }
.split-text h3:first-child { margin-top: 0; }
.split-text .note { margin-top: 1.2rem; color: var(--ink); font-family: var(--serif); font-size: 1.1rem; font-style: italic; letter-spacing: 0; }

/* ── Tabs (attributes + viewer) ── */
[role="tablist"] { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
button[role="tab"] {
  background: none; color: var(--dim); border: 1px solid var(--line); border-radius: 2px;
  padding: .5rem .9rem; cursor: pointer;
}
button[role="tab"]:hover { color: var(--ink); }
button[role="tab"][aria-selected="true"] { color: var(--ground); background: var(--amber); border-color: var(--amber); }

.attr-body { display: grid; grid-template-columns: 1fr 1.1fr; gap: 2.5rem; align-items: center; background: #000; border: 1px solid var(--line); padding: 1.5rem; }
.attr-body > * { min-width: 0; }
.attr-def { font-size: 1.45rem; line-height: 1.35; min-height: 4em; }
.node {
  font: .82rem/1.75 var(--mono); color: var(--dim); background: var(--raised);
  border: 1px solid var(--line); padding: 1rem 1.2rem; margin: 0 0 .8rem; overflow-x: auto;
}
.node .on { color: var(--amber); }

.viewer-stage { background: #000; border: 1px solid var(--line); aspect-ratio: 16 / 10; display: grid; place-items: center; overflow: hidden; }
.viewer-stage > * { width: 100%; height: 100%; object-fit: contain; }
.viewer-cap { color: var(--dim); margin: .8rem 0 0; }

/* ── Findings ── */
.findings { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--line); }
.findings li { padding: 1.4rem 1.6rem 0 0; }
.findings li + li { padding-left: 1.6rem; border-left: 1px solid var(--line); }
.findings h3 { margin: .6rem 0 .6rem; }
.findings p { color: var(--dim); font-size: 1.05rem; }

/* ── Closing ── */
.closing { margin-top: 7rem; }
blockquote { margin: 0 0 1.6rem; }
blockquote p { font-size: clamp(1.9rem, 4vw, 2.9rem); line-height: 1.15; font-weight: 300; letter-spacing: -.015em; text-wrap: balance; }
.closing > p { color: var(--dim); font-style: italic; }

.bib { font: .8rem/1.6 var(--mono); color: var(--dim); background: var(--raised); border: 1px solid var(--line); padding: 1.2rem; overflow-x: auto; }

footer { max-width: var(--wide); margin: 6rem auto 0; padding: 1.5rem; border-top: 1px solid var(--line); color: var(--dim); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
footer p { margin: 0; }

@media (max-width: 820px) {
  body { font-size: 1.0625rem; }
  .masthead { grid-template-columns: 1fr; min-height: 0; padding: 1rem 1.25rem; }
  .masthead-media { order: 0; }
  .masthead-text { padding-left: 0; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stats div:nth-child(3) { padding-left: 0; border-left: 0; }
  .stats div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .split, .attr-body, .findings { grid-template-columns: minmax(0, 1fr); }
  .attr-body { padding: 1rem; gap: 1.2rem; }
  .split.flip img { order: 0; }
  .split figcaption { margin-top: 0; }
  .findings li + li { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  section.prose[id] { margin-top: 4.5rem; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
