:root {
  --primary-color: #1d4ed8;
  --primary-hover: #173ea8;
  --primary-deep: #14254a;
  --accent-color: #0f8f7a;
  --text-primary: #1f2937;
  --text-secondary: #5f6f84;
  --text-light: #95a4b8;
  --background-primary: #ffffff;
  --background-secondary: #f7faff;
  --background-accent: #f2f7ff;
  --surface-border: rgba(29, 78, 216, 0.12);
  --surface-shadow: 0 12px 24px -18px rgb(15 23 42 / 0.2);
  --border-color: #dce7f6;
  --shadow-sm: 0 1px 2px 0 rgb(15 23 42 / 0.05);
  --shadow-md: 0 10px 18px -12px rgb(15 23 42 / 0.2);
  --shadow-lg: 0 18px 28px -18px rgb(15 23 42 / 0.22);
  --shadow-xl: 0 24px 36px -24px rgb(15 23 42 / 0.24);
  --gradient-primary: linear-gradient(135deg, #1d4ed8 0%, #0f8f7a 100%);
  --gradient-accent: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 45%, #0f8f7a 100%);
  --border-radius: 12px;
  --border-radius-lg: 16px;
  --transition: all 0.28s ease;
}

@font-face {
  font-family: "Zen Dots";
  src: url("../fonts/ZenDots-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 42%, #ffffff 100%);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

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

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

.is-disabled-button,
.is-disabled-button:hover {
  cursor: not-allowed;
  background: #cbd5e1 !important;
  box-shadow: none !important;
  transform: none !important;
}

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

.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: 3.35rem 1.5rem;
}

.hero.hero-compact .hero-body {
  padding-top: 2.2rem;
  padding-bottom: 2.65rem;
}

.teaser {
  margin-top: -0.65rem;
}

.teaser .hero-body {
  padding-top: 0;
  padding-bottom: 3.25rem;
}

.section-heading {
  margin-top: 2.85rem;
  margin-bottom: 1.25rem;
  text-align: center;
}

.publication-title {
  margin-bottom: 1.4rem !important;
  font-family: "Inter", sans-serif !important;
  font-size: clamp(2.2rem, 4vw, 3.2rem) !important;
  font-weight: 800 !important;
  line-height: 1.05 !important;
  letter-spacing: -0.02em;
  color: var(--text-primary) !important;
}

.publication-subtitle {
  display: inline-block;
  max-width: 920px;
  margin-top: 0.55rem;
  font-size: clamp(1.95rem, 3.3vw, 2.82rem);
  font-weight: 500;
  line-height: 1.18;
}

.title-logo {
  position: relative;
  top: -5px;
  height: 3.1rem;
  margin-right: 0.8rem;
  vertical-align: middle;
  border-radius: 0.45rem;
}

.fluxmem-word {
  font-family: "Zen Dots", "Inter", sans-serif;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.fluxmem-word .flux-part {
  background-image: var(--gradient-accent);
  background-size: 200% 200%;
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  animation: flux-flow 3.5s ease-in-out infinite;
}

.fluxmem-word .mem-part {
  color: #264081;
}

.publication-authors {
  max-width: 980px;
  margin: 0 auto 1.1rem;
  font-family: "Inter", sans-serif !important;
  font-size: 1.04rem;
  font-weight: 500;
  line-height: 1.75;
}

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

.publication-authors a::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-primary);
  transition: var(--transition);
}

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

.publication-authors a:hover::after {
  width: 100%;
}

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

.publication-affiliations {
  margin-bottom: 1.2rem;
  font-size: 0.98rem !important;
  color: var(--text-secondary);
  line-height: 1.8;
}

.publication-affiliations .author-block {
  margin-bottom: 0.2rem;
}

.corresponding-authors {
  font-size: 0.94rem;
  color: var(--text-light);
}

.publication-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.15rem 0.35rem;
  margin-top: -1.0rem;
}

.publication-links .button {
  min-width: 170px;
}

.teaser-image,
.content-image {
  display: block;
  box-sizing: border-box;
  width: 100%;
  padding: 0.3rem;
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  background: var(--background-primary);
  box-shadow: var(--surface-shadow);
}

.teaser-image {
  max-width: 960px;
  margin: 0 auto;
}

