:root {
  color-scheme: light;
  --ink: #000;
  --paper: #fff;
  --line: rgb(0 0 0 / 22%);
  --control-border: rgb(0 0 0 / 50%);
  --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 94px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1rem/1.65 var(--sans); }
h1, h2, h3, h4, p, figure { margin: 0; }
h1, h2, h3, h4 { font-weight: 600; line-height: 1.12; letter-spacing: -.045em; text-wrap: balance; }
a { color: var(--ink); text-decoration: none; text-underline-offset: .22em; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
img, video { display: block; width: 100%; height: auto; }
video.animation { pointer-events: none; background: var(--paper); }
::selection { color: var(--paper); background: var(--ink); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 5px; }
.shell { width: min(1280px, 100% - 112px); margin-inline: auto; }
.reading { width: min(100%, 760px); margin-inline: auto; }
.visually-hidden, .rollout-filter input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link { position: fixed; z-index: 40; top: .5rem; left: .5rem; padding: .5rem 1rem; background: var(--paper); transform: translateY(-200%); }
.skip-link:focus { transform: none; }

.opening-nav {
  position: sticky;
  z-index: 30;
  top: 0;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.opening-nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 65px; }
.opening-wordmark { font: 650 1.35rem/1 "Inter Tight", var(--sans); letter-spacing: -.035em; white-space: nowrap; }
.opening-nav-links { display: flex; align-items: center; gap: clamp(1.1rem, 3vw, 2.25rem); }
.opening-nav-links a { padding-block: .45rem; font-size: .9375rem; font-weight: 550; }
.opening-menu { position: relative; display: none; }
.opening-menu summary { padding: .35rem .75rem; border: 1px solid var(--control-border); border-radius: 5px; font-size: .9375rem; font-weight: 550; cursor: pointer; }
.opening-menu-content {
  position: absolute;
  inset: calc(100% + .65rem) 0 auto auto;
  display: grid;
  width: max-content;
  min-width: 12rem;
  padding: .4rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  box-shadow: 0 12px 32px rgb(0 0 0 / 10%);
  font-size: .9375rem;
}
.opening-menu:not([open]) .opening-menu-content { display: none; }
.opening-menu-content a { display: block; padding: .5rem .65rem; border-radius: 3px; }
.opening-menu-content a:hover { color: var(--paper); background: var(--ink); text-decoration: none; }

#main {
  --module-spacing: clamp(1rem, 2.25vw, 2rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--module-spacing);
  padding: var(--module-spacing) clamp(.75rem, 2.5vw, 2.75rem);
  background: #f5f5f5;
}

#main .shell { width: min(1280px, 100% - clamp(1.75rem, 6.6vw, 6rem)); }

