:root {
    /* CORE PALETTE */
    --clr-bg-primary: #F5A623;
    /* Main Orange */
    --clr-bg-soft: #FFF3D6;
    /* Soft Light */
    --clr-bg-deep: #1A1206;
    /* Deep Contrast */

    /* ACCENTS */
    --clr-accent-gold: #FFC15E;
    /* Interactive */
    --clr-accent-amber: #E0A106;
    /* Buttons */
    --clr-accent-burnt: #C87B00;
    /* Depth*/

    /* TEXT */
    --clr-text-dark: #4B2C00;
    --clr-text-shadow: #2A1A05;
    --clr-text-warm-white: #FFF8E8;
    --clr-text-cream: #F2E3C2;
    --clr-text-muted: #BFAE8A;

    /* BORDERS */
    --clr-border-warm: #A67C00;

    /* FONTS */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* SPACING */
    --spacing-section-desktop: 120px;
    --spacing-section-mobile: 80px;

    /* GRADIENTS */
    --grad-primary: linear-gradient(135deg, #F5A623 0%, #FFC15E 100%);
    --grad-deep: linear-gradient(135deg, #1A1206 0%, #2A1A05 100%);
    --grad-button-hover: linear-gradient(to right, #FFC15E, transparent);
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--clr-bg-primary);
    color: var(--clr-text-dark);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* CUSTOM CURSOR (Desktop Only) */
@media (hover: hover) and (pointer: fine) {
    body {
        cursor: url('/img/cursor-poop.svg'), auto;
    }

    a,
    button,
    .gallery-item,
    .lightbox-close {
        cursor: url('/img/cursor-poop.svg'), pointer;
        /* Fallback or same custom pointer if available */
    }
}

body.loading {
    overflow: hidden;
}

/* UTILS */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 5vw;
    padding-left: max(5vw, env(safe-area-inset-left));
    padding-right: max(5vw, env(safe-area-inset-right));
}

.centered {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.medium-width {
    max-width: 800px;
}

/* GLOBAL VIDEO -> HERO VIDEO */
.hero-section {
    position: relative;
    overflow: hidden;
    /* Contain video */
    /* Optimized rendering layer */
    transform: translateZ(0);
}

.video-bg-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    height: 100vh;
    /* Fallback */
    height: 100dvh;
    /* Mobile browser address bar fix */
    z-index: 0;
    pointer-events: none;
    mix-blend-mode: overlay;
    /* Accecnt blend */
    opacity: 0.3;
    /* Subtle accent */
    will-change: opacity;
}

.bg-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    backface-visibility: hidden;
    /* Performance */
}

.bg-fallback {
    display: none;
    /* No fallback needed inside colored hero */
}

/* LOADER */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--clr-bg-primary);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 1.5s ease;
}

.loader-container {
    width: 300px;
    height: 200px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.loader-video-wrapper {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
    background: #000;
}

.loader-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.loader-bar-bg {
    width: 100%;
    height: 4px;
    /* Slightly thicker */
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
}

.loader-bar-fill {
    width: 0%;
    height: 100%;
    background: #FFFFFF;
    transition: width 0.1s linear;
}

/* NAVBAR */
.navbar {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 0;
    z-index: 100;
    transition: transform 0.3s ease;
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 5vw;
}

.logo {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--clr-text-warm-white);
    text-decoration: none;
    text-transform: uppercase;
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-link {
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--clr-text-warm-white);
    text-decoration: none;
}

.nav-link:hover {
    color: var(--clr-accent-gold);
}

.copy-btn {
    background: transparent;
    border: none;
    color: var(--clr-text-warm-white);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    cursor: pointer;
}

.tooltip {
    position: absolute;
    top: 120%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--clr-bg-deep);
    color: var(--clr-accent-gold);
    padding: 4px 10px;
    border-radius: 2px;
    font-size: 0.75rem;
    font-weight: bold;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.tooltip.show {
    opacity: 1;
}

