:root {
  --bg: #ffffff;
  --surface: #f7f8fa;
  --surface-strong: #eef1f4;
  --line: #d9dee6;
  --text: #17212b;
  --muted: #5b6674;
  --muted-strong: #3f4b58;
  --green: #0b7564;
  --blue: #245fa8;
  --red: #a64232;
  --ink: #111820;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

a {
  color: inherit;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 60px;
  padding: 0 32px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.brand {
  flex: 0 0 auto;
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
}

nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

nav a {
  text-decoration: none;
}

nav a:hover {
  color: var(--text);
}

.hero {
  padding: 82px 32px 48px;
  background: var(--bg);
}

.hero-inner,
.section > *,
.site-footer {
  max-width: 1120px;
  margin-left: auto;
  margin-right: auto;
}

.hero-inner {
  text-align: center;
}

.eyebrow,
.section-kicker {
  margin: 0 0 12px;
  color: var(--red);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  max-width: 1040px;
  margin: 0 auto 18px;
  font-size: 44px;
  line-height: 1.12;
  font-weight: 800;
}

.subtitle {
  max-width: 820px;
  margin: 0 auto 24px;
  color: var(--muted-strong);
  font-size: 19px;
  line-height: 1.45;
}

.author-block {
  max-width: 1000px;
  margin: 0 auto 26px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.author-list {
  margin-bottom: 8px;
  color: var(--text);
  font-weight: 750;
}

.author-list sup,
.affiliation-list sup {
  font-size: 0.72em;
  line-height: 0;
}

.corr-envelope {
  display: inline-flex;
  width: 0.95em;
  height: 0.95em;
  margin-left: 0.08em;
  vertical-align: -0.12em;
  color: currentColor;
}

.corr-envelope svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.note-envelope {
  width: 0.92em;
  height: 0.92em;
  margin: 0 0.08em 0 0;
  vertical-align: -0.08em;
}

.affiliation-list {
  margin-bottom: 8px;
}

.contribution-note {
  margin-bottom: 0;
}

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

.action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 102px;
  min-height: 40px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  font-weight: 750;
  text-decoration: none;
}

.action.primary {
  border-color: var(--ink);
  background: var(--ink);
  color: #ffffff;
}

.action.secondary {
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}

.action:disabled {
  cursor: default;
  opacity: 0.72;
}

.section {
  padding: 70px 32px;
}

section[id] {
  scroll-margin-top: 78px;
}

.section.narrow > * {
  max-width: 900px;
}

.muted {
  background: var(--surface);
}

.section-heading {
  margin-bottom: 22px;
}

h2 {
  margin-bottom: 12px;
  font-size: 32px;
  line-height: 1.2;
}

.section-heading p,
.section.narrow p {
  color: var(--muted);
}

.abstract-text {
  color: var(--text) !important;
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
}

.demo-section {
  padding-top: 56px;
  background: var(--surface);
}

.generation-explorer {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 48px rgba(17, 24, 32, 0.08);
}

.explorer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfd;
}

.toolbar-label {
  margin-bottom: 2px;
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.toolbar-title {
  margin: 0;
  color: var(--text);
  font-size: 20px;
  font-weight: 850;
}

.toolbar-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  color: var(--muted-strong);
  font-size: 13px;
}

.toolbar-stats span {
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
}

.toolbar-stats strong {
  color: var(--text);
}

.explorer-layout {
  display: grid;
  align-items: start;
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.7fr);
  gap: 12px;
  padding: 12px;
}

.camera-panel,
.stage-panel,
.input-deck,
.output-card,
.synth-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.camera-panel {
  display: flex;
  align-self: start;
  min-width: 0;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f6f9fb 100%);
}

.stage-panel {
  display: grid;
  min-width: 0;
  gap: 12px;
  padding: 12px;
  background: #f7f8fa;
}

.panel-heading h3,
.panel-heading p {
  margin: 0;
}

.panel-heading h3 {
  color: var(--text);
  font-size: 18px;
  line-height: 1.25;
}

.panel-heading.compact {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 8px;
}

.panel-kicker {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.spatial-map {
  position: relative;
  min-height: 320px;
  aspect-ratio: 1.32;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    radial-gradient(circle at 44% 34%, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0) 34%),
    linear-gradient(135deg, rgba(36, 95, 168, 0.1), rgba(11, 117, 100, 0.11)),
    #f8fafc;
  cursor: grab;
  touch-action: none;
}

.spatial-map:active {
  cursor: grabbing;
}

.spatial-map svg {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 320px;
  outline: none;
}

.spatial-map svg:focus-visible {
  box-shadow: inset 0 0 0 2px rgba(36, 95, 168, 0.42);
}

