/* ==========================================================================
   Keys Motors - Fresh Start
   ========================================================================== */

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Scroll animations */
.fade-in {
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-in-left {
    opacity: 0;
    transform: translateX(-15px);
    transition: opacity 1.4s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 1.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.fade-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.fade-in-right {
    opacity: 0;
    transform: translateX(15px);
    transition: opacity 1.4s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 1.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.fade-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.why-us-stack .fade-in-right:nth-child(2) {
    transition-delay: 0.2s;
}

.scale-in {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.scale-in.visible {
    opacity: 1;
    transform: scale(1);
}

/* Variables */
:root {
    --color-charcoal: #1A1A1A;
    --color-white: #FFFFFF;
    --color-silver: #9B9B9B;
    --color-bmw-blue: #001F3F;
    --color-light-gray: #F8F9FA;
    
    --font-primary: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
    --spacing: 24px;
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: var(--font-primary);
    color: var(--color-charcoal);
    line-height: 1.6;
    background: var(--color-white);
    will-change: scroll-position;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing);
}

/* Typography */
h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--spacing);
}

.section-title {
    font-size: clamp(2rem, 5vw, 3rem);
    text-align: center;
    margin-bottom: calc(var(--spacing) * 2);
    font-weight: 800;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 16px 32px;
    text-decoration: none;
    font-weight: 600;
    border-radius: 6px;
    transition: var(--transition);
    font-size: 1rem;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.btn-primary {
    background: var(--color-charcoal);
    color: var(--color-white);
}

.hero .btn-primary,
.about .btn-primary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--color-white);
    border: 2px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.btn-primary:hover {
    background: var(--color-bmw-blue);
    transform: translateY(-2px);
}

.hero .btn-primary:hover,
.about .btn-primary:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background: transparent;
    color: var(--color-white);
    border: 2px solid var(--color-white);
}

.btn-secondary:hover {
    background: var(--color-white);
    color: var(--color-charcoal);
}

.btn-full {
    width: 100%;
}

/* Navigation */
.nav-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(26, 26, 26, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
    transition: all 0.3s ease;
    transform: translate3d(0, 0, 0);
    will-change: transform, background, backdrop-filter;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
}

.logo {
    text-decoration: none;
    display: block;
}

.logo-img {
    height: 32px;
    width: auto;
    object-fit: contain;
}

.nav-menu {
    display: flex;
    gap: calc(var(--spacing) * 1.5);
    align-items: center;
}

.nav-link {
    color: var(--color-silver);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    transition: var(--transition);
    position: relative;
}

.nav-link:hover {
    color: var(--color-white);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--color-white);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

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

.phone-number {
    color: var(--color-white);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
}

.hamburger {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--color-white);
    margin: 3px 0;
    transition: var(--transition);
}

/* Hero Section */
.hero {
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    transform: translate3d(0, 0, 0);
}

.hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    will-change: transform;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(26, 26, 26, 0.75) 0%, rgba(26, 26, 26, 0.9) 100%);
}

.hero-content {
    text-align: center;
    color: var(--color-white);
    z-index: 1;
    max-width: 800px;
    padding: 0 var(--spacing);
}

.hero-title {
    font-size: clamp(2.5rem, 7vw, 4.5rem);
    font-weight: 800;
    margin-bottom: calc(var(--spacing) * 2);
    text-shadow: 0 4px 30px rgba(0, 0, 0, 0.7), 0 2px 10px rgba(0, 0, 0, 0.5);
}

.hero-cta {
    display: flex;
    gap: var(--spacing);
    justify-content: center;
    flex-wrap: wrap;
}

.scroll-indicator {
    position: absolute;
    bottom: var(--spacing);
    left: 50%;
    transform: translateX(-50%);
}

.mouse {
    width: 30px;
    height: 50px;
    border: 2px solid var(--color-white);
    border-radius: 25px;
    position: relative;
}

.mouse::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 10px;
    background: var(--color-white);
    border-radius: 2px;
    animation: scroll-bounce 2s infinite;
}

@keyframes scroll-bounce {
    0% { transform: translateX(-50%) translateY(0); opacity: 1; }
    100% { transform: translateX(-50%) translateY(20px); opacity: 0; }
}

/* Why Us Section */
.why-us {
    padding: calc(var(--spacing) * 6) 0;
    background: var(--color-white);
    position: relative;
    overflow: hidden;
    min-height: 600px;
}

.why-us::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 60%;
    height: 200%;
    background: radial-gradient(circle, rgba(0, 31, 63, 0.05) 0%, transparent 70%);
    pointer-events: none;
    animation: float-gradient 20s ease-in-out infinite;
}

@keyframes float-gradient {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(-5%, 5%) rotate(180deg); }
}

.why-us-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: var(--spacing);
    min-height: 500px;
}

.why-us-large {
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    height: 100%;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.why-us-large:hover {
    transform: translateY(-5px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.2);
}

.why-us-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    will-change: transform;
}

.why-us-stack {
    display: grid;
    grid-template-rows: 1fr 1fr;
    gap: var(--spacing);
    height: 100%;
}

.why-us-small {
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    min-height: 230px;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.why-us-small:hover {
    transform: translateY(-5px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.2);
}

.why-us-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    will-change: transform;
}

.why-us-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.6) 40%, rgba(0, 0, 0, 0.95) 100%);
    color: var(--color-white);
    padding: var(--spacing);
}

.why-us-overlay h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
    font-weight: 700;
}

