// Smooth scrolling for anchor links document.querySelectorAll('a[href^="#"]').forEach(anchor => { anchor.addEventListener('click', function (e) { e.preventDefault(); document.querySelector(this.getAttribute('href')).scrollIntoView({ behavior: 'smooth' }); }); }); // Intersection Observer for animations const animateOnScroll = () => { const sections = document.querySelectorAll('section'); const observer = new IntersersectionObserver((entries) => { entries.forEach(entry => { if (entry.isIntersecting) { entry.target.classList.add('animate-fadeIn'); observer.unobserve(entry.target); } }); }, { threshold: 0.1 }); sections.forEach(section => { observer.observe(section); section.classList.add('opacity-0', 'transition-opacity', 'duration-500'); }); }; document.addEventListener('DOMContentLoaded', () => { animateOnScroll(); console.log('Cosmic Context Navigator loaded 🚀'); });