    const sectionHeight = section.clientHeight;

        if (scrollPosition >= sectionTop - 85 && scrollPosition < sectionTop + sectionHeight - 85) { //85 is header space
            const activeLinkId = section.id; // Get the current section id
            navLinks.forEach((link) => {
                link.classList.remove('active-header'); // Remove active class from all links
            });
            // Add active class to the corresponding <a> tag
            document.querySelector(`a[href="#$