:root {
    --primary: #ff3b30;
    --primary-dark: #d32f2f;
    --primary-light: #ff6b61;
    --secondary: #1a1a1a;
    --secondary-light: #252525;
    --dark: #0a0a0a;
    --dark-light: #151515;
    --light: #f5f5f5;
    --text: #ffffff;
    --text-secondary: #b0b0b0;
    --text-tertiary: #808080;
    --accent: #ffd700;
    --accent-light: #ffe347;
    --danger: #ff3b30;
    --warning: #ff9500;
    
    /* Glass effect */
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-hover: rgba(255, 255, 255, 0.08);
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(255, 59, 48, 0.3);
    --shadow-glow-lg: 0 0 60px rgba(255, 59, 48, 0.4);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px; /* Account for fixed navbar */
    scroll-snap-type: y proximity;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--dark);
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(255, 59, 48, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 215, 0, 0.02) 0%, transparent 50%);
    background-attachment: fixed;
    color: var(--text);
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 1000;
    padding: 1.25rem 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(0);
}

.navbar.hidden {
    transform: translateY(-100%);
}

.navbar.scrolled {
    background: rgba(10, 10, 10, 0.95);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    border-bottom-color: rgba(255, 59, 48, 0.2);
    padding: 1rem 0;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 3px;
    transition: all 0.3s ease;
    position: relative;
}

.logo::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width 0.3s ease;
}

.logo:hover::after {
    width: 100%;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s ease;
}

.nav-menu a:hover {
    color: var(--primary);
}

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

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--text);
    transition: all 0.3s ease;
}

/* Hero Section */
.hero {
    height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 50%, #0a0a0a 100%);
    overflow: hidden;
    scroll-snap-align: start;
    scroll-snap-stop: normal;
}

.hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0.8) 0%,
        rgba(0, 0, 0, 0.6) 50%,
        rgba(0, 0, 0, 0.8) 100%
    );
    z-index: 1;
    animation: overlayPulse 4s ease-in-out infinite;
}

@keyframes overlayPulse {
    0%, 100% {
        background: rgba(0, 0, 0, 0.7);
    }
    50% {
        background: rgba(0, 0, 0, 0.65);
    }
}

@keyframes scan {
    0% { transform: translateY(0); }
    100% { transform: translateY(100vh); }
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 2rem;
}

.hero-title {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(3rem, 10vw, 8rem);
    font-weight: 900;
    margin-bottom: 1rem;
    line-height: 1.1;
}

.title-line {
    display: block;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        text-shadow: 0 0 20px rgba(255, 59, 48, 0.5);
    }
    to {
        text-shadow: 0 0 40px rgba(255, 59, 48, 0.8), 0 0 60px rgba(255, 215, 0, 0.3);
    }
}

.title-subtitle {
    display: block;
    font-size: clamp(1rem, 3vw, 2rem);
    font-weight: 300;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    letter-spacing: 0.2em;
}

.hero-description {
    font-size: clamp(1rem, 2vw, 1.5rem);
    color: var(--text-secondary);
    margin-top: 2rem;
    margin-bottom: 4rem;
    font-weight: 300;
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    animation: bounce 2s infinite;
    z-index: 3;
}

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-10px); }
}

.scroll-arrow {
    width: 2px;
    height: 30px;
    background: var(--primary);
    position: relative;
}

.scroll-arrow::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -4px;
    width: 10px;
    height: 10px;
    border-right: 2px solid var(--primary);
    border-bottom: 2px solid var(--primary);
    transform: rotate(45deg);
}

/* Driving Car Animation - Scroll Triggered */
.driving-car {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    width: 400px;
    max-width: 40vw;
    z-index: 100;
    pointer-events: none;
    opacity: 0;
    will-change: transform;
    transition: none; /* Remove transition to prevent fading during animation */
}

.driving-car.active {
    opacity: 1 !important; /* Force full opacity when active */
}

.driving-car-img {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 20px 60px rgba(255, 59, 48, 0.5));
    transform-origin: center center;
    position: relative;
    z-index: 2;
}

/* Dust Trail Effect - Rally Car Cloud */
.dust-trail {
    position: absolute;
    bottom: 15%;
    left: 100%;
    width: 300px;
    height: 150px;
    pointer-events: none;
    z-index: 1;
    overflow: visible;
}

