/* ==========================================================================
   FILE: SCREEN.CSS (CORE STYLESHEET)
   ROLE: Central Design System & Responsive Logic.
   
   FUNCTION: 
   Defines the site's visual identity (colors, fonts), desktop layout frames, 
   atmospheric SVG animations, and the comprehensive "Density Pass" in 
   Section 12 which handles all Mobile & Tablet adjustments.
   ========================================================================== */

:root {
    /* Color Palette & Identity Tokens */
    --bg: #000000;                      /* Primary background */
    --fg: #F5F5F5;                      /* Primary text color */
    --dim: #666666;                     /* Muted/Secondary text */
    --border: rgba(255, 255, 255, 0.12);/* Semi-transparent tactical borders */
    --accent: #E0E0E0;                  /* Description text color */
    
    /* Typography Tokens */
    --font-main: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    /* System Status Indicators */
    --status-red: #a33b3b;
    --status-red-glow: rgba(163, 59, 59, 0.6);
    --status-green: #4b6b4b;
    --status-green-glow: rgba(75, 107, 75, 0.6);
}

/* ==========================================================================
   1. GLOBAL RESET
   ========================================================================== */
* { box-sizing: border-box; } /* Padding/Borders do not expand element width */

html {
    scrollbar-gutter: stable; /* Prevents page jump when scrollbar vanishes */
}

body {
    background-color: var(--bg);
    color: var(--fg);
    font-family: var(--font-main);
    margin: 0; padding: 0;
    overflow-x: hidden;         /* Prevents horizontal overflow/scrolling */
    min-height: 100vh;          /* Ensures body fills vertical viewport height */
    display: flex;
    flex-direction: column;
}


/* ==========================================================================
   2. LAYOUT STRUCTURE
   ========================================================================== */
.ds-main { 
    max-width: 1600px; 
    margin: 40px auto;          /* 40px Top/Bottom | Auto Left/Right (Centering) */
    width: calc(100% - 40px);   /* Full width minus 20px margin on each side */
    min-height: calc(100vh - 40px); /* Full height minus 20px margin on top/bottom */
    border: 1px solid var(--border); 
    display: flex; 
    flex-direction: column;
    position: relative;         /* Anchor for absolute-positioned children */
}

/* ==========================================================================
   3. TYPOGRAPHY & HERO COMPONENTS
   ========================================================================== */
h1 { 
    font-size: 10vw;            /* Responsive size based on screen width */
    line-height: 0.75;          /* Vertical spacing between lines of text */
    letter-spacing: -0.06em;    /* Horizontal spacing between letters */
    font-weight: 900; 
    margin: 0; 
    text-transform: uppercase; 
    color: #ffffff; 
    position: relative; 
    z-index: 5;                 /* Keeps text above smoke effects */
}

.mono { 
    font-family: var(--font-mono); 
    font-size: 0.7rem; 
    text-transform: uppercase; 
    letter-spacing: 0.25em; 
    color: var(--dim); 
}

.hero { 
    /* Clock Method: 40px Top | 80px Right | 80px Bottom | 80px Left */
    padding: 40px 80px 80px 80px; 
    position: relative; 
    overflow: hidden; 
}

.hero-meta { 
    display: flex; 
    justify-content: flex-start;
    gap: 40px;                  /* Horizontal spacing between nav items */
    margin-bottom: 50px;        /* Space below the meta navigation bar */
    border-bottom: 1px solid var(--border);
    padding-bottom: 20px;       /* Internal space between text and border-bottom */
}

.home-nav-bar { justify-content: space-between; gap: 0; }
.hero-desc { font-size: 1.8rem; color: var(--accent); margin-top: 40px; }

/* ==========================================================================
   4. NAVIGATION (INTEGRATED) - EVEN SPACING FIX
   ========================================================================== */
.home-nav-bar {
    width: 100%;
    margin-bottom: 30px; /* Reduced padding to tighten hero space */
}

.desktop-nav {
    display: flex;
    justify-content: space-between; /* Spreads items evenly */
    width: 100%;
    padding: 0;
}

