/* ------------------------------------------------------------------ tokens */
:root {
  color-scheme: light;
  --bg: #f7f8f6;
  --bg-tint: #eef1ee;
  --surface: #ffffff;
  --surface-2: #f2f4f2;
  --ink: #0f1a1c;
  --ink-2: #43504f;
  --ink-3: #75817f;
  --line: #dfe4e1;
  --line-2: #c9d0cc;
  --accent: #0f8b7e;
  --accent-ink: #0b6f65;
  --accent-soft: #dcf1ec;
  --accent-2: #6b4ce6;
  --grid: rgba(15, 26, 28, .055);
  --force: #2a78d6;
  --velocity: #c99a06;
  --baseline: #75817f;
  --imitation: #16a06d;
  --fig-bg: #ffffff;
  --l-ped: #d9701c;
  --l-env: #17a05d;
  --l-robot: #2a78d6;
  --shadow: 0 1px 2px rgba(15, 26, 28, .05), 0 16px 40px -12px rgba(15, 26, 28, .14);
  --radius: 14px;
  --display: "Space Grotesk", system-ui, sans-serif;
  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b1213;
    --bg-tint: #101a1b;
    --surface: #142022;
    --surface-2: #1a2729;
    --ink: #eaf2f0;
    --ink-2: #aebcb9;
    --ink-3: #7f8e8b;
    --line: #233335;
    --line-2: #314446;
    --accent: #2dd4bf;
    --accent-ink: #5ee3d1;
    --accent-soft: #123532;
    --accent-2: #a18bff;
    --grid: rgba(234, 242, 240, .05);
    --force: #4b93ea;
    --velocity: #e2b520;
    --baseline: #9aa7a4;
    --imitation: #2fc386;
    --fig-bg: #f3f5f3;
    --l-ped: #f0934a;
    --l-env: #34c47e;
    --l-robot: #5aa0f0;
    --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 16px 40px -12px rgba(0, 0, 0, .6);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1213;
  --bg-tint: #101a1b;
  --surface: #142022;
  --surface-2: #1a2729;
  --ink: #eaf2f0;
  --ink-2: #aebcb9;
  --ink-3: #7f8e8b;
  --line: #233335;
  --line-2: #314446;
  --accent: #2dd4bf;
  --accent-ink: #5ee3d1;
  --accent-soft: #123532;
  --accent-2: #a18bff;
  --grid: rgba(234, 242, 240, .05);
  --force: #4b93ea;
  --velocity: #e2b520;
  --baseline: #9aa7a4;
  --imitation: #2fc386;
  --fig-bg: #f3f5f3;
  --l-ped: #f0934a;
  --l-env: #34c47e;
  --l-robot: #5aa0f0;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 16px 40px -12px rgba(0, 0, 0, .6);
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, video, svg { display: block; max-width: 100%; }
a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
h1, h2, h3, h4 { margin: 0; font-family: var(--display); line-height: 1.12; letter-spacing: -0.02em; }
h2 { font-size: clamp(28px, 3.4vw, 40px); font-weight: 700; }
h3 { font-size: 19px; font-weight: 600; }
p { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: 820px; }
@media (max-width: 600px) { .wrap { padding: 0 16px; } }

.section { padding: 96px 0; border-top: 1px solid var(--line); }
.section-tint { background: var(--bg-tint); }
@media (max-width: 700px) { .section { padding: 64px 0; } }

/* Numbered two-column section header: index + title on the left, intro on the right. */
.section-head {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 20px 64px;
  align-items: start;
  margin-bottom: 48px;
}
.section-head .num {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 12px;
  font-family: var(--mono); font-size: 13px; font-weight: 500;
  color: var(--accent-ink);
  letter-spacing: .04em;
}
.section-head .num::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
.section-head h2 { text-wrap: balance; }
.section-intro { font-size: 17px; color: var(--ink-2); line-height: 1.7; }
.section-head.stacked { grid-template-columns: 1fr; gap: 18px; }
.section-head.stacked h2 { max-width: 900px; }
.section-head.stacked .section-intro { max-width: 780px; }
.section-head.full h2 { max-width: none; }
@media (max-width: 860px) {
  .section-head { grid-template-columns: 1fr; }
}
.hl { color: var(--accent-ink); }
.mt-lg { margin-top: 40px; }

/* ------------------------------------------------------------------ nav */
.topnav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.5) blur(14px);
  -webkit-backdrop-filter: saturate(1.5) blur(14px);
  border-bottom: 1px solid var(--line);
  transition: background .25s, border-color .25s;
}
/* over the hero video: transparent with light text */
.topnav.on-hero { background: transparent; border-bottom-color: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
.topnav.on-hero .brand, .topnav.on-hero .navlinks a { color: rgba(255, 255, 255, .88); }
.topnav.on-hero .navlinks a:hover { color: #fff; }
.topnav.on-hero .theme-toggle { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .25); color: #fff; }
.topnav.on-hero .navlinks a.active::after { transform: scaleX(0); }
.topnav .wrap { display: flex; align-items: center; gap: 24px; height: 62px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--display); font-weight: 700; font-size: 18px; letter-spacing: -.01em;
  color: var(--ink); text-decoration: none;
}
.brand-mark { width: 26px; height: 26px; }
.navlinks { display: flex; gap: 2px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.navlinks::-webkit-scrollbar { display: none; }
.navlinks a {
  position: relative;
  color: var(--ink-2); text-decoration: none; font-size: 14px; font-weight: 500;
  padding: 8px 12px; white-space: nowrap;
}
.navlinks a::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 2px;
  background: var(--accent); transform: scaleX(0); transition: transform .2s;
}
.navlinks a:hover { color: var(--ink); }
.navlinks a.active { color: var(--ink); }
.navlinks a.active::after { transform: scaleX(1); }
.theme-toggle {
  flex: none; width: 36px; height: 36px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface);
  display: grid; place-items: center;
}
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
@media (max-width: 820px) { .navlinks { display: none; } .theme-toggle { margin-left: auto; } }

