/* --- RESET & BASE --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

html {
    font-size: 16px;
    background-color: var(--bg-void);
    color-scheme: dark;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-void);
    color: var(--text-primary);
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    position: relative;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background: var(--accent);
    color: #000;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 7px;
}
::-webkit-scrollbar-track {
    background: rgba(8, 8, 12, 0.85);
}
::-webkit-scrollbar-thumb {
    background: rgba(249, 115, 22, 0.35);
    border-radius: var(--radius-pill);
    border: 1px solid rgba(255, 255, 255, 0.05);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* --- CINEMATIC RUST VIDEO BACKGROUND (FULLY RESTORED & PROMINENT) --- */
.video-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    opacity: 0.55;
    pointer-events: none;
}

.video-bg video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(1.15) brightness(0.9);
}

.video-overlay {
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(circle at 50% 30%, rgba(4, 4, 6, 0.2) 0%, rgba(4, 4, 6, 0.8) 75%),
        linear-gradient(180deg, rgba(4, 4, 6, 0.7) 0%, rgba(4, 4, 6, 0.15) 30%, rgba(4, 4, 6, 0.75) 75%, #040406 100%);
}

.bg-gradient {
    position: fixed;
    inset: 0;
    background: #040406;
    z-index: -2;
    pointer-events: none;
}

.bg-effects {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.bg-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(130px);
    opacity: 0.14;
    will-change: transform;
    animation: floatingOrb 18s ease-in-out infinite alternate;
}

.blob-1 {
    top: -5%;
    right: 5%;
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, #f97316 0%, #ea580c 60%, transparent 80%);
}

.blob-2 {
    bottom: 5%;
    left: -5%;
    width: 750px;
    height: 750px;
    background: radial-gradient(circle, #dc2626 0%, #7f1d1d 60%, transparent 80%);
    animation-delay: -6s;
}

@keyframes floatingOrb {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(40px, -60px) scale(1.08); }
    100% { transform: translate(-30px, 40px) scale(0.95); }
}

/* Subtle tech grid */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: 
        linear-gradient(to right, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 60px 60px;
    z-index: 1;
    pointer-events: none;
    mask-image: radial-gradient(circle at center, black 40%, transparent 90%);
}

/* Ensure all page content is above video */
.navbar,
.hero,
section,
footer,
.modal-overlay,
.community-overlay,
.welcome-notification-overlay {
    position: relative;
    z-index: 2;
}

/* --- SCROLL PROGRESS --- */
.scroll-progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 10001;
    pointer-events: none;
    background: rgba(255, 255, 255, 0.03);
}

.scroll-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ea580c, #f97316, #fb923c);
    box-shadow: 0 0 14px var(--accent);
    transition: width 0.08s ease-out;
}

/* --- PRELOADER --- */
#preloader {
    position: fixed;
    inset: 0;
    background: #030305;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.8s;
}

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

.loader-content {
    width: 320px;
    text-align: center;
    position: relative;
}

.glitch-text {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 900;
    letter-spacing: 4px;
    color: #fff;
    text-transform: uppercase;
    margin-bottom: 24px;
    text-shadow: 0 0 20px rgba(249, 115, 22, 0.6);
}

.loader-status-row {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 1.5px;
    margin-bottom: 10px;
}

.loading-bar-container {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-pill);
    overflow: hidden;
}

.loading-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ea580c, #f97316);
    box-shadow: 0 0 15px var(--accent);
    border-radius: var(--radius-pill);
    transition: width 0.15s linear;
}

