:root {
  --ink: #111827;
  --muted: #5b6472;
  --soft: #f5f7f9;
  --paper: #ffffff;
  --line: #dce3e8;
  --teal: #0f766e;
  --teal-dark: #0b4f4a;
  --blue: #1e40af;
  --clay: #b45309;
  --rose: #be123c;
  --shadow-sm: 0 1px 2px rgba(17, 24, 39, 0.06);
  --shadow-md: 0 12px 28px rgba(17, 24, 39, 0.12);
  --shadow-lg: 0 24px 64px rgba(17, 24, 39, 0.16);
  --radius: 8px;
  --radius-lg: 12px;
  --transition: 180ms ease;
}

html {
  scroll-behavior: smooth;
}

body {
  background:
    radial-gradient(circle at 15% 0%, rgba(15, 118, 110, 0.14), transparent 34rem),
    linear-gradient(180deg, #fbfcfd 0%, #ffffff 34rem);
  color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--teal-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--blue);
}

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

.section {
  padding: 4.5rem 1.5rem;
}

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

.publication-header {
  position: relative;
  overflow: hidden;
}

.publication-header::before {
  background-image:
    linear-gradient(rgba(15, 118, 110, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 118, 110, 0.09) 1px, transparent 1px);
  background-size: 44px 44px;
  content: "";
  inset: 0;
  mask-image: linear-gradient(180deg, #000, transparent 76%);
  position: absolute;
}

.publication-header .container {
  position: relative;
  z-index: 1;
}

.paper-kicker {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  margin-bottom: 1.3rem;
}

.paper-kicker span,
.section-label,
.result-tag {
  align-items: center;
  background: rgba(15, 118, 110, 0.1);
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 999px;
  color: var(--teal-dark);
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 800;
  gap: 0.4rem;
  letter-spacing: 0;
  line-height: 1;
  padding: 0.55rem 0.75rem;
  text-transform: uppercase;
}

.paper-kicker .venue-badge i,
.paper-kicker .workshop-award i {
  font-size: 0.9em;
  opacity: 0.85;
}

.paper-kicker .venue-badge {
  background: rgba(180, 83, 9, 0.11);
  border-color: rgba(180, 83, 9, 0.22);
  color: #873d06;
}

.paper-kicker .award-badge {
  background: rgba(15, 118, 110, 0.12);
  border-color: rgba(15, 118, 110, 0.24);
  color: var(--teal-dark);
}

.paper-kicker .headline-award {
  align-items: center;
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(
        100deg,
        #ff3b3b,
        #ff8a00,
        #ffd000,
        #36c945,
        #1ea7ff,
        #6a5cff,
        #c33bff,
        #ff3b3b
      )
      border-box;
  background-size: auto, 220% auto;
  background-repeat: no-repeat;
  animation: headline-rainbow 6s linear infinite;
  border: 2px solid transparent;
  border-radius: 999px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.1);
  color: #111;
  display: inline-flex;
  font-size: 0.82rem;
  font-weight: 900;
  gap: 0.4rem;
  letter-spacing: 0.01em;
  line-height: 1;
  padding: 0.58rem 0.95rem;
  text-transform: uppercase;
}

.paper-kicker .headline-award i {
  color: #111;
  font-size: 0.9em;
}

@keyframes headline-rainbow {
  0% {
    background-position: 0 0, 0% 50%;
  }
  100% {
    background-position: 0 0, 220% 50%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .paper-kicker .headline-award {
    animation: none;
  }
}

.paper-kicker .workshop-award {
  background: rgba(15, 118, 110, 0.12);
  border-color: rgba(15, 118, 110, 0.24);
  color: var(--teal-dark);
}

.publication-title {
  color: var(--ink) !important;
  font-family: "Inter", sans-serif !important;
  font-size: clamp(2.3rem, 5vw, 5.1rem) !important;
  font-weight: 900 !important;
  line-height: 1.02 !important;
  margin: 0 auto 1.6rem !important;
  max-width: 1080px;
}

.publication-authors {
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.publication-authors a {
  color: var(--teal-dark);
  text-decoration-line: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
}

.publication-authors a:hover {
  color: var(--blue);
}

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

.publication-affiliation {
  color: #374151;
  font-weight: 700;
  margin-bottom: 1.4rem;
}

.publication-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
}

.link-block a {
  margin: 0;
}

.button {
  border-radius: var(--radius) !important;
  font-weight: 800 !important;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition) !important;
}

.button.is-dark {
  background: var(--ink) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  box-shadow: var(--shadow-sm);
  color: white !important;
}

