/* =========================================================================
   Nexus · motion.css — global motion primitives, ripple, page transitions.
   Respects prefers-reduced-motion.
   ========================================================================= */

@keyframes nxRipple {
  to { transform: scale(2.4); opacity: 0; }
}

.nx-ripple {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  background: rgba(255, 255, 255, .35);
  transform: scale(0);
  opacity: .5;
  animation: nxRipple 600ms var(--nx-ease) forwards;
  mix-blend-mode: overlay;
}

/* Aurora drift behind chat */
@keyframes nxAuroraDrift {
  0%   { transform: translate3d(0, 0, 0) rotate(0deg); }
  50%  { transform: translate3d(40px, -30px, 0) rotate(8deg); }
  100% { transform: translate3d(0, 0, 0) rotate(0deg); }
}

.nx-aurora {
  position: absolute;
  inset: -10%;
  pointer-events: none;
  background:
    radial-gradient(40% 30% at 30% 30%, var(--nx-aurora-1), transparent 60%),
    radial-gradient(35% 25% at 70% 60%, var(--nx-aurora-2), transparent 60%),
    radial-gradient(25% 20% at 50% 80%, var(--nx-aurora-3), transparent 60%);
  filter: blur(40px);
  opacity: .6;
  animation: nxAuroraDrift 28s var(--nx-ease-soft) infinite;
  z-index: 0;
}

/* Boot overlay */
#nx-boot-overlay {
  position: fixed;
  inset: 0;
  background: var(--nx-bg);
  display: grid;
  place-items: center;
  z-index: 9999;
  transition: opacity var(--nx-dur-slow) var(--nx-ease);
}
#nx-boot-overlay[data-done="true"] {
  opacity: 0;
  pointer-events: none;
}
.nx-boot-text {
  font-family: var(--nx-font-pixel);
  font-size: 28px;
  letter-spacing: .12em;
  color: var(--nx-accent);
  text-shadow: 0 0 12px var(--nx-glow);
  white-space: nowrap;
}
.nx-boot-text::after {
  content: "_";
  animation: nxBootCaret 600ms steps(2) infinite;
}
@keyframes nxBootCaret {
  50% { opacity: 0; }
}

/* View Transitions API hooks */
::view-transition-old(root) { animation: nxViewFadeOut var(--nx-dur-base) var(--nx-ease); }
::view-transition-new(root) { animation: nxViewFadeIn var(--nx-dur-slow) var(--nx-ease); }
@keyframes nxViewFadeOut { to { opacity: 0; } }
@keyframes nxViewFadeIn { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .nx-aurora { animation: none; }
}
