:root {
    --bg-color: #070709;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-muted: #666670;
    --accent: #ff1926;
    --accent-hover: #ff3340;
    --accent-glow: rgba(255, 25, 38, 0.4);
    --glass-bg: rgba(12, 12, 16, 0.68);
    --glass-border: rgba(255, 255, 255, 0.08);
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
}

/* ============================================================
   01. PRELOADER
   ============================================================ */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #060608;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preloader-content {
    text-align: center;
    width: 360px;
    max-width: 90vw;
}

.preloader-badge {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.3em;
    color: var(--accent);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.brand-text {
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    letter-spacing: 0.25em;
    font-size: 3.2rem;
    line-height: 1;
    color: #ffffff;
    text-shadow: 0 0 35px rgba(255, 255, 255, 0.2);
}

.sub-brand {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.35em;
    color: var(--text-secondary);
    margin-top: 0.6rem;
    margin-bottom: 2.2rem;
    text-transform: uppercase;
}

.progress-bar-container {
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ff1926, #ffffff);
    box-shadow: 0 0 10px var(--accent);
    transition: width 0.25s ease-out;
}

.progress-text {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

.loading-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted);
}

/* ============================================================
   02. VIDEO STAGE & PLAYERS
   ============================================================ */
#video-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    background: #000;
    transform: scale(1.05);
}

.cinematic-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    visibility: visible; /* Kept visible to preserve GPU canvas */
    will-change: opacity, transform;
}

.cinematic-video.active {
    opacity: 1;
    z-index: 5;
}

/* HIGH QUALITY STATIC FRAMES */
.hq-static-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    visibility: hidden;
    z-index: 2;
}

/* DUST PARTICLE CANVAS */
.gl-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 3;
}

/* CINEMATIC VIGNETTE */
.vignette-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    background: radial-gradient(circle at center, transparent 35%, rgba(4, 4, 5, 0.92) 110%);
    box-shadow: inset 0 0 160px rgba(0, 0, 0, 0.85);
    z-index: 5;
}

/* ============================================================
   03. HUD OVERLAY
   ============================================================ */
.hud-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2.2rem 4rem;
    pointer-events: none;
}

/* ============================================================
   03. TOP LUXURY STATUS BAR
   ============================================================ */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    pointer-events: auto;
}

.top-bar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Montserrat', sans-serif;
}

.brand-brabus {
    font-weight: 900;
    font-size: 1.15rem;
    letter-spacing: 0.22em;
    color: #ffffff;
}

.brand-model {
    font-weight: 800;
    font-style: italic;
    font-size: 1.05rem;
    letter-spacing: 0.12em;
    color: var(--accent);
}

.brand-badge {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 3px 8px;
    border-radius: 9999px;
    margin-left: 4px;
}

/* Minimalist Inline Telemetry Ticker */
.top-specs-ticker {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(14, 15, 18, 0.65);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 6px 20px;
    border-radius: 9999px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    color: rgba(255, 255, 255, 0.65);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.spec-tick strong {
    color: #ffffff;
    font-weight: 800;
}

.spec-tick-sep {
    color: rgba(255, 255, 255, 0.25);
    font-weight: 300;
}

.top-bar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-pill-action {
    background: rgba(14, 15, 18, 0.65);
    color: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 6px 14px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(16px);
    transition: all 0.25s ease;
}

.btn-pill-action:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
    color: #ffffff;
}

.btn-pill-cta {
    background: var(--accent);
    color: #ffffff;
    border: 1px solid rgba(255, 25, 38, 0.5);
    padding: 7px 18px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 9999px;
    box-shadow: 0 4px 18px var(--accent-glow);
    transition: all 0.25s ease;
}

.btn-pill-cta:hover {
    background: var(--accent-hover);
    box-shadow: 0 6px 24px rgba(255, 25, 38, 0.65);
    transform: translateY(-1px);
}

/* SOUND BARS ANIMATION */
.sound-bars {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 10px;
}

.s-bar {
    width: 2px;
    height: 100%;
    background: var(--accent);
    transform: scaleY(0.3);
    transform-origin: bottom;
    transition: transform 0.2s ease;
}

.sound-bars.active .s-bar:nth-child(1) {
    animation: bar-dance 0.7s infinite alternate ease-in-out;
}
.sound-bars.active .s-bar:nth-child(2) {
    animation: bar-dance 0.9s infinite alternate ease-in-out 0.2s;
}
.sound-bars.active .s-bar:nth-child(3) {
    animation: bar-dance 0.6s infinite alternate ease-in-out 0.4s;
}

@keyframes bar-dance {
    0% { transform: scaleY(0.2); }
    100% { transform: scaleY(1); }
}

/* ============================================================
   04. FLOATING CONTEXT MICRO-CAPSULE CONTAINER (COLOR & COCKPIT)
   ============================================================ */
.floating-context-container {
    position: absolute;
    bottom: calc(2.2rem + 54px);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    z-index: 55;
    pointer-events: none;
}

.context-pill-menu {
    pointer-events: auto;
    display: none;
    align-items: center;
    gap: 6px;
    background: rgba(14, 15, 18, 0.85);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 9999px;
    padding: 4px 6px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.6), 0 0 16px rgba(255, 25, 38, 0.15);
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.context-pill-menu.active {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.pill-context-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    color: var(--accent);
    padding: 0 8px 0 10px;
}

.pill-swatch-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.75);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.25s ease;
}

.pill-swatch-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.pill-swatch-btn.active {
    background: rgba(255, 25, 38, 0.22);
    border-color: var(--accent);
    color: #ffffff;
    box-shadow: 0 0 14px rgba(255, 25, 38, 0.35);
}

