/* ========================================
   R & M Auto Electric — Custom Styles
   Midnight Blue + Mint | Clean Minimalist
   ======================================== */

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

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

body {
    margin: 0;
    background-color: #0A1628;
    color: white;
    overflow-x: hidden;
}

::selection {
    background: rgba(52, 212, 168, 0.25);
    color: white;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: #0A1628;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(52, 212, 168, 0.4);
}

/* --- Navigation --- */
.nav-link {
    position: relative;
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: #34D4A8;
    transition: width 0.3s ease;
}
.nav-link:hover::after {
    width: 100%;
}
.nav-link:hover {
    color: white !important;
}

/* --- Hero Animations --- */
.hero-eyebrow {
    animation: fadeSlideUp 0.8s ease forwards;
    animation-delay: 0.2s;
    opacity: 0;
}
.hero-title {
    animation: fadeSlideUp 0.8s ease forwards;
    animation-delay: 0.4s;
    opacity: 0;
}
.hero-subtitle {
    animation: fadeSlideUp 0.8s ease forwards;
    animation-delay: 0.6s;
    opacity: 0;
}

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

/* --- Service Cards --- */
.service-card {
    position: relative;
    overflow: hidden;
}
.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(52, 212, 168, 0.3), transparent);
    opacity: 0;
    transition: opacity 0.5s ease;
}
.service-card:hover::before {
    opacity: 1;
}

/* --- Testimonial Cards --- */
.testimonial-card {
    position: relative;
}
.testimonial-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 8%;
    right: 8%;
    height: 1px;
    background: rgba(255, 255, 255, 0.05);
}

/* --- Reveal Animations --- */
.reveal {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }
.reveal-delay-6 { transition-delay: 0.6s; }

/* --- Nav scroll state --- */
nav.scrolled {
    background: rgba(10, 22, 40, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* --- Mobile menu transitions --- */
.mobile-link {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.3s ease, transform 0.3s 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.05s; }
#mobile-menu.open .mobile-link:nth-child(2) { transition-delay: 0.1s; }
#mobile-menu.open .mobile-link:nth-child(3) { transition-delay: 0.15s; }
#mobile-menu.open .mobile-link:nth-child(4) { transition-delay: 0.2s; }
#mobile-menu.open .mobile-link:nth-child(5) { transition-delay: 0.25s; }

/* --- Menu toggle animation --- */
.menu-line {
    transition: transform 0.3s ease, opacity 0.3s ease, width 0.3s ease;
}
#menu-toggle[aria-expanded="true"] .menu-line:first-child {
    transform: rotate(45deg) translate(3px, 3px);
}
#menu-toggle[aria-expanded="true"] .menu-line:last-child {
    opacity: 0;
    width: 0;
    margin-left: 0;
}

/* --- Form inputs --- */
input:focus,
textarea:focus {
    border-color: rgba(52, 212, 168, 0.5) !important;
    outline: none;
    box-shadow: 0 0 0 1px rgba(52, 212, 168, 0.15);
}

/* --- Button hover effect --- */
button[type="submit"]:hover {
    box-shadow: 0 4px 24px rgba(52, 212, 168, 0.25);
}

/* --- Image hover zoom --- */
.service-card img,
.testimonial-card img {
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* --- Responsive --- */
@media (max-width: 767px) {
    .hero-title {
        font-size: 2.75rem !important;
    }
}

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

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