/* SM4RT project page.
   Palette follows the poster and intro video (brightened for the dark background):
   blue = geometry, vermilion = object flow / motion, gold = camera, magenta = labels, slate = static & baselines. */
:root {
  --bg: #070b14;
  --bg-1: #0a1020;
  --surface: #0f1626;
  --surface-2: #141d32;
  --edge: #212e47;
  --edge-2: #2e3f5e;
  --ink: #eef2f8;
  --ink-2: #c8d1df;
  --muted: #94a3b8;
  --faint: #5b6b84;
  --geom: #509ef5;
  --motion: #ff794e;
  --camera: #e8b93b;
  --label: #dc71c2;
  --static: #8193ae;
  --radius: 20px;
  --radius-sm: 12px;
  --wrap: 1120px;
  --wrap-wide: 1320px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --math: "STIX Two Text", "Times New Roman", serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-optical-sizing: auto;
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink-2);
  background:
    radial-gradient(1400px 900px at 50% -200px, #111a2e 0%, transparent 70%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img, video, canvas, svg { display: block; max-width: 100%; }
a { color: var(--geom); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--geom); outline-offset: 3px; border-radius: 6px; }
::selection { background: rgba(80, 158, 245, .35); }

.g { color: var(--geom); }
.o { color: var(--motion); }
.c { color: var(--camera); }
.l { color: var(--label); }
.m { font-family: var(--math); font-style: italic; font-size: 1.08em; white-space: nowrap; letter-spacing: 0; }
.m .up { font-style: normal; }
.nw { white-space: nowrap; }

.wordmark {
  font-weight: 800;
  letter-spacing: -.02em;
  background: linear-gradient(95deg, #5aa5f7 0%, #8f8ff0 42%, #e47aa4 68%, #ff7f50 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.wrap.wide { max-width: var(--wrap-wide); }

/* ------------------------------------------------------------------ nav */
.topnav {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: 64px;
  transition: background .35s var(--ease), border-color .35s var(--ease), backdrop-filter .35s;
  border-bottom: 1px solid transparent;
}
.topnav.solid {
  background: rgba(7, 11, 20, .72);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom-color: rgba(46, 63, 94, .55);
}
.nav-inner { height: 100%; max-width: var(--wrap-wide); margin: 0 auto; padding: 0 24px; display: flex; align-items: center; gap: 28px; }
.nav-brand { font-size: 1.3rem; line-height: 1; opacity: 0; transform: translateY(-4px); transition: opacity .35s, transform .35s var(--ease); }
.topnav.solid .nav-brand { opacity: 1; transform: none; }
.nav-brand:hover { text-decoration: none; }
.nav-links { display: flex; gap: 4px; margin-left: auto; }
.nav-links a {
  color: var(--muted); font-size: .9rem; font-weight: 500; padding: 7px 12px; border-radius: 999px;
  transition: color .2s, background .2s;
}
.nav-links a:hover { color: var(--ink); background: rgba(255, 255, 255, .06); text-decoration: none; }
.nav-links a.active { color: var(--ink); background: rgba(255, 255, 255, .08); }

.more-works-container { position: relative; }
.more-works-btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  background: rgba(255, 255, 255, .05); border: 1px solid var(--edge-2); color: var(--ink);
  padding: 7px 14px; border-radius: 999px; font-size: .88rem; font-weight: 600;
  transition: background .2s, border-color .2s;
}
.more-works-btn:hover { background: rgba(255, 255, 255, .1); border-color: var(--muted); }
.more-works-btn svg { width: 15px; height: 15px; }
.more-works-btn .dropdown-arrow { transition: transform .25s var(--ease); }
.more-works-btn.active .dropdown-arrow { transform: rotate(180deg); }
.more-works-dropdown {
  position: absolute; top: calc(100% + 10px); right: 0; width: 380px; max-width: calc(100vw - 32px);
  background: rgba(15, 22, 38, .96); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--edge-2); border-radius: 16px; box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
  opacity: 0; visibility: hidden; transform: translateY(-8px); transition: all .25s var(--ease);
}
.more-works-dropdown.show { opacity: 1; visibility: visible; transform: none; }
.dropdown-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px 10px; border-bottom: 1px solid var(--edge); }
.dropdown-header h4 { margin: 0; font-size: .95rem; color: var(--ink); }
.close-btn { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 4px; border-radius: 8px; }
.close-btn:hover { color: var(--ink); background: rgba(255, 255, 255, .06); }
.close-btn svg { width: 16px; height: 16px; }
.works-list { padding: 8px; }
.work-item { display: flex; gap: 12px; justify-content: space-between; padding: 12px; border-radius: 12px; color: inherit; transition: background .2s; }
.work-item:hover { background: rgba(255, 255, 255, .05); text-decoration: none; }
.work-info h5 { margin: 0 0 4px; font-size: .92rem; font-weight: 600; color: var(--ink); line-height: 1.35; }
.work-info p { margin: 0 0 6px; font-size: .84rem; color: var(--muted); line-height: 1.45; }
.work-venue { font-size: .76rem; color: var(--geom); font-weight: 600; }
.work-item svg { flex: none; width: 14px; height: 14px; color: var(--faint); margin-top: 4px; }