.nav-link-item { text-decoration: none !important; transition: 0.3s ease; }
.nav-link-item .mono { color: #ffffff !important; opacity: 0.8; font-weight: 800 !important; }
.nav-link-item:hover .mono { opacity: 1; text-shadow: 0 0 10px rgba(255, 255, 255, 0.5); }

/* ==========================================================================
   5. ATMOSPHERIC EFFECTS (SMOKE)
   ========================================================================== */
.hero h1::after {
    content: "";
    position: absolute; 
    /* Positioning relative to the H1 element */
    top: -30%; left: -15%; width: 220%; height: 220%; 
    background: radial-gradient(ellipse at 20% 50%, rgba(255, 255, 255, 0.65) 0%, rgba(200, 200, 200, 0.3) 20%, rgba(100, 100, 100, 0.1) 45%, transparent 75%);
    filter: url(#smoke-filter) blur(12px);
    opacity: 0; pointer-events: none; z-index: -1; transition: opacity 2s ease-in-out;
}
.hero h1.is-active::after { opacity: 1; animation: smoke-drift 35s infinite ease-in-out; }

@keyframes smoke-drift {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(3%, 4%) scale(1.15); } /* Drifts right/down and grows */
    100% { transform: translate(0, 0) scale(1); }
}

/* ==========================================================================
   6. TELEMETRY & ACTIVITY BAR
   ========================================================================== */
.activity-bar {
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    width: 100%; 
    padding: 25px 30px;         /* 25px Top/Bottom | 30px Left/Right */
    border-top: 1px solid var(--border); 
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}

.status-item { display: flex; align-items: center; gap: 10px; flex: 1; }
.status-item:nth-child(2) { justify-content: center; } /* Centers the "Latest Intel" bar */
.status-item:last-child { justify-content: flex-end; }  /* Pushes clock to the right */

.ticker-text { font-family: var(--font-mono); font-size: 0.75rem; color: var(--accent); text-transform: uppercase; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.is-online { background: var(--status-green); box-shadow: 0 0 8px var(--status-green-glow); }
.dot.is-offline { background: var(--status-red); box-shadow: 0 0 8px var(--status-red-glow); }

/* ==========================================================================
   7. HUB COMPONENTS (HOMEPAGE BENTO GRID)
   ========================================================================== */
.hub-grid { display: grid; grid-template-columns: repeat(4, 1fr); } /* 4 columns on desktop */

.hub-card { 
    padding: 40px 30px;         /* 40px Top/Bottom | 30px Left/Right */
    border-right: 1px solid var(--border); 
    border-bottom: 1px solid var(--border);
    text-decoration: none; 
    color: inherit; 
    min-height: 250px;           /* Minimum height of the bento box */
    display: flex; 
    flex-direction: column; 
    justify-content: space-between; /* Spreads content (status/title/mono) vertically */
}

.hub-card h3 { 
    font-size: 2.2rem; 
    margin: 0; 
    font-weight: 700; 
    transition: transform 0.3s ease; 
}
.hub-card:hover h3 { transform: translateX(10px); } /* Shifts title right on hover */
.hub-card:hover { background: rgba(255, 255, 255, 0.03); }

/* ==========================================================================
   8. INTEL FEED COMPONENTS (BLOG SECTION)
   ROLE: Curated post-grid styling for the Primary Intelligence Feed.
   ========================================================================== */
.intel-featured-grid { 
    /* Clock Method: 40px Top | 30px Right | 80px Bottom | 30px Left */
    padding: 40px 30px 80px 30px; 
} 

.centered-header { 
    text-align: center; 
    letter-spacing: 0.3em; 
    margin-bottom: 50px; 
    font-size: 1.5rem; 
    position: relative; 
    display: inline-block; 
    width: 100%; 
}

/* Decorative line under "Latest Intelligence" */
.centered-header::after {
    content: ""; position: absolute; bottom: -15px; left: 50%; transform: translateX(-50%);
    width: 60%; max-width: 400px; height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.2) 20%, rgba(255, 255, 255, 0.2) 80%, transparent 100%);
}

.intel-posts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }

.featured-card { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    text-align: center; 
    padding-bottom: 30px; 
    border: 1px solid var(--border); 
    background: #080808; 
    overflow: hidden; /* Ensures internal scale effects do not break card boundaries */
}

/* Image container sizing */
.featured-img-link { 
    width: 100%; 
    aspect-ratio: 16/9; 
    overflow: hidden; 
    border-bottom: 1px solid var(--border); 
    margin-bottom: 20px; 
}

.featured-img-link img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    
    /* IDENTITY_STATE: Desaturated and slightly dimmed for 'Inactive' state */
    filter: grayscale(1) brightness(0.85); 
    
    /* MOTION_LOGIC: Easing uses cubic-bezier for a weighted, smooth feel. 
       'will-change' prepares GPU for filter/transform interpolation. */
    transition: filter 1.0s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 1.0s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: filter, transform;
}

/* --- ACTIVATION_LOGIC: SPLIT BEHAVIOR --- */

/* 1. DESKTOP DEFAULT: Only activate on physical mouse hover */
.featured-card:hover img { 
    filter: grayscale(0) brightness(1); 
    transform: scale(1.04); 
}

/* 2. MOBILE OVERRIDE: Activate on Scroll (IntersectionObserver) 
   We wrap this in a media query so Desktop ignores the 'is-visible' class */
@media (max-width: 1024px) {
    .featured-card.is-visible img { 
        filter: grayscale(0) brightness(1); 
        transform: scale(1.04); 
    }
}

