/* ============================================
   Kevin Miller, M.D. — Premium Dark Luxury
   Custom Styles & Animations
   ============================================ */

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

body {
    overflow-x: hidden;
}

::selection {
    background: rgba(201, 168, 76, 0.3);
    color: #f5f0e0;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #0a1628;
}
::-webkit-scrollbar-thumb {
    background: rgba(201, 168, 76, 0.3);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(201, 168, 76, 0.5);
}

/* --- Scroll Reveal Base (progressive enhancement) --- */
.reveal {
    opacity: 1;
    transform: none;
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.8s cubic-bezier(0.25, 0.46, 0.46, 0.94);
}

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

/* --- Scroll Reveal Animations (enhanced via JS) --- */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(30px);
    }
    .reveal.revealed {
        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; }
    .reveal-delay-5 { transition-delay: 0.5s; }
    .reveal-delay-6 { transition-delay: 0.6s; }
}

/* --- Navbar --- */
#navbar {
    background: transparent;
}

#navbar.scrolled {
    background: rgba(5, 13, 23, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(201, 168, 76, 0.08);
    box-shadow: 0 4px 40px rgba(0, 0, 0, 0.4);
}

#navbar.scrolled .menu-line {
    background: white;
}

/* --- Mobile Menu --- */
.mobile-link {
    opacity: 1;
    transform: none;
    transition: color 0.3s ease;
}

#mobile-menu.open {
    opacity: 1;
    pointer-events: all;
}

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

/* --- Menu Toggle Animation --- */
.menu-toggle-active .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(3px, 3px);
}
.menu-toggle-active .menu-line:nth-child(2) {
    opacity: 0;
    transform: translateX(10px);
}
.menu-toggle-active .menu-line:nth-child(3) {
    transform: rotate(-45deg) translate(3px, -3px);
    width: 1.25rem;
}

/* --- Service Cards --- */
.service-card {
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(201, 168, 76, 0), transparent);
    transition: background 0.5s ease;
}

.service-card:hover::before {
    background: linear-gradient(90deg, transparent, rgba(201, 168, 76, 0.6), transparent);
}

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

.testimonial-card::after {
    content: '"';
    position: absolute;
    top: 16px;
    right: 24px;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 6rem;
    color: rgba(201, 168, 76, 0.06);
    line-height: 1;
    pointer-events: none;
}

/* --- Scroll Line Animation --- */
@keyframes scrollLine {
    0% {
        opacity: 0;
        transform: scaleY(0);
        transform-origin: top;
    }
    50% {
        opacity: 1;
        transform: scaleY(1);
        transform-origin: top;
    }
    51% {
        transform-origin: bottom;
    }
    100% {
        opacity: 0;
        transform: scaleY(0);
        transform-origin: bottom;
    }
}

.animate-scroll-line {
    animation: scrollLine 2s ease-in-out infinite;
}

/* --- Gold Shimmer on CTA --- */
@keyframes shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

/* --- Custom Select Styling --- */
select option {
    background: #0d1b2a;
    color: #e0d5c0;
}

/* --- Form Focus States --- */
input:focus,
textarea:focus,
select:focus {
    background: rgba(10, 22, 40, 0.8);
}

/* --- Image Loading --- */
img {
    opacity: 1;
    transition: opacity 0.4s ease;
}

img[data-src] {
    opacity: 0;
}

/* --- Mobile Responsiveness --- */
@media (max-width: 640px) {
    .font-serif {
        line-height: 1.2;
    }
}

/* --- Print Styles --- */
@media print {
    #navbar,
    #contact,
    .service-card,
    .testimonial-card {
        background: white !important;
        color: black !important;
    }
}
