:root {
  color-scheme: light;
  --ink: #101318;
  --muted: #66707d;
  --paper: #f7f8fa;
  --panel: #ffffff;
  --line: rgba(16, 19, 24, 0.12);
  --dark: #080b10;
  --dark-soft: #111720;
  --cyan: #87e6f6;
  --rose: #ffb2c8;
  --shadow: 0 24px 70px rgba(16, 19, 24, 0.16);
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

img,
video,
model-viewer {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 66px;
  padding: 12px clamp(18px, 4vw, 56px);
  color: rgba(255, 255, 255, 0.92);
  transition: background 220ms ease, border-color 220ms ease, color 220ms ease;
}

.site-header.is-light {
  border-bottom: 1px solid rgba(220, 224, 230, 0.78);
  background: rgba(247, 248, 250, 0.84);
  color: var(--ink);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-size: 1.28rem;
  font-weight: 900;
  letter-spacing: 0;
}

.brand-mark {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), var(--rose));
  box-shadow: 0 0 20px rgba(135, 230, 246, 0.9);
}

nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 22px;
  font-size: 0.94rem;
  font-weight: 760;
}

nav a {
  opacity: 0.78;
}

nav a:hover {
  opacity: 1;
}

h1,
h2,
h3,
p,
pre {
  margin-top: 0;
}

.eyebrow {
  margin: 0 0 14px;
  color: #2aa8bb;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.scrub-section {
  position: relative;
  min-height: 260vh;
}

.sticky-scene {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}

.hero {
  background: var(--dark);
  color: white;
}

.hero-scene {
  background: #64676c;
}

.scene-media,
.hero-shade {
  position: absolute;
  inset: 0;
}

.scene-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero .scene-media video {
  object-fit: cover;
}

.hero-shade {
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(5, 8, 12, 0.32), rgba(5, 8, 12, 0.16) 50%, rgba(5, 8, 12, 0.26)),
    linear-gradient(0deg, rgba(5, 8, 12, 0.72), rgba(5, 8, 12, 0.2) 48%, rgba(5, 8, 12, 0.42));
  opacity: var(--hero-shade, 1);
  pointer-events: none;
}

.hero-shade.softer {
  background:
    linear-gradient(90deg, rgba(5, 8, 12, 0.72), rgba(5, 8, 12, 0.24) 62%),
    linear-gradient(0deg, rgba(5, 8, 12, 0.68), rgba(5, 8, 12, 0.08) 55%, rgba(5, 8, 12, 0.38));
}

