:root {
  --text: #1a1a1a;
  --muted: #5a5a5a;
  --rule: #e3e3e3;
  --bg: #ffffff;
  --accent: #1a4f8b;
  --pill-bg: #1a1a1a;
  --pill-fg: #ffffff;
  --code-bg: #f6f7f9;
  --max-width: 840px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* -------- Hero -------- */

.hero {
  padding: 3.5rem 0 1.5rem;
  text-align: center;
  border-bottom: 1px solid var(--rule);
}

.hero h1 {
  font-size: 2rem;
  line-height: 1.25;
  font-weight: 600;
  margin: 0 0 1.25rem;
  letter-spacing: -0.01em;
}

.authors {
  font-size: 1.05rem;
  margin: 0.25rem 0;
  color: var(--text);
}
.authors a { color: var(--text); }
.authors a:hover { color: var(--accent); }

.affil, .venue {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0.25rem 0;
}
.venue { margin-top: 0.5rem; font-weight: 500; }

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

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  background: var(--pill-bg);
  color: var(--pill-fg);
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 500;
  transition: opacity 0.15s ease;
}
.pill:hover { opacity: 0.82; text-decoration: none; }
.pill svg { width: 16px; height: 16px; }

/* -------- Sections -------- */

section {
  padding: 2.5rem 0 0.5rem;
}

section h2 {
  font-size: 1.4rem;
  font-weight: 600;
  margin: 0 0 1rem;
  letter-spacing: -0.005em;
}

section p {
  margin: 0 0 1rem;
}

/* -------- Figures & video -------- */
/*
 * Width presets. Apply one of these classes on <figure>:
 *   (default)   fills container, up to the figure's intrinsic width
 *   .fig-medium max 540px, centered  — for one-column / narrow figures
 *   .fig-small  max 380px, centered  — for tiny diagrams or PSFs
 * Image rows: use <div class="fig-row"> inside a figure to lay out
 * multiple <img> elements side by side.
 */

figure {
  margin: 1.5rem 0;
}

figure img,
figure video {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  background: transparent;
}

figure video {
  border: 0;
  outline: 0;
  background: #fff;
}

figure .video-wrapper {
  overflow: hidden;
  position: relative;
  line-height: 0;
  clip-path: inset(0.5px);
}

figure .video-wrapper video {
  width: calc(100% + 2px);
  margin: -1px;
  object-fit: cover;
  /* No object-fit: with width/height attributes on the <video>, the box
     already matches the video's intrinsic aspect ratio exactly, so the
     frame fills it without letterboxing or cropping. */
}

figure.fig-medium > img,
figure.fig-medium > video,
figure.fig-medium > .fig-row {
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
}

figure.fig-small > img,
figure.fig-small > video,
figure.fig-small > .fig-row {
  max-width: 380px;
  margin-left: auto;
  margin-right: auto;
}

.fig-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
  justify-content: center;
  /* Slightly narrower than the text column — keeps side-by-side images
     from feeling oversized. Overridden by .fig-medium / .fig-small caps. */
  max-width: 87.5%;
  margin-left: auto;
  margin-right: auto;
}

.fig-row > figure,
.fig-row > .fig-item {
  flex: 1 1 0;
  min-width: 0;
  margin: 0;
}

.fig-row > figure > figcaption,
.fig-row > .fig-item > .fig-sub {
  text-align: center;
  font-size: 0.82rem;
  margin-top: 0.35rem;
  color: var(--muted);
}

figcaption {
  margin-top: 0.6rem;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.5;
}

figcaption strong {
  color: var(--text);
  font-weight: 600;
}

/* -------- BibTeX -------- */

pre {
  background: var(--code-bg);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.5;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  margin: 0.5rem 0 1.5rem;
}

/* -------- Footer -------- */

footer {
  margin-top: 3rem;
  padding: 1.5rem 0 2rem;
  border-top: 1px solid var(--rule);
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
}

/* -------- Section navigation -------- */

.section-nav {
  position: fixed;
  top: 50%;
  right: 1.25rem;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  z-index: 10;
}

.section-nav a {
  position: relative;
  display: block;
  width: 18px;
  height: 18px;
  padding: 4px;
}

.section-nav a span {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #c8c8c8;
  transition: background 0.2s ease, transform 0.2s ease;
}

.section-nav a:hover span,
.section-nav a.is-active span {
  background: var(--text);
  transform: scale(1.25);
}

.section-nav a::before {
  content: attr(data-label);
  position: absolute;
  right: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  padding: 0.25rem 0.55rem;
  background: var(--text);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
  border-radius: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.section-nav a:hover::before {
  opacity: 1;
}

/* -------- Narrow screens -------- */

@media (max-width: 1100px) {
  .section-nav { display: none; }
}

@media (max-width: 520px) {
  html, body { font-size: 16px; }
  .hero { padding-top: 2.5rem; }
  .hero h1 { font-size: 1.55rem; }
  .pill { padding: 0.45rem 0.85rem; font-size: 0.9rem; }
  section h2 { font-size: 1.2rem; }
}