.teaser-summary {
  margin-top: 1.5rem !important;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  font-size: 1.05rem !important;
  line-height: 1.75;
  color: var(--text-secondary);
}

.image-block {
  margin-bottom: 2.3rem;
}

.image-block-spaced .results-carousel {
  margin-bottom: 1.1rem;
}

.image-block .image {
  padding: 0.3rem;
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  background: var(--background-primary);
  box-shadow: var(--surface-shadow);
}

.image-block .image img {
  display: block;
  width: 100%;
  border-radius: 9px;
}

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

.results-carousel .slider-item {
  display: flex;
  padding: 0 0.25rem;
}

.results-carousel .slider-item .box {
  width: 100%;
  margin: 0 !important;
  padding: 0.8rem;
  border: 1px solid var(--surface-border);
  border-radius: 14px;
  box-shadow: var(--surface-shadow);
}

.results-carousel .slider-item .content {
  margin-bottom: 0;
}

.results-carousel img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 9px;
}

.image-block .subtitle {
  max-width: 900px;
  margin: 0.85rem auto 0;
  font-size: 1.02rem !important;
  line-height: 1.75;
  color: var(--text-secondary);
}

.slider-navigation-next,
.slider-navigation-previous {
  width: 2.35rem;
  height: 2.35rem;
  background: rgba(20, 37, 74, 0.74);
  box-shadow: none;
}

.slider-navigation-next:hover,
.slider-navigation-previous:hover {
  background: rgba(29, 78, 216, 0.92);
}

.slider-navigation-next svg,
.slider-navigation-previous svg {
  width: 16px;
  height: 16px;
}

.slider-pagination .slider-page {
  background: rgba(29, 78, 216, 0.24);
  border-radius: 50%;
  transition: var(--transition);
}

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

.title.is-3 {
  position: relative;
  margin-bottom: 1.5rem !important;
  padding-bottom: 0.85rem;
  font-family: "Inter", sans-serif !important;
  font-size: clamp(1.72rem, 2.2vw, 2.1rem) !important;
  font-weight: 700 !important;
  line-height: 1.25;
  color: var(--text-primary);
}

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

.content.has-text-justified,
#contributions .content,
.has-text-justified {
  font-size: 1.03rem;
  line-height: 1.84;
  color: var(--text-secondary);
}

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

.content ul {
  margin-top: 0.2rem;
}

.content li {
  margin-bottom: 0.8rem;
}

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

.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 {
  overflow-x: auto;
  padding: 1.2rem 1.3rem !important;
  font-size: 0.9rem !important;
  background: var(--background-accent) !important;
  border: 1px solid var(--surface-border) !important;
  border-radius: var(--border-radius) !important;
  box-shadow: var(--shadow-sm);
}

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

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

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

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

.copy-bibtex-btn.copied {
  background: var(--accent-color);
}

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

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

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

@keyframes flux-flow {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

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

  .hero.hero-compact .hero-body {
    padding-top: 1.35rem;
    padding-bottom: 2rem;
  }

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

  .publication-subtitle {
    margin-top: 0.45rem;
    font-size: 1.68rem;
    line-height: 1.22;
  }

  .title-logo {
    height: 2.8rem;
  }

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

  .publication-affiliations {
    font-size: 0.92rem !important;
  }

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

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

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

  .image-block .subtitle {
    font-size: 0.98rem !important;
  }

  .results-carousel .slider-item .box {
    padding: 0.7rem;
  }

  .slider-navigation-next,
  .slider-navigation-previous {
    width: 2.15rem;
    height: 2.15rem;
  }
}

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

  .publication-subtitle {
    font-size: 1.42rem;
  }

  .title-logo {
    height: 2.45rem;
  }

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

  .hero.hero-compact .hero-body {
    padding-top: 1.25rem;
    padding-bottom: 1.9rem;
  }

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

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

  .publication-links .button {
    min-width: 0;
  }

  .image-block .columns.is-mobile {
    flex-wrap: wrap;
  }

  .image-block .columns.is-mobile > .column {
    flex: 0 0 100%;
  }

  .bibtex-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .copy-bibtex-btn {
    justify-content: center;
  }

  .scroll-to-top {
    right: 1rem;
    bottom: 1rem;
    width: 44px;
    height: 44px;
  }
}

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

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
