/* CSS Variables and Design Tokens
 * 1. Global Variables & Base Styles
 * ---------------------------------------------------- */
:root {
    /* Brand Colors */
    --bg-primary: #050816;
    --bg-secondary: #0B1220;
    --bg-glass: rgba(11, 18, 32, 0.6);
    --accent-primary: #00E5FF;
    --accent-secondary: #5B8CFF;
    --accent-success: #00D084;
    --accent-warning: #FFB020;
    --accent-error: #EF4444;
    --text-primary: #FFFFFF;
    --text-muted: #A0AEC0;
    --border-glow: rgba(0, 229, 255, 0.15);
    --border-normal: rgba(255, 255, 255, 0.08);
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --glow-shadow: 0 0 20px rgba(0, 229, 255, 0.2);

    /* Layout Containers & Spacing Constraints */
    --container-xs: 800px;
    --container-sm: 900px;
    --container-md: 1000px;
    --container-lg: 1200px;
    --container-xl: 1400px;
    --container-max-width: 1400px;
    --max-line-length: 70ch;
    --site-header-height: 64px;
    
    /* Spacing Scale (Fluid) */
    --space-xs: clamp(0.5rem, 1.5vw, 0.75rem);
    --space-sm: clamp(0.75rem, 2vw, 1rem);
    --space-md: clamp(1rem, 3vw, 1.5rem);
    --space-lg: clamp(1.5rem, 4vw, 2.5rem);
    --space-xl: clamp(2rem, 6vw, 3.5rem);
    
    /* Fluid Section & Card Paddings */
    --padding-section-y: clamp(2.5rem, 5vw, 5rem);
    --padding-section-x: clamp(1rem, 4vw, 8%);
    --padding-card: clamp(1.25rem, 3vw, 2rem);
    
    /* Border Radius Presets */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    
    /* Typography Scale (Fluid) */
    --fs-hero-title: clamp(2.2rem, 6vw, 3.8rem);
    --fs-section-title: clamp(1.6rem, 4vw, 2.5rem);
    --fs-card-title: clamp(1.1rem, 2.5vw, 1.35rem);
    --fs-body: clamp(0.9rem, 2vw, 1rem);
    --fs-small: clamp(0.8rem, 1.5vw, 0.9rem);
    --fs-meta: clamp(0.75rem, 1.5vw, 0.85rem);
    
    /* Shadow Presets */
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.15);
    --shadow-hover: 0 10px 30px rgba(0, 229, 255, 0.08);
    --shadow-focus: 0 0 0 3px rgba(0, 229, 255, 0.3);
    
    /* Motion Transitions */
    --transition-fast: 0.15s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-normal: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-slow: 0.5s cubic-bezier(0.16, 1, 0.3, 1);

    /* Z-Index Layers */
    --z-background: -10;
    --z-default: 1;
    --z-sticky: 100;
    --z-modal-overlay: 999;
    --z-modal-content: 1000;
    --z-drawer-overlay: 9999;
    --z-drawer-content: 10000;
}

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

html {
    font-family: var(--font-sans);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background-color: var(--bg-primary);
    overflow-x: hidden;
    line-height: 1.6;
}

a {
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition-smooth);
}

a:hover {
    color: var(--accent-primary);
}

/* ----------------------------------------------------
 * 2. Background Grid & Particles Wrapper
 * ---------------------------------------------------- */
.network-bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
}

.grid-bg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 229, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 229, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -2;
    pointer-events: none;
}

/* Radial dark gradient overlay to fade grid on edges */
.radial-darkness-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, transparent 20%, var(--bg-primary) 85%);
    z-index: -1;
    pointer-events: none;
}

/* ----------------------------------------------------
 * 3. Custom Glow Cursor (Desktop only)
 * ---------------------------------------------------- */
.custom-cursor-dot {
    width: 8px;
    height: 8px;
    background-color: var(--accent-primary);
    border-radius: 50%;
    position: fixed;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 9999;
    transition: width 0.1s, height 0.1s;
}

.custom-cursor-glow {
    width: 40px;
    height: 40px;
    border: 1px solid var(--accent-primary);
    background-color: rgba(0, 229, 255, 0.03);
    border-radius: 50%;
    position: fixed;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 9998;
    box-shadow: var(--glow-shadow);
    transition: transform 0.08s ease-out, width 0.2s, height 0.2s, background-color 0.2s;
}

