/* Main App Layout */
#app {
    display: flex;
    height: 100vh;
    /* Fallback */
    height: 100dvh;
    /* Mobile browser friendly */
    width: 100vw;
    overflow: hidden;
    /* Prevent body scroll */
}

/* Sidebar */
#sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-medium);
    z-index: 10;
}

#sidebar.collapsed {
    transform: translateX(-100%);
    position: absolute;
    height: 100%;
}

.sidebar-header {
    padding: 1.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent-primary);
    border-bottom: 1px solid var(--border-color);
}

.agenda-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE 10+ */
}

.agenda-list::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari/Webkit */
}

.agenda-item {
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.agenda-item:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}


.agenda-item.active {
    background-color: var(--accent-primary);
    color: white;
    box-shadow: 0 4px 6px -1px var(--accent-glow);
}

.sidebar-footer {
    padding: 0.75rem;
    font-size: 0.55rem;
    color: var(--accent-primary);
    /* More subtle color */
    border-top: 1px solid var(--border-color);
    text-align: center;
    background-color: var(--bg-secondary);
    opacity: 1;
}

.sidebar-footer p {
    margin: 0.25rem 0;
}

/* Main Content Area */
#main-content {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    /* Clean white background instead of dark radial */
    background: var(--bg-primary);
    height: 100%;
    overflow: hidden;
}

/* Slide Canvas */
#slide-canvas {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    overflow: hidden;
    position: relative;
    /* Ensure padding for the absolute badge if we want it global, 
       but slides are absolute. Let's handle it in .slide */
}

.slide {
    width: 100%;
    max-width: 1200px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    position: absolute;
    pointer-events: none;

    /* Global safe zone for the badge */
    padding-left: 6rem;
    /* Enough space for 60px badge + gap */
    padding-top: 4rem;
    /* Top margin */
    box-sizing: border-box;
}

.slide.active {
    opacity: 1;
    transform: translateY(0);
    position: relative;
    pointer-events: all;
    display: flex;
}

/* ... existing styles ... */

/* Footer Controls */
#footer-controls {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    background: #ffffff;
    border-top: 1px solid var(--border-color);
    position: relative;
    z-index: 20;
}

/* ... existing styles ... */

