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

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

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: #fdfcf8;
}
::-webkit-scrollbar-thumb {
    background: #d1fae5;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #6ee7b7;
}

/* Selection */
::selection {
    background: #d1fae5;
    color: #064e3b;
}

/* Navbar transitions */
#navbar.scrolled {
    background: rgba(253, 252, 248, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(6, 95, 70, 0.08);
}

#navbar.scrolled #nav-name {
    color: #064e3b;
}

#navbar.scrolled #nav-subtitle {
    color: #059669;
}

/* Service card stagger animation */
.service-card {
    opacity: 1;
    transform: translateY(0);
    transition: background-color 0.5s ease, transform 0.5s ease;
}

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

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    .fade-up, .fade-down, .fade-in {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* Utility */
.fade-up {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}
.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-down {
    opacity: 0;
    transform: translateY(-16px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-down.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-in {
    opacity: 0;
    transition: opacity 0.8s ease;
}
.fade-in.visible {
    opacity: 1;
}

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