.hero-content {
  position: relative;
  z-index: 3;
  display: grid;
  align-content: center;
  width: min(1500px, calc(100% - 40px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 94px 0 112px;
  text-align: center;
  transform: translateY(var(--title-y, 0));
  opacity: var(--title-opacity, 1);
}

h1 {
  margin-bottom: 18px;
  font-size: clamp(4rem, 8.2vw, 7.6rem);
  line-height: 0.9;
  letter-spacing: 0;
}

.subtitle {
  margin: 0 auto 20px;
  color: rgba(255, 255, 255, 0.94);
  font-size: clamp(1.6rem, 3.2vw, 3.9rem);
  font-weight: 520;
  line-height: 1.16;
  letter-spacing: 0;
  white-space: nowrap;
}

.subtitle span {
  position: relative;
  display: inline-block;
  padding-bottom: 0.06em;
  background: linear-gradient(90deg, #ffffff 0 34%, var(--cyan) 45%, var(--rose) 55%, #ffffff 66% 100%);
  background-size: 320% 100%;
  color: transparent;
  font-weight: 520;
  line-height: 1.12;
  -webkit-background-clip: text;
  background-clip: text;
  animation: bridgeTextSweep 2.8s linear infinite;
}

.subtitle span::after {
  display: none;
}

@keyframes bridgeTextSweep {
  0% {
    background-position: 138% 50%;
  }
  48% {
    background-position: 50% 50%;
  }
  100% {
    background-position: -38% 50%;
  }
}

.authors {
  max-width: none;
  margin: 0 auto 8px;
  color: rgba(255, 255, 255, 0.86);
  font-size: clamp(0.9rem, 1.05vw, 1.14rem);
  font-weight: 620;
  line-height: 1.55;
  white-space: nowrap;
}

.authors a {
  border-bottom: 1px solid rgba(255, 255, 255, 0.28);
}

.authors a:hover {
  border-bottom-color: white;
  color: white;
}

.authors sup,
.affiliations sup {
  font-size: 0.65em;
  line-height: 0;
}

.affiliations {
  margin: 0 auto 28px;
  color: rgba(255, 255, 255, 0.74);
  font-size: clamp(0.9rem, 1.05vw, 1.14rem);
  font-weight: 650;
}

.affiliations span {
  display: inline-block;
  width: 20px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.resource-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 112px;
  min-height: 46px;
  gap: 9px;
  padding: 10px 18px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.13);
  color: white;
  font-size: 0.95rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 12px 34px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(18px) saturate(130%);
}

.resource-button:hover {
  border-color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.2);
}

.resource-button img {
  width: 20px;
  height: 20px;
  filter: invert(1);
  opacity: 0.95;
}

.scroll-cue {
  position: absolute;
  right: clamp(18px, 4vw, 56px);
  bottom: 32px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.82rem;
  font-weight: 760;
  opacity: var(--cue-opacity, 1);
}

.scroll-cue span {
  display: block;
  width: 36px;
  height: 1px;
  background: currentColor;
}

.dual-intro {
  position: relative;
  z-index: 5;
  padding: clamp(74px, 10vw, 150px) clamp(20px, 5vw, 74px);
  background: linear-gradient(180deg, #eef3f6 0%, #f8f8fa 100%);
}

.dual-line {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(20px, 5vw, 86px);
  width: min(1320px, 100%);
  margin: 0 auto;
}

.dual-line h2 {
  margin: 0;
  padding-top: 18px;
  border-top: 2px solid rgba(16, 19, 24, 0.16);
  font-size: clamp(2rem, 3.45vw, 4.25rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.accent-manipulation {
  color: #008ca3;
}

.accent-locomotion {
  color: #bd456d;
}

.morphology {
  position: relative;
  z-index: 6;
  background: linear-gradient(180deg, #10151d 0%, #111720 76%, #ffffff 100%);
  color: white;
}

.morph-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.62fr);
  gap: clamp(26px, 5vw, 84px);
  width: min(1460px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(54px, 8vw, 100px) 0 clamp(84px, 12vw, 150px);
}

.morph-viewport {
  position: sticky;
  top: 82px;
  height: calc(100vh - 116px);
  min-height: 540px;
}

.model-shell {
  position: relative;
  height: 100%;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  background:
    radial-gradient(circle at var(--light-x, 35%) 28%, rgba(135, 230, 246, 0.26), transparent 32%),
    radial-gradient(circle at 78% 70%, rgba(255, 178, 200, 0.16), transparent 30%),
    linear-gradient(145deg, #222c3a, #0b0f15 64%);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.38);
}

.model-viewer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  --poster-color: transparent;
  transition: opacity 180ms ease, transform 180ms ease, filter 180ms ease;
}

.model-dex {
  z-index: var(--dex-z, 20);
  opacity: calc(1 - var(--morph-progress, 0));
  pointer-events: var(--dex-pointer, auto);
  transform: translateX(calc(var(--morph-progress, 0) * -8%)) scale(calc(1 - var(--morph-progress, 0) * 0.05));
}

.model-humanoid {
  z-index: var(--humanoid-z, 10);
  opacity: var(--morph-progress, 0);
  pointer-events: var(--humanoid-pointer, none);
  transform: translateX(calc((1 - var(--morph-progress, 0)) * 8%)) scale(calc(0.95 + var(--morph-progress, 0) * 0.05));
}

.model-grid {
  position: absolute;
  inset: auto 0 0;
  z-index: 30;
  height: 38%;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(transparent, black);
  pointer-events: none;
}

.mode-meter {
  position: absolute;
  right: 18px;
  bottom: 18px;
  left: 18px;
  z-index: 35;
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr) auto;
  gap: 12px;
  align-items: center;
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.78rem;
  font-weight: 850;
  pointer-events: none;
}

.mode-meter div {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

.mode-meter i {
  display: block;
  width: calc(var(--morph-progress, 0) * 100%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--rose));
}

.morph-copy {
  display: grid;
  gap: 18vh;
  padding: 18vh 0;
}

.morph-card {
  min-height: 46vh;
  padding: 28px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.morph-card span {
  color: var(--rose);
  font-size: 0.78rem;
  font-weight: 900;
}

.morph-card h2 {
  margin: 14px 0 16px;
  font-size: clamp(2rem, 3.35vw, 3.8rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.morph-card p {
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.74);
  font-size: clamp(1rem, 1.34vw, 1.2rem);
}

.design {
  z-index: 7;
  min-height: 340vh;
  background: #ffffff;
}

.design-scene {
  background: #ffffff;
}

.scene-media.clean {
  inset: 0;
  background: #ffffff;
}

.scene-media.clean video {
  object-fit: contain;
  transform: scale(0.64);
}

.design-title,
.demo-title {
  position: absolute;
  top: clamp(54px, 5vw, 72px);
  bottom: auto;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  width: min(1260px, calc(100% - 40px));
  margin: 0 auto;
  padding: 0;
}

.design-title h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(3rem, 7.2vw, 7.2rem);
  line-height: 0.86;
  letter-spacing: 0;
}

.design-title p {
  margin: 30px 0 0;
  color: #2f3845;
  font-size: clamp(1.3rem, 2.2vw, 2.5rem);
  font-weight: 620;
  line-height: 1.05;
}

.design-title span {
  display: inline-block;
  margin-top: 16px;
  color: #65707d;
  font-size: clamp(0.95rem, 1.35vw, 1.25rem);
  font-weight: 780;
  letter-spacing: 0.04em;
}

.demo-title h2 {
  max-width: 720px;
  margin: 0;
  color: var(--ink);
  font-size: clamp(2rem, 4vw, 4.3rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.design-details {
  position: relative;
  z-index: 8;
  display: grid;
  gap: clamp(34px, 5vw, 72px);
  padding: clamp(70px, 9vw, 132px) 0;
  background: #eef3f6;
}

.detail-panel {
  width: min(1420px, calc(100% - 40px));
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 16px 50px rgba(16, 19, 24, 0.08);
}

.detail-copy {
  padding: 26px 30px 12px;
}

.detail-copy h2 {
  margin-bottom: 8px;
  font-size: clamp(1.8rem, 3vw, 3.4rem);
  line-height: 1;
}

.detail-copy p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

.detail-panel img {
  width: 100%;
  background: white;
}

.demos-heading {
  position: relative;
  z-index: 9;
  min-height: auto;
  padding: clamp(74px, 10vw, 142px) 0 clamp(26px, 4vw, 52px);
  background: var(--paper);
  color: var(--ink);
}

.demos-heading .demo-title {
  position: static;
  width: min(1260px, calc(100% - 40px));
  transform: none;
}

.demos-heading .demo-title h2 {
  max-width: none;
  color: var(--ink);
  font-size: clamp(3rem, 8.4vw, 8.4rem);
  line-height: 0.86;
}

.demos-heading .demo-title p {
  margin: 22px 0 0;
  color: #2f3845;
  font-size: clamp(1.25rem, 2.3vw, 2.6rem);
  font-weight: 560;
  line-height: 1.08;
}

.demo-focus {
  position: relative;
  z-index: 10;
  width: min(1320px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(36px, 5vw, 70px) 0 clamp(28px, 4vw, 54px);
  background: var(--paper);
}

.demo-focus video {
  width: 100%;
  overflow: hidden;
  border-radius: 8px;
  background: #0d1118;
  box-shadow: var(--shadow);
}

.demo-focus div {
  padding: 24px 4px 0;
}

.demo-focus h2 {
  margin: 0;
  font-size: clamp(1.8rem, 3.5vw, 4rem);
  line-height: 1;
}

.dp-focus {
  padding-top: clamp(58px, 7vw, 104px);
}

.demo-carousel {
  position: relative;
  z-index: 10;
  overflow: hidden;
  padding: clamp(56px, 8vw, 104px) 0 clamp(76px, 9vw, 132px);
  background: var(--paper);
}

.carousel-track {
  display: flex;
  width: max-content;
  gap: 18px;
  padding: 0 20px;
  animation: demoMarquee 72s linear infinite;
}

.carousel-track:hover {
  animation-play-state: paused;
}

@keyframes demoMarquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(calc(-50% - 9px));
  }
}

.portrait-demo {
  position: relative;
  flex: 0 0 clamp(210px, 18vw, 280px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 14px 42px rgba(16, 19, 24, 0.08);
}

.portrait-demo video {
  width: 100%;
  aspect-ratio: 9 / 16;
  background: #111720;
  object-fit: cover;
}

.portrait-demo h3 {
  min-height: 58px;
  margin: 0;
  padding: 14px 14px 12px;
  font-size: 1rem;
  line-height: 1.18;
}

.portrait-demo p {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  margin: 0;
  padding: 14px;
  background: rgba(10, 13, 18, 0.82);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.85rem;
  line-height: 1.38;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
  backdrop-filter: blur(12px);
}

.portrait-demo:hover p {
  opacity: 1;
  transform: translateY(0);
}

.abstract,
.bibtex {
  position: relative;
  z-index: 10;
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(70px, 9vw, 132px) 0;
  background: white;
}

.abstract {
  width: 100%;
}

.abstract h2,
.abstract p {
  width: min(var(--max), calc(100% - 40px));
  margin-right: auto;
  margin-left: auto;
}

.abstract h2 {
  margin-bottom: 22px;
  font-size: clamp(2rem, 4vw, 3.8rem);
  line-height: 1;
}

.abstract p {
  margin-bottom: 0;
  color: #2b313a;
  font-size: clamp(1.08rem, 1.55vw, 1.32rem);
  line-height: 1.72;
  text-align: justify;
}

.bibtex {
  background: var(--paper);
}

.bibtex .section-heading h2 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3.8rem);
  line-height: 1;
}

.bibtex pre {
  overflow-x: auto;
  margin-bottom: 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101318;
  color: #e8edf5;
  font-size: 0.95rem;
  line-height: 1.55;
}

@media (max-width: 1040px) {
  .subtitle,
  .authors {
    white-space: normal;
  }

  .dual-line,
  .morph-stage {
    grid-template-columns: 1fr;
  }

  .morph-viewport {
    position: relative;
    top: auto;
    height: 68vh;
    min-height: 430px;
  }

  .morph-copy {
    gap: 20px;
    padding: 0 0 24px;
  }

  .morph-card {
    min-height: 0;
  }
}

@media (max-width: 720px) {
  .site-header {
    position: absolute;
  }

  nav {
    display: none;
  }

  .hero-content {
    width: min(100% - 28px, 1500px);
    text-align: left;
  }

  h1 {
    font-size: clamp(3.55rem, 17vw, 5.2rem);
  }

  .subtitle {
    font-size: clamp(1.75rem, 8vw, 3rem);
    line-height: 1.03;
    white-space: normal;
  }

  .hero-actions {
    justify-content: flex-start;
  }

  .resource-button {
    min-width: calc(50% - 6px);
  }

  .scroll-cue {
    right: 14px;
    left: 14px;
  }

  .dual-line h2,
  .design-title h2,
  .demos-heading .demo-title h2 {
    font-size: clamp(2rem, 10vw, 3.2rem);
  }

  .design-title,
  .demos-heading .demo-title {
    width: min(100% - 28px, 1260px);
  }

  .portrait-demo {
    flex-basis: 220px;
  }
}
