Streaming live at 10am (PST)

A sticky nav that shows current section

Hi everyone,

I intend to build something like this: Imgur: The magic of the Internet
Basically a sticky nav such that as a person scrolls through the page, the nav highlights current section, and when clicked it goes to appropriate section. On mobile, the nav is also scrollable to the right (displays the remaining sections).

My primary question is - how do I achieve the interaction of the nav highlighting the current section. And if a person scrolls to a section that is beyond the current sections displayed on the nav, then the nav will horizontally scroll until that section name is in view of the nav bar.

Would appreciate any thoughts!