/* ========================================
   NNY Tire & Auto Center — Custom Styles
   ======================================== */

/* Base & Typography */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
}

::selection {
    background-color: #1a3c2a;
    color: #faf9f6;
}

/* ========================================
   Navigation
   ======================================== */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1.5px;
    background-color: #3d7a48;
    transition: width 0.3s ease;
}

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

/* Navbar scroll state */
.navbar-scrolled {
    background-color: rgba(250, 249, 246, 0.95) !important;
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(26, 60, 42, 0.08);
}

.navbar-scrolled .nav-link {
    color: #1a3c2a !important;
}

.navbar-scrolled .font-serif {
    color: #1a3c2a !important;
}

.navbar-scrolled .bg-forest-700 {
    background-color: #1a3c2a !important;
}

/* Mobile menu */
.mobile-menu-open {
    opacity: 1 !important;
    pointer-events: auto !important;
}

.mobile-nav-link {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s 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; }
.mobile-menu-open .mobile-nav-link:nth-child(5) { transition-delay: 0.25s; }

/* Menu button animation */
#bar1.open {
    transform: rotate(45deg) translate(4px, 4px);
}

#bar2.open {
    opacity: 0;
}

#bar3.open {
    transform: rotate(-45deg) translate(4px, -4px);
    width: 100%;
}

/* ========================================
   Hero Section
   ======================================== */
.hero-title {
    animation: heroTitleIn 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(40px);
}

.hero-eyebrow {
    animation: heroEyebrowIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
    opacity: 0;
    transform: translateY(30px);
}

.hero-subtitle {
    animation: heroSubtitleIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.35s forwards;
    opacity: 0;
    transform: translateY(30px);
}

.hero-cta {
    animation: heroCtaIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.5s forwards;
    opacity: 0;
    transform: translateY(30px);
}

.hero-trust {
    animation: heroTrustIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.65s forwards;
    opacity: 0;
    transform: translateY(30px);
}

.hero-image-card {
    animation: heroImageIn 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards;
    opacity: 0;
    transform: translateY(60px) scale(0.97);
}

.hero-floating-card {
    animation: heroFloatIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.8s forwards;
    opacity: 0;
    transform: translateY(30px);
}

@keyframes heroTitleIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes heroEyebrowIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes heroSubtitleIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes heroCtaIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes heroTrustIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes heroImageIn {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes heroFloatIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   Section Styles
   ======================================== */
.section-eyebrow {
    animation: sectionFadeIn 0.8s ease forwards;
}

.section-title {
    animation: sectionFadeIn 0.8s ease 0.1s forwards;
    opacity: 0;
}

.section-subtitle {
    animation: sectionFadeIn 0.8s ease 0.2s forwards;
    opacity: 0;
}

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

/* ========================================
   Services Section
   ======================================== */
.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.service-card {
    padding: 2.5rem;
    background: white;
    border-radius: 1.25rem;
    border: 1px solid rgba(220, 230, 223, 0.8);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0;
    transform: translateY(40px);
}

.service-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px -12px rgba(26, 60, 42, 0.12);
    border-color: transparent;
}

.service-icon-wrap {
    width: 64px;
    height: 64px;
    border-radius: 1rem;
    background: linear-gradient(135deg, #1a3c2a 0%, #2d5e37 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #faf9f6;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.service-card:hover .service-icon-wrap {
    transform: scale(1.05) rotate(-3deg);
    box-shadow: 0 12px 24px -8px rgba(26, 60, 42, 0.35);
}

.service-title {
    transition: color 0.3s ease;
}

/* ========================================
   About Section
   ======================================== */
.about-image {
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.about-image:hover {
    transform: scale(1.02);
}

.about-image-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
}

.about-stats {
    animation: statsIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.5s forwards;
    opacity: 0;
    transform: translateY(20px);
}

@keyframes statsIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   Why Us Section
   ======================================== */
.reason-card {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s ease, transform 0.6s ease, box-shadow 0.5s ease;
}

.reason-card.visible {
    opacity: 1;
    transform: translateY(0);
}

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

/* ========================================
   Testimonials
   ======================================== */
.testimonial-card {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s ease, transform 0.6s ease, border-color 0.3s ease, box-shadow 0.5s ease;
}

.testimonial-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.testimonial-text {
    font-style: italic;
}

/* ========================================
   Contact Form
   ======================================== */
.form-input {
    font-family: 'Inter', system-ui, sans-serif;
}

.form-input:focus {
    border-color: #3d7a48;
    box-shadow: 0 0 0 4px rgba(61, 122, 72, 0.1);
}

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

.form-submit::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s ease;
}

.form-submit:hover::before {
    left: 100%;
}

.form-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px -8px rgba(26, 60, 42, 0.3);
}

/* ========================================
   CTA Section
   ======================================== */
.cta-eyebrow {
    animation: sectionFadeIn 0.8s ease forwards;
}

.cta-title {
    animation: sectionFadeIn 0.8s ease 0.1s forwards;
    opacity: 0;
}

.cta-subtitle {
    animation: sectionFadeIn 0.8s ease 0.2s forwards;
    opacity: 0;
}

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

.reveal.visible {
    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; }

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 1024px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .services-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .hero-title {
        font-size: 2.75rem !important;
    }

    .hero-title.xl\:text-8xl {
        font-size: 2.75rem;
    }

    .about-stats {
        position: relative;
        bottom: auto;
        left: auto;
        right: auto;
        margin-top: 1.5rem;
    }
}

@media (max-width: 640px) {
    .hero-floating-card {
        position: relative;
        bottom: auto;
        left: auto;
        margin-top: 1rem;
        max-width: 100%;
    }
}

/* ========================================
   Utility
   ======================================== */
@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, .service-card, .reason-card, .testimonial-card {
        opacity: 1;
        transform: none;
    }
}
