:root {
  --bg: #f7f7f4;
  --paper: #ffffff;
  --ink: #151515;
  --muted: #666a70;
  --line: #d7d8d2;
  --accent: #006b5f;
  --accent-dark: #08463f;
  --warm: #b45f32;
  --header-bg: rgba(247, 247, 244, 0.92);
  --panel-bg: #fbfbf9;
  --viewer-bg: #d5d5cf;
  --viewer-glow: rgba(255, 255, 255, 0.12);
  --action-bg: #f4f4ef;
  --action-glow: rgba(180, 95, 50, 0.11);
  --video-bg: #111;
  --shadow: 0 18px 45px rgba(20, 20, 18, 0.08);
}

[data-theme="dark"] {
  --bg: #050505;
  --paper: #111111;
  --ink: #f1f1ed;
  --muted: #a2a29a;
  --line: #2b2b2b;
  --accent: #4fb5a7;
  --accent-dark: #8ad5ca;
  --warm: #d19065;
  --header-bg: rgba(5, 5, 5, 0.9);
  --panel-bg: #151515;
  --viewer-bg: #161616;
  --viewer-glow: rgba(255, 255, 255, 0.06);
  --action-bg: #121212;
  --action-glow: rgba(79, 181, 167, 0.08);
  --video-bg: #000;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

a {
  color: inherit;
}

img,
video {
  display: block;
  width: 100%;
  height: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  background: var(--header-bg);
  backdrop-filter: blur(12px);
}

.nav {
  max-width: 1480px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  font-weight: 720;
  text-decoration: none;
  letter-spacing: 0;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  color: var(--muted);
  font-size: 14px;
}

.nav-links a {
  text-decoration: none;
}

.nav-links a:hover,
.theme-toggle:hover {
  color: var(--ink);
}

.theme-toggle {
  appearance: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}

.hero,
.section {
  max-width: 1480px;
  margin: 0 auto;
  padding: 64px 24px;
}

.hero {
  padding-top: 54px;
}

.hero-copy {
  max-width: 1180px;
  margin: 0 auto 34px;
  text-align: center;
}

.venue {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 720;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.12;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(32px, 4.8vw, 58px);
  font-weight: 780;
}

.hero-title {
  max-width: 1120px;
  margin: 0 auto;
}

.hero-title .title-line {
  display: block;
  white-space: nowrap;
}

h2 {
  font-size: clamp(28px, 3.6vw, 44px);
  font-weight: 760;
}

h3 {
  font-size: 18px;
  font-weight: 700;
}

.subtitle {
  max-width: 820px;
  margin: 22px auto 0;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 22px);
}

.author-block {
  max-width: 980px;
  margin: 28px auto 0;
  text-align: center;
}

.author-list,
.affiliations {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  column-gap: 34px;
  row-gap: 12px;
}

.author {
  color: var(--ink);
  font-size: clamp(18px, 2.2vw, 28px);
  font-weight: 740;
  line-height: 1.15;
  text-decoration: none;
  white-space: nowrap;
}

a.author:hover {
  color: var(--accent-dark);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.author sup,
.affiliations sup,
.author-note sup {
  font-size: 0.58em;
  line-height: 0;
  vertical-align: super;
}

.affiliations {
  margin-top: 20px;
  column-gap: 38px;
  color: var(--ink);
  font-size: clamp(15px, 1.7vw, 22px);
  font-weight: 680;
  line-height: 1.25;
}

.author-note {
  margin: 12px auto 0;
  color: var(--muted);
  font-size: clamp(13px, 1.2vw, 16px);
  font-weight: 560;
}

.link-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
}

.badge-link {
  display: inline-flex;
  align-items: center;
  line-height: 0;
}

.badge-link img {
  height: 24px;
  width: auto;
}

.badge-disabled {
  opacity: 0.92;
}

.pill {
  min-width: 118px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  text-decoration: none;
  font-weight: 680;
  box-shadow: 0 8px 20px rgba(20, 20, 18, 0.04);
}

.pill svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex: 0 0 auto;
}

.pill:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.disabled-link {
  cursor: default;
  opacity: 0.72;
}

.disabled-link:hover {
  border-color: var(--line);
  color: var(--ink);
}

