/* ==========================================================================
   CREATIVE FUND ENGINE - CORE MATRIX ARCHITECTURE STYLESHEET
   THEME CONFIGURATION: MUTED PRESENTATION SLATE (REBOOT MASTER PASS)
   ========================================================================== */

:root {
    /* Base Foundations (Turned Down, Glare-Free Canvas) */
    --bg-root: #eef2f5;          /* Smooth, soft slate-tinted light background */
    --bg-canvas: #f7f9fa;        /* Clean muted off-white/cream for structured cells */
    --bg-panel: #ffffff;         /* Elevated pure white layer used strictly for story boxes */
    
    /* Presentation Typography (Deep Slate Blue Core) */
    --text-main: #1e293b;        /* Deep midnight slate for rich contrast */
    --text-primary: #334155;     /* Dark slate gray for highly legible reading columns */
    --text-secondary: #475569;   /* Controlled steel gray for metadata and element labels */
    --text-muted: #64748b;       /* Muted blue-gray for taglines, captions, and structural labels */
    --text-dim: #94a3b8;         /* Soft timestamp and system element gray */
    
    /* Tracking Lights & Dynamic Interaction Accents (Accessible & Balanced) */
    --accent-primary: #059669;   /* Accessible Deep Emerald Green - high contrast readability */
    --accent-secondary: #047857; /* Rich dark forest green for active interaction hover states */
    --accent-bright: #059669;    /* Clean, deliberate tracking green asset backup */
    --accent-subtle: rgba(5, 150, 105, 0.06); /* Highly controlled indicator fill tint */
    
    /* Structural Borders (Tuned to Contextual Slate) */
    --border-main: #cbd5e1;      /* Crisp slate boundary line rules */
    --border-dim: #e2e8f0;       /* Ultra-soft internal grid division tracks */

    /* Typography Polish (Clean, Editorial, Less Sci-Fi Terminal) */
    --font-heading: 'Space Grotesk', -apple-system, sans-serif;
    --font-body: 'IBM Plex Sans', sans-serif;
}

/* RESET ELEMENT DEFAULTS */
*, *::before, *::after {
    box-sizing: border-box !important;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-root);
    color: var(--text-primary);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.01em;
}

/* Give the headers an editorial weight rather than a code look */
h1, h2, h3, .cfe-section-title {
    font-family: var(--font-heading);
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text-main);
}

/* Soften the structural cells so they sit nicely on the new canvas */
.cfe-structural-cell {
    background-color: var(--bg-canvas);
    border: 1px solid var(--border-main);
    box-shadow: 0 1px 3px rgba(31, 35, 40, 0.04);
    border-radius: 6px;
}

h1.cfe-nav-brand-title {
    font-size: 1.4rem !important;
    margin-bottom: 0;
    letter-spacing: -0.03em !important;
    font-family: 'Syne', sans-serif !important;
    font-weight: 800;
}

h2 { 
    font-size: 1.8rem !important; 
    border-bottom: 2px solid var(--border-dim) !important; 
    padding-bottom: 0.8rem !important; 
    margin-bottom: 1.5rem !important;
    font-family: 'Syne', sans-serif !important;
}

h3 { 
    font-size: 1.2rem !important; 
    margin-top: 2rem !important; 
    margin-bottom: 1rem !important;
    color: var(--text-main) !important;
    text-transform: none;
    letter-spacing: -0.01em !important;
    font-family: var(--font-heading) !important;
}

.cfe-telemetry-display-fallback {
    font-family: 'Syne', sans-serif !important;
    font-weight: 700;
    font-size: 2.2rem;
    letter-spacing: -0.03em;
}

/* INTERACTIVE LAYER TYPE RETAINERS */
.cfe-nav-page-btn {
    font-family: var(--font-heading) !important;
    font-weight: 500;
    font-size: 0.9rem;
    letter-spacing: 0.01em;
}

.cfe-campaign-hero-narrative-strip p {
    font-family: var(--font-heading) !important;
    font-size: 1.25rem;
    color: var(--text-secondary);
    font-weight: 400;
    letter-spacing: -0.01em;
}

/* FINANCIAL TELEMETRY NODES TYPE */
.cfe-telemetry-node div,
[id="net-total"],
[id="backer-count"] {
    font-family: 'Syne', sans-serif !important;
    font-weight: 700;
    font-size: 2.2rem;
    letter-spacing: -0.03em;
    color: var(--text-main);
}

