
/* ULTRA-PREMIUM BENTO BOX LAYOUT (PRODUCT DEEP DIVES) */

.product-deep-dive-section {
    position: relative;
    background-color: #000;
    padding: 0 !important; /* Action 1: Kill blank space */
    position: relative;
    background-color: #000;
    overflow: hidden;
    /* border-top removed to let gradient shine */
}

/* --- THE CONTINUOUS TIMELINE SPINE --- */
/* We move the timeline from the container to a global spine for perfect continuity */
.product-deep-dive-section::before {
    content: '';
    position: absolute;
    top: 0; 
    bottom: 0;
    left: 50%; /* Default fallback, overridden by grid logic */
    left: calc(50% - 600px + 56px); /* Align with container padding-left + 16px offset */
    width: 2px;
    z-index: 10;
    background: rgba(255,255,255,0.1);
}

/* --- SCROLL-DRIVEN BEAM ANIMATION --- */
/* The beam travels down the line */
.product-deep-dive-section::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: calc(50% - 600px + 56px);
    width: 2px;
    z-index: 11;
    background: linear-gradient(to bottom, transparent, var(--theme-color), transparent);
    opacity: 0;
    height: 30vh; /* The length of the "beam" */
    animation: beamTravel 8s ease-in-out infinite;
    pointer-events: none;
}

