In this lesson, we take a look at how to implement animated anchor scrolling using CSS scroll-behavior. We can do this whilst respecting our users' preference for motion and in a way that shouldn't annoy them when searching the page.
I don't believe focus-within
solves much for the inline links. Here's a fork of your Codepen: https://codepen.io/mirhamasala/pen/BadyyZV (The Codepen provided doesn't use inline links, unfortunately). Am I missing something?