/* ------------------------------------------------------------------ hero */
.hero {
  position: relative; min-height: max(640px, 100svh); display: flex; align-items: center;
  overflow: hidden; isolation: isolate; background: #060912;
}
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; cursor: grab; touch-action: pan-y; }
.hero-canvas:active { cursor: grabbing; }
.hero.no-webgl { background: #060912 url("../images/hero_fallback.jpg") center / cover no-repeat; }
.hero-shade {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(6, 9, 18, .92) 0%, rgba(6, 9, 18, .74) 34%, rgba(6, 9, 18, .1) 62%, rgba(6, 9, 18, 0) 100%),
    linear-gradient(180deg, rgba(6, 9, 18, .55) 0%, transparent 18%, transparent 72%, var(--bg) 100%);
}
.hero-content { position: relative; width: 100%; max-width: var(--wrap-wide); margin: 0 auto; padding: 110px 24px 120px; pointer-events: none; }
.hero-content > * { max-width: 640px; }
.hero-content > .hero-links { max-width: 760px; }
.hero-content a, .hero-content button { pointer-events: auto; }
.venue-pill {
  display: inline-flex; align-items: center; gap: 10px; font-size: .8rem; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink); padding: 6px 14px 6px 8px; border-radius: 999px;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); backdrop-filter: blur(6px);
}
.venue-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--motion); box-shadow: 0 0 0 4px rgba(255, 121, 78, .2); }
.hero-title { margin: 22px 0 0; font-weight: 800; color: var(--ink); line-height: 1.02; }
.hero-title .wordmark { display: block; font-size: clamp(4rem, 10.5vw, 8.4rem); letter-spacing: -.035em; line-height: .95; padding-bottom: .04em; }
.hero-title .sub { display: block; margin-top: 14px; font-size: clamp(1.45rem, 2.7vw, 2.25rem); font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.hero-hook { margin: 20px 0 0; font-size: clamp(1.02rem, 1.4vw, 1.18rem); color: var(--muted); line-height: 1.55; }
.hero-hook em { font-style: normal; color: var(--motion); font-weight: 600; }
.authors { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 4px 22px; font-size: 1.08rem; font-weight: 600; color: var(--ink); }
.authors a { color: var(--ink); pointer-events: auto; border-bottom: 1px solid rgba(238, 242, 248, .25); transition: border-color .2s, color .2s; }
.authors a:hover { text-decoration: none; color: #fff; border-bottom-color: var(--geom); }
.authors sup { color: var(--geom); font-weight: 700; margin-left: 2px; }
.affils { margin-top: 6px; font-size: .92rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 2px 18px; }
.affils sup { color: var(--geom); font-weight: 700; margin-right: 3px; }
.logos { display: flex; align-items: center; gap: 18px; margin-top: 22px; }
.logos img { height: 34px; width: auto; }
.logos .cmu { border-radius: 4px; }
.logos .ntu { height: 30px; opacity: .92; }
.hero-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 999px;
  font-size: .92rem; font-weight: 600; color: var(--ink); cursor: pointer; white-space: nowrap;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .14);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: transform .2s var(--ease), background .2s, border-color .2s, box-shadow .2s;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); background: rgba(255, 255, 255, .13); border-color: rgba(255, 255, 255, .28); }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn.primary { background: var(--ink); color: #0a1020; border-color: var(--ink); }
.btn.primary:hover { background: #fff; box-shadow: 0 10px 30px rgba(80, 158, 245, .25); }
.btn.is-disabled { color: var(--muted); }


.hero-hud {
  position: absolute; right: 24px; bottom: 28px; display: flex; align-items: center; gap: 18px; z-index: 2;
  padding: 10px 12px 10px 16px; border-radius: 14px; font-size: .8rem; color: var(--muted);
  background: rgba(10, 16, 32, .62); border: 1px solid rgba(255, 255, 255, .09);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  opacity: 0; transform: translateY(8px); transition: opacity .6s var(--ease), transform .6s var(--ease);
}
.hero-hud.on { opacity: 1; transform: none; }
.hud-live { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-weight: 500; }
.hud-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--motion); animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 121, 78, .6); } 70% { box-shadow: 0 0 0 8px rgba(255, 121, 78, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 121, 78, 0); } }
.hud-hint { display: flex; align-items: center; gap: 6px; }
.hud-hint svg { width: 15px; height: 15px; }
.hud-link {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-weight: 600; color: var(--ink);
  background: rgba(255, 121, 78, .14); border: 1px solid rgba(255, 121, 78, .45); transition: background .2s;
}
.hud-link:hover { text-decoration: none; background: rgba(255, 121, 78, .26); }
.hud-link svg { width: 14px; height: 14px; }
.scroll-cue {
  position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 2; width: 26px; height: 42px;
  border-radius: 14px; border: 1.5px solid rgba(255, 255, 255, .3);
}
.scroll-cue::after { content: ""; position: absolute; left: 50%; top: 8px; width: 3px; height: 8px; margin-left: -1.5px; border-radius: 2px; background: var(--ink); animation: cue 1.8s infinite var(--ease); }
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* ------------------------------------------------------------------ sections */
.section { position: relative; padding: 112px 0; }
.section.tight { padding-top: 72px; padding-bottom: 72px; }
.section.alt { background: linear-gradient(180deg, transparent, rgba(15, 22, 38, .55) 12%, rgba(15, 22, 38, .55) 88%, transparent); }
.sec-head { max-width: 820px; margin-bottom: 40px; }
.kicker {
  display: flex; align-items: center; gap: 12px; margin: 0 0 14px; font-size: .76rem; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
}
h2 { margin: 0; font-size: clamp(1.9rem, 3.6vw, 2.9rem); line-height: 1.12; font-weight: 750; color: var(--ink); letter-spacing: -.025em; text-wrap: balance; }
h3 { margin: 0 0 8px; font-size: 1.28rem; line-height: 1.3; font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
.lede { margin: 16px 0 0; font-size: 1.12rem; color: var(--muted); max-width: 760px; text-wrap: pretty; }
.note { margin: 12px 0 0; font-size: .84rem; color: var(--faint); }
.res-note { margin: 14px 0 0; font-size: .86rem; color: var(--faint); max-width: 900px; }
.res-note b { color: var(--muted); font-weight: 600; }

.card { background: var(--surface); border: 1px solid var(--edge); border-radius: var(--radius); }

.chip {
  display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; padding: 9px 16px; border-radius: 14px;
  font-size: .9rem; color: var(--ink-2); background: color-mix(in srgb, var(--chip) 9%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--chip) 45%, transparent);
}
.chip .k { font-size: .7rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--chip); }
.chip b { color: var(--ink); font-weight: 700; }
.chip .s { color: var(--muted); }
.chip.o { --chip: var(--motion); } .chip.g { --chip: var(--geom); } .chip.l { --chip: var(--label); } .chip.c { --chip: var(--camera); }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

