/* ==========================================
   Signal Precision — polish (global)
   Page transitions + live helpers. Dead reassure/contact chrome removed.
   ========================================== */

@view-transition {
  navigation: auto;
}

#campus-page-stage {
  view-transition-name: hall-stage;
}

::view-transition-group(hall-stage) {
  animation-duration: 560ms;
  animation-timing-function: var(--nx-ease-out);
}
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 320ms;
  animation-timing-function: var(--nx-ease-out);
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}

body.has-nx-shell main {
  animation: nx-page-in 520ms var(--nx-ease-out);
}
@keyframes nx-page-in {
  from {
    opacity: 0;
    transform: translate3d(0, 16px, 0);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

body.has-nx-shell.is-leaving main {
  animation: none;
}

body.has-nx-shell .page-transition__overlay {
  background: var(--nx-bg-void);
  overflow: hidden;
}
body.has-nx-shell .page-transition__overlay.is-active::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(28, 36, 48, 0.12), transparent 55%);
  pointer-events: none;
}
body.has-nx-shell .page-transition__overlay.is-active::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 8%;
  right: 8%;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--nx-accent) 25%,
    var(--nx-accent) 75%,
    transparent 100%
  );
  transform: scaleX(0);
  animation: nx-trans-pulse 420ms var(--nx-ease-out) forwards;
  box-shadow: 0 0 24px var(--nx-tint);
}
@keyframes nx-trans-pulse {
  0% { transform: scaleX(0); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: scaleX(1); opacity: 0.4; }
}

body.has-nx-shell .link-inline {
  color: var(--nx-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 200ms;
}
body.has-nx-shell .link-inline:hover {
  color: var(--nx-accent);
}

[data-theme="light"] body.has-nx-shell .chapter-nav {
  background: color-mix(in srgb, rgba(255, 255, 255, 0.92) 70%, var(--campus-glass-strong));
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.7) inset,
    0 18px 48px rgba(10, 16, 24, 0.1);
}
[data-theme="light"] body.has-nx-shell .page-transition__overlay {
  background: var(--nx-bg-void);
}

@media (prefers-reduced-motion: reduce) {
  body.has-nx-shell main {
    animation: none;
  }
  body.has-nx-shell .page-transition__overlay.is-active::after {
    animation: none;
    transform: scaleX(1);
    opacity: 0.3;
  }
}