.dust-particle {
    position: absolute;
    border-radius: 50%;
    opacity: 0;
    animation: dustCloudFlyRight 4s ease-out forwards;
    filter: blur(3px);
    background: radial-gradient(circle, rgba(220, 200, 170, 0.9) 0%, rgba(180, 160, 130, 0.7) 30%, rgba(140, 120, 90, 0.5) 60%, transparent 100%);
}

/* Small particles */
.dust-particle.small {
    width: 12px;
    height: 12px;
}

/* Medium particles */
.dust-particle.medium {
    width: 20px;
    height: 20px;
    filter: blur(4px);
}

/* Large particles */
.dust-particle.large {
    width: 35px;
    height: 35px;
    filter: blur(6px);
}

/* Extra large cloud particles */
.dust-particle.xlarge {
    width: 50px;
    height: 50px;
    filter: blur(8px);
}

@keyframes dustCloudFlyRight {
    0% {
        opacity: 0.9;
        transform: translateX(0) translateY(0) scale(0.6);
    }
    30% {
        opacity: 0.8;
        transform: translateX(50px) translateY(var(--dust-y, 0)) scale(1.2);
    }
    60% {
        opacity: 0.6;
        transform: translateX(120px) translateY(calc(var(--dust-y, 0) * 1.2)) scale(1.8);
    }
    100% {
        opacity: 0;
        transform: translateX(250px) translateY(calc(var(--dust-y, 0) * 1.5)) scale(2.5);
    }
}

/* Base cloud layer for density */
.dust-cloud-base {
    position: absolute;
    width: 80px;
    height: 80px;
    background: radial-gradient(ellipse, rgba(200, 180, 150, 0.6) 0%, rgba(160, 140, 110, 0.4) 50%, transparent 100%);
    border-radius: 50%;
    filter: blur(12px);
    opacity: 0;
    animation: dustCloudBaseFlyRight 5s ease-out forwards;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
}

@keyframes dustCloudBaseFlyRight {
    0% {
        opacity: 0.7;
        transform: translateX(0) translateY(-50%) scale(0.8);
    }
    40% {
        opacity: 0.6;
        transform: translateX(100px) translateY(-50%) scale(1.5);
    }
    100% {
        opacity: 0;
        transform: translateX(300px) translateY(-50%) scale(3);
    }
}


/* Sections */
.section {
    padding: 8rem 0;
    position: relative;
    scroll-snap-align: start;
    scroll-snap-stop: normal;
    min-height: 100vh;
}

.section:not(:first-child) {
    padding-top: 10rem;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 4rem;
}

.section-number {
    font-family: 'Orbitron', sans-serif;
    font-size: 6rem;
    font-weight: 900;
    color: rgba(255, 59, 48, 0.25);
    line-height: 1;
}

.section-title {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 700;
    background: linear-gradient(135deg, var(--text) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    letter-spacing: -0.5px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 2px;
}

/* What Was Section */
.what-was {
    background: var(--secondary);
    position: relative;
    overflow: hidden;
}

.content-grid {
    display: grid;
    gap: 4rem;
    margin-bottom: 4rem;
}

.text-content {
    max-width: 800px;
    font-size: 1.2rem;
    line-height: 1.9;
    color: var(--text-secondary);
    letter-spacing: 0.2px;
}

.text-content p:not(:last-child) {
    margin-bottom: 1.5rem;
}

.lead-text {
    font-size: 1.6rem;
    color: var(--text);
    font-weight: 500;
    margin-bottom: 1.5rem;
    line-height: 1.6;
    letter-spacing: -0.3px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.feature-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 2.5rem;
    border-radius: 16px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

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

.feature-card:hover::before {
    left: 100%;
}

.feature-card:hover {
    transform: translateY(-12px) scale(1.03);
    border-color: var(--primary);
    box-shadow: var(--shadow-glow), var(--shadow-lg);
    background: var(--glass-hover);
}

.feature-icon {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    display: inline-block;
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    filter: drop-shadow(0 4px 8px rgba(255, 59, 48, 0.3));
}

.feature-card:hover .feature-icon {
    transform: scale(1.2) rotate(5deg);
}

.feature-card h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.feature-card p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.stat-box {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: linear-gradient(135deg, rgba(255, 59, 48, 0.1) 0%, rgba(255, 215, 0, 0.05) 100%);
    border: 2px solid var(--primary);
    border-radius: 20px;
    padding: 3.5rem 2.5rem;
    margin-top: 4rem;
    flex-wrap: wrap;
    gap: 2rem;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-glow), inset 0 0 60px rgba(255, 59, 48, 0.1);
}

.stat-box::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 59, 48, 0.1), transparent);
    animation: statShine 3s infinite;
    pointer-events: none;
}

