/* ============================================
   Raven's Hair Apothecary — Custom Styles
   ============================================ */

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

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

body {
    overflow-x: hidden;
}

/* Selection */
::selection {
    background: rgba(201, 162, 39, 0.3);
    color: #fdfbf7;
}

/* ============================================
   Animations
   ============================================ */

/* Hero entrance animations — only for hero (above fold), always visible */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-up {
    animation-name: fadeUp;
    animation-duration: 0.8s;
    animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
    animation-iteration-count: 1;
}

/* 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);
    }

    /* Stagger children */
    .reveal-grid > * {
        opacity: 0;
        transform: translateY(20px);
        transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                    transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .reveal-grid.revealed > *:nth-child(1) { transition-delay: 0.05s; }
    .reveal-grid.revealed > *:nth-child(2) { transition-delay: 0.1s; }
    .reveal-grid.revealed > *:nth-child(3) { transition-delay: 0.15s; }
    .reveal-grid.revealed > *:nth-child(4) { transition-delay: 0.2s; }
    .reveal-grid.revealed > *:nth-child(5) { transition-delay: 0.25s; }
    .reveal-grid.revealed > *:nth-child(6) { transition-delay: 0.3s; }
}

/* Fallback: content always visible if JS is disabled */
.no-js .reveal,
.js-disabled .reveal {
    opacity: 1;
    transform: none;
}

/* ============================================
   Navbar
   ============================================ */

#navbar {
    transition: background-color 0.4s ease, backdrop-filter 0.4s ease, box-shadow 0.4s ease;
}

#navbar.scrolled {
    background: rgba(10, 10, 10, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 1px 0 rgba(201, 162, 39, 0.1);
}

/* ============================================
   Mobile Menu
   ============================================ */

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

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

.mobile-link {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease, transform 0.4s ease, color 0.3s ease;
}

#mobile-menu.open .mobile-link {
    opacity: 1;
    transform: translateY(0);
}

#mobile-menu.open .mobile-link:nth-child(1) { transition-delay: 0.1s; }
#mobile-menu.open .mobile-link:nth-child(2) { transition-delay: 0.15s; }
#mobile-menu.open .mobile-link:nth-child(3) { transition-delay: 0.2s; }
#mobile-menu.open .mobile-link:nth-child(4) { transition-delay: 0.25s; }
#mobile-menu.open .mobile-link:nth-child(5) { transition-delay: 0.3s; }

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

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

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

#menu-btn.active .menu-line:nth-child(3) {
    width: 24px;
    transform: rotate(-45deg) translate(4px, -4px);
}

/* ============================================
   Service Cards
   ============================================ */

.service-card {
    position: relative;
    overflow: hidden;
}

.service-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #c9a227, transparent);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.service-card:hover::after {
    opacity: 0.6;
}

/* ============================================
   Form Styles
   ============================================ */

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(201, 162, 39, 0.6) !important;
    box-shadow: 0 0 0 1px rgba(201, 162, 39, 0.2);
}

/* ============================================
   Scrollbar
   ============================================ */

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #0a0a0a;
}

::-webkit-scrollbar-thumb {
    background: rgba(201, 162, 39, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(201, 162, 39, 0.5);
}

/* ============================================
   Focus Visible
   ============================================ */

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #c9a227;
    outline-offset: 2px;
}

/* ============================================
   Responsive adjustments
   ============================================ */

@media (max-width: 767px) {
    .font-serif {
        line-height: 1.2;
    }
}