/* Custom cursor modifier on hover */
body.cursor-hovering .custom-cursor-glow {
    width: 60px;
    height: 60px;
    background-color: rgba(0, 229, 255, 0.1);
    border-color: var(--accent-primary);
}

body.cursor-hovering .custom-cursor-dot {
    width: 4px;
    height: 4px;
}

/* Hide cursor on small screens */
@media (max-width: 1024px) {
    .custom-cursor-dot, .custom-cursor-glow {
        display: none !important;
    }
}

/* ----------------------------------------------------
 * 4. Header & Navigation (Glassmorphism Navbar)
 * ---------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-normal);
    padding: 15px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition-smooth);
}

.logo-container a {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.logo-icon {
    color: var(--accent-primary);
    font-weight: 900;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 25px;
}

.nav-links a {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
}

.nav-links a:hover, .nav-links a.active {
    color: var(--accent-primary);
    text-shadow: 0 0 10px rgba(0, 229, 255, 0.5);
}

.search-trigger-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.search-trigger-btn:hover {
    color: var(--accent-primary);
}

/* Mobile Nav Toggle */
.mobile-nav-toggle {
    display: none;
    font-size: 24px;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
}

/* ----------------------------------------------------
 * 5. Layout and Spacing System
 * ---------------------------------------------------- */
.section-container {
    padding: 80px 8%;
    max-width: 1400px;
    margin: 0 auto;
}

.text-center {
    text-align: center;
}

.section-title {
    font-size: 42px;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 15px;
    background: linear-gradient(135deg, #FFFFFF 0%, #A0AEC0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section-subtitle {
    font-size: 16px;
    color: var(--text-muted);
    max-width: 650px;
    margin: 0 auto 50px auto;
}

/* ----------------------------------------------------
 * 6. UI Components: Cards & Glassmorphism
 * ---------------------------------------------------- */
.glass-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-normal);
    border-radius: 12px;
    padding: 30px;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(12px);
}

/* Spotlight Hover Effect styling */
.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(800px circle at var(--mouse-x, 0) var(--mouse-y, 0), rgba(0, 229, 255, 0.08), transparent 40%);
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s;
}

.glass-card:hover::before {
    opacity: 1;
}

.glass-card:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 10px 30px rgba(0, 229, 255, 0.05);
    transform: translateY(-4px);
}

/* Glowing Border highlights */
.glow-border {
    position: relative;
}

.glow-border::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    border: 1px solid var(--accent-primary);
    opacity: 0;
    transition: var(--transition-smooth);
    pointer-events: none;
    box-shadow: var(--glow-shadow);
}

.glow-border:hover::after {
    opacity: 0.5;
}

/* ----------------------------------------------------
 * 7. Buttons & Form inputs
 * ---------------------------------------------------- */
.btn-primary {
    background: #FFFFFF;
    color: #050816;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    border: none;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
    background: var(--accent-primary);
    color: #050816;
    box-shadow: var(--glow-shadow);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-normal);
    color: var(--text-primary);
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.btn-secondary:hover {
    border-color: var(--accent-primary);
    background: rgba(0, 229, 255, 0.05);
    color: var(--accent-primary);
    box-shadow: var(--glow-shadow);
}

.btn-cyan {
    background: var(--accent-primary);
    color: #050816;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--glow-shadow);
}

.btn-cyan:hover {
    background: #FFFFFF;
    color: #050816;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

/* Forms */
.form-input {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-normal);
    border-radius: 8px;
    padding: 14px 20px;
    color: var(--text-primary);
    font-size: 15px;
    width: 100%;
    outline: none;
    transition: var(--transition-smooth);
}

.form-input:focus {
    border-color: var(--accent-primary);
    box-shadow: var(--glow-shadow);
    background: rgba(255, 255, 255, 0.05);
}

/* ----------------------------------------------------
 * 8. Hero Section
 * ---------------------------------------------------- */
.hero-wrapper {
    min-height: 85vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    padding: 100px 5%;
}

.hero-tagline {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent-primary);
    margin-bottom: 20px;
    text-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
}

