:root {
    --bg-navy: #070B14;
    --accent-blue: #00A3FF;
    --accent-amber: #F59E0B;
    --text-main: #F8FAFC;
    --text-muted: #94A3B8;
    --glass-bg: rgba(10, 17, 32, 0.62);
    --glass-border: rgba(0, 163, 255, 0.25);
    --nav-safe-top: 105px;
    --hud-safe-bottom: 75px;
    --site-max-w: 1360px;
    --site-edge-x: max(4%, calc((100vw - 1360px) / 2 + 4%));
}

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

html, body {
    background-color: var(--bg-navy);
    color: var(--text-main);
    font-family: 'Plus Jakarta Sans', sans-serif;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ================= PRELOADER ================= */
#cinema-loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--bg-navy);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1),
                visibility 0.75s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
}

#cinema-loader.hidden {
    opacity: 0;
    visibility: hidden;
    transform: scale(1.04);
    pointer-events: none;
}

.loader-ambient {
    position: absolute;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 163, 255, 0.16) 0%, rgba(7, 11, 20, 0) 70%);
    pointer-events: none;
}

.loader-core {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    width: min(280px, 82vw);
}

.loader-logo-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
}

.loader-logo {
    height: auto;
    max-width: 115px;
    object-fit: contain;
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 0 20px rgba(0, 163, 255, 0.4));
    animation: logoBreathe 2s infinite ease-in-out;
}

@keyframes logoBreathe {
    0%, 100% { transform: scale(1); opacity: 0.92; }
    50% { transform: scale(1.04); opacity: 1; }
}

.loader-status {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.loader-brand {
    color: var(--text-muted);
}

.loader-pct {
    color: var(--accent-blue);
    font-weight: 600;
}

.loader-bar-track {
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 99px;
    overflow: hidden;
}

.loader-bar-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--accent-blue), #38BDF8);
    box-shadow: 0 0 12px rgba(0, 163, 255, 0.8);
    transition: width 0.15s ease-out;
}

/* ================= STICKY TOP NAV ================= */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    padding: 16px var(--site-edge-x);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(180deg, rgba(7, 11, 20, 0.88) 0%, rgba(7, 11, 20, 0) 100%);
    pointer-events: none;
}

.nav-logo, .nav-actions {
    pointer-events: auto;
}

.nav-logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.nav-logo img {
    height: auto;
    width: auto;
    max-width: 100px;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.55));
    transition: transform 0.25s ease;
}

.nav-logo:hover img {
    transform: scale(1.03);
}

.btn-nav {
    padding: 10px 22px;
    border-radius: 999px;
    background: rgba(0, 163, 255, 0.14);
    border: 1px solid rgba(0, 163, 255, 0.45);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all 0.25s ease;
}

.btn-nav:hover {
    background: var(--accent-blue);
    box-shadow: 0 0 24px rgba(0, 163, 255, 0.5);
}

/* ================= HERO SCROLL TRACK ================= */
#hero-cinematic {
    position: relative;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    background: var(--bg-navy);
}

#hero-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    z-index: 1;
}

.hero-vignette {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background:
        radial-gradient(circle at center, transparent 42%, rgba(7, 11, 20, 0.72) 100%),
        linear-gradient(90deg, rgba(7, 11, 20, 0.82) 0%, rgba(7, 11, 20, 0.25) 55%, rgba(7, 11, 20, 0.48) 100%);
}

/* ================= SAFE-ZONE STORY STAGE (UNIFIED 1360PX RAIL) ================= */
.story-stage {
    position: absolute;
    inset: 0;
    z-index: 10;
    pointer-events: none;
    padding: var(--nav-safe-top) var(--site-edge-x) var(--hud-safe-bottom);
}

.story-beat {
    position: absolute;
    inset: var(--nav-safe-top) var(--site-edge-x) var(--hud-safe-bottom);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    will-change: transform, opacity;
}

.beat-inner {
    max-width: 620px;
    width: 100%;
}

.beat-1 {
    justify-content: flex-end;
    align-items: flex-start;
    padding-bottom: 2vh;
}

.beat-2 {
    justify-content: center;
    align-items: flex-start;
}

