html {
  scroll-behavior: smooth;
}

body {
  color: #242424;
  background: #fff;
}

.theme-toggle {
  position: fixed;
  z-index: 20;
  top: 1rem;
  right: 1rem;
  display: inline-flex;
  min-width: 6.2rem;
  height: 2.65rem;
  padding: 0 0.9rem;
  gap: 0.45rem;
  align-items: center;
  justify-content: center;
  color: #242424;
  font: 700 0.86rem "Noto Sans", sans-serif;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #d7d7d7;
  border-radius: 999px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  cursor: pointer;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  border-color: #3298dc;
}

.theme-toggle-icon {
  font-size: 1.08rem;
  line-height: 1;
}

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

.publication-title {
  max-width: 900px;
  margin-right: auto;
  margin-left: auto;
  line-height: 1.12;
}

.publication-authors {
  margin-top: 0.35rem;
  line-height: 1.8;
}

.affiliations {
  margin-top: 0.65rem;
  color: #555;
}

.publication-links {
  margin-top: 1.25rem;
}

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

.teaser {
  padding-top: 1rem;
}

.teaser .subtitle {
  max-width: 850px;
  margin: 0 auto 2rem;
  line-height: 1.5;
}

.section-intro {
  max-width: 800px;
  margin: 0 auto 1.5rem;
}

.publication-figure {
  margin: 1.5rem auto 0;
}

.publication-figure img {
  display: block;
  width: 100%;
  height: auto;
}

.curve-carousel-stage {
  position: relative;
}

.sudoku-nfe-stage {
  position: relative;
}

.curve-carousel-model {
  display: flex;
  width: fit-content;
  margin: 0 auto 0.8rem;
  overflow: hidden;
  align-items: stretch;
  color: #555;
  font-size: 0.88rem;
  background: #f1f3f6;
  border: 1px solid #d7dbe2;
  border-radius: 999px;
}

.curve-carousel-model span,
.curve-carousel-model strong {
  display: flex;
  min-height: 2.2rem;
  padding: 0.4rem 0.9rem;
  align-items: center;
}

.curve-carousel-model strong {
  min-width: 8.5rem;
  justify-content: center;
  color: #fff;
  background: #7b145c;
  font-weight: 700;
}

.curve-carousel-viewport {
  position: relative;
  overflow: hidden;
  cursor: zoom-in;
  outline: none;
  touch-action: pan-y;
}

.curve-carousel-viewport:focus-visible {
  box-shadow: 0 0 0 3px rgba(50, 152, 220, 0.5);
}

.curve-carousel-viewport.is-magnifying {
  cursor: crosshair;
}

