const copyButton = document.querySelector('[data-copy-link]');
const copyStatus = document.querySelector('[data-copy-status]');

copyButton?.addEventListener('click', async () => {
  try {
    await navigator.clipboard.writeText('https://arenazreborn.netlify.app/developer-library-050/');
    copyStatus.textContent = 'The official canon link is copied.';
  } catch {
    copyStatus.textContent = 'Copy the page address from your browser to share this release.';
  }
});

const observer = new IntersectionObserver((entries) => {
  entries.forEach((entry) => entry.isIntersecting && entry.target.classList.add('is-visible'));
}, { threshold: 0.16 });

document.querySelectorAll('[data-reveal]').forEach((element) => observer.observe(element));