/* ------------------------------------------------------------------ hero */
.hero {
  position: relative;
  /* exactly one screen; svh avoids jumps from mobile browser toolbars */
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: #071112;
  color: #fff;
  isolation: isolate;
}
.hero-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: -2;
  /* crop the Isaac Sim window chrome at the top of the recording */
  transform: scale(1.22); transform-origin: 50% 70%;
}
.hero-shade {
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(110% 80% at 10% 100%, rgba(5, 18, 19, .94) 0%, rgba(5, 18, 19, .62) 50%, rgba(5, 18, 19, .2) 100%),
    linear-gradient(180deg, rgba(5, 18, 19, .55) 0%, rgba(5, 18, 19, 0) 28%, rgba(5, 18, 19, .9) 100%),
    linear-gradient(120deg, rgba(45, 212, 191, .14), rgba(161, 139, 255, .1));
}
.hero-inner { width: 100%; padding-top: 140px; padding-bottom: 88px; }
/* venue badge: accepted journal + upcoming conference */
.venue {
  display: inline-flex; flex-wrap: wrap; align-items: stretch;
  padding: 4px; border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .2);
  background: rgba(8, 16, 17, .38);
  backdrop-filter: blur(10px);
  font-size: 13px; font-weight: 500; color: rgba(255, 255, 255, .82);
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, .5);
  margin-bottom: 26px;
}
.venue-item { display: inline-flex; align-items: center; gap: 9px; padding: 4px 10px; border-radius: 8px; }
.venue-item + .venue-item { border-left: 1px solid rgba(255, 255, 255, .14); margin-left: 4px; padding-left: 14px; }
.venue-check {
  width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center;
  background: #2dd4bf; box-shadow: 0 0 0 4px rgba(45, 212, 191, .18);
}
.venue-check svg { width: 12px; height: 12px; fill: none; stroke: #062420; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.venue b {
  font-family: var(--mono); font-weight: 500; font-size: 12px; letter-spacing: .02em;
  padding: 3px 8px; border-radius: 6px; background: #2dd4bf; color: #062420;
}
.venue b.venue-next {
  position: relative; color: #fff; background: transparent; overflow: hidden; isolation: isolate;
  border: 1px solid transparent;
  background: linear-gradient(rgba(14, 22, 28, .9), rgba(14, 22, 28, .9)) padding-box,
              linear-gradient(90deg, #2dd4bf, #a18bff) border-box;
}
.venue b.venue-next::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(100deg, transparent 30%, rgba(161, 139, 255, .45) 50%, transparent 70%);
  transform: translateX(-100%); animation: venue-shine 4.5s ease-in-out 1.2s infinite;
}
@keyframes venue-shine { 0%, 55% { transform: translateX(-100%); } 85%, 100% { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .venue b.venue-next::after { animation: none; } }
@media (max-width: 520px) {
  .venue { flex-direction: column; align-items: flex-start; }
  .venue-item + .venue-item { border-left: 0; margin-left: 0; padding-left: 10px; border-top: 1px solid rgba(255, 255, 255, .12); }
  .venue-item { width: 100%; }
  .venue-item + .venue-item { padding-left: 37px; }
}
.hero h1 {
  font-size: clamp(32px, 5vw, 62px);
  font-weight: 700;
  letter-spacing: -.035em;
  line-height: 1.05;
  max-width: 940px;
  color: #fff;
  text-shadow: 0 2px 24px rgba(0, 0, 0, .25);
}
.hero h1 .name {
  display: inline-block;
  background: linear-gradient(90deg, #2dd4bf 0%, #a18bff 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: none;
}
.authors { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 4px 22px; font-size: 17px; font-weight: 500; color: rgba(255, 255, 255, .94); }
.authors a { color: inherit; text-decoration: none; border-bottom: 1px dashed rgba(255, 255, 255, .35); }
.authors a:hover { border-bottom-color: #2dd4bf; }
.affil { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 2px 22px; color: rgba(255, 255, 255, .62); font-size: 15px; }
.authors sup, .affil sup { font-size: .62em; font-weight: 600; color: #2dd4bf; margin-left: 2px; vertical-align: super; line-height: 0; }
.affil sup { margin: 0 3px 0 0; }
.hero-links { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 15px; font-weight: 600;
  text-decoration: none;
  color: #fff;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .24);
  backdrop-filter: blur(8px);
  transition: transform .15s, border-color .15s, background .15s;
}
.btn:hover { transform: translateY(-1px); background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .4); }
.btn.primary { background: #2dd4bf; color: #062420; border-color: #2dd4bf; }
.btn.primary:hover { background: #5ee3d1; }
.btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.hero-tag {
  position: absolute; right: 24px; bottom: 28px;
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 12px; color: rgba(255, 255, 255, .7);
}
.hero-tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #2dd4bf; animation: blink 1.6s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.scroll-cue {
  position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%);
  width: 24px; height: 38px; border: 2px solid rgba(255, 255, 255, .4); border-radius: 13px;
}
.scroll-cue span {
  position: absolute; left: 50%; top: 7px; width: 4px; height: 7px; margin-left: -2px;
  background: #fff; border-radius: 2px; animation: cue 1.8s infinite;
}
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(13px); } }
/* short laptop screens: tighten so the whole hero still fits in one screen */
@media (max-height: 760px) and (min-width: 701px) {
  .hero h1 { font-size: clamp(30px, 4vw, 48px); }
  .hero-inner { padding-top: 96px; padding-bottom: 60px; }
  .authors { margin-top: 20px; }
  .hero-links { margin-top: 22px; }
  .scroll-cue { display: none; }
}
@media (max-width: 700px) {
  .hero-inner { padding-top: 110px; padding-bottom: 72px; }
  .scroll-cue { display: none; }
  .hero-tag { left: 16px; right: auto; bottom: 22px; font-size: 11px; }
}

/* ------------------------------------------------------------------ stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; }
.stat { padding: 8px 28px; border-left: 1px solid var(--line-2); }
.stat-value { font-family: var(--display); font-size: clamp(38px, 4.4vw, 54px); font-weight: 700; letter-spacing: -.04em; line-height: 1; }
.stat-value small { font-size: .45em; font-weight: 600; letter-spacing: 0; margin-left: 3px; color: var(--ink-3); }
.stat-value.hl { color: var(--accent); }
.stat-label { margin-top: 12px; font-size: 14px; color: var(--ink-2); line-height: 1.5; }
@media (max-width: 860px) {
  .stats { grid-template-columns: repeat(2, 1fr); row-gap: 32px; }
}
@media (max-width: 420px) { .stat { padding: 4px 14px; } }

/* ------------------------------------------------------------------ overview */
.tldr-lead {
  font-family: var(--display);
  font-size: clamp(22px, 2.6vw, 32px); font-weight: 500; letter-spacing: -.02em; line-height: 1.3;
  max-width: 940px; margin: 72px 0 40px;
}
.tldr-lead mark { background: linear-gradient(transparent 62%, var(--accent-soft) 62%); color: inherit; padding: 0 2px; }

.figure {
  background: var(--fig-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(12px, 2.2vw, 28px);
  overflow: hidden;
}
.figure img { width: 100%; height: auto; border-radius: 6px; cursor: zoom-in; }
.figcap { margin-top: 16px; font-size: 15px; color: var(--ink-2); line-height: 1.6; }
.figcap strong { color: var(--ink); }
.fig-num { font-family: var(--mono); font-size: 12px; color: var(--accent-ink); margin-right: 6px; }

/* ------------------------------------------------------------------ abstract */
.abstract-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 56px; }
.abstract p { font-size: 17px; line-height: 1.8; color: var(--ink-2); }
.abstract p + p { margin-top: 1em; }
.abstract strong { color: var(--ink); font-weight: 600; }
.facts { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); align-self: start; }
.facts div { display: flex; justify-content: space-between; gap: 16px; padding: 14px 18px; border-bottom: 1px solid var(--line); font-size: 14px; }
.facts div:last-child { border-bottom: 0; }
.facts dt { color: var(--ink-3); }
.facts dd { margin: 0; font-weight: 600; text-align: right; }
@media (max-width: 860px) { .abstract-grid { grid-template-columns: 1fr; gap: 32px; } }

