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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
}

::selection {
    background: rgba(168, 47, 47, 0.15);
    color: #5c1d1d;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: #faf9f7;
}
::-webkit-scrollbar-thumb {
    background: #d4c8c4;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #a82f2f;
}

/* Animations */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-up {
    animation: fadeUp 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* Reveal on scroll */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), 
                transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

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

/* Stagger children */
.reveal:nth-child(1) { transition-delay: 0.05s; }
.reveal:nth-child(2) { transition-delay: 0.12s; }
.reveal:nth-child(3) { transition-delay: 0.19s; }
.reveal:nth-child(4) { transition-delay: 0.26s; }
.reveal:nth-child(5) { transition-delay: 0.33s; }
.reveal:nth-child(6) { transition-delay: 0.40s; }

/* Navigation */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: currentColor;
    transition: width 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.nav-link:hover::after {
    width: 100%;
}

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

#mobile-menu.open .mobile-nav-link {
    animation: fadeUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

#mobile-menu.open .mobile-nav-link:nth-child(1) { animation-delay: 0.1s; }
#mobile-menu.open .mobile-nav-link:nth-child(2) { animation-delay: 0.18s; }
#mobile-menu.open .mobile-nav-link:nth-child(3) { animation-delay: 0.26s; }
#mobile-menu.open .mobile-nav-link:nth-child(4) { animation-delay: 0.34s; }

/* Menu toggle animation */
.menu-active #menu-line-1 {
    transform: translateY(4px) rotate(45deg);
}
.menu-active #menu-line-2 {
    opacity: 0;
}
.menu-active #menu-line-3 {
    transform: translateY(-4px) rotate(-45deg);
    width: 1.5rem;
}

/* Form select arrow */
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a8a8a8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    appearance: none;
    -webkit-appearance: none;
}

/* Focus visible */
*:focus-visible {
    outline: 2px solid #a82f2f;
    outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    html {
        scroll-behavior: auto;
    }
    .reveal {
        opacity: 1;
        transform: none;
    }
}

/* Print */
@media print {
    nav, #contact-form, .reveal {
        display: none !important;
    }
    body {
        color: #000;
        background: #fff;
    }
}