.beat-3 {
    justify-content: flex-end;
    align-items: flex-start;
    padding-bottom: 2vh;
}

.beat-4 {
    justify-content: flex-end;
    align-items: flex-end;
    text-align: right;
    padding-bottom: 2vh;
}

.beat-4 .beat-inner {
    max-width: 560px;
}

.beat-5 {
    justify-content: center;
    align-items: flex-start;
}

.beat-5 .beat-inner {
    max-width: 780px;
}

/* Base Typography & Glass UI */
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent-blue);
    background: rgba(0, 163, 255, 0.1);
    border: 1px solid rgba(0, 163, 255, 0.3);
    padding: 6px 14px;
    border-radius: 999px;
    margin-bottom: 14px;
    backdrop-filter: blur(10px);
}

.eyebrow.amber {
    color: var(--accent-amber);
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.35);
}

.hero-title {
    font-size: clamp(1.75rem, 3.6vw, 2.5rem);
    font-weight: 800;
    line-height: 1.06;
    letter-spacing: -0.03em;
    text-transform: uppercase;
    margin-bottom: 14px;
    text-shadow: 0 12px 32px rgba(0, 0, 0, 0.65);
}

.hero-title .highlight {
    background: linear-gradient(135deg, #FFFFFF 20%, #38BDF8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-sub {
    font-size: clamp(0.95rem, 1.2vw, 1.15rem);
    line-height: 1.55;
    color: #CBD5E1;
    margin-bottom: 20px;
    max-width: 500px;
}

.beat-4 .hero-sub {
    margin-left: auto;
}

/* Glassmorphic HUD Telemetry Cards */
.hud-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}

.beat-4 .hud-row {
    justify-content: flex-end;
}

.hud-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 12px 18px;
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.hud-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(1.15rem, 1.8vw, 1.45rem);
    font-weight: 600;
    color: #fff;
}

.hud-value span {
    color: var(--accent-blue);
}

.hud-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Dispatch Network SVG Overlay */
.dispatch-svg {
    position: absolute;
    right: var(--site-edge-x);
    top: 24%;
    width: min(460px, 42vw);
    opacity: 0;
    pointer-events: none;
    filter: drop-shadow(0 0 16px rgba(0, 163, 255, 0.55));
}

/* Final CTA Buttons */
.cta-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    pointer-events: auto;
}

