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

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

body {
    overflow-x: hidden;
}

/* Hero fade-in animation */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-fade {
    opacity: 0;
    animation: fadeUp 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.hero-fade:nth-child(1) { animation-delay: 0.1s; }
.hero-fade:nth-child(2) { animation-delay: 0.3s; }
.hero-fade:nth-child(3) { animation-delay: 0.5s; }
.hero-fade:nth-child(4) { animation-delay: 0.7s; }

/* Scroll reveal */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1), transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Header scroll state */
#header.scrolled {
    background: rgba(250, 250, 245, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(27, 67, 50, 0.08);
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: currentColor;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

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

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

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

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

/* Service card hover line */
.service-card {
    position: relative;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #1B4332, #2D6A4F);
    transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.service-card:hover::before {
    width: 100%;
}

/* Form input focus effects */
input:focus, textarea:focus {
    border-image: linear-gradient(180deg, #1B4332, #2D6A4F) 1;
}

/* Image hover container */
.overflow-hidden {
    position: relative;
}

.overflow-hidden::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(27, 67, 50, 0.03), transparent);
    pointer-events: none;
}

/* Selection color */
::selection {
    background: rgba(45, 106, 79, 0.2);
    color: #1B4332;
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: #1B4332;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero-fade {
        animation-duration: 0.7s;
    }
}
