/* Modern CSS Variables for consistent theming */
:root {
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --secondary-color: #64748b;
  --accent-color: #0ea5e9;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-light: #94a3b8;
  --background-primary: #ffffff;
  --background-secondary: #f8fafc;
  --background-accent: #f1f5f9;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-accent: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --gradient-subtle: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
  --border-radius: 12px;
  --border-radius-lg: 16px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 16px;
  background-color: var(--background-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.button {
  border-radius: var(--border-radius) !important;
  font-weight: 600 !important;
  transition: var(--transition) !important;
  border: 2px solid transparent !important;
  position: relative;
  overflow: hidden;
}

.button.is-dark {
  background: var(--text-primary) !important;
  border: none !important;
  color: white !important;
  box-shadow: var(--shadow-md);
}

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

.button.is-dark:active {
  transform: translateY(0);
  box-shadow: var(--shadow-md);
}

.footer .icon-link {
  font-size: 25px;
  color: var(--text-secondary);
  transition: var(--transition);
}

.footer .icon-link:hover {
  color: var(--primary-color);
  transform: translateY(-2px);
}

.link-block a {
  margin: 8px 4px;
}

.dnerf {
  font-variant: small-caps;
}

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

.hero.is-light {
  background: var(--background-secondary);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

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

.publication-header .hero-body {
  padding-top: 4rem;
  padding-bottom: 4rem;
}

.teaser .hero-body {
  padding-top: 2rem;
  padding-bottom: 4rem;
}

.teaser {
  font-family: "Inter", sans-serif;
}

.teaser .container.is-max-desktop {
  max-width: 1420px !important;
  width: min(96vw, 1420px);
}

.publication-title {
  font-family: "Inter", sans-serif !important;
  font-weight: 800 !important;
  color: var(--text-primary) !important;
  margin-bottom: 2rem !important;
  line-height: 1.1 !important;
}

.publication-banner {
  margin: 2rem 0;
}

.publication-banner img {
  width: 100%;
  display: block;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.publication-links {
  margin-bottom: 1rem;
}

.teaser .subtitle {
  margin-top: 1rem !important;
  margin-bottom: 0 !important;
  line-height: 1.35;
}

.publication-authors {
  font-family: "Inter", sans-serif !important;
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.publication-authors a {
  color: var(--primary-color) !important;
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
  position: relative;
}

.publication-authors a:hover {
  color: var(--primary-hover) !important;
}

.author-block {
  display: inline-block;
  margin-right: 0.5rem;
}

.publication-video {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%;
  overflow: hidden;
  border-radius: var(--border-radius-lg) !important;
  box-shadow: var(--shadow-xl);
  transition: var(--transition);
}

.publication-video:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.publication-video iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: var(--border-radius-lg);
}

.results-carousel {
  overflow: hidden;
  padding: 1rem 0;
}

.results-carousel .item {
  margin: 1rem;
  overflow: hidden;
  padding: 1.5rem;
  font-size: 0;
  background: var(--background-primary);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  border: 1px solid var(--border-color);
}

.results-carousel .item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.results-carousel .item img,
.results-carousel video {
  margin: 0;
  border-radius: var(--border-radius);
  width: 100%;
  height: auto;
}

.results-carousel .subtitle {
  font-size: 1rem !important;
  color: var(--text-secondary);
  margin-top: 1rem;
  font-weight: 500;
}

.slider-pagination .slider-page {
  background: var(--primary-color);
  border-radius: 50%;
  transition: var(--transition);
}

.slider-pagination .slider-page.is-active {
  background: var(--primary-hover);
  transform: scale(1.2);
}

.eql-cntrb {
  font-size: 0.875rem;
  color: var(--text-light);
  font-style: italic;
}

.title.is-3 {
  font-family: "Inter", sans-serif !important;
  font-weight: 700 !important;
  color: var(--text-primary);
  margin-bottom: 2rem !important;
  position: relative;
  padding-bottom: 1rem;
}

.title.is-3::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: var(--gradient-accent);
  border-radius: 2px;
}

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

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

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

.footer .content {
  color: var(--text-secondary);
  line-height: 1.7;
}

.footer a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
}

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

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

code {
  background: var(--background-accent) !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: white;
  border: none;
  border-radius: var(--border-radius);
  padding: 0.75rem 1rem;
  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;
}

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

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

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

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

.institution-logo-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.8rem;
  align-items: stretch;
  margin: 1rem auto 0.5rem;
}

.institution-logo-card {
  position: relative;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 0.85rem;
  box-shadow: var(--shadow-sm);
}

.institution-logo-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
}

