/* ========================================
   Roanoke Therapeutic Services
   Custom Styles
======================================== */

/* Base & Typography */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
}

/* Selection Color */
::selection {
    background: rgba(255, 107, 74, 0.3);
    color: #f6f6f7;
}

/* ========================================
   Animations
======================================== */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-up {
    animation: fadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Scroll Reveal */
.scroll-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);
}

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

/* Staggered reveal delays */
.scroll-reveal[data-delay="0"] { transition-delay: 0s; }
.scroll-reveal[data-delay="100"] { transition-delay: 0.1s; }
.scroll-reveal[data-delay="200"] { transition-delay: 0.1s; }
.scroll-reveal[data-delay="300"] { transition-delay: 0.15s; }
.scroll-reveal[data-delay="400"] { transition-delay: 0.2s; }

/* ========================================
   Navigation
======================================== */
#navbar {
    transition: background-color 0.4s ease, 
                box-shadow 0.4s ease,
                backdrop-filter 0.4s ease;
}

#navbar.scrolled {
    background-color: rgba(18, 20, 24, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* ========================================
   Mobile Menu
======================================== */
#mobileMenu.open {
    opacity: 1;
    pointer-events: all;
}

#mobileMenu.closed {
    opacity: 0;
    pointer-events: none;
}

.menu-line {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

#menuBtn.active .menu-line:nth-child(1) {
    transform: translateY(3px) rotate(45deg);
}

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

#menuBtn.active .menu-line:nth-child(3) {
    transform: translateY(-3px) rotate(-45deg);
    width: 1.25rem;
}

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

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

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

/* ========================================
   Service Cards
======================================== */
.scroll-reveal:nth-child(1) { transition-delay: 0s; }
.scroll-reveal:nth-child(2) { transition-delay: 0.1s; }
.scroll-reveal:nth-child(3) { transition-delay: 0.2s; }
.scroll-reveal:nth-child(4) { transition-delay: 0.1s; }
.scroll-reveal:nth-child(5) { transition-delay: 0.2s; }
.scroll-reveal:nth-child(6) { transition-delay: 0.3s; }

/* ========================================
   Form Styles
======================================== */
select option {
    background: #1e2126;
    color: #c7c9cd;
}

/* ========================================
   Focus Styles
======================================== */
input:focus,
textarea:focus,
select:focus {
    outline: none;
}

/* ========================================
   Smooth Image Loading
======================================== */
img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: #5c626b;
}

/* ========================================
   Responsive Adjustments
======================================== */
@media (max-width: 767px) {
    .font-serif {
        line-height: 1.15;
    }
}

@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;
    }

    .scroll-reveal {
        opacity: 1;
        transform: none;
    }
}
