:root {
  --page-gutter: 48px;
  --page-width: 1180px;
  --accent: #0c8ce9;
  --accent-soft: rgba(12, 140, 233, 0.08);
  --surface-0: #ffffff;
  --surface-1: #fafafa;
  --surface-2: #f6f7f8;
  --text-primary: #111111;
  --text-secondary: #4d5561;
  --text-tertiary: #737373;
  --border: rgba(17, 17, 17, 0.12);
  --border-strong: rgba(17, 17, 17, 0.2);
  --shadow: 0 18px 56px rgba(17, 17, 17, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  color: var(--text-primary);
  background: var(--surface-2);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

::selection {
  background: rgba(12, 140, 233, 0.22);
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.project-page {
  min-height: 100vh;
}

.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 56px;
  padding: 0 32px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--border-strong);
  backdrop-filter: blur(18px);
}

.site-mark {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-primary);
  text-decoration: none;
}

.site-nav nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

.site-nav nav a {
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 500;
  color: #50565f;
  text-decoration: none;
}

.site-nav nav a:hover,
.site-nav nav a:focus-visible {
  color: #0056c8;
}

.mobile-nav-toggle {
  display: none;
}

.hero-section {
  padding: 120px 0 72px;
  background:
    radial-gradient(circle at top right, rgba(12, 140, 233, 0.08), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, #f6f7f8 100%);
  border-bottom: 1px solid var(--border);
}

.hero-content {
  width: min(var(--page-width), calc(100% - var(--page-gutter)));
  margin: 0 auto;
  text-align: center;
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero-content h1 {
  margin: 0;
  font-size: clamp(36px, 4.8vw, 58px);
  font-weight: 650;
  line-height: 1.04;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  max-width: 920px;
  margin: 18px auto 0;
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.45;
  color: var(--text-secondary);
}

.hero-authors {
  display: grid;
  gap: 10px;
  margin: 28px auto 0;
  font-size: clamp(16px, 1.8vw, 20px);
  line-height: 1.45;
  color: #2a3138;
}

.hero-author-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 24px;
}

.hero-affiliations {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 20px;
  margin: 16px auto 0;
  font-size: clamp(14px, 1.5vw, 17px);
  color: var(--text-secondary);
}

.hero-author-notes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
  margin: 10px auto 0;
  font-size: 13px;
  color: var(--text-tertiary);
}

.hero-author-notes sup,
.hero-authors sup,
.hero-affiliations sup {
  margin-left: 1px;
  font-size: 0.7em;
  line-height: 0;
}

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

.hero-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  box-shadow: 0 10px 28px rgba(17, 17, 17, 0.06);
  transition: transform 0.16s ease, border-color 0.16s ease, background-color 0.16s ease;
}

.hero-action:hover,
.hero-action:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(12, 140, 233, 0.45);
  background: #fff;
}

.hero-action.primary {
  background: var(--text-primary);
  border-color: var(--text-primary);
  color: #fff;
}

.hero-action.primary:hover,
.hero-action.primary:focus-visible {
  background: #222;
  border-color: #222;
}

.hero-summary {
  max-width: 820px;
  margin: 24px auto 0;
  text-align: left;
  font-size: 17px;
  line-height: 1.58;
  color: var(--text-secondary);
}