.map-action-hint {
  position: absolute;
  right: 10px;
  bottom: 9px;
  max-width: calc(100% - 20px);
  padding: 5px 8px;
  border: 1px solid rgba(139, 159, 176, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.2;
  pointer-events: none;
}

.map-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  color: var(--muted);
  text-align: center;
  font-weight: 750;
}

.map-placeholder[hidden] {
  display: none;
}

.map-floor {
  fill: rgba(230, 238, 246, 0.82);
  stroke: rgba(117, 139, 158, 0.42);
  stroke-width: 1.1;
}

.map-backdrop {
  fill: rgba(245, 248, 251, 0.62);
  stroke: rgba(160, 176, 190, 0.26);
  stroke-width: 1;
}

.map-grid-lines .grid-line {
  stroke: rgba(139, 159, 176, 0.34);
  stroke-linecap: round;
  stroke-width: 1.1;
}

.map-grid-lines .wall-grid-line {
  stroke: rgba(139, 159, 176, 0.18);
  stroke-dasharray: 3 7;
  stroke-linecap: round;
}

.scene-axes .axis-line {
  stroke-linecap: round;
  stroke-width: 2.1;
}

.axis-x {
  stroke: rgba(36, 95, 168, 0.42);
}

.axis-y {
  stroke: rgba(82, 93, 105, 0.3);
}

.axis-z {
  stroke: rgba(11, 117, 100, 0.4);
}

.trajectory-shadow {
  fill: none;
  stroke: rgba(10, 18, 32, 0.14);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 7;
}

.trajectory-line {
  fill: none;
  stroke: var(--green);
  stroke-dasharray: 8 8;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4.2;
}

.trajectory-knot {
  fill: #ffffff;
  stroke: var(--green);
  stroke-width: 2;
}

.trajectory-knot.active {
  fill: var(--red);
  stroke: #ffffff;
  stroke-width: 2.4;
}

.ray-fan .ray-line {
  stroke: rgba(36, 95, 168, 0.22);
  stroke-dasharray: 4 7;
  stroke-linecap: round;
  stroke-width: 2.1;
}

.camera-frustum {
  transition: opacity 160ms ease;
}

.camera-shadow {
  fill: rgba(10, 18, 32, 0.13);
}

.frustum-face {
  stroke-linejoin: round;
  stroke-width: 2;
}

.frustum-edge {
  stroke-linecap: round;
  stroke-width: 1.75;
}

.input-camera .frustum-face {
  fill: rgba(36, 95, 168, 0.17);
  stroke: var(--blue);
}

.input-camera .frustum-edge,
.input-camera .camera-center {
  stroke: var(--blue);
}

.input-camera .camera-center {
  fill: #ffffff;
}

.output-camera .frustum-face {
  fill: rgba(166, 66, 50, 0.13);
  stroke: var(--red);
}

.output-camera .frustum-edge,
.output-camera .camera-center {
  stroke: var(--red);
}

.output-camera .camera-center {
  fill: #ffffff;
}

.camera-frustum text {
  font-family: inherit;
  font-size: 13px;
  font-weight: 850;
  paint-order: stroke;
  stroke: #ffffff;
  stroke-width: 3px;
}

.input-camera text {
  fill: var(--blue);
}

.output-camera text,
.current-camera text {
  fill: var(--red);
}

.input-camera.active .frustum-face {
  fill: #fff4f1;
  stroke: var(--red);
}

.input-camera.active .frustum-edge,
.input-camera.active .camera-center {
  stroke: var(--red);
}

.input-camera.active text {
  fill: var(--red);
}

.output-camera {
  opacity: 0.46;
}

.output-camera.active {
  opacity: 0.78;
}

.current-camera {
  opacity: 1;
  filter: drop-shadow(0 10px 14px rgba(166, 66, 50, 0.28));
}

.current-camera .frustum-face {
  fill: #fff4f1;
  stroke: var(--red);
  stroke-width: 2.8;
}

.current-camera .frustum-edge,
.current-camera .camera-center {
  stroke: var(--red);
  stroke-width: 2.4;
}

.track-controls {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  gap: 6px 8px;
  align-items: center;
}

#trackBack {
  grid-column: 1;
  grid-row: 2;
}

#trackForward {
  grid-column: 3;
  grid-row: 2;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: 850;
}

.icon-button:hover,
.input-view-tile:hover,
.output-view-tile:hover {
  border-color: #b9c2cc;
  background: #fbfcfd;
}

