/* Base styles and custom utilities */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Service card hover glow */
.service-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    opacity: 0;
    transition: opacity 0.3s ease;
    background: radial-gradient(circle at 50% 0%, rgba(255, 107, 90, 0.08), transparent 70%);
    pointer-events: none;
}

.service-card {
    position: relative;
    overflow: hidden;
}

.service-card:hover::before {
    opacity: 1;
}

/* Navbar scroll effect */
.nav-scrolled {
    background: rgba(26, 26, 26, 0.95) !important;
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Scroll reveal animations - progressive enhancement */
.reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.hidden-reveal {
    opacity: 0;
    transform: translateY(30px);
}

@media (prefers-reduced-motion: reduce) {
    .reveal.hidden-reveal {
        opacity: 1;
        transform: none;
    }
    html {
        scroll-behavior: auto;
    }
    .geo-shape {
        animation: none;
    }
}

/* Floating animation for geometric shapes */
@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

@keyframes float-slow {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-12px); }
}

.geo-shape {
    animation: float-slow 6s ease-in-out infinite;
}

.geo-shape:nth-child(2n) {
    animation-delay: -2s;
    animation-duration: 8s;
}

.geo-shape:nth-child(3n) {
    animation-delay: -4s;
    animation-duration: 10s;
}

/* Pulse animation for the dot */
@keyframes pulse-ring {
    0% { box-shadow: 0 0 0 0 rgba(255, 127, 110, 0.4); }
    70% { box-shadow: 0 0 0 8px rgba(255, 127, 110, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 127, 110, 0); }
}

.animate-pulse {
    animation: pulse-ring 2s ease-in-out infinite;
}
</style>

<sm-file path="script.js">
(function () {
    'use strict';

    // Mobile menu toggle
    const menuToggle = document.getElementById('menu-toggle');
    const mobileMenu = document.getElementById('mobile-menu');
    const menuOpen = document.getElementById('menu-open');
    const menuClose = document.getElementById('menu-close');
    const mobileLinks = document.querySelectorAll('.mobile-link');

    menuToggle.addEventListener('click', function () {
        const isOpen = !mobileMenu.classList.contains('hidden');
        mobileMenu.classList.toggle('hidden');
        menuOpen.classList.toggle('hidden');
        menuClose.classList.toggle('hidden');
    });

    mobileLinks.forEach(function (link) {
        link.addEventListener('click', function () {
            mobileMenu.classList.add('hidden');
            menuOpen.classList.remove('hidden');
            menuClose.classList.add('hidden');
        });
    });

    // Navbar scroll effect
    const navbar = document.getElementById('navbar');
    let lastScroll = 0;

    window.addEventListener('scroll', function () {
        const currentScroll = window.pageYOffset;
        if (currentScroll > 50) {
            navbar.classList.add('nav-scrolled');
        } else {
            navbar.classList.remove('nav-scrolled');
        }
        lastScroll = currentScroll;
    });

    // Scroll reveal - progressive enhancement, only if JS is enabled and user prefers motion
    const prefersReducedMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches;

    if (!prefersReducedMotion) {
        const reveals = document.querySelectorAll('.reveal');

        function checkReveal() {
            reveals.forEach(function (el) {
                const rect = el.getBoundingClientRect();
                const windowHeight = window.innerHeight;
                if (rect.top < windowHeight - 80) {
                    el.classList.remove('hidden-reveal');
                }
            });
        }

        window.addEventListener('scroll', checkReveal);
        checkReveal();
    }

    // Contact form
    const form = document.getElementById('contact-form');
    const successMsg = document.getElementById('form-success');

    if (form) {
        form.addEventListener('submit', function (e) {
            e.preventDefault();
            form.style.display = 'none';
            successMsg.classList.remove('hidden');
        });
    }
})();