/* --- END ACTIVATION LOGIC --- */

.featured-title { font-size: 1.4rem; margin: 10px 20px; } 
.featured-excerpt { color: var(--dim); margin: 0 20px 30px 20px; line-height: 1.6; }

.featured-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    width: 100%;
    /* Centers children horizontally so the button doesn't stretch */
    align-items: center; 
}

.btn-continue { 
    display: inline-block; 
    border: 1px solid var(--border); 
    padding: 12px 24px; 
    font-family: var(--font-mono); 
    font-size: 0.7rem; 
    color: #fff; 
    text-decoration: none; 
    background: rgba(255,255,255,0.03); 
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: auto;
    margin-bottom: 0;

}

.btn-continue:hover { background: #fff; color: #000; }

/* ==========================================================================
   9. ARMORY COMPONENTS (TOOLS)
   ========================================================================== */
.category-banner { 
    padding: 15px 30px; 
    border-top: 1px solid var(--border) !important; 
    border-bottom: 1px solid var(--border); 
    background: rgba(255, 255, 255, 0.02); 
    margin-top: -1px; 
}

.armory-cat { 
    font-family: var(--font-mono); 
    font-size: 0.9rem; 
    color: #fff !important; 
    text-transform: uppercase;
    letter-spacing: 0.15em;
    opacity: 0.9;
}

.tool-grid { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
}

.tool-card { 
    padding: 30px; 
    border-right: 1px solid var(--border); 
    border-bottom: 1px solid var(--border); 
    background: #0d0d0d; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    text-align: center; 
    transition: all 0.2s ease-out; 
}

.tool-card:hover { 
    box-shadow: inset 0 0 0 1px #fff; 
    background: #1a1a1a; 
}

.tool-img-window { 
    width: 140px; 
    height: 200px; 
    border: 1px solid var(--border); 
    margin-bottom: 20px; 
    overflow: hidden; 
    display: block; 
}

.tool-img-window img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    filter: grayscale(1); 
    transition: 0.3s; 
}

.tool-card:hover .tool-img-window img { 
    filter: grayscale(0); 
}

.tool-card h4 { 
    font-size: 1.2rem; 
    color: #fff; 
    margin: 10px 0; 
    text-transform: uppercase; 
}

.tool-card p { 
    font-size: 0.9rem; 
    color: var(--dim); 
    line-height: 1.5; 
    margin-bottom: 10px; 
}

/* --- Responsive Adjustments for Section 9 --- */
@media (max-width: 1024px) {
    .tool-grid { 
        grid-template-columns: 1fr !important; /* Forces 1 tool across on mobile */
    }

    .tool-card {
        border-right: none; /* Removes side borders on stacked view */
        padding: 40px 20px;
    }
}

/* ==========================================================================
   10. MODALS (BRIEFINGS)
   ========================================================================== */
.modal-overlay { 
    position: fixed; 
    top: 0; left: 0; width: 100vw; height: 100vh; 
    background: rgba(0,0,0,0.85); 
    backdrop-filter: blur(5px); 
    display: flex; 
    align-items: center; justify-content: center; 
    opacity: 0; pointer-events: none; 
    transition: 0.3s ease; 
    z-index: 99999 !important; 
}

.modal-overlay.active { opacity: 1; pointer-events: auto; }

.modal-content { 
    background: #2a2a2a; 
    border: 1px solid rgba(255, 255, 255, 0.2); 
    padding: 60px; 
    max-width: 700px; 
    width: 90%; 
    max-height: 80vh; 
    overflow-y: auto;           /* Scrollbar active if content exceeds max-height */
}

.close-modal { position: absolute; top: 25px; right: 30px; font-size: 2rem; color: var(--dim); cursor: pointer; }
.briefing-body h2 { font-size: 2.2rem; margin-bottom: 20px; text-transform: uppercase; letter-spacing: -0.02em; }
.briefing-body p { line-height: 1.8; color: var(--accent); margin-bottom: 20px; }


/* ==========================================================================
   11. GLOBAL FOOTER - SEAMLESS LEFT ALIGNED
   ========================================================================== */
.ds-footer { 
    padding: 30px 50px;         
    display: flex; 
    justify-content: space-between; 
    margin-top: auto;           
    background: transparent;
    border-top: none !important; 
}

/* 2. HOMEPAGE OVERRIDE: Matches the Learning Pathway gradient */
.home-template .ds-footer {
    background: rgba(255, 255, 255, 0.01);
}

@media (max-width: 1024px) {
    .ds-footer { 
        padding: 15px 15px !important; 
        /* Corrected from center to flex-start */
        justify-content: flex-start !important; 
    }
}

/* ==========================================================================
   12. MOBILE & TABLET OPTIMIZATION (DENSITY PASS)
   ========================================================================== */
