/* Base styles */
html {
    scroll-behavior: smooth;
}

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

/* Navigation */
#nav {
    background: transparent;
    transition: background 0.5s ease, box-shadow 0.5s ease;
}

#nav.scrolled {
    background: rgba(249, 247, 242, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 1px 0 rgba(6, 78, 59, 0.08);
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: currentColor;
    transition: width 0.3s ease;
}

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

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

#mobile-menu.open .mobile-link {
    animation: fadeUp 0.4s ease forwards;
    opacity: 0;
}

#mobile-menu.open .mobile-link:nth-child(1) { animation-delay: 0.05s; }
#mobile-menu.open .mobile-link:nth-child(2) { animation-delay: 0.1s; }
#mobile-menu.open .mobile-link:nth-child(3) { animation-delay: 0.15s; }
#mobile-menu.open .mobile-link:nth-child(4) { animation-delay: 0.2s; }
#mobile-menu.open .mobile-link:nth-child(5) { animation-delay: 0.25s; }

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Menu toggle animation */
#menu-toggle.active .menu-line:first-child {
    transform: rotate(45deg);
    top: 4px;
}

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

#menu-toggle.active .menu-line:last-child {
    width: 24px;
    transform: rotate(-45deg);
    top: auto;
    bottom: 4px;
}

/* Hero animations */
.hero-subtitle {
    animation: fadeUp 0.8s ease 0.3s forwards;
}

.hero-subtitle h1 {
    animation: fadeUp 0.8s ease 0.5s forwards;
}

.hero-subtitle p {
    animation: fadeUp 0.8s ease 0.7s forwards;
}

.hero-subtitle .flex {
    animation: fadeUp 0.8s ease 0.9s forwards;
}

.hero-scroll {
    animation: fadeIn 0.8s ease 1.2s forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

.reveal:nth-child(2) { transition-delay: 0.1s; }
.reveal:nth-child(3) { transition-delay: 0.2s; }
.reveal:nth-child(4) { transition-delay: 0.3s; }

/* Image hover effects */
img {
    transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Selection color */
::selection {
    background: rgba(6, 78, 59, 0.15);
    color: #064e3b;
}

/* Focus styles */
a:focus-visible,
button:focus-visible {
    outline: 2px solid #064e3b;
    outline-offset: 2px;
}

/* Smooth image loading */
img {
    image-rendering: -webkit-optimize-contrast;
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
    
    img {
        transition: none;
    }
    
    .group:hover img {
        transform: none;
    }
    
    #mobile-menu.open .mobile-link {
        animation: none;
        opacity: 1;
    }
    
    .hero-subtitle,
    h1,
    p,
    .flex {
        animation: none;
        opacity: 1;
    }
}

/* Print styles */
@media print {
    #nav,
    .hero-scroll {
        display: none;
    }
    
    body {
        color: #000;
        background: #fff;
    }
    
    .reveal {
        opacity: 1;
        transform: none;
    }
}
