Changed around line 1
+ document.addEventListener('DOMContentLoaded', () => {
+ // Mobile menu functionality
+ const mobileMenu = document.querySelector('.mobile-menu');
+ const navLinks = document.querySelector('.nav-links');
+
+ mobileMenu.addEventListener('click', () => {
+ navLinks.classList.toggle('active');
+
+ // Animate hamburger to X
+ mobileMenu.classList.toggle('active');
+ });
+
+ // Smooth scrolling for navigation links
+ document.querySelectorAll('a[href^="#"]').forEach(anchor => {
+ anchor.addEventListener('click', function (e) {
+ e.preventDefault();
+ const target = document.querySelector(this.getAttribute('href'));
+ if (target) {
+ target.scrollIntoView({
+ behavior: 'smooth'
+ });
+ // Close mobile menu if open
+ navLinks.classList.remove('active');
+ }
+ });
+ });
+
+ // Intersection Observer for fade-in animations
+ const observerOptions = {
+ threshold: 0.1,
+ rootMargin: '0px 0px -50px 0px'
+ };
+
+ const observer = new IntersectionObserver((entries) => {
+ entries.forEach(entry => {
+ if (entry.isIntersecting) {
+ entry.target.classList.add('visible');
+ }
+ });
+ }, observerOptions);
+
+ // Observe all sections
+ document.querySelectorAll('section').forEach(section => {
+ section.classList.add('fade-in');
+ observer.observe(section);
+ });
+
+ // Dynamic hero animation
+ const heroAnimation = document.querySelector('.hero-animation');
+ if (heroAnimation) {
+ createParticleEffect(heroAnimation);
+ }
+ });
+
+ function createParticleEffect(container) {
+ const particles = [];
+ const particleCount = 50;
+
+ for (let i = 0; i < particleCount; i++) {
+ const particle = document.createElement('div');
+ particle.className = 'particle';
+ particle.style.cssText = `
+ position: absolute;
+ width: ${Math.random() * 5 + 2}px;
+ height: ${Math.random() * 5 + 2}px;
+ background: ${getRandomColor()};
+ border-radius: 50%;
+ pointer-events: none;
+ opacity: ${Math.random() * 0.5 + 0.2};
+ `;
+ container.appendChild(particle);
+ animateParticle(particle);
+ }
+ }
+
+ function getRandomColor() {
+ const colors = ['#60a5fa', '#2563eb', '#1e40af'];
+ return colors[Math.floor(Math.random() * colors.length)];
+ }
+
+ function animateParticle(particle) {
+ const animation = particle.animate([
+ {
+ transform: `translate(${Math.random() * 100}%, ${Math.random() * 100}%)`,
+ opacity: Math.random() * 0.5 + 0.2
+ },
+ {
+ transform: `translate(${Math.random() * 100}%, ${Math.random() * 100}%)`,
+ opacity: Math.random() * 0.5 + 0.2
+ }
+ ], {
+ duration: Math.random() * 3000 + 2000,
+ iterations: Infinity,
+ direction: 'alternate',
+ easing: 'ease-in-out'
+ });
+ }