/* SECTIONS (RHYTHM) */
section {
    padding: var(--spacing-section-desktop) 0;
}

/* HERO (Orange Gradient) */
.hero-section {
    min-height: 90vh;
    display: flex;
    align-items: center;
    padding: 0;
    background: var(--grad-primary);
    color: var(--clr-text-warm-white);
}

.hero-container {
    position: relative;
    z-index: 1;
    /* Above video */
}

.hero-title {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: clamp(3rem, 7vw, 6rem);
    line-height: 1.1;
    text-transform: uppercase;
    margin-bottom: 40px;
}

.hero-subcopy {
    font-size: 1.125rem;
    max-width: 650px;
    margin-bottom: 50px;
    opacity: 0.95;
}

/* BUTTONS */
.cta-group {
    display: flex;
    gap: 20px;
}

.btn {
    padding: 16px 32px;
    border-radius: 4px;
    font-family: var(--font-heading);
    font-weight: 700;
    text-transform: uppercase;
    text-align: center;
    text-decoration: none;
    min-width: 160px;
    transition: all 0.2s ease;
}

.btn.primary {
    background: var(--clr-accent-amber);
    color: var(--clr-bg-deep);
    /* Dark Text on Amber */
}

.btn.primary:hover {
    background: var(--clr-accent-gold);
}

.btn.secondary {
    border: 1px solid var(--clr-text-warm-white);
    color: var(--clr-text-warm-white);
}

.btn.secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* MARQUEE (Deep Contrast) */
.marquee-section {
    padding: 60px 0;
    background: var(--clr-bg-deep);
    border-top: 1px solid var(--clr-border-warm);
    border-bottom: 1px solid var(--clr-border-warm);
    overflow: hidden;
}

.marquee-track {
    white-space: nowrap;
    overflow: hidden;
}

.marquee-content {
    display: inline-block;
    animation: marquee 30s linear infinite;
}

