/* ═══════════════════════════════════════════════════════════════
   6AM MAFIA CREW — CSS STYLESHEET
   Brutalist Dark Aesthetics & High-Performance Layout
   ═══════════════════════════════════════════════════════════════ */

:root {
    --bg-color: #000000;
    --text-primary: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.6);
    --border-color: rgba(255, 255, 255, 0.15);

    --accent-white: #ffffff;
    --accent-silver: #d4d4d4;
    --accent-gray: rgba(255, 255, 255, 0.4);

    --font-title: 'Arial Black', 'Impact', 'Montserrat', sans-serif;
    --font-body: 'DotGothic16', 'Space Mono', monospace;
    --font-mono: 'DotGothic16', 'Space Mono', monospace;

    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: auto; /* Raw scroll for lerp */
    overflow-x: hidden;
}

body {
    background-color: var(--bg-color);
    overflow-x: hidden;
    cursor: crosshair;
}

/* ══════════════════════════════════════════════
   1. FIXED WEBGL CANVAS
   ══════════════════════════════════════════════ */
#webgl-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    pointer-events: none;
}

/* ══════════════════════════════════════════════
   2. SCROLL SPACER (Drives 850vh Timeline)
   ══════════════════════════════════════════════ */
#scroll-spacer {
    height: 850vh;
    position: relative;
    pointer-events: none;
    z-index: 0;
}

/* ══════════════════════════════════════════════
   3. PROGRESS BAR
   ══════════════════════════════════════════════ */
#progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.08);
}

#progress-bar-fill {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.2), #ffffff);
    transform-origin: left;
    transform: scaleX(0);
    transition: transform 0.05s linear;
}

/* ══════════════════════════════════════════════
   4. HEADER & NAVIGATION
   ══════════════════════════════════════════════ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 24px 36px;
    z-index: 500;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
}

.header > * {
    pointer-events: auto;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
}

.header-logo {
    height: 28px;
    width: auto;
}

.brand-badge {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 28px;
}

.header-clocks {
    display: flex;
    align-items: center;
    gap: 16px;
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.clock-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.clock-city {
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
}

.clock-val {
    color: var(--text-primary);
    font-weight: 700;
}

.clock-sep {
    color: rgba(255, 255, 255, 0.2);
}

/* Sound Button with Equalizer Bars */
.sound-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 8px 16px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: background 0.3s, border-color 0.3s;
}

.sound-btn:hover {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.12);
}

.eq-bars {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 12px;
}

.eq-bar {
    width: 2px;
    height: 4px;
    background: var(--text-muted);
    transition: height 0.2s;
}

.sound-btn.is-active .eq-bar {
    background: #ffffff;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
    animation: eqBounce 0.8s ease-in-out infinite alternate;
}

.sound-btn.is-active .eq-bar:nth-child(1) { animation-delay: 0.1s; }
.sound-btn.is-active .eq-bar:nth-child(2) { animation-delay: 0.3s; }
.sound-btn.is-active .eq-bar:nth-child(3) { animation-delay: 0.5s; }

@keyframes eqBounce {
    0% { height: 3px; }
    100% { height: 12px; }
}

/* ══════════════════════════════════════════════
   5. SIDEBAR NAVIGATION DOTS
   ══════════════════════════════════════════════ */
.sidebar-nav {
    position: fixed;
    right: 36px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 500;
    display: flex;
    flex-direction: column;
    gap: 14px;
    pointer-events: auto;
}

.law-nav-dot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 0;
}

.dot-label {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.35);
    opacity: 0;
    transform: translateX(10px);
    transition: opacity 0.3s, transform 0.3s, color 0.3s;
    pointer-events: none;
}

.dot-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    transition: background 0.3s, transform 0.3s, box-shadow 0.3s;
}

.law-nav-dot:hover .dot-label,
.law-nav-dot.is-active .dot-label {
    opacity: 1;
    transform: translateX(0);
}

.law-nav-dot.is-active .dot-label {
    color: #ffffff;
    font-weight: 700;
}

.law-nav-dot.is-active .dot-indicator {
    background: #ffffff;
    transform: scale(1.6);
    box-shadow: 0 0 12px #ffffff;
}

/* ══════════════════════════════════════════════
   6. LAW OVERLAYS (FULLSCREEN LAYOUTS)
   ══════════════════════════════════════════════ */
.law-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    padding: 0 24px;
    transition: opacity 0.45s var(--ease-out), transform 0.45s var(--ease-out);
}

.law-card {
    max-width: 880px;
    width: 100%;
    background: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    border-radius: 0;
    padding: 0;
    position: relative;
    box-shadow: none;
}

/* Card Header */
.law-tag-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.law-tag {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: #ffffff;
    opacity: 0.75;
}