#main > :is(.project, .overview-band, .paper-section) {
  width: min(100%, 1480px);
  min-width: 0;
  margin-inline: auto;
  border: 1px solid rgb(0 0 0 / 12%);
  border-radius: clamp(1rem, 2vw, 1.5rem);
  background-color: var(--paper);
  box-shadow: 0 2px 4px rgb(0 0 0 / 3%), 0 .65rem 1.5rem rgb(0 0 0 / 5%);
}
.module-gradient {
  background-image: linear-gradient(165deg, #ededed, var(--paper) 40%, var(--paper) 73%, #f5f5f5);
}
.overview-band { display: flow-root; }
.project { padding-block: clamp(1.85rem, 3.1vw, 3.1rem) clamp(2.45rem, 4.4vw, 3.85rem); }
.project-layout { max-width: 1120px; }
.project-intro { text-align: center; }
.project h1 {
  color: var(--ink);
  font: 600 clamp(2rem, 4.6vw, 3.85rem)/1.05 "Inter Tight", var(--sans);
  letter-spacing: -.032em;
}
.project-name {
  display: block;
  margin-bottom: .45rem;
  font-size: clamp(2.85rem, 6.25vw, 5.25rem);
  font-weight: 750;
  line-height: 1;
  letter-spacing: -.045em;
}
.project-byline { margin-top: 1rem; }
.project-authors, .project-affiliations { display: flex; flex-wrap: wrap; justify-content: center; margin: 0; padding: 0; list-style: none; }
.project-authors { gap: .24rem 1.05rem; font-size: clamp(1rem, 1.45vw, 1.125rem); font-weight: 600; line-height: 1.45; }
.project-authors li { white-space: nowrap; }
.project-byline sup { font-size: .7em; line-height: 0; }
.project-authors sup { margin-inline-start: .12em; }
.project-affiliations { gap: .18rem .95rem; margin-top: .45rem; font-size: .9375rem; line-height: 1.45; }
.project-affiliations li { max-width: 100%; }
.project-author-note { margin-top: .35rem; font-size: .875rem; font-weight: 550; }
.opening-lead { max-width: 68ch; margin: .8rem auto 0; font-size: clamp(1rem, 1.45vw, 1.125rem); line-height: 1.6; text-wrap: balance; }
.opening-actions, .opening-resources { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; }
.opening-actions { gap: .48rem .8rem; margin-top: 1.05rem; }
.opening-primary {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: .42rem .87rem;
  border: 1px solid var(--ink);
  border-radius: 5px;
  color: var(--paper);
  background: var(--ink);
  font-size: .9375rem;
  font-weight: 600;
}
.opening-primary:hover { color: var(--ink); background: var(--paper); text-decoration: none; }
.opening-resources { gap: .36rem; }
.opening-resources :is(button, a) { min-height: 38px; padding: .3rem .67rem; border: 1px dashed var(--control-border); border-radius: 5px; background: var(--paper); font-size: .875rem; font-weight: 550; }
.opening-resources a { display: inline-flex; align-items: center; border: 2px solid var(--ink); }

.opening-overview { margin-top: clamp(1.35rem, 2.55vw, 2.1rem); padding-top: .84rem; border-top: 1px solid var(--line); }
.opening-overview-heading {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  align-items: center;
  gap: .55rem;
  margin-bottom: 1rem;
  text-align: center;
}
.opening-overview-heading > div { grid-area: 1 / 2; }
.opening-playback {
  display: grid;
  grid-area: 1 / 3;
  justify-self: end;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
}
.opening-playback:hover { color: var(--paper); background: var(--ink); }
.opening-playback::before {
  width: 10px;
  height: 12px;
  background: linear-gradient(to right, currentColor 0 33%, transparent 33% 67%, currentColor 67%);
  content: "";
}
.opening-playback[data-paused="true"]::before { background: currentColor; clip-path: polygon(0 0, 100% 50%, 0 100%); }
.opening-scenes {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(.38rem, 1vw, .75rem);
  margin: 0;
  padding: 0;
  list-style: none;
}
.opening-scene { min-width: 0; text-align: center; }
.opening-scene-image { display: none; overflow: hidden; aspect-ratio: 1; background: var(--paper); }
.opening-scene-image :is(img, video) { width: 408.035714%; max-width: none; transform: translateX(var(--scene-offset, 0%)); }
.scene-pushobj { --scene-offset: -25.164114%; }
.scene-rope { --scene-offset: -50.328228%; }
.scene-granular { --scene-offset: -75.492342%; }
.opening-scene > span { display: block; margin-top: .42rem; font-size: .9375rem; font-weight: 600; }

.animation-tools { margin: .65rem auto 0; text-align: center; }
.animation-tools button {
  min-height: 2.25rem;
  padding: .28rem .65rem;
  border: 1px solid var(--ink);
  border-radius: 4px;
  background: var(--paper);
  font-size: .9375rem;
  font-weight: 550;
}
.animation-tools button:hover { color: var(--paper); background: var(--ink); }

h2 { font-size: clamp(2.25rem, 4vw, 3.5rem); }
h3 { margin-top: 2.1rem; font-size: clamp(1.5rem, 3vw, 2rem); }
h4 { font-size: 1.3rem; }
.abstract h2, .reading h2, .reading h3 { text-align: center; }
.abstract p, .paper-section p { text-align: justify; hyphens: auto; }
.reading p { margin-top: .9rem; }
.abstract { max-width: 780px; margin-top: 88px; }
.abstract p { margin-top: 1.15rem; color: var(--ink); font-size: clamp(1.07rem, 1.7vw, 1.45rem); line-height: 1.6; letter-spacing: -.025em; }
.highlight-band { padding: 56px 0 85px; }
.highlights { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 1000px; container: highlights / inline-size; }
.highlights:not([hidden]) + .highlights:not([hidden]) { margin-top: 2rem; }
.highlight-planner { grid-column: 1 / -1; margin-bottom: .9rem; text-align: center; font-size: 1.0625rem; font-weight: 650; }
.highlight { display: flex; flex-direction: column; align-items: center; padding: .65rem clamp(1.125rem, 2vw, 1.75rem); text-align: center; }
.highlight + .highlight { border-inline-start: 1px solid var(--line); }
.highlight-label { font-size: 1.0625rem; font-weight: 650; line-height: 1.35; text-wrap: balance; }
.highlight-description { display: grid; justify-items: center; font-size: .9375rem; line-height: 1.4; white-space: nowrap; }
.highlight-separator { display: none; }
@container highlights (width >= 62rem) or (20rem <= width <= 25rem) {
  .highlight-description { grid-auto-flow: column; column-gap: .3em; }
  .highlight-separator { display: block; }
}
.highlight-values {
  display: flex;
  align-items: baseline;
  gap: .2em;
  margin: .35rem 0 .5rem;
  color: #b74738;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -.045em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.highlight-before { color: var(--ink); font-weight: 550; }
.highlight-arrow { font-size: .75em; font-weight: 500; }
.highlight:hover { text-decoration: none; }
.highlight:hover .highlight-label { text-decoration: underline; }

.paper-section { padding-block: clamp(58px, 8vw, 110px); }
.section-heading { max-width: 860px; margin: 0 auto 52px; text-align: center; }
.section-heading p { max-width: 690px; margin: 19px auto 0; font-size: 1.125rem; }
.gallery-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  grid-template-areas: "media choices";
  gap: 38px;
  align-items: start;
  max-width: 1150px;
  margin-inline: auto;
}
.gallery-stage:has(.rollout-filter[hidden]) { display: block; }
.rollout-filter {
  grid-area: choices;
  min-inline-size: 0;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-top: 1px solid var(--line);
}
.rollout-filter label { display: block; border-bottom: 1px solid var(--line); }
.rollout-filter label > span { display: flex; align-items: center; gap: .75rem; min-height: 49px; padding: .6rem .85rem; border-inline-start: 3px solid transparent; font-size: .9375rem; font-weight: 550; cursor: pointer; }
.rollout-filter label > span:hover { text-decoration: underline; }
.rollout-filter input:checked + span { color: var(--paper); border-color: var(--ink); background: var(--ink); font-weight: 650; }
.rollout-filter input:focus-visible + span { outline: 3px solid var(--ink); outline-offset: -4px; }
.rollout-filter input:checked:focus-visible + span { outline-color: var(--paper); }
.task-thumb { flex: 0 0 42px; aspect-ratio: 1; background: url("./assets/teaser-4k.webp") no-repeat var(--task-offset, 0%) center / 408.035714% 100%; }
.thumb-pushobj { --task-offset: 33.3333%; }
.thumb-rope { --task-offset: 66.6667%; }
.thumb-granular { --task-offset: 100%; }
.rollouts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.15rem 1.65rem; margin: 1.5rem auto 0; }
.rollouts[data-rollout-set] { grid-area: media; width: 100%; margin: 0; }
.rollouts[data-carousel] {
  display: flex;
  position: relative;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  block-size: var(--rollout-frame-size, auto);
  overflow-x: hidden;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scrollbar-gutter: stable both-edges;
  scrollbar-width: thin;
}
.rollouts[data-carousel] > figure {
  position: relative;
  flex: 0 0 var(--rollout-frame-size, auto);
  min-block-size: 0;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}