/* --- COMPREHENSIVE MOBILE OPTIMIZATIONS (768px and below) --- */
@media (max-width: 768px) {

    /* 1. Sidebar & Navigation */
    #sidebar {
        position: fixed;
        height: 100dvh;
        z-index: 1000;
        /* Sidebar on very top */
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
    }

    /* Fixed Footer for Mobile */
    #footer-controls {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 80px;
        /* Taller for mobile */
        padding: 0.5rem 1rem;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
        z-index: 500;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        flex-wrap: nowrap;
        /* Keep on one line if possible, or organize better */
        display: grid;
        grid-template-columns: 40px 1fr 40px;
        align-items: center;
        gap: 0.5rem;
    }

    #toggle-sidebar-btn {
        grid-column: 1;
        position: static;
        /* Reset absolute */
        font-size: 1.5rem;
        width: 40px;
        height: 40px;
    }

    .nav-controls {
        grid-column: 2;
        width: 100%;
        margin-top: 0;
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 1rem;
    }

    #slide-counter {
        font-size: 0.9rem;
        min-width: 50px;
        text-align: center;
    }

    .misc-controls {
        grid-column: 3;
        position: static;
        /* Reset absolute */
        display: flex;
        justify-content: flex-end;
    }

    #fullscreen-btn {
        display: none !important;
    }

    .control-btn {
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        background: transparent;
    }

    .control-btn:hover {
        background: rgba(0, 0, 0, 0.05);
        /* Subtle touch feedback */
    }

    /* 2. Slide Layout & Canvas */
    #slide-canvas {
        /* Add huge bottom padding so content doesn't stuck behind fixed footer */
        padding: 4rem 1.5rem 100px 1.5rem !important;
        align-items: flex-start !important;
        overflow-y: auto !important;
        height: 100dvh;
        /* Full viewport height */
        display: block !important;
        /* Allow block flow for scrolling */
    }

    .slide {
        padding-left: 0 !important;
        padding-top: 0 !important;
        height: auto !important;
        min-height: auto;
        display: block !important;
        /* Stack content naturally */
        position: relative !important;
    }

    /* Hide non-active slides */
    .slide:not(.active) {
        display: none !important;
    }

    /* 6. Blueprint / Cover Slide Mobile */
    .bp-container {
        position: fixed !important;
        /* Lock it */
        top: 0;
        left: 0;
        width: 100vw;
        height: 100dvh;
        z-index: 600;
        /* Above footer! Cover slide hides controls */
        overflow-y: auto;
        background: white;
    }

    .bp-content {
        min-height: 100dvh;
        padding: 2rem 1.5rem !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        text-align: center !important;
        gap: 1.5rem;
    }

    /* Hide Footer Controls ONLY when Cover Slide is Active? 
       Actually, common pattern is: Title slide has Big Button. 
       Footer controls can be hidden behind it (z-index 600 vs 500).
       This looks cleaner.
    */

    /* Fix Blueprint Content Sizing */
    .bp-text-group {
        width: 100%;
        margin-top: 1rem;
    }

    .bp-container h1 {
        font-size: 2.5rem !important;
        line-height: 1.1;
        margin-bottom: 0.5rem;
    }

    .bp-sub {
        font-size: 1rem !important;
        color: #64748b;
        margin-top: 0.5rem;
    }

    .bp-cta {
        width: 100%;
        display: flex;
        justify-content: center;
        margin-top: 2rem !important;
        padding-bottom: 2rem;
        /* Buffer */
    }

    .bp-cta button {
        width: 80%;
        padding: 1rem;
        font-size: 1.1rem;
    }

    .bp-blueprint {
        opacity: 0.2 !important;
        top: 10%;
        /* Move up a bit */
    }

    .bp-blueprint svg {
        width: 150%;
        /* Zoom in on the pattern */
        transform: translateX(-15%);
    }

    /* --- Space Animation Mobile --- */
    #space-overlay {
        z-index: 9999;
        /* Highest */
    }

    .message-container {
        width: 90%;
    }

    .main-text {
        font-size: 2.5rem;
    }

    .sub-text {
        font-size: 1rem;
    }
}

.slide-title {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    color: #1e3a8a;
    /* Remove manual margins as container has padding */
    margin-left: 0 !important;
    margin-top: 0 !important;
    line-height: 1.1;
}

.slide-intro-text {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
    max-width: 900px;
    /* Readability */
}

.slide-bullets li {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
    position: relative;
}

.slide-bullets li::before {
    content: "•";
    color: var(--accent-primary);
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* Portfolio Grid */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    width: 100%;
    margin-top: 2rem;
}

.tool-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    border-color: var(--accent-primary);
}

.tool-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    object-fit: contain;
}

.tool-name {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.tool-tag {
    font-size: 0.8rem;
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-primary);
    padding: 0.25rem 0.6rem;
    border-radius: 100px;
    display: inline-block;
}

/* Footer Controls */
#footer-controls {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    background: #ffffff;
    border-top: 1px solid var(--border-color);
}

.progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--accent-primary);
    width: 0%;
    transition: width 0.3s ease;
}

.control-btn {
    color: var(--text-secondary);
    padding: 0.5rem;
    border-radius: 4px;
    transition: color 0.2s;
}

.control-btn:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

/* Demo Mode / Split View */
.demo-container {
    display: flex;
    width: 100%;
    height: 100%;
    gap: 1.5rem;
}

.demo-sidebar {
    width: 300px;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.demo-viewer {
    flex: 1;
    background: #000;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    position: relative;
}

.demo-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #fff;
    /* Most tools are light mode probably */
}

/* Fallback UI */
.fallback-ui {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    max-width: 400px;
}

