/* Base & Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Geometric shapes for hero */
.geometric-shape {
    position: absolute;
    opacity: 0.08;
    pointer-events: none;
}

.shape-circle-1 {
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: #FF6B4A;
    top: -100px;
    right: 5%;
    animation: float 8s ease-in-out infinite;
}

.shape-circle-2 {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: #FF6B4A;
    bottom: 15%;
    left: 45%;
    animation: float 6s ease-in-out infinite reverse;
}

.shape-square-1 {
    width: 120px;
    height: 120px;
    background: #FF6B4A;
    top: 30%;
    right: 2%;
    transform: rotate(45deg);
    animation: spin-slow 20s linear infinite;
}

.shape-triangle-1 {
    width: 0;
    height: 0;
    border-left: 80px solid transparent;
    border-right: 80px solid transparent;
    border-bottom: 140px solid #FF6B4A;
    top: 60%;
    left: 3%;
    animation: float 7s ease-in-out infinite;
    opacity: 0.06;
}

.shape-ring-1 {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    border: 3px solid #FF6B4A;
    bottom: -50px;
    right: 10%;
    animation: float 9s ease-in-out infinite reverse;
}

/* Animations */
@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(2deg); }
}

@keyframes spin-slow {
    from { transform: rotate(45deg); }
    to { transform: rotate(405deg); }
}

/* Clip path for diagonal section */
.clip-diagonal {
    clip-path: polygon(50% 0%, 100% 0, 100% 100%, 0% 100%);
}

/* Service card hover */
.service-card {
    will-change: transform;
}

.service-card:hover {
    transform: translateY(-4px);
}

/* Process step animation */
.process-step {
    will-change: transform;
}

.process-step:hover {
    transform: translateY(-4px);
}

/* Scroll reveal base styles (progressive enhancement) */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(30px);
        transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    }

    .reveal.revealed {
        opacity: 1;
        transform: translateY(0);
    }

    .reveal-delay-1 { transition-delay: 0.1s; }
    .reveal-delay-2 { transition-delay: 0.2s; }
    .reveal-delay-3 { transition-delay: 0.3s; }
    .reveal-delay-4 { transition-delay: 0.4s; }
    .reveal-delay-5 { transition-delay: 0.5s; }
    .reveal-delay-6 { transition-delay: 0.6s; }
}

/* Mobile menu transitions */
#mobileMenu.open {
    opacity: 1;
    pointer-events: all;
}

#mobileMenu.closed {
    opacity: 0;
    pointer-events: none;
}

/* Navbar scroll state */
#navbar.scrolled {
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 107, 74, 0.1);
}

/* Input autofill override */
input:-webkit-autofill,
textarea:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 30px #1A1A2E inset !important;
    -webkit-text-fill-color: #ffffff !important;
}
</style>
<sm-file path="script.js">
(function () {
    'use strict';

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

    function handleNavbarScroll() {
        const currentScroll = window.pageYOffset;
        if (currentScroll > 50) {
            navbar.classList.add('scrolled');
        } else {
            navbar.classList.remove('scrolled');
        }
        lastScroll = currentScroll;
    }

    window.addEventListener('scroll', handleNavbarScroll, { passive: true });

    // ─── Mobile menu ────────────────────────────────────────────────────────
    const menuBtn = document.getElementById('menuBtn');
    const mobileMenu = document.getElementById('mobileMenu');
    const mobileLinks = document.querySelectorAll('.mobile-link');
    let menuOpen = false;

    function toggleMenu() {
        menuOpen = !menuOpen;
        if (menuOpen) {
            mobileMenu.classList.remove('closed');
            mobileMenu.classList.add('open');
            document.body.style.overflow = 'hidden';
        } else {
            mobileMenu.classList.remove('open');
            mobileMenu.classList.add('closed');
            document.body.style.overflow = '';
        }
    }

    menuBtn.addEventListener('click', toggleMenu);

    mobileLinks.forEach(function (link) {
        link.addEventListener('click', function () {
            menuOpen = false;
            mobileMenu.classList.remove('open');
            mobileMenu.classList.add('closed');
            document.body.style.overflow = '';
        });
    });

    // ─── Scroll reveal (progressive enhancement) ────────────────────────────
    if (window.matchMedia('(prefers-reduced-motion: no-preference)').matches) {
        const revealElements = document.querySelectorAll('.reveal');

        function checkReveal() {
            const windowHeight = window.innerHeight;
            const revealPoint = 100;

            revealElements.forEach(function (el) {
                const elementTop = el.getBoundingClientRect().top;
                if (elementTop < windowHeight - revealPoint) {
                    el.classList.add('revealed');
                }
            });
        }

        window.addEventListener('scroll', checkReveal, { passive: true });
        checkReveal(); // Check on load
    }

    // ─── Contact form ───────────────────────────────────────────────────────
    const contactForm = document.getElementById('contactForm');
    const formSuccess = document.getElementById('formSuccess');

    if (contactForm) {
        contactForm.addEventListener('submit', function (e) {
            e.preventDefault();

            // Simple validation
            const firstName = document.getElementById('firstName').value.trim();
            const email = document.getElementById('email').value.trim();

            if (!firstName || !email) {
                return;
            }

            // Hide form, show success
            contactForm.style.display = 'none';
            formSuccess.classList.remove('hidden');
        });
    }

    // ─── Smooth scroll for anchor links ─────────────────────────────────────
    document.querySelectorAll('a[href^="#"]').forEach(function (anchor) {
        anchor.addEventListener('click', function (e) {
            const targetId = this.getAttribute('href');
            if (targetId === '#') return;

            const target = document.querySelector(targetId);
            if (target) {
                e.preventDefault();
                const navHeight = navbar.offsetHeight;
                const targetPosition = target.getBoundingClientRect().top + window.pageYOffset - navHeight;

                window.scrollTo({
                    top: targetPosition,
                    behavior: 'smooth'
                });
            }
        });
    });
})();