.hero-headline {
    font-size: 64px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -2px;
    max-width: 900px;
    margin-bottom: 25px;
    background: linear-gradient(to right, #FFFFFF 30%, #A0AEC0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subheadline {
    font-size: 20px;
    color: var(--text-muted);
    max-width: 700px;
    margin-bottom: 40px;
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

/* ----------------------------------------------------
 * 9. Timeline Component
 * ---------------------------------------------------- */
.timeline-container {
    position: relative;
    padding-left: 50px;
    margin: 50px 0;
}

.timeline-container::before {
    content: '';
    position: absolute;
    left: 19px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--accent-primary), var(--accent-secondary), transparent);
}

.timeline-item {
    position: relative;
    margin-bottom: 40px;
}

.timeline-badge {
    position: absolute;
    left: -50px;
    top: 4px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 2px solid var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--accent-primary);
    box-shadow: var(--glow-shadow);
}

.timeline-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.timeline-desc {
    color: var(--text-muted);
    font-size: 15px;
}

/* ----------------------------------------------------
 * 10. Tags & Badges
 * ---------------------------------------------------- */
.badge-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(0, 229, 255, 0.08);
    border: 1px solid rgba(0, 229, 255, 0.2);
    color: var(--accent-primary);
}

.badge-tag.blue {
    background: rgba(91, 140, 255, 0.08);
    border-color: rgba(91, 140, 255, 0.2);
    color: var(--accent-secondary);
}

.badge-tag.green {
    background: rgba(0, 208, 132, 0.08);
    border-color: rgba(0, 208, 132, 0.2);
    color: var(--accent-success);
}

/* ----------------------------------------------------
 * 11. Search Overlay System
 * ---------------------------------------------------- */
.search-overlay-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(5, 8, 22, 0.95);
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-smooth);
    display: flex;
    justify-content: center;
    padding-top: 10vh;
}

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

.search-modal-content {
    width: 90%;
    max-width: 800px;
}

.search-input-wrapper {
    position: relative;
    margin-bottom: 30px;
}

.search-modal-input {
    width: 100%;
    background: var(--bg-secondary);
    border: 2px solid var(--border-normal);
    border-radius: 12px;
    padding: 20px 60px 20px 25px;
    color: var(--text-primary);
    font-size: 20px;
    outline: none;
    transition: var(--transition-smooth);
}

.search-modal-input:focus {
    border-color: var(--accent-primary);
    box-shadow: var(--glow-shadow);
}

.search-close-btn {
    position: absolute;
    right: 25px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
}

.search-close-btn:hover {
    color: var(--accent-primary);
}

.search-results-container {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 10px;
}

.search-result-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-normal);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    transition: var(--transition-smooth);
    display: block;
}

.search-result-item:hover {
    border-color: var(--accent-primary);
    background: rgba(0, 229, 255, 0.03);
}

/* ----------------------------------------------------
 * 12. Grid and Custom Card Lists
 * ---------------------------------------------------- */
.cards-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.cards-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

.cards-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* ----------------------------------------------------
 * 13. Dynamic Filter Panel
 * ---------------------------------------------------- */
.directory-filter-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.filter-select {
    background: var(--bg-secondary);
    border: 1px solid var(--border-normal);
    color: var(--text-primary);
    padding: 12px 20px;
    border-radius: 8px;
    outline: none;
    font-size: 14px;
    cursor: pointer;
}

.filter-select:focus {
    border-color: var(--accent-primary);
}

/* ----------------------------------------------------
 * 14. Responsive Layouts
 * ---------------------------------------------------- */
@media (max-width: 1200px) {
    .cards-grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    .cards-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .site-header {
        padding: 15px 20px;
    }
    .nav-links {
        display: none; /* Hide standard nav links on mobile for drawer */
    }
    .mobile-nav-toggle {
        display: block;
    }
    .section-container {
        padding: 50px 20px;
    }
    .section-title {
        font-size: 32px;
    }
    .hero-headline {
        font-size: 42px;
    }
    .hero-subheadline {
        font-size: 16px;
    }
    .cards-grid-3, .cards-grid-2, .cards-grid-4 {
        grid-template-columns: 1fr;
    }
    .directory-filter-bar {
        flex-direction: column;
    }
}

/* ----------------------------------------------------
 * 15. Keyframe Animations & Utilities
 * ---------------------------------------------------- */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Accessibility outline indicators */
.focus-outline:focus-visible {
    outline: 2px solid var(--accent-primary) !important;
    outline-offset: 4px !important;
}

/* ----------------------------------------------------
 * 16. Technical Article Grid Layout
 * ---------------------------------------------------- */
