:root {
  --bg: #0b0c0e;
  --surface: #141619;
  --surface-2: #1c1f24;
  --line: #2a2e35;
  --text: #e8e9ec;
  --muted: #9aa0a8;
  --faint: #6b7280;
  --accent: #7dd3fc;
  --accent-dim: #38598a;
  --radius: 10px;
  --measure: 46rem;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.wrap {
  width: 100%;
  max-width: 68rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

section { padding: 3.5rem 0; }
section + section { border-top: 1px solid var(--line); }

h1, h2, h3 { font-family: var(--font-serif); font-weight: 600; line-height: 1.2; }

h2 {
  font-size: 1.6rem;
  margin: 0 0 1.5rem;
  letter-spacing: -0.01em;
  text-align: center;
}

p { margin: 0 0 1.1rem; }

.lead {
  max-width: var(--measure);
  margin: -0.9rem auto 1.6rem;
  color: var(--muted);
  text-align: center;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code, kbd { font-family: var(--font-mono); font-size: 0.9em; }

.hero { padding: 5rem 0 3.5rem; text-align: center; }

.hero h1 {
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  margin: 0 0 0.6rem;
  letter-spacing: -0.02em;
}

.hero .tagline {
  font-size: clamp(1.05rem, 2.4vw, 1.3rem);
  color: var(--muted);
  max-width: 40rem;
  margin: 0 auto 2.2rem;
  line-height: 1.45;
}

.venue {
  display: inline-block;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.25rem 0.85rem;
  margin-bottom: 1.5rem;
}

.authors {
  font-size: 1.02rem;
  margin: 0 0 0.5rem;
  color: var(--text);
}
.authors a { color: var(--text); }
.authors a:hover { color: var(--accent); }
.authors sup { color: var(--accent); font-size: 0.72em; padding-left: 0.1em; }

.affiliations {
  font-size: 0.92rem;
  color: var(--muted);
  margin: 0 0 2rem;
}
.affiliations sup { color: var(--accent); }

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 999px;
  padding: 0.5rem 1.15rem;
  font-size: 0.95rem;
  font-weight: 500;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.btn:hover {
  background: #23272e;
  border-color: var(--accent-dim);
  text-decoration: none;
  transform: translateY(-1px);
}
.btn svg { width: 1em; height: 1em; fill: currentColor; opacity: 0.85; }

.btn[aria-disabled="true"] {
  opacity: 0.4;
  pointer-events: none;
  cursor: default;
}
.btn[aria-disabled="true"]::after {
  content: "soon";
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--faint);
}

figure { margin: 0 0 1.5rem; }

figure img,
figure video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
}

figcaption {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
  margin-top: 0.75rem;
  max-width: var(--measure);
}
figcaption b { color: var(--text); font-weight: 600; }

.teaser {
  position: relative;
  width: min(100%, 52rem, calc(62vh * 16 / 9));
  margin: 0 auto 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #000;
  overflow: hidden;
  line-height: 0;
}
.teaser video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0;
}

.teaser-play {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: #fff;
  cursor: pointer;
}
.teaser-play[hidden] { display: none; }
.teaser-play svg {
  width: 48px;
  height: 48px;
  fill: currentColor;
  opacity: .6;
  filter: drop-shadow(0 1px 8px rgba(0, 0, 0, .6));
  transition: opacity .15s;
}
.teaser-play:hover svg { opacity: .95; }
.teaser-play:focus-visible { outline: none; }
.teaser-play:focus-visible svg {
  opacity: .95;
  outline: 2px solid var(--accent);
  outline-offset: 10px;
  border-radius: 50%;
}

.bibtex {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.83rem;
  line-height: 1.6;
  color: var(--muted);
  margin: 0;
}

.bibtex { text-align: left; }
.bibtex code { white-space: pre; }

.copy-btn {
  float: right;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 6px;
  padding: 0.25rem 0.7rem;
  font-size: 0.78rem;
  font-family: var(--font-sans);
  cursor: pointer;
}
.copy-btn:hover { color: var(--text); border-color: var(--accent-dim); }

footer {
  border-top: 1px solid var(--line);
  padding: 2.5rem 0 3.5rem;
  font-size: 0.85rem;
  color: var(--faint);
  text-align: center;
}
footer p { margin: 0 0 0.5rem; }
.zea-credit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .85rem;
  margin-top: 1.75rem;
  color: var(--muted);
}
.zea-credit img { display: block; flex-shrink: 0; }
.zea-credit p { margin: 0; text-align: left; line-height: 1.7; }
.zea-credit strong { color: var(--text); font-weight: 600; }
.zea-credit a { font-size: .8rem; }

@media (max-width: 640px) {
  body { font-size: 16px; }
  .hero { padding: 3rem 0 2.5rem; }
  section { padding: 2.5rem 0; }
}

#trajectory { --dps-w: min(100%, 52rem, calc((62vh - 3.4rem) * 1.82 + 1.25rem)); }

.dps { width: var(--dps-w); margin: 0 auto; }

