/* run.exe · HOTFIX 13 · Restrained, accessible page transitions.
 * Only CSS/JS hosted on this domain; compatible with CSP script-src 'self'.
 * No transitions run when the user requests reduced motion. */
@media (prefers-reduced-motion: no-preference) {
  /* Enter: content eases into place; site chrome remains stable. */
  html.rx-motion body > main#main-content,
  html.rx-motion .admin-content {
    animation: rx-page-enter 270ms cubic-bezier(.22, 1, .36, 1) both;
  }

  /* Exit only on eligible internal navigation, never on form submission. */
  html.rx-motion.rx-leaving body > main#main-content,
  html.rx-motion.rx-leaving .admin-content {
    animation: rx-page-exit 145ms cubic-bezier(.4, 0, 1, 1) both;
  }

  /* A small violet "execute" streak, not a loading overlay. */
  html.rx-motion.rx-leaving body::after {
    content: "";
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #6020d2, #a976ff, #efe4ff);
    transform-origin: left center;
    pointer-events: none;
    animation: rx-page-streak 150ms ease-out both;
  }
}

@keyframes rx-page-enter {
  from { opacity: 0; transform: translate3d(0, 9px, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes rx-page-exit {
  from { opacity: 1; transform: translate3d(0, 0, 0); }
  to   { opacity: .78; transform: translate3d(0, -5px, 0); }
}
@keyframes rx-page-streak {
  from { transform: scaleX(0); opacity: .7; }
  to   { transform: scaleX(1); opacity: 1; }
}

/* Safety: when reduced motion is enabled, never leave page content dimmed. */
@media (prefers-reduced-motion: reduce) {
  html.rx-motion body > main#main-content,
  html.rx-motion .admin-content {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  html.rx-motion.rx-leaving body::after { content: none !important; }
}
