/* ═══════════════════════════════════════════════════════════════
   JOIA Family Acupuncture — Custom Styles
   ═══════════════════════════════════════════════════════════════ */

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
}

::selection {
    background-color: rgba(94, 197, 143, 0.3);
    color: #f0f3f9;
}

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

::-webkit-scrollbar-track {
    background: #0c1538;
}

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

::-webkit-scrollbar-thumb:hover {
    background: #2e4495;
}

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

#navbar.scrolled {
    background-color: rgba(6, 11, 32, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(94, 197, 143, 0.1);
}

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

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: linear-gradient(90deg, #5ec58f, #8eddb0);
    transition: width 0.3s ease;
}

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

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

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

.mobile-link {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease, color 0.3s ease;
}

#mobile-menu.open .mobile-link {
    opacity: 1;
    transform: translateY(0);
}

#mobile-menu.open .mobile-link:nth-child(1) { transition-delay: 0.1s; }
#mobile-menu.open .mobile-link:nth-child(2) { transition-delay: 0.15s; }
#mobile-menu.open .mobile-link:nth-child(3) { transition-delay: 0.2s; }
#mobile-menu.open .mobile-link:nth-child(4) { transition-delay: 0.25s; }
#mobile-menu.open .mobile-link:nth-child(5) { transition-delay: 0.3s; }

/* ── Hamburger Animation ── */
#menu-btn.active .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

#menu-btn.active .menu-line:nth-child(2) {
    opacity: 0;
}

#menu-btn.active .menu-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
    width: 1.5rem;
}

/* ── Scroll Reveal (Progressive Enhancement) ── */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(40px);
        transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    }

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

    .reveal-hero {
        opacity: 0;
        transform: translateY(30px);
        transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    }

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

    /* Staggered hero reveals */
    #hero .reveal-hero:nth-child(1) { transition-delay: 0.1s; }
    #hero .reveal-hero:nth-child(2) { transition-delay: 0.25s; }
    #hero .reveal-hero:nth-child(3) { transition-delay: 0.4s; }
    #hero .reveal-hero:nth-child(4) { transition-delay: 0.55s; }
    #hero .reveal-hero:nth-child(5) { transition-delay: 0.7s; }
}

/* When JS is ready, reveal hero immediately (no delay) */
.js-ready .reveal-hero {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Scroll Indicator ── */
@keyframes scroll-indicator {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(200%); }
}

.animate-scroll-indicator {
    animation: scroll-indicator 1.5s ease-in-out infinite;
}

/* ── Service Card Hover ── */
.group:hover .group-hover\:bg-midnight-900 {
    background-color: #0c1538;
}

/* ── Form Select Arrow ── */
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235c73c2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

/* ── Focus Visible ── */
:focus-visible {
    outline: 2px solid #5ec58f;
    outline-offset: 2px;
}

/* ── Utility ── */
.text-balance {
    text-wrap: balance;
}

/* ── Print ── */
@media print {
    nav, #contact-form, .reveal, .animate-scroll-indicator {
        display: none !important;
    }

    body {
        background: white !important;
        color: black !important;
    }

    a {
        color: black !important;
    }
}