@media (max-width: 768px) {
    .article-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ----------------------------------------------------
 * 17. Print Stylesheet
 * ---------------------------------------------------- */
@media print {
    body { background: white !important; color: black !important; }
    .print-hide, .site-header, footer, aside, #reading-progress-bar, .breadcrumbs-container { display: none !important; }
    .article-grid { grid-template-columns: 1fr !important; }
    .article-body-content { width: 100% !important; }
    h1, h2, h3, h4 { color: black !important; }
    p, li, td { color: #333 !important; }
    .glass-card { background: none !important; border: 1px solid #ccc !important; color: black !important; }
    .markdown-content a { color: black !important; border-bottom: 1px solid black !important; }
}

/* ----------------------------------------------------
 * 18. Double Column Documentation Layout & TOC
 * ---------------------------------------------------- */
.doc-layout-grid {
    display: grid;
    grid-template-columns: 1fr 3fr;
    gap: 60px;
    align-items: start;
}

.doc-sidebar {
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    padding-right: 15px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.05) transparent;
}

.doc-sidebar::-webkit-scrollbar {
    width: 4px;
}
.doc-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.05);
    border-radius: 4px;
}

.doc-content {
    min-width: 0;
}

.toc-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toc-link {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    padding: 6px 12px;
    border-left: 2px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition-smooth);
    display: block;
}

.toc-link:hover, .toc-link.active {
    color: var(--accent-primary);
    border-left-color: var(--accent-primary);
    background: rgba(0, 229, 255, 0.02);
    text-shadow: 0 0 10px rgba(0, 229, 255, 0.2);
}

/* Accordion Style FAQ */
.faq-accordion-item {
    border: 1px solid var(--border-normal);
    border-radius: 8px;
    margin-bottom: 12px;
    background: rgba(11, 18, 32, 0.4);
    overflow: hidden;
    transition: var(--transition-smooth);
}

.faq-accordion-item:hover {
    border-color: var(--accent-primary);
}

.faq-trigger {
    width: 100%;
    background: none;
    border: none;
    padding: 18px 24px;
    text-align: left;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    transition: var(--transition-smooth);
}

.faq-trigger::after {
    content: '+';
    font-size: 20px;
    font-weight: 400;
    color: var(--accent-primary);
    transition: transform 0.3s;
}

.faq-accordion-item.active .faq-trigger::after {
    content: '\u2212';
    transform: rotate(180deg);
}

.faq-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.7;
    padding: 0 24px;
}

.faq-accordion-item.active .faq-panel {
    max-height: 500px;
    padding-bottom: 20px;
}

.privacy-intro-lead {
    font-size: 18px;
    line-height: 1.8;
    color: #fff;
    margin-bottom: 30px;
}

.policy-card-info {
    margin-top: 30px;
}

.doc-content-section {
    margin-bottom: 60px;
}

.doc-content-section h2 {
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 20px;
    border-left: 3px solid var(--accent-primary);
    padding-left: 15px;
}

.doc-content-section h3 {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin: 25px 0 15px 0;
}

.doc-content-section p {
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.8;
    margin-bottom: 20px;
}

.doc-content-section ul {
    margin: 15px 0 25px 20px;
    list-style-type: square;
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.8;
}

.doc-content-section li {
    margin-bottom: 8px;
}

.doc-content-section table {
    width: 100%;
    border-collapse: collapse;
    margin: 25px 0;
    font-size: 14px;
}

.doc-content-section th {
    padding: 12px 16px;
    font-weight: 700;
    color: var(--accent-primary);
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 2px solid var(--border-normal);
    text-align: left;
}

.doc-content-section td {
    padding: 12px 16px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-normal);
}

@media (max-width: 1024px) {
    .doc-layout-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .doc-sidebar {
        position: static;
        max-height: none;
        overflow: visible;
        padding-right: 0;
        border-bottom: 1px solid var(--border-normal);
        padding-bottom: 30px;
        margin-bottom: 20px;
    }
}

/* ----------------------------------------------------
 * 18. Mobile UX/UI Redesign & Component Refactoring
 * ---------------------------------------------------- */

/* Fluid Typography overrides */
.hero-headline {
    font-size: var(--fs-hero-title) !important;
    line-height: 1.2 !important;
    letter-spacing: -1px !important;
}

