/* ===================================
   Railside Automotive — Custom Styles
   =================================== */

/* CSS Custom Properties */
:root {
    --emerald-900: #064E3B;
    --emerald-800: #065F46;
    --emerald-700: #047857;
    --emerald-600: #059669;
    --emerald-500: #10B981;
    --emerald-100: #D1FAE5;
    --emerald-50:  #ECFDF5;
    
    --cream-50:  #FFFBF0;
    --cream-100: #FEF3C7;
    --cream-200: #FDE68A;
    --cream-500: #D97706;
    
    --stone-900: #1C1917;
    --stone-800: #292524;
    --stone-700: #44403C;
    --stone-600: #57534E;
    --stone-500: #78716C;
    --stone-400: #A8A29E;
    --stone-300: #D6D3D1;
    --stone-200: #E7E5E4;
    --stone-100: #F5F5F4;
    --stone-50:  #FAFAF9;
    
    --white: #FFFFFF;
    
    --font-heading: 'Fraunces', Georgia, serif;
    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.04);
    --shadow-xl: 0 20px 60px rgba(0,0,0,0.1), 0 8px 20px rgba(0,0,0,0.06);
    
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    color: var(--stone-700);
    background-color: var(--cream-50);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Typography */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    color: var(--stone-900);
    line-height: 1.2;
    font-weight: 700;
}

.text-emerald {
    color: var(--emerald-700);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: var(--radius-lg);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--emerald-700);
    color: var(--white);
    border-color: var(--emerald-700);
}

.btn-primary:hover {
    background: var(--emerald-800);
    border-color: var(--emerald-800);
}

.btn-secondary {
    background: var(--white);
    color: var(--stone-800);
    border-color: var(--stone-200);
}

.btn-secondary:hover {
    border-color: var(--emerald-700);
    color: var(--emerald-700);
}

.btn-large {
    padding: 16px 36px;
    font-size: 1rem;
}

.btn-light {
    background: var(--white);
    color: var(--emerald-800);
    border-color: var(--white);
}

.btn-light:hover {
    background: var(--cream-100);
}

.btn-outline-light {
    background: transparent;
    color: var(--white);
    border-color: rgba(255,255,255,0.5);
}

.btn-outline-light:hover {
    background: var(--white);
    color: var(--emerald-800);
    border-color: var(--white);
}

.btn-full {
    width: 100%;
    justify-content: center;
}

/* Section Header */
.section-header {
    text-align: center;
    max-width: 640px;
    margin: 0 auto 64px;
}

.section-tag {
    display: inline-block;
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--emerald-700);
    background: var(--emerald-50);
    padding: 6px 16px;
    border-radius: 50px;
    margin-bottom: 16px;
}

.section-title {
    font-size: clamp(2rem, 4vw, 2.75rem);
    margin-bottom: 16px;
}

.section-description {
    font-size: 1.0625rem;
    color: var(--stone-500);
    line-height: 1.7;
}

/* ===================================
   Navbar
   =================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    transition: var(--transition);
}

.navbar.scrolled {
    box-shadow: var(--shadow-md);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 16px;
    padding-bottom: 16px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--stone-900);
}

.logo-accent {
    color: var(--emerald-700);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-links li a {
    padding: 8px 18px;
    border-radius: var(--radius-lg);
    font-weight: 500;
    font-size: 0.9375rem;
    color: var(--stone-600);
}

.nav-links li a:hover {
    color: var(--emerald-700);
    background: var(--emerald-50);
}

.nav-links li:last-child a {
    margin-left: 8px;
}

/* Mobile Menu */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--stone-700);
    border-radius: 2px;
    transition: var(--transition);
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

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

.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    background: var(--white);
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-close {
    position: absolute;
    top: 20px;
    right: 24px;
    background: none;
    border: none;
    font-size: 2.5rem;
    cursor: pointer;
    color: var(--stone-600);
    line-height: 1;
    padding: 8px;
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.mobile-nav-link {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--stone-700);
    padding: 12px 24px;
    border-radius: var(--radius-md);
}

.mobile-nav-link:hover {
    color: var(--emerald-700);
    background: var(--emerald-50);
}

.mobile-nav-cta {
    margin-top: 16px;
}

/* ===================================
   Hero Section
   =================================== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 120px 0 80px;
    background: linear-gradient(135deg, var(--cream-50) 0%, var(--emerald-50) 50%, var(--cream-50) 100%);
    position: relative;
    overflow: hidden;
}

.hero-bg-pattern {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at 20% 80%, rgba(4, 120, 87, 0.05) 0%, transparent 50%),
                      radial-gradient(circle at 80% 20%, rgba(254, 243, 199, 0.6) 0%, transparent 50%);
    pointer-events: none;
}

.hero-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--white);
    color: var(--emerald-700);
    font-size: 0.875rem;
    font-weight: 600;
    padding: 8px 18px;
    border-radius: 50px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    line-height: 1.1;
    margin-bottom: 24px;
    color: var(--stone-900);
}

.hero-description {
    font-size: 1.125rem;
    color: var(--stone-600);
    line-height: 1.75;
    margin-bottom: 36px;
    max-width: 500px;
}

.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

/* Floating Stat Cards */
.hero-cards {
    position: relative;
    height: 480px;
}