.dps-stage {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 6fr);
  gap: 1.25rem;
  align-items: start;
}

.dps-panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #000;
  overflow: hidden;
}
.dps-panel canvas { display: block; width: 100%; height: auto; }

.dps-tag {
  position: absolute;
  top: 0.5rem;
  left: 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--faint);
  pointer-events: none;
}

.dps-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: var(--surface);
  color: var(--faint);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.dps.is-ready .dps-loading { display: none; }
.dps-progress {
  width: 8rem;
  height: 2px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
}
.dps-progress > span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.2s ease;
}
.dps.is-failed .dps-loading-label { display: none; }
.dps.is-failed .dps-progress { display: none; }
.dps.is-failed .dps-loading::after { content: "could not load"; }

.dps-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.1rem;
}

.dps-play {
  flex: none;
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.dps-play:hover:not(:disabled) { border-color: var(--accent-dim); background: #23272e; }
.dps-play:disabled { opacity: 0.35; cursor: default; }
.dps-play svg { width: 0.85rem; height: 0.85rem; fill: currentColor; }
.dps-play .icon-pause,
.dps-play.is-playing .icon-play { display: none; }
.dps-play.is-playing .icon-pause { display: block; }

.dps-slider {
  flex: 1 1 auto;
  min-width: 0;
  -webkit-appearance: none;
  appearance: none;
  height: 3px;
  border-radius: 3px;
  background: var(--line);
  cursor: pointer;
}
.dps-slider:disabled { opacity: 0.4; cursor: default; }
.dps-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: var(--text);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 1px var(--line);
  cursor: grab;
}
.dps-slider::-moz-range-thumb {
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--text);
  border: 2px solid var(--bg);
  cursor: grab;
}
.dps-slider:focus-visible { outline: 2px solid var(--accent-dim); outline-offset: 4px; }

@media (max-width: 820px) {
  #trajectory { --dps-w: 100%; }
  .dps-stage { grid-template-columns: 1fr; }
  .dps-controls { flex-wrap: wrap; }
}

.gal { margin: 0; --thumb: 14px; }

.gal-controls {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1rem 2rem;
  align-items: end;
  margin-bottom: 1rem;
}

.gal-ctl-nb { grid-column: 1 / -1; }

.gal-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 0.45rem;
}

.gal-nbwrap { padding-bottom: 0.1rem; }

.gal-slider {
  display: block;
  width: 100%;

  margin: 0;
  -webkit-appearance: none;
  appearance: none;
  height: 3px;
  border-radius: 3px;
  background: var(--line);
  cursor: pointer;
}
.gal-slider:disabled { opacity: 0.4; cursor: default; }
.gal-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: var(--thumb); height: var(--thumb);
  border-radius: 50%;
  background: var(--text);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 1px var(--line);
  cursor: grab;
}
.gal-slider::-moz-range-thumb {
  width: var(--thumb); height: var(--thumb);
  box-sizing: border-box;
  border-radius: 50%;
  background: var(--text);
  border: 2px solid var(--bg);
  cursor: grab;
}
.gal-slider:focus-visible { outline: 2px solid var(--accent-dim); outline-offset: 4px; }

.gal-ticks {
  position: relative;
  height: 1em;
  margin-top: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  color: var(--faint);
}
.gal-ticks > span {
  position: absolute;
  top: 0;
  left: calc(var(--thumb) / 2 + (100% - var(--thumb)) * var(--i) / var(--n));
  transform: translateX(-50%);
  white-space: nowrap;
}

.gal-readout {
  margin: 0.45rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}
.gal-readout b {
  font-family: var(--font-mono);
  color: var(--text);
  font-weight: 400;
}

.gal-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }

.gal-chip {
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.28rem 0.65rem;
  font-family: var(--font-sans);
  font-size: 0.76rem;
  line-height: 1.1;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.gal-chip:hover { color: var(--text); border-color: var(--accent-dim); }
.gal-chip.is-on {
  color: var(--bg);
  background: var(--text);
  border-color: var(--text);
}
.gal-chip:focus-visible { outline: 2px solid var(--accent-dim); outline-offset: 2px; }

.gal-chips-num .gal-chip {
  min-width: 1.9rem;
  padding: 0.28rem 0.38rem;
  font-family: var(--font-mono);
  text-align: center;
}

.gal-stage { text-align: center; }
.gal-stage canvas { display: inline-block; vertical-align: top; }

.gal.is-busy .gal-stage { opacity: 0.55; transition: opacity 0.15s ease; }

.gal-loading {
  text-align: center;
  color: var(--faint);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: none;
}
.gal:not(.is-ready) .gal-loading,
.gal.is-failed .gal-loading { display: block; }
.gal.is-failed .gal-loading-label { display: none; }
.gal.is-failed .gal-loading::after { content: "could not load"; }

@media (max-width: 900px) {
  .gal-controls { grid-template-columns: minmax(0, 1fr); }
  .gal-ctl-nb { grid-column: auto; }
}