@keyframes statShine {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-family: 'Orbitron', sans-serif;
    font-size: 3.5rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 30px rgba(255, 59, 48, 0.5);
    position: relative;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1.4;
    max-width: 200px;
    margin: 0 auto;
}

.stat-divider {
    width: 1px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
}

/* Cars Section */
.cars-section {
    background: var(--dark);
    position: relative;
    overflow: hidden;
}

/* Rally-themed background effects */
.rally-effects {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    z-index: 1;
    pointer-events: none;
}

/* Speed Lines - Horizontal streaks showing motion */
.speed-lines {
    position: absolute;
    top: 0;
    left: -400px;
    right: -400px;
    bottom: 0;
    width: calc(100% + 800px);
    margin-left: -400px;
    background: repeating-linear-gradient(
        90deg,
        transparent 0px,
        transparent 10px,
        rgba(255, 59, 48, 0.18) 10px,
        rgba(255, 59, 48, 0.18) 14px,
        transparent 14px,
        transparent 24px
    );
    background-size: 24px 100%;
    animation: speedLines 2s linear infinite;
    opacity: 0.8;
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0);
}

@keyframes speedLines {
    0% {
        transform: translate3d(0, 0, 0);
    }
    100% {
        transform: translate3d(24px, 0, 0);
    }
}

/* Rally Dust - Floating dust clouds */
.rally-dust {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse 900px 500px at 20% 30%, rgba(200, 175, 150, 0.4) 0%, rgba(190, 165, 140, 0.3) 25%, rgba(180, 155, 130, 0.2) 40%, rgba(170, 145, 120, 0.1) 55%, transparent 70%),
        radial-gradient(ellipse 700px 400px at 80% 70%, rgba(210, 185, 160, 0.35) 0%, rgba(200, 175, 150, 0.25) 30%, rgba(190, 165, 140, 0.15) 45%, rgba(180, 155, 130, 0.08) 60%, transparent 75%),
        radial-gradient(ellipse 800px 450px at 50% 50%, rgba(190, 165, 140, 0.3) 0%, rgba(180, 155, 130, 0.2) 30%, rgba(170, 145, 120, 0.12) 45%, rgba(160, 135, 110, 0.06) 60%, transparent 75%),
        radial-gradient(ellipse 650px 350px at 65% 20%, rgba(195, 170, 145, 0.28) 0%, rgba(185, 160, 135, 0.18) 35%, rgba(175, 150, 125, 0.1) 50%, transparent 70%);
    animation: dustFloat 12s ease-in-out infinite;
    filter: blur(25px);
    opacity: 1;
    will-change: transform, opacity;
}

@keyframes dustFloat {
    0%, 100% {
        transform: translate3d(0, 0, 0) scale(1);
        opacity: 0.9;
    }
    50% {
        transform: translate3d(0, -30px, 0) scale(1.1);
        opacity: 1;
    }
}

/* Spotlight Sweep - Moving spotlight effect */
.spotlight {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: radial-gradient(
        ellipse 800px 200% at center,
        rgba(255, 59, 48, 0.25) 0%,
        rgba(255, 215, 0, 0.15) 25%,
        rgba(255, 215, 0, 0.05) 35%,
        transparent 55%
    );
    background-size: 800px 200%;
    background-repeat: no-repeat;
    background-position: -800px center;
    animation: spotlightSweep 10s linear infinite;
    will-change: background-position, opacity;
    backface-visibility: hidden;
    transform: translateZ(0);
}

@keyframes spotlightSweep {
    0% {
        background-position: -800px center;
        opacity: 0.5;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        background-position: calc(100% + 800px) center;
        opacity: 0.5;
    }
}

.cars-section .container {
    position: relative;
    z-index: 2;
}

