<!-- Force scroll on click #Contact -->
<script>
(function() {
  function handleContactScroll(e) {
    const href = this.getAttribute('href');
    if (!href || !href.includes('#contact')) return;
    
    const target = document.getElementById('contact');
    if (!target) return;
    
    e.preventDefault();
    
    target.scrollIntoView({
      behavior: 'smooth',
      block: 'start'
    });
    
    history.pushState(null, null, '#contact');
  }
  
  function init() {
    document.querySelectorAll('a[href*="#contact"]').forEach(link => {
      link.addEventListener('click', handleContactScroll);
    });
  }
  
  if (document.readyState === 'loading') {
    document.addEventListener('DOMContentLoaded', init);
  } else {
    init();
  }
  
  window.addEventListener('mercury:load', init);
})();
</script>

 

Buy me a coffee