/* ========================================
   KING BARBERSHOP — Custom Styles
   ======================================== */

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

html {
    scroll-behavior: smooth;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Selection */
::selection {
    background: #d94f2e;
    color: #fff;
}

/* ========================================
   NAVIGATION
   ======================================== */
#navbar {
    transition: background-color 0.4s ease, padding 0.4s ease, backdrop-filter 0.4s ease;
}

#navbar.scrolled {
    background-color: rgba(250, 247, 242, 0.95);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

#navbar.scrolled .w-8 {
    border-color: rgba(26, 26, 26, 0.3);
}

#navbar.scrolled svg,
#navbar.scrolled .w-8 {
    color: #1a1a1a;
}

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

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

.mobile-link {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.menu-line {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* ========================================
   HERO ANIMATIONS
   ======================================== */
.hero-tag {
    animation: slideUp 0.8s ease forwards;
    animation-delay: 0.1s;
    opacity: 0;
}

.hero-title {
    animation: slideUp 0.8s ease forwards;
    animation-delay: 0.25s;
    opacity: 0;
}

.hero-subtitle {
    animation: slideUp 0.8s ease forwards;
    animation-delay: 0.4s;
    opacity: 0;
}

.hero-cta {
    animation: slideUp 0.8s ease forwards;
    animation-delay: 0.55s;
    opacity: 0;
}

.hero-info {
    animation: slideUp 0.8s ease forwards;
    animation-delay: 0.7s;
    opacity: 0;
}

.hero-image-wrapper {
    animation: fadeIn 1s ease forwards;
    animation-delay: 0.3s;
    opacity: 0;
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ========================================
   REVEAL ANIMATIONS
   (Progressive enhancement — content visible if JS disabled)
   ======================================== */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(24px);
        transition: opacity 0.7s ease, transform 0.7s ease;
    }
    
    .reveal.revealed {
        opacity: 1;
        transform: translateY(0);
    }
}

/* If JS is disabled, all content is visible by default */
.no-js .reveal {
    opacity: 1;
    transform: none;
}

/* ========================================
   SERVICES
   ======================================== */
.service-card {
    transition: background-color 0.5s ease, transform 0.3s ease;
}

.service-card:hover {
    transform: translateY(-2px);
}

.service-icon svg {
    transition: transform 0.3s ease;
}

.service-card:hover .service-icon svg {
    transform: scale(1.05);
}

/* ========================================
   GALLERY
   ======================================== */
.gallery-item {
    transition: opacity 0.7s ease, transform 0.7s ease;
}

/* ========================================
   FORMS
   ======================================== */
.form-input {
    transition: border-color 0.3s ease;
}

.form-input:focus {
    border-color: #d94f2e !important;
}

.form-input::placeholder {
    color: rgba(26, 26, 26, 0.15);
}

.form-submit {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.form-submit::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.1), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.form-submit:hover::after {
    transform: translateX(100%);
}

/* ========================================
   SMOOTH SCROLL OFFSET
   ======================================== */
[id] {
    scroll-margin-top: 80px;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 767px) {
    #navbar {
        background-color: transparent;
        backdrop-filter: none;
    }
    
    #navbar.scrolled {
        background-color: rgba(250, 247, 242, 0.98);
    }
    
    .hero-title {
        font-size: 3rem !important;
    }
    
    .hero-info {
        flex-direction: column;
        gap: 1rem !important;
        align-items: center;
    }
    
    .hero-info > div.w-px {
        width: 4rem;
        height: 1px !important;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .hero-title {
        font-size: 3.5rem;
    }
}

@media (min-width: 1024px) {
    .hero-title {
        font-size: 4.5rem;
    }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */
@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;
    }
    
    .reveal {
        opacity: 1;
        transform: none;
    }
}

/* Focus visible */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid #d94f2e;
    outline-offset: 2px;
}