/* scroll reveal */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: var(--d, 0s); }
.js .reveal.in { opacity: 1; transform: none; }

/* ------------------------------------------------------------------ shared controls */
.play-btn {
  flex: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--edge-2); background: var(--surface-2);
  display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--ink); transition: background .2s, border-color .2s, transform .2s;
}
.play-btn:hover { background: #1b2742; border-color: var(--muted); transform: scale(1.05); }
.play-btn svg { width: 18px; height: 18px; }
.play-btn .i-pause, .play-btn.playing .i-play { display: none; }
.play-btn.playing .i-pause { display: block; }
.seg { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--bg-1); border: 1px solid var(--edge); }
.seg button { border: 0; background: transparent; padding: 7px 15px; border-radius: 999px; font-size: .86rem; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; transition: background .25s, color .25s; }
.seg button.on { background: var(--surface-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--edge-2); }
.seg button:hover:not(.on) { color: var(--ink-2); }
.toggle {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 15px; border-radius: 999px; border: 1px solid var(--edge);
  background: var(--bg-1); color: var(--muted); font-size: .86rem; font-weight: 600; cursor: pointer; transition: color .2s, border-color .2s;
}
.toggle::before { content: ""; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid currentColor; transition: background .2s, border-color .2s; }
.toggle.on { color: var(--ink); border-color: var(--edge-2); }
.toggle.on::before { background: var(--motion); border-color: var(--motion); box-shadow: 0 0 8px rgba(255, 121, 78, .7); }
.range { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; margin: 0; background: transparent; cursor: pointer; }
.range::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--motion) var(--v, 0%), rgba(255, 255, 255, .14) var(--v, 0%)); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -6px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(255, 121, 78, .35); }
.range::-moz-range-track { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .14); }
.range::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--motion); }
.range::-moz-range-thumb { width: 16px; height: 16px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(255, 121, 78, .35); }
.slider { display: flex; align-items: center; gap: 12px; flex: 1 1 240px; font-size: .86rem; font-weight: 600; color: var(--ink-2); transition: opacity .25s; }
.slider > span { white-space: nowrap; }
.slider.off { opacity: .35; pointer-events: none; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .82rem; color: var(--muted); }
.legend > span { display: inline-flex; align-items: center; gap: 8px; }
.legend i { flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--c); }
.legend i.ring { background: none; border: 2px solid var(--c); }
.legend i.line { width: 16px; height: 2px; border-radius: 1px; }
.legend i.arrow { position: relative; width: 14px; height: 2px; border-radius: 0; margin-right: 4px; }
.legend i.arrow::after { content: ""; position: absolute; right: -5px; top: -4px; border-left: 7px solid var(--c); border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
.legend i.box { border-radius: 2px; background: repeating-linear-gradient(135deg, var(--c) 0 2px, transparent 2px 5px); box-shadow: inset 0 0 0 1px var(--muted); }

/* ------------------------------------------------------------------ overview */
.ov-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.video-shell { margin: 0; }
.video-shell video {
  width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 20px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 40px 120px -30px rgba(80, 158, 245, .3), 0 30px 80px -40px rgba(255, 121, 78, .3);
}
.video-shell figcaption { margin-top: 12px; font-size: .84rem; color: var(--faint); }
.tldr .kicker { color: var(--motion); }
.tldr-lead { margin: 0; font-size: clamp(1.5rem, 2.4vw, 2rem); line-height: 1.2; font-weight: 750; letter-spacing: -.02em; color: var(--ink); text-wrap: balance; }
.contribs { list-style: none; counter-reset: c; margin: 26px 0 0; padding: 0; display: grid; gap: 4px; }
.contribs li { counter-increment: c; }
.contribs a {
  display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding: 9px 12px 9px 8px; margin: 0 -12px 0 -8px; border-radius: 12px;
  color: var(--muted); font-size: .96rem; line-height: 1.5; transition: background .2s, color .2s;
}
.contribs a::before {
  content: counter(c); width: 26px; height: 26px; margin-top: 1px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: .78rem; font-weight: 800; color: var(--ink); border: 1px solid var(--edge-2);
}
.contribs a:hover { text-decoration: none; background: var(--surface); color: var(--ink-2); }
.contribs b { color: var(--ink); font-weight: 650; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 24px; }
.kpis > div { padding: 14px 14px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--edge); }
.kpis b { display: block; font-size: 1.7rem; line-height: 1.1; font-weight: 800; letter-spacing: -.03em; color: var(--ink); font-variant-numeric: tabular-nums; }
.kpis span { display: block; margin-top: 4px; font-size: .76rem; line-height: 1.35; color: var(--muted); }
.abstract { margin-top: 80px; display: grid; grid-template-columns: 200px minmax(0, 860px); gap: 32px; padding-top: 40px; border-top: 1px solid var(--edge); }
.abstract h3 { font-size: .76rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }
.abstract p { margin: 0; font-size: 1.04rem; line-height: 1.8; color: var(--ink-2); text-wrap: pretty; }