@keyframes beamTravel {
    0% { top: -30vh; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

/* Theme-Specific Colors */
.theme-teal { --theme-color: #00FFCC; }
.theme-purple { --theme-color: #8A2BE2; }
.theme-orange { --theme-color: #FF4500; }

/* Override container to fit tight packing */
.bento-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 100px 40px; /* Internal padding for breathability */
    padding-left: 100px; /* Space for timeline + visual offset */
    position: relative;
    z-index: 2;
}

/* Hide the old local timelines */
.bento-container::before {
    display: none !important;
}

/* Glowing Anchor Dots - Now Absolute to Section to align with Spine */
.chapter-header {
    position: relative;
    margin-bottom: 60px;
}

.chapter-eyebrow {
    display: block;
    font-family: 'Nunito', sans-serif; /* Seamless fit with site body */
    font-size: 24px; /* Larger, more narrative */
    font-weight: 300; /* Light and elegant */
    margin-bottom: 24px;
    letter-spacing: 0.02em; /* Slight breath */
    line-height: 1.4;
}

/* The Dot sits on the spine */
.chapter-eyebrow::before {
    content: '';
    position: absolute;
    left: -65px; /* Perfect alignment with padding-left 100px spine */
    top: 8px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #000;
    border: 2px solid currentColor;
    box-shadow: 0 0 15px currentColor;
    z-index: 15;
}

/* Pulse animation for the dot */
.chapter-eyebrow::after {
    content: '';
    position: absolute;
    left: -69px;
    top: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid currentColor;
    opacity: 0;
    animation: ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
    z-index: 14;
}

@keyframes ping {
    75%, 100% {
        transform: scale(2);
        opacity: 0;
    }
}

    /* Redesigning the LexLoop Finale */
    .product-handoff {
        position: relative;
        text-align: center;
        margin: 120px auto 160px; /* More breathing room */
        padding: 60px 20px;
        max-width: 1000px;
        background: radial-gradient(circle at center, rgba(34, 197, 94, 0.03) 0%, transparent 60%); /* Subtle backdrop */
    }

    /* The Narrative Text (targeting the first span, overrides inline styles if needed via specificity or structure) */
    .product-handoff span:first-child {
        display: block;
        font-family: 'Space Mono', monospace;
        font-size: 18px; /* Increased from 14px */
        text-transform: uppercase;
        letter-spacing: 2px;
        color: #888;
        margin-bottom: 24px;
        line-height: 1.6;
        opacity: 0.8 !important; /* Force override inline */
        font-weight: 400 !important; /* Force override inline */
    }

    .text-gradient-lexloop {
        display: inline-block; /* Changed from block to wrap tightly but allow padding */
        font-family: 'Inter', sans-serif;
        font-weight: 800; /* Extra bold */
        font-size: clamp(3rem, 6vw, 5rem); /* Responsive Huge */
        line-height: 1.1;
        letter-spacing: -0.03em; /* Tight tracking */
        
        /* Beautiful Gradient */
        background: linear-gradient(135deg, #FFF 0%, #00FFCC 40%, #22C55E 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        
        /* Clean, Cinematic Glow */
        filter: drop-shadow(0 0 40px rgba(0, 255, 204, 0.3));
        text-shadow: none; /* Remove old shadow */
        
        margin-top: 0;
        padding: 0 20px; /* Prevent edge clipping of glow/icon */
        transition: transform 0.5s ease;
    }

    .loop-icon {
        display: inline-block;
        vertical-align: middle;
        margin-left: 16px;
        font-size: 0.6em; /* Relative to parent */
        
        /* Gradient for the icon too */
        background: linear-gradient(135deg, #00FFCC 0%, #22C55E 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        
        filter: drop-shadow(0 0 20px rgba(34, 197, 94, 0.6));
        animation: floatLoop 6s ease-in-out infinite;
    }

    @keyframes floatLoop {
        0%, 100% { transform: translateY(0) rotate(0deg); }
        50% { transform: translateY(-10px) rotate(5deg); }
    }

    /* Add a connecting line from the top */
    .product-handoff::before {
        content: '';
        position: absolute;
        top: 0;
        left: 50%;
        width: 1px;
        height: 40px;
        background: linear-gradient(to bottom, rgba(255, 69, 0, 0.5), rgba(34, 197, 94, 0)); /* Transition from Orange to Green */
    }

    .handoff-italic {
        font-style: italic;
    }

    .handoff-arrow {
        display: block; /* Drop to new line if preferred, or inline-block */
        margin-top: 16px;
        color: #8A2BE2; /* Purple for Next Section Preview */
        font-size: 24px;
        font-weight: 300;
    }

    .chapter-title {
    font-family: 'Inter', sans-serif;
    font-size: clamp(32px, 4vw, 52px); /* Slightly reduced to prevent orphan words */
    font-weight: 600; /* Semi-bold */
    color: #FFFFFF;
    line-height: 1.1;
    letter-spacing: -0.02em; 
    margin-bottom: 32px;
    max-width: 100%; /* Allow full width */
}

.chapter-body {
    font-family: 'Inter', sans-serif;
    font-size: 18px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.6); /* Silver */
    font-weight: 300;
    max-width: 600px;
}

/* Slider Top Instruction (Above Visual) */
.slider-top-instruction {
    display: block;
    text-align: center;
    margin-bottom: 16px;
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.9;
    color: #FFF; /* Default fallback */
}

/* Theme-based coloring */
.theme-teal .slider-top-instruction { color: #00FFCC; }
.theme-purple .slider-top-instruction { color: #8A2BE2; }
.theme-orange .slider-top-instruction { color: #FF4500; }

/* 2. MAIN STAGE VISUAL (BEFORE & AFTER SLIDER) */
.bento-visual-stage {
    width: 100%;
    height: 600px;
    position: relative;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 60px;
    background: #050505;
}

.slider-container {
    position: relative;
    width: 100%;
    height: 100%;
    user-select: none;
}

.slider-image {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    pointer-events: none;
}

/* The "After" Image (Annotated) - Cropped by container width */
.slider-after {
    position: absolute;
    top: 0; left: 0;
    width: 50%; /* Initial split */
    height: 100%;
    overflow: hidden;
    border-right: 1px solid #00FFCC; /* Teal divider */
    z-index: 2;
    background: #000; /* Fallback */
}

/* Overlay UI for "After" state */
.after-overlay-ui {
    position: absolute;
    top: 0; left: 0;
    height: 100%;
    /* Width will be set by JS to match parent container, preventing squashing */
    pointer-events: none;
}

/* The Handle */
.slider-handle {
    position: absolute;
    top: 0; bottom: 0; left: 50%;
    width: 40px;
    height: 40px;
    background: #00FFCC;
    border-radius: 50%;
    z-index: 10;
    cursor: col-resize;
    transform: translate(-50%, -50%);
    top: 50%; /* Center vertically */
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(0, 255, 204, 0.5);
}

.slider-handle i {
    color: #000;
    font-size: 14px;
}

.slider-line {
    position: absolute;
    top: 0; bottom: 0; left: 50%;
    width: 2px;
    background: #00FFCC;
    z-index: 9;
    transform: translateX(-50%);
    box-shadow: 0 0 10px rgba(0, 255, 204, 0.3);
}

/* Labels */
.slider-label {
    position: absolute;
    top: 20px;
    padding: 6px 12px;
    background: rgba(0,0,0,0.8);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    color: #FFF;
    text-transform: uppercase;
    z-index: 5;
    pointer-events: none;
}
.label-before { right: 20px; border-color: rgba(255,255,255,0.2); }
.label-after { left: 20px; border-color: #00FFCC; color: #00FFCC; }

/* 3. SPEC GRID (TECHNICAL RECEIPTS) */
.spec-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 60px;
}

.spec-item {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 16px 8px; /* Reduced padding to fit text */
    text-align: center;
    font-family: 'Space Mono', monospace;
    font-size: 11px; /* Slightly smaller font */
    color: #FFF;
    text-transform: uppercase;
    letter-spacing: 0.5px; /* Tighter tracking */
    transition: all 0.3s ease;
    border-radius: 2px;
    white-space: nowrap; 
    overflow: hidden;
    text-overflow: ellipsis; 
}

.spec-item:hover {
    background: rgba(0, 255, 204, 0.05);
    border-color: #00FFCC;
    color: #00FFCC;
    transform: translateY(-2px);
}

/* 4. EXECUTION TABLE (BRUTALIST) */
.execution-table {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 4px;
    overflow: hidden;
}

/* --- LEXOPERATE TELEMETRY DASHBOARD --- */
.telemetry-dashboard {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
}

.snow-layer {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.snow-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Simulate Heavy Snow: High Brightness (Whiteout), Low Contrast, Cold Tint */
    filter: grayscale(100%) brightness(1.4) contrast(0.7) blur(1px) sepia(30%) hue-rotate(180deg);
}

.snow-particles {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.4'/%3E%3C/svg%3E");
    opacity: 0.5;
    mix-blend-mode: screen;
}

.radar-line {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 2px;
    background: #FF4500;
    box-shadow: 0 0 20px #FF4500;
    z-index: 5;
    animation: radarScan 3s linear infinite;
}

@keyframes radarScan {
    0% { top: 0; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

.telemetry-ui {
    position: absolute;
    inset: 0;
    z-index: 10;
    font-family: 'Space Mono', monospace;
}

/* Flickering Box (The Target) */
.box-fail {
    position: absolute;
    border: 2px dashed #FF4500;
    background: rgba(255, 69, 0, 0.05);
    box-shadow: 0 0 15px rgba(255, 69, 0, 0.2);
    animation: glitchBox 0.15s infinite;
}

@keyframes glitchBox {
    0% { opacity: 1; transform: translate(0, 0) scale(1); border-color: #FF4500; }
    20% { opacity: 0.8; transform: translate(-2px, 1px); }
    40% { opacity: 1; transform: translate(2px, -1px); border-color: rgba(255,69,0,0.5); }
    60% { opacity: 0.9; transform: translate(-1px, 2px); }
    80% { opacity: 1; transform: translate(1px, -2px); border-color: #FF4500; }
    100% { opacity: 0.9; transform: translate(0, 0) scale(1.01); }
}

/* The Tether Line */
.alert-tether {
    position: absolute;
    width: 2px;
    background: #FF4500;
    box-shadow: 0 0 10px #FF4500;
    transform-origin: top center;
    opacity: 0;
    animation: tetherGrow 0.3s ease-out forwards 0.8s; /* Appears before warning */
}

@keyframes tetherGrow {
    from { transform: scaleY(0); opacity: 0; }
    to { transform: scaleY(1); opacity: 1; }
}

/* Warning Module Position & Anim */
.warning-module {
    position: absolute;
    background: rgba(10, 5, 0, 0.95);
    border: 1px solid #FF4500;
    border-left: 4px solid #FF4500;
    padding: 20px;
    border-radius: 2px;
    box-shadow: 0 0 40px rgba(255, 69, 0, 0.4);
    color: #FF4500;
    min-width: 320px;
    /* Center horizontal, sit above tether */
    transform: translateX(-50%); 
    opacity: 0;
    animation: alertPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards 1s;
    z-index: 20;
}

@keyframes alertPop {
    0% { opacity: 0; transform: translateX(-50%) scale(0.9); }
    100% { opacity: 1; transform: translateX(-50%) scale(1); }
}

/* Environmental Micro-Data */
.env-readout {
    position: absolute;
    top: 20px;
    right: 20px;
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    color: #FF4500;
    text-align: right;
    line-height: 1.6;
    background: rgba(0,0,0,0.6);
    padding: 8px 12px;
    border: 1px solid rgba(255,69,0,0.3);
    border-radius: 4px;
    z-index: 15;
}

.env-row {
    display: block;
    opacity: 0.8;
}

.env-row strong {
    color: #FFF;
    font-weight: normal;
    opacity: 0.6;
}

.warning-header {
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255, 69, 0, 0.3);
    padding-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.warning-row {
    display: flex;
    justify-content: space-between;
}

.warning-row .bad-stat {
    color: #FF4500;
    font-weight: 700;
}

.warning-row .action-stat {
    color: #FF4500;
    font-weight: 700;
    animation: blinkAction 1s infinite;
}

@keyframes blinkAction {
    50% { opacity: 0.5; }
}

.warning-progress {
    width: 100%;
    height: 4px;
    background: rgba(255, 69, 0, 0.2);
    margin-top: 12px;
    position: relative;
    overflow: hidden;
}

.warning-bar {
    position: absolute;
    top: 0; left: 0; height: 100%; width: 100%;
    background: #FF4500;
    transform: translateX(-100%);
    animation: progressBar 2s infinite linear;
}

@keyframes progressBar {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.exec-col {
    padding: 40px;
}

.exec-col-platform {
    background: rgba(255,255,255,0.02);
    border-right: 1px solid rgba(255,255,255,0.1);
}

.exec-col-you {
    background: #000;
}

.exec-header {
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 32px;
    display: block;
    opacity: 0.5;
}

.exec-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.exec-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    color: #FFF;
    line-height: 1.5;
}

.exec-item:last-child { margin-bottom: 0; }

.exec-icon {
    margin-top: 4px;
    font-size: 12px;
}

.col-teal { color: #00FFCC; }
.col-white { color: #FFF; }

/* Responsive */
@media (max-width: 1024px) {
    .spec-grid { grid-template-columns: 1fr 1fr; }
    .execution-table { grid-template-columns: 1fr; }
    .exec-col-platform { border-right: none; border-bottom: 1px solid rgba(255,255,255,0.1); }
    .bento-visual-stage { height: 400px; }
}

@media (max-width: 600px) {
    .spec-grid { grid-template-columns: 1fr; }
    .chapter-title { font-size: 36px; }
}

/* Slider Instruction */
.slider-instruction {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #FFF;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 20;
    pointer-events: none;
    opacity: 0.8;
    backdrop-filter: blur(4px);
    white-space: nowrap;
    animation: fadeInInstruction 1s ease-out 1s forwards;
}

@keyframes fadeInInstruction {
    from { opacity: 0; transform: translate(-50%, 10px); }
    to { opacity: 0.8; transform: translate(-50%, 0); }
}

/* --- DEEP DIVE NAVIGATION (FIXED HUD) --- */
.dd-nav {
    position: fixed;
    top: 50%;
    right: 20px; /* Hug edge closer */
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 16px;
    z-index: 100;
    opacity: 0; /* Hidden by default */
    pointer-events: none; /* Click-through when hidden */
    transition: opacity 0.5s ease, transform 0.5s ease;
    
    /* GLASS PANEL BACKDROP */
    background: rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 20px 12px !important;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5) !important;
    
    /* RESET GLOBAL NAV STYLES IN CASE OF INHERITANCE */
    width: auto !important;
    height: auto !important;
    left: auto !important;
}

.dd-nav.visible {
    opacity: 1;
    pointer-events: auto;
}

.dd-node {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    transition: transform 0.2s ease;
    opacity: 0.5;
}

.dd-node:hover {
    opacity: 1;
    transform: translateX(-5px);
}

.dd-num {
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    color: #FFF;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 4px;
    padding: 4px 6px;
    transition: all 0.3s ease;
}

.dd-label {
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    letter-spacing: 1px;
    color: #FFF;
    font-weight: 700;
    opacity: 1;
    display: block;
    text-shadow: 0 0 10px rgba(0,0,0,0.8);
    transition: color 0.3s ease;
}

/* Active States */
.dd-node.active {
    opacity: 1;
    transform: scale(1.1) translateX(-5px);
}

/* Theme Colors for Active State */
.dd-node[data-target="lexannotate-deep"].active .dd-num {
    border-color: #00FFCC;
    color: #00FFCC;
    box-shadow: 0 0 10px rgba(0, 255, 204, 0.4);
    background: rgba(0, 255, 204, 0.1);
}
.dd-node[data-target="lexannotate-deep"].active .dd-label { color: #00FFCC; }

.dd-node[data-target="lexintel-deep"].active .dd-num {
    border-color: #8A2BE2;
    color: #8A2BE2;
    box-shadow: 0 0 10px rgba(138, 43, 226, 0.4);
    background: rgba(138, 43, 226, 0.1);
}
.dd-node[data-target="lexintel-deep"].active .dd-label { color: #8A2BE2; }

.dd-node[data-target="lexoperate-deep"].active .dd-num {
    border-color: #FF4500;
    color: #FF4500;
    box-shadow: 0 0 10px rgba(255, 69, 0, 0.4);
    background: rgba(255, 69, 0, 0.1);
}
.dd-node[data-target="lexoperate-deep"].active .dd-label { color: #FF4500; }

.dd-node[data-target="industries"].active .dd-num {
    border-color: #FFFFFF;
    color: #FFFFFF;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.1);
}
.dd-node[data-target="industries"].active .dd-label { color: #FFFFFF; }

.dd-node[data-target="contact"].active .dd-num {
    border-color: #FFFFFF;
    color: #FFFFFF;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.1);
}
.dd-node[data-target="contact"].active .dd-label { color: #FFFFFF; }

/* Connecting Line */
.dd-nav::before {
    content: '';
    position: absolute;
    top: 20px;
    bottom: 20px;
    left: 26px; /* Align with center of padding + numbers */
    width: 1px;
    background: rgba(255,255,255,0.1);
    z-index: -1;
}

@media (max-width: 1280px) {
    .dd-nav { display: none !important; }
}
