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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    overflow-x: hidden;
}

/* Hero animations - above the fold, always visible */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
}

/* Scroll reveal - progressive enhancement, below the fold only */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(20px);
        transition: opacity 0.7s ease-out, transform 0.7s ease-out;
    }
    
    .reveal.revealed {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fallback: ensure content is visible even without JS */
@supports not (animation-fill-mode: forwards) {
    .reveal {
        opacity: 1;
        transform: none;
    }
}

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

#mobile-menu.closed {
    opacity: 0;
    pointer-events: none;
}

/* Hamburger animation */
#mobile-menu-btn.active #menu-line-1 {
    transform: translateY(4px) rotate(45deg);
}

#mobile-menu-btn.active #menu-line-2 {
    opacity: 0;
}

#mobile-menu-btn.active #menu-line-3 {
    transform: translateY(-4px) rotate(-45deg);
}

/* Navbar scroll state */
#navbar.scrolled {
    background-color: rgba(253, 252, 248, 0.95);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(5, 150, 105, 0.1);
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: #047857;
}

/* Form focus styles */
input:focus,
select:focus,
textarea:focus {
    outline: none;
}

/* Selection color */
::selection {
    background-color: rgba(5, 150, 105, 0.2);
    color: #064e3b;
}

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

img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.5s ease;
}

img[loading="lazy"].loaded {
    opacity: 1;
}
