/* ===== Base & Typography ===== */
html {
    scroll-behavior: smooth;
}

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

::selection {
    background-color: #bbf7d0;
    color: #064E3B;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #fdf9ee;
}
::-webkit-scrollbar-thumb {
    background: #86efac;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #4ade80;
}

/* ===== Header ===== */
#main-header {
    background: transparent;
    transition: background-color 0.4s ease, box-shadow 0.4s ease;
}

#main-header.scrolled {
    background: rgba(254, 253, 248, 0.95);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 20px rgba(6, 78, 59, 0.08);
}

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

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

.menu-line {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.menu-btn.active .menu-line:nth-child(1) {
    transform: translateY(5px) rotate(45deg);
}
.menu-btn.active .menu-line:nth-child(2) {
    opacity: 0;
}
.menu-btn.active .menu-line:nth-child(3) {
    transform: translateY(-5px) rotate(-45deg);
    width: 1.4rem;
}

/* ===== Stat Cards ===== */
@keyframes float-1 {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}
@keyframes float-2 {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
}
@keyframes float-3 {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-12px); }
}
@keyframes float-4 {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-6px); }
}

.stat-card:nth-child(1) { animation: float-1 5s ease-in-out infinite; }
.stat-card:nth-child(2) { animation: float-2 6s ease-in-out infinite; animation-delay: 1s; }
.stat-card:nth-child(3) { animation: float-3 4.5s ease-in-out infinite; animation-delay: 0.5s; }
.stat-card:nth-child(4) { animation: float-4 5.5s ease-in-out infinite; animation-delay: 1.5s; }

/* ===== Service Cards ===== */
.service-card {
    position: relative;
    overflow: hidden;
}

.service-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #064E3B, #4ade80);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.service-card:hover::after {
    transform: scaleX(1);
}

/* ===== Community Cards ===== */
.community-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(5, 46, 22, 0.85) 0%, rgba(5, 46, 22, 0.2) 50%, transparent 100%);
    z-index: 1;
    transition: opacity 0.4s ease;
}

.community-card:hover::before {
    opacity: 0.9;
}

/* ===== Testimonial Cards ===== */
.testimonial-card {
    position: relative;
}

.testimonial-card::before {
    content: '\201C';
    position: absolute;
    top: 16px;
    left: 20px;
    font-family: 'Playfair Display', serif;
    font-size: 5rem;
    line-height: 1;
    color: #bbf7d0;
    z-index: 0;
    pointer-events: none;
}

.testimonial-card > * {
    position: relative;
    z-index: 1;
}

/* ===== Scroll Reveal ===== */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

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

/* Stagger children */
.reveal-stagger > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal-stagger.visible > *:nth-child(1) { transition-delay: 0.05s; opacity: 1; transform: translateY(0); }
.reveal-stagger.visible > *:nth-child(2) { transition-delay: 0.12s; opacity: 1; transform: translateY(0); }
.reveal-stagger.visible > *:nth-child(3) { transition-delay: 0.19s; opacity: 1; transform: translateY(0); }
.reveal-stagger.visible > *:nth-child(4) { transition-delay: 0.26s; opacity: 1; transform: translateY(0); }
.reveal-stagger.visible > *:nth-child(5) { transition-delay: 0.33s; opacity: 1; transform: translateY(0); }
.reveal-stagger.visible > *:nth-child(6) { transition-delay: 0.40s; opacity: 1; transform: translateY(0); }

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    html {
        scroll-behavior: auto;
    }
    .reveal {
        opacity: 1;
        transform: none;
    }
    .reveal-stagger > * {
        opacity: 1;
        transform: none;
    }
}

/* ===== Focus Styles ===== */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid #4ade80;
    outline-offset: 2px;
    border-radius: 4px;
}
