This is a two pronged exercise, one being to code a menu utilising an intersection observer and two to create a very minimal dom utility to handle selections, classes and events.
A function written in SCSS to simplify calculating clamp rules. Just pass in min and max font sizes, min and max widths, and the function will generate the vanilla CSS clamp rule for you.