/* Technology Section */
.technology-section {
    background: var(--secondary);
    position: relative;
    overflow: hidden;
}

.tech-intro {
    max-width: 900px;
    margin: 0 auto 4rem;
    text-align: center;
}

.tech-lead {
    font-size: 1.3rem;
    color: var(--text);
    line-height: 1.8;
    font-weight: 400;
}

.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.tech-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
}

.tech-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary) 0%, var(--accent) 100%);
    transform: scaleY(0);
    transition: transform 0.4s ease;
    z-index: 1;
}

.tech-card:hover::before {
    transform: scaleY(1);
}

.tech-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary);
    box-shadow: 0 15px 50px rgba(255, 59, 48, 0.2);
    background: rgba(255, 255, 255, 0.05);
}

.tech-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    position: relative;
    background: var(--dark);
    display: flex;
    align-items: center;
    justify-content: center;
}

.tech-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.4s ease;
}

.tech-card:hover .tech-img {
    transform: scale(1.1);
}

.tech-card-content {
    padding: 2rem;
    position: relative;
    z-index: 1;
}

.tech-card h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    color: var(--text);
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.tech-card p {
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: 1rem;
    position: relative;
    z-index: 1;
}

.cars-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
    align-items: stretch;
}

.car-card {
    flex: 0 1 350px;
    min-width: 300px;
    max-width: 350px;
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-light) 100%);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    border: 1px solid var(--glass-border);
    transform-style: preserve-3d;
    width: 100%;
    box-shadow: var(--shadow-md);
    position: relative;
    display: flex;
    flex-direction: column;
}

.car-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 59, 48, 0.1) 0%, rgba(255, 215, 0, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    border-radius: 20px;
}

.car-card:hover::after {
    opacity: 1;
}

.car-card:hover {
    transform: translateY(-18px) scale(1.03) rotateY(2deg);
    box-shadow: var(--shadow-glow-lg), var(--shadow-lg);
    border-color: var(--primary);
}

.car-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--dark);
}

.car-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.4s ease;
}

.car-card:hover .car-photo {
    transform: scale(1.1);
}

.car-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.7) 100%);
    transition: opacity 0.3s ease;
    pointer-events: none;
    /* Width and height will be set by JavaScript to match image dimensions */
}

.car-card:hover .car-overlay {
    opacity: 0.5;
}

.car-name {
    position: relative;
    z-index: 2;
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    text-align: center;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.car-info {
    padding: 2rem;
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-light) 100%);
    position: relative;
    z-index: 2;
    margin: 0;
    margin-top: auto;
    box-shadow: none;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.car-info h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.car-info p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.click-to-expand {
    display: block;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 0.5px;
    margin-top: 1rem;
    text-align: center;
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.3s ease;
    font-weight: 300;
}

.car-card:hover .click-to-expand {
    opacity: 1;
    transform: translateY(0);
    color: rgba(255, 255, 255, 0.5);
}

/* Why End Section */
.why-end {
    background: 
        linear-gradient(rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.75)),
        url('../images/rallyspectators.jpeg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    position: relative;
    overflow: hidden;
}

.why-end::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(
        circle at 50% 50%,
        rgba(255, 59, 48, 0.08) 0%,
        transparent 60%
    );
    animation: dangerPulse 4s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes dangerPulse {
    0%, 100% {
        opacity: 0.5;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

.why-end .container {
    position: relative;
    z-index: 2;
}

.warning-box {
    background: linear-gradient(135deg, rgba(255, 59, 48, 0.2) 0%, rgba(255, 59, 48, 0.1) 100%);
    border: 2px solid var(--danger);
    border-radius: 16px;
    padding: 2.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 4rem;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-glow), inset 0 0 40px rgba(255, 59, 48, 0.1);
    backdrop-filter: blur(10px);
}

.warning-box::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(255, 59, 48, 0.1),
        transparent
    );
    animation: warningShine 3s infinite;
    pointer-events: none;
}

@keyframes warningShine {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

.warning-icon {
    font-size: 3rem;
}

.warning-text {
    font-size: 1.3rem;
    color: var(--text);
    font-weight: 500;
}

.reasons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.reason-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 16px;
    padding: 2.5rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.reason-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.05),
        transparent
    );
    transition: left 0.6s ease;
}