.curve-magnifier {
  position: absolute;
  z-index: 3;
  display: none;
  width: 13rem;
  height: 13rem;
  background-color: #fff;
  background-repeat: no-repeat;
  border: 3px solid rgba(255, 255, 255, 0.96);
  border-radius: 50%;
  box-shadow: 0 5px 24px rgba(0, 0, 0, 0.38), 0 0 0 1px rgba(20, 20, 20, 0.35);
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.curve-magnifier.is-visible {
  display: block;
}

.curve-magnifier-hint {
  margin: 0.55rem 0 0;
  color: #777;
  font-size: 0.78rem;
  text-align: center;
}

.curve-carousel-viewport img.slide-from-right {
  animation: curve-slide-from-right 0.38s ease-out both;
}

.curve-carousel-viewport img.slide-from-left {
  animation: curve-slide-from-left 0.38s ease-out both;
}

.sudoku-nfe-viewport {
  position: relative;
  overflow: hidden;
  overscroll-behavior-x: contain;
  touch-action: pan-y;
}

.sudoku-nfe-viewport img.slide-from-right {
  animation: curve-slide-from-right 0.38s ease-out both;
}

.sudoku-nfe-viewport img.slide-from-left {
  animation: curve-slide-from-left 0.38s ease-out both;
}

@keyframes curve-slide-from-right {
  from {
    opacity: 0.25;
    transform: translateX(12%);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes curve-slide-from-left {
  from {
    opacity: 0.25;
    transform: translateX(-12%);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.curve-carousel-button {
  position: absolute;
  z-index: 2;
  top: 50%;
  display: flex;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  align-items: center;
  justify-content: center;
  color: #242424;
  font-size: 1rem;
  line-height: 1;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #d7d7d7;
  border-radius: 50%;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.14);
  cursor: pointer;
  transform: translateY(-50%);
  transition: color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.curve-carousel-button:hover,
.curve-carousel-button:focus-visible {
  color: #1677b8;
  border-color: #3298dc;
  transform: translateY(-50%) scale(1.06);
}

.curve-carousel-previous,
.sudoku-nfe-previous,
.owt-samples-previous {
  left: -3.25rem;
}

.curve-carousel-next,
.sudoku-nfe-next,
.owt-samples-next {
  right: -3.25rem;
}

.publication-figure figcaption {
  margin-top: 0.6rem;
  color: #666;
  font-size: 0.85rem;
  line-height: 1.45;
  text-align: center;
}

.owt-samples-section {
  margin-top: 3.5rem;
}

.owt-samples-stage {
  position: relative;
}

.owt-samples-viewport {
  position: relative;
  overflow: hidden;
  overscroll-behavior-x: contain;
  touch-action: pan-y;
}

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

.owt-samples-panel[hidden] {
  display: none;
}

.owt-samples-panel.slide-from-right {
  animation: curve-slide-from-right 0.38s ease-out both;
}

.owt-samples-panel.slide-from-left {
  animation: curve-slide-from-left 0.38s ease-out both;
}

.generation-card {
  padding: 1rem 1.1rem;
  color: #343434;
  text-align: left;
  background: #f7f8fa;
  border: 1px solid #dfe2e8;
  border-radius: 0.75rem;
}

.generation-card header {
  display: flex;
  margin-bottom: 0.55rem;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.generation-card header strong {
  color: #5f174b;
  font-size: 1rem;
}

.generation-card header span {
  flex: none;
  color: #707684;
  font-size: 0.76rem;
  font-weight: 700;
}

.generation-card p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.55;
}

.generation-card-simplax {
  order: -1;
  background: #fff6fb;
  border-color: #c52888;
  box-shadow: inset 0 0 0 1px rgba(197, 40, 136, 0.16);
}

.sample-truncation {
  color: #858b98;
}

.sudoku-figure {
  max-width: 760px;
}

.sudoku-result-title {
  margin-top: 2rem;
  margin-bottom: 0.75rem !important;
}

.few-step-figure {
  max-width: 950px;
}

.qualitative-title {
  margin-top: 3rem;
}

.bibtex-section {
  background: #f5f5f5;
}

.bibtex-section pre {
  overflow-x: auto;
}

.footer {
  padding: 2rem 1.5rem;
  font-size: 0.85rem;
}

.home-link {
  margin-top: 1.2rem;
  margin-bottom: 0;
  font-size: 0.95rem;
  font-weight: 700;
}

html[data-theme="dark"] body {
  color: #e7e9f3;
  background: #11131b;
}

html[data-theme="dark"] .theme-toggle {
  color: #f2f4ff;
  background: rgba(25, 28, 39, 0.94);
  border-color: #505568;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.3);
}

html[data-theme="dark"] .curve-carousel-button {
  color: #f2f4ff;
  background: rgba(25, 28, 39, 0.94);
  border-color: #505568;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.34);
}

html[data-theme="dark"] .curve-carousel-model {
  color: #c2c7d6;
  background: #191c27;
  border-color: #505568;
}

html[data-theme="dark"] .curve-carousel-model strong {
  color: #fff;
  background: #9d176e;
}

html[data-theme="dark"] .curve-magnifier-hint {
  color: #9da5ba;
}

html[data-theme="dark"] .generation-card {
  color: #d7dbea;
  background: #191c27;
  border-color: #3f4456;
}

html[data-theme="dark"] .generation-card header strong {
  color: #f08bc9;
}

html[data-theme="dark"] .generation-card header span,
html[data-theme="dark"] .sample-truncation {
  color: #9da5ba;
}

html[data-theme="dark"] .generation-card-simplax {
  background: #271722;
  border-color: #d33898;
  box-shadow: inset 0 0 0 1px rgba(211, 56, 152, 0.2);
}

html[data-theme="dark"] .curve-carousel-button:hover,
html[data-theme="dark"] .curve-carousel-button:focus-visible {
  color: #74c8ff;
  border-color: #74c8ff;
}

html[data-theme="dark"] .title,
html[data-theme="dark"] .subtitle,
html[data-theme="dark"] .content,
html[data-theme="dark"] .content h2,
html[data-theme="dark"] .content pre {
  color: #e7e9f3;
}

html[data-theme="dark"] .affiliations,
html[data-theme="dark"] .publication-figure figcaption {
  color: #aab1c5;
}

html[data-theme="dark"] .button.is-dark {
  color: #11131b;
  background: #f2f4ff;
}

html[data-theme="dark"] .bibtex-section,
html[data-theme="dark"] .footer {
  background: #191c27;
}

html[data-theme="dark"] .bibtex-section pre {
  color: #e7e9f3;
  background: #11131b;
}

html[data-theme="dark"] .footer {
  color: #c2c7d6;
}

@media (prefers-reduced-motion: reduce) {
  .curve-carousel-viewport img.slide-from-right,
  .curve-carousel-viewport img.slide-from-left,
  .sudoku-nfe-viewport img.slide-from-right,
  .sudoku-nfe-viewport img.slide-from-left,
  .owt-samples-panel.slide-from-right,
  .owt-samples-panel.slide-from-left {
    animation: none;
  }
}

@media screen and (max-width: 1215px) {
  .curve-carousel-previous,
  .sudoku-nfe-previous,
  .owt-samples-previous {
    left: 0.5rem;
  }

  .curve-carousel-next,
  .sudoku-nfe-next,
  .owt-samples-next {
    right: 0.5rem;
  }
}

@media screen and (max-width: 768px) {
  .publication-header .hero-body {
    padding-top: 5rem;
  }

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

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

  .section {
    padding: 2rem 1.25rem;
  }

  .curve-carousel-model {
    font-size: 0.76rem;
  }

  .curve-carousel-model span,
  .curve-carousel-model strong {
    min-height: 2rem;
    padding: 0.35rem 0.7rem;
  }

  .curve-carousel-model strong {
    min-width: 7.1rem;
  }

  .owt-samples-panel {
    grid-template-columns: 1fr;
  }

  .generation-card {
    padding: 0.85rem 0.9rem;
  }

  .generation-card p {
    font-size: 0.82rem;
  }

  .curve-magnifier {
    width: 8.5rem;
    height: 8.5rem;
  }

  .curve-carousel-button {
    width: 2.25rem;
    height: 2.25rem;
    font-size: 0.78rem;
  }

  .curve-carousel-previous,
  .sudoku-nfe-previous,
  .owt-samples-previous {
    left: -0.8rem;
  }

  .curve-carousel-next,
  .sudoku-nfe-next,
  .owt-samples-next {
    right: -0.8rem;
  }
}