/* ------------------------------------------------------------------ results explorer */
.picker { display: flex; flex-wrap: wrap; gap: 18px 28px; margin-bottom: 22px; }
.pgroup { display: flex; flex-direction: column; gap: 8px; }
.pgroup .gl { font-size: .72rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.pgroup .row { display: flex; gap: 8px; }
.pick {
  position: relative; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 12px; overflow: hidden; width: 86px; height: 58px;
  box-shadow: 0 0 0 1px var(--edge-2); transition: transform .2s var(--ease), box-shadow .2s;
}
.pick img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.75) brightness(.7); transition: filter .25s; }
.pick span { position: absolute; left: 6px; bottom: 4px; font-size: .68rem; font-weight: 700; color: #fff; text-shadow: 0 1px 4px rgba(0, 0, 0, .8); }
.pick:hover { transform: translateY(-2px); }
.pick:hover img { filter: none; }
.pick.on { box-shadow: 0 0 0 2px var(--motion), 0 10px 30px -10px rgba(255, 121, 78, .6); }
.pick.on img { filter: none; }

.explorer {
  display: grid; grid-template-columns: minmax(0, 1fr) 260px; grid-template-areas: "stage side" "bar bar"; overflow: hidden;
  box-shadow: 0 40px 120px -50px rgba(80, 158, 245, .25);
}
.ex-stage { grid-area: stage; position: relative; aspect-ratio: 16 / 9.6; min-height: 420px; background: #0b101d; }
.ex-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: pan-y; }
.ex-stage canvas:active { cursor: grabbing; }
.ex-stage .glass, .ex-info, .ex-tools button, .ex-legend, .ex-hint {
  background: rgba(10, 16, 32, .66); border: 1px solid rgba(255, 255, 255, .08); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.ex-info { position: absolute; left: 14px; top: 14px; display: flex; flex-direction: column; padding: 8px 12px; border-radius: 12px; pointer-events: none; }
.ex-info b { color: var(--ink); font-size: .92rem; }
.ex-info span { font-size: .76rem; color: var(--muted); line-height: 1.45; }
.ex-info #ex-meta { color: var(--faint); font-variant-numeric: tabular-nums; }
.ex-tools { position: absolute; right: 14px; top: 14px; display: flex; gap: 6px; }
.ex-tools button { width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center; color: var(--ink-2); cursor: pointer; transition: color .2s, border-color .2s; }
.ex-tools button:hover { color: #fff; border-color: rgba(255, 255, 255, .25); }
.ex-tools svg { width: 18px; height: 18px; }
.ex-legend {
  position: absolute; left: 14px; bottom: 14px; display: flex; gap: 14px; padding: 7px 12px; border-radius: 10px; font-size: .76rem; color: var(--ink-2);
  opacity: 0; transform: translateY(6px); transition: opacity .3s, transform .3s var(--ease); pointer-events: none;
}
.explorer[data-colour="motion"] .ex-legend { opacity: 1; transform: none; }
.ex-legend span { display: inline-flex; align-items: center; gap: 7px; }
.ex-legend i { width: 10px; height: 10px; border-radius: 50%; }
.ex-legend i.st { background: #6b7891; }
.ex-legend i.ramp { width: 46px; border-radius: 5px; background: linear-gradient(90deg, #6b7891, #ff794e 40%, #ffdb8c); }
.ex-hint {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); padding: 6px 12px; border-radius: 999px; font-size: .76rem; color: var(--muted);
  white-space: nowrap; pointer-events: none; transition: opacity .5s;
}
.explorer.touched .ex-hint, .explorer[data-colour="motion"] .ex-hint { opacity: 0; }
.ex-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(11, 16, 29, .45); opacity: 0; pointer-events: none; transition: opacity .2s; }
.explorer.loading .ex-loading { opacity: 1; }
.spin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .15); border-top-color: var(--motion); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.ex-fallback { display: none; position: absolute; inset: 0; margin: 0; padding: 24px; align-items: center; justify-content: center; text-align: center; color: var(--muted); }
.explorer.no-webgl .ex-fallback, .explorer.failed .ex-fallback { display: flex; }
.explorer.no-webgl .ex-hint, .explorer.no-webgl .ex-tools { display: none; }
.ex-side { grid-area: side; padding: 16px; display: flex; flex-direction: column; gap: 14px; border-left: 1px solid var(--edge); }
.ex-frame { margin: 0; }
.ex-frame img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; background: var(--bg-1); box-shadow: 0 0 0 1px var(--edge); transition: box-shadow .3s; }
.ex-frame figcaption { display: flex; align-items: center; gap: 6px; margin-top: 7px; font-size: .82rem; font-weight: 600; color: var(--ink-2); }
.ex-frame .src-tag { margin-left: auto; padding: 1px 8px; border-radius: 999px; font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--motion); border: 1px solid rgba(255, 121, 78, .5); opacity: 0; transition: opacity .3s; }
.ex-frame.src img { box-shadow: 0 0 0 2px var(--motion); }
.ex-frame.src .src-tag { opacity: 1; }
.ex-dl { margin-top: auto; display: inline-flex; align-items: center; gap: 7px; font-size: .82rem; font-weight: 600; color: var(--muted); }
.ex-dl:hover { color: var(--ink); text-decoration: none; }
.ex-dl svg { width: 16px; height: 16px; }
.ex-bar { grid-area: bar; display: flex; align-items: center; flex-wrap: wrap; gap: 12px 14px; padding: 14px 16px; border-top: 1px solid var(--edge); }
.ex-time { flex: 1 1 220px; display: flex; align-items: center; gap: 10px; min-width: 200px; color: var(--ink-2); }
.explorer.full { border-radius: 0; border: 0; height: 100vh; grid-template-rows: minmax(0, 1fr) auto; }
.explorer.full .ex-stage { aspect-ratio: auto; min-height: 0; }

/* ------------------------------------------------------------------ method */
.mblock { display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); gap: 56px; align-items: start; margin-top: 120px; }
.sec-head + .mblock { margin-top: 24px; }
.mblock.full { grid-template-columns: minmax(0, 1fr); gap: 22px; }
.mblock.full .mtext { max-width: 780px; }
.mblock.rope-block { grid-template-columns: minmax(0, .78fr) minmax(0, 1.22fr); }
.mtext h3 { display: flex; align-items: center; gap: 12px; font-size: clamp(1.3rem, 2.1vw, 1.65rem); margin-bottom: 14px; }
.mi { flex: none; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--edge-2); display: inline-flex; align-items: center; justify-content: center; font-size: .82rem; font-weight: 800; color: var(--muted); }
.mtext p { margin: 0 0 14px; }
.mtext a { font-weight: 600; }