.reason-card:hover::after {
    left: 100%;
}

.reason-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--danger);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.reason-card:hover::before {
    transform: scaleY(1);
}

.reason-card:hover {
    transform: translateX(10px) translateY(-8px) scale(1.02);
    border-color: var(--danger);
    box-shadow: var(--shadow-glow), var(--shadow-lg);
    background: var(--glass-hover);
    background: rgba(255, 255, 255, 0.06);
}

.reason-card.critical {
    border-color: var(--danger);
    background: rgba(255, 59, 48, 0.05);
}

.reason-card.critical::before {
    background: var(--danger);
    transform: scaleY(1);
}

.reason-number {
    font-family: 'Orbitron', sans-serif;
    font-size: 3rem;
    font-weight: 900;
    color: var(--danger);
    opacity: 0.3;
    margin-bottom: 1rem;
}

.reason-card h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text);
}

.reason-card p {
    color: var(--text-secondary);
    line-height: 1.8;
}

.tragedy-section {
    background: linear-gradient(
        135deg,
        rgba(255, 59, 48, 0.08) 0%,
        rgba(255, 59, 48, 0.03) 100%
    );
    border: 2px solid var(--danger);
    border-radius: 16px;
    padding: 3rem;
    margin-top: 4rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 40px rgba(255, 59, 48, 0.2), inset 0 0 40px rgba(255, 59, 48, 0.05);
}

.tragedy-section::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(
        45deg,
        var(--danger),
        transparent,
        var(--danger)
    );
    border-radius: 16px;
    opacity: 0.3;
    animation: tragedyGlow 3s ease-in-out infinite;
    z-index: -1;
}

@keyframes tragedyGlow {
    0%, 100% {
        opacity: 0.2;
    }
    50% {
        opacity: 0.4;
    }
}

.tragedy-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    color: var(--danger);
    margin-bottom: 2rem;
}

.tragedy-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.tragedy-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tragedy-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tragedy-value {
    color: var(--text);
    font-size: 1.2rem;
    font-weight: 600;
}

.tragedy-text {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.8;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 59, 48, 0.3);
}

/* The End Section */
.the-end {
    background: linear-gradient(
        180deg,
        var(--dark) 0%,
        var(--secondary) 50%,
        var(--dark) 100%
    );
    text-align: center;
    position: relative;
    overflow: hidden;
}

.the-end::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 30% 50%, rgba(255, 59, 48, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 70% 50%, rgba(255, 215, 0, 0.08) 0%, transparent 50%);
    animation: endFade 6s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes endFade {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
}

.the-end .container {
    position: relative;
    z-index: 2;
}

.end-content {
    max-width: 900px;
    margin: 0 auto;
}

.end-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 4rem;
    position: relative;
}

.end-header::after {
    content: '';
    position: absolute;
    bottom: -2rem;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(
        90deg,
        transparent,
        var(--primary),
        transparent
    );
    animation: lineGrow 2s ease-in-out infinite;
}

@keyframes lineGrow {
    0%, 100% {
        width: 50px;
        opacity: 0.5;
    }
    50% {
        width: 150px;
        opacity: 1;
    }
}

.end-text {
    font-size: 1.2rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.end-lead {
    font-size: 1.5rem;
    color: var(--text);
    margin-bottom: 2rem;
    font-weight: 500;
}

.announcement-box {
    background: linear-gradient(
        135deg,
        rgba(255, 59, 48, 0.2) 0%,
        rgba(255, 215, 0, 0.1) 50%,
        rgba(255, 59, 48, 0.1) 100%
    );
    border: 3px solid var(--primary);
    border-radius: 20px;
    padding: 3.5rem;
    margin: 3rem 0;
    position: relative;
    overflow: hidden;
    box-shadow: 
        var(--shadow-glow-lg),
        inset 0 0 60px rgba(255, 59, 48, 0.15);
    backdrop-filter: blur(10px);
}

.announcement-box::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(255, 59, 48, 0.2),
        transparent
    );
    animation: announcementShine 4s infinite;
    pointer-events: none;
}

@keyframes announcementShine {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

.announcement-box::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid var(--primary);
    border-radius: 16px;
    opacity: 0.5;
    animation: announcementPulse 2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes announcementPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.3;
    }
    50% {
        transform: scale(1.02);
        opacity: 0.6;
    }
}

