// Show/hide sticky CTA based on scroll position window.addEventListener('scroll', function() { const stickyCta = document.getElementById('sticky-cta'); const contactSection = document.getElementById('contact-form'); // Show sticky CTA when scrolled past hero section if (window.scrollY > window.innerHeight * 0.5) { stickyCta.classList.remove('translate-y-full'); } else { stickyCta.classList.add('translate-y-full'); } // Hide sticky CTA when reaching contact form const contactRect = contactSection.getBoundingClientRect(); if (contactRect.top <= window.innerHeight && contactRect.bottom >= 0) { stickyCta.classList.add('translate-y-full'); } }); // Smooth scroll to contact form function scrollToForm() { document.getElementById('contact-form').scrollIntoView({ behavior: 'smooth' }); } // Form submission handling document.getElementById('trailer-form').addEventListener('submit', function(e) { e.preventDefault(); // Get form values const formData = { name: document.getElementById('name').value, email: document.getElementById('email').value, logline: document.getElementById('logline').value }; // In a real application, you would send this data to your server console.log('Form submitted:', formData); // Show success message alert('Thank you! I\'ll get back to you within 24 hours to discuss your project.'); // Reset form this.reset(); });