.defs { display: grid; gap: 8px; margin: 18px 0 20px; }
.def {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "n m" "d m"; align-items: center; gap: 1px 16px;
  text-align: left; padding: 11px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--edge); cursor: pointer;
  transition: border-color .25s, background .25s, box-shadow .25s;
}
.def .dn { grid-area: n; font-weight: 650; color: var(--ink); }
.def .dn em { font-style: normal; color: var(--motion); }
.def .dd { grid-area: d; font-size: .82rem; color: var(--muted); }
.def .m { grid-area: m; color: var(--ink-2); font-size: 1.02rem; }
.def:hover { border-color: var(--edge-2); }
.def.on { border-color: color-mix(in srgb, var(--camera) 60%, transparent); background: var(--surface-2); box-shadow: inset 3px 0 0 var(--camera); }
.def.ours.on { border-color: color-mix(in srgb, var(--motion) 65%, transparent); box-shadow: inset 3px 0 0 var(--motion); }

.flowfig { margin: 0; padding: 14px 16px 16px; position: sticky; top: 88px; }
.flowfig svg { width: 100%; height: auto; }
#flow-svg text { font-family: "Inter", sans-serif; }
#flow-svg .math { font-family: var(--math); font-style: italic; }
.flow-ctrl { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px; margin-top: 8px; }
.read { font-size: .86rem; color: var(--muted); }
.read b { color: var(--camera); font-variant-numeric: tabular-nums; font-size: 1rem; }
.read.zero b { color: var(--ink); }
.read .s { color: var(--faint); }
.fnote { margin: 10px 0 12px; font-size: .92rem; color: var(--ink-2); min-height: 3.1em; }

