/* ========== RESET & BASE ========== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

body {
    overflow-x: hidden;
}

img, svg {
    display: block;
    max-width: 100%;
}

::selection {
    background: rgba(27, 67, 50, 0.15);
    color: #1B4332;
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: #F5F5F0;
}
::-webkit-scrollbar-thumb {
    background: #b8cfbe;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #8fb897;
}

/* ========== ANIMATIONS ========== */
@keyframes scrollLine {
    0% { transform: scaleY(0); transform-origin: top; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: scaleY(1); transform-origin: bottom; opacity: 0; }
}

.animate-scroll-line {
    animation: scrollLine 2s ease-in-out infinite;
}

/* ========== REVEAL ANIMATIONS ========== */
.reveal {
    opacity: 1;
    transform: translateY(0);
    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);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .animate-scroll-line {
        animation: none;
        opacity: 0.5;
    }
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== HEADER SCROLLED STATE ========== */
#site-header.scrolled {
    background: rgba(250, 250, 247, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(27, 67, 50, 0.08);
}

#site-header.scrolled a:not([class*="bg-"]) {
    color: #1B4332;
}

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

#mobile-menu .mobile-link {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.3s ease, transform 0.3s ease, color 0.2s ease;
}

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

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

/* ========== SERVICE CARDS HOVER ========== */
#services .group:hover svg {
    transform: scale(1.05);
    transition: transform 0.3s ease;
}

#services .group svg {
    transition: transform 0.3s ease, color 0.4s ease;
}

/* ========== FORM INPUTS ========== */
#contact-form input:focus,
#contact-form textarea:focus {
    border-color: #3d8252;
    box-shadow: 0 0 0 3px rgba(61, 130, 82, 0.08);
}

/* ========== LINK UNDERLINE ANIMATION ========== */
a:hover::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 100%;
    height: 1px;
    background: currentColor;
    transform: scaleX(1);
    transition: transform 0.3s ease;
}

/* ========== FOCUS VISIBLE ========== */
:focus-visible {
    outline: 2px solid #1B4332;
    outline-offset: 2px;
}

/* ========== UTILITY ========== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}
