/* ============================================
   Hair by Jaime Cohen — Custom Styles
   ============================================ */

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

body {
    overflow-x: hidden;
}

::selection {
    background-color: rgba(45, 90, 61, 0.2);
    color: #1e3d28;
}

/* --- Scroll Reveal (progressive enhancement) --- */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(30px);
        transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                    transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    }

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

    .reveal:nth-child(2) { transition-delay: 0.1s; }
    .reveal:nth-child(3) { transition-delay: 0.2s; }
    .reveal:nth-child(4) { transition-delay: 0.3s; }
    .reveal:nth-child(5) { transition-delay: 0.4s; }
    .reveal:nth-child(6) { transition-delay: 0.5s; }
}

/* --- Hero floating animations --- */
@media (prefers-reduced-motion: no-preference) {
    .hero-float-1 {
        animation: float1 8s ease-in-out infinite;
    }
    .hero-float-2 {
        animation: float2 10s ease-in-out infinite;
    }
    .hero-float-3 {
        animation: float3 12s ease-in-out infinite;
    }
}

@keyframes float1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(20px, -30px) scale(1.05); }
    66% { transform: translate(-10px, 20px) scale(0.95); }
}

@keyframes float2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-25px, 15px) scale(1.08); }
    66% { transform: translate(15px, -25px) scale(0.92); }
}

@keyframes float3 {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.15); }
}

/* --- Navbar scroll state --- */
.nav-scrolled {
    background: rgba(253, 252, 250, 0.95) !important;
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 20px rgba(45, 90, 61, 0.08);
}

.nav-scrolled .nav-link {
    color: #2D5A3D !important;
}

.nav-scrolled .menu-line {
    background-color: #2D5A3D !important;
}

.nav-scrolled .font-serif {
    color: #1e3d28 !important;
}

/* --- Mobile menu transitions --- */
#mobile-menu {
    box-shadow: none;
}

#mobile-menu.open {
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

/* --- Service card hover glow --- */
.group:hover .group-hover\:bg-forest-700 {
    background-color: #2D5A3D;
}

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

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: #4a7d4e;
}

/* --- Form styles --- */
input, textarea {
    font-family: 'Nunito Sans', system-ui, sans-serif;
}

input:focus, textarea:focus {
    outline: none;
    border-color: #2D5A3D;
    box-shadow: 0 0 0 3px rgba(45, 90, 61, 0.1);
}

/* --- Success message --- */
.success-message {
    animation: fadeInUp 0.5s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Mobile menu animation --- */
.menu-line {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

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

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

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