/* ------------------------------------------------------------------ video */
.video-frame {
  position: relative; aspect-ratio: 16 / 9; width: 100%;
  border-radius: var(--radius); overflow: hidden;
  background: #000; box-shadow: var(--shadow);
}
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* demo: highlight reel (stage + chapter rail), reuses the showcase layout */
.sc-body.dm-body { grid-template-columns: minmax(0, 1fr) 316px; }
.dm-stage { background: #fff; }
.sc-stage.dm-stage video { position: absolute; inset: 0; transform: none; object-fit: cover; }
.dm-stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.dm-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(15, 26, 28, .14); z-index: 1; }
.dm-bar i, .dm-prog { display: block; height: 100%; width: calc(var(--p, 0) * 100%); background: var(--accent); }
.demo.is-full .dm-bar, .demo.is-full .dm-prog, .demo.is-full .ctrls { visibility: hidden; }
.demo .viewer-head { flex-wrap: nowrap; }
.dm-dur { margin-left: 7px; font-family: var(--mono); font-size: 12px; color: var(--ink-3); }

.dm-rail { display: grid; grid-template-rows: repeat(5, minmax(0, 1fr)); gap: 8px; height: 0; min-height: 100%; }
.dm-chap {
  display: flex; align-items: center; gap: 12px; min-height: 0; min-width: 0; overflow: hidden; padding: 6px 10px 6px 6px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink);
  text-align: left; cursor: pointer;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.dm-chap:hover { border-color: var(--line-2); transform: translateX(-2px); }