.track-slider-label {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

#trackSlider {
  grid-column: 2;
  grid-row: 2;
  width: 100%;
  accent-color: var(--green);
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.input-dot {
  border: 2px solid var(--blue);
  background: #ffffff;
}

.target-dot {
  background: var(--red);
}

.legend-line {
  display: inline-block;
  width: 22px;
  border-top: 3px dashed var(--green);
}

.input-deck {
  padding: 12px;
}

.input-view-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.output-view-grid {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: repeat(3, auto);
  flex: 0 0 auto;
  gap: 6px;
  padding: 8px;
  background: #f7f9fb;
}

.input-view-tile,
.output-view-tile {
  display: grid;
  min-width: 0;
  gap: 5px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.output-view-tile {
  grid-template-rows: minmax(0, 1fr) auto;
}

.input-view-tile.active,
.output-view-tile.active {
  border-color: var(--red);
  box-shadow: 0 0 0 2px rgba(166, 66, 50, 0.12);
}

.input-thumb-frame,
.output-thumb-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 6.9;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #eef2f6;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.output-thumb-frame {
  min-height: 0;
  aspect-ratio: 16 / 9.8;
}

.input-thumb-frame.has-media img,
.output-thumb-frame.has-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.input-thumb-label,
.output-thumb-label {
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 800;
}

.view-stage {
  display: grid;
  grid-template-columns: minmax(150px, 0.42fr) minmax(0, 1.32fr);
  gap: 12px;
  align-items: stretch;
}

.output-card,
.synth-card {
  display: flex;
  min-width: 0;
  margin: 0;
  flex-direction: column;
  overflow: hidden;
}

.media-frame {
  position: relative;
  display: flex;
  min-height: 0;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #f1f4f7;
}

.video-frame {
  height: clamp(260px, 24vw, 320px);
  background: var(--ink);
}

.media-frame img,
.media-frame video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.video-frame video {
  min-height: 0;
  background: var(--ink);
}

.media-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  color: var(--muted);
  text-align: center;
  background: #f1f4f7;
  font-weight: 750;
}

.video-frame .media-placeholder {
  color: #dce5ee;
  background: var(--ink);
}

.media-frame.has-media .media-placeholder {
  display: none;
}

figcaption {
  padding: 8px 10px 10px;
  color: var(--muted);
  font-size: 12px;
}

.analysis-stack {
  display: grid;
  max-width: 940px;
  gap: 18px;
}

.figure {
  margin-top: 0;
  margin-bottom: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.figure img {
  width: 100%;
  background: #ffffff;
}

.analysis-figure:first-child img {
  padding: 14px;
}

.analysis-figure img {
  max-height: 520px;
  object-fit: contain;
}

.method-figure {
  max-width: 920px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.citation-section {
  background: #ffffff;
}

.bibtex-card {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111820;
}

.bibtex-card pre {
  margin: 0;
  padding: 18px 20px;
  color: #f6f8fb;
  font: 13px/1.65 "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  white-space: pre;
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

caption {
  padding: 16px 18px 0;
  text-align: left;
  color: var(--muted);
  font-weight: 750;
}

th,
td {
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--surface-strong);
  color: #2c3440;
  font-size: 13px;
  text-transform: uppercase;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.ours td {
  background: #eef7f3;
  color: #123b34;
  font-weight: 750;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 32px;
  color: var(--muted);
  font-size: 14px;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: var(--text);
  font-weight: 750;
  text-decoration: none;
}

@media (max-width: 980px) {
  .explorer-layout,
  .view-stage {
    grid-template-columns: 1fr;
  }

  .input-view-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .spatial-map,
  .spatial-map svg {
    min-height: 300px;
  }

  .video-frame,
  .video-frame video {
    height: 300px;
  }

}

@media (max-width: 900px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 22px;
  }

  nav {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 14px;
    white-space: normal;
  }

  .hero {
    padding: 64px 22px 42px;
  }

  .section {
    padding: 54px 22px;
  }

  section[id] {
    scroll-margin-top: 124px;
  }

  h1 {
    font-size: 34px;
  }

  h2 {
    font-size: 27px;
  }

  .subtitle {
    font-size: 17px;
  }

  .site-footer {
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 15px;
  }

  .brand {
    line-height: 1.25;
  }

  nav {
    font-size: 13px;
  }

  h1 {
    font-size: 28px;
  }

  .action {
    min-width: 94px;
    min-height: 38px;
    padding: 0 14px;
  }

  .generation-explorer {
    border-radius: 8px;
  }

  .explorer-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbar-stats {
    justify-content: flex-start;
  }

  .explorer-layout {
    padding: 10px;
  }

  .track-controls {
    grid-template-columns: 34px minmax(0, 1fr) 34px;
  }

  .video-frame,
  .video-frame video {
    height: 230px;
  }

  .abstract-text {
    text-align: left;
    hyphens: none;
  }

  th,
  td {
    padding: 11px 13px;
  }
}
