/* Base & Typography */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: #FAFAF7;
}
::-webkit-scrollbar-thumb {
    background: #c5dbcc;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #98c198;
}

/* Selection */
::selection {
    background: #98c198;
    color: #284128;
}

/* Reveal Animations (progressive enhancement) */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(24px);
        transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
                    transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }
    .reveal.revealed {
        opacity: 1;
        transform: translateY(0);
    }
    
    /* Stagger delays */
    .reveal-delay-1 { transition-delay: 0.1s; }
    .reveal-delay-2 { transition-delay: 0.2s; }
    .reveal-delay-3 { transition-delay: 0.3s; }
    .reveal-delay-4 { transition-delay: 0.4s; }
}

/* Service cards */
.service-card {
    transition: background-color 0.5s ease;
}

/* Navbar transition */
#navbar {
    backdrop-filter: blur(0px);
    transition: backdrop-filter 0.5s ease, background-color 0.5s ease, padding 0.5s ease;
}

#navbar.scrolled {
    backdrop-filter: blur(12px);
    background-color: rgba(250, 250, 247, 0.9);
}

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

/* Mobile link hover */
.mobile-link {
    position: relative;
}
.mobile-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: #3d633d;
    transition: width 0.3s ease;
}
.mobile-link:hover::after {
    width: 100%;
}

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

/* Focus styles */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid #4a7a4a;
    outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .service-card,
    img,
    #navbar {
        transition: none;
    }
    .aspect-square img:hover,
    .aspect-square:hover img {
        transform: none;
    }
}