.hero-media,
.figure-frame,
.video-card {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-media img,
.hero-media video,
.figure-frame img {
  background: #fff;
}

.hero-media {
  max-width: 1360px;
  margin-inline: auto;
}

.hero-media video {
  max-height: min(66vh, 760px);
  object-fit: contain;
  background: #000;
}

.method-image-link {
  display: block;
  padding: clamp(24px, 3.2vw, 48px);
  background: #fff;
  cursor: zoom-in;
}

.method-image {
  width: min(100%, 1320px);
  margin-inline: auto;
}

.figure-frame figcaption {
  padding: 14px 18px 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: var(--panel-bg);
  font-size: 14px;
  line-height: 1.45;
}

.hero-media video {
  aspect-ratio: 2770 / 1440;
  object-fit: contain;
}

.narrow {
  max-width: 920px;
}

.narrow p,
.section > p,
.section-heading p {
  color: var(--muted);
  font-size: 18px;
}

.section-heading {
  margin-bottom: 24px;
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(260px, 1fr);
  gap: 28px;
  align-items: end;
}

.section-heading p {
  margin: 0;
}

.asset-grid {
  display: flex;
  gap: 22px;
  margin-inline: -24px;
  padding: 4px 24px 22px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-color: var(--accent) rgba(0, 0, 0, 0.08);
}

.rollout-grid {
  gap: 0;
  scroll-padding-inline: 24px;
  touch-action: pan-x;
}

.rollout-card {
  flex: 0 0 100%;
  scroll-snap-align: center;
}

.rollout-grid .rollout-card {
  flex-basis: min(920px, calc(100vw - 48px));
}

.rollout-video-block {
  padding: clamp(12px, 2vw, 24px);
  background: var(--video-bg);
}

.rollout-video {
  aspect-ratio: 16 / 9;
  max-height: min(720px, 62vw);
  object-fit: contain;
  background: #000;
}

.rollout-speed {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 12px 0;
  color: var(--muted);
  font-size: 13px;
}

.rollout-speed select {
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 4px 7px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}

.gallery-swipe-hint {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.model-grid {
  display: flex;
  gap: 22px;
  margin-inline: -24px;
  padding: 4px 24px 24px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-color: var(--accent) rgba(0, 0, 0, 0.08);
}

.model-card {
  flex: 0 0 min(920px, calc(100vw - 48px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  overflow: hidden;
  box-shadow: 0 14px 34px rgba(20, 20, 18, 0.06);
  scroll-snap-align: center;
}

.model-card header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-bg);
}

.model-card header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.case-stage {
  position: relative;
  min-height: 420px;
  background: var(--viewer-bg);
}

.mode-tabs {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  display: flex;
  gap: 6px;
  padding: 5px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 24px rgba(20, 20, 18, 0.12);
  backdrop-filter: blur(10px);
}

.mode-button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 8px 12px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.mode-button:hover,
.mode-button.is-active {
  background: var(--ink);
  color: #fff;
}

.mode-panel[hidden] {
  display: none;
}

model-viewer {
  display: block;
  width: 100%;
  height: min(520px, 58vw);
  min-height: 360px;
  cursor: grab;
  touch-action: none;
  background:
    radial-gradient(circle at 50% 18%, var(--viewer-glow), transparent 34%),
    var(--viewer-bg);
}

model-viewer:active {
  cursor: grabbing;
}

.action-panel {
  min-height: min(520px, 58vw);
  padding: 82px 28px 28px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.72fr);
  gap: 24px;
  align-items: center;
  background:
    radial-gradient(circle at 12% 16%, var(--action-glow), transparent 30%),
    var(--action-bg);
}

.action-panel.no-image {
  grid-template-columns: 1fr;
}

.action-label {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 780;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.action-text {
  margin: 0;
  max-width: 620px;
  color: var(--ink);
  font-size: clamp(17px, 2.15vw, 25px);
  font-weight: 720;
  line-height: 1.28;
}

.action-image {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.asset-card {
  flex: 0 0 min(920px, calc(100vw - 48px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  overflow: hidden;
  box-shadow: 0 14px 34px rgba(20, 20, 18, 0.06);
  scroll-snap-align: center;
}

.asset-card header,
.video-card h3 {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-bg);
}

.paired-videos {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
}

.video-block {
  background: var(--paper);
}

.video-label {
  padding: 9px 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 680;
  text-transform: uppercase;
}

video {
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: var(--video-bg);
}

video:not([src]) {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0)),
    #141414;
}

.multimodal-grid,
.comparison-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.multimodal-grid .wide {
  grid-column: 1 / -1;
}

.video-card img {
  max-height: 220px;
  object-fit: contain;
  padding: 16px;
  background: #f2f2ee;
  border-bottom: 1px solid var(--line);
}

.full-demo video {
  aspect-ratio: 16 / 9;
}

.footer {
  border-top: 1px solid var(--line);
  padding: 30px 24px 42px;
  color: var(--muted);
  text-align: center;
}

.footer p {
  margin: 0;
}

@media (max-width: 840px) {
  .nav {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-title .title-line {
    white-space: normal;
  }

  .hero,
  .section {
    padding: 46px 18px;
  }

  .section-heading,
  .multimodal-grid,
  .comparison-grid {
    grid-template-columns: 1fr;
  }

  .method-image-link {
    padding: 18px 12px;
  }

  model-viewer {
    min-height: 320px;
    height: 64vw;
  }

  .asset-grid,
  .model-grid {
    margin-inline: -18px;
    padding-inline: 18px;
  }

  .asset-card,
  .model-card {
    flex-basis: calc(100vw - 36px);
  }

  .mode-tabs {
    left: 12px;
    right: auto;
    max-width: calc(100% - 24px);
    overflow-x: auto;
  }

  .action-panel {
    min-height: 360px;
    padding: 78px 18px 22px;
    grid-template-columns: 1fr;
  }

  .action-text {
    font-size: 18px;
  }

  .paired-videos {
    grid-template-columns: 1fr;
  }
}
