/* ==========================================================================
   EXCELEON RACING — DESIGN SYSTEM & STYLESHEET
   Dark. Clean. Minimal. Modern. Motorsport. Cinematic.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. DESIGN TOKENS & CSS VARIABLES
   -------------------------------------------------------------------------- */
:root {
    /* Color System */
    --color-bg: #050505;
    --color-bg-alt: #0b0b0d;
    --color-surface: #121215;
    --color-surface-hover: #1a1a1f;
    --color-border: rgba(255, 255, 255, 0.08);
    --color-border-bright: rgba(255, 255, 255, 0.2);
    
    /* Typography Colors */
    --color-text-main: #FFFFFF;
    --color-text-muted: #8E8E93;
    --color-text-dark: #55555A;
    
    /* Accent Color (Exceleon Crimson) */
    --color-accent: #FF1E27;
    --color-accent-glow: rgba(255, 30, 39, 0.3);

    /* Fonts */
    --font-heading: 'Space Grotesk', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    /* Transitions */
    --transition-fast: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-medium: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-slow: 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --------------------------------------------------------------------------
   2. GLOBAL RESET & BASE STYLES
   -------------------------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    background-color: var(--color-bg);
    color: var(--color-text-main);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: clip;
}

body {
    width: 100%;
    min-height: 100vh;
    background-color: var(--color-bg);
    color: var(--color-text-main);
    line-height: 1.5;
    overflow-x: clip;
}

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

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

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: var(--color-bg);
}
::-webkit-scrollbar-thumb {
    background: #26262a;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--color-accent);
}

/* --------------------------------------------------------------------------
   3. PRELOADER
   -------------------------------------------------------------------------- */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #030303;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.preloader.loaded {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.preloader-content {
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.preloader-brand {
    margin-bottom: 2rem;
}

.brand-text {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.35em;
    color: #FFFFFF;
}

.preloader-counter-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.preloader-percent {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: 700;
    color: #FFFFFF;
    letter-spacing: 0.05em;
    font-variant-numeric: tabular-nums;
}

.preloader-bar {
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 1px;
    overflow: hidden;
}

.preloader-progress {
    width: 0%;
    height: 100%;
    background: var(--color-accent);
    transition: width 0.1s linear;
    box-shadow: 0 0 10px var(--color-accent-glow);
}

.preloader-sub {
    margin-top: 1rem;
    font-size: 0.7rem;
    letter-spacing: 0.25em;
    color: var(--color-text-muted);
}

/* --------------------------------------------------------------------------
   4. NAVIGATION
   -------------------------------------------------------------------------- */
.main-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 1.25rem 0;
    background: linear-gradient(to bottom, rgba(5, 5, 5, 0.85) 0%, rgba(5, 5, 5, 0) 100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: background 0.3s ease;
}

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

.nav-brand {
    display: flex;
    align-items: center;
}

.nav-logo-img {
    height: 32px;
    width: auto;
    display: block;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2.5rem;
}

.nav-links a {
    font-family: var(--font-heading);
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    color: var(--color-text-muted);
    font-weight: 500;
    transition: color var(--transition-fast);
    position: relative;
}

.nav-links a.active,
.nav-links a:hover {
    color: #FFFFFF;
    font-weight: 600;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 0%;
    height: 2px;
    background-color: var(--color-accent);
    transition: width 0.3s ease;
}

.nav-links a.active::after {
    width: 100%;
}

.nav-cta {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    letter-spacing: 0.25em;
    padding: 0.6rem 1.4rem;
    border: 1px solid var(--color-border-bright);
    color: #FFFFFF;
    transition: all var(--transition-fast);
}

.nav-cta:hover {
    background-color: #FFFFFF;
    color: #050505;
    border-color: #FFFFFF;
}

/* --------------------------------------------------------------------------
   5. SECTION 1 — HERO CANVAS & SCROLL SEQUENCE
   -------------------------------------------------------------------------- */
.hero-section {
    position: relative;
    width: 100%;
    height: 450vh; /* Scroll distance driving 300 frames */
    background-color: #030303;
}

.hero-sticky {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

#hero-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
    z-index: 1;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    filter: contrast(1.08) brightness(1.02) saturate(1.05);
}

/* Vignette Dark Overlay */
.hero-sticky::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(5,5,5,0.15) 0%, rgba(5,5,5,0.8) 100%),
                linear-gradient(to bottom, rgba(5,5,5,0.4) 0%, rgba(5,5,5,0) 30%, rgba(5,5,5,0.85) 100%);
    pointer-events: none;
    z-index: 2;
}

.hero-typography {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 1400px;
    height: 100%;
    padding: 0 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    pointer-events: none;
}

.hero-statement-wrap {
    max-width: 900px;
}

.hero-eyebrow {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    letter-spacing: 0.35em;
    color: var(--color-accent);
    margin-bottom: 1.5rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.hero-statement {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 6vw, 5.5rem);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: #FFFFFF;
    margin: 0;
    opacity: 0;
    transform: translateY(35px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    text-shadow: 0 4px 30px rgba(0, 0, 0, 0.8);
    text-transform: uppercase;
}

.hero-line-2 {
    color: #E2E2E8;
    margin-top: 0.5rem;
}

.hero-scroll-indicator {
    position: absolute;
    bottom: 3rem;
    left: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    opacity: 0.8;
}

.scroll-text {
    font-family: var(--font-heading);
    font-size: 0.7rem;
    letter-spacing: 0.3em;
    color: var(--color-text-muted);
}

.scroll-line {
    width: 40px;
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.scroll-dot {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    background: var(--color-accent);
    animation: scrollSlide 2s infinite ease-in-out;
}

@keyframes scrollSlide {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(200%); }
}

/* --------------------------------------------------------------------------
   6. SECTION 2 — INTRODUCTION / WELCOME
   -------------------------------------------------------------------------- */
.intro-section {
    position: relative;
    z-index: 20;
    background-color: var(--color-bg);
    padding: 10rem 0 8rem 0;
    border-top: 1px solid var(--color-border);
}

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

.intro-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 4rem;
    align-items: start;
}

