/* ============================================
   Driver Knowledge — Custom Styles
   ============================================ */

/* Base & Typography */
html {
    scroll-behavior: smooth;
}

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

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #FDF8F0;
}
::-webkit-scrollbar-thumb {
    background: #065F46;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #064E3B;
}

/* Selection */
::selection {
    background: #065F46;
    color: #FDF8F0;
}

/* ============================================
   Navigation
   ============================================ */
.nav-header {
    transition: box-shadow 0.3s ease;
}

.nav-header.scrolled {
    box-shadow: 0 1px 20px rgba(2, 44, 34, 0.08);
}

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

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

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

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

/* ============================================
   Hero Animations
   ============================================ */
.reveal {
    opacity: 1;
    transform: none;
    transition: opacity 0.7s ease, transform 0.7s ease;
}

/* Hero-specific entrance (above the fold — always visible) */
.hero-eyebrow {
    animation: fadeDown 0.8s ease forwards;
    animation-delay: 0.1s;
    opacity: 0;
}

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

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

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

.hero-note {
    animation: fadeUp 0.8s ease forwards;
    animation-delay: 0.9s;
    opacity: 0;
}

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

@keyframes fadeDown {
    from {
        opacity: 0;
        transform: translateY(-16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scroll indicator */
.scroll-line {
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom, transparent, #065F46);
    animation: scrollDown 1.5s ease-in-out infinite;
    position: absolute;
    top: 0;
    left: 0;
}

@keyframes scrollDown {
    0% { transform: translateY(-100%); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translateY(100%); opacity: 0; }
}

/* ============================================
   Scroll Reveal (below the fold only)
   Progressive enhancement — JS adds is-visible
   ============================================ */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(32px);
        transition: opacity 0.7s ease, transform 0.7s ease;
    }

    .reveal.is-visible {
        opacity: 1;
        transform: translateY(0);
    }

    /* Staggered delays for card grids */
    .service-card:nth-child(1) { transition-delay: 0s; }
    .service-card:nth-child(2) { transition-delay: 0.1s; }
    .service-card:nth-child(3) { transition-delay: 0.2s; }
    .service-card:nth-child(4) { transition-delay: 0.3s; }
    .service-card:nth-child(5) { transition-delay: 0.4s; }
    .service-card:nth-child(6) { transition-delay: 0.5s; }

    .testimonial-card:nth-child(1) { transition-delay: 0s; }
    .testimonial-card:nth-child(2) { transition-delay: 0.15s; }
    .testimonial-card:nth-child(3) { transition-delay: 0.3s; }
}

/* Reduced motion: disable all animations */
@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;
    }
    .scroll-line {
        animation: none;
        opacity: 0.5;
    }
}

/* ============================================
   Service Cards — image hover effect
   ============================================ */
.service-card img {
    transition: transform 0.6s ease;
}

/* ============================================
   Testimonial Cards
   ============================================ */
.testimonial-card {
    transition: transform 0.4s ease, background 0.4s ease;
}

.testimonial-card:hover {
    transform: translateY(-4px);
}

/* ============================================
   Form Styles
   ============================================ */
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='%23065F46' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

input:focus, textarea:focus, select:focus {
    box-shadow: 0 0 0 4px rgba(6, 95, 70, 0.1);
}

/* ============================================
   Utility
   ============================================ */
.text-balance {
    text-wrap: balance;
}