.dm-chap.on { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.dm-thumb {
  position: relative; flex: none; height: 100%; max-height: 72px; aspect-ratio: 16 / 9;
  border-radius: 8px; overflow: hidden; background: #fff; border: 1px solid var(--line);
}
.dm-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; filter: saturate(.85); transition: filter .2s; }
.dm-chap.on .dm-thumb img, .dm-chap:hover .dm-thumb img { filter: none; }
.dm-prog { position: absolute; left: 0; bottom: 0; height: 3px; width: calc(var(--p, 0) * 100%); }
.dm-chap:not(.on) .dm-prog { width: 0; }
.dm-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dm-meta small { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); }
.dm-meta small b { color: var(--accent-ink); font-weight: 500; margin-right: 8px; }
.dm-meta strong { font-size: 14px; font-weight: 600; line-height: 1.25; }
.dm-meta em { font-style: normal; font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.dm-cap { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px 32px; margin-top: 16px; }
.dm-cap .figcap { margin: 0; max-width: 860px; }
.dm-jump {
  flex: none; display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2);
  font: 500 13.5px/1 var(--font); transition: border-color .2s, color .2s, background .2s;
}
.dm-jump:hover { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); }
.dm-jump svg { width: 12px; height: 12px; fill: var(--accent); }
.dm-jump b { font-family: var(--mono); font-weight: 500; color: var(--accent-ink); }
.demo.is-full .dm-jump svg { display: none; }

@media (max-width: 860px) {
  .sc-body.dm-body { grid-template-columns: 1fr; }
  .dm-rail {
    height: auto; min-height: 0; grid-template-rows: none;
    grid-auto-flow: column; grid-auto-columns: minmax(176px, 1fr);
    overflow-x: auto; scroll-snap-type: x mandatory; padding: 3px 3px 6px; margin: -3px;
  }
  .dm-chap { flex-direction: column; align-items: stretch; gap: 8px; padding: 6px; scroll-snap-align: start; }
  .dm-chap:hover { transform: none; }
  .dm-thumb { height: auto; max-height: none; width: 100%; }
  .dm-meta { padding: 0 4px 4px; }
  .dm-cap { flex-direction: column; }
}
@media (max-width: 420px) { .dm-dur { display: none; } .demo .seg button { padding: 10px 8px; } }

/* ------------------------------------------------------------------ system */
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; }
@media (max-width: 960px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .features { grid-template-columns: 1fr; } }
.feature { display: grid; grid-template-columns: 40px 1fr; gap: 14px; }
.feature .ico {
  width: 40px; height: 40px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-ink);
}
.feature .ico svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.feature h3 { margin-bottom: 4px; font-size: 17px; }
.feature p { color: var(--ink-2); font-size: 15px; }

