:root {
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --rs-teal: #0f766e;
  --rs-cyan: #0891b2;
  --text-primary: #10263b;
  --text-secondary: #385066;
  --background-primary: #ffffff;
  --background-soft: #f6fbff;
  --background-accent: #eef5fb;
  --border-color: #dbe7f3;
  --shadow-sm: 0 1px 2px rgb(16 38 59 / 0.08);
  --shadow-md: 0 4px 10px -4px rgb(16 38 59 / 0.16);
  --shadow-lg: 0 8px 18px -8px rgb(16 38 59 / 0.22);
  --border-radius: 10px;
  --border-radius-lg: 14px;
  --transition: all 0.22s ease;
}

html {
  scroll-behavior: smooth;
}

body {
  position: relative;
  isolation: isolate;
  margin: 0;
  font-family: 'IBM Plex Sans', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-primary);
  line-height: 1.52;
  background:
    radial-gradient(circle at 8% -5%, rgb(8 145 178 / 0.14), transparent 30%),
    radial-gradient(circle at 92% 0%, rgb(15 118 110 / 0.1), transparent 34%),
    linear-gradient(180deg, #f8fcff 0%, #ffffff 28%);
  font-size: 16px;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background-image:
    repeating-linear-gradient(30deg, rgb(37 99 235 / 0.04) 0 1px, transparent 1px 30px),
    repeating-linear-gradient(120deg, rgb(15 118 110 / 0.03) 0 1px, transparent 1px 26px);
}

main {
  position: relative;
}

.button {
  border-radius: var(--border-radius) !important;
  font-family: 'Space Grotesk', 'IBM Plex Sans', sans-serif;
  font-weight: 600 !important;
  transition: var(--transition) !important;
  border: 2px solid transparent !important;
}

.button.is-primary {
  background: linear-gradient(120deg, #1d4ed8 0%, #2563eb 55%, #0ea5e9 100%) !important;
  color: #fff !important;
  box-shadow: var(--shadow-md);
}

.button.is-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.button.is-light {
  background: #fff !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-primary) !important;
  box-shadow: var(--shadow-sm);
}

.button.is-light:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #b7cfe6 !important;
}

.hero {
  position: relative;
  overflow: hidden;
}

.hero-compact {
  border-bottom: 1px solid var(--border-color);
  background: linear-gradient(160deg, rgb(37 99 235 / 0.08) 0%, rgb(8 145 178 / 0.08) 48%, rgb(15 118 110 / 0.06) 100%);
}

.hero-compact::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 18% 35%, rgb(255 255 255 / 0.5) 0 14%, transparent 42%),
    linear-gradient(90deg, transparent 0%, rgb(255 255 255 / 0.28) 50%, transparent 100%);
}

.hero-compact .hero-body {
  position: relative;
  z-index: 1;
  padding: 3rem 1.25rem;
}

.section-tight {
  padding: 2.45rem 1.25rem;
}

.narrow {
  max-width: 1100px;
}

.publication-title {
  margin-bottom: 1rem !important;
  font-family: 'Space Grotesk', 'IBM Plex Sans', sans-serif;
  font-weight: 700 !important;
  line-height: 1.08 !important;
  letter-spacing: -0.01em;
  color: #0f2740;
}

.lead {
  margin-bottom: 0.95rem;
  color: var(--text-secondary);
  font-size: 1.05rem;
}

.publication-authors {
  max-width: 940px;
  margin: 0 auto 0.75rem;
  color: #1c3854;
  font-size: 0.98rem;
}

.author-block {
  display: inline-block;
  margin-left: 0.32rem;
  color: #4a6580;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.2rem;
}

.title.is-3 {
  margin-bottom: 1.15rem !important;
  font-family: 'Space Grotesk', 'IBM Plex Sans', sans-serif;
  font-weight: 700 !important;
  color: #0e2942;
}

.content.has-text-justified {
  font-size: 1rem;
  line-height: 1.72;
  color: var(--text-secondary);
}

.content.has-text-justified p {
  margin-bottom: 0.95rem;
}

.highlight-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.78rem;
  margin-top: 1.15rem;
}

.highlight-card {
  position: relative;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 0.88rem 1rem;
  color: #16314b;
  font-weight: 600;
  background: linear-gradient(180deg, #fbfdff 0%, var(--background-accent) 100%);
  box-shadow: var(--shadow-sm);
}

.highlight-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--rs-teal), var(--rs-cyan));
}

.demo-video-shell {
  position: relative;
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
  background: linear-gradient(180deg, #f8fcff 0%, #edf5fc 100%);
  box-shadow: var(--shadow-sm);
}

.demo-video-player {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0d1f31;
}

.demo-video-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  color: #d6e7f8;
  text-align: center;
  padding: 1rem;
  background:
    linear-gradient(140deg, rgb(13 31 49 / 0.84) 0%, rgb(8 47 73 / 0.72) 55%, rgb(15 118 110 / 0.62) 100%),
    repeating-linear-gradient(0deg, rgb(255 255 255 / 0.06) 0 1px, transparent 1px 24px),
    repeating-linear-gradient(90deg, rgb(255 255 255 / 0.06) 0 1px, transparent 1px 24px);
}

.demo-video-empty.hidden {
  display: none;
}

.demo-video-empty i {
  font-size: 1.35rem;
}

.demo-video-empty p {
  margin: 0;
}

.video-config-hint {
  font-size: 0.9rem;
  color: #bcd6ef;
}

.video-config-hint code {
  color: #f4fbff !important;
  background: rgb(11 23 37 / 0.35) !important;
  border-radius: 6px;
  padding: 0.1rem 0.32rem;
}

.fig-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.15rem;
}

.fig-item {
  position: relative;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #ffffff 0%, var(--background-soft) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.fig-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, rgb(37 99 235 / 0.75), rgb(8 145 178 / 0.75));
}

.fig-item img {
  display: block;
  width: 100%;
  height: auto;
}

.fig-item figcaption {
  padding: 0.9rem 1rem 1rem;
  font-size: 0.94rem;
  color: var(--text-secondary);
}

.fig-wide {
  grid-column: span 2;
}

pre {
  background: var(--background-accent) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--border-radius) !important;
  padding: 1.2rem !important;
  font-size: 0.9rem !important;
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}

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

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

.copy-bibtex-btn {
  background: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: var(--border-radius);
  padding: 0.65rem 0.95rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.copy-bibtex-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.copy-bibtex-btn.copied {
  background: #10b981;
}

.scroll-to-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 46px;
  height: 46px;
  border: none;
  border-radius: 50%;
  background: var(--primary-color);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  box-shadow: var(--shadow-lg);
  z-index: 999;
}

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

.scroll-to-top:hover {
  background: var(--primary-hover);
  transform: translateY(-3px);
}

.button:focus,
a:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

.hero,
.section {
  animation: fadeInUp 0.48s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  .hero-compact .hero-body {
    padding: 2.35rem 1rem;
  }

  .publication-title {
    font-size: 2.02rem !important;
    margin-bottom: 0.85rem !important;
  }

  .lead {
    font-size: 1rem;
  }

  .button {
    font-size: 0.92rem !important;
    padding: 0.68rem 1rem !important;
  }

  .fig-wide {
    grid-column: span 1;
  }

  .publication-authors {
    font-size: 0.94rem;
  }
}

@media (max-width: 480px) {
  .hero-compact .hero-body {
    padding: 1.95rem 0.75rem;
  }

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

  .hero-actions {
    gap: 0.5rem;
  }

  .button {
    width: 100%;
    justify-content: center;
  }

  .section-tight {
    padding: 2.1rem 0.85rem;
  }
}
