document.addEventListener("scroll", () => {
    const navbar = document.querySelector(".navbar");
    if (window.scrollY > 100) {  // Increased threshold for better effect
        navbar.classList.add("scrolled");
    } else {
        navbar.classList.remove("scrolled");
    }
});