window.addEventListener('load', function() {
// Wait for the preloader to fade out (adjust timeout if needed)
setTimeout(function() {
if (window.location.hash) {
const target = document.querySelector(window.location.hash);
if (target) {
// Scroll smoothly to the anchor
target.scrollIntoView({ behavior: 'smooth', block: 'start' });
}
}
}, 500); // delay matches your preloader fade-out time
});