/* Base styles and custom utilities */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* Selection color */
::selection {
    background: #99f6e4;
    color: #042f2e;
}

/* Focus visible styles */
:focus-visible {
    outline: 2px solid #0d9488;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Scroll reveal base — content is VISIBLE by default (progressive enhancement) */
.scroll-reveal {
    opacity: 1;
    transform: none;
}

/* Animated state — only applied via JS when in viewport */
.scroll-reveal.revealed {
    animation: revealUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes revealUp {
    from {
        opacity: 0;
        transform: translateY(32px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Staggered delays for grid items */
.scroll-reveal:nth-child(1) { transition-delay: 0ms; }
.scroll-reveal:nth-child(2) { transition-delay: 80ms; }
.scroll-reveal:nth-child(3) { transition-delay: 160ms; }
.scroll-reveal:nth-child(4) { transition-delay: 240ms; }
.scroll-reveal:nth-child(5) { transition-delay: 320ms; }
.scroll-reveal:nth-child(6) { transition-delay: 400ms; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .scroll-reveal {
        opacity: 1;
        transform: none;
        animation: none;
    }
    html {
        scroll-behavior: auto;
    }
}

/* Navbar glass effect when scrolled */
#navbar.scrolled {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06), 0 4px 24px rgba(0, 0, 0, 0.04);
}

/* Nav link hover underline animation */
.nav-link {
    position: relative;
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    width: 0;
    height: 2px;
    background: #0d9488;
    border-radius: 1px;
    transition: all 0.25s ease;
    transform: translateX(-50%);
}
.nav-link:hover::after {
    width: 60%;
}

/* Pulse animation for the "Accepting New Patients" badge */
@keyframes soft-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}
.animate-pulse {
    animation: soft-pulse 2.5s ease-in-out infinite;
}

/* Print styles */
@media print {
    #navbar, #back-to-top, .scroll-reveal { display: none; }
    body { color: #000; background: #fff; }
}
