document.addEventListener('click', function(e){ const link = e.target.closest('a[href^="#"]'); if(!link) return; const hash = link.getAttribute('href'); if(!hash || hash === '#') return; const target = document.querySelector(hash); if(!target) return; e.preventDefault(); // If you have a sticky header, set this to its height (ex: 80-110) const headerOffset = 0; const y = target.getBoundingClientRect().top + window.pageYOffset - headerOffset; window.scrollTo({ top: y, behavior: 'smooth' }); // optional: update URL hash without jumping history.pushState(null, '', hash); });

THIS IS

WHERE EVERYTHING IS ENERGY!