/* Native scrolling, with a quiet reading rhythm. Content is never CSS-hidden. */
/* Arriving from another page (a #section, a search's text fragment, a restored position) lands at once,
   whatever the page's own stylesheet asks (Dan, August 29: no long animated travel). Links within the
   page glide once motion.js marks the page arrived, two frames after load. */
html:not(.ajhp-motion-smooth) {
  scroll-behavior: auto;
}
html.ajhp-motion.ajhp-motion-smooth {
  scroll-behavior: smooth;
}
/* Each page retains its own anchor clearance, including sticky headers. */
html.ajhp-motion::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: 2px;
  z-index: 1000;
  pointer-events: none;
  background: linear-gradient(90deg, #5e1f28, #a8842f);
  transform: scaleX(var(--ajhp-reading-progress, 0));
  transform-origin: left center;
}
/* Focus navigation stays immediate; the browser owns hash/history behavior. */
html.ajhp-motion.ajhp-motion-smooth:has(:focus-visible) { scroll-behavior: auto; }
@media (prefers-reduced-motion: reduce) {
  html.ajhp-motion { scroll-behavior: auto !important; }
  html.ajhp-motion::before { display: none; }
  html.ajhp-motion *, html.ajhp-motion *::before, html.ajhp-motion *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
@media print, (forced-colors: active) {
  html.ajhp-motion::before { display: none; }
}