.marquee-content span {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 2rem;
    text-transform: uppercase;
    margin: 0 40px;
    color: var(--clr-text-cream);
    opacity: 0.8;
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* LORE (Soft Light Background) */
.lore-section {
    background: var(--clr-bg-soft);
    color: var(--clr-text-dark);
}

.lore-section p {
    font-size: 1.25rem;
    max-width: 700px;
    margin-bottom: 30px;
}

.archive-block {
    margin-top: 60px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lore-image {
    max-width: 100%;
    width: 600px;
    height: auto;
    border-radius: 4px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--clr-border-warm);
}

.tweet-container {
    width: 100%;
    max-width: 500px;
    /* Standard tweet width */
    margin-bottom: 40px;
    min-height: 200px;
    /* Prevent layout shift during load */
    display: flex;
    justify-content: center;
}

.divider {
    width: 60px;
    height: 2px;
    background: var(--clr-border-warm);
    margin: 0 auto 40px;
    opacity: 0.5;
}

.label {
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    display: block;
    margin-bottom: 10px;
    color: var(--clr-text-muted);
}

.archive-link {
    font-family: monospace;
    color: var(--clr-text-dark);
    text-decoration: underline;
}

/* GALLERY (Soft Light) */
.gallery-section {
    padding: var(--spacing-section-desktop) 0;
    overflow: hidden;
    background: var(--clr-bg-soft);
}

.gallery-track-wrapper {
    margin-bottom: 30px;
    overflow: hidden;
    white-space: nowrap;
}

.gallery-track {
    display: inline-flex;
    gap: 20px;
}

.gallery-item {
    width: 320px;
    height: 220px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
    cursor: pointer;
    transition: transform 0.2s;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-item:hover {
    transform: scale(1.02);
}

.scroll-left {
    animation: scrollLeft 60s linear infinite;
}

.scroll-right {
    animation: scrollRight 60s linear infinite;
}

@keyframes scrollLeft {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

@keyframes scrollRight {
    0% {
        transform: translateX(-50%);
    }

    100% {
        transform: translateX(0);
    }
}

/* CHART (Warm Neutral / Light) */
.chart-section {
    background: var(--clr-bg-primary);
    /* Prompt: Warm Light OR Subtle Contrast. Let's use Primary as per list */
    color: var(--clr-text-warm-white);
}

.chart-container {
    width: 100%;
    max-width: 1000px;
    aspect-ratio: 16/9;
    background: var(--clr-bg-deep);
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid var(--clr-border-warm);
}

.chart-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.section-label {
    font-family: var(--font-heading);
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 40px;
    display: block;
}

/* WHY (Primary) */
.why-section {
    background: var(--clr-bg-primary);
    color: var(--clr-text-warm-white);
}

.impact-text {
    font-family: var(--font-heading);
    font-size: 2rem;
    line-height: 1.4;
}

.highlight {
    color: var(--clr-bg-deep);
}

/* Contrast on Orange */

/* CTA (Rich Amber / Gradient) */
.cta-section {
    background: var(--grad-primary);
    color: var(--clr-text-warm-white);
}

.cta-title {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 3rem;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.cta-text {
    font-size: 1.25rem;
    margin-bottom: 60px;
    /* Increased spacing */
    opacity: 0.95;
    max-width: 600px;
}

/* FOOTER (Deep Contrast) */
footer {
    background: var(--grad-deep);
    color: var(--clr-text-muted);
    border-top: 1px solid var(--clr-border-warm);
    padding: 60px 0;
    margin-top: 0;
    /* Connected to CTA */
}

.footer-links {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

.footer-links a {
    color: var(--clr-text-cream);
    text-decoration: none;
    opacity: 0.7;
}

/* LIGHTBOX */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 18, 6, 0.95);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.lightbox.active {
    opacity: 1;
    pointer-events: all;
}

.lightbox-img {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 30px;
    right: 30px;
    font-size: 3rem;
    color: var(--clr-accent-gold);
    cursor: pointer;
}

/* HIDE MOBILE MENU ON DESKTOP (Fix Duplicate Navbar) */
.hamburger-btn,
.mobile-menu {
    display: none;
}

/* MOBILE OPTIMIZATION */
@media (max-width: 768px) {
    :root {
        --spacing-section-desktop: 60px;
        /* More compact on mobile */
    }

    /* GLOBAL MOBILE TWEAKS */
    html,
    body {
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        /* Smooth iOS scroll */
    }

    /* NAVBAR & MOBILE MENU */
    .desktop-links {
        display: none;
    }

    .hamburger-btn {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 30px;
        height: 20px;
        background: transparent;
        border: none;
        cursor: pointer;
        z-index: 200;
        /* Above everything in nav */
        padding: 0;
    }

    .hamburger-btn span {
        width: 100%;
        height: 2px;
        background: var(--clr-text-warm-white);
        transition: all 0.3s ease;
    }

    /* Active Hamburger State */
    .hamburger-btn.active span:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }

    .hamburger-btn.active span:nth-child(2) {
        transform: translateY(-9px) rotate(-45deg);
    }

    .nav-wrapper {
        padding: 0 5vw;
        position: relative;
        z-index: 200;
        /* Keep logo and burger above menu */
    }

    .mobile-menu {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: var(--clr-bg-deep);
        /* Dark theme for menu */
        z-index: 150;
        display: flex;
        align-items: center;
        justify-content: center;
        transform: translateY(-100%);
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        padding-top: 60px;
        /* Check safe area */
    }

    .mobile-menu.active {
        transform: translateY(0);
    }

    .mobile-nav-links {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 30px;
    }

    .mobile-link {
        font-family: var(--font-heading);
        font-size: 2rem;
        color: var(--clr-text-warm-white);
        text-decoration: none;
        text-transform: uppercase;
        font-weight: 800;
        opacity: 0;
        transform: translateY(20px);
        transition: all 0.3s ease;
    }

    .mobile-menu.active .mobile-link {
        opacity: 1;
        transform: translateY(0);
        /* Stagger in JS or CSS delay */
    }

    .logo {
        font-size: 1.2rem;
        position: relative;
        z-index: 200;
    }

    .copy-btn {
        font-size: 0.8rem;
        position: relative;
        z-index: 200;
    }

    /* TYPOGRAPHY SCALING */
    .hero-title,
    .cta-title {
        font-size: 3rem;
        line-height: 1.1;
    }

    .hero-subcopy {
        font-size: 1rem;
        margin-bottom: 30px;
    }

    .impact-text {
        font-size: 1.5rem;
    }

    /* ANIMATIONS */
    /* Reduce motion intensity */
    * {
        transition: all 0.2s ease !important;
    }

    .scroll-left,
    .scroll-right {
        animation-duration: 40s !important;
    }

    /* Slower marquee */

    /* CHART - PORTRAIT MODE */
    .chart-container {
        width: 100%;
        max-width: 100%;
        aspect-ratio: auto;
        height: 75vh;
        min-height: 520px;
        border-radius: 0;
        /* Full bleed feel usually better or small radius */
        border-left: none;
        border-right: none;
    }

    /* FOOTER & BUTTONS - STACKED & TOUCH FRIENDLY */
    .footer-links,
    .cta-group {
        flex-direction: column;
        width: 100%;
        max-width: 400px;
        /* Constraint width */
        gap: 16px;
    }

    .footer-links a,
    .btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        min-height: 48px;
        /* Tap Target */
        padding: 16px 20px;
        font-size: 1rem;
        background: rgba(255, 255, 255, 0.05);
        /* Footer link bg */
        border: 1px solid var(--clr-border-warm);
        border-radius: 4px;
        text-align: center;
        opacity: 1;
        /* Full visibility */
        margin: 0;
    }

    /* Specific override for CTA buttons which already have styles */
    .btn.primary {
        background: var(--clr-accent-amber);
        border: none;
        color: var(--clr-bg-deep);
    }

    .btn.secondary {
        background: transparent;
        border: 1px solid var(--clr-text-warm-white);
        color: var(--clr-text-warm-white);
    }

    .footer-links a {
        color: var(--clr-text-cream);
        text-decoration: none;
    }

    /* GALLERY */
    .gallery-item {
        width: 240px;
        /* Smaller items */
        height: 160px;
    }

    /* Re-enable video for mobile (User Request) -> REVERTED: Stability First */
    .bg-video,
    .loader-video {
        display: none !important;
    }

    .bg-fallback {
        opacity: 1 !important;
        background: var(--clr-bg-primary);
        /* Solid color fallback */
        /* Optional: Add a subtle pattern or gradient if desired */
        background: var(--grad-primary);
    }

    /* MOBILE SAFETY: FORCE VISIBILITY */
    .hero-title,
    .hero-subcopy,
    .cta-group,
    .text-block,
    .archive-block,
    .impact-text,
    .cta-title {
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        transition: none !important;
        /* Remove delay */
        -webkit-text-fill-color: initial;
        /* Reset Safari clip */
        color: var(--clr-text-warm-white);
    }

    .hero-container,
    .cta-container {
        z-index: 50 !important;
    }

    /* LORE TEXT COLOR FIX */
    .lore-section .text-block,
    .lore-section .text-block p,
    .lore-section .archive-block,
    .lore-section .label,
    .lore-section .archive-link {
        color: #4B2C00 !important;
    }
}

/* FIXES FOR HERO TEXT VISIBILITY & LOADER */
.hero-container {
    position: relative;
    z-index: 20;
    /* Boost z-index */
    display: flex !important;
    /* Force flex */
    flex-direction: column;
}

.hero-title,
.hero-subcopy,
.cta-group {
    /* Prevent Safari rendering bugs */
    transform: translate3d(0, 0, 0);
    /* HW accel but safe */
    position: relative;
    z-index: 21;
}

.loader-video-wrapper {
    background: transparent;
    /* Remove black box if video fails/loads */
}