.why-us-overlay p {
    font-size: 0.9rem;
    opacity: 0.9;
    line-height: 1.4;
}

/* About Section */
.about {
    padding: calc(var(--spacing) * 6) 0;
    position: relative;
    color: var(--color-white);
    min-height: 600px;
    display: flex;
    align-items: center;
}

.about-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('https://i.imgur.com/ayVCAyv.jpeg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.about-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 26, 26, 0.75);
}

.about-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.about-text {
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: var(--spacing);
    opacity: 0.95;
}

/* Stats Section */
.stats-container {
    display: flex;
    justify-content: center;
    gap: calc(var(--spacing) * 3);
    margin: calc(var(--spacing) * 2) 0;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
    color: var(--color-white);
}

.stat-number {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 8px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.stat-item .counter {
    display: inline;
}

.stat-label {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.9;
    display: block;
}

/* Contact Section */
.contact {
    padding: calc(var(--spacing) * 4) 0;
    background: var(--color-light-gray);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: calc(var(--spacing) * 2);
}

.contact-form-wrapper {
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--border-radius);
    padding: calc(var(--spacing) * 1.5);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-bmw-blue);
    box-shadow: 0 0 0 3px rgba(0, 31, 63, 0.1);
}

.response-time {
    text-align: center;
    color: var(--color-silver);
    margin-top: 16px;
    font-size: 0.9rem;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: var(--spacing);
}

.info-item {
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--border-radius);
    padding: calc(var(--spacing) * 1.5);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.info-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.1);
}

.info-item h3 {
    margin-bottom: 12px;
    font-size: 1.2rem;
}

.info-item p {
    margin-bottom: 8px;
}

.info-item a {
    color: var(--color-bmw-blue);
    text-decoration: none;
}

.info-item a:hover {
    text-decoration: underline;
}

/* Footer */
.footer {
    background: var(--color-charcoal);
    color: var(--color-silver);
    padding: calc(var(--spacing) * 3) 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing);
    margin-bottom: var(--spacing);
}

.footer-logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.footer-logo-img {
    height: 32px;
    width: auto;
    object-fit: contain;
}

.footer-logo {
    color: var(--color-white);
    font-size: 1.5rem;
    letter-spacing: 2px;
    margin-bottom: 0;
    font-weight: 700;
}

.footer-column h4 {
    color: var(--color-white);
    margin-bottom: 16px;
    font-size: 1.1rem;
}

.footer-column ul {
    list-style: none;
}

.footer-column ul li {
    margin-bottom: 8px;
}

.footer-column a {
    color: var(--color-silver);
    text-decoration: none;
    transition: var(--transition);
}

.footer-column a:hover {
    color: var(--color-white);
}

.footer-bottom {
    text-align: center;
    padding-top: var(--spacing);
    border-top: 1px solid var(--color-silver);
}

/* Performance optimizations for mobile */
@media (max-width: 768px) and (prefers-reduced-motion: reduce) {
    .hero-video {
        display: none;
    }
    
    .hero {
        background: linear-gradient(135deg, var(--color-charcoal) 0%, var(--color-bmw-blue) 100%);
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .stats-container {
        gap: calc(var(--spacing) * 2);
    }
    
    .stat-number {
        font-size: 2.5rem;
    }
    .container {
        padding: 0 16px;
    }
    
    /* Navigation */
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background: var(--color-charcoal);
        width: 100%;
        text-align: center;
        transition: var(--transition);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        padding: var(--spacing) 0;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-contact {
        display: none;
    }
    
    .hamburger {
        display: flex;
    }
    
    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }
    
    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }
    
    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }
    
    /* Hero Section */
    .hero {
        min-height: 85vh;
        height: 85vh;
    }
    
    .hero-cta {
        flex-direction: column;
        align-items: center;
    }
    
    /* Hide scroll indicator on mobile */
    .scroll-indicator {
        display: none;
    }
    
    /* Why Us Section */
    .why-us {
        padding: calc(var(--spacing) * 3) 0;
    }
    
    .section-title {
        margin-bottom: calc(var(--spacing) * 1.5);
    }
    
    .why-us-grid {
        grid-template-columns: 1fr;
        height: auto;
        min-height: auto;
        gap: calc(var(--spacing) * 0.75);
    }
    
    .why-us-large {
        height: 250px;
        margin-bottom: 0;
    }
    
    .why-us-stack {
        grid-template-rows: auto auto;
        gap: calc(var(--spacing) * 0.75);
    }
    
    .why-us-small {
        height: 180px;
    }
    
    /* About Section */
    .about {
        padding: calc(var(--spacing) * 4) 0;
        min-height: 50vh;
    }
    
    .about-text {
        font-size: 1rem;
        margin-bottom: calc(var(--spacing) * 0.75);
    }
    
    /* Contact Section */
    .contact {
        padding: calc(var(--spacing) * 3) 0;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing);
    }
    
    /* Footer */
    .footer {
        padding: calc(var(--spacing) * 2) 0;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: calc(var(--spacing) * 0.75);
    }
    
    .footer-logo-container {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .hero {
        min-height: 90vh;
        height: 90vh;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    /* Adjust video positioning for better framing on small screens */
    .hero-video {
        object-position: center 35%;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .why-us {
        padding: calc(var(--spacing) * 3) 0;
    }
    
    .why-us-large {
        height: 200px;
    }
    
    .why-us-small {
        height: 150px;
    }
    
    .about {
        padding: calc(var(--spacing) * 3) 0;
    }
}