Adding a scroll-to-top button without JavaScript: https://kevq.uk/adding-a-scroll-to-top-button-without-javascript/
This reminds me, I should implement the "#" relatively URI as a slightly simpler way to do this... And it's a nice reminder about the "scroll-behavior: smooth" CSS property!
Really you can probably drop your CSS frameworks, browsers have taken the hint and implemented the same features in a nicer syntax!