/* ==========================================================
   G.A.S. MASTER FIX v1.0
   Forces mobile symmetry and resolves known production bugs.
   ========================================================== */

@media screen and (max-width: 980px) {

    /* HEADER REDUCTION - DEVASTATINGLY SPECIFIC FORCE */
    html body #header,
    html body #header .header-container,
    html body #header #logo,
    html body #header #logo a {
        height: 52px !important;
        min-height: 52px !important;
        max-height: 52px !important;
        line-height: 52px !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }

    html body #header {
        padding: 0 1rem !important;
    }

    /* RESTORE LADY JUSTICE TO HERO (User Request) */
    /* Use position: absolute within #hero to keep it in place and prevent leakage to other sections */
    #hero #morph-container,
    #hero #justiceCanvas {
        display: block !important;
        visibility: visible !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        z-index: 5 !important;
        /* Above hero background/overlay (z=1) but below content (z=10) */
        opacity: 0.15 !important;
        /* v7.0 Subliminal Presence - Ghostly and sophisticated */
        pointer-events: none !important;
    }

    #hero {
        position: relative !important;
        z-index: 5 !important;
        overflow: hidden !important;
    }

    /* SOTA VERTICAL CENTERING ENGINE v3.0 (Zero-Gravity Cleanup) */
    /* Neutralize ALL legacy heights/margins to let flex-grow spacers work */
    html body #hero,
    html body section#hero,
    html body #banner {
        display: flex !important;
        flex-direction: column !important;
        min-height: 100svh !important;
        max-height: 100svh !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow: hidden !important;
        /* Restore DESKTOP standard background */
        background-color: var(--gas-navy) !important;
        background-image: url("assets/hero-bg.webp") !important;
        background-size: cover !important;
        background-position: center 25% !important;
        background-attachment: scroll !important;
        /* Root Fix: 'fixed' fails on mobile */
        position: relative !important;
    }

    /* Neutralize all legacy pseudo-element overlays AND RESTORE DESKTOP AESTHETIC */
    html body #hero:before,
    html body section#hero:before,
    html body #banner:before {
        content: "" !important;
        display: block !important;
        position: absolute !important;
        inset: 0 !important;
        /* Mirroring Desktop "Dual Layer Elite Overlay" from global.css */
        background: radial-gradient(circle at center, rgba(5, 10, 20, 0.45) 0%, rgba(5, 10, 20, 0.85) 100%),
            linear-gradient(to bottom, transparent 70%, #050a14 100%) !important;
        backdrop-filter: blur(1.5px) !important;
        z-index: 1 !important;
        pointer-events: none !important;
    }

    html body #hero:after,
    html body section#hero:after,
    html body #banner:after {
        display: none !important;
        content: none !important;
        background: none !important;
    }

    /* Neutralize grid-system conflicts */
    html body .hero-grid-system,
    html body #hero .hero-grid-system,
    html body .hero-col-content,
    html body #hero .hero-col-content {
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        padding: 0 !important;
        margin: 0 !important;
        flex: 0 0 auto !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* Atomic Content Group - The actual unit being centered */
    .hero-content-group {
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0 1.25rem !important;
        gap: clamp(1.25rem, 5vh, 2.5rem) !important;
        text-align: center !important;
        z-index: 10 !important;
        position: relative !important;
    }

    /* Dynamic flex-grow spacers - these provide the only source of gravity */
    .hero-flex-grow {
        flex: 1 1 auto !important;
        min-height: 20px !important;
        /* Safety floor */
    }

    /* Fluid Typography Engine (Atomic Group Scope) */
    .hero-claim {
        font-size: clamp(1.2rem, 5.8vw, 1.7rem) !important;
        margin: 0 !important;
        padding: 0 !important;
        line-height: 1.1 !important;
        max-width: 95% !important;
    }

    .hero-authority {
        font-size: clamp(0.75rem, 2.2vw, 0.85rem) !important;
        margin: 0 !important;
        padding: 0 !important;
        opacity: 0.85 !important;
        line-height: 1.35 !important;
    }

    .hero-profile-block {
        padding: clamp(0.7rem, 2vh, 0.9rem) !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: 380px !important;
        border-radius: 12px !important;
        background: rgba(255, 255, 255, 0.02) !important;
        backdrop-filter: blur(8px) !important;
    }

    .profile-name {
        font-size: clamp(0.9rem, 2.8vw, 1.05rem) !important;
    }

    .hero-actions {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        max-width: 380px !important;
        gap: 0.65rem !important;
        margin: 0 !important;
    }

    .hero-actions .button {
        width: 100% !important;
        padding: 0.75rem !important;
        font-size: 0.8rem !important;
    }

    /* REDUNDANT RULES SUPPRESSED */
    .hero-spacer-top,
    .hero-col-visual {
        display: none !important;
    }

    /* LADY JUSTICE BACKGROUND RESTORATION */
    #hero #morph-container,
    #hero #justiceCanvas {
        display: block !important;
        visibility: visible !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        z-index: 5 !important;
        opacity: 0.85 !important;
        pointer-events: none !important;
    }

    /* DOUBLE MENU RESOLUTION */
    #header .toggle {
        display: none !important;
        width: 44px !important;
        height: 44px !important;
        position: absolute !important;
        top: 4px !important;
        right: 15px !important;
        z-index: 10001 !important;
    }

    #header .toggle:last-of-type {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    #header .toggle:before {
        content: '\f0c9' !important;
        font-family: 'Font Awesome 5 Free' !important;
        font-weight: 900 !important;
        font-size: 1.25rem !important;
        color: var(--gas-gold) !important;
    }

    /* ELITE SIDEBAR MENU REDESIGN (#navPanel) */
    html body #navPanel {
        background: rgba(5, 10, 20, 0.98) !important;
        /* Deepest Midnight */
        backdrop-filter: blur(15px) !important;
        border-left: 0 !important;
        /* Isolated in .navPanel-visible */
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.8) !important;
        padding: 2rem 1.5rem !important;
        width: 18em !important;
        transform: translateX(-100%) !important;
        /* Force hide fully off-screen */
        -webkit-transform: translateX(-100%) !important;
    }

    /* Active State & Border Isolation Fix v3.4 */
    body.navPanel-visible #navPanel {
        border-right: 1px solid rgba(184, 134, 11, 0.3) !important;
        /* Use border-right since it slides from left */
        transform: translateX(0) !important;
        -webkit-transform: translateX(0) !important;
    }

    html body #navPanel nav {
        display: flex !important;
        flex-direction: column !important;
        gap: 1rem !important;
    }

    html body #navPanel ul {
        list-style: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    html body #navPanel li {
        margin-bottom: 0.75rem !important;
    }

    html body #navPanel .link,
    html body #navPanel a {
        display: block !important;
        padding: 1rem 1.25rem !important;
        background: rgba(10, 17, 40, 0.6) !important;
        /* Corporate Navy */
        border: 1px solid rgba(184, 134, 11, 0.15) !important;
        border-radius: 8px !important;
        color: var(--gas-white) !important;
        font-family: var(--gas-font-mono) !important;
        /* IBM Plex Mono */
        font-size: 0.9rem !important;
        font-weight: 400 !important;
        text-transform: uppercase !important;
        letter-spacing: 0.1em !important;
        text-decoration: none !important;
        transition: all 0.3s ease !important;
        position: relative !important;
        overflow: hidden !important;
        border-left: 4px solid transparent !important;
        height: auto !important;
        line-height: 1.2 !important;
    }

    html body #navPanel a:hover,
    html body #navPanel a:active {
        background: rgba(184, 134, 11, 0.1) !important;
        border-color: var(--gas-gold) !important;
        border-left-color: var(--gas-gold) !important;
        color: var(--gas-gold-light) !important;
        padding-left: 1.5rem !important;
        /* Slight push on hover */
    }

    /* Neutralize generic template dot/bullet styles */
    html body #navPanel b,
    html body #navPanel .indent {
        display: none !important;
    }

    /* Fix logo overflow & scale for 52px header */
    #logo a {
        font-size: clamp(0.7rem, 3.2vw, 0.85rem) !important;
        letter-spacing: 0.01rem !important;
        max-width: 65vw !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        display: block !important;
        white-space: nowrap !important;
    }
}