.swatch-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.swatch-dot--white {
    background: radial-gradient(circle at 35% 35%, #ffffff 0%, #d8d8d8 70%, #909090 100%);
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.9);
}

.swatch-dot--black {
    background: radial-gradient(circle at 35% 35%, #2a2a2a 0%, #0d0d0d 70%, #000000 100%);
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.swatch-dot--red {
    background: var(--accent);
    box-shadow: 0 0 6px var(--accent);
}

/* Elegant Floating Guidance Micro-Line */
.guidance-line {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    color: rgba(255, 255, 255, 0.85);
    text-transform: uppercase;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.85);
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.guidance-pulse-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent);
    animation: guidance-dot-blink 1.5s infinite ease-in-out;
}

@keyframes guidance-dot-blink {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.4); opacity: 0.5; }
}

/* ============================================================
   05. MAIN FLOATING BOTTOM CAPSULE DOCK
   ============================================================ */
.bottom-nav-dock {
    position: absolute;
    bottom: 2.2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(14, 15, 18, 0.72);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 9999px;
    padding: 5px 8px;
    z-index: 50;
    pointer-events: auto;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65), inset 0 1px 1px rgba(255, 255, 255, 0.15);
}

.dock-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 15px;
    border-radius: 9999px;
    border: 1px solid transparent;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
    white-space: nowrap;
}

.dock-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.dock-btn.active {
    background: #ff1926;
    color: #ffffff;
    box-shadow: 0 4px 18px rgba(255, 25, 38, 0.45);
    border-color: rgba(255, 255, 255, 0.2);
}

.dock-num {
    font-size: 0.62rem;
    font-weight: 500;
    opacity: 0.6;
    font-variant-numeric: tabular-nums;
}

.dock-btn.active .dock-num {
    opacity: 0.95;
    font-weight: 800;
}

/* PULSE ON 01 ARRIVAL WHEN SCENE IS EMPTY */
.dock-btn.pulse-anim {
    animation: dock-arrival-pulse 1.8s infinite ease-in-out;
    border-color: rgba(255, 25, 38, 0.6) !important;
}

@keyframes dock-arrival-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 25, 38, 0.7);
        background: rgba(255, 25, 38, 0.2);
        color: #ffffff;
    }
    50% {
        box-shadow: 0 0 16px 4px rgba(255, 25, 38, 0.55);
        background: rgba(255, 25, 38, 0.45);
        color: #ffffff;
    }
}

/* ============================================================
   09. MODALS (CINEMA & TELEMETRY)
   ============================================================ */
.trailer-modal,
.telemetry-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.4s ease;
}

.trailer-modal.active,
.telemetry-modal.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.trailer-modal__backdrop,
.telemetry-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4, 4, 6, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.trailer-modal__container {
    position: relative;
    z-index: 2;
    width: 85vw;
    max-width: 1200px;
    background: #0a0a0d;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9);
}

.trailer-modal__header,
.telemetry-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.trailer-sub,
.t-badge {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.25em;
    color: var(--accent);
    text-transform: uppercase;
}

.trailer-title,
.t-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    margin-top: 4px;
}

.modal-close-btn {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: #ffffff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-close-btn:hover {
    background: var(--accent);
    transform: rotate(90deg);
}

.trailer-modal__video-wrap {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
}

.trailer-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* TELEMETRY PANEL */
.telemetry-modal__panel {
    position: relative;
    z-index: 2;
    width: 80vw;
    max-width: 1000px;
    background: #0a0a0e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9);
}

.telemetry-modal__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    padding: 2rem;
}

.spec-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 1.4rem;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
}

.spec-card__label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent);
    margin-bottom: 6px;
}

.spec-card__value {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 6px;
}

.spec-card__sub {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ============================================================
   10. ORIENTATION LOCK (PORTRAIT)
   ============================================================ */
.orientation-lock {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #050507;
    z-index: 100000;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #ffffff;
}

.orientation-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 2rem;
}

.rocket-rotate-icon {
    animation: pulse-rotate 2.5s infinite ease-in-out;
    filter: drop-shadow(0 0 15px rgba(255, 25, 38, 0.5));
}

@keyframes pulse-rotate {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(90deg) scale(1.1); }
    100% { transform: rotate(90deg) scale(1); }
}

.orientation-content h2 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 1.8rem;
    letter-spacing: 0.1em;
    margin: 0;
}

.orientation-content p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

@media (max-width: 900px) and (orientation: portrait) {
    .orientation-lock {
        display: flex;
    }
}

/* ============================================================
   11. RESPONSIVE BREAKPOINTS
   ============================================================ */
@media (max-width: 1100px) {
    .hud-overlay { padding: 1.5rem 2rem; }
    .main-title { font-size: 3.5rem; }
    .specs-panel { display: none; }
    .atelier-color-picker, .cockpit-sub-menu { left: 240px; }
}

@media (max-height: 520px) and (orientation: landscape) {
    .hud-overlay { padding: 1rem 1.5rem; }
    .hero-titles { top: 25% !important; left: 1.5rem !important; }
    .main-title { font-size: 1.8rem; }
    .subtitle { font-size: 0.65rem; }
    .forza-menu { bottom: 0.8rem; left: 0.8rem; gap: 1px; }
    .forza-item { padding: 6px 16px 6px 12px; width: 140px; }
    .forza-item:hover, .forza-item.active { width: 155px; }
    .forza-text { font-size: 0.72rem; }
    .forza-number { font-size: 0.6rem; }
    .user-guidance { bottom: 0.8rem; padding: 6px 16px; font-size: 0.65rem; }
    .atelier-color-picker, .cockpit-sub-menu { bottom: 0.8rem; left: 160px; padding: 6px 12px; }
}