.arch { padding: 18px 20px 20px; position: relative; overflow: hidden; }
.arch::before { content: ""; position: absolute; inset: 0; background: radial-gradient(900px 400px at 30% 0%, rgba(80, 158, 245, .07), transparent 70%), radial-gradient(700px 400px at 85% 100%, rgba(255, 121, 78, .06), transparent 70%); pointer-events: none; }
.arch-top { position: relative; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 8px; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tabs button {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--edge);
  background: transparent; color: var(--muted); font-size: .86rem; font-weight: 600; cursor: pointer; transition: color .2s, background .2s, border-color .2s;
}
.tabs button i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.tabs button:hover { color: var(--ink-2); border-color: var(--edge-2); }
.tabs button.on { color: var(--ink); background: var(--surface-2); border-color: var(--edge-2); }
.arch-scroll { position: relative; overflow-x: auto; margin: 0 -6px; padding: 0 6px; scrollbar-width: thin; }
.arch-svg { width: 100%; min-width: 780px; height: auto; overflow: visible; }
.arch-svg text { font-family: "Inter", sans-serif; }
.arch-svg .math { font-family: var(--math); font-style: italic; }
.arch-svg [data-part] { cursor: pointer; transition: opacity .35s var(--ease), filter .25s; }
.arch-svg.focusing [data-part]:not(.on) { opacity: .13; }
.arch-svg [data-part].hover { filter: brightness(1.3); }
.arch-svg.focusing .wire.on { stroke-width: 3; }
.arch-detail { position: relative; margin-top: 4px; padding: 16px 18px; border-radius: 14px; background: var(--bg-1); border: 1px solid var(--edge); min-height: 136px; }
.arch-detail h4 { margin: 0 0 6px; color: var(--ink); font-size: 1.02rem; }
.arch-detail p { margin: 0 0 10px; color: var(--ink-2); font-size: .95rem; max-width: 980px; }
.arch-detail .swapped { color: var(--muted); }
.arch-detail .io { display: flex; flex-wrap: wrap; gap: 8px; }
.arch-detail .io span { font-size: .82rem; padding: 4px 10px; border-radius: 8px; background: var(--surface-2); color: var(--muted); }