.law-tag--cyan,
.law-tag--pink,
.law-tag--volt { color: #ffffff; opacity: 0.75; }

.law-number-box {
    font-family: var(--font-mono);
    font-size: 13px;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 2px;
}

/* Law Typography */
.law-title {
    font-family: var(--font-title);
    font-size: clamp(2.2rem, 5.2vw, 3.8rem);
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    margin-bottom: 20px;
    color: #ffffff;
}

.law-subtitle {
    font-family: var(--font-body);
    font-size: clamp(1rem, 1.4vw, 1.25rem);
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.5;
    margin-bottom: 24px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.law-body {
    font-family: var(--font-body);
    font-size: clamp(0.95rem, 1.25vw, 1.15rem);
    color: rgba(242, 240, 235, 0.85);
    line-height: 1.85;
    letter-spacing: 0.5px;
    margin-bottom: 32px;
    max-width: 800px;
}

.law-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    border-top: none;
    padding-top: 12px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* ══════════════════════════════════════════════
   GLOWING TITLE PARTICLE ASSEMBLY
   ══════════════════════════════════════════════ */
.char-particle {
    display: inline-block;
    position: relative;
    opacity: 0;
    transform: translate3d(var(--rx, 0px), var(--ry, 0px), var(--rz, 0px)) scale(var(--rscale, 0.15));
    filter: blur(14px) brightness(3.0);
    transition: 
        transform 0.9s cubic-bezier(0.16, 1, 0.3, 1),
        opacity 0.7s ease-out,
        filter 0.85s cubic-bezier(0.16, 1, 0.3, 1),
        color 0.6s ease,
        text-shadow 0.6s ease;
    transition-delay: calc(var(--char-index, 0) * 0.024s);
    will-change: transform, opacity, filter;
    color: var(--glow-color, var(--accent-gold));
    text-shadow: 
        0 0 25px var(--glow-color, var(--accent-gold)),
        0 0 50px var(--glow-color, var(--accent-gold)),
        0 0 80px var(--glow-color, var(--accent-gold));
}

.char-space {
    display: inline-block;
    width: 0.35em;
}

/* State when Law Overlay is Active */
.law-overlay.is-active .char-particle {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
    filter: blur(0px) brightness(1);
    color: #ffffff;
    text-shadow: 
        0 0 12px rgba(255, 255, 255, 0.8),
        0 0 24px var(--glow-color, var(--accent-gold)),
        0 0 45px var(--glow-color, var(--accent-gold));
}

/* Glowing neon particle dot that converges into each letter */
.char-particle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    margin: -4px 0 0 -4px;
    border-radius: 50%;
    background: var(--glow-color, var(--accent-gold));
    box-shadow: 
        0 0 14px var(--glow-color, var(--accent-gold)),
        0 0 28px #fff;
    opacity: 1;
    transform: scale(2.0);
    transition: opacity 0.5s ease 0.45s, transform 0.5s ease 0.45s;
    pointer-events: none;
}

.law-overlay.is-active .char-particle::before {
    opacity: 0;
    transform: scale(0);
}

/* ══════════════════════════════════════════════
   7. INTRO & OUTRO OVERLAYS
   ══════════════════════════════════════════════ */
.intro-content {
    text-align: center;
    max-width: 900px;
}

.intro-pre {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 6px;
    color: var(--accent-gold);
    text-transform: uppercase;
    margin-bottom: 24px;
    display: block;
}

.intro-title {
    font-family: var(--font-title);
    font-size: clamp(2.8rem, 7.5vw, 6.2rem);
    font-weight: 900;
    line-height: 0.95;
    letter-spacing: -0.03em;
    text-transform: uppercase;
    margin-bottom: 32px;
    background: linear-gradient(180deg, #ffffff 40%, rgba(255, 255, 255, 0.4) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.intro-desc {
    font-family: var(--font-body);
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.85;
    letter-spacing: 0.5px;
    max-width: 640px;
    margin: 0 auto 40px;
}

.scroll-indicator {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 4px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.scroll-indicator::after {
    content: '↓';
    animation: bounceDown 1.4s ease-in-out infinite;
}

@keyframes bounceDown {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}

/* ── Outro Join Box ── */
.join-card {
    text-align: center;
    max-width: 700px;
    background: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

.join-form {
    display: flex;
    gap: 12px;
    margin-top: 32px;
}

.join-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 30px;
    padding: 16px 24px;
    color: #fff;
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 1px;
    transition: border-color 0.3s;
}

.join-input:focus {
    outline: none;
    border-color: var(--accent-gold);
}

.join-btn {
    background: var(--accent-gold);
    color: #000;
    border: none;
    border-radius: 30px;
    padding: 0 32px;
    font-family: var(--font-title);
    font-weight: 900;
    font-size: 13px;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
}

.join-btn:hover {
    background: #ffb338;
    transform: translateY(-2px);
}

/* ══════════════════════════════════════════════
   8. LOADER SCREEN
   ══════════════════════════════════════════════ */
#loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--bg-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    transition: opacity 0.8s var(--ease-out);
}

.loader-brand {
    font-family: var(--font-mono);
    font-size: 13px;
    letter-spacing: 6px;
    text-transform: uppercase;
    color: var(--text-primary);
}

.loader-counter {
    font-family: var(--font-mono);
    font-size: 28px;
    font-weight: 700;
    color: var(--accent-gold);
}

/* ══════════════════════════════════════════════
   9. RESPONSIVE DESIGN
   ══════════════════════════════════════════════ */
@media (max-width: 768px) {
    .header {
        padding: 16px 20px;
    }

    .header-clocks {
        display: none;
    }

    .sidebar-nav {
        right: 16px;
    }

    .dot-label {
        display: none;
    }

    .law-card {
        padding: 32px 24px;
        margin: 0 12px;
    }

    .join-form {
        flex-direction: column;
    }

    .join-btn {
        padding: 16px;
    }
}
