:root {
  --primary: #5b8def;
  --primary-dark: #0f3f6f;
  --primary-soft: #eef4fd;
  --red: #ef4b36;
  --red-soft: #fff0ed;
  --text: #18181b;
  --muted: #71717a;
  --light: #9a9ea6;
  --border: #e4e4e7;
  --bg-alt: #f7f7f6;
  --container-width: 68rem;
  --figure-width: 76rem;
  --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;
  margin: 0;
  padding: 0;
}

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

body {
  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;
}

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

img {
  height: auto;
}

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

h1,
h2,
h3 {
  color: var(--text);
  font-weight: 700;
  line-height: 1.2;
}

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

.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: 3rem 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: 62rem;
  margin: 0 auto 2.6rem;
  padding: 0 1rem;
}

.hero-title {
  margin: 0 0 1.1rem;
  color: var(--text);
  font-size: clamp(1.5rem, 2.4vw, 2.15rem);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.hero-authors {
  display: flex;
  margin: 0 auto 0.85rem;
  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;
  white-space: nowrap;
}

.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;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.3;
}

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

.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 {
  width: 100%;
  max-width: 76rem;
  margin: 0 auto 2rem;
  padding: 0 1rem;
}

.hero-video-container {
  max-width: 68rem;
  margin: 0 auto;
}

.video-container {
  position: relative;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-alt);
}

.video-container video {
  width: 100%;
  height: auto;
  border-radius: 13px;
  cursor: pointer;
}

.hero-video,
.lazy-video {
  min-height: 120px;
  background: linear-gradient(110deg, var(--border) 30%, var(--bg-alt) 50%, var(--border) 70%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

.hero-video.loaded,
.lazy-video.loaded {
  background: none;
  animation: none;
}

.video-badge {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 3px 9px;
  border-radius: 5px;
  background: rgba(24, 24, 27, 0.72);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  pointer-events: none;
}

.video-badge-red {
  background: rgba(239, 75, 54, 0.82);
}

.video-caption,
.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;
}

.tldr-box {
  max-width: var(--figure-width);
  margin: 0 auto;
  padding: 1.5rem 1.65rem;
  border: 1px solid var(--border);
  border-left: 4px solid var(--text);
  border-radius: 0 12px 12px 0;
  background: var(--bg-alt);
  text-align: left;
}

.tldr-content {
  display: flex;
  align-items: flex-start;
  gap: 1.15rem;
}

.tldr-label {
  flex: 0 0 auto;
  padding: 0.3rem 0.62rem;
  border-radius: 6px;
  background: var(--text);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.tldr-text {
  margin: -0.08rem 0 0;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.7;
}

.tldr-highlight {
  color: var(--text);
  font-weight: 700;
}

.video-block {
  margin-top: 3rem;
}

.video-block + .video-block {
  margin-top: 4rem;
}

.two-col {
  margin-bottom: 1.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  gap: 1.25rem;
}

.figure-container {
  width: 100%;
  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%;
}

.insight-box {
  margin-top: 2.5rem;
  padding: 1.35rem 1.5rem;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 0 12px 12px 0;
  background: var(--bg-alt);
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 1.2rem;
}

.insight-box > span {
  padding: 0.18rem 0.55rem;
  border-radius: 4px;
  background: var(--primary);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.insight-box p {
  margin: 0;
  font-size: 1.05rem;
}

.method-primary {
  margin-top: 3rem;
  padding: 1.5rem 1.75rem;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 0 0.55rem 0.55rem 0;
  background: #fff;
}

.method-primary h3 {
  color: var(--text);
  font-size: 1.12rem;
  font-weight: 650;
}

.method-primary p {
  margin: 0.6rem 0 0;
  color: var(--muted);
  font-size: 0.96rem;
}

.method-bonus {
  margin-top: 1rem;
  padding: 1.1rem 1.4rem;
  border: 1px dashed var(--border);
  border-radius: 0.55rem;
  background: var(--bg-alt);
}

.method-bonus-tag {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.method-bonus h3 {
  margin-top: 0.4rem;
  color: var(--text);
  font-size: 0.98rem;
  font-weight: 650;
}

.method-bonus p {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

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

table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
  font-size: 0.82rem;
}

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

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

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

td {
  color: var(--muted);
  font-family: var(--font-mono);
}

td:first-child {
  color: var(--text);
  font-family: var(--font-sans);
}

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

.row-ours td {
  background: var(--bg-alt);
}

.row-ours td:first-child,
.row-best td:first-child {
  color: var(--primary-dark);
  font-weight: 700;
}

.row-best td {
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 700;
}

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

.citation-title {
  margin-bottom: 1rem;
  border-color: var(--border);
  font-size: 1.5rem;
}

.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;
  white-space: pre;
}

.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;
  transition: border-color 0.2s, color 0.2s;
}

.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;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

@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: 1rem;
  }

  .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;
  }

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

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

  .tldr-content {
    flex-direction: column;
  }

  .two-col {
    grid-template-columns: 1fr;
  }

  .insight-box {
    grid-template-columns: 1fr;
  }

  .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;
  }

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