.rollout-controls, .rollout-paging { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .5rem; }
.rollouts figure { min-width: 0; }
.rollouts h3 { margin: 0; font-size: 1.5rem; text-align: center; }
.rollout-labels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.16%; margin: .55rem 0 .4rem; font-size: .875rem; font-weight: 600; line-height: 1.25; text-align: center; }
.comparison-summary { max-width: 1150px; margin: 2.35rem auto 0; border-block: 1px solid var(--line); }
.comparison-summary summary { display: flex; align-items: center; justify-content: space-between; gap: .85rem; padding-block: .85rem; font-size: 1rem; font-weight: 600; cursor: pointer; list-style: none; }
.comparison-summary summary:hover { text-decoration: underline; }
.comparison-summary summary::-webkit-details-marker { display: none; }
.summary-icon::before { content: "+"; font-size: 1.3rem; font-weight: 400; line-height: 1; }
.comparison-summary[open] .summary-icon::before { content: "−"; }
.summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.65rem 1.5rem; padding-block: 1.4rem; }
.summary-grid figure { min-width: 0; }
.summary-grid figcaption { font-weight: 650; text-align: center; }
.summary-case p { margin: .48rem 0 .28rem; font-size: .9375rem; font-weight: 550; }
.summary-grid img + img { margin-top: .72rem; }