@media (max-width: 1024px) {
    .ds-main {
        margin: 10px auto !important; 
        width: calc(100% - 20px) !important;
        min-height: calc(100svh - 22px) !important; 
    }

    /* 1. Navigation Hiding */
    .desktop-nav { display: none !important; }
    .hero-meta.home-nav-bar { display: none !important; }

    /* 2. Mobile Menu Trigger */
    .mobile-menu-trigger {
        display: flex !important;
        position: absolute;
        top: 20px;
        left: 20px;
        flex-direction: column;
        gap: 5px;
        z-index: 1001;
        cursor: pointer;
    }
    .menu-bar { width: 25px; height: 2px; background: #fff; }

    /* 3. Hero Adjustments */
    .hero { 
        padding: 20px 15px !important; 
        display: flex !important; 
        flex-direction: column !important; 
        align-items: center !important; 
        text-align: center !important; 
    }

    /* TARGETED FIX: Syncing Post Nav & Armory Nav */
    .page-armory .hero-meta,
    .post-template .post-nav-meta { 
        position: relative !important;
        display: flex !important; 
        width: 100% !important;
        justify-content: flex-start !important; 
        margin-bottom: 10px !important; /* Reduced to tighten gap */
        padding: 15px !important; 
        border: none !important;
        background: transparent !important;
        border-bottom: none !important; /* REMOVED for seamless box feel */
    }

    /* FIX: Prevents /// RETURN HOME /// from splitting into two lines */
    .page-armory .hero-meta .nav-link-item,
    .post-template .post-nav-meta .nav-link-item {
        white-space: nowrap !important;
        display: inline-block !important;
    }

    .hero h1 { 
        font-size: clamp(2.5rem, 10vw, 3rem) !important; 
        margin-top: 10px !important; 
        width: 100% !important;
        text-align: center !important; 
    }

    .hero-desc { 
        font-size: 0.9rem !important; 
        margin-top: 10px !important; 
        color: var(--dim) !important; 
        width: 100% !important;
        text-align: center !important;
    }

    /* 4. Armory Categories Density */
    .category-banner { padding: 10px 15px !important; }
    .armory-cat {
        font-size: 0.7rem !important; 
        white-space: nowrap !important; 
        overflow: hidden !important;
        text-overflow: ellipsis !important; 
        display: block !important;
    }

    /* 5. Intel Bar Logic */
    .activity-bar { padding: 0 !important; height: 35px !important; justify-content: center !important; }
    .activity-bar .status-item:first-child, 
    .activity-bar .status-item:last-child { display: none !important; } 
    .intel-posts { display: flex !important; flex-direction: column !important; gap: 30px !important; }

    /* 6. Mobile Overlay - FIXING BLUE LINKS */
    .mobile-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.98);
        backdrop-filter: blur(15px);
        z-index: 9999;
        display: flex !important;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: 0.3s ease-in-out;
    }
    .mobile-overlay.is-active { opacity: 1; visibility: visible; pointer-events: auto; }
    .overlay-content { display: flex; flex-direction: column; gap: 35px; text-align: center; }
    .overlay-item { text-decoration: none !important; color: #ffffff !important; display: block; }
    .overlay-item h3 { font-size: 1.8rem; margin: 0; color: #ffffff !important; }
    .overlay-item .mono { color: var(--dim) !important; display: block; margin-top: 5px; }
    .close-overlay { margin-top: 40px; background: transparent; border: 1px solid var(--border); color: #fff; padding: 12px 24px; font-family: var(--font-mono); }

    /* Target the Inspector and Armory specifically to hide desktop nav */
    .page-pgp-inspector .hero-meta,
    .page-armory .hero-meta,
    .page-armory-hub .hero-meta,
    .post-template .post-nav-meta {
        display: none !important;
    }

    /* Ensure the mobile return trigger is the only thing visible */
    .mobile-return-trigger {
        display: flex !important;
    }

}

@media (min-width: 1025px) {
    .mobile-menu-trigger, .mobile-overlay { display: none !important; }
}


/* ==========================================================================
   13. POST ARCHITECTURE & TYPOGRAPHY
   ROLE: Defines the visual layout and reading experience for Ghost Articles.
   ========================================================================== */

/* --- 1. Layout & Media Logic --- */
.post-template .ds-main {
    display: flex !important;
    flex-direction: column !important;
    min-height: calc(100vh - 42px) !important;
}

/* SYNCED WITH ARMORY: Left Aligned and Seamless (No Border) */
.post-template .hero-meta.post-nav-meta {
    margin-bottom: 10px !important; 
    padding: 20px 80px 10px 80px !important;
    display: flex !important;
    justify-content: flex-start !important; /* FORCES LEFT ALIGN */
    border-bottom: none !important; /* REMOVED for seamless "one box" feel */
}

/* Ensure link doesn't wrap on desktop or mobile */
.post-nav-meta .nav-link-item {
    white-space: nowrap !important;
}

.post-template .briefing {
    flex: 1 0 auto !important;
    padding: 0 !important; /* Strips padding to move content up */
}

/* FIX: The Framing Container */
.briefing-hero-image {
    width: 100% !important;
    max-width: none !important;
    margin: 0 auto 30px auto !important; 
    padding: 0 40px !important;
    display: flex !important;
    justify-content: center !important;
}

/* FIX: Collapses grey border to image width only */
.briefing-hero-image img {
    width: auto !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: 45vh !important;
    object-fit: contain !important;        
    border: 1px solid var(--border) !important;
    background: #0a0a0a !important;
    display: block !important;
}

.briefing-header {
    text-align: center;
    margin-bottom: 50px;
    padding: 0 40px;
}

.briefing-title {
    font-size: clamp(2rem, 5vw, 3.2rem);
    margin: 0 auto 20px auto;
    max-width: 900px;
    line-height: 1.1;
    text-transform: uppercase;
}

.briefing-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 40px;
}

/* --- 2. Post Metadata --- */
.briefing-meta {
    display: flex;
    justify-content: center;
    gap: 30px;
    color: var(--dim); 
}

.meta-data {
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.75rem;
}

.post-footer {
    border-top: 1px solid var(--border);
    margin-top: 0 !important;
    padding: 20px 30px !important;
    flex-shrink: 0;
}

/* --- 3. Typography: Body & Headlines --- */
.gh-content { font-family: 'Inter', sans-serif; }
.gh-content p { font-size: 1.1rem; line-height: 1.8; margin-bottom: 1.6rem; color: var(--fg); }
.gh-content h2, .gh-content h3 { color: #ffffff; margin: 3rem 0 1rem 0; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 800; }
.gh-content h2 { font-size: 1.6rem; }
.gh-content h3 { font-size: 1.3rem; }
.gh-content strong { color: #ffffff; font-weight: 700; }
.gh-content a { color: #ffffff; text-decoration: underline; text-underline-offset: 4px; }
.gh-content ul, .gh-content ol { margin-bottom: 1.8rem; padding-left: 25px; }
.gh-content li { margin-bottom: 0.8rem; color: var(--fg); }

/* --- 4. Media & Blockquotes --- */
.gh-content figure { margin: 3rem 0; border: 1px solid var(--border); padding: 10px; background: #0a0a0a; }
.gh-content figcaption { font-family: 'JetBrains Mono', monospace; font-size: 0.7rem; color: var(--dim); text-align: center; margin-top: 12px; }
.gh-content blockquote { border-left: 2px solid var(--accent); padding: 5px 0 5px 25px; margin: 2rem 0; color: var(--accent); font-style: italic; }

@media (max-width: 1024px) {
    .post-template .post-nav-meta {
        padding: 15px !important;
        justify-content: flex-start !important; /* Mobile Left Align */
    }
    .briefing-hero-image { width: 100%; padding: 0 10px; }
    .briefing-header { padding: 0 20px; margin-bottom: 30px; }
    .meta-data { font-size: 0.65rem; }
}



/* ==========================================================================
   14. SECURE UPLINK (MAILING LIST CTA)
   ROLE: Conversion point for site membership / newsletter.
   ========================================================================== */
.secure-uplink-cta {
    padding: 80px 30px;
    border-top: 1px solid var(--border);
    /* Removed the gradient and set to pure background */
    background: rgba(255, 255, 255, 0.01); 
    text-align: center;
}

.uplink-container { max-width: 650px; margin: 0 auto; }

.uplink-title {
    font-size: 3rem;
    font-weight: 900;
    letter-spacing: -0.04em;
    margin: 10px 0 20px 0;
    text-transform: uppercase;
    color: #ffffff;
}

.uplink-desc {
    color: var(--dim);
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 40px;
}

.input-wrapper {
    display: flex;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.03);
    padding: 5px;
    transition: all 0.3s ease;
}

.input-wrapper:focus-within { 
    border-color: rgba(255,255,255,0.5); 
    box-shadow: 0 0 15px rgba(255,255,255,0.05);
}

.uplink-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #fff;
    padding: 15px 20px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    outline: none;
}

.uplink-button {
    background: #ffffff;
    border: none;
    padding: 0 30px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.uplink-button span { color: #000 !important; font-weight: 800 !important; }

.uplink-button:hover { background: var(--accent); }

/* Ghost Form Status Handling */
.message-success, .message-error { display: none; margin-top: 25px; font-size: 0.8rem; letter-spacing: 0.1em; }
.success .message-success { display: block; color: var(--status-green); }
.error .message-error { display: block; color: var(--status-red); }

/* ==========================================================================
   15. LEARNING PATHWAY (FOCAL CAROUSEL)
   ========================================================================== */
.learning-pathway {
    padding: 60px 0; /* Restored to original compact vertical padding */
    overflow: hidden;
    position: relative;
    background: linear-gradient(180deg, transparent 0%, rgba(255,255,255,0.01) 100%);
    border-top: 1px solid var(--border);
}

.series-description {
    max-width: 700px;
    margin: -30px auto 40px auto; /* Original negative margin to tuck under header */
    text-align: center;
    color: var(--dim); /* Restored to original muted gray color */
    line-height: 1.6;
    font-size: 1rem; /* Original size */
    padding: 0 20px;
}

.carousel-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    width: 100%;
    padding: 20px 0;
}

.carousel-track {
    display: flex;
    gap: 60px;
    overflow-x: hidden;
    scroll-behavior: smooth;
    align-items: center;
    width: 100%;
    min-height: 450px; /* Restored more compact height */
    padding: 0 50vw; 
}

.series-card {
    flex: 0 0 320px; /* Restored original card width */
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.15;
    filter: blur(6px) grayscale(1);
    transform: scale(0.9);
    text-align: center;
}

.series-card.is-focused {
    opacity: 1;
    filter: blur(0) grayscale(0);
    transform: scale(1.05); /* Original subtle focus scale */
    z-index: 10;
}

.series-image {
    width: 100%;
    aspect-ratio: 1/1;
    border: 1px solid var(--border);
    position: relative;
    margin-bottom: 20px;
    background: #000;
    overflow: hidden;
}

.series-image img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover;
    object-position: center;
}

.series-title { 
    font-size: 1.4rem; /* Restored original title size */
    margin: 0 0 8px 0; 
    text-transform: uppercase;
    color: #fff;
}

.series-link {
    text-decoration: none !important;
    display: block;
    color: inherit; /* Ensures the title doesn't turn blue */
}

/* Ensures that the title stays white even if the link is "visited" */
.series-title {
    color: #ffffff !important;
}

/* THE VISUAL COUNTER - Precisely Centered */
.carousel-counter {
    margin-top: 20px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--dim);
    background: rgba(255, 255, 255, 0.03);
    padding: 6px 16px;
    border: 1px solid var(--border);
    display: flex;
    gap: 10px;
}

#current-index {
    color: #fff;
    font-weight: bold;
}

/* NAVIGATION - Absolute positioning ensures they don't offset the counter */
.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    background: rgba(0,0,0,0.4);
    border: 1px solid var(--border);
    color: white;
    width: 50px;
    height: 50px;
    cursor: pointer;
    backdrop-filter: blur(5px);
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-nav:hover { background: #fff; color: #000; }
.prev { left: 8vw; }
.next { right: 8vw; }

@media (max-width: 1024px) {
    .series-card { width: 260px; min-width: 260px; }
    .carousel-track { padding: 0 15%; gap: 20px; }
    .carousel-nav { width: 45px; height: 45px; }
}


/* ==========================================================================
   16. MISSION BRIEF (UNIFIED & SEAMLESS)
   ========================================================================== */
.mission-brief {
    padding: 0 80px 60px 80px;
    /* No border-bottom here to keep it flowing into Intel */
}

.brief-container {
    max-width: 900px;
}

.brief-text {
    font-size: 1.4rem;
    line-height: 1.6;
    color: var(--accent);
    margin-top: 20px;
}

/* --- SEAMLESS BOX LOGIC: REMOVING SECTION DIVIDERS --- */
.intel-featured-grid, 
.learning-pathway {
    border-top: none !important; 
    padding-top: 40px !important;
}

.centered-header::after {
    display: none !important; /* Removes decorative lines under headers for a cleaner look */
}

@media (max-width: 1024px) {
    .mission-brief {
        padding: 0 20px 40px 20px;
        /* Modern Design: Left Aligned for better mobile readability */
        text-align: left !important; 
    }
    
    .brief-container {
        margin: 0;
    }

    .brief-text {
        font-size: 1.1rem;
    }
}

/* ==========================================================================
   MOBILE SPECIFIC OVERRIDES (ADD TO BOTTOM OF SCREEN.CSS)
   ========================================================================== */
@media (max-width: 1024px) {
    
    /* 1. HIDE DESKTOP NAV TEXT ON POSTS & ARMORY */
    .post-template .hero-meta.post-nav-meta,
    .page-armory .hero-meta {
        display: none !important;
    }

    /* 2. STACK METADATA VERTICALLY */
    .briefing-meta {
        flex-direction: column !important;
        gap: 8px !important;
        align-items: center !important;
    }

    /* 3. MOBILE HOME MENU TRIGGER (Top Left) */
    .mobile-return-trigger {
        display: flex !important;
        position: absolute;
        top: 25px;
        left: 20px;
        flex-direction: column;
        gap: 5px;
        z-index: 99999;
        cursor: pointer;
    }
    .return-bar { width: 25px; height: 2px; background: #fff; }

    /* 4. STYLED MOBILE HOME MENU OVERLAY */
    .mobile-return-overlay {
        position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
        background: rgba(0,0,0,0.98); /* Darker opacity to match Home */
        backdrop-filter: blur(15px);
        display: flex; align-items: center; justify-content: center;
        opacity: 0; pointer-events: none; transition: 0.3s ease;
        z-index: 100000;
    }
    .mobile-return-overlay.active { opacity: 1; pointer-events: auto; }
    
    /* Wrapper to stack Link and Close button vertically */
    .return-content {
        display: flex; flex-direction: column; 
        align-items: center; gap: 50px; 
        text-align: center;
    }

    /* The Link Container (Removes default blue underline) */
    .return-item { text-decoration: none !important; display: block; }

    /* Main Heading "HOME" */
    .return-item h3 {
        font-size: 2.5rem; /* Large and bold */
        margin: 0; 
        color: #ffffff !important; 
        text-transform: uppercase;
        font-weight: 900;
        letter-spacing: -0.02em;
    }

    /* Subheading "// RETURN_TO_BASE" */
    .return-item .mono {
        font-family: var(--font-mono);
        color: var(--dim) !important;
        font-size: 0.9rem;
        margin-top: 10px;
        display: block;
        letter-spacing: 0.15em;
    }

    /* Tactical Close Button */
    .close-return-btn {
        background: transparent;
        border: 1px solid var(--border);
        color: #ffffff !important;
        padding: 12px 30px;
        font-family: var(--font-mono);
        font-size: 0.85rem;
        cursor: pointer;
        text-transform: uppercase;
        letter-spacing: 0.1em;
    }
}

/* Ensure hidden on Desktop */
@media (min-width: 1025px) {
    .mobile-return-trigger, .mobile-return-overlay { display: none !important; }
}

/* ==========================================================================
   FINAL MOBILE SPACING ADJUSTMENTS
   Adds "Dead Space" at the top so the Menu Icon never overlaps content.
   ========================================================================== */
@media (max-width: 1024px) {
    
    /* 1. HOME & ARMORY: Nudges the Hero text down */
    .hero {
        /* Previously ~20px. Now 85px to clear the menu icon */
        padding-top: 60px !important; 
    }

    /* 2. POSTS: Pushes the Featured Image down */
    .briefing-hero-image {
        /* Forces the image to start lower down the page */
        margin-top: 85px !important; 
    }
}

/* ==========================================================================
   FIX: NAVIGATION CONSISTENCY
   Ensures Armory and Post menus match Home Menu font size exactly.
   ========================================================================== */
.page-armory .hero-meta .nav-link-item,
.post-template .post-nav-meta .nav-link-item,
.page-armory .hero-meta .nav-link-item .mono,
.post-template .post-nav-meta .nav-link-item .mono {
    font-family: var(--font-mono) !important;
    font-size: 0.7rem !important;       /* Matches Home .mono size */
    letter-spacing: 0.25em !important;  /* Matches Home spacing */
    font-weight: 700 !important;        /* Matches Home boldness */
    text-transform: uppercase !important;
    color: #ffffff !important;
    opacity: 0.8;
}

/* Ensure Hover Effect Matches Home */
.page-armory .hero-meta .nav-link-item:hover,
.post-template .post-nav-meta .nav-link-item:hover,
.page-armory .hero-meta .nav-link-item:hover .mono,
.post-template .post-nav-meta .nav-link-item:hover .mono {
    opacity: 1;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* ==========================================================================
   DYNAMIC MOBILE MENU TEXT SWAP (ESCAPE HATCH)
   ========================================================================== */
@media (max-width: 1024px) {
    
    /* Target Armory Tools, EXCLUDING the Hub itself */
    .page-armory:not(.page-armory-hub) #return-title {
        font-size: 0 !important; 
    }
    .page-armory:not(.page-armory-hub) #return-title::before {
        content: "ARMORY";
        font-size: 2.5rem;
        display: block;
        font-weight: 900;
        color: #fff;
    }

    .page-armory:not(.page-armory-hub) #return-desc {
        font-size: 0 !important; 
    }
    .page-armory:not(.page-armory-hub) #return-desc::before {
        content: "/// RETURN TO THE ARMORY ///";
        font-size: 0.9rem;
        display: block;
        color: var(--dim);
        letter-spacing: 0.15em;
    }
}