.section-title {
    font-size: var(--fs-section-title) !important;
    line-height: 1.3 !important;
}

.glass-card h3 {
    font-size: var(--fs-card-title) !important;
}

/* Accessible Mobile Navigation Drawer */
.mobile-nav-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10000;
    visibility: hidden;
    pointer-events: none;
    transition: visibility var(--transition-normal);
}

.mobile-nav-drawer.mobile-nav-open {
    visibility: visible;
    pointer-events: auto;
}

.mobile-nav-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 8, 22, 0.85);
    backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.mobile-nav-drawer.mobile-nav-open .mobile-nav-overlay {
    opacity: 1;
}

.mobile-nav-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 320px;
    max-width: 100%;
    height: 100%;
    background: #0B1220;
    border-left: 1px solid var(--border-normal);
    display: flex;
    flex-direction: column;
    padding: 20px 24px;
    transform: translateX(100%);
    transition: transform var(--transition-normal);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
}

.mobile-nav-drawer.mobile-nav-open .mobile-nav-content {
    transform: translateX(0);
}

.mobile-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-normal);
}

.mobile-nav-close {
    font-size: 28px;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition-fast);
}

.mobile-nav-close:hover {
    color: var(--accent-primary);
    background: rgba(255, 255, 255, 0.03);
}

.mobile-nav-body {
    flex-grow: 1;
    overflow-y: auto;
}

.mobile-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.mobile-nav-list li a {
    display: block;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-muted);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
}

.mobile-nav-list li a:hover,
.mobile-nav-list li a.active {
    color: var(--accent-primary);
    background: rgba(0, 229, 255, 0.05);
    padding-left: 20px;
}

/* Contact Page Refactored Layout */
.contact-section-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: var(--padding-section-y) var(--padding-section-x);
}

.contact-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.contact-layout-grid {
    display: grid;
    grid-template-columns: 1.8fr 1fr;
    gap: var(--space-xl);
}

.contact-form-card {
    padding: var(--padding-card);
}

.contact-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.contact-submit-wrapper {
    display: flex;
    justify-content: flex-end;
}

.contact-submit-btn {
    min-width: 160px;
    justify-content: center;
    height: 48px;
}

.contact-sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.contact-info-card {
    padding: var(--padding-card);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

/* Responsive Footer Redesign */
.site-footer {
    border-top: 1px solid var(--border-normal);
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    padding: var(--padding-section-y) var(--padding-section-x);
    position: relative;
    z-index: 10;
}

.footer-layout-grid {
    max-width: var(--container-max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2.2fr 1fr 1fr 1.8fr;
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

/* Stacking Alternating Homepage Sections */
@media (max-width: 768px) {
    #ai-agents-hub > div,
    #automation-hub > div {
        display: flex !important;
        flex-direction: column-reverse !important;
        gap: var(--space-lg) !important;
    }
}

/* Layout overrides & reflow below 768px */
@media (max-width: 768px) {
    .site-header {
        height: var(--site-header-height) !important;
        padding: 0 20px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
    }
    
    .site-header .logo-container a {
        font-size: 16px !important;
    }
    
    .search-trigger-btn,
    .mobile-nav-toggle {
        min-width: 48px;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 0;
        font-size: 20px !important;
    }

    .hero-wrapper {
        min-height: 60vh !important;
        padding: 60px 20px !important;
    }
    
    .hero-tagline {
        margin-bottom: var(--space-xs) !important;
    }
    
    .hero-headline {
        margin-bottom: var(--space-sm) !important;
    }
    
    .hero-subheadline {
        margin-bottom: var(--space-md) !important;
        font-size: 15px !important;
    }
    
    .hero-actions {
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100% !important;
        gap: 12px !important;
    }
    
    .hero-actions a {
        width: 100% !important;
        text-align: center !important;
    }

    .contact-layout-grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }
    
    .contact-form-row {
        grid-template-columns: 1fr;
        gap: var(--space-sm);
    }
    
    .contact-submit-wrapper {
        justify-content: stretch;
    }
    
    .contact-submit-btn {
        width: 100%;
    }

    .footer-layout-grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
        margin-bottom: var(--space-lg);
    }

    /* Stack filter dropdowns */
    .directory-filter-bar {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        gap: var(--space-xs) !important;
        align-items: stretch !important;
    }
    
    .directory-filter-bar > * {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    #glossary-search-input {
        max-width: 100% !important;
        width: 100% !important;
    }
}

