/* ============================================
   Sleep Evaluation Services — Custom Styles
   ============================================ */

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

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

::selection {
    background-color: #99f6e4;
    color: #134e4a;
}

/* --- Navbar --- */
#navbar {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.5);
}

#navbar.scrolled {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

.nav-link {
    position: relative;
}

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

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

/* --- Mobile Menu --- */
.mobile-link {
    border-radius: 0.75rem;
}

#mobileMenu {
    animation: slideDown 0.25s ease-out;
}

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

/* --- Hero Floating Cards --- */
.floating-card {
    animation: float 6s ease-in-out infinite;
}

.floating-card:nth-child(2) {
    animation-delay: -1s;
}

.floating-card:nth-child(3) {
    animation-delay: -2.5s;
}

.floating-card:nth-child(4) {
    animation-delay: -4s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* --- 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, #0d9488, #2dd4bf);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.service-card:hover::before {
    opacity: 1;
}

/* --- Process Steps --- */
.process-step {
    position: relative;
}

.process-step::after {
    content: '';
    display: block;
    width: 48px;
    height: 48px;
    margin: 12px auto 0;
    border-radius: 50%;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 4px,
        rgba(13, 148, 136, 0.05) 4px,
        rgba(13, 148, 136, 0.05) 8px
    );
}

/* --- FAQ --- */
.faq-item {
    transition: border-color 0.2s ease;
}

.faq-item.active {
    border-color: #99f6e4;
}

.faq-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.35s ease;
}

.faq-content.open {
    max-height: 300px;
}

.faq-btn[aria-expanded="true"] .faq-icon {
    transform: rotate(180deg);
}

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

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

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

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

/* --- Focus Styles --- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid #0d9488;
    outline-offset: 2px;
    border-radius: 0.5rem;
}

/* --- Responsive Tweaks --- */
@media (max-width: 640px) {
    .font-serif {
        font-size: 1.75rem;
    }
}