.primary-btn {
    background: var(--accent-primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    margin-top: 1rem;
    display: inline-block;
    transition: background 0.2s;
}

.primary-btn:hover {
    background: #2563eb;
}

/* Loader */
.loader {
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-left-color: var(--accent-primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    margin-top: -20px;
    margin-left: -20px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* NEW LAYOUTS */

/* Split Text */
.split-layout {
    display: flex;
    gap: 4rem;
    margin-top: 2rem;
    align-items: flex-start;
}

.split-col {
    flex: 1;
}

.text-accent {
    color: var(--accent-primary);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

/* Comparison */
.comparison-container {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-top: 2rem;
}

.comparison-col {
    flex: 1;
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.comparison-col h3 {
    margin-bottom: 1rem;
    text-align: center;
    color: var(--text-primary);
}

.comparison-col.before {
    border-top: 4px solid var(--text-muted);
}

.comparison-col.after {
    border-top: 4px solid var(--success);
}

.comparison-col ul {
    list-style: disc;
    padding-left: 1.5rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.comparison-arrow {
    font-size: 2rem;
    color: var(--accent-primary);
}

/* Roadmap */
.roadmap-container {
    display: flex;
    justify-content: space-between;
    margin-top: 4rem;
    position: relative;
}

.roadmap-container::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--bg-tertiary);
    z-index: 0;
}

.roadmap-item {
    position: relative;
    z-index: 1;
    text-align: center;
    flex: 1;
    padding: 0 1rem;
}

.roadmap-item::before {
    content: '';
    width: 40px;
    height: 40px;
    background: var(--bg-secondary);
    border: 2px solid var(--accent-primary);
    border-radius: 50%;
    display: block;
    margin: 0 auto 1.5rem auto;
}

.roadmap-time {
    color: var(--accent-primary);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

/* Slide Number Badge */
.slide-number-badge {
    position: absolute;
    top: 4rem;
    /* Match slide padding-top */
    left: 0;
    /* Inside the relative container's padding-box? No, container is relative? */
    /* Wait, .slide is Position Relative when active. 4rem top is good. 
       Left should be 0 relative to slide content? 
       Actually, if we pad padding-left: 6rem, and badge is left: 0, it fits. */
    left: 1rem;
    width: 60px;
    height: 60px;
    border: 4px solid;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 700;
    font-family: var(--font-heading);
    opacity: 0.9;
    z-index: 5;
    background: #fff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Make sure text doesn't overlap the badge if it's top-left */
.slide-title {
    margin-top: 0;
    margin-left: 0;
    line-height: 1.2;
}

/* Adjust Comparison Layout to be less weird with new headers */
.comparison-col h3 {
    font-size: 1.25rem;
    font-weight: 700;
}

/* Intro Text styling */
.slide-intro-text {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin: 0 5rem 2rem 5rem;
    line-height: 1.6;
}

/* Comparison Bridge */
.comparison-bridge {
    flex: 0 0 250px;
    text-align: center;
    font-weight: 700;
    color: var(--accent-primary);
    font-size: 1.2rem;
    padding: 0 1rem;
    line-height: 1.4;
    font-style: italic;
}

/* Comparison Footer */
.comparison-footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px dashed rgba(0, 0, 0, 0.1);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-muted);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Specific Colors for Comparison Cols */
.comparison-col.before {
    border-top: 6px solid #3b82f6;
    background: #eff6ff;
}

.comparison-col.after {
    border-top: 6px solid #10b981;
    background: #f0fdf4;
}


/* --- Responsive Design --- */

/* Small Laptops (1024px) */
@media (max-width: 1024px) {
    .slide-title {
        font-size: 2.5rem;
        margin-left: 4.5rem;
        /* Adjust for smaller badge */
    }

    .slide-intro-text {
        font-size: 1.1rem;
        margin: 0 2rem 1.5rem 2rem;
    }

    .comparison-container {
        gap: 1rem;
    }

    .comparison-bridge {
        flex: 0 0 180px;
        font-size: 1rem;
    }
}

/* (Mobile styles consolidated at the bottom of file) */

/* --- INLINE BADGE REFACTOR --- */

/* Reset Slide Container */
.slide {
    padding-left: 0 !important;
    padding-top: 0 !important;
}

/* New Inline Badge Style */
.slide-number-badge {
    position: static !important;
    display: inline-flex !important;
    width: 48px;
    height: 48px;
    border: 3px solid;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin-right: 1rem;
    vertical-align: middle;
    background: #fff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    /* Don't squash title wraps */
}

/* Flex Title for Alignment */
.slide-title {
    display: flex;
    align-items: center;
    margin-left: 0 !important;
    margin-top: 0 !important;
    text-align: left;
}

/* Fix Intro Text margins */
.slide-intro-text {
    margin: 0 0 2rem 0 !important;
    /* Remove huge side margins */
    max-width: 100%;
}


/* --- RESPONSIVE SCALING & SCROLL FIX --- */

/* Allow scrolling if content overflows viewport */
#slide-canvas {
    overflow-y: auto !important;
    /* Allow scroll */
    align-items: flex-start !important;
    /* Top align to allow scrolling down */
    padding-top: 4rem !important;
    /* Space for top */
}

.slide {
    height: auto !important;
    /* Allow content to dictate height */
    min-height: 100%;
    justify-content: flex-start !important;
    /* Top align */
    padding-bottom: 4rem !important;
    /* Space for bottom */
}

/* Base Scaling for Smaller Screens (Laptops) */
@media (max-width: 1366px),
(max-height: 800px) {
    .slide-title {
        font-size: 2.2rem !important;
        margin-bottom: 1rem !important;
    }

    .slide-number-badge {
        width: 40px !important;
        height: 40px !important;
        font-size: 1.2rem !important;
    }

    .slide-intro-text {
        font-size: 1.1rem !important;
        margin-bottom: 1.5rem !important;
    }

    .comparison-col {
        padding: 1rem !important;
    }

    .comparison-col ul li {
        font-size: 0.9rem !important;
        margin-bottom: 0.5rem !important;
    }

    .comparison-col h3 {
        font-size: 1.1rem !important;
    }

    .comparison-bridge {
        font-size: 1rem !important;
        flex: 0 0 150px !important;
    }
}

/* Further Scaling for Tablets */
@media (max-width: 1024px) {
    .slide-title {
        font-size: 1.8rem !important;
    }
}

/* Center Logo Layout adjustment */
.text-center .slide-title {
    justify-content: center;
}

/* Financial Impact Section */
.financial-impact-section {
    margin-top: 1.5rem;
    /* Reduced from 2rem to fit */
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.financial-impact-section h4 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid var(--accent-primary);
    display: inline-block;
    padding-bottom: 0.25rem;
}

.impact-grid {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-top: 0.5rem;
}

.impact-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.impact-item {
    font-weight: 700;
    font-size: 1rem;
}

.impact-col.negative .impact-item {
    color: #ef4444;
    /* Red */
}

.impact-col.positive .impact-item {
    color: #10b981;
    /* Green */
}

.impact-divider {
    width: 1px;
    height: 40px;
    background: var(--border-color);
    margin: 0 1rem;
}

/* Modal Styles */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.custom-modal-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    right: 1.5rem;
    font-size: 2rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
}

.modal-title {
    color: var(--accent-primary);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.modal-intro {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    color: var(--text-secondary);
}

.maturity-levels {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.m-level {
    padding: 1rem;
    border-left: 4px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: 0 8px 8px 0;
}

.m-level h4 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.m-level ul {
    list-style: disc;
    padding-left: 1.5rem;
    color: var(--text-secondary);
}

.m-level.current {
    border-left-color: #3b82f6;
    /* Blue */
    background: #eff6ff;
}

.m-level.target {
    border-left-color: #10b981;
    /* Green */
    background: #f0fdf4;
    border: 2px solid #10b981;
    /* Highlight */
}

.m-badge {
    font-size: 0.8rem;
    background: #3b82f6;
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 100px;
    text-transform: uppercase;
    font-weight: 600;
}

.m-badge.next {
    background: #10b981;
}

.bridge-link {
    display: inline-block;
    margin-top: 0.5rem;
    color: var(--accent-primary);
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
}

.bridge-link:hover {
    color: #1d4ed8;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Detailed Roadmap Styles - Premium Look */
.roadmap-container.detailed {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    margin-top: 3rem;
    position: relative;
    padding-top: 1rem;
    /* Space for connecting line */
}

/* Top connecting line */
.roadmap-container.detailed::before {
    content: '';
    position: absolute;
    top: 2rem;
    /* Align with badges */
    left: 2rem;
    /* Start after first badge center */
    right: 2rem;
    /* End before last badge center */
    height: 4px;
    background: #e2e8f0;
    z-index: 0;
    border-radius: 4px;
    display: block !important;
}

.roadmap-card {
    flex: 1;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem 1.5rem 1.5rem 1.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
    display: flex;
    flex-direction: column;
    text-align: left;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    z-index: 1;
    /* Sit above line */
    overflow: visible;
    /* To allow badge overflow if needed */
}

.roadmap-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Top Border Colors */
.roadmap-card:nth-child(1) {
    border-top: 6px solid #3b82f6;
}

/* Blue */
.roadmap-card:nth-child(2) {
    border-top: 6px solid #10b981;
}

/* Green */
.roadmap-card:nth-child(3) {
    border-top: 6px solid #8b5cf6;
}

/* Purple */

.roadmap-header {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    position: relative;
}

.roadmap-time-badge {
    background: #fff;
    color: var(--text-primary);
    padding: 0.4rem 1rem;
    border-radius: 100px;
    font-size: 0.95rem;
    font-weight: 800;
    display: inline-block;
    margin-bottom: 0.75rem;
    border: 2px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    /* Float nicely */
    transform: translateY(-50%);
    position: absolute;
    top: -2.5rem;
    /* Pull up to sit on top border/line */
    left: 0;
}

/* Adjust colors for badges to match card border */
.roadmap-card:nth-child(1) .roadmap-time-badge {
    border-color: #3b82f6;
    color: #1d4ed8;
}

.roadmap-card:nth-child(2) .roadmap-time-badge {
    border-color: #10b981;
    color: #047857;
}

.roadmap-card:nth-child(3) .roadmap-time-badge {
    border-color: #8b5cf6;
    color: #6d28d9;
}


.roadmap-card h3 {
    font-size: 1.35rem;
    /* Larger font */
    color: var(--text-primary);
    margin: 1.5rem 0 0.5rem 0;
    /* Space for badge */
    line-height: 1.3;
    font-weight: 800;
}

.roadmap-body {
    flex: 1;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.roadmap-objective {
    margin-bottom: 1.25rem;
    font-style: italic;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.roadmap-actions {
    list-style: none;
    /* Custom bullets */
    padding-left: 0;
    margin-bottom: 1.5rem;
}

.roadmap-actions li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.6rem;
    line-height: 1.4;
    color: var(--text-primary);
}

.roadmap-actions li::before {
    content: "•";
    color: var(--accent-primary);
    /* Default color */
    font-weight: bold;
    font-size: 1.2rem;
    position: absolute;
    left: 0;
    top: -2px;
}

/* Custom bullet colors per card */
.roadmap-card:nth-child(1) .roadmap-actions li::before {
    color: #3b82f6;
}

.roadmap-card:nth-child(2) .roadmap-actions li::before {
    color: #10b981;
}

.roadmap-card:nth-child(3) .roadmap-actions li::before {
    color: #8b5cf6;
}

.roadmap-result {
    margin-top: auto;
    background: var(--bg-tertiary);
    /* Light gray */
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-primary);
    border-left: 4px solid var(--text-muted);
    font-weight: 500;
}

.roadmap-impact-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-weight: 700;
    color: var(--success);
    /* Green for impact ($) */
    font-size: 1rem;
    border-top: 1px dashed var(--border-color);
    padding-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* Transversal Bar - Clean & Premium */
.transversal-section {
    margin-top: 3rem;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 100px;
    /* Pillow shape for bar */
    padding: 1rem 2rem;
    text-align: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* Spread items nicely */
    flex-wrap: wrap;
    /* Safe wrapping */
    gap: 1rem;
}

.transversal-section h4 {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
    flex-shrink: 0;
    padding-right: 1.5rem;
    border-right: 2px solid var(--border-color);
}

.transversal-list {
    flex: 1;
    display: flex;
    justify-content: space-around;
    /* Distribute evenly */
    align-items: center;
    gap: 1rem;
}

.transversal-item {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.95rem;
    white-space: nowrap;
}

/* Mobile Responsive Adjustments */
@media (max-width: 1024px) {
    .roadmap-container.detailed {
        flex-direction: column;
        padding-top: 0;
        gap: 2.5rem;
    }

    .roadmap-container.detailed::before {
        display: none;
        /* Hide horizontal line */
    }

    /* Vertical connector line for mobile? */
    .roadmap-container.detailed::after {
        content: '';
        position: absolute;
        top: 0;
        bottom: 0;
        left: 2rem;
        /* Pass through badges */
        width: 4px;
        background: #e2e8f0;
        z-index: 0;
        display: block !important;
    }

    .roadmap-card {
        margin-left: 0;
        /* Or offset for line */
        z-index: 1;
    }

    .roadmap-time-badge {
        position: static;
        /* Reset absolute */
        transform: none;
        margin-bottom: 0.5rem;
    }

    .roadmap-card h3 {
        margin-top: 0.5rem;
    }

    .transversal-section {
        flex-direction: column;
        border-radius: 12px;
        align-items: center;
    }

    .transversal-section h4 {
        border-right: none;
        border-bottom: 2px solid var(--border-color);
        padding-right: 0;
        padding-bottom: 0.5rem;
        width: 100%;
    }

    .transversal-list {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Demo Layer Styles - Fix for Dead Space */
#demo-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #f8fafc;
    z-index: 50;
    /* Ensure it covers slides but allows nav overlay if nav is > 50 */
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#demo-layer.hidden {
    display: none;
}

.demo-container {
    display: flex;
    width: 100%;
    height: 100%;
    /* Ensure content doesn't get hidden behind bottom nav if fixed */
    padding-bottom: 60px;
    box-sizing: border-box;
    padding-top: 0;
    /* Or header space? */
}

.demo-sidebar {
    width: 320px;
    background: white;
    border-right: 1px solid var(--border-color);
    padding: 2rem;
    overflow-y: auto;
    flex-shrink: 0;
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.05);
    z-index: 2;
    height: 100%;
}

.demo-viewer {
    flex: 1;
    background: #e2e8f0;
    /* Darker bg to frame iframe */
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    padding: 1rem;
    /* Frame the tool */
}

.demo-iframe {
    width: 100%;
    height: 100%;
    border: none;
    flex: 1;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Loader for iframe */
.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--accent-primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Mobile Demo Adjustments */
@media (max-width: 1024px) {
    .demo-container {
        flex-direction: column;
    }

    .demo-sidebar {
        width: 100%;
        height: auto;
        max-height: 30vh;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .demo-viewer {
        height: 70vh;
    }
}

/* BLUEPRINT COVER STYLES - Premium Intro */
.bp-container {
    --bg-bp: #ffffff;
    --ink: #002855;
    /* Deacero Corporate Blue */
    --muted: #64748b;
    --line: rgba(0, 40, 85, 0.08);
    --grid: rgba(0, 40, 85, 0.04);

    width: 100vw;
    height: 100vh;
    background: var(--bg-bp);
    color: var(--ink);
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial, sans-serif;
    position: absolute;
    top: 0;
    left: 0;
    overflow: hidden;
    z-index: 10;
}

.bp-grid {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 48px 48px,
        linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 48px 48px;
    opacity: 0.6;
    /* Subtler grid */
    pointer-events: none;
}

.bp-vignette {
    display: none;
    /* Removed for cleaner white look */
}

.bp-blueprint {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.bp-blueprint svg {
    width: min(980px, 92vw);
    height: auto;
}

.bp-line {
    fill: none;
    stroke: var(--line);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: bp-draw 1.8s ease forwards;
}

.bp-line.delay1 {
    animation-delay: .15s;
}

.bp-line.delay2 {
    animation-delay: .30s;
}

.bp-line.delay3 {
    animation-delay: .45s;
}

.bp-line.delay4 {
    animation-delay: .60s;
}

@keyframes bp-draw {
    to {
        stroke-dashoffset: 0;
    }
}

/* Brain/Neural Network Styles */
.bp-node {
    fill: #ffffff;
    stroke: #002855;
    stroke-width: 2px;
    opacity: 0;
    transform-origin: center;
    transform-box: fill-box;
    animation: bp-nodeIn 0.6s ease forwards, bp-pulse 2s ease-in-out infinite;
}

.bp-node.n1 {
    animation-delay: 0.2s, 0.5s;
}

.bp-node.n2 {
    animation-delay: 0.4s, 1.0s;
}

.bp-node.n3 {
    animation-delay: 0.6s, 1.5s;
}

.bp-node.n4 {
    animation-delay: 0.8s, 2.0s;
}

@keyframes bp-nodeIn {
    to {
        opacity: 1;
    }
}

@keyframes bp-pulse {

    0%,
    100% {
        transform: scale(0.7);
        opacity: 0.6;
    }

    50% {
        transform: scale(1.6);
        opacity: 1;
        stroke: #F26522;
        stroke-width: 3px;
    }
}

.bp-line {
    fill: none;
    stroke: rgba(0, 40, 85, 0.3);
    /* Subtle blue lines */
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: bp-draw 1.8s ease forwards;
}




.bp-content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
    padding: 0 24px;
}

.bp-kicker {
    letter-spacing: .22em;
    text-transform: uppercase;
    font-weight: 700;
    font-size: 12px;
    color: rgba(11, 31, 58, .55);
    opacity: 0;
    transform: translateY(6px);
    animation: bp-fadeUp .7s ease forwards;
    animation-delay: .9s;
}

.bp-container h1 {
    margin: 14px 0 6px;
    font-size: clamp(34px, 4.2vw, 54px);
    line-height: 1.08;
    letter-spacing: -.02em;
    opacity: 0;
    transform: translateY(10px);
    animation: bp-fadeUp .9s ease forwards;
    animation-delay: 1.15s;
    color: var(--ink);
}

.bp-sub {
    margin: 8px 0 0;
    font-size: clamp(14px, 1.6vw, 18px);
    color: var(--muted);
    opacity: 0;
    transform: translateY(10px);
    animation: bp-fadeUp .9s ease forwards;
    animation-delay: 1.35s;
}

.bp-cta {
    margin-top: 28px;
    display: flex;
    gap: 12px;
    align-items: center;
    opacity: 0;
    transform: translateY(10px);
    animation: bp-fadeUp .9s ease forwards;
    animation-delay: 1.55s;
}

.bp-cta button {
    border: 1px solid rgba(11, 31, 58, .14);
    background: #fff;
    padding: 10px 14px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    color: var(--ink);
    transition: transform .15s ease, box-shadow .15s ease;
    box-shadow: 0 10px 30px rgba(11, 31, 58, .06);
}

.bp-cta button:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 36px rgba(11, 31, 58, .10);
}

.bp-hint {
    font-size: 13px;
    color: rgba(11, 31, 58, .55);
}

@keyframes bp-fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bp-footerline {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(11, 31, 58, .14), transparent);
}

/* Center aligns */
.slide-intro-text {
    text-align: center;
}

/* --- COMPREHENSIVE MOBILE OPTIMIZATIONS (768px and below) --- */
@media (max-width: 768px) {

    /* 1. Sidebar & Navigation */
    #sidebar {
        position: fixed;
        height: 100dvh;
        z-index: 2000 !important;
        /* Higher than anything else */
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        display: flex !important;
        /* Ensure it's not hidden by display:none */
    }

    #sidebar.active {
        transform: translateX(0);
    }

    #footer-controls {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 80px;
        padding: 0.5rem 1rem;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
        z-index: 500;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        flex-wrap: nowrap;
        display: grid;
        grid-template-columns: 40px 1fr 40px;
        align-items: center;
        gap: 0.5rem;
    }

    .nav-controls {
        grid-column: 2;
        width: 100%;
        margin-top: 0;
        display: flex;
        justify-content: center;
        gap: 1rem;
    }

    #toggle-sidebar-btn {
        grid-column: 1;
        position: static;
        font-size: 1.5rem;
    }

    .misc-controls {
        grid-column: 3;
        position: static;
        justify-content: flex-end;
    }

    /* 2. Slide Canvas & Layout */
    #slide-canvas {
        padding: 4rem 1.5rem 100px 1.5rem !important;
        align-items: flex-start !important;
        overflow-y: auto !important;
        height: 100dvh;
        display: block !important;
    }

    .slide {
        padding: 0 !important;
        height: auto !important;
        min-height: auto;
        display: block !important;
        position: relative !important;
    }

    .slide.active {
        transform: none !important;
    }

    .slide:not(.active) {
        display: none !important;
    }

    /* 3. Typography */
    .slide-title {
        font-size: 1.75rem !important;
        margin-bottom: 1rem !important;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .slide-title .slide-number-badge {
        position: static !important;
        margin-bottom: 0.5rem;
        margin-right: 0;
    }

    .slide-intro-text {
        font-size: 1rem !important;
        text-align: center !important;
        margin: 0 0 1.5rem 0 !important;
    }

    /* 4. Comparison & Roadmap */
    .comparison-container,
    .roadmap-container {
        flex-direction: column;
        gap: 1.5rem;
    }

    .comparison-col,
    .roadmap-card {
        width: 100%;
    }

    .comparison-bridge::before {
        display: none;
    }

    /* 5. Tools Grid */
    .tools-grid {
        grid-template-columns: 1fr;
    }

    /* 6. Blueprint / Cover Slide */
    .bp-container {
        position: fixed !important;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100dvh;
        z-index: 600;
        overflow-y: auto;
        background: white;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .bp-content {
        position: relative !important;
        left: 0 !important;
        top: 0 !important;
        transform: none !important;
        min-height: auto !important;
        /* Remove 100vh min-height to allow centering */
        height: auto !important;
        width: 100%;
        padding: 2rem 1.5rem !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        text-align: center !important;
        gap: 1.5rem;
        margin: 0 !important;
    }

    .bp-text-group {
        width: 100%;
        text-align: center !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .bp-container h1 {
        font-size: 2rem !important;
        text-align: center;
        margin: 0.5rem 0;
        line-height: 1.2;
    }

    .bp-sub {
        font-size: 1rem !important;
        text-align: center;
    }

    .bp-cta {
        width: 100%;
        justify-content: center;
        margin-top: 1.5rem !important;
        padding-bottom: 0 !important;
    }

    .bp-cta button {
        width: 100%;
        max-width: 280px;
        padding: 14px;
        font-size: 1rem;
    }

    .bp-blueprint {
        opacity: 0.2 !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
    }

    /* 7. Conclusion / Center Logo Slide */
    .text-center.center-logo-layout {
        min-height: 80vh;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }

    /* 8. Fix Sidebar Interaction */
    #sidebar {
        z-index: 2000 !important;
        /* Higher than anything else */
    }

    #toggle-sidebar-btn {
        z-index: 501;
        /* Slightly above footer */
        cursor: pointer;
    }

    #close-sidebar-btn {
        display: block !important;
    }
}

/* Space Overlay Styles */
#space-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    z-index: 2147483647;
    /* Max z-index to stay on top of everything including fullscreen elements */
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 1s ease;
}