.stats-strip {
  width: min(var(--page-width), calc(100% - var(--page-gutter)));
  margin: 36px auto 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.stat-card {
  padding: 18px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 8px 24px rgba(17, 17, 17, 0.05);
}

.stat-card strong {
  display: block;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.stat-card span {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}

.content-section {
  width: min(var(--page-width), calc(100% - var(--page-gutter)));
  margin: 0 auto;
  padding: 84px 0;
  border-bottom: 1px solid var(--border);
}

.section-heading {
  margin-bottom: 32px;
  text-align: center;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 46px);
  font-weight: 640;
  line-height: 1.08;
}

.section-heading p:last-child {
  max-width: 860px;
  margin: 14px auto 0;
  font-size: clamp(17px, 1.8vw, 22px);
  line-height: 1.5;
  color: var(--text-secondary);
}

.overview-media,
.figure-card {
  border: none;
  border-radius: 8px;
  overflow: hidden;
  background: transparent;
  box-shadow: none;
}

.overview-media img,
.figure-card img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.figure-caption,
.gallery-caption {
  padding: 12px 0 0;
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
}

.overview-media .figure-caption {
  font-size: 17px;
  line-height: 1.58;
}

.overview-copy,
.body-copy {
  margin: 28px auto 0;
  font-size: 17px;
  line-height: 1.58;
  color: var(--text-secondary);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 28px;
}

.feature-card {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.feature-card h3 {
  margin: 0 0 10px;
  font-size: 18px;
  text-align: center;
}

.feature-card p {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-secondary);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.stats-grid .figure-card {
  display: flex;
  flex-direction: column;
  margin: 0;
}

.stats-grid .stats-figure-media {
  aspect-ratio: 881 / 900;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.stats-grid .stats-figure-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
}

.stats-grid .stats-figure-media--zoom img {
  width: auto;
  height: 40%;
  max-width: none;
  transform: none;
}

.keypoint-layout {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 18px;
  align-items: center;
}

.keypoint-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.keypoint-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.keypoint-table th,
.keypoint-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #ececec;
  text-align: left;
}

.keypoint-table th {
  background: #fafafa;
  font-weight: 650;
}

.comparison-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.comparison-table th,
.comparison-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #ececec;
  text-align: center;
}

.comparison-table th {
  background: #fafafa;
  font-weight: 650;
}

.comparison-table tr.highlight {
  background: #f3f5f7;
  font-weight: 650;
}

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

.benchmark-tables {
  display: grid;
  gap: 24px;
}

.benchmark-tables .results-table {
  font-size: 13px;
}

.benchmark-tables .results-table caption {
  padding: 14px 12px 0;
  text-align: center;
  font-weight: 650;
  caption-side: top;
  transform: translateY(-6px);
}

.benchmark-tables .results-table thead tr:first-child > th:first-child,
.benchmark-tables .results-table tbody td:first-child {
  text-align: left;
}

.benchmark-tables .results-table tbody td:not(:first-child) {
  text-align: center;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.results-table th,
.results-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #ececec;
  text-align: center;
}

.results-table th {
  background: #fafafa;
}

.results-table tr.highlight {
  background: #f3f5f7;
}

.demo-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.citation-section {
  border-bottom: 0;
}

.citation-code-wrap {
  position: relative;
}

.citation-copy-button {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f7f8fa;
  color: #171a1f;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.citation-copy-button:hover,
.citation-copy-button:focus-visible {
  background: #fff;
  border-color: rgba(17, 17, 17, 0.3);
}

.citation-bibtex {
  margin: 0;
  padding: 18px 118px 18px 18px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-family: "SF Mono", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.65;
  white-space: pre;
}

.site-footer {
  width: min(var(--page-width), calc(100% - var(--page-gutter)));
  margin: 0 auto;
  padding: 28px 0 48px;
  text-align: center;
  font-size: 13px;
  color: var(--text-tertiary);
}

.site-footer p {
  margin: 0;
}

.site-footer-attribution {
  margin-top: 10px !important;
  font-size: 12px;
  line-height: 1.6;
}

.site-footer a {
  color: var(--text-secondary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

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

@media (max-width: 960px) {
  .stats-strip,
  .feature-grid,
  .stats-grid,
  .benchmark-grid,
  .demo-split,
  .keypoint-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  :root {
    --page-gutter: 24px;
  }

  .site-nav {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 0 12px;
    padding: 9px 18px;
  }

  .mobile-nav-toggle {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid rgba(17, 17, 17, 0.18);
    border-radius: 8px;
    background: transparent;
    color: #111;
    cursor: pointer;
  }

  .mobile-nav-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background: currentColor;
    border-radius: 999px;
  }

  .site-nav nav {
    grid-column: 1 / -1;
    display: grid;
    gap: 3px;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    transform: translateY(-4px);
    transition: max-height 0.2s ease, opacity 0.18s ease, transform 0.18s ease, padding-top 0.18s ease;
  }

  .site-nav.nav-open nav {
    max-height: 320px;
    opacity: 1;
    padding-top: 8px;
    pointer-events: auto;
    transform: translateY(0);
  }

  .hero-section {
    padding-top: 104px;
  }

  .content-section {
    padding: 58px 0;
  }
}

.gallery-section {
  padding-top: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gallery-section .section-heading,
.gallery-explorer {
  width: min(1180px, 100%);
  margin-inline: auto;
}

.gallery-section .section-heading {
  text-align: center;
}

.gallery-explorer {
  display: grid;
  gap: 18px;
}

.gallery-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.gallery-toolbar label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.gallery-toolbar select,
.gallery-toolbar button {
  min-height: 40px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text-primary);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
}

.gallery-toolbar select {
  min-width: 220px;
  padding: 0 12px;
}

.gallery-toolbar button {
  padding: 0 16px;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background-color 0.16s ease;
}

.gallery-toolbar button:hover,
.gallery-toolbar button:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(12, 140, 233, 0.45);
}

.gallery-status {
  margin: 0;
  width: 100%;
  text-align: center;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.gallery-interaction-hint {
  margin: 6px 0 0;
  width: 100%;
  text-align: center;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.5;
  color: var(--text-tertiary);
}

.gallery-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  justify-items: center;
}

.gallery-layout:has(#gallery-detail:not([hidden])) {
  grid-template-columns: minmax(0, 1fr) minmax(380px, 480px);
  justify-items: stretch;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 280px));
  justify-content: center;
  gap: 14px;
  width: 100%;
  max-width: 892px;
}