a {
    color: var(--accent-primary) !important;
    text-decoration: underline !important;
    cursor: pointer;
}
a:hover {
    color: var(--accent-secondary) !important;
    opacity: 0.85;
}

/* Strip display: contents entirely if it is on this parent wrapper */
.cfe-global-header-hull {
    position: -webkit-sticky; /* Safari backup */
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: #f7f9fa; /* Matches your muted slate presentation canvas cells */
    border-bottom: 1px solid var(--border-dim);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05); /* Soft visual split when scrolling */
}

/* Ensure your nav strip behaves inside the sticky chassis */
.cfe-top-navbar-matrix {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.cfe-navbar-brand-block {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cfe-nav-logo-asset {
    width: auto;
    height: 48px;
    object-fit: contain;
}

.cfe-nav-brand-text-chassis {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.cfe-nav-brand-tagline {
    font-family: var(--font-heading) !important;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

.cfe-campaign-hero-narrative-strip {
    text-align: center;
    padding: 2.5rem 20px 2rem 20px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.cfe-campaign-hero-narrative-strip p {
    font-size: 1.15rem;
    color: var(--text-muted);
    font-weight: 400;
    letter-spacing: 0.01em;
    margin-bottom: 0;
}

/* GLOBAL NAV LINK ROW STRIP */
.cfe-global-nav-strip {
    display: flex;
    gap: 6px;
    position: static;
    padding: 0;
    margin-bottom: 0;
    width: auto;
    align-items: center;
}

.cfe-nav-page-btn {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    color: var(--text-secondary);
    padding: 8px 16px;
    text-decoration: none !important;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.15s ease;
}

.cfe-nav-page-btn:hover {
    color: var(--accent-secondary) !important;
    background: rgba(5, 150, 105, 0.05);
}

/* Synchronized Active Tab Marker Styles (Clean text contrast) */
.cfe-nav-page-btn.active-nav-link {
    background: var(--accent-primary) !important;
    border-color: var(--accent-primary) !important;
    color: #ffffff !important; /* Clear white text over accessible emerald */
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.15);
}

/* MANIFESTO INFRASTRUCTURE CARDS */
.cfe-housebuilt-manifesto {
    background: var(--bg-panel);
    border: 1px solid var(--border-main);
    border-left: 4px solid var(--accent-primary) !important;
    border-radius: 6px;
    padding: 1.5rem;
    margin: 0 auto 2.5rem auto;
    max-width: 1200px;
    width: 100%;
}
.cfe-housebuilt-manifesto strong {
    display: block;
    font-size: 0.95rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}
.cfe-housebuilt-manifesto p {
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 0;
    line-height: 1.6;
}

/* FINALS PROGRESS RUNTIME VISUALS */
.cfe-progress-chassis {
    width: 100%;
    background: var(--bg-canvas);
    border: 1px solid var(--border-dim);
    border-radius: 4px;
    height: 14px;
    margin-bottom: 1.5rem;
    overflow: hidden;
    position: relative;
}
.cfe-progress-fill {
    height: 100%;
    background: var(--accent-primary);
    width: 0%;
    transition: width 0.4s ease;
}

#runway-ticker {
    color: var(--text-secondary) !important;
    font-family: monospace;
}

/* MAIN LAYOUT COLUMNS GRID MATRIX */
.cfe-main-content-layout-matrix {
    max-width: 1200px;
    margin: 1rem auto 0 auto !important;
    display: grid !important;
    grid-template-columns: 180px 1fr 340px !important; 
    gap: 2rem !important;
    align-items: start !important;
    width: 100% !important;
    clear: both !important;
    padding: 0 20px;
}

/* JUMP STRIP INTERNAL ROUTING LINKS */
.cfe-local-side-sticky-nav {
    position: sticky;
    top: 90px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 90;
}
.cfe-jump-link {
    display: block;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    color: var(--text-secondary);
    padding: 10px;
    font-family: var(--font-heading) !important;
    font-size: 0.85rem;
    text-decoration: none !important;
    transition: all 0.15s ease;
}
.cfe-jump-link:hover, .cfe-jump-link.active {
    color: var(--accent-secondary);
    border-color: var(--border-main);
    background: var(--bg-canvas);
    font-weight: 600;
}

/* STORIES & INTERFACE PANEL WRAPPERS */
.manifesto-panel-box {
    background: var(--bg-panel) !important;
    border: 1px solid var(--border-main) !important;
    border-radius: 6px;
    padding: 2.5rem !important;
    margin-bottom: 2rem !important;
    box-shadow: 0 1px 3px rgba(31, 35, 40, 0.04);
}

.cfe-panel-terminal-strip {
    display: flex;
    justify-content: space-between;
    background: var(--bg-canvas);
    padding: 6px 12px;
    font-family: monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-dim);
    border-radius: 4px;
}

p { margin-bottom: 1.5rem; color: var(--text-primary); line-height: 1.6; }
strong { color: var(--text-main); }

.cfe-video-frame-container {
    background: #000;
    border: 1px solid var(--border-main);
    border-radius: 6px;
    overflow: hidden;
    width: 100%;
}

.cfe-primary-content-column {
    min-width: 0 !important;
    width: 100% !important;
}

/* ACTIONS SIDEBAR ACTION CARDS TIER NODES */
.cfe-right-actions-rail {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.cfe-tier-card-node {
    background: var(--bg-panel);
    border: 1px solid var(--border-main);
    border-radius: 6px;
    padding: 1.5rem;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

/* Clear hover feedback since the inner button is gone */
.cfe-tier-card-node:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 4px 20px rgba(5, 150, 105, 0.08);
    transform: translateY(-2px); /* Subtle lift to call attention to the interactivity */
}
.cfe-tier-price {
    font-family: var(--font-heading) !important;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--accent-secondary);
}
.cfe-tier-title {
    font-family: 'Syne', sans-serif !important;
    font-size: 1.1rem;
    font-weight: 800;
    margin: 4px 0 12px 0;
    color: var(--text-main);
    text-transform: uppercase;
}
.cfe-tier-perk-details {
    font-size: 0.85rem;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}
.cfe-back-project-btn {
    width: 100%;
    background: transparent;
    border: 2px solid var(--accent-primary);
    border-radius: 4px;
    color: var(--accent-secondary);
    padding: 10px;
    font-family: var(--font-heading) !important;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}
.cfe-back-project-btn:hover {
    background: var(--accent-primary);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.2);
}

/* OVERLAY CONTROL TILES MODALS */
.cfe-modal-overlay-hull {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(30, 41, 59, 0.4);
    backdrop-filter: blur(4px);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.cfe-modal-structural-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-main);
    border-radius: 8px;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
    max-width: 540px;
    width: 100%;
    padding: 2rem;
    position: relative;
}
.cfe-modal-close-trigger {
    position: absolute;
    top: 15px; right: 20px;
    cursor: pointer;
    font-family: monospace;
    font-size: 1.2rem;
    color: var(--text-muted);
}
.cfe-modal-close-trigger:hover { color: var(--accent-secondary); }

