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

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

body {
    overflow-x: hidden;
}

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

::-webkit-scrollbar-track {
    background: #f5f0e8;
}

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

::-webkit-scrollbar-thumb:hover {
    background: #5e9a5e;
}

/* Selection */
::selection {
    background: #1a3a2a;
    color: #faf8f4;
}

/* Animation Keyframes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Reveal Animations - Progressive Enhancement */
.reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.fade-up {
    transform: translateY(32px);
    opacity: 0;
}

@media (prefers-reduced-motion: no-preference) {
    .reveal.fade-up.is-visible {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Reduced motion - content always visible */
@media (prefers-reduced-motion: reduce) {
    .reveal.fade-up {
        opacity: 1;
        transform: none;
    }
    
    .reveal.fade-up.is-visible {
        opacity: 1;
        transform: none;
    }
    
    .animate-fade-in-up {
        animation: none;
        opacity: 1;
        transform: none;
    }
}

/* Navbar */
#navbar {
    background: transparent;
}

#navbar.scrolled {
    background: rgba(250, 248, 244, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(26, 58, 42, 0.06);
}

#navbar.scrolled .nav-link {
    color: #1a3a2a;
}

#navbar.scrolled .nav-link:hover {
    color: #3d7a3d;
}

#navbar.scrolled .menu-line {
    background: #1a3a2a;
}

/* Nav Links Hover Effect */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: #5e9a5e;
    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-nav-link {
    animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

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

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

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

#menu-toggle.active .menu-line:nth-child(3) {
    transform: rotate(-45deg);
    width: 24px;
    margin: 0;
}

/* Smooth image loading */
img {
    opacity: 1;
    transition: opacity 0.3s ease;
}

img[data-src] {
    opacity: 0;
}

/* Focus styles */
a:focus-visible,
button:focus-visible {
    outline: 2px solid #5e9a5e;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Print styles */
@media print {
    nav, #menu-toggle, .reveal {
        display: none !important;
    }
    
    body {
        background: white;
        color: #1a3a2a;
    }
    
    section {
        page-break-inside: avoid;
    }
}
