/* ========================================
   K. V. Davis Counseling — Custom Styles
   ======================================== */

/* CSS Custom Properties */
:root {
    --color-cream: #faf9f6;
    --color-cream-dark: #f5f3ed;
    --color-emerald-50: #ecfdf5;
    --color-emerald-100: #d1fae5;
    --color-emerald-200: #a7f3d0;
    --color-emerald-300: #6ee7b7;
    --color-emerald-400: #34d399;
    --color-emerald-500: #10b981;
    --color-emerald-600: #059669;
    --color-emerald-700: #047857;
    --color-emerald-800: #065f46;
    --color-emerald-900: #064e3b;
    --color-emerald-950: #022c22;
    --color-charcoal: #1a1a1a;
    --font-serif: 'Playfair Display', Georgia, serif;
    --font-sans: 'Inter', system-ui, sans-serif;
}

/* Base Reset & Typography */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: var(--font-sans);
    background-color: var(--color-cream);
    color: var(--color-charcoal);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Font overrides */
.font-serif {
    font-family: var(--font-serif), Georgia, serif;
}

.font-sans {
    font-family: var(--font-sans), system-ui, sans-serif;
}

/* Section Labels */
.section-label {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--color-emerald-600);
    background: linear-gradient(135deg, var(--color-emerald-100), var(--color-emerald-50));
    padding: 0.4em 1em;
    border-radius: 100px;
    border: 1px solid var(--color-emerald-200);
}

/* Navbar */
#navbar {
    background: transparent;
    transition: background 0.4s ease, box-shadow 0.4s ease, padding 0.4s ease;
}

#navbar.scrolled {
    background: rgba(250, 249, 246, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(4, 120, 87, 0.08), 0 4px 20px rgba(4, 120, 87, 0.06);
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-emerald-500);
    border-radius: 1px;
    transition: width 0.3s ease;
}

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

/* Mobile Menu */
#mobile-menu {
    max-height: 0;
    opacity: 0;
    transition: max-height 0.4s ease, opacity 0.3s ease;
}

#mobile-menu.open {
    max-height: 400px;
    opacity: 1;
}

#mobile-menu.open .menu-line:nth-child(1) {
    transform: translateY(5px) rotate(45deg);
}

#mobile-menu.open .menu-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

#mobile-menu.open .menu-line:nth-child(3) {
    transform: translateY(-5px) rotate(-45deg);
}

.mobile-link {
    display: block;
    text-align: left;
}

/* Hero Badge */
.hero-badge {
    animation: fadeInUp 0.8s ease forwards;
    opacity: 0;
}

/* Hero Headline */
#hero h1 {
    animation: fadeInUp 0.8s ease 0.1s forwards;
    opacity: 0;
}

#hero p {
    animation: fadeInUp 0.8s ease 0.2s forwards;
    opacity: 0;
}

#hero .flex-col {
    animation: fadeInUp 0.8s ease 0.3s forwards;
    opacity: 0;
}

#hero .mt-12 {
    animation: fadeInUp 0.8s ease 0.4s forwards;
    opacity: 0;
}

/* Floating Card */
.hero-card-float {
    animation: float 4s ease-in-out infinite;
}

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

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

/* 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, var(--color-emerald-400), var(--color-emerald-600));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
    border-radius: 2rem 2rem 0 0;
}

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

/* Section Animations */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-in-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.fade-in-right {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Back to Top */
#back-to-top {
    transition: opacity 0.3s ease, transform 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}

#back-to-top.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

#back-to-top:hover {
    box-shadow: 0 4px 20px rgba(4, 120, 87, 0.4);
}

/* Keyframes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Selection Color */
::selection {
    background: var(--color-emerald-200);
    color: var(--color-emerald-900);
}

/* Focus Styles */
:focus-visible {
    outline: 2px solid var(--color-emerald-500);
    outline-offset: 2px;
}

/* Reduced Motion */
@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;
    }
    
    .fade-in,
    .fade-in-left,
    .fade-in-right {
        opacity: 1;
        transform: none;
    }
}

/* Print Styles */
@media print {
    #navbar,
    #back-to-top,
    .animate-scroll-down {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
}
