/* Reading stays still. Only emphasis and navigation move. */
body.s-article .s-prose h2{position:relative;scroll-margin-top:130px;}
body.s-article .s-prose h2:after{content:"";position:absolute;inset-inline-start:0;bottom:-6px;width:min(140px,40%);height:5px;background:#f0b4bd;clip-path:polygon(0 40%,35% 0,100% 35%,97% 80%,20% 100%);transform:scaleX(0);transform-origin:left;transition:transform .7s cubic-bezier(.16,1,.3,1);}
body.s-article .s-prose h2.article-seen:after{transform:scaleX(1);}
body.s-article .s-toc a{transition:background-size .4s,color .25s;background:linear-gradient(#f0b4bd90,#f0b4bd90) left bottom/0 35% no-repeat;}
body.s-article .s-toc a[aria-current=location]{background-size:100% 35%;color:#000;}
body.s-article .s-next{position:relative;}
body.s-article .s-next:before{content:"";position:absolute;top:0;inset-inline-start:0;inset-inline-end:0;height:3px;background:#f0b4bd;transform:scaleX(0);transform-origin:left;transition:transform .8s;}
body.s-article .s-next.article-seen:before{transform:scaleX(1);}
body.s-article .s-next>a{transition:color .25s;}
body.s-article .s-next>a:is(:hover,:focus-visible){color:#f0b4bd;}
@media(prefers-reduced-motion:reduce){body.s-article .s-prose h2:after,body.s-article .s-toc a,body.s-article .s-next:before{transition:none;}}
body.s-article.motion-paused .s-prose h2:after,body.s-article.motion-paused .s-toc a,body.s-article.motion-paused .s-next:before{transition:none;}

/* Direction-aware animation and decoration. */
:where(html[dir="rtl"]) body.s-article .s-prose h2:after{transform-origin:right;}
:where(html[dir="rtl"]) body.s-article .s-toc a{background:linear-gradient(#f0b4bd90,#f0b4bd90) right bottom/0 35% no-repeat;}
:where(html[dir="rtl"]) body.s-article .s-next:before{transform-origin:right;}