/* ==========================================================================
   17. GHOST CORE COMPLIANCE (DO NOT DELETE)
   ROLE: Mandatory styles required by the Ghost Engine.
   CRITICAL: Deleting these classes will cause Theme Validation Errors 
   and break image alignment in the Koenig Editor.
   ========================================================================== */

/* Defines behavior for 'Wide' images in the editor */
.kg-width-wide {
    grid-column: wide-start / wide-end;
    max-width: 1200px; 
    width: 100%;
}

/* Defines behavior for 'Full' images in the editor */
.kg-width-full {
    grid-column: full-start / full-end;
    max-width: 100vw;
    width: 100vw;
}

/* General Ghost Media Card support */
.kg-image-card img {
    width: 100%;
    height: auto;
}

.kg-gallery-card-container {
    display: flex;
    gap: 10px;
}

/* ==========================================================================
   18. MOBILE FIXES: VISIBLE SMOKE & FORM LAYOUT
   ROLE: High-contrast horizontal smoke & fixed form layout.
   ========================================================================== */
@media (max-width: 1024px) {

    /* --- A. STATIC SMOKE FIX (High Visibility) --- */
    .hero h1::after {
        filter: blur(25px) !important; 
        animation: none !important;
        
        /* SHAPE: Wide horizontal bar */
        width: 180% !important;
        height: 70% !important;
        
        /* CENTERING */
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        
        /* GRADIENT: Boosted Opacity to 0.65 (Much brighter white core) */
        background: radial-gradient(ellipse at center, rgba(255,255,255,0.65) 0%, rgba(255,255,255,0.1) 60%, transparent 85%) !important;
        
        opacity: 1 !important;
        z-index: -1 !important;
    }

    /* Hide the heavy desktop filter */
    #smoke-filter {
        display: none !important;
    }

    /* --- B. SECURE UPLINK FIX (Stack Vertically) --- */
    .input-wrapper {
        flex-direction: column !important;
        border: none !important;
        background: transparent !important;
        gap: 10px;
    }

    .uplink-input {
        width: 100% !important;
        text-align: center !important;
        background: rgba(255,255,255,0.05) !important; 
        border: 1px solid var(--border) !important;
    }

    .uplink-button {
        width: 100% !important;
        padding: 15px !important;
        margin-left: 0 !important;
    }
}