/* interactive system diagram */
.sysx {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.sysx-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--surface-2);
}
.sysx-pair { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; }
.sysx-hint { font-size: 13px; }
.muted { color: var(--ink-3); }
.pair-chip {
  font-family: var(--mono); font-size: 13px; font-weight: 500;
  padding: 3px 10px; border-radius: 7px;
  color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 35%, transparent);
  transition: transform .2s;
}
.pair-chip.bump { animation: bump .45s ease; }
@keyframes bump { 40% { transform: scale(1.12); } }
.c-ped { --c: var(--l-ped); }
.c-robot { --c: var(--l-robot); }
.sysx-play {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 9px;
  border: 1px solid var(--accent); background: var(--accent); color: #fff;
  font-size: 14px; font-weight: 600;
}
:root[data-theme="dark"] .sysx-play { color: #062420; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sysx-play { color: #062420; } }
.sysx-play svg { width: 15px; height: 15px; fill: currentColor; }
.sysx-play[aria-pressed="true"] { background: transparent; color: var(--accent-ink); }

.sysx-body { display: grid; grid-template-columns: minmax(0, 1fr) 320px; }
@media (max-width: 980px) { .sysx-body { grid-template-columns: 1fr; } }
.sysx-diagram { padding: 18px; display: flex; flex-direction: column; gap: 14px; }

.layer {
  position: relative;
  border: 1.5px dashed color-mix(in srgb, var(--lc) 55%, transparent);
  border-radius: 14px;
  padding: 30px 12px 12px;
  background: color-mix(in srgb, var(--lc) 4%, transparent);
}
.layer-name {
  position: absolute; top: 8px; left: 14px;
  font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase;
  color: var(--lc);
}
.l-ped { --lc: var(--l-ped); }
.l-env { --lc: var(--l-env); }
.l-robot { --lc: var(--l-robot); }
.ped-grid {
  display: grid; gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-areas:
    "perc inter anim"
    "bt   path rec"
    "bt   lca  lca";
}
.row-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 640px) {
  .ped-grid { grid-template-columns: 1fr 1fr; grid-template-areas: "perc inter" "bt path" "anim rec" "lca lca"; }
  .row-3 { grid-template-columns: 1fr; }
  .row-3 .mod-art { max-width: 240px; align-self: center; }
}

.mod {
  position: relative;
  display: flex; flex-direction: column; gap: 8px;
  padding: 12px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--lc) 35%, var(--line));
  cursor: pointer;
  text-align: left;
  transition: border-color .2s, box-shadow .2s, transform .2s, opacity .3s, background .2s;
}
.mod:hover { border-color: var(--lc); transform: translateY(-1px); }
.mod.sel { border-color: var(--lc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--lc) 22%, transparent); }
.mod.flash { background: color-mix(in srgb, var(--lc) 12%, var(--surface)); border-color: var(--lc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--lc) 30%, transparent); }
.sysx.playing .mod:not(.flash) { opacity: .45; }
.mod-slot { border-style: solid; border-width: 1.5px; background: color-mix(in srgb, var(--lc) 6%, var(--surface)); }
.mod-core { background: color-mix(in srgb, var(--lc) 10%, var(--surface)); }
.mod-t { font-family: var(--display); font-weight: 600; font-size: 14.5px; line-height: 1.25; }
.mod-t em { display: block; font-style: normal; font-family: var(--mono); font-weight: 400; font-size: 11px; color: var(--lc); margin-top: 2px; }
.subs { display: flex; flex-wrap: wrap; gap: 4px; }
.subs > span {
  font-size: 11.5px; line-height: 1.3; padding: 3px 7px; border-radius: 6px;
  background: var(--surface-2); color: var(--ink-2);
}
.pick button {
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  padding: 4px 9px; border-radius: 7px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2);
  transition: all .15s;
}
.pick button:hover { border-color: var(--c, var(--l-robot)); color: var(--ink); }
.pick button.on {
  background: var(--c, var(--l-robot)); border-color: var(--c, var(--l-robot)); color: #fff;
}
.step-badge {
  position: absolute; top: -9px; right: -9px;
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  background: var(--lc); color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
}