/* Touch targets standardization */
.btn-primary, .btn-secondary, .btn-cyan, .form-input, .filter-select {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
}

/* Scroll lock when mobile navigation is open */
body.mobile-nav-active {
    overflow: hidden !important;
}

/* Sub-footer styling */
.sub-footer-container {
    border-top: 1px solid var(--border-normal);
    padding-top: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: var(--container-max-width);
    margin: 0 auto;
    flex-wrap: wrap;
    gap: 20px;
    font-size: 12px;
    color: var(--text-muted);
}

.sub-footer-links {
    display: flex;
    gap: 20px;
}

.sub-footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition-fast);
}

.sub-footer-links a:hover {
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .sub-footer-container {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    .sub-footer-links {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }
}

/* ==========================================================================
   AI DELIVERY HUB DESIGN SYSTEM - LAYOUTS, COMPONENTS & UTILITIES
   ========================================================================== */

/* 1. Global Layout Constraints */
.site-container {
    width: 100%;
    margin: 0 auto;
    padding: 0 var(--space-md);
    box-sizing: border-box;
}

@media (min-width: 1024px) {
    .site-container {
        padding: 0 8%;
    }
}

/* Container Width Modifier Tokens */
.container-xs { max-width: var(--container-xs); }
.container-sm { max-width: var(--container-sm); }
.container-md { max-width: var(--container-md); }
.container-lg { max-width: var(--container-lg); }
.container-xl { max-width: var(--container-xl); }

.page-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

.section-wrapper {
    padding: var(--padding-section-y) 0;
    position: relative;
}

/* 2. Standardized Layout Grid Utilities */
.layout-content {
    width: 100%;
}

.layout-content-sidebar {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
    width: 100%;
}

@media (min-width: 1024px) {
    .layout-content-sidebar {
        grid-template-columns: 2.5fr 1fr;
        gap: 40px;
    }
}

.layout-article-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
    width: 100%;
}

@media (min-width: 1024px) {
    .layout-article-grid {
        grid-template-columns: 2.6fr 1fr;
        gap: 50px;
    }
}

.layout-comparison-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
    width: 100%;
}

@media (min-width: 768px) {
    .layout-comparison-grid {
        grid-template-columns: 1fr 1fr;
        gap: 30px;
    }
}

.layout-auto-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-md);
}

.layout-stack-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

/* Master 2-Column Responsive Layout Grid (Legacy compatibility) */
.content-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
    width: 100%;
}

@media (min-width: 1024px) {
    .content-wrapper {
        grid-template-columns: 2.5fr 1fr;
    }
}

.primary-content {
    min-width: 0;
    width: 100%;
}

.secondary-sidebar {
    width: 100%;
}

@media (min-width: 1024px) {
    .secondary-sidebar {
        position: sticky;
        top: 100px;
    }
}

/* Grid System Primitives (Legacy compatibility) */
.auto-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-md);
}

.two-column-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
}

@media (min-width: 768px) {
    .two-column-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.three-column-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
}

@media (min-width: 768px) {
    .three-column-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .three-column-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 3. Card Component Primitive (.info-card) */
.info-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-normal);
    border-radius: var(--radius-lg);
    padding: var(--padding-card);
    margin-bottom: var(--space-md);
    box-sizing: border-box;
    transition: border-color var(--transition-normal), box-shadow var(--transition-normal), transform var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.info-card:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

/* 4. Metadata Grid Primitive (.meta-grid) */
.meta-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-sm);
    padding: var(--space-sm) 0;
    border-top: 1px solid var(--border-normal);
    border-bottom: 1px solid var(--border-normal);
    margin: var(--space-md) 0;
    font-size: var(--fs-meta);
    color: var(--text-muted);
}

@media (min-width: 480px) {
    .meta-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .meta-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.meta-grid span strong {
    color: var(--text-primary);
}

/* 5. Responsive Tables & Code Blocks */
.responsive-table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: var(--space-md);
    border: 1px solid var(--border-normal);
    border-radius: var(--radius-md);
    background: rgba(0, 0, 0, 0.2);
}

.responsive-table-wrapper table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: var(--fs-small);
}

.responsive-table-wrapper th {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 2px solid var(--border-normal);
    font-weight: 700;
    color: var(--accent-primary);
}

