/* Custom styles for Miracle-Ear Huntsville */

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

body {
    overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #f5f3ee;
}
::-webkit-scrollbar-thumb {
    background: #9dc192;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #73a266;
}

/* Navbar scroll state */
#navbar.scrolled {
    box-shadow: 0 1px 20px rgba(49, 82, 43, 0.08);
}

/* Hero image gradient overlay */
#hero img {
    mask-image: linear-gradient(to bottom, rgba(0,0,0,0.05) 60%, rgba(0,0,0,0.3) 100%);
    -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0.05) 60%, rgba(0,0,0,0.3) 100%);
}

/* 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, #31522b, #73a266);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-card:hover::before {
    transform: scaleX(1);
}

/* Testimonial cards */
.testimonial-card {
    position: relative;
}

.testimonial-card::after {
    content: '\201C';
    position: absolute;
    top: 16px;
    right: 24px;
    font-family: 'Playfair Display', serif;
    font-size: 5rem;
    line-height: 1;
    color: #e3eddf;
    pointer-events: none;
}

/* Mobile menu animation */
.menu-line {
    display: block;
}

#menuBtn[aria-expanded="true"] .menu-line:nth-child(1) {
    transform: translateY(4px) rotate(45deg);
}

#menuBtn[aria-expanded="true"] .menu-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

#menuBtn[aria-expanded="true"] .menu-line:nth-child(3) {
    transform: translateY(-4px) rotate(-45deg);
    width: 5px !important;
}

/* Mobile links */
.mobile-link {
    display: block;
}

/* Scroll reveal base - progressive enhancement */
.reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1), transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .service-card::before {
        transform: scaleX(1);
    }
    * {
        transition: none !important;
        animation: none !important;
    }
}

/* Form focus styles */
input:focus,
select:focus,
textarea:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(82, 132, 71, 0.15);
}

/* Print styles */
@media print {
    #navbar, #mobileMenu, .service-card, .testimonial-card {
        break-inside: avoid;
    }
    body {
        color: #000;
        background: #fff;
    }
}

/* Large screen adjustments */
@media (min-width: 1280px) {
    .font-serif {
        text-rendering: optimizeLegibility;
    }
}

/* Mobile-specific */
@media (max-width: 640px) {
    #hero h1 {
        font-size: 2.75rem;
    }
    
    .testimonial-card::after {
        font-size: 3.5rem;
        top: 12px;
        right: 16px;
    }
    
    .floating-card {
        position: relative;
        bottom: 0;
        left: 0;
        margin-top: 1rem;
    }
}
