/* ========================================
   Krystal Rae's Hair and Nails
   Premium Dark Luxury Styles
   ======================================== */

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    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(212, 168, 83, 0.3);
    color: #fff;
}

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

/* Hero entrance animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Scroll reveal */
.reveal {
    opacity: 1;
    transform: translateY(0);
    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);
}

/* Initial state for revealed elements — visible by default for no-JS */
.reveal {
    transform: translateY(0);
}

@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(30px);
    }
    
    .reveal.revealed {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   Navigation
   ======================================== */

#navbar {
    background: transparent;
}

#navbar.scrolled {
    background: rgba(10, 14, 39, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(212, 168, 83, 0.1);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: linear-gradient(90deg, #d4a853, #e0bc6e);
    transition: width 0.3s ease;
}

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

/* Mobile menu */
#mobileMenu.open {
    opacity: 1;
    pointer-events: all;
}

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

.mobile-link {
    font-size: 1.125rem;
    letter-spacing: 0.15em;
}

/* Menu button animation */
.menu-line {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

#menuBtn.active .menu-line:nth-child(3) {
    transform: translateY(-4px) rotate(-45deg);
    width: 1.5rem;
}

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

.service-card {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.4s ease,
                border-color 0.4s ease;
}

.service-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3),
                0 0 40px rgba(212, 168, 83, 0.05);
}

/* ========================================
   Gallery
   ======================================== */

.gallery-item {
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-item:hover {
    transform: scale(1.02);
}

/* ========================================
   Buttons
   ======================================== */

button, a[role="button"] {
    cursor: pointer;
}

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

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

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

::-webkit-scrollbar-thumb {
    background: rgba(212, 168, 83, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 168, 83, 0.5);
}

/* ========================================
   Back to top
   ======================================== */

#backToTop.visible {
    opacity: 1;
    pointer-events: all;
}

#backToTop:not(.visible) {
    transform: translateY(10px);
}

#backToTop.visible {
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

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

@media (max-width: 768px) {
    html {
        font-size: 15px;
    }
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

/* ========================================
   Focus visible
   ======================================== */

:focus-visible {
    outline: 2px solid rgba(212, 168, 83, 0.6);
    outline-offset: 2px;
}

/* ========================================
   Print styles
   ======================================== */

@media print {
    body {
        background: white;
        color: black;
    }
    
    .service-card, .gallery-item {
        break-inside: avoid;
    }
}