.button.is-dark:hover {
  background: var(--teal-dark) !important;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.teaser .hero-body {
  padding-top: 0.5rem;
}

.teaser-frame,
.video-card,
.figure-panel,
.video-tile,
.tldr-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.teaser-frame {
  overflow: hidden;
}

.teaser-frame video,
.video-card video,
.video-tile video {
  background: #0b1120;
  height: auto;
  width: 100%;
}

.teaser-caption {
  color: var(--muted);
  font-size: 1.1rem !important;
  font-weight: 600;
  margin: 1.25rem auto 0;
  max-width: 900px;
}

.tldr-section {
  padding-top: 2rem;
}

.tldr-panel {
  border-left: 5px solid var(--teal);
  padding: 1.5rem;
}

.tldr-panel p {
  color: var(--ink);
  font-size: clamp(1.2rem, 2vw, 1.65rem);
  font-weight: 750;
  line-height: 1.45;
  margin: 0.9rem 0 0;
}

.section-heading {
  margin-bottom: 2rem;
}

.section-heading .section-label {
  margin-bottom: 0.9rem;
}

.title.is-3 {
  color: var(--ink);
  font-family: "Inter", sans-serif !important;
  font-size: clamp(1.7rem, 3vw, 2.6rem) !important;
  font-weight: 900 !important;
  line-height: 1.1 !important;
  margin-bottom: 0 !important;
}

.abstract-section {
  background: linear-gradient(180deg, #f7faf9, #ffffff);
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
}

.publication-body {
  color: var(--muted);
  font-size: 1.08rem;
}

.publication-body p {
  margin-bottom: 1.15rem;
}

.method-section {
  background:
    linear-gradient(180deg, #ffffff, #f6f8fb);
}

.method-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
  align-items: start;
  max-width: 1120px;
  margin: 0 auto;
}

.figure-panel {
  margin: 0;
  overflow: hidden;
  padding: 1rem;
}

.figure-title {
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 900;
  line-height: 1.2;
  margin: 0 0 0.9rem;
}

.figure-panel img {
  border-radius: var(--radius);
  width: 100%;
}

.figure-panel figcaption {
  color: var(--muted);
  font-size: 0.96rem;
  font-weight: 600;
  margin: 0.95rem 0.15rem 0.1rem;
}

.algorithm-panel img {
  max-height: 690px;
  object-fit: contain;
}

.results-section {
  background: #111827;
  color: white;
}

.results-section .title,
.results-section .title.is-3 {
  color: white !important;
}

.results-section .section-label {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.18);
  color: #d1fae5;
}

.result-block {
  align-items: center;
  display: grid;
  gap: 1.4rem;
  grid-template-columns: minmax(260px, 0.55fr) minmax(0, 1fr);
  margin: 2rem 0;
}

.result-block.reversed {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.55fr);
}

.result-block.reversed .result-copy {
  order: 2;
}

.result-copy {
  padding: 0.5rem 0;
}

.result-copy h3,
.video-tile h3 {
  color: white;
  font-size: clamp(1.35rem, 2vw, 2rem);
  font-weight: 900;
  line-height: 1.15;
  margin: 0.9rem 0 0.7rem;
}

.result-copy p,
.video-tile p {
  color: rgba(255, 255, 255, 0.74);
  font-weight: 560;
}

.result-tag {
  background: rgba(45, 212, 191, 0.12);
  border-color: rgba(45, 212, 191, 0.24);
  color: #99f6e4;
}

.video-card {
  overflow: hidden;
}

.results-section .video-card,
.video-tile {
  background: #1f2937;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.3);
}

.video-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 2rem 0 3.5rem;
}

.video-tile {
  overflow: hidden;
}

.video-tile h3 {
  font-size: 1.15rem;
  margin: 1rem 1rem 0.35rem;
}

.video-tile p {
  font-size: 0.95rem;
  margin: 0 1rem 1.1rem;
}

.bibtex-header {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 1rem;
}

pre {
  background: #f4f7f8 !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow-sm);
  font-size: 0.92rem !important;
  overflow-x: auto;
  padding: 1.25rem !important;
}

code {
  background: transparent !important;
  color: var(--ink) !important;
  font-family: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", monospace !important;
}

.copy-bibtex-btn {
  align-items: center;
  background: var(--teal);
  border: 0;
  border-radius: var(--radius);
  color: white;
  cursor: pointer;
  display: inline-flex;
  font-family: "Inter", sans-serif;
  font-weight: 800;
  gap: 0.45rem;
  padding: 0.75rem 0.95rem;
  transition: background var(--transition), transform var(--transition);
}

.copy-bibtex-btn:hover {
  background: var(--teal-dark);
  transform: translateY(-1px);
}

.copy-bibtex-btn.copied {
  background: #15803d;
}

.copy-bibtex-btn.copied .copy-text::after {
  content: "ied";
}

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

.scroll-to-top {
  align-items: center;
  background: var(--ink);
  border: 0;
  border-radius: 999px;
  bottom: 1.5rem;
  box-shadow: var(--shadow-md);
  color: white;
  cursor: pointer;
  display: flex;
  height: 46px;
  justify-content: center;
  opacity: 0;
  position: fixed;
  right: 1.5rem;
  transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
  visibility: hidden;
  width: 46px;
  z-index: 20;
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.scroll-to-top:hover {
  transform: translateY(-2px);
}

.button:focus,
.copy-bibtex-btn:focus,
a:focus {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}

@media screen and (max-width: 980px) {
  .method-grid,
  .result-block,
  .result-block.reversed {
    grid-template-columns: 1fr;
  }

  .result-block.reversed .result-copy {
    order: 0;
  }

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

@media screen and (max-width: 768px) {
  .section {
    padding: 3rem 1rem;
  }

  .hero-body {
    padding: 3rem 1rem 2rem;
  }

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

  .publication-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .link-block,
  .link-block .button {
    width: 100%;
  }

  .link-block .button {
    justify-content: center;
  }

  .tldr-panel {
    padding: 1.15rem;
  }

  .figure-panel {
    padding: 0.75rem;
  }

  .bibtex-header {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media screen and (max-width: 460px) {
  .publication-links {
    grid-template-columns: 1fr;
  }

  .paper-kicker {
    justify-content: flex-start;
  }
}

@media print {
  .scroll-to-top {
    display: none;
  }

  body {
    background: white;
  }
}
