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

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

body {
    overflow-x: hidden;
}

::selection {
    background: #064e3b;
    color: #faf8f4;
}

/* Smooth scroll offset for fixed header */
section[id] {
    scroll-margin-top: 80px;
}

/* Mobile overlay animation */
#mobileOverlay {
    opacity: 0;
    pointer-events: none;
}

#mobileOverlay.active {
    opacity: 1;
    pointer-events: all;
}

/* Mobile menu link animation */
.mobile-link {
    transform: translateY(20px);
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.4s ease, color 0.3s ease;
}

#mobileOverlay.active .mobile-link {
    transform: translateY(0);
    opacity: 1;
}

#mobileOverlay.active .mobile-link:nth-child(1) { transition-delay: 0.1s; }
#mobileOverlay.active .mobile-link:nth-child(2) { transition-delay: 0.15s; }
#mobileOverlay.active .mobile-link:nth-child(3) { transition-delay: 0.2s; }
#mobileOverlay.active .mobile-link:nth-child(4) { transition-delay: 0.25s; }
#mobileOverlay.active .mobile-link:nth-child(5) { transition-delay: 0.3s; }
#mobileOverlay.active .mobile-link:nth-child(6) { transition-delay: 0.35s; }

/* Hamburger animation */
#bar1 {
    transform-origin: center;
}

#bar2 {
    transform-origin: center;
}

#bar3 {
    transform-origin: center;
}

#menuBtn.active #bar1 {
    transform: rotate(45deg) translate(3px, 3px);
}

#menuBtn.active #bar2 {
    opacity: 0;
}

#menuBtn.active #bar3 {
    transform: rotate(-45deg) translate(3px, -3px);
    width: 1.5rem;
}

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

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

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

/* Header shadow on scroll */
header.scrolled {
    background: rgba(250, 248, 244, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(6, 78, 59, 0.08);
}

/* Subtle line decoration */
.section-line {
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, #064e3b, transparent);
}

/* Image hover effect */
img {
    will-change: transform;
}

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

/* Form styles */
input, textarea, select {
    font-family: inherit;
}

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

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

::-webkit-scrollbar-thumb {
    background: #064e3b;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #022c22;
}

/* Tablet adjustments */
@media (max-width: 768px) {
    section[id] {
        scroll-margin-top: 60px;
    }
}
