/* ============================================
   Magic Carpet Driving School - 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-color: #fbbf24;
    color: #500724;
}

/* --- Scroll Reveal --- */
.reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal[data-reveal-delay="1"] { transition-delay: 0.1s; }
.reveal[data-reveal-delay="2"] { transition-delay: 0.2s; }
.reveal[data-reveal-delay="3"] { transition-delay: 0.3s; }
.reveal[data-reveal-delay="4"] { transition-delay: 0.4s; }

.reveal-hidden {
    opacity: 0;
    transform: translateY(30px);
}

/* --- Hero Animations --- */
.hero-subtitle {
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

.hero-headline {
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.4s both;
}

.hero-desc {
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.6s both;
}

.hero-cta {
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.8s both;
}

.hero-stats {
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 1s both;
}

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

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

#navbar.scrolled {
    background-color: rgba(254, 253, 248, 0.95);
    backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(131, 20, 67, 0.1);
}

#navbar.scrolled .nav-link {
    color: #500724;
}

#navbar.scrolled .nav-link:hover {
    color: #b45309;
}

#navbar.scrolled .font-serif,
#navbar.scrolled .font-sans {
    color: #500724;
}

#navbar.scrolled .menu-line {
    background-color: #500724;
}

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

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #831443, #fbbf24);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* --- Testimonial Cards --- */
.testimonial-card {
    position: relative;
}

.testimonial-card::after {
    content: '"';
    position: absolute;
    top: -10px;
    right: 24px;
    font-family: 'Playfair Display', serif;
    font-size: 8rem;
    color: rgba(131, 20, 67, 0.05);
    line-height: 1;
    pointer-events: none;
}

/* --- Diagonal Clip --- */
.clip-diagonal {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 85%);
}

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

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

#mobile-menu.open .mobile-nav-link {
    animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

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

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

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

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

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

/* --- Button Hover Effects --- */
a, button {
    -webkit-tap-highlight-color: transparent;
}

/* --- Focus Styles --- */
:focus-visible {
    outline: 2px solid #fbbf24;
    outline-offset: 2px;
}

/* --- Reduced Motion --- */
@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-hidden {
        opacity: 1;
        transform: none;
    }
}

/* --- Responsive --- */
@media (max-width: 767px) {
    .clip-diagonal {
        clip-path: none;
    }
    
    #navbar.scrolled .w-10,
    #navbar.scrolled .font-serif,
    #navbar.scrolled .font-sans {
        color: #500724;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .clip-diagonal {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 90%);
    }
}

/* --- Print --- */
@media print {
    nav, #mobile-menu, .reveal-hidden {
        display: none !important;
    }
    
    body {
        color: #000;
        background: #fff;
    }
}