/* FOOTERS STRUCTURAL LINES */
.disclaimers-footer {
    max-width: 1200px;
    margin: 4rem auto 0 auto;
    border-top: 1px dashed var(--border-main);
    padding-top: 2rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    padding-left: 20px;
    padding-right: 20px;
}
.disclaimers-footer p { margin-bottom: 1rem; color: var(--text-muted); }

/* SYSTEM RESPONSIVE RECONCILIATIONS */
@media screen and (max-width: 992px) {
    .cfe-main-content-layout-matrix,
    .cfe-local-side-sticky-nav {
        position: static;
        grid-template-columns: 1fr !important;
    }
    .cfe-top-navbar-matrix {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
        border-radius: 0;
    }
    .cfe-global-header-hull {
        padding: 0;
    }
}/* SYSTEM RESPONSIVE RECONCILIATIONS */
@media screen and (max-width: 992px) {
    .cfe-main-content-layout-matrix {
        position: static;
        display: flex !important;
        flex-direction: column !important; /* Stack elements cleanly */
        gap: 1.5rem !important;
    }
    
    /* Force the primary content column (with the video) to the absolute top */
    .cfe-primary-content-column {
        order: 1 !important;
    }

    /* Place the financial telemetry actions directly under the video */
    .cfe-right-actions-rail {
        order: 2 !important;
    }

    /* Push the internal side navigation links to the bottom on mobile */
    .cfe-local-side-sticky-nav {
        position: static;
        order: 3 !important;
        flex-direction: row !important; /* Lay them out horizontally on mobile */
        flex-wrap: wrap;
        gap: 8px;
    }

    .cfe-top-navbar-matrix {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
        border-radius: 0;
    }
    .cfe-global-header-hull {
        padding: 0;
    }
}