.rope { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.rope-panel { margin: 0; padding: 14px 14px 12px; display: flex; flex-direction: column; }
.rope-panel.ours { border-color: color-mix(in srgb, var(--motion) 55%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--motion) 18%, transparent), 0 30px 80px -40px rgba(255, 121, 78, .35); }
.rope-panel figcaption { font-weight: 700; color: var(--ink); font-size: .92rem; }
.rope-panel.ours figcaption { color: var(--motion); }
.rope-panel figcaption .s { color: var(--muted); font-weight: 500; }
.rope-panel canvas { width: 100%; aspect-ratio: 1; margin-top: 8px; border-radius: 12px; touch-action: pan-y; }
.rope-panel.ours canvas { cursor: grab; }
.rope-panel.ours canvas:active { cursor: grabbing; }
.rope-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px; margin-top: 14px; }
.hint { font-size: .86rem; color: var(--muted); }

.loss { padding: 24px 24px 22px; }
.eq { margin: 4px 0 22px; text-align: center; font-family: var(--math); font-size: clamp(1.1rem, 2vw, 1.5rem); color: var(--ink); }
.eq sub { font-size: .62em; font-family: "Inter", sans-serif; font-style: normal; }
.eq .g { color: var(--geom); } .eq .o { color: var(--motion); } .eq .s { color: var(--static); } .eq .l { color: var(--label); }
.terms { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.term { padding: 14px 16px 16px; border-radius: 14px; background: var(--bg-1); border: 1px solid var(--edge); box-shadow: inset 0 2px 0 var(--c); }
.term .tk { display: block; margin-bottom: 6px; font-family: var(--math); font-size: 1.12rem; color: var(--c); }
.term .tk sub { font-size: .62em; font-family: "Inter", sans-serif; }
.term p { margin: 0; font-size: .88rem; color: var(--muted); line-height: 1.55; }

.chamfer { padding: 20px 20px 18px; }
.chamfer-top { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 14px 32px; margin-bottom: 12px; }
.chamfer-intro { flex: 1 1 520px; max-width: 900px; }
.chamfer-intro h4 { margin: 0 0 2px; color: var(--ink); font-size: 1.05rem; }
.chamfer-intro .fnote { margin: 4px 0 0; min-height: 0; }
.chamfer .legend { padding: 0 2px 12px; }
.chamfer-stage { border-radius: 12px; background: var(--bg-1); border: 1px solid var(--edge); overflow: hidden; }
.chamfer-stage canvas { display: block; width: 100%; aspect-ratio: 900 / 330; cursor: crosshair; }
.chamfer-under { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 20px; margin-top: 10px; }
.chamfer-read { display: flex; flex-wrap: wrap; gap: 6px; font-size: .8rem; color: var(--muted); }
.chamfer-read span { padding: 3px 9px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--edge); }
.chamfer-read b { color: var(--ink); font-variant-numeric: tabular-nums; }
.chamfer-read .bad b { color: var(--camera); }
.chamfer-read .ok b { color: var(--geom); }
.chamfer-hint { margin: 0; font-size: .84rem; color: var(--muted); }
.chamfer-hint b { color: var(--ink); }
.chamfer-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 28px; margin-top: 16px; }
.chamfer-bar .slider { flex: 1 1 260px; }
.chamfer-bar .slider b { display: inline-block; min-width: 2ch; color: var(--ink); font-variant-numeric: tabular-nums; }
.chamfer-foot { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: 0 1 auto; }
.chamfer .res-note { margin: 14px 0 0; }
.formula { margin: 0; font-family: var(--math); font-size: clamp(1.05rem, 1.8vw, 1.3rem); color: var(--ink); }
.formula i { font-style: italic; }
.formula sub { font-size: .62em; font-family: "Inter", sans-serif; font-style: normal; }
.formula .l { color: var(--label); } .formula .o { color: var(--motion); } .formula .g { color: var(--geom); }
.formula.small { font-size: clamp(.86rem, 1.3vw, 1rem); color: var(--ink-2); }
.train-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 24px; }
.train-foot p { margin: 0; flex: 1 1 360px; font-size: .9rem; color: var(--muted); }
.train-foot p b { color: var(--ink-2); }

