:root {
  --bg: #ffffff; --bg-alt: #f5f5f7; --hero-top: #fbfbfd;
  --ink: #1d1d1f; --text: #1d1d1f; --muted: #6e6e73; --faint: #86868b;
  --line: #d2d2d7; --line-soft: #e6e6eb;
  --teal: #3c7281; --teal-dark: #2f5b67; --coral: #cc8a83;
  --ours: rgba(60, 114, 129, .07); --ours-strong: rgba(60, 114, 129, .11);
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --wrap: 1120px; --narrow: 780px; --r: 20px;
  --shadow: 0 12px 32px rgba(0, 0, 0, .08), 0 2px 6px rgba(0, 0, 0, .04);
  --ring: 0 0 0 1px var(--line-soft);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 60px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.6 var(--sans); letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased; }
img, video { display: block; max-width: 100%; }
a { color: var(--teal); text-underline-offset: 3px; }
h1, h2, h3 { color: var(--ink); margin: 0; }
h2 { font-size: clamp(34px, 4.6vw, 56px); line-height: 1.07; font-weight: 700; letter-spacing: -0.03em; margin-bottom: 18px;
  text-wrap: balance; }
h3 { font-size: 19px; line-height: 1.3; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 6px; }
p { margin: 0 0 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--teal); color: #fff; padding: 6px 12px; z-index: 50; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 28px; }
.wrap.narrow { max-width: var(--narrow); }
.center { text-align: center; }
.eyebrow { font: 600 17px/1.3 var(--sans); color: var(--teal); letter-spacing: -0.01em; margin-bottom: 10px; }
.lead { font-size: clamp(19px, 1.7vw, 22px); line-height: 1.5; color: var(--muted); margin: 0; }

/* navigation: a translucent white bar */
.nav { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 18px; height: 52px; padding: 0 28px;
  background: rgba(251, 251, 253, .82); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, .08); }
.lab { display: inline-flex; align-items: center; flex: none; line-height: 0; }
.lab img { width: auto; height: 28px; max-width: none; }
.nav-divider { flex: none; width: 1px; height: 22px; background: var(--line); }
.nav-mark { flex: none; line-height: 0; }
.nav-mark img { width: auto; height: 21px; }
.nav-sections { margin-left: auto; display: flex; gap: 28px; overflow-x: auto; scrollbar-width: none; }
.nav-sections::-webkit-scrollbar { display: none; }
.nav-sections a { color: var(--ink); opacity: .72; text-decoration: none; font-size: 14px; white-space: nowrap; transition: opacity .2s; }
.nav-sections a:hover { opacity: 1; }
.nav-sections a.active { opacity: 1; color: var(--teal); }

/* hero: the horizontal poster's layout -- logo, name, one line, buttons on the left; the render on the right */
.hero { background: linear-gradient(180deg, var(--hero-top) 0%, var(--bg-alt) 100%); padding: 32px 0 40px; overflow: hidden; }
.hero-grid { max-width: 1320px; margin: 0 auto; padding: 0 28px; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 12px; align-items: center; min-height: min(740px, calc(100vh - 150px)); }
.hero-lab img { height: 52px; }
.hero-mark { margin: 36px 0 22px; line-height: 0; }
.hero-mark img { width: min(500px, 100%); height: auto; }
.tagline { font: 700 clamp(30px, 3.3vw, 46px)/1.1 var(--sans); letter-spacing: -0.03em; color: var(--ink); margin: 0 0 12px;
  text-wrap: balance; }
.subline { font-size: clamp(18px, 1.45vw, 21px); line-height: 1.45; color: var(--muted); max-width: 26em; margin: 0 0 30px; }
.links { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-render { margin: 0; }
.hero-render img { width: 100%; height: auto; }
.paper-line { max-width: 1320px; margin: 8px auto 0; padding: 0 28px; }
.paper-title { font-size: 14.5px; color: var(--muted); margin: 0 0 2px; }
.authors { font-size: 14.5px; color: var(--faint); margin: 0; }

/* buttons: pills */
.btn { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 20px; border-radius: 980px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); font: 500 16px/1 var(--sans); text-decoration: none; cursor: pointer;
  transition: background .2s, border-color .2s; }
.btn svg { width: 14px; height: 14px; fill: currentColor; }
.btn:hover { border-color: var(--teal); }
.btn.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn.primary:hover { background: var(--teal-dark); border-color: var(--teal-dark); }
.btn.soon { color: var(--faint); background: transparent; cursor: default; }
.btn.soon:hover { border-color: var(--line); }
.btn em { font: 600 10.5px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--coral); font-style: normal; }