.announcement-text {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8rem;
    color: var(--primary);
    font-weight: 700;
    position: relative;
    z-index: 1;
    text-shadow: 0 0 20px rgba(255, 59, 48, 0.5);
    animation: textGlow 3s ease-in-out infinite;
}

@keyframes textGlow {
    0%, 100% {
        text-shadow: 0 0 20px rgba(255, 59, 48, 0.5);
    }
    50% {
        text-shadow: 0 0 30px rgba(255, 59, 48, 0.8), 0 0 40px rgba(255, 59, 48, 0.4);
    }
}

.end-conclusion {
    margin-top: 2rem;
    font-size: 1.2rem;
    color: var(--text-secondary);
}

/* Footer */
.footer {
    background: linear-gradient(180deg, var(--dark) 0%, var(--secondary) 100%);
    padding: 3rem 0;
    text-align: center;
    color: var(--text-secondary);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    scroll-snap-align: start;
    scroll-snap-stop: normal;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: 0.5;
}

/* Car Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--dark) 100%);
    border: 2px solid rgba(255, 59, 48, 0.3);
    border-radius: 20px;
    padding: 0;
    max-width: 1200px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(255, 59, 48, 0.2);
    animation: slideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.modal-content::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

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

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    color: var(--text);
    font-size: 2rem;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    z-index: 10001;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 0;
    margin: 0;
    text-align: center;
    user-select: none;
}

.modal-close:hover {
    color: var(--primary);
    background: rgba(255, 59, 48, 0.2);
    transform: rotate(90deg);
}

.modal-body {
    padding: 3rem;
}

.modal-car-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
    padding-bottom: 3rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.modal-car-image {
    width: 100%;
    height: auto;
    border-radius: 16px;
    object-fit: cover;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 59, 48, 0.2);
}

.modal-car-info h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
    text-shadow: 0 0 20px rgba(255, 59, 48, 0.5);
}

.modal-car-info p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 2rem;
}

.modal-specs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.spec-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1rem;
    backdrop-filter: blur(10px);
}

.spec-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.spec-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
}

.modal-drivers-section {
    margin-top: 3rem;
}

.modal-drivers-section h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    color: var(--text);
    margin-bottom: 2rem;
    text-align: center;
}

.drivers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.driver-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.driver-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary);
    box-shadow: 0 10px 40px rgba(255, 59, 48, 0.2);
    background: rgba(255, 255, 255, 0.05);
}

.driver-image {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 1rem;
    border: 3px solid var(--primary);
    box-shadow: 0 0 30px rgba(255, 59, 48, 0.3);
}

.driver-name {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.3rem;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.driver-info {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Responsive Modal */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        padding: 0;
    }

    .modal-body {
        padding: 2rem 1.5rem;
    }

    .modal-car-section {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .modal-car-info h2 {
        font-size: 2rem;
    }

    .modal-specs {
        grid-template-columns: 1fr;
    }

    .drivers-grid {
        grid-template-columns: 1fr;
    }

    .modal-close {
        top: 1rem;
        right: 1rem;
        font-size: 2.5rem;
        width: 35px;
        height: 35px;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background: rgba(10, 10, 10, 0.98);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        padding: 2rem 0;
        gap: 1rem;
    }

    .nav-menu.active {
        left: 0;
    }

    .hamburger {
        display: flex;
    }

    .section {
        padding: 4rem 0;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .section-number {
        font-size: 4rem;
    }

    .stat-box {
        flex-direction: column;
    }

    .stat-divider {
        width: 60px;
        height: 1px;
    }

    .cars-grid {
        flex-direction: column;
        align-items: center;
    }
    
    .car-card {
        max-width: 100%;
    }

    .tech-grid {
        grid-template-columns: 1fr;
    }

    .tech-lead {
        font-size: 1.1rem;
    }

    .reasons-grid {
        grid-template-columns: 1fr;
    }

    .tragedy-details {
        grid-template-columns: 1fr;
    }
}

/* Scroll Animations */
.fade-in {
    opacity: 0;
    transform: translateY(50px) scale(0.95);
    transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

/* Responsive adjustments for driving car */
@media (max-width: 768px) {
    .driving-car {
        width: 250px;
        max-width: 50vw;
    }
}