.responsive-table-wrapper td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-normal);
    color: var(--text-muted);
}

.responsive-table-wrapper tr:last-child td {
    border-bottom: none;
}

.responsive-code-block {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-normal);
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-md);
    margin-bottom: var(--space-md);
}

.responsive-code-block pre {
    font-family: monospace;
    font-size: var(--fs-small);
    color: #fff;
    margin: 0;
    white-space: pre;
}

/* 6. Form Components (Design System) */
.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    margin-bottom: var(--space-md);
    width: 100%;
}

.form-group label {
    font-size: var(--fs-meta);
    font-weight: 600;
    color: var(--text-muted);
}

.form-input-control {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-normal);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 12px 16px;
    font-size: var(--fs-body);
    transition: var(--transition-fast);
    min-height: 48px;
}

.form-input-control:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-focus);
}

.form-input-control:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.form-error-msg {
    color: var(--accent-error);
    font-size: var(--fs-small);
    margin-top: 4px;
}

.form-success-msg {
    color: var(--accent-success);
    font-size: var(--fs-small);
    margin-top: 4px;
}

/* 7. Empty States & Skeleton Loaders */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-xl) var(--space-md);
    border: 1px dashed var(--border-normal);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.01);
}

.empty-state-icon {
    font-size: 40px;
    margin-bottom: var(--space-sm);
    color: var(--accent-secondary);
}

.empty-state-title {
    font-size: var(--fs-card-title);
    font-weight: 700;
    margin-bottom: var(--space-xs);
    color: var(--text-primary);
}

.empty-state-desc {
    font-size: var(--fs-body);
    color: var(--text-muted);
    max-width: 500px;
    margin-bottom: var(--space-md);
}

.skeleton-loader {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.03) 75%);
    background-size: 200% 100%;
    animation: skeleton-pulse 1.5s infinite var(--ease-premium);
    border-radius: var(--radius-md);
}

@keyframes skeleton-pulse {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* 8. Spacing and Responsive Utilities */
.content-stack {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.stack-mobile {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

@media (min-width: 768px) {
    .stack-mobile {
        flex-direction: row;
        align-items: center;
    }
}

.hide-mobile {
    display: none !important;
}

@media (min-width: 768px) {
    .hide-mobile {
        display: block !important;
    }
}

.hide-desktop {
    display: block !important;
}

@media (min-width: 1024px) {
    .hide-desktop {
        display: none !important;
    }
}

.center-mobile {
    text-align: center;
}

@media (min-width: 768px) {
    .center-mobile {
        text-align: left;
    }
}

.full-width-mobile {
    width: 100% !important;
}

@media (min-width: 768px) {
    .full-width-mobile {
        width: auto !important;
    }
}

.break-anywhere {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.max-content-width {
    max-width: 100%;
    box-sizing: border-box;
}

.scroll-x {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ==========================================================================
   AI DELIVERY HUB DESIGN SYSTEM - COMPONENTS NORMALIZATION (PHASE 2)
   ========================================================================== */

/* 1. Newsletter Subscription Component */
.newsletter-subscription-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.newsletter-subscription-form input[type="email"],
.newsletter-subscription-form .form-input-control {
    flex: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--border-normal);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    height: 48px;
    outline: none;
    transition: var(--transition-fast);
}

.newsletter-subscription-form input[type="email"]:focus,
.newsletter-subscription-form .form-input-control:focus {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-focus);
}

.newsletter-subscription-form button[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--accent-primary);
    color: var(--bg-primary);
    border: none;
    border-radius: var(--radius-sm);
    padding: 0 24px;
    font-weight: 700;
    font-size: 14px;
    height: 48px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.newsletter-subscription-form button[type="submit"]:hover {
    background-color: var(--accent-secondary);
    color: var(--text-primary);
}

@media (min-width: 768px) {
    .newsletter-subscription-form.stack-mobile {
        flex-direction: row;
        align-items: center;
    }
}

/* 2. Background Canvas & Decorative Elements Overlay Click Protection */
.network-bg-canvas,
.grid-bg-overlay,
.radial-darkness-overlay {
    pointer-events: none !important;
    user-select: none !important;
    z-index: -10 !important;
    overflow: hidden;
}

/* 3. Reusable Cards Spacing Normalization */
.glass-card,
.info-card {
    padding: var(--padding-card) !important;
    margin-bottom: var(--space-md);
}