.sysx-panel {
  border-left: 1px solid var(--line);
  padding: 22px;
  display: flex; flex-direction: column;
  background: var(--surface);
}
@media (max-width: 980px) { .sysx-panel { border-left: 0; border-top: 1px solid var(--line); } }
.panel-step { font-family: var(--mono); font-size: 12px; color: var(--accent-ink); min-height: 18px; }
.panel-layer {
  align-self: flex-start;
  margin-top: 6px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--lc, var(--ink-3));
}
.panel-title { margin-top: 6px; font-size: 21px; }
.panel-desc { margin-top: 10px; font-size: 15px; color: var(--ink-2); line-height: 1.65; }
.panel-extra { margin-top: 12px; font-size: 14px; color: var(--ink-2); }
.panel-extra:empty { display: none; }
.panel-extra .kv { display: flex; gap: 8px; align-items: baseline; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); }
.panel-extra .kv b { font-family: var(--mono); font-weight: 500; color: var(--ink); }
.cycle {
  list-style: none; margin: 22px 0 0; padding: 16px 0 0;
  border-top: 1px solid var(--line);
  counter-reset: step;
  display: flex; flex-direction: column; gap: 2px;
  font-size: 13px;
}
.cycle li {
  counter-increment: step;
  display: flex; gap: 10px; align-items: center;
  padding: 4px 8px; border-radius: 7px; color: var(--ink-3);
  cursor: pointer;
}
.cycle li::before {
  content: counter(step);
  width: 18px; height: 18px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 10px;
  border: 1px solid var(--line-2);
}
.cycle li:hover { color: var(--ink); }
.cycle li.on { color: var(--ink); background: var(--accent-soft); }
.cycle li.on::before { background: var(--accent); border-color: var(--accent); color: #fff; }
/* module heads with icons */
.mod-h { display: flex; align-items: flex-start; gap: 10px; }
.mod-ico {
  flex: none; width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--lc) 14%, transparent);
  color: var(--lc);
}
.mod-ico svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mod-h .mod-t { padding-top: 5px; }

