*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    background-color: #1a1a1a;
    color: #ffffff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.font-serif {
    font-family: 'Playfair Display', serif;
}

.font-sans {
    font-family: 'Inter', sans-serif;
}

/* Reveal animation - progressive enhancement */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(24px);
        transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }
    .reveal.visible {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* FAQ accordion */
.faq-btn {
    cursor: pointer;
}

.faq-btn .faq-icon {
    transition: transform 0.3s ease;
}

.faq-btn.active .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
}

.faq-answer.open {
    max-height: 200px;
    padding-top: 1rem;
}

/* Mobile menu */
#mobile-menu {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Selection color */
::selection {
    background-color: #FF6B6B;
    color: #1a1a1a;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
    background: #404040;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #FF6B6B;
}

/* Thin line separator */
.line {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 107, 107, 0.3), transparent);
}
</style>

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

    // Mobile menu toggle
    const menuBtn = document.getElementById('menu-btn');
    const menu = document.getElementById('mobile-menu');
    const menuIcon = document.getElementById('menu-icon');
    let menuOpen = false;

    menuBtn.addEventListener('click', function() {
        menuOpen = !menuOpen;
        menu.classList.toggle('hidden');
        if (menuOpen) {
            menuIcon.innerHTML = '<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M6 18L18 6M6 6l12 12"/>';
        } else {
            menuIcon.innerHTML = '<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M4 6h16M4 12h16M4 18h16"/>';
        }
    });

    // Close mobile menu on link click
    document.querySelectorAll('.mobile-link').forEach(function(link) {
        link.addEventListener('click', function() {
            menuOpen = false;
            menu.classList.add('hidden');
            menuIcon.innerHTML = '<path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M4 6h16M4 12h16M4 18h16"/>';
        });
    });

    // Scroll reveal
    function revealOnScroll() {
        var reveals = document.querySelectorAll('.reveal');
        reveals.forEach(function(el, index) {
            var windowHeight = window.innerHeight;
            var elementTop = el.getBoundingClientRect().top;
            var revealPoint = 100;

            if (elementTop < windowHeight - revealPoint) {
                el.style.transitionDelay = (index % 3) * 0.1 + 's';
                el.classList.add('visible');
            }
        });
    }

    // Run on load and scroll
    window.addEventListener('scroll', revealOnScroll);
    window.addEventListener('load', revealOnScroll);

    // FAQ accordion
    document.querySelectorAll('.faq-btn').forEach(function(btn) {
        btn.addEventListener('click', function() {
            var answer = this.nextElementSibling;
            var isOpen = answer.classList.contains('open');

            // Close all
            document.querySelectorAll('.faq-answer').forEach(function(a) {
                a.classList.remove('open');
            });
            document.querySelectorAll('.faq-btn').forEach(function(b) {
                b.classList.remove('active');
            });

            // Toggle current
            if (!isOpen) {
                answer.classList.add('open');
                this.classList.add('active');
            }
        });
    });

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

    form.addEventListener('submit', function(e) {
        e.preventDefault();
        var btn = form.querySelector('button[type="submit"]');
        btn.textContent = 'Sending...';
        btn.disabled = true;

        setTimeout(function() {
            form.reset();
            successMsg.classList.remove('hidden');
            btn.textContent = 'Send Message';
            btn.disabled = false;

            setTimeout(function() {
                successMsg.classList.add('hidden');
            }, 4000);
        }, 800);
    });

    // Navbar background on scroll
    var nav = document.getElementById('nav');
    window.addEventListener('scroll', function() {
        if (window.scrollY > 50) {
            nav.classList.add('bg-charcoal-900/95');
        } else {
            nav.classList.remove('bg-charcoal-900/95');
        }
    });
})();
</script>