.gallery-layout:has(#gallery-detail:not([hidden])) .gallery-grid {
  max-width: none;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  justify-content: stretch;
}

.gallery-grid .gallery-card {
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s ease;
}

.gallery-grid .gallery-card:hover,
.gallery-grid .gallery-card:focus-visible,
.gallery-grid .gallery-card.is-selected {
  transform: translateY(-2px);
}

.gallery-grid .gallery-card.is-selected .gallery-card-media {
  outline: 2px solid rgba(12, 140, 233, 0.75);
  outline-offset: 2px;
}

.gallery-card-media {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 8px;
  overflow: hidden;
  background: transparent;
  box-shadow: 0 8px 24px rgba(17, 17, 17, 0.06);
}

.gallery-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-card-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #111;
  font-size: 11px;
  font-weight: 700;
}

.gallery-card-meta {
  display: grid;
  gap: 4px;
  padding: 12px 14px 14px;
}

.gallery-card-meta strong {
  font-size: 14px;
}

.gallery-card-meta span {
  font-size: 11px;
  color: var(--text-tertiary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gallery-detail {
  position: sticky;
  top: 84px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.gallery-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.gallery-detail-heading {
  min-width: 0;
  flex: 1;
}

.gallery-detail-close {
  flex-shrink: 0;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text-secondary);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.16s ease, color 0.16s ease, background-color 0.16s ease;
}

.gallery-detail-close:hover,
.gallery-detail-close:focus-visible {
  border-color: rgba(12, 140, 233, 0.45);
  color: var(--text-primary);
  background: var(--accent-soft);
}

.gallery-detail h3 {
  margin: 0;
  font-size: 22px;
}

.gallery-detail p {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--text-tertiary);
  word-break: break-all;
}

.gallery-detail-stage {
  position: relative;
  margin-top: 14px;
  border-radius: 8px;
  overflow: hidden;
  background: #101316;
}

.gallery-detail-stage img {
  display: block;
  width: 100%;
  height: auto;
}

.gallery-detail-stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.gallery-detail-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.gallery-detail-stats div {
  padding: 10px;
  border-radius: 8px;
  background: var(--surface-1);
  min-width: 0;
}

.gallery-detail-stats span {
  display: block;
  font-size: 11px;
  color: var(--text-tertiary);
}

.gallery-detail-stats strong {
  display: block;
  margin-top: 4px;
  font-size: 16px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.gallery-detail-stats .gallery-stat-species strong {
  font-size: 13px;
}

.gallery-detail-hint {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary);
}

@media (max-width: 1100px) {
  .gallery-layout {
    grid-template-columns: 1fr;
  }

  .gallery-detail {
    position: static;
  }
}

@media (max-width: 760px) {
  .gallery-grid {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
    max-width: 100%;
  }
}

@media (max-width: 520px) {
  .gallery-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .gallery-detail-stats {
    grid-template-columns: 1fr;
  }
}

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

  *, *::before, *::after {
    transition-duration: 0.01ms !important;
  }
}