/* ==========================================================================
   19. AUTHENTICATION TERMINAL (FILE TAB STYLE)
   ROLE: Login button that sits "On Top" of the main container border.
   ========================================================================== */
.auth-access-port {
    position: absolute;
    /* MOVES IT UP: -30px pulls it outside the box, sitting on top */
    top: -30px;           
    /* ALIGNS RIGHT: Flush with the right edge of the border */
    right: 0;             
    height: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 2000; /* Ensures it sits above smoke/hero layers */
    pointer-events: none; /* Allows clicks to pass through the empty container */
}

.auth-link {
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--dim);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    transition: all 0.3s ease;
    cursor: pointer;
    padding: 10px 0 10px 10px; /* Increased padding for easier clicking */
    pointer-events: auto; /* Re-enables clicking on the link itself */
    display: flex; /* CRITICAL: Fixes the "Clickable Area" collapse */
    align-items: center;
}

.auth-link:hover {
    color: #fff;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
}

/* ACTIVE STATE */
.auth-link.is-active { color: var(--status-green); }

/* MOBILE ADJUSTMENT: Moves inside the box to save space */
@media (max-width: 1024px) {
    .ds-main { margin: 10px auto !important; } 
    
    .auth-access-port {
        top: 15px;    /* Move INSIDE the box */
        right: 15px;  /* Top Right Corner */
    }
    
    /* 1. Hide the desktop text */
    .auth-link { 
        font-size: 0 !important; 
        padding: 15px; /* Big touch target for fingers */
    }

    /* 2. REPLACEMENT TEXT: LOGGED OUT */
    .auth-link:not(.is-active)::after { 
        content: "/// LOGIN ///"; /* Updated per your request */
        font-size: 0.75rem; 
        font-family: var(--font-mono);
        color: var(--dim);
        display: block; /* Ensures the text has physical dimensions */
    }

    /* 3. REPLACEMENT TEXT: LOGGED IN */
    .auth-link.is-active::after { 
        content: "/// SIGNED_IN ///"; 
        font-size: 0.75rem;
        font-family: var(--font-mono);
        color: var(--status-green);
        display: block;
    }
}

/* ==========================================================================
   20. PERFORMANCE SAFEGUARDS
   ROLE: Prevents GPU crashes when Ghost Portal (Signin) opens.
   ========================================================================== */
   
/* When the Ghost Portal is open, hide the heavy smoke effect immediately */
body.gh-portal-open .hero h1::after {
    display: none !important;
}

/* Optional: Also hide the smoke on the main 'body' if you used it elsewhere */
body.gh-portal-open #smoke-filter {
    display: none !important;
}