#space-overlay.active {
    opacity: 1;
    pointer-events: all;
}

#space-overlay.hidden {
    display: none;
}

#space-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* Ensure it covers everything in fullscreen too */
:fullscreen #space-overlay {
    width: 100vw;
    height: 100vh;
    display: block;
    z-index: 2147483647;
}

:-webkit-full-screen #space-overlay {
    width: 100vw;
    height: 100vh;
    display: block;
    z-index: 2147483647;
}

:-ms-fullscreen #space-overlay {
    width: 100vw;
    height: 100vh;
    display: block;
    z-index: 2147483647;
}

.message-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
    z-index: 2147483648;
    /* Higher z-index than overlay */
}

.main-text {
    color: white;
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 700;
    opacity: 0;
    animation: fadeIn 2s ease forwards 1s;
    text-shadow: 0 0 30px rgba(37, 99, 235, 0.8);
    letter-spacing: -0.02em;
}

.sub-text {
    color: #94a3b8;
    font-size: clamp(1rem, 2vw, 1.5rem);
    margin-top: 1rem;
    opacity: 0;
    animation: fadeIn 2s ease forwards 2.5s;
}

.brand-corner {
    position: absolute;
    bottom: 2rem;
    right: 2rem;
    opacity: 0;
    animation: fadeIn 2s ease forwards 4s;
    pointer-events: none;
    z-index: 2147483648;
}

.brand-corner img {
    height: 30px;
    filter: brightness(0) invert(1);
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}