.stat-card {
    position: absolute;
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

.stat-card:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-4px) !important;
}

.stat-card-1 {
    top: 0;
    right: 0;
}

.stat-card-2 {
    top: 50%;
    left: 0;
    transform: translateY(-50%);
}

.stat-card-2.visible {
    transform: translateY(-50%);
}

.stat-card-3 {
    bottom: 0;
    right: 40px;
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    background: var(--emerald-50);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--emerald-700);
    flex-shrink: 0;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.8125rem;
    color: var(--stone-500);
    font-weight: 500;
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--stone-900);
}

/* Hero Image */
.hero-image-wrapper {
    position: relative;
    z-index: 1;
}

.hero-image-accent {
    position: absolute;
    width: 80%;
    height: 80%;
    top: 10%;
    right: -5%;
    background: var(--emerald-100);
    border-radius: var(--radius-xl);
    z-index: -1;
}

.hero-image-wrapper img {
    width: 100%;
    height: 700px;
    object-fit: cover;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
}

/* ===================================
   Services Section
   =================================== */
.services {
    padding: 100px 0;
    background: var(--white);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.service-card {
    background: var(--cream-50);
    border-radius: var(--radius-xl);
    padding: 36px 28px;
    transition: var(--transition);
    border: 1px solid transparent;
}

.service-card:hover {
    background: var(--white);
    border-color: var(--emerald-100);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.service-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-lg);
    background: var(--emerald-50);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    transition: var(--transition);
}

.service-card:hover .service-icon {
    background: var(--emerald-100);
}

.service-card h3 {
    font-size: 1.1875rem;
    margin-bottom: 12px;
    font-family: var(--font-heading);
}

.service-card p {
    font-size: 0.9375rem;
    color: var(--stone-500);
    line-height: 1.7;
}

/* ===================================
   About Section
   =================================== */
.about {
    padding: 100px 0;
    background: var(--cream-50);
}

.about-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
}

.about-image-wrapper {
    position: relative;
}

.about-image-accent {
    position: absolute;
    width: 60%;
    height: 60%;
    bottom: 0;
    right: 0;
    background: var(--emerald-100);
    border-radius: var(--radius-xl);
    z-index: -1;
}

.about-image-wrapper img {
    width: 100%;
    height: 600px;
    object-fit: cover;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

.about-content .section-tag {
    margin-bottom: 16px;
}

.about-content .section-title {
    text-align: left;
    margin-bottom: 24px;
}

.about-text {
    font-size: 1.0625rem;
    color: var(--stone-600);
    line-height: 1.8;
    margin-bottom: 16px;
}

.about-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 32px;
}

.about-feature {
    display: flex;
    align-items: center;
    gap: 12px;
}

.feature-check {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--emerald-100);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--emerald-700);
    flex-shrink: 0;
}

.about-feature span {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--stone-700);
}

/* ===================================
   Why Choose Us Section
   =================================== */
.why-us {
    padding: 100px 0;
    background: var(--emerald-800);
    position: relative;
    overflow: hidden;
}

.why-us::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at 10% 90%, rgba(255,255,255,0.03) 0%, transparent 50%),
                      radial-gradient(circle at 90% 10%, rgba(255,255,255,0.05) 0%, transparent 50%);
    pointer-events: none;
}

.why-us .section-tag {
    background: rgba(255,255,255,0.1);
    color: var(--cream-100);
}

.why-us .section-title {
    color: var(--white);
}

.why-us .section-title .text-emerald {
    color: var(--cream-100);
}

.why-us .section-description {
    color: rgba(255,255,255,0.7);
}

.why-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    position: relative;
    z-index: 1;
}

.why-card {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-xl);
    padding: 40px 32px;
    transition: var(--transition);
    backdrop-filter: blur(8px);
}

.why-card:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.2);
    transform: translateY(-4px);
}

.why-number {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 700;
    color: rgba(255,255,255,0.1);
    line-height: 1;
    margin-bottom: 16px;
}

.why-card h3 {
    font-size: 1.25rem;
    color: var(--white);
    margin-bottom: 12px;
    font-family: var(--font-heading);
}

.why-card p {
    font-size: 0.9375rem;
    color: rgba(255,255,255,0.7);
    line-height: 1.7;
}

/* ===================================
   CTA Section
   =================================== */
.cta {
    padding: 100px 0;
    background: var(--cream-50);
}