.btn-primary {
    padding: 14px 28px;
    border-radius: 12px;
    background: linear-gradient(135deg, #00A3FF 0%, #0284C7 100%);
    color: #fff;
    font-weight: 700;
    font-size: 0.92rem;
    text-decoration: none;
    box-shadow: 0 10px 30px rgba(0, 163, 255, 0.4);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 36px rgba(0, 163, 255, 0.6);
}

.btn-secondary {
    padding: 14px 24px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-weight: 600;
    font-size: 0.92rem;
    text-decoration: none;
    backdrop-filter: blur(12px);
    transition: border-color 0.25s ease, background 0.25s ease;
}

.btn-secondary:hover {
    border-color: var(--accent-blue);
    background: rgba(0, 163, 255, 0.12);
}

/* Bottom Progress Bar & Scroll Cue (Aligned to 1360px Rail) */
.scroll-hud {
    position: absolute;
    bottom: 24px;
    left: var(--site-edge-x);
    right: var(--site-edge-x);
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    pointer-events: none;
}

.scroll-cue {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    color: var(--text-muted);
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 10px;
}

.scroll-line {
    width: 36px;
    height: 1px;
    background: var(--accent-blue);
    animation: pulseLine 1.8s infinite ease-in-out;
}

@keyframes pulseLine {
    0%, 100% { transform: scaleX(0.4); opacity: 0.4; }
    50% { transform: scaleX(1); opacity: 1; }
}

.progress-track {
    width: 180px;
    height: 3px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 99px;
    overflow: hidden;
}

.progress-fill {
    width: 0%;
    height: 100%;
    background: var(--accent-blue);
}

.next-section {
    min-height: 100vh;
    background: #070B14;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 80px var(--site-edge-x);
}

/* ================= STRICT DESKTOP (1025px AND ABOVE) ================= */
@media (min-width: 1025px) {
    .hero-title {
        font-size: clamp(1.75rem, 3.6vw, 2.5rem);
    }
}

/* ================= STRICT TABLET (769px TO 1024px) ================= */
@media (min-width: 769px) and (max-width: 1024px) {
    .dispatch-svg {
        display: none;
    }

    .beat-inner,
    .beat-4 .beat-inner,
    .beat-5 .beat-inner {
        max-width: 440px;
    }

    .eyebrow {
        font-size: 0.66rem;
        padding: 5px 11px;
        margin-bottom: 10px;
    }

    .hero-title {
        font-size: clamp(1.5rem, 3vw, 2.05rem);
        margin-bottom: 10px;
    }

    .hero-sub {
        font-size: 0.88rem;
        line-height: 1.5;
        margin-bottom: 14px;
        max-width: 400px;
    }

    .hud-card {
        padding: 9px 14px;
    }

    .hud-value {
        font-size: 1.05rem;
    }

    .hud-label {
        font-size: 0.65rem;
    }

    .btn-primary,
    .btn-secondary {
        padding: 11px 20px;
        font-size: 0.82rem;
    }
}

/* ================= STRICT MOBILE (MAX 768px - CENTERED & COMPACT) ================= */
@media (max-width: 768px) {
    :root {
        --nav-safe-top: 86px;
        --hud-safe-bottom: 62px;
        --site-edge-x: 5%;
    }

    .nav-logo img {
        max-width: 82px;
    }

    .btn-nav {
        padding: 8px 16px;
        font-size: 0.78rem;
    }

    .hero-vignette {
        background: radial-gradient(circle at center, rgba(7, 11, 20, 0.58) 0%, rgba(7, 11, 20, 0.84) 100%);
    }

    .story-beat,
    .beat-1,
    .beat-2,
    .beat-3,
    .beat-4,
    .beat-5 {
        inset: var(--nav-safe-top) 5% var(--hud-safe-bottom);
        justify-content: center;
        align-items: center;
        text-align: center;
        padding-top: 0;
        padding-bottom: 0;
    }

    .beat-inner,
    .beat-4 .beat-inner,
    .beat-5 .beat-inner {
        max-width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .eyebrow {
        font-size: 0.58rem;
        letter-spacing: 0.12em;
        padding: 4px 10px;
        margin-bottom: 8px;
    }

    .hero-title {
        font-size: clamp(1.25rem, 5.2vw, 1.6rem);
        line-height: 1.12;
        margin-bottom: 8px;
    }

    .hero-sub,
    .beat-4 .hero-sub {
        font-size: 0.8rem;
        line-height: 1.45;
        margin-left: auto;
        margin-right: auto;
        margin-bottom: 12px;
        max-width: 300px;
    }

    .hud-row,
    .beat-4 .hud-row {
        justify-content: center;
        gap: 8px;
    }

    .hud-card {
        padding: 8px 12px;
        border-radius: 10px;
    }

    .hud-value {
        font-size: 0.92rem;
    }

    .hud-label {
        font-size: 0.58rem;
    }

    .cta-group {
        justify-content: center;
        gap: 8px;
    }

    .btn-primary,
    .btn-secondary {
        padding: 9px 15px;
        font-size: 0.76rem;
        border-radius: 10px;
    }

    .scroll-hud {
        left: 5%;
        right: 5%;
    }

    .progress-track {
        width: 105px;
    }
}

/* ================= SHORT LANDSCAPE SCREENS (MAX-HEIGHT 650px) ================= */
@media (max-height: 650px) {
    :root {
        --nav-safe-top: 72px;
        --hud-safe-bottom: 48px;
    }

    .eyebrow {
        font-size: 0.6rem;
        margin-bottom: 6px;
        padding: 3px 9px;
    }

    .hero-sub {
        font-size: 0.78rem;
        line-height: 1.4;
        margin-bottom: 10px;
    }

    .hud-card {
        padding: 6px 11px;
    }

    .hud-value {
        font-size: 0.9rem;
    }

    .hud-label {
        font-size: 0.58rem;
    }

    .btn-primary,
    .btn-secondary {
        padding: 8px 14px;
        font-size: 0.75rem;
    }
}