/* ============================================
   Phases of Beauty Hair Studio — Custom Styles
   ============================================ */

/* --- Base & Reset --- */
*, *::before, *::after {
    box-sizing: border-box;
}

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

body {
    overflow-x: hidden;
}

::selection {
    background: rgba(91, 191, 154, 0.2);
    color: #0f1d35;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #f0faf7;
}
::-webkit-scrollbar-thumb {
    background: #8fd3bc;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #5bbf9a;
}

/* --- Hero Animations (above the fold — always visible) --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

/* When JS is disabled or reduced-motion preferred, all content stays visible */
.no-motion .reveal {
    opacity: 1;
    transform: none;
    transition: none;
}

/* --- Navbar transitions --- */
.navbar-scrolled {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 20px rgba(15, 29, 53, 0.08);
}

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

.service-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #5bbf9a, #8fd3bc);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* --- Gallery items --- */
.gallery-item {
    aspect-ratio: auto;
    cursor: pointer;
}

.gallery-item:nth-child(1) { aspect-ratio: 4/5; }
.gallery-item:nth-child(2) { aspect-ratio: 4/3; }
.gallery-item:nth-child(3) { aspect-ratio: 4/3; }
.gallery-item:nth-child(4) { aspect-ratio: 4/5; }
.gallery-item:nth-child(5) { aspect-ratio: 4/3; }
.gallery-item:nth-child(6) { aspect-ratio: 4/5; }
.gallery-item:nth-child(7) { aspect-ratio: 4/3; }
.gallery-item:nth-child(8) { aspect-ratio: 4/3; }

/* --- Mobile menu --- */
.mobile-menu-open {
    opacity: 1 !important;
    pointer-events: auto !important;
}

body.menu-open {
    overflow: hidden;
}

/* --- Hamburger animation --- */
.menu-active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.menu-active .hamburger-line:nth-child(2) {
    opacity: 0;
}
.menu-active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* --- Form select arrow --- */
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

/* --- Subtle hover glow on CTA buttons --- */
.cta-glow:hover {
    box-shadow: 0 0 40px rgba(91, 191, 154, 0.3) !important;
}

/* --- Decorative divider --- */
.divider-mint {
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, #5bbf9a, #8fd3bc);
    border: none;
    margin: 1.5rem 0;
}

/* --- Smooth focus outlines --- */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #5bbf9a;
    outline-offset: 2px;
}

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

    #hero h1 {
        font-size: 2.75rem;
    }

    .service-card {
        padding: 1.5rem;
    }

    .gallery-item {
        aspect-ratio: 1 / 1 !important;
    }
}

@media (min-width: 641px) and (max-width: 1023px) {
    #hero h1 {
        font-size: 4rem;
    }
}

@media (min-width: 1024px) {
    #hero h1 {
        font-size: 5.5rem;
    }
}