.method-band { padding-block-start: clamp(3rem, 6vw, 5rem); }
.method-band h2 { text-align: center; }
.method-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1.05rem, 3vw, 2.3rem); margin: 3.25rem 0 0; padding: 0; list-style: none; }
.method-steps li { min-width: 0; border-top: 1px solid var(--line); padding-top: 1.25rem; }
.method-steps h3 { margin: 0; font-size: 1.5rem; }
.method-steps p { margin-top: .7rem; }
#method-animation { max-width: 1020px; margin-top: 2.5rem; }
#method-animation .method-animation-header { margin: 0 0 .8rem; gap: .5rem .85rem; }
.method-animation-header strong { font-size: 1.125rem; }
.method-player { position: relative; }
.animation-timeline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: .6rem;
  width: min(100%, 42rem);
  margin: .35rem auto 0;
  color: #565656;
  font-size: .8125rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.animation-timeline input {
  width: 100%;
  height: 32px;
  margin: 0;
  accent-color: #767676;
  cursor: pointer;
  touch-action: pan-y;
}
.animation-timeline span { min-width: 10ch; text-align: right; white-space: nowrap; }
@media (hover: hover) and (pointer: fine) {
  .animation-timeline {
    position: absolute;
    inset: auto 0 clamp(.35rem, 1.2vw, .85rem);
    z-index: 1;
    width: min(100% - 1rem, 42rem);
    margin: 0 auto;
    padding-inline: .55rem;
    border-radius: .5rem;
    background: rgb(255 255 255 / 84%);
    opacity: 0;
    pointer-events: none;
  }
  .method-player:hover .animation-timeline,
  .animation-timeline:has(input:is(:focus-visible, :active)) {
    opacity: 1;
    pointer-events: auto;
  }
}
.method-equations { margin-top: 3rem; }
.method-equations p { color: var(--ink); }
.equation-math { overflow-x: auto; overflow-y: hidden; margin-block: 1em; padding-block: .2em; }
.equation-math math { min-width: max-content; margin-inline: auto; }
.paper-figure { max-width: 56rem; margin: 1.65rem auto 0; }
.paper-overview { max-width: 1020px; margin-top: clamp(1.4rem, 2.65vw, 2.25rem); }
.narrow-figure { max-width: 37rem; }
.paper-figure figcaption, .rollouts figcaption { margin-top: .68rem; font-size: .9375rem; font-weight: 500; line-height: 1.55; }
.paper-figure figcaption { text-align: center; }
.mixed-task-gallery { max-width: 68rem; margin-top: 2rem; }
.mixed-task-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem 2rem; }
.mixed-task-grid h4 { margin-bottom: .65rem; text-align: center; }
.mixed-task-labels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .3rem; margin-top: .4rem; text-align: center; font-size: .875rem; font-weight: 600; line-height: 1.3; }
.mixed-task-gallery figcaption { max-width: 44rem; margin: 1rem auto 0; }
.figure-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .25rem .8rem; font-size: .9375rem; }
.figure-tools a { padding: .15rem .25rem; text-decoration: underline; }
.results-table { margin-top: 1.65rem; }
.results-table figcaption { margin-bottom: .75rem; font-size: .9375rem; }
.table-wrap { overflow-x: auto; overscroll-behavior-inline: contain; }
.results-table table { width: 100%; border-collapse: collapse; background: var(--paper); font-size: .875rem; line-height: 1.5; font-variant-numeric: tabular-nums; }
.results-table th, .results-table td { padding: .5em .75em; border: 1px solid var(--line); text-align: center; vertical-align: middle; white-space: nowrap; }
.results-table th[scope="row"], .results-table thead tr:first-child th:first-child { text-align: left; }
.results-table tbody th { font-weight: inherit; }
.cem-table { min-width: 48rem; }
.results-table .paper-result-highlight { border-top: 2px solid var(--ink); font-weight: 700; }
.reading .table-note { margin-top: .75rem; font-size: .9375rem; }
#bibtex { padding-block: .8rem; }
.citation-panel { position: relative; max-width: 760px; }
.citation-details summary {
  width: fit-content;
  padding: .45rem .25rem;
  font-weight: 650;
  cursor: pointer;
}
.citation-details h2 { display: inline; font-size: 1.05rem; letter-spacing: -.015em; }
.citation-copy {
  position: absolute;
  inset-block-start: 0;
  inset-inline-end: 0;
  min-height: 2.1rem;
  padding: .2rem .7rem;
  border: 1px solid var(--control-border);
  border-radius: 5px;
  background: var(--paper);
  font-size: .875rem;
  font-weight: 600;
}
.citation-copy:hover { color: var(--paper); background: var(--ink); }
.bibtex-entry {
  margin: .5rem 0 0;
  padding: .65rem .75rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7f7f7;
  font: .8125rem/1.45 ui-monospace, Consolas, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.bibtex-entry code { font: inherit; }
.site-footer { padding: 1.45rem 0; color: var(--paper); text-align: center; background: var(--ink); }
.site-footer a { color: inherit; font-size: .9375rem; font-weight: 550; }
.site-footer :focus-visible { outline-color: var(--paper); }

@media (max-width: 1100px) {
  .shell { width: calc(100% - 72px); }
  .gallery-stage { grid-template-columns: minmax(0, 1fr) 210px; gap: 25px; }
}

@media (max-width: 800px) {
  html { scroll-padding-top: 77px; }
  .gallery-stage { grid-template-columns: minmax(0, 1fr); grid-template-areas: "choices" "media"; gap: 1.3rem; }
  .rollout-filter { display: flex; flex-wrap: wrap; width: auto; }
  .rollout-filter label { flex: 1 0 auto; text-align: center; }
  .rollout-filter label > span { justify-content: center; min-height: 0; border-inline-start: 0; border-block-end: 3px solid transparent; padding: .62rem .6rem; }
  .task-thumb { display: none; }
  .method-steps { grid-template-columns: minmax(0, 1fr); margin-top: 2rem; }
  .abstract { margin-top: 62px; }
  .highlight-band { padding: 40px 0 58px; }
  .highlights { grid-template-columns: minmax(0, 1fr); max-width: 25rem; }
  .highlight { padding-block: 1rem; }
  .highlight + .highlight { border-inline-start: 0; border-block-start: 1px solid var(--line); }
  .highlight-values { font-size: clamp(1.625rem, 7.2vw, 2.05rem); }
  .section-heading { margin-bottom: 36px; }
  .section-heading p { font-size: 1rem; }
}

@media (max-width: 720px) {
  .mixed-task-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 600px) {
  .shell { width: calc(100% - 40px); }
  .opening-nav-inner { min-height: 58px; }
  .opening-nav-links { display: none; }
  .opening-menu { display: block; }
  .project { padding-block: 2.1rem 2.35rem; }
  .opening-strip { display: none; }
  .opening-scene-image { display: block; }
  .opening-scenes { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem .58rem; }
  .rollouts { grid-template-columns: minmax(0, 1fr); }
  .summary-grid { grid-template-columns: minmax(0, 1fr); }
  .rollout-labels { font-size: .8125rem; }
  .rollout-filter label > span { font-size: .875rem; }
  .equation-math { font-size: .91em; }
}

@media screen and (prefers-reduced-motion: no-preference) {
  .animation-timeline { transition: opacity .18s ease; }
  [data-scroll-reveal] { transform-origin: 50% 80%; }
  [data-scroll-reveal="pending"] {
    opacity: 0;
    transform: perspective(1150px) translate3d(0, 32px, -30px) rotateX(6deg) scale(.987);
  }
  [data-scroll-reveal="revealed"] {
    transition: opacity .72s ease-out, transform .88s cubic-bezier(.22, .65, .28, 1);
  }
}

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