document.addEventListener('DOMContentLoaded', () => { // 8K Resolution Check const checkResolution = () => { const dpr = window.devicePixelRatio || 1; const isHighRes = window.screen.width * dpr >= 7680; if (isHighRes) { document.documentElement.classList.add('high-dpi'); } }; // Initialize micro-interactions const initMicroInteractions = () => { const navLinks = document.querySelectorAll('.nav-link'); navLinks.forEach(link => { link.addEventListener('mouseenter', () => { link.style.opacity = '0.8'; }); link.addEventListener('mouseleave', () => { link.style.opacity = '1'; }); }); const buttons = document.querySelectorAll('button, .cta-button'); buttons.forEach(button => { button.addEventListener('mousedown', () => { button.style.transform = 'scale(0.98)'; }); button.addEventListener('mouseup', () => { button.style.transform = ''; }); button.addEventListener('mouseleave', () => { button.style.transform = ''; }); }); }; // Animate elements on scroll const initScrollAnimations = () => { const observerOptions = { threshold: 0.1, rootMargin: '0px 0px -100px 0px' }; const observer = new IntersectionObserver((entries) => { entries.forEach(entry => { if (entry.isIntersecting) { entry.target.style.opacity = '1'; entry.target.style.transform = 'translateY(0)'; } }); }, observerOptions); document.querySelectorAll('[data-animate]').forEach(el => { el.style.opacity = '0'; el.style.transform = 'translateY(20px)'; el.style.transition = 'opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1), transform 0.8s cubic-bezier(0.22, 1, 0.36, 1)'; observer.observe(el); }); }; // Smooth scroll const initSmoothScroll = () => { document.querySelectorAll('a[href^="#"]').forEach(anchor => { anchor.addEventListener('click', function(e) { e.preventDefault(); document.querySelector(this.getAttribute('href'))?.scrollIntoView({ behavior: 'smooth' }); }); }); }; // Initialize everything const init = () => { checkResolution(); initMicroInteractions(); initScrollAnimations(); initSmoothScroll(); }; init(); }); // High DPI styles const style = document.createElement('style'); style.textContent = ` .high-dpi { --logo-size: 400px; --tagline-size: 96px; --tagline-spacing: 30px; } @media (min-width: 7680px) { .logo svg { width: var(--logo-size) !important; height: var(--logo-size) !important; } .tagline { font-size: var(--tagline-size) !important; letter-spacing: var(--tagline-spacing) !important; } } `; document.head.appendChild(style);