threshold) backBtn.classList.add('show');
        else backBtn.classList.remove('show');
      };
      window.addEventListener('scroll', check);
      window.addEventListener('resize', check);
      check();
      backBtn.addEventListener('click', () => { window.scrollTo({ top: 0, behavior: 'smooth' }); });
    })();

    // Floating nav: smooth scroll for href="#id"
    (function () {
      document.querySelectorAll('.floating-nav a').forEach(link => {
        link.addEventListener('click', fu