/* Cross-document view transitions (Chrome 126+, Edge) */
@view-transition {
  navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.32s;
  animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

/* Keep the header stable during transitions when supported */
.site-header {
  view-transition-name: site-header;
}

::view-transition-old(site-header),
::view-transition-new(site-header) {
  animation: none;
  mix-blend-mode: normal;
}

/* Fallback enter / leave fades */
html.nrlc-nav-loading {
  background: #ffffff;
}

html.nrlc-nav-loading body,
html.nrlc-nav-leaving body {
  opacity: 0;
}

html.nrlc-nav-leaving body {
  transition: opacity 0.18s ease;
}

html.nrlc-nav-ready body {
  opacity: 1;
  transition: opacity 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Top progress bar while the next page loads */
#nrlc-nav-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10001;
  height: 2px;
  width: 0;
  opacity: 0;
  pointer-events: none;
  background: linear-gradient(90deg, #6d46f8 0%, #f038d7 55%, #ea82ee 100%);
  box-shadow: 0 0 12px rgba(240, 56, 215, 0.35);
  transition: opacity 0.15s ease;
}

html.nrlc-nav-leaving #nrlc-nav-progress,
html.nrlc-nav-loading #nrlc-nav-progress {
  opacity: 1;
}

#nrlc-nav-progress.is-active {
  animation: nrlcNavProgress 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes nrlcNavProgress {
  0% { width: 0; }
  35% { width: 42%; }
  75% { width: 78%; }
  100% { width: 92%; }
}

@media (prefers-reduced-motion: reduce) {
  @view-transition {
    navigation: none;
  }

  html.nrlc-nav-loading body,
  html.nrlc-nav-leaving body,
  html.nrlc-nav-ready body {
    opacity: 1 !important;
    transition: none !important;
  }

  #nrlc-nav-progress {
    display: none !important;
  }
}