.cta-card {
    background: linear-gradient(135deg, var(--emerald-700) 0%, var(--emerald-800) 100%);
    border-radius: var(--radius-xl);
    padding: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    position: relative;
    overflow: hidden;
}

.cta-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at 80% 50%, rgba(255,255,255,0.08) 0%, transparent 60%);
    pointer-events: none;
}

.cta-content {
    position: relative;
    z-index: 1;
}

.cta-title {
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    color: var(--white);
    margin-bottom: 16px;
}

.cta-text {
    font-size: 1.0625rem;
    color: rgba(255,255,255,0.8);
    line-height: 1.7;
    max-width: 480px;
}

.cta-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

/* ===================================
   Contact Section
   =================================== */
.contact {
    padding: 100px 0;
    background: var(--white);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 60px;
    align-items: start;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.contact-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    background: var(--emerald-50);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.contact-item h4 {
    font-size: 0.875rem;
    font-family: var(--font-body);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--stone-500);
    margin-bottom: 4px;
}

.contact-item p {
    font-size: 1rem;
    color: var(--stone-700);
    line-height: 1.6;
}

.contact-item a {
    color: var(--emerald-700);
}

.contact-item a:hover {
    color: var(--emerald-800);
    text-decoration: underline;
}

/* Contact Form */
.contact-form-wrapper {
    background: var(--cream-50);
    border-radius: var(--radius-xl);
    padding: 40px;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--stone-700);
}

.form-group input,
.form-group textarea {
    padding: 14px 18px;
    border: 1.5px solid var(--stone-200);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 0.9375rem;
    color: var(--stone-800);
    background: var(--white);
    transition: var(--transition);
    outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--emerald-600);
    box-shadow: 0 0 0 3px rgba(4, 120, 87, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--stone-400);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-success {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 48px 24px;
    gap: 16px;
}

.form-success.active {
    display: flex;
}

.success-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--emerald-100);
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-success h3 {
    font-size: 1.5rem;
    color: var(--stone-900);
}

.form-success p {
    color: var(--stone-500);
    font-size: 0.9375rem;
}

/* ===================================
   Footer
   =================================== */
.footer {
    background: var(--stone-900);
    padding: 64px 0 0;
    color: rgba(255,255,255,0.6);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
    gap: 48px;
    padding-bottom: 48px;
}

.footer-brand .logo-text {
    color: var(--white);
    margin-bottom: 16px;
    display: block;
}

.footer-brand p {
    font-size: 0.9375rem;
    line-height: 1.7;
    max-width: 280px;
}

.footer-links h4,
.footer-contact h4 {
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--white);
    margin-bottom: 20px;
}

.footer-links ul {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-links a {
    font-size: 0.9375rem;
    color: rgba(255,255,255,0.6);
}

.footer-links a:hover {
    color: var(--emerald-400);
}

.footer-contact p {
    font-size: 0.9375rem;
    margin-bottom: 8px;
}

.footer-contact a {
    color: rgba(255,255,255,0.6);
}

.footer-contact a:hover {
    color: var(--emerald-400);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: 24px 0;
    text-align: center;
}

.footer-bottom p {
    font-size: 0.875rem;
    color: rgba(255,255,255,0.4);
}

/* ===================================
   Animations
   =================================== */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

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

.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===================================
   Responsive
   =================================== */
@media (max-width: 1024px) {
    .hero-container {
        grid-template-columns: 1fr;
        gap: 48px;
    }
    
    .hero-cards {
        height: auto;
        display: flex;
        flex-wrap: wrap;
        gap: 16px;
        justify-content: center;
    }
    
    .stat-card {
        position: relative;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        transform: none !important;
    }
    
    .hero-image-wrapper {
        max-width: 500px;
        margin: 0 auto;
    }
    
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .about-container {
        grid-template-columns: 1fr;
        gap: 48px;
    }
    
    .about-image-wrapper {
        max-width: 480px;
        margin: 0 auto;
    }
    
    .why-grid {
        grid-template-columns: 1fr;
    }
    
    .cta-card {
        flex-direction: column;
        text-align: center;
        padding: 48px 32px;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 48px;
    }
    
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    .hero {
        padding: 100px 0 60px;
    }
    
    .hero-title {
        font-size: clamp(2rem, 8vw, 3rem);
    }
    
    .hero-buttons {
        flex-direction: column;
    }
    
    .hero-buttons .btn {
        width: 100%;
        justify-content: center;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .about-features {
        grid-template-columns: 1fr;
    }
    
    .cta-card {
        padding: 40px 24px;
    }
    
    .cta-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .cta-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    .contact-form-wrapper {
        padding: 28px;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }
    
    .section-header {
        margin-bottom: 48px;
    }
    
    .hero {
        padding: 90px 0 50px;
    }
    
    .hero-image-wrapper img {
        height: 400px;
    }
    
    .about-image-wrapper img {
        height: 400px;
    }
}