/* mini illustrations inside modules */
.mod-art { width: 100%; height: auto; margin-top: 2px; overflow: visible; }
.mod-art text { font-family: var(--font); }
.bt-art { max-width: 240px; align-self: center; margin-top: 6px; }
.a-start { fill: #3ddc84; }
.a-edge { fill: none; stroke: var(--l-ped); stroke-width: 1.4; }
.a-dec { fill: color-mix(in srgb, var(--l-ped) 40%, var(--surface)); stroke: var(--l-ped); stroke-width: 1.2; }
.a-act { fill: color-mix(in srgb, var(--l-robot) 16%, var(--surface)); stroke: var(--l-robot); stroke-width: 1.2; }
.a-t { font-size: 10.5px; font-weight: 600; text-anchor: middle; fill: var(--ink); }
.a-s { font-size: 10px; fill: var(--ink-3); font-style: italic; }
.tr { fill: none; stroke-width: 2; stroke-linecap: round; stroke-dasharray: 260; stroke-dashoffset: 260; animation: draw 4s ease-in-out infinite; }
.tr1 { stroke: var(--force); }
.tr2 { stroke: var(--imitation); animation-delay: .5s; }
.tr3 { stroke: var(--velocity); animation-delay: 1s; }
@keyframes draw { 0% { stroke-dashoffset: 260; } 55%, 80% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 0; opacity: 0; } }
.rec-dot { fill: #e5484d; animation: blink 1.2s infinite; }
.rays path { stroke: var(--l-robot); stroke-width: 1.2; stroke-dasharray: 3 3; opacity: .7; animation: scan 1.4s linear infinite; }
@keyframes scan { to { stroke-dashoffset: -12; } }
.ped { fill: color-mix(in srgb, var(--l-ped) 75%, var(--surface)); }
.bot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.bot-head { stroke: #fff; stroke-width: 2.4; stroke-linecap: round; }
.path-dash { fill: none; stroke: var(--line-2); stroke-width: 1.6; stroke-dasharray: 4 4; }
.vec { fill: none; stroke: var(--l-robot); stroke-width: 1.8; }

.g-cell { fill: var(--surface-2); }
.g-obs { fill: color-mix(in srgb, var(--ink) 55%, var(--surface)); }
.g-path { fill: none; stroke: var(--l-ped); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 300; stroke-dashoffset: 300; animation: draw 3.6s ease-in-out infinite; }
.g-start { fill: #3ddc84; }
.g-goal { fill: var(--l-ped); }
.nn-e { fill: none; stroke: color-mix(in srgb, var(--l-robot) 35%, transparent); stroke-width: 1; }
.nn-n { fill: var(--surface); stroke: var(--l-robot); stroke-width: 1.6; animation: fire 1.6s ease-in-out infinite; }
@keyframes fire { 0%, 100% { fill: var(--surface); } 30% { fill: var(--l-robot); } }

/* animated flow between layers */
.flow { display: flex; justify-content: center; gap: 28px; margin: -4px 0; }
.flow-arrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 11px; color: var(--ink-3);
}
.flow-arrow svg { width: 12px; height: 24px; overflow: visible; }
.fl-line { fill: none; stroke: var(--fc); stroke-width: 1.8; stroke-dasharray: 3 3; animation: flowd .7s linear infinite; }
.flow-arrow.up .fl-line { animation-name: flowu; }
.fl-head { fill: none; stroke: var(--fc); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@keyframes flowd { to { stroke-dashoffset: -6; } }
@keyframes flowu { to { stroke-dashoffset: 6; } }
@media (max-width: 520px) { .flow { gap: 14px; } .flow-arrow { font-size: 10px; } }

/* toy crowd in the side panel */
.toy { margin: -4px -4px 18px; }
.toy-canvas {
  width: 100%; height: 150px; display: block;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.toy-cap { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12.5px; color: var(--ink-2); }
.toy-cap span { display: inline-flex; align-items: center; gap: 6px; }
.toy-cap b { font-family: var(--mono); font-weight: 500; color: var(--ink); }
.toy-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.toy-note { margin-top: 4px; font-size: 11.5px; color: var(--ink-3); }

@media (prefers-reduced-motion: reduce) {
  .tr, .rec-dot, .rays path, .fl-line, .g-path, .nn-n { animation: none; }
  .g-path { stroke-dashoffset: 0; }
  .tr { stroke-dashoffset: 0; }
}

.sysx-cap { max-width: 900px; }
.linklike {
  border: 0; background: none; padding: 0; margin-left: 4px;
  color: var(--accent-ink); font-weight: 500; font-size: inherit;
  text-decoration: underline; text-underline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) { .pair-chip.bump { animation: none; } }

/* ------------------------------------------------------------------ drivers */
.taxonomy { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.driver { padding: 22px 22px 24px; border-left: 1px solid var(--line); }
.driver:first-child { border-left: 0; }
.driver .klass {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3);
}
.driver .klass::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.driver h3 { margin: 10px 0 14px; font-size: 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-family: var(--mono); font-size: 13px; font-weight: 500;
  padding: 3px 9px; border-radius: 6px;
  background: color-mix(in srgb, var(--c) 12%, transparent);
  color: var(--c);
}
.c-force { --c: var(--force); }
.c-velocity { --c: var(--velocity); }
.c-baseline { --c: var(--baseline); }
.c-imitation { --c: var(--imitation); }
@media (max-width: 860px) {
  .taxonomy { grid-template-columns: repeat(2, 1fr); }
  .driver:nth-child(3) { border-left: 0; }
  .driver:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}
@media (max-width: 460px) {
  .taxonomy { grid-template-columns: 1fr; }
  .driver { border-left: 0; border-bottom: 1px solid var(--line); }
  .driver:last-child { border-bottom: 0; }
}

/* ------------------------------------------------------------------ viewer */
.viewer-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; justify-content: space-between; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.seg { display: flex; flex-wrap: wrap; gap: 0 4px; margin-bottom: -1px; }
.seg button {
  border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--ink-3);
  padding: 10px 12px; font-size: 15px; font-weight: 500;
  transition: color .15s, border-color .15s;
}
.seg button:hover { color: var(--ink); }
.seg button.on { color: var(--ink); border-bottom-color: var(--accent); }
.ctrls { display: flex; gap: 6px; padding-bottom: 8px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--surface);
  display: grid; place-items: center; color: var(--ink-2);
}
.icon-btn:hover { color: var(--ink); border-color: var(--line-2); }
.icon-btn svg { width: 16px; height: 16px; fill: currentColor; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 760px) { .tiles { grid-template-columns: 1fr; } }
.tile { margin: 0; }
.tile-media {
  position: relative; border-radius: 10px; overflow: hidden;
  background: #0b1213; aspect-ratio: var(--ar, 16 / 10);
  border: 1px solid var(--line);
}
.viewer.plots .tile-media { background: #fff; }
.tile video { width: 100%; height: 100%; object-fit: contain; }
.tile-label {
  position: absolute; left: 10px; top: 10px;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 10px; border-radius: 7px;
  background: rgba(255, 255, 255, .92); color: #0f1a1c;
  font-size: 13px; font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .12);
}
.tile-label .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--accent)); }
.tile figcaption { margin-top: 8px; font-family: var(--mono); font-size: 12px; color: var(--ink-3); }

.callout {
  margin-top: 32px;
  display: grid; grid-template-columns: 28px 1fr; gap: 12px;
  font-size: 16px; color: var(--ink-2); max-width: 860px;
}
.callout svg { width: 22px; height: 22px; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; margin-top: 2px; }

