:root {
  --primary: #5b8def;
  --primary-dark: #0f3f6f;
  --primary-soft: #eef4fd;
  --red: #ef4b36;
  --red-soft: #fff0ed;
  --cyan: #1787a8;
  --text: #18181b;
  --muted: #71717a;
  --light: #9a9ea6;
  --border: #e4e4e7;
  --bg-alt: #f7f7f6;
  --container-width: 57.5rem;
  --figure-width: 57.5rem;
  --font-sans: "Carlito", "Calibri", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --nav-h: 60px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 76px;
}

body {
  margin: 0;
  padding-left: 10.5rem;
  background:
    radial-gradient(circle at 16px 16px, rgba(24, 24, 27, 0.035) 1px, transparent 1.5px) 0 0 / 32px 32px,
    #fafaf9;
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

button {
  font: inherit;
}

p {
  margin: 0.8rem 0 1.5rem;
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.7;
  text-align: left;
}

strong {
  font-weight: 700;
}

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

.section {
  width: 100%;
  padding: 4.5rem 0;
  border-top: 1px solid var(--border);
}

.section.alt-bg {
  background: var(--bg-alt);
}

.section-title {
  width: fit-content;
  margin: 0 0 2rem;
  padding-bottom: 0.72rem;
  border-bottom: 2px solid var(--border);
  color: var(--text);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.subsection-title {
  margin: 3.25rem 0 1rem;
  color: var(--text);
  font-size: 1.2rem;
  font-weight: 700;
}

.sidebar {
  position: fixed;
  z-index: 100;
  top: 50%;
  left: 2.2rem;
  transform: translateY(-50%);
}

.sidebar-nav {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.sidebar-nav::before {
  position: absolute;
  z-index: 0;
  top: 0;
  bottom: 0;
  left: 5px;
  width: 1px;
  background: var(--border);
  content: "";
}

.sidebar-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  transition: color 0.2s;
}

.sidebar-dot {
  position: relative;
  z-index: 2;
  width: 11px;
  height: 11px;
  border: 2px solid #fafaf9;
  border-radius: 50%;
  background: var(--light);
  box-sizing: content-box;
  transition: background 0.2s, transform 0.2s;
}

.sidebar-item:hover .sidebar-dot,
.sidebar-item.active .sidebar-dot {
  background: var(--text);
  box-shadow: 0 0 0 4px rgba(24, 24, 27, 0.1);
  transform: scale(1.15);
}

.sidebar-item:hover .sidebar-label,
.sidebar-item.active .sidebar-label {
  color: var(--text);
  font-weight: 700;
}

.sidebar-item:hover,
.sidebar-item.active {
  color: var(--text);
}

.hero-section {
  margin-bottom: 3rem;
  text-align: center;
}

.hero-cover {
  display: flex;
  min-height: calc(100vh - var(--nav-h, 60px));
  padding: 2.2rem 0;
  flex-direction: column;
  justify-content: center;
  box-sizing: border-box;
}

.hero-container {
  max-width: 57.5rem;
  margin: 0 auto 2.6rem;
  padding: 0 1rem;
}

.hero-title {
  margin: 0 0 1.1rem;
  color: var(--text);
  font-size: clamp(1.65rem, 2.6vw, 2.3rem);
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: -0.01em;
}

.hero-authors {
  display: flex;
  margin: 0 auto 0.85rem;
  flex-direction: column;
  gap: 0.1rem;
}

.author-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  column-gap: 1rem;
  row-gap: 0.2rem;
}

.hero-authors span,
.hero-authors a {
  color: var(--text);
  font-size: 0.96rem;
  font-weight: 400;
  line-height: 1.35;
}

.hero-authors a:hover {
  color: var(--red);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.hero-authors sup,
.hero-affiliations sup {
  position: relative;
  top: -0.25em;
  margin-left: 0.08em;
  font-size: 0.67em;
}

.hero-affiliations {
  display: flex;
  margin-bottom: 0.7rem;
  justify-content: center;
  gap: 1.25rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.3;
}

.venue-row {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 1.1rem;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  line-height: 1.3;
}

.hero-venue {
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-venue-secondary {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.hero-venue-sep {
  color: var(--light);
}

.hero-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  font-size: 1.02rem;
  line-height: 1.3;
}

.hero-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text);
  font-weight: 700;
  transition: color 0.15s;
}

.hero-links a:hover {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.hero-links a svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.hero-links-sep {
  color: var(--light);
}

.teaser-container {
  max-width: var(--figure-width);
  margin: 0 auto 2rem;
  padding: 0 1rem;
}

.concept-animation {
  position: relative;
}

.animation-canvas-shell {
  position: relative;
  width: 100%;
  background: #fff;
}

#collaborative-perception-animation {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #fff;
}

.figure-container {
  max-width: var(--figure-width);
  margin: 2rem auto 0;
  padding: 1.15rem;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
}

.figure-container img {
  width: 100%;
}

.figure-caption,
.table-caption {
  display: block;
  margin: 0.7rem auto 0;
  color: var(--light);
  font-size: 0.89rem;
  line-height: 1.5;
  text-align: center;
}

.ranker-figure {
  padding: 0.8rem;
}

.gaps-figure {
  max-width: 34rem;
}

.ranker-architecture-figure {
  max-width: 34rem;
  padding: 0.8rem;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

th,
td {
  padding: 0.95rem 1rem;
  border-bottom: 1px solid var(--border);
  text-align: center;
  white-space: nowrap;
}

th:first-child,
td:first-child {
  text-align: left;
}

th {
  background: var(--bg-alt);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

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

.row-ours {
  background: #edf3ff;
  color: var(--primary-dark);
}

.qualitative-figure {
  margin-top: 3.25rem;
  padding: 0.7rem;
}

.citation-section {
  padding: 4.5rem 0;
  border-top: 1px solid var(--border);
  background: #fff;
}

.citation-title {
  border-color: var(--border);
}

.citation-block {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-alt);
}

.citation-code {
  margin: 0;
  padding: 1.5rem 5.5rem 1.5rem 1.5rem;
  overflow-x: auto;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.65;
}

.citation-copy-btn {
  position: absolute;
  z-index: 2;
  top: 0.85rem;
  right: 0.85rem;
  padding: 0.43rem 0.72rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 700;
}

.citation-copy-btn:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  background: #fff;
  text-align: center;
}

.footer p {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

.footer a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.js .fade-in-section {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.js .fade-in-section.is-visible {
  opacity: 1;
  transform: none;
}

@media (max-width: 1280px) {
  body {
    padding-left: 0;
  }

  .sidebar {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    padding: 0.8rem 1rem;
    overflow-x: auto;
    border-bottom: 1px solid var(--border);
    background: rgba(250, 250, 249, 0.92);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transform: none;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    scrollbar-width: none;
  }

  .sidebar::-webkit-scrollbar {
    display: none;
  }

  .sidebar-nav {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 1.3rem;
  }

  .sidebar-nav::before,
  .sidebar-dot {
    display: none;
  }

  .sidebar-item {
    gap: 0;
    padding: 0.4rem 0.2rem;
    font-size: 0.85rem;
  }
}

@media (max-width: 768px) {
  p {
    font-size: 0.95rem;
  }

  .section {
    padding: 3.5rem 0;
  }

  .sidebar {
    gap: 0.8rem;
    padding: 0.7rem 1rem;
  }

  .sidebar-nav {
    justify-content: flex-start;
    gap: 0.8rem;
  }

  .sidebar-item {
    font-size: 0.78rem;
  }

  .author-row {
    column-gap: 0.72rem;
  }

  .hero-authors span,
  .hero-authors a {
    font-size: 0.85rem;
  }

  .hero-affiliations {
    flex-direction: column;
    gap: 0.25rem;
  }

  .citation-code {
    padding: 3.5rem 1.2rem 1.2rem;
    font-size: 0.74rem;
  }
}

@media (max-width: 480px) {
  .hero-container {
    padding: 0 0.85rem;
  }

  .figure-container {
    padding: 0.4rem;
    border-radius: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