/* ------------------------------------------------------------------ citation / footer */
.cite-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; max-width: 860px; }
.bibtex { position: relative; padding: 0; overflow: hidden; }
.bibtex-header { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px 14px 22px; border-bottom: 1px solid var(--edge); }
.bibtex-header > span { font-size: .76rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.copy-bibtex-btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--edge-2);
  background: var(--surface-2); color: var(--ink); font-size: .84rem; font-weight: 600; cursor: pointer; transition: background .2s, border-color .2s;
}
.copy-bibtex-btn:hover { background: #1b2742; border-color: var(--muted); }
.copy-bibtex-btn svg { width: 15px; height: 15px; }
.copy-bibtex-btn.copied { border-color: #34d399; color: #34d399; }
.bibtex pre { margin: 0; padding: 20px 22px 22px; overflow-x: auto; font: 500 .86rem/1.7 ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace; color: var(--ink-2); }
.bibtex pre .bk { color: var(--motion); } .bibtex pre .bf { color: var(--geom); }
.ack { padding: 22px 24px; font-size: .92rem; color: var(--muted); line-height: 1.7; }
.ack h3 { font-size: .76rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.ack p { margin: 0; }
.footer { padding: 48px 0 64px; border-top: 1px solid var(--edge); font-size: .86rem; color: var(--faint); }
.footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px; }
.footer p { margin: 0; max-width: 720px; }
.footer .wordmark { font-size: 1.3rem; }

.scroll-to-top {
  position: fixed; right: 24px; bottom: 24px; z-index: 40; width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid var(--edge-2); background: rgba(15, 22, 38, .85); color: var(--ink); cursor: pointer;
  display: flex; align-items: center; justify-content: center; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  opacity: 0; visibility: hidden; transform: translateY(10px); transition: all .3s var(--ease);
}
.scroll-to-top.visible { opacity: 1; visibility: visible; transform: none; }
.scroll-to-top:hover { border-color: var(--muted); }
.scroll-to-top svg { width: 18px; height: 18px; }


/* ------------------------------------------------------------------ responsive */
@media (max-width: 1080px) {
  .ov-grid { grid-template-columns: 1fr; gap: 36px; }
  .mblock, .mblock.rope-block { grid-template-columns: 1fr; gap: 28px; margin-top: 96px; }
  .flowfig { position: static; }
  .terms { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .nav-links { display: none; }
  .more-works-container { margin-left: auto; }
  .hero-shade { background: linear-gradient(180deg, rgba(6, 9, 18, .5) 0%, rgba(6, 9, 18, .6) 40%, rgba(6, 9, 18, .82) 78%, var(--bg) 100%); }
  .hero-hud { left: 16px; right: 16px; bottom: 16px; justify-content: space-between; }
  .hud-hint { display: none; }
  .scroll-cue { display: none; }
  .abstract { grid-template-columns: 1fr; gap: 10px; margin-top: 64px; }
  .explorer { grid-template-columns: 1fr; grid-template-areas: "stage" "side" "bar"; }
  .ex-stage { aspect-ratio: 4 / 3.4; min-height: 0; }
  .ex-side { flex-direction: row; flex-wrap: wrap; border-left: 0; border-top: 1px solid var(--edge); padding: 12px; gap: 10px; }
  .ex-frame { flex: 1 1 0; min-width: 0; }
  .ex-dl { flex-basis: 100%; margin-top: 0; }
  .ex-hint { display: none; }
  .pick { width: 76px; height: 52px; }
  .arch-svg { min-width: 860px; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .section { padding: 80px 0; }
  .wrap { padding: 0 16px; }
  .nav-inner { padding: 0 16px; }
  .hero-content { padding: 96px 16px 120px; }
  .kpis b { font-size: 1.4rem; }
  .def { grid-template-columns: 1fr; grid-template-areas: "n" "m" "d"; }
  .terms { grid-template-columns: 1fr; }
  .rope { gap: 10px; }
  .rope-panel { padding: 10px 10px 8px; }
  .rope-panel figcaption .s { display: none; }
  .ex-bar { padding: 12px; gap: 10px; }
  .ex-bar .seg button { padding: 7px 11px; }
  .ex-info { left: 10px; top: 10px; }
  .ex-tools { right: 10px; top: 10px; }
  .ex-tools button { width: 34px; height: 34px; }
  .chamfer { padding: 14px; }
  .chamfer-foot { align-items: flex-start; }
  .scroll-to-top { right: 16px; bottom: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .scroll-cue::after, .hud-live i, .spin { animation: none; }
}
@media print {
  .topnav, .hero-hud, .scroll-cue, .scroll-to-top { display: none; }
}