.institution-index {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--text-primary);
  color: #ffffff;
  font-size: 0.75rem;
  line-height: 22px;
  font-weight: 700;
}

.highlight-grid,
.video-placeholder-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

.highlight-card,
.video-placeholder-card {
  background: var(--background-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  height: 100%;
}

.highlight-card h3,
.video-placeholder-card h3 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 1.15rem;
  color: var(--text-primary);
}

.highlight-card p,
.video-placeholder-card p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.7;
}

.video-placeholder-card {
  border-style: dashed;
}

.video-embed-card {
  border-style: solid;
}

.video-embed-card .publication-video {
  margin-bottom: 1rem;
  box-shadow: var(--shadow-md);
}

.dataset-video-grid {
  gap: 1rem;
}

.dataset-video-card {
  padding: 0.85rem;
}

.dataset-video-card .publication-video {
  margin-bottom: 0;
}

.generated-video-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.generated-video-card {
  padding: 1.75rem;
}

.generated-video-player {
  max-width: 1200px;
  margin: 0 auto 1.25rem;
}

.generated-video-card p + p {
  margin-top: 1rem;
}

.generated-pipeline-card {
  padding: 1.75rem;
}

.pipeline-label {
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
}

.pipeline-layout {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: stretch;
  margin-top: 1.25rem;
}

.pipeline-reference,
.pipeline-step {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.pipeline-reference {
  aspect-ratio: 768 / 1365;
}

.pipeline-step {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.pipeline-reference img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  object-fit: cover;
}

.pipeline-video-column {
  display: grid;
  grid-template-rows: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 0.85rem;
  height: 100%;
}

.pipeline-video-top-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.pipeline-video-bottom-row {
  display: flex;
  justify-content: center;
  align-items: stretch;
}

.pipeline-video-bottom-row,
.pipeline-video-top-row,
.pipeline-video-bottom-row .pipeline-step,
.pipeline-video-top-row .pipeline-step {
  min-height: 0;
}

.pipeline-video-bottom-row .pipeline-step,
.pipeline-video-top-row .pipeline-step {
  height: 100%;
}

.pipeline-video-bottom-row .pipeline-step {
  flex: 0 0 calc((100% - 0.85rem) / 2);
  width: calc((100% - 0.85rem) / 2);
  max-width: calc((100% - 0.85rem) / 2);
}

.pipeline-video {
  margin-bottom: 0;
  height: 100%;
  min-height: 0;
  padding-bottom: 0;
}

@media screen and (max-width: 1024px) {
  .institution-logo-grid,
  .highlight-grid,
  .video-placeholder-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .pipeline-layout {
    grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  }
}

@media screen and (max-width: 768px) {
  .hero-body {
    padding: 2rem 1rem;
  }

  .publication-header .hero-body {
    padding-top: 3rem;
    padding-bottom: 2rem;
  }

  .publication-title {
    font-size: 2.3rem !important;
    line-height: 1.2 !important;
    margin-bottom: 1.5rem !important;
  }

  .publication-authors {
    font-size: 1rem !important;
  }

  .button {
    margin: 0.25rem !important;
    font-size: 0.875rem !important;
    padding: 0.75rem 1rem !important;
  }

  .institution-logo-grid,
  .highlight-grid,
  .video-placeholder-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .teaser .hero-body {
    padding: 1rem;
  }

  .content.has-text-justified {
    font-size: 1rem;
  }
}

@media screen and (max-width: 480px) {
  .publication-title {
    font-size: 2rem !important;
  }

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

  .publication-header .hero-body {
    padding-top: 2rem;
    padding-bottom: 1.5rem;
  }

  .institution-logo-grid,
  .highlight-grid,
  .video-placeholder-grid {
    grid-template-columns: 1fr;
  }

  .pipeline-layout {
    grid-template-columns: 1fr;
  }

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

  .pipeline-video-bottom-row .pipeline-step {
    flex-basis: 100%;
    width: 100%;
    max-width: 100%;
  }

  .link-block {
    display: block;
    margin-bottom: 0.5rem;
  }

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