/* Spring smooth scroll (mount-page.mjs). Every rule is keyed on html[data-smooth-scroll], which the
   render-blocking mount sets, so a page whose script fails or never runs keeps native scrolling. */

/* Scroll anchoring moves scrollY when content above the viewport resizes; with the layer fixed,
   that fights the spring and the page jumps. Tradeoff: content growing above the viewport now
   pushes the reader down, as it does in browsers without scroll anchoring. */
html[data-smooth-scroll],
html[data-smooth-scroll] [data-scroll-layer],
html[data-smooth-scroll] [data-scroll-spacer] {overflow-anchor: none;}

/* Native smooth scrolling on top of the spring makes reload and back/forward glide in from the
   top. Links and focus still glide: the mount passes behavior 'smooth' itself. */
html[data-smooth-scroll] {scroll-behavior: auto;}

[data-scroll-layer] {padding: 0; margin: 0; border: 0;}