/* Smooth Scrolling for Jump Links */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px; /* Prevents sticky navbar from overlapping sections */
}

/* Fixed Sticky Header Core Alignment */
.cfe-top-navbar-matrix {
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
    background-color: var(--bg-canvas) !important;
    border-bottom: 1px solid var(--border-dim);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    width: 100%;
    border-radius: 0 0 8px 8px;
}

/* Template Variant Overrides: Full-Width Layout Actions */
/* On sub-pages without a local side nav, extend content cleanly */
body.sub-page-view .cfe-main-content-layout-matrix {
    grid-template-columns: 1fr 340px !important; /* Drops the 180px left nav channel */
}

/* On the FAQ page layout */
body.faq-view .cfe-main-content-layout-matrix {
    grid-template-columns: 300px 1fr !important; /* Left side questions, right side answers */
}
/* ROOT LEVEL VIEWPORT CO-ORDINATE LOCK */
.cfe-root-sticky-nav-deck {
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    z-index: 99999 !important; /* Forces it over every single layer on the canvas */
    
    /* Layout Presentation Match */
    background-color: var(--bg-canvas) !important; 
    border-bottom: 1px solid var(--border-dim) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    
    /* Flex alignment rules */
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
}
/* KO-FI NAVIGATION BUTTON INJECTION WRAPPER */
.cfe-nav-widget-anchor {
    display: inline-flex;
    align-items: center;
    margin-left: 12px; /* Give it space after the FAQ link */
}

/* Force the widget's internal iframe container or generated structural button anchor to look balanced */
.cfe-nav-widget-anchor a, 
.cfe-nav-widget-anchor .kofi-button {
    font-family: var(--font-heading) !important;
    font-weight: 600 !important;
    font-size: 0.85rem !important;
    padding: 6px 14px !important;
    border-radius: 4px !important;
    box-shadow: 0 2px 6px rgba(5, 150, 105, 0.15) !important;
    text-decoration: none !important;
}
/* ==========================================================================
   MOBILE MENU & VIDEO PERSISTENCE OVERRIDES
   ========================================================================== */

/* Hide checkbox natively */
.cfe-mobile-toggle-input {
    display: none;
}

/* Mobile Toggle Layout Bars */
.cfe-mobile-toggle-label {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 5px;
    z-index: 100000;
}

.cfe-mobile-toggle-label span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--text-main);
    border-radius: 2px;
    transition: all 0.2s ease;
}

/* Mobile Responsive Engine Layout Reset */
@media screen and (max-width: 992px) {
    /* 1. Force Video Frame to persist and stay at the top */
    .cfe-main-content-layout-matrix {
        display: flex !important;
        flex-direction: column !important;
        gap: 1.5rem !important;
    }

    .cfe-primary-content-column {
        order: 1 !important;
        width: 100% !important;
    }
    
    /* Ensure hero section grid doesn't collapse video into zero height */
    section.cfe-campaign-hero-container > div[style*="display: grid"] {
        grid-template-columns: 1fr !important;
    }

    .cfe-video-frame-container {
        display: flex !important;
        flex-direction: column !important;
        min-height: 240px !important; /* Forces layout tracking box boundary visibility */
    }

    /* 2. Mobile Dropdown Menu Drawer Transformation */
    .cfe-mobile-toggle-label {
        display: flex;
    }

    .cfe-global-nav-strip {
        display: none !important;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--bg-canvas);
        border-bottom: 1px solid var(--border-main);
        flex-direction: column;
        padding: 1.5rem;
        gap: 12px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }

    /* Open Navigation on Checkbox Trigger */
    .cfe-mobile-toggle-input:checked ~ .cfe-global-nav-strip {
        display: flex !important;
    }

    .cfe-nav-page-btn {
        width: 100%;
        text-align: left;
        padding: 12px;
    }

    .cfe-nav-widget-anchor {
        margin-left: 0;
        margin-top: 8px;
        width: 100%;
    }
    
    /* Transform Hamburger into an X when menu checkbox opens */
    .cfe-mobile-toggle-input:checked + .cfe-mobile-toggle-label span:nth-child(1) {
        transform: rotate(45deg) translate(6px, 5px);
    }
    .cfe-mobile-toggle-input:checked + .cfe-mobile-toggle-label span:nth-child(2) {
        opacity: 0;
    }
    .cfe-mobile-toggle-input:checked + .cfe-mobile-toggle-label span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -5px);
    }
}