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

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

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

/* ─── Hero Gradient ─── */
.hero-gradient {
    background: linear-gradient(135deg, #064E3B 0%, #047857 25%, #059669 50%, #10B981 75%, #34D399 100%);
}

/* ─── Hero Animations ─── */
@keyframes heroFloat1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(30px, -20px) scale(1.05); }
}

@keyframes heroFloat2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-20px, 30px) scale(1.08); }
}

@keyframes heroFloat3 {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-45%, -55%) scale(1.1); }
}

.hero-blob-1 { animation: heroFloat1 8s ease-in-out infinite; }
.hero-blob-2 { animation: heroFloat2 10s ease-in-out infinite; }
.hero-blob-3 { animation: heroFloat3 12s ease-in-out infinite; }

/* ─── About Blobs ─── */
@keyframes aboutFloat1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-20px, 20px) scale(1.05); }
}

@keyframes aboutFloat2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(20px, -15px) scale(1.08); }
}

.about-blob-1 { animation: aboutFloat1 9s ease-in-out infinite; }
.about-blob-2 { animation: aboutFloat2 11s ease-in-out infinite; }

/* ─── Patient Blobs ─── */
@keyframes patientFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-15px, 15px) scale(1.05); }
}

.patients-blob { animation: patientFloat 10s ease-in-out infinite; }

/* ─── Contact Blobs ─── */
@keyframes contactFloat1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(15px, -15px) scale(1.05); }
}

@keyframes contactFloat2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-15px, 15px) scale(1.08); }
}

.contact-blob-1 { animation: contactFloat1 9s ease-in-out infinite; }
.contact-blob-2 { animation: contactFloat2 11s ease-in-out infinite; }

/* ─── Navbar ─── */
.nav-link {
    position: relative;
}

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

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

/* ─── Scroll Reveal ─── */
.scroll-reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

/* Progressive enhancement: only animate when JS is available and user prefers motion */
@media (prefers-reduced-motion: no-preference) {
    .scroll-reveal {
        opacity: 0;
        transform: translateY(30px);
        transition: opacity 0.7s ease, transform 0.7s ease;
    }

    .scroll-reveal.revealed {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ─── Service Cards ─── */
.service-card {
    perspective: 1000px;
}

/* ─── Form Styles ─── */
input:focus,
select:focus,
textarea:focus {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

/* ─── Smooth scrollbar ─── */
::-webkit-scrollbar {
    width: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: #A7F3D0;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #6EE7B7;
}

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

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

/* ─── Mobile nav link hover ─── */
.mobile-nav-link {
    position: relative;
    display: block;
}

.mobile-nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #059669;
    transition: width 0.3s ease;
    border-radius: 1px;
}

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

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

/* ─── 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;
    }
}