/* simulator logos (inside the intro column) */
.section-head.full .intro-row { max-width: none; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 48px; }
.intro-row p { flex: 1 1 420px; max-width: 680px; }
.intro-row .logos { margin: 0; }
.logos { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.logos li {
  height: 40px; padding: 6px 10px;
  display: grid; place-items: center;
  background: #fff; border: 1px solid var(--line); border-radius: 9px;
}
.logos img { height: 26px; width: auto; }
.logos img.wide { height: 20px; }
.tile-label img { height: 16px; width: auto; border-radius: 3px; background: #fff; }

/* scenario tab icons */
.tab-ico { width: 16px; height: 16px; margin-right: 7px; vertical-align: -3px; display: inline-block; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* showcase: big stage + rail of live previews */
.sc-body { display: grid; grid-template-columns: minmax(0, 1fr) 248px; gap: 16px; }
.sc-stage {
  position: relative; aspect-ratio: 16 / 9;
  border-radius: 14px; overflow: hidden;
  background: #0b1213; border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.sc-thumb-media video { position: absolute; inset: 0; }
.sc-stage video, .sc-thumb-media video {
  width: 100%; height: 100%; object-fit: cover; display: block;
  /* trim the OS dock and window bars of the desktop screen recordings */
  transform: scale(1.16); transform-origin: 30% 78%;
}
.sc-badge {
  position: absolute; left: 14px; bottom: 14px; z-index: 1;
  display: inline-flex; align-items: center; gap: 9px;
  padding: 7px 12px 7px 8px; border-radius: 10px;
  background: rgba(11, 18, 19, .78); color: #fff;
  backdrop-filter: blur(8px);
  font-weight: 600; font-size: 15px;
}
.sc-badge img { height: 24px; width: auto; border-radius: 5px; background: #fff; padding: 2px; }
.sc-badge span { font-weight: 400; font-size: 13px; color: rgba(255, 255, 255, .7); }
/* height 0 + min-height 100%: the rail takes the stage's height instead of growing it */
.sc-rail { display: grid; grid-template-rows: repeat(3, minmax(0, 1fr)); gap: 12px; height: 0; min-height: 100%; }
.sc-thumb {
  display: flex; flex-direction: column; gap: 8px; padding: 8px; min-height: 0;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  text-align: left; transition: border-color .2s, box-shadow .2s, transform .2s;
}
.sc-thumb:hover { border-color: var(--line-2); transform: translateY(-1px); }
.sc-thumb.on { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.sc-thumb-media { position: relative; flex: 1; min-height: 0; border-radius: 8px; overflow: hidden; background: #0b1213; display: block; }
.sc-live {
  position: absolute; inset: 0; display: none; place-items: center;
  font-family: var(--mono); font-size: 12px; color: var(--accent-ink);
  background: repeating-linear-gradient(135deg, var(--accent-soft) 0 8px, var(--surface-2) 8px 16px);
}
.sc-thumb.on .sc-live { display: grid; }
.sc-thumb-cap { display: flex; align-items: center; gap: 10px; }
.sc-logo { flex: none; width: 36px; height: 36px; border-radius: 8px; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; padding: 4px; }
.sc-logo img { max-width: 26px; max-height: 26px; width: auto; height: auto; }
.sc-thumb-cap b { display: block; font-size: 14px; }
.sc-thumb-cap small { display: block; font-size: 12px; color: var(--ink-3); }
@media (max-width: 860px) {
  .sc-body { grid-template-columns: 1fr; }
  .sc-rail { grid-template-rows: none; grid-template-columns: repeat(3, minmax(0, 1fr)); height: auto; min-height: 0; }
  .sc-thumb { min-width: 0; padding: 6px; }
  .sc-thumb-media { flex: none; aspect-ratio: 16 / 9; }
  .sc-thumb-cap small { display: none; }
  .sc-logo { width: 28px; height: 28px; }
}
@media (max-width: 420px) { .sc-thumb-cap b { font-size: 12px; } .sc-logo { display: none; } }

/* ------------------------------------------------------------------ bibtex */
.bib {
  position: relative;
  background: var(--surface); color: var(--ink);
  border-radius: var(--radius); border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  padding: 22px 24px;
  overflow-x: auto;
}
.bib pre { margin: 0; font-family: var(--mono); font-size: 14px; line-height: 1.7; white-space: pre; }
.copy-btn {
  position: absolute; top: 12px; right: 12px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: 13px; font-weight: 600;
}
.copy-btn:hover { border-color: var(--line-2); }
.copy-btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }

/* ------------------------------------------------------------------ footer */
footer { padding: 40px 0 48px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 14px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 32px; justify-content: space-between; }
footer a { color: var(--ink-2); }

/* ------------------------------------------------------------------ lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(6, 12, 13, .88);
  display: none; place-items: center; padding: 24px;
  cursor: zoom-out;
}
.lightbox.open { display: grid; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 10px; background: #fff; }

/* ------------------------------------------------------------------ reveal */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-tag::before, .scroll-cue span { animation: none; }
}
