:root {
    --plum-950: #3d121c;
    --plum-900: #6b283b;
    --plum-800: #7d2841;
    --plum-700: #972a44;
    --plum-600: #b83450;
    --plum-300: #f3a9b9;
    --plum-200: #f9d0d9;
    --plum-100: #fce7ec;
    --plum-50: #fdf4f7;
    --amber-500: #e09000;
    --amber-400: #ffd14a;
    --amber-300: #ffe78a;
    --amber-200: #fff3c6;
    --amber-100: #fffbeb;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden;
}

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

#mobile-menu .menu-line:nth-child(1) {
    transform: translateY(12px) rotate(45deg);
}

#mobile-menu .menu-line:nth-child(2) {
    opacity: 0;
}

#mobile-menu .menu-line:nth-child(3) {
    transform: translateY(-12px) rotate(-45deg);
    width: 24px;
}

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

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

@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(30px);
    }
}

/* Navbar scroll state */
nav.scrolled {
    box-shadow: 0 1px 0 rgba(125, 40, 65, 0.08);
}

/* Subtle hover underline for text links */
a {
    text-decoration: none;
}

/* Image aspect ratio utilities */
img {
    display: block;
}

/* Selection color */
::selection {
    background: rgba(125, 40, 65, 0.15);
    color: var(--plum-950);
}
</style>
<sm-file path="script.js">
(function () {
    'use strict';

    // Mobile menu
    const menuBtn = document.getElementById('menu-btn');
    const menuClose = document.getElementById('menu-close');
    const mobileMenu = document.getElementById('mobile-menu');
    const mobileLinks = document.querySelectorAll('.mobile-link');

    function openMenu() {
        mobileMenu.classList.add('open');
        mobileMenu.classList.remove('opacity-0', 'pointer-events-none');
        document.body.style.overflow = 'hidden';
    }

    function closeMenu() {
        mobileMenu.classList.remove('open');
        mobileMenu.classList.add('opacity-0', 'pointer-events-none');
        document.body.style.overflow = '';
    }

    menuBtn.addEventListener('click', openMenu);
    menuClose.addEventListener('click', closeMenu);
    mobileLinks.forEach(function (link) {
        link.addEventListener('click', closeMenu);
    });

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

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

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

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

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

    // 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'
                });
            }
        });
    });
})();