/* sections */
.section { padding: 112px 0; }
.section.alt { background: var(--bg-alt); }
.section.film { background: var(--bg-alt); padding: 24px 0 112px; }
.film-card { max-width: 980px; margin: 0 auto; border-radius: var(--r); overflow: hidden; background: #fff; box-shadow: var(--shadow); }
.film-card video { width: 100%; aspect-ratio: 16 / 9; background: #e9ebef; }
.film-card figcaption { padding: 12px 20px; color: var(--muted); font-size: 14px; }

/* key numbers from the paper */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-top: 72px; }
.kpi { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.kpi-v { font: 700 clamp(40px, 4.4vw, 56px)/1 var(--sans); letter-spacing: -0.035em; color: var(--teal); }
.kpi-l { margin-top: 10px; font-size: 17px; font-weight: 600; color: var(--ink); }
.kpi-c { max-width: 16em; font-size: 14px; line-height: 1.45; color: var(--muted); }

/* figures from the paper: drawn on white; click opens the lightbox */
.paper-fig { margin: 72px 0 0; }
.paper-fig img { width: 100%; height: auto; padding: 16px; background: #fff; border-radius: var(--r); box-shadow: var(--shadow); cursor: zoom-in; }
.paper-fig figcaption { max-width: 820px; margin: 16px auto 0; text-align: center; color: var(--muted); font-size: 14.5px; line-height: 1.55; }
.paper-fig figcaption b { color: var(--ink); font-weight: 600; }

/* method: a sticky stage with one loop per step */
.scrolly { display: grid; grid-template-columns: 7fr 5fr; gap: 56px; margin-top: 72px; }
.scrolly-media { position: sticky; top: max(84px, calc(50vh - 230px)); align-self: start; }
.stage { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r); overflow: hidden; background: #e9ebef; box-shadow: var(--shadow); }
.stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .45s ease; }
.stage video.on { opacity: 1; }
.stage-caption { margin: 14px 4px 0; color: var(--muted); font-size: 14px; }
.stage-caption b { color: var(--teal); font-weight: 600; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.step { position: relative; min-height: 34vh; padding: 0 0 40px 56px; opacity: .35; transition: opacity .3s; }
.step:last-child { min-height: 0; }
.step.active { opacity: 1; }
.step::before { counter-increment: step; content: counter(step); position: absolute; left: 0; top: -3px; width: 34px; height: 34px;
  border-radius: 50%; background: #fff; color: var(--muted); display: grid; place-items: center; font: 600 15px/1 var(--sans);
  box-shadow: inset 0 0 0 1px var(--line); }
.step.active::before { background: var(--teal); color: #fff; box-shadow: none; }
.step h3 { font-size: 21px; }
.step p { margin: 0; font-size: 17px; color: var(--muted); }

/* envelopes / meshes compare slider */
.compare { margin: 96px 0 0; --pos: 50%; }
.compare-frame { position: relative; border-radius: var(--r); overflow: hidden; background: #e9ebef; box-shadow: var(--shadow); }
.compare-frame > img { width: 100%; height: auto; }
.compare-before { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.compare-before img { width: 100%; height: 100%; object-fit: cover; }
.compare-handle { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px; background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .05); pointer-events: none; }
.compare-handle::after { content: '‹ ›'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 44px; height: 44px;
  border-radius: 50%; background: #fff; color: var(--ink); display: grid; place-items: center; font: 600 17px/1 var(--sans); box-shadow: var(--shadow); }
.compare input[type=range] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.compare-label { position: absolute; top: 14px; padding: 7px 12px; border-radius: 99px; background: rgba(255, 255, 255, .88);
  font: 600 13px/1 var(--sans); color: var(--ink); pointer-events: none; }
.compare-label.l { left: 14px; color: var(--teal); }
.compare-label.r { right: 14px; }
.compare figcaption { margin-top: 14px; color: var(--muted); font-size: 14px; text-align: center; }

/* tables */
.table-wrap { overflow-x: auto; margin-top: 56px; border-radius: var(--r); background: #fff; box-shadow: var(--ring); }
.table-wrap.compact { max-width: 880px; margin-left: auto; margin-right: auto; }
table { border-collapse: collapse; width: 100%; min-width: 860px; font-size: 14.5px; }
caption { caption-side: top; text-align: left; padding: 18px 20px 12px; color: var(--muted); font-size: 14px; }
caption b { color: var(--ink); font-weight: 600; }
th, td { padding: 11px 14px; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: top; }
thead th { font: 600 12.5px/1.3 var(--sans); color: var(--muted); background: #fafafb; }
tbody td:first-child, thead th:first-child { position: sticky; left: 0; z-index: 1; background: #fff; color: var(--ink); font-weight: 500; }
thead th:first-child { background: #fafafb; }
tr.group td, tr.group td:first-child { font: 600 12.5px/1 var(--sans); color: var(--teal); background: #f7f8fa; }
td.y { color: var(--teal); font-weight: 600; } td.n { color: #b4b4ba; } td.p { color: var(--coral); font-weight: 600; }
tr.ours td, tr.ours td:first-child { background: var(--ours); }
tr.ours td:first-child { color: var(--teal); font-weight: 600; box-shadow: inset 3px 0 0 var(--teal); }
sup { color: var(--coral); font-size: 70%; }
.table-notes { margin: 0; padding: 12px 20px 16px; font-size: 13px; line-height: 1.6; color: var(--muted); }
table.results td:not(:first-child), table.results th:not(:first-child) { text-align: center; }
table.results td { font-variant-numeric: tabular-nums; }
table.results u { text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
table.results b { color: var(--ink); font-weight: 700; }
table.metrics { min-width: 560px; }
table.metrics td.o, table.metrics th.o { background: var(--ours); }
table.metrics th.o { color: var(--teal); }
table.metrics tr.dim td, table.metrics tr.dim td:first-child { color: var(--ink); font-weight: 600; background: #fafafb; }
table.metrics tr.dim td.o { background: var(--ours-strong); }
td.ind { padding-left: 30px; }
h3.sub { margin: 104px 0 0; font-size: clamp(26px, 2.6vw, 34px); font-weight: 700; letter-spacing: -0.025em; }
h3.sub + .table-wrap { margin-top: 32px; }

/* gallery: tabs, room filters, cards and the lightbox */
.tabs { display: inline-flex; gap: 4px; padding: 4px; margin: 26px 0 30px; border-radius: 99px; background: #e8e8ed; }
.tabs button, .filters button { font: 500 15px/1 var(--sans); color: var(--ink); background: none; border: 0; padding: 9px 18px;
  border-radius: 99px; cursor: pointer; }
.tabs button[aria-selected=true] { background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.filters { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: -6px 0 26px; }
.filters button { border: 1px solid var(--line); background: #fff; padding: 7px 14px; font-size: 14px; color: var(--muted); }
.filters button[aria-pressed=true] { border-color: var(--teal); color: var(--teal); }
/* exactly 4 columns from 1000 px, 2 below (never 3): main.js shows homes and rooms in full rows of these widths */
.gallery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.gcard { position: relative; margin: 0; border-radius: 16px; overflow: hidden; background: #fff; cursor: zoom-in;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .05); transition: box-shadow .3s, transform .3s; }
.gcard:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.gcard img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.gcard.contain img, .gcard.asset img { object-fit: contain; padding: 14px; background: radial-gradient(circle at 50% 45%, #fff 0%, #eceef2 78%); }
.gcard.asset img { padding: 18px; }
.gcard.latest img { object-fit: contain; background: #8d8d8d; }
.gcard figcaption { position: absolute; left: 10px; right: 10px; bottom: 10px; display: flex; justify-content: space-between; gap: 8px;
  font: 500 12.5px/1.2 var(--sans); color: var(--ink); pointer-events: none; }
.gcard figcaption span { background: rgba(255, 255, 255, .9); padding: 5px 9px; border-radius: 99px; }
.gcard figcaption .dim { color: var(--muted); }
.ghead { grid-column: 1 / -1; margin: 18px 2px 0; }
.ghead:first-child { margin-top: 0; }
.ghead h3 { margin: 0 0 2px; }
.ghead p { margin: 0; color: var(--muted); font-size: 14.5px; }
.lightbox { border: 0; padding: 0; border-radius: 18px; max-width: 94vw; background: #fff; color: var(--text); box-shadow: var(--shadow); }
.lightbox::backdrop { background: rgba(29, 29, 31, .55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.lightbox img { max-width: 94vw; max-height: 84vh; object-fit: contain; margin: 0 auto; }
.lb-caption { margin: 0; padding: 12px 18px; font-size: 14px; color: var(--muted); }
.lb-close { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .92);
  color: var(--ink); font-size: 22px; cursor: pointer; box-shadow: 0 1px 4px rgba(0, 0, 0, .15); }

/* built for robots: the posters' three portraits */
.robots { display: grid; grid-template-columns: repeat(3, minmax(0, 260px)); justify-content: center; gap: 28px; margin-top: 64px; }
.robot { margin: 0; text-align: center; }
.robot img { width: 100%; height: auto; border-radius: 22px; box-shadow: var(--shadow); }
/* live portraits: 4:5 loops with the portrait as poster, and the speed in a small chip, as on the film's sped-up panels */
.robot-media { position: relative; aspect-ratio: 4 / 5; border-radius: 22px; overflow: hidden; background: #e9ebef; box-shadow: var(--shadow); }
.robot-media video { width: 100%; height: 100%; object-fit: cover; }
.robot-media .speed { position: absolute; top: 10px; right: 10px; padding: 5px 9px; border-radius: 99px; background: rgba(255, 255, 255, .9);
  color: var(--ink); font: 600 12px/1 var(--sans); letter-spacing: .02em; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.robot figcaption { margin-top: 14px; color: var(--faint); font-size: 16px; font-weight: 500; }

/* release, citation, footer */
.release { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 88px; padding: 18px 22px;
  border-radius: var(--r); background: #fff; box-shadow: var(--ring); }
.release p { margin: 0; font-size: 16px; color: var(--muted); }
.release b { color: var(--ink); font-weight: 600; }
.bibtex { position: relative; margin-top: 30px; }
.bibtex pre { margin: 0; padding: 22px; border-radius: var(--r); background: #fff; box-shadow: var(--ring); overflow-x: auto;
  font: 14px/1.65 var(--mono); color: var(--ink); }
.copy { position: absolute; top: 12px; right: 12px; border: 0; border-radius: 99px; padding: 8px 13px; background: var(--bg-alt);
  color: var(--ink); font: 500 13px/1 var(--sans); cursor: pointer; }
.copy.done { color: var(--teal); }
.footer { padding: 32px 0; border-top: 1px solid var(--line-soft); color: var(--faint); font-size: 13.5px; }
.footer .wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.footer p { margin: 0; }
.footer a { color: var(--muted); text-decoration: none; }
.footer .lab img { height: 26px; }

/* layout breakpoints */
@media (max-width: 999.98px) {   /* the same 1000 px as main.js's gallery column count */
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}
@media (max-width: 1040px) {
  .hero-grid { grid-template-columns: 1fr; min-height: 0; gap: 4px; text-align: center; }
  .hero-copy { display: flex; flex-direction: column; align-items: center; padding-top: 12px; }
  .links { justify-content: center; }
  .hero-render img { width: min(760px, 100%); margin: 0 auto; }
  .paper-line { text-align: center; }
  .kpis { grid-template-columns: repeat(2, 1fr); row-gap: 40px; }
  .scrolly { grid-template-columns: 1fr; gap: 20px; }
  .scrolly-media { top: 52px; z-index: 5; padding: 10px 0 8px; background: var(--bg-alt); }
  .step { min-height: 28vh; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .wrap, .hero-grid, .paper-line { padding: 0 20px; }
  .section { padding: 80px 0; }
  .section.film { padding: 16px 0 80px; }
  .nav { gap: 14px; padding: 0 16px; }
  .nav-lab, .nav-divider { display: none; }   /* phones: the logo stays in the hero, the bar keeps room for the sections */
  .nav-sections { gap: 20px; }
  .hero-lab img { height: 44px; }
  .hero-mark { margin: 26px 0 16px; }
  .btn { height: 40px; padding: 0 16px; font-size: 15px; }
  .robots { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .robot img, .robot-media { border-radius: 14px; }
  .robot-media .speed { top: 6px; right: 6px; padding: 4px 7px; font-size: 11px; }
  .robot figcaption { font-size: 13px; }
  .release { flex-direction: column; align-items: flex-start; }
  .tabs { max-width: 100%; overflow-x: auto; }
  .paper-fig img { padding: 8px; }
  .gcard figcaption { left: 6px; right: 6px; bottom: 6px; font-size: 11.5px; }
  .gcard figcaption .dim { display: none; }   /* two narrow columns: the card keeps its name, the lightbox shows the rest */
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .stage video, .gcard, .step { transition: none; }
}
