:root {
  --text: #20242a;
  --muted: #667085;
  --link: #2457a6;
  --border: #e1e4e8;
  --soft: #f7f8fa;
  --white: #ffffff;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 4.5rem;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--white);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.skip-link {
  position: fixed;
  top: -5rem;
  left: 1rem;
  z-index: 100;
  padding: 0.65rem 0.9rem;
  color: var(--white);
  background: var(--text);
}

.skip-link:focus {
  top: 0;
}

.project-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  min-height: 3.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
  font-weight: 700;
}

.nav-brand:hover {
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  width: 1.65rem;
  height: 1.65rem;
  display: grid;
  place-items: center;
  color: var(--link);
  border: 1px solid #b9c7dd;
  border-radius: 3px;
  font-size: 0.82rem;
}

.nav-links {
  display: flex;
  gap: 1.4rem;
}

.nav-links a {
  color: var(--muted);
  font-size: 0.88rem;
}

.publication-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
}

.publication-header .hero-body {
  padding: 5rem 1.5rem 4rem;
}

.eyebrow,
.section-kicker {
  display: block;
  margin-bottom: 0.7rem;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.publication-title {
  max-width: 920px;
  margin: 0 auto 1.8rem !important;
  color: var(--text) !important;
  font-family: Arial, Helvetica, sans-serif !important;
  font-size: clamp(2.2rem, 4.3vw, 3.6rem) !important;
  font-weight: 600 !important;
  line-height: 1.12 !important;
  letter-spacing: -0.025em;
}

.title-accent {
  color: var(--text);
}

.publication-authors {
  max-width: 900px;
  margin: 0 auto 0.65rem;
  color: #2f4f7f;
  font-size: 1.02rem;
}

.author-block {
  display: inline-block;
  margin: 0.15rem 0.45rem;
}

.author-block sup,
.affiliations sup {
  color: var(--muted);
}

.affiliations {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.2rem 1.2rem;
  color: var(--muted);
  font-size: 0.88rem;
}

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

.resource-button {
  min-height: 2.7rem;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.65rem;
  color: #5f6672;
  background: var(--white);
  border: 1px solid #cfd4da;
  border-radius: 4px;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
}

.resource-button:disabled {
  cursor: not-allowed;
  opacity: 1;
}

.resource-button-link {
  color: #2f4f7f;
  cursor: pointer;
}

.resource-button-link:hover {
  color: var(--link);
  background: var(--soft);
  text-decoration: none;
}

.resource-icon {
  min-width: 1.8rem;
  height: 1.8rem;
  display: inline-grid;
  place-items: center;
  color: var(--link);
  background: #f0f4fa;
  border-radius: 3px;
  font-size: 0.62rem;
  font-weight: 700;
}

.code-icon {
  font-size: 0.7rem;
}

.coming-soon {
  padding-left: 0.55rem;
  color: #8a9099;
  border-left: 1px solid var(--border);
  font-size: 0.67rem;
  font-weight: 400;
}

.hero-summary {
  max-width: 680px;
  margin: 1.6rem auto 0;
  color: var(--muted);
  font-size: 0.98rem;
}

.section {
  padding: 4.5rem 1.5rem;
}

.teaser-section {
  padding-top: 3.5rem;
  padding-bottom: 4rem;
}

.paper-figure {
  margin: 0;
}

.paper-figure img {
  display: block;
  width: 100%;
  height: auto;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 3px;
}

.paper-figure figcaption {
  max-width: 880px;
  margin: 1rem auto 0;
  color: var(--muted);
  font-size: 0.91rem;
  line-height: 1.55;
  text-align: center;
}

.teaser-figure img,
.method-figure img {
  padding: 0.5rem;
}

.paper-figure figcaption strong {
  color: var(--text);
}

.abstract-section,
.results-section,
.citation-section {
  background: var(--soft);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-heading {
  max-width: 760px;
  margin-bottom: 2rem;
}

.centered-heading {
  margin-right: auto;
  margin-left: auto;
  text-align: center;
}

.section-heading .title,
.citation-header .title,
.takeaway-panel .title {
  margin-bottom: 0.65rem !important;
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif !important;
  font-size: clamp(1.9rem, 3.2vw, 2.6rem) !important;
  font-weight: 600 !important;
  letter-spacing: -0.015em;
}

.section-lead {
  max-width: 650px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 0.98rem;
}

.abstract-copy {
  max-width: 860px;
  color: #343a44;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1.04rem;
  line-height: 1.75;
}

.abstract-copy p {
  margin: 0 0 1.2rem;
}

.method-stack {
  margin-top: 2.5rem;
  display: grid;
  gap: 2.75rem;
}

.method-panel {
  width: 100%;
}

.method-crop {
  width: 100%;
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 3px;
}

.method-crop img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  padding: 0;
  border: 0;
}

.method-grid {
  margin-top: 3rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.method-card {
  padding: 1.25rem 0 0;
  border-top: 2px solid #ccd3dc;
}

.card-number {
  display: block;
  margin-bottom: 0.7rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.method-card h3,
.result-card h3,
.zero-cost-callout h3 {
  margin-bottom: 0.5rem;
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
}

.method-card p,
.result-card p,
.zero-cost-callout p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.result-card {
  min-height: 210px;
  padding: 1.5rem;
  background: transparent;
  border-right: 1px solid var(--border);
}

.result-card:last-child {
  border-right: 0;
}

.result-value {
  display: inline-block;
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 2.5rem;
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1;
}

.result-unit {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.result-card h3 {
  margin-top: 1.5rem;
}

.results-table-wrap {
  margin-top: 2.5rem;
  overflow-x: auto;
  border: 1px solid var(--border);
  background: var(--white);
}

.results-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  color: #343a44;
  font-size: 0.88rem;
  text-align: right;
}

.results-table caption {
  padding: 1rem 1.1rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  text-align: left;
}

.results-table th,
.results-table td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.results-table thead th {
  color: var(--muted);
  background: var(--soft);
  font-size: 0.76rem;
  font-weight: 700;
  text-align: right;
}

.results-table th:first-child,
.results-table td:first-child,
.results-table th:nth-child(2),
.results-table td:nth-child(2) {
  text-align: left;
}

.results-table tbody tr:last-child th,
.results-table tbody tr:last-child td {
  border-bottom: 0;
}

.queenvis-row th,
.queenvis-row td {
  font-weight: 700;
}

.gain-row th,
.gain-row td {
  color: var(--link);
}

.zero-cost-callout {
  margin: 2rem 0 4rem;
  padding: 1.25rem 1rem;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.callout-value {
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.25;
}

.zero-cost-callout p {
  max-width: 720px;
  margin: 0.4rem auto 0;
}

.demo-videos {
  margin-top: 4.5rem;
  padding-top: 4rem;
  border-top: 1px solid var(--border);
}

.teaser-section .demo-videos {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.embedding-figure {
  margin-top: 4.5rem;
  padding-top: 4rem;
  border-top: 1px solid var(--border);
}

.demo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.demo-item {
  margin: 0;
}

.demo-item video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #111318;
  border: 1px solid var(--border);
  border-radius: 3px;
}

.demo-item figcaption {
  margin-top: 0.45rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.demo-item:last-child:nth-child(odd) {
  grid-column: 1 / -1;
  width: calc(50% - 0.75rem);
  justify-self: center;
}

.takeaway-section {
  padding-top: 4rem;
  padding-bottom: 4rem;
  background: var(--white);
}

.takeaway-panel {
  padding: 2.5rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.takeaway-panel .title {
  max-width: 820px;
}

.takeaway-panel p {
  max-width: 780px;
  margin: 0.8rem 0 0;
  color: var(--muted);
  font-size: 0.98rem;
}

.citation-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.2rem;
}

.citation-header .title {
  margin-bottom: 0 !important;
}

.copy-button {
  padding: 0.55rem 0.8rem;
  color: var(--link);
  background: var(--white);
  border: 1px solid #c9d1dc;
  border-radius: 4px;
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}

.copy-button:hover {
  background: #f0f3f7;
}

.copy-button.is-copied {
  color: #28705a;
  border-color: #9fc8ba;
}

.bibtex-block {
  margin: 0;
  padding: 1.35rem;
  overflow-x: auto;
  color: #2f3742;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 3px;
  font-size: 0.84rem;
  line-height: 1.65;
}

.bibtex-block code {
  color: inherit;
  background: transparent;
  font-family: Consolas, "Liberation Mono", monospace;
}

.copy-status {
  min-height: 1.4rem;
  margin-top: 0.5rem;
  color: #28705a;
  font-size: 0.8rem;
}

.footer {
  padding: 2.5rem 1.5rem;
  color: var(--muted);
  background: var(--white);
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
}

.footer p {
  max-width: 550px;
  margin: 0;
  font-size: 0.8rem;
}

.scroll-to-top {
  display: none;
}

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

@media (max-width: 850px) {
  .method-grid {
    grid-template-columns: 1fr;
    gap: 1.6rem;
  }

  .result-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .result-card:nth-child(2) {
    border-right: 0;
  }

  .result-card:nth-child(-n + 2) {
    border-bottom: 1px solid var(--border);
  }
}

@media (max-width: 650px) {
  .project-nav {
    position: relative;
  }

  .nav-links {
    display: none;
  }

  .publication-header .hero-body {
    padding: 3.5rem 1rem 3rem;
  }

  .publication-title {
    font-size: 2.25rem !important;
  }

  .affiliations {
    display: block;
  }

  .affiliations span {
    display: block;
    margin-bottom: 0.2rem;
  }

  .resource-button {
    width: min(100%, 280px);
  }

  .coming-soon {
    margin-left: auto;
  }

  .section {
    padding: 3.5rem 1rem;
  }

  .teaser-section {
    padding-top: 2.5rem;
  }

  .paper-figure figcaption {
    text-align: left;
  }

  .result-grid {
    grid-template-columns: 1fr;
  }

  .result-card,
  .result-card:nth-child(2) {
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .result-card:last-child {
    border-bottom: 0;
  }

  .demo-grid {
    grid-template-columns: 1fr;
  }

  .demo-item:last-child:nth-child(odd) {
    grid-column: auto;
    width: 100%;
  }

  .citation-header,
  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .copy-button {
    width: 100%;
  }
}

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

@media print {
  .project-nav,
  .publication-links,
  .copy-button {
    display: none;
  }
}
