/* ─── Base & Typography ─── */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

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

/* ─── Navbar ─── */
#navbar {
    transition: box-shadow 0.3s ease, background 0.3s ease;
}

#navbar.scrolled {
    box-shadow: 0 4px 20px rgba(107, 33, 168, 0.1);
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: #a855f7;
    border-radius: 1px;
    transition: width 0.2s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 60%;
}

/* ─── Stat Cards ─── */
.stat-card {
    transform: translateY(0);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(107, 33, 168, 0.15) !important;
}

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

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #6b21a8, #fbbf24);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

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

/* ─── Condition Cards ─── */
.condition-card {
    transition: transform 0.3s ease, background 0.3s ease, border-color 0.3s ease;
}

.condition-card:hover {
    transform: translateY(-4px);
}

/* ─── Scroll Animations ─── */
.scroll-animate {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-animate[data-animate] {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-animate[data-animate].visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger children */
.scroll-animate[data-animate="stagger"] > * {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.scroll-animate[data-animate="stagger"].visible > * {
    opacity: 1;
    transform: translateY(0);
}

.scroll-animate[data-animate="stagger"].visible > *:nth-child(1) { transition-delay: 0.05s; }
.scroll-animate[data-animate="stagger"].visible > *:nth-child(2) { transition-delay: 0.1s; }
.scroll-animate[data-animate="stagger"].visible > *:nth-child(3) { transition-delay: 0.15s; }
.scroll-animate[data-animate="stagger"].visible > *:nth-child(4) { transition-delay: 0.2s; }
.scroll-animate[data-animate="stagger"].visible > *:nth-child(5) { transition-delay: 0.25s; }
.scroll-animate[data-animate="stagger"].visible > *:nth-child(6) { transition-delay: 0.3s; }
.scroll-animate[data-animate="stagger"].visible > *:nth-child(7) { transition-delay: 0.35s; }
.scroll-animate[data-animate="stagger"].visible > *:nth-child(8) { transition-delay: 0.4s; }

/* ─── Mobile Menu ─── */
#mobile-menu {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

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

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

/* ─── Responsive tweaks ─── */
@media (max-width: 640px) {
    .stat-card { padding: 1.25rem !important; }
    .stat-card div:first-child svg { width: 22px !important; height: 22px !important; }
    .stat-card .text-3xl { font-size: 1.75rem !important; }
}