.eyebrow {
    display: block;
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.35em;
    color: var(--color-text-muted);
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.section-headline {
    font-family: var(--font-heading);
    font-size: clamp(2.2rem, 4vw, 3.8rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: #FFFFFF;
}

.highlight-text {
    color: #FFFFFF;
    background: linear-gradient(90deg, #FFFFFF 0%, #8E8E93 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.intro-body {
    display: flex;
    flex-direction: column;
    gap: 1.8rem;
}

.lead-text {
    font-size: 1.25rem;
    line-height: 1.6;
    color: #E2E2E8;
    font-weight: 400;
}

.body-text {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--color-text-muted);
}

.stats-row {
    margin-top: 2rem;
    padding-top: 2.5rem;
    border-top: 1px solid var(--color-border);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 700;
    color: #FFFFFF;
}

.stat-label {
    font-family: var(--font-heading);
    font-size: 0.65rem;
    letter-spacing: 0.25em;
    color: var(--color-text-muted);
}

/* --------------------------------------------------------------------------
   7. SECTION 3 — IMAGE GALLERY
   -------------------------------------------------------------------------- */
.gallery-section {
    position: relative;
    z-index: 20;
    background-color: var(--color-bg-alt);
    padding: 8rem 0;
    border-top: 1px solid var(--color-border);
}

.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 4rem;
}

.section-subheadline {
    font-family: var(--font-heading);
    font-size: clamp(1.4rem, 2.5vw, 2.2rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: #FFFFFF;
}

.gallery-insta-link {
    color: #FFFFFF;
    transition: color var(--transition-fast);
}

.gallery-insta-link:hover {
    color: var(--color-accent);
}

.gallery-subtitle {
    max-width: 420px;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--color-text-muted);
}

/* 6x7 Square Thumbnail Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1rem;
}

.gallery-item {
    position: relative;
    aspect-ratio: 1 / 1;
    width: 100%;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    overflow: hidden;
    cursor: pointer;
}

.gallery-image-wrap {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.gallery-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1), filter 0.7s ease;
    filter: brightness(0.9) contrast(1.05);
}

.gallery-item:hover .gallery-image-wrap img {
    transform: scale(1.04);
    filter: brightness(1.05) contrast(1.1);
}

.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem;
    background: linear-gradient(to top, rgba(5,5,5,0.9) 0%, rgba(5,5,5,0) 100%);
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    opacity: 0.85;
    transition: opacity var(--transition-fast);
}

.gallery-item:hover .gallery-caption {
    opacity: 1;
}

.caption-tag {
    font-family: var(--font-heading);
    font-size: 0.65rem;
    letter-spacing: 0.25em;
    color: var(--color-accent);
}

.caption-title {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    color: #FFFFFF;
}

/* --------------------------------------------------------------------------
   8. LIGHTBOX MODAL
   -------------------------------------------------------------------------- */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(3, 3, 4, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-close {
    position: absolute;
    top: 2rem;
    right: 2.5rem;
    font-size: 2.5rem;
    color: #FFFFFF;
    line-height: 1;
    transition: color 0.2s ease;
}

.lightbox-close:hover {
    color: var(--color-accent);
}

.lightbox-content {
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    border: 1px solid var(--color-border-bright);
    box-shadow: 0 20px 50px rgba(0,0,0,0.8);
}

.lightbox-caption {
    margin-top: 1.2rem;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    letter-spacing: 0.1em;
    color: #FFFFFF;
}

/* --------------------------------------------------------------------------
   9. FOOTER
   -------------------------------------------------------------------------- */
.site-footer {
    position: relative;
    z-index: 20;
    background-color: #030303;
    padding: 5rem 0 3rem 0;
    border-top: 1px solid var(--color-border);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 3rem;
    border-bottom: 1px solid var(--color-border);
}

.footer-logo {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.25em;
    color: #FFFFFF;
    display: block;
}

.footer-motto {
    font-family: var(--font-heading);
    font-size: 0.7rem;
    letter-spacing: 0.35em;
    color: var(--color-text-muted);
    margin-top: 0.5rem;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    color: var(--color-text-muted);
}

.footer-links a:hover {
    color: #FFFFFF;
}

.footer-bottom {
    max-width: 1400px;
    margin: 2rem auto 0 auto;
    padding: 0 2rem;
    font-family: var(--font-heading);
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    color: var(--color-text-dark);
}

/* --------------------------------------------------------------------------
   10. RESPONSIVE BREAKPOINTS
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .nav-container {
        justify-content: center;
    }

    .nav-brand {
        margin: 0 auto;
    }

    .nav-links,
    .nav-cta {
        display: none !important;
    }

    .intro-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
    }
    
    .gallery-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .hero-statement {
        font-size: 2.2rem;
    }
    
    .hero-eyebrow {
        font-size: 0.75rem;
        letter-spacing: 0.25em;
    }
    
    .intro-section, .gallery-section {
        padding: 5rem 0;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .stats-row {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .footer-content {
        flex-direction: column;
        gap: 2rem;
    }
}
