/* --- SERVICES.HTML STYLES --- */

/* --- SERVICES HERO (UPDATED MODERN LOOK) --- */
.services-hero {
    position: relative;
    padding: 180px 0 120px;
    background-color: #f8fafc;
    background-image: 
        linear-gradient(rgba(15, 23, 42, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 23, 42, 0.05) 1px, transparent 1px);
    background-size: 50px 50px;
    overflow: hidden;
}

.hero-grid-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
}

.badge-pill-tech {
    background: #0f172a;
    color: #fff;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 25px;
    box-shadow: 0 5px 15px rgba(15, 23, 42, 0.2);
}

.service-text h1 {
    font-size: 4rem;
    color: #0f172a;
    line-height: 1.1;
    margin-bottom: 25px;
    font-weight: 800;
    letter-spacing: -1px;
}

.service-text p {
    font-size: 1.25rem;
    color: #475569;
    margin-bottom: 45px;
    max-width: 550px;
    line-height: 1.6;
}

/* --- ISOMETRIC STACK --- */
.service-visual {
    perspective: 1000px;
    display: flex;
    justify-content: center;
    height: 500px;
    align-items: center;
}

.isometric-stack {
    position: relative;
    width: 320px;
    height: 400px;
    transform: rotateY(-20deg) rotateX(10deg);
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
}

.iso-card {
    position: absolute;
    width: 100%;
    height: 90px;
    animation: floatStack 4s ease-in-out infinite;
}

.card-surface {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: #0f172a !important;
    background-image: 
        linear-gradient(rgba(56, 189, 248, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(56, 189, 248, 0.1) 1px, transparent 1px) !important;
    background-size: 20px 20px;
    border: 1px solid rgba(56, 189, 248, 0.5);
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    z-index: 10;
    opacity: 1 !important;
    box-shadow: 10px 10px 30px rgba(0,0,0,0.3);
}

.iso-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: -10px; 
    width: 10px;  
    height: 100%;
    background: #020617 !important;
    transform-origin: left;
    transform: skewY(45deg); 
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-left: none;
}

.tech-edge {
    position: absolute;
    left: 0;
    top: 15px;
    bottom: 15px;
    width: 4px;
    background: #38bdf8;
    border-radius: 0 4px 4px 0;
    box-shadow: 0 0 15px #38bdf8;
}

.iso-icon {
    width: 50px; height: 50px;
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8 !important;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
    border: 1px solid rgba(56, 189, 248, 0.3);
    flex-shrink: 0;
}

.iso-info h4 { 
    color: #ffffff !important;
    margin: 0 0 3px; 
    font-size: 1.1rem; 
    font-weight: 700; 
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.iso-info span { 
    color: #cbd5e1 !important;
    font-size: 0.85rem; 
    font-family: monospace;
}

.layer-infra { 
    top: 240px; 
    z-index: 3;
    animation-delay: 0s;
}

.layer-data { 
    top: 130px; 
    z-index: 2;
    transform: scale(0.95);
    opacity: 0.9;
    animation-delay: 0.5s;
}

.layer-ai { 
    top: 20px; 
    z-index: 1; 
    transform: scale(0.9); 
    opacity: 0.8;
    animation-delay: 1s;
}

.connector-line {
    position: absolute;
    width: 2px;
    height: 60px;
    background: linear-gradient(to bottom, #38bdf8, transparent);
    left: 45px;
    z-index: 0;
    opacity: 0.5;
}
.c1 { top: 70px; }
.c2 { top: 180px; }

@keyframes floatStack {
    0%, 100% { transform: translateY(0px) scale(var(--s, 1)); }
    50% { transform: translateY(-15px) scale(var(--s, 1)); }
}

/* --- INTERACTIVE SERVICE NEXUS --- */
.nexus-section {
    background: #f8fafc;
    padding: 100px 0;
    background-image: radial-gradient(#e2e8f0 1px, transparent 1px);
    background-size: 30px 30px; 
}

.nexus-header {
    text-align: center;
    margin-bottom: 60px;
}
.nexus-header h2 { font-size: 2.5rem; color: #0f172a; font-weight: 800; }
.nexus-header p { color: #64748b; }

.nexus-interface {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 40px;
    align-items: start;
    max-width: 1200px;
    margin: 0 auto;
}

.nexus-menu {
    display: flex;
    flex-direction: column;
    gap: 15px;
    height: 380px; 
    overflow-y: auto;
    padding-right: 15px;
    padding-bottom: 20px;
    scroll-behavior: smooth;
}

.nexus-menu::-webkit-scrollbar {
    width: 8px;
}
.nexus-menu::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}
.nexus-menu::-webkit-scrollbar-thumb {
    background-color: #94a3b8;
    border-radius: 4px;
}
.nexus-menu::-webkit-scrollbar-thumb:hover {
    background-color: #64748b;
}

.nexus-trigger {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    min-height: 90px;
}

.nexus-trigger:hover {
    transform: translateX(5px);
    border-color: #cbd5e1;
}

.nexus-trigger.active {
    background: #0f172a;
    border-color: #0f172a;
    color: #fff;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.2);
}

.trigger-icon {
    width: 40px; height: 40px;
    background: #f1f5f9;
    color: #64748b;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
    transition: 0.3s;
}

.nexus-trigger.active .trigger-icon {
    background: rgba(255,255,255,0.1);
    color: #38bdf8;
}

.trigger-info h4 { margin: 0; font-size: 1rem; font-weight: 700; color: #0f172a; }
.trigger-info span { font-size: 0.85rem; color: #64748b; }

.nexus-trigger.active .trigger-info h4 { color: #fff; }
.nexus-trigger.active .trigger-info span { color: #94a3b8; }

.trigger-arrow { margin-left: auto; color: #cbd5e1; font-size: 0.9rem; }
.nexus-trigger.active .trigger-arrow { color: #38bdf8; }

.nexus-display {
    position: sticky;
    top: 100px;
    height: 100%;
}

.display-card {
    background: linear-gradient(to bottom, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0.85)), 
                url('https://images.unsplash.com/photo-1451187580459-43490279c0fa?auto=format&fit=crop&w=1600&q=80');
    background-size: cover;
    background-position: center;
    border-radius: 20px;
    padding: 50px;
    color: #fff;
    position: relative;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0,0,0,0.15);
    border: 1px solid rgba(255,255,255,0.1);
    min-height: 450px;
    display: flex;
    flex-direction: column;
}

.category-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #94a3b8;
    margin-bottom: 25px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-label::before {
    content: '';
    display: block;
    width: 30px;
    height: 1px;
    background: #38bdf8;
}

.display-content h3 { 
    font-size: 2.8rem; 
    margin-bottom: 20px; 
    font-weight: 800; 
    line-height: 1.1;
    letter-spacing: -1px;
}

.display-content p { 
    color: #cbd5e1; 
    font-size: 1.15rem; 
    line-height: 1.7; 
    margin-bottom: 50px; 
    max-width: 95%;
    border-left: 3px solid rgba(56, 189, 248, 0.3);
    padding-left: 20px;
}

.display-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    margin-top: auto;
    border-top: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.2);
    border-radius: 0 0 20px 20px;
    margin: 0 -50px -50px -50px;
}

.meta-box {
    padding: 25px 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.meta-box:first-child {
    border-right: 1px solid rgba(255,255,255,0.15);
}

.highlight-box {
    background: rgba(56, 189, 248, 0.05);
}

.meta-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #94a3b8;
    margin-bottom: 12px;
    letter-spacing: 1px;
    font-weight: 600;
}

.tech-stack-dynamic { 
    display: flex; 
    gap: 8px; 
    flex-wrap: wrap; 
}

.tech-stack-dynamic span {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    font-size: 0.8rem;
    padding: 6px 12px;
    border-radius: 6px;
    color: #fff;
}

.highlight-box h4 { 
    font-size: 2rem; 
    color: #38bdf8;
    margin: 0; 
    font-weight: 700; 
    line-height: 1;
}

.display-grid-bg {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: 
        linear-gradient(rgba(56, 189, 248, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(56, 189, 248, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: 1;
    opacity: 0.5;
    pointer-events: none;
}

/* --- MISSION LOG SECTION --- */
.mission-section {
    background: #f8fafc;
    padding: 100px 0;
    border-top: 1px solid #e2e8f0;
}

.mission-header {
    text-align: center;
    margin-bottom: 60px;
}

.mono-tag {
    font-family: monospace;
    color: #94a3b8;
    font-size: 0.85rem;
    letter-spacing: 1px;
    margin-bottom: 10px;
    display: block;
}

.mission-header h2 { font-size: 2.5rem; font-weight: 800; color: #0f172a; margin-bottom: 15px; }
.mission-header p { color: #64748b; font-size: 1.1rem; }
.text-navy { color: #0f172a; }

.mission-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
    max-width: 1200px;
    margin: 0 auto;
}

.mission-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    transition: 0.3s ease;
    height: 320px;
    display: flex;
    flex-direction: column;
}

.mission-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.06);
    border-color: #cbd5e1;
}

.file-tab {
    background: #f1f5f9;
    padding: 8px 20px;
    font-size: 0.75rem;
    font-family: monospace;
    color: #64748b;
    border-bottom: 1px solid #e2e8f0;
    font-weight: 700;
    letter-spacing: 1px;
}

.card-main {
    padding: 30px 25px;
    transition: 0.3s ease;
}

.phase-icon {
    width: 50px; height: 50px;
    background: rgba(15, 23, 42, 0.05);
    color: #0f172a;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.mission-card h4 { font-size: 1.2rem; font-weight: 700; color: #0f172a; margin-bottom: 10px; }
.mission-card p { font-size: 0.9rem; color: #64748b; line-height: 1.6; }

.file-contents {
    position: absolute;
    bottom: 0; left: 0; width: 100%;
    background: #0f172a;
    padding: 25px;
    transform: translateY(100%);
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 180px;
}

.mission-card:hover .file-contents {
    transform: translateY(0);
}

.content-label {
    display: block;
    font-size: 0.7rem;
    color: #94a3b8;
    margin-bottom: 10px;
    letter-spacing: 1px;
    font-weight: 700;
}

.file-contents ul { list-style: none; padding: 0; margin: 0; }
.file-contents li {
    color: #fff;
    font-size: 0.85rem;
    margin-bottom: 8px;
    display: flex; gap: 10px; align-items: center;
}
.file-contents li i { color: #38bdf8; font-size: 0.75rem; }

/* --- ENGAGEMENT MODELS SECTION --- */
.engagement-section {
    background: #fff;
    padding: 120px 0;
    position: relative;
}

.section-header-center {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 60px;
}

.section-header-center h2 {
    font-size: 2.5rem;
    color: #0f172a;
    font-weight: 800;
    margin-bottom: 15px;
}

.highlight-navy {
    color: #0f172a;
    position: relative;
    display: inline-block;
}

.highlight-navy::after {
    content: '';
    position: absolute;
    bottom: 2px; left: 0; width: 100%; height: 6px;
    background: rgba(56, 189, 248, 0.2);
    z-index: -1;
}

.section-header-center p { color: #64748b; font-size: 1.1rem; }

.badge-pill-light {
    background: #f1f5f9;
    color: #475569;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
    display: inline-block;
}

.engagement-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    max-width: 1100px;
    margin: 0 auto;
    align-items: center;
}

.engage-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 40px 30px;
    text-align: center;
    transition: 0.3s;
    position: relative;
}

.engage-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.08);
    border-color: #cbd5e1;
}

.icon-circle {
    width: 60px; height: 60px;
    background: #f8fafc;
    color: #0f172a;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto 20px;
    border: 1px solid #e2e8f0;
}

.engage-card h3 { font-size: 1.4rem; color: #0f172a; margin-bottom: 5px; font-weight: 700; }
.model-desc { color: #94a3b8; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 20px; font-weight: 600; }

.card-body p { color: #64748b; font-size: 0.95rem; margin-bottom: 25px; line-height: 1.6; min-height: 50px; }

.check-list { list-style: none; padding: 0; text-align: left; margin-bottom: 30px; }
.check-list li {
    display: flex; gap: 10px; align-items: center;
    color: #475569; margin-bottom: 12px; font-size: 0.9rem;
}
.check-list i { color: #22c55e; font-size: 0.8rem; }

.featured-card {
    background: #0f172a;
    color: #fff;
    border: none;
    padding: 50px 30px;
    box-shadow: 0 25px 50px rgba(15, 23, 42, 0.25);
    transform: scale(1.05);
    z-index: 2;
}

.featured-card:hover { transform: scale(1.05) translateY(-5px); }

.featured-card h3 { color: #fff; }
.featured-card .model-desc { color: #94a3b8; }
.featured-card .card-body p { color: #cbd5e1; }
.featured-card .check-list li { color: #e2e8f0; }
.featured-card .icon-circle { background: rgba(255,255,255,0.1); color: #38bdf8; border: none; }

.rec-badge {
    position: absolute;
    top: -12px; left: 50%; transform: translateX(-50%);
    background: #38bdf8;
    color: #fff;
    padding: 5px 15px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    box-shadow: 0 5px 15px rgba(56, 189, 248, 0.4);
}

.btn-outline-dark {
    display: inline-block;
    border: 1px solid #e2e8f0;
    color: #0f172a;
    padding: 12px 25px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: 0.3s;
    width: 100%;
}
.btn-outline-dark:hover { background: #f1f5f9; border-color: #cbd5e1; }

.btn-solid-blue {
    display: inline-block;
    background: #38bdf8;
    color: #fff;
    padding: 15px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    transition: 0.3s;
    width: 100%;
    box-shadow: 0 10px 20px rgba(56, 189, 248, 0.2);
}
.btn-solid-blue:hover { background: #0284c7; }

/* --- CLEAN INFRASTRUCTURE SECTION --- */
.cinematic-section {
    background: #ffffff;
    color: #0f172a;
    position: relative;
    border-top: 1px solid #e2e8f0;
}

.cinematic-wrapper {
    display: flex;
    height: 100vh;
    min-height: 700px;
}

.cinematic-visual {
    width: 55%;
    position: sticky;
    top: 0;
    height: 100vh;
    background-size: cover;
    background-position: center;
    transition: background-image 0.4s ease-out;
    box-shadow: inset -10px 0 20px rgba(0,0,0,0.05); 
}

.cinematic-content {
    width: 45%;
    padding: 80px 60px;
    background-color: #ffffff;
    background-image: 
        linear-gradient(#f1f5f9 1px, transparent 1px),
        linear-gradient(90deg, #f1f5f9 1px, transparent 1px);
    background-size: 40px 40px;
    overflow-y: auto;
}

.content-header { margin-bottom: 60px; position: relative; z-index: 2; }
.content-header h3 { 
    font-size: 2.8rem; 
    font-weight: 800; 
    color: #0f172a; 
    margin-bottom: 15px; 
    line-height: 1.1; 
}

.content-header p { 
    color: #64748b;
    font-size: 1.1rem; 
    line-height: 1.6;
}

.feature-list-vertical {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.feature-row {
    display: flex;
    gap: 25px;
    padding: 35px 30px;
    border-left: 3px solid transparent; 
    border-radius: 0 12px 12px 0;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.feature-row:hover, .feature-row.active {
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(148, 163, 184, 0.15);
    border-left-color: #0f172a;
}

.f-number {
    font-size: 1.2rem;
    font-weight: 700;
    color: #cbd5e1;
    font-family: monospace;
    padding-top: 5px;
}

.feature-row.active .f-number { color: #0f172a; }

.f-info h4 { font-size: 1.3rem; font-weight: 700; margin-bottom: 8px; color: #0f172a; }
.f-info p { color: #64748b; margin-bottom: 15px; font-size: 0.95rem; line-height: 1.6; }

.f-tags span {
    display: inline-block;
    background: #fff; 
    color: #475569;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 50px;
    margin-right: 6px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* Responsive */
@media (max-width: 1024px) {
    .hero-grid-split { grid-template-columns: 1fr; text-align: center; }
    .service-text p { margin: 0 auto 40px; }
    .hero-actions { justify-content: center; }
    .service-visual { height: 400px; margin-top: 50px; }
    .isometric-stack { transform: rotateX(45deg) rotateZ(-30deg) scale(0.8); }
    .nexus-interface { grid-template-columns: 1fr; }
    .nexus-display { position: static; }
    .mission-grid { grid-template-columns: 1fr 1fr; }
    .engagement-grid { grid-template-columns: 1fr; }
    .featured-card { transform: scale(1); }
    .featured-card:hover { transform: translateY(-5px); }
    .cinematic-wrapper { flex-direction: column; height: auto; }
    .cinematic-visual { width: 100%; height: 400px; position: relative; }
    .cinematic-content { width: 100%; padding: 50px 30px; }
}

@media (max-width: 768px) {
    .mission-grid { grid-template-columns: 1fr; }
    .nexus-menu { height: auto; max-height: 500px; }
}

/* =========================================
   SERVICES HERO: SIDE-BY-SIDE MOBILE FIX
   ========================================= */

@media (max-width: 900px) {

    /* 1. Force Single Row Layout */
    .hero-grid-split {
        display: flex !important;
        flex-direction: row !important; /* Keep them side-by-side */
        align-items: center;
        justify-content: space-between;
        gap: 10px; /* Very small gap to save space */
        padding-top: 80px;
        padding-bottom: 40px;
        text-align: left; /* Keep text left-aligned */
    }

    /* 2. Resize Text Column (Takes 55% of width) */
    .service-text {
        flex: 1; /* Allow it to grow */
        width: 55%; 
        padding-right: 5px;
        z-index: 10; /* Ensure text stays on top if they overlap slightly */
    }

    /* Drastically reduce font sizes to fit side-by-side */
    .service-text h1 {
        font-size: 1.6rem !important; /* Smaller Heading */
        margin-bottom: 10px;
    }

    .service-text p {
        font-size: 0.85rem !important; /* Smaller paragraph */
        line-height: 1.4;
        margin-bottom: 20px;
    }

    /* 3. Resize Visual Column (Takes 45% of width) */
    .service-visual {
        width: 45%;
        height: 250px; /* Reduced height */
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: visible; /* Let the 3D effect poke out if needed */
    }

    /* 4. Shrink the 3D Stack */
    .isometric-stack {
        /* Scale down to 45% of original size to fit on phone */
        transform: scale(0.45) rotateY(-20deg) rotateX(10deg); 
        transform-origin: center center;
        
        /* Pull it slightly to the right so it doesn't hit the text */
        margin-right: -40px; 
    }

    /* 5. Adjust Buttons for tight space */
    .hero-actions {
        display: flex;
        flex-direction: column; /* Stack buttons vertically inside the text column */
        align-items: flex-start;
        gap: 10px;
    }

    .btn-primary-solid {
        padding: 10px 20px;
        font-size: 0.8rem;
    }
    /* 6. REDUCE GAP BETWEEN HERO AND NEXT SECTION */
    .services-hero {
        padding-bottom: 20px !important; /* Reduce bottom padding */
    }

    .nexus-section {
        padding-top: 40px !important; /* Reduce top padding of next section */
    }

    /* Optional: If the gap is still huge, it might be the container's margin */
    .hero-grid-split {
        margin-bottom: 0 !important;
    }
}

/* =========================================
   NEXUS ECOSYSTEM: HORIZONTAL MENU + FULL WIDTH DISPLAY
   ========================================= */

@media (max-width: 900px) {

    /* 1. Stack the Layout Vertically */
    .nexus-interface {
        display: flex !important;
        flex-direction: column !important; /* Stack Menu on top, Content below */
        gap: 20px;
    }

    /* 2. Transform Menu into Horizontal Scroller */
    .nexus-menu {
        flex-direction: row !important; /* Arrange items horizontally */
        width: 100%;
        height: auto !important; /* Remove fixed height limit */
        overflow-x: auto !important; /* Enable horizontal scrolling */
        overflow-y: hidden;
        padding-bottom: 15px; /* Space for touch interaction */
        
        /* Snap logic for smooth feeling */
        scroll-snap-type: x mandatory; 
        -webkit-overflow-scrolling: touch;
    }

    /* 3. Style the Triggers (The Buttons) */
    .nexus-trigger {
        min-width: 280px; /* Fixed width so text is readable */
        flex: 0 0 auto; /* Prevent shrinking */
        scroll-snap-align: center; /* Snap to center when scrolling stops */
        margin-right: 15px; /* Gap between buttons */
        
        /* Ensure they look like clickable cards */
        border-bottom: 1px solid #e2e8f0; 
    }

    /* 4. Full Width Display Card (The "Pic" Area) */
    .nexus-display {
        width: 100%; /* Take full width */
        position: static; /* Remove sticky behavior */
        margin-top: 10px;
    }

    .display-card {
        min-height: auto; /* Let content dictate height */
        padding: 30px 20px; /* Adjust padding for mobile */
        border-radius: 12px;
    }

    /* 5. Adjust Text Sizes inside the Card */
    .display-content h3 {
        font-size: 2rem;
        line-height: 1.2;
    }

    .display-content p {
        font-size: 1rem;
        margin-bottom: 30px;
    }

    /* 6. Stack the Meta Data (Bottom Dark Box) */
    .display-meta {
        grid-template-columns: 1fr; /* Stack vertically */
        margin: 0 -20px -30px -20px; /* Reset margins */
        border-radius: 0 0 12px 12px;
    }

    .meta-box {
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        padding: 20px;
    }

    /* Hide Scrollbar for cleaner look */
    .nexus-menu::-webkit-scrollbar {
        display: none;
    }
}

/* =========================================
   MISSION SECTION: 2x2 GRID RESPONSIVE FIX
   ========================================= */

@media (max-width: 900px) {

    /* 1. Force 2 Columns (Creates 2 Rows for 4 items) */
    .mission-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr) !important; /* 2 boxes per row */
        gap: 15px; /* Slightly tighter gap */
        padding: 0 10px; /* Prevent edge touching */
    }

    /* 2. Adjust Card Height for Mobile */
    .mission-card {
        height: auto; /* Allow flexible height */
        min-height: 280px; /* Ensure enough space */
    }

    /* 3. Scale Text Down for Narrow Columns */
    .mission-card h4 {
        font-size: 1.1rem; /* Slightly smaller title */
    }

    .mission-card p {
        font-size: 0.85rem; /* Smaller description */
        line-height: 1.5;
    }

    /* 4. Adjust the Hover Content */
    .file-contents {
        padding: 15px; /* Less padding inside the hover state */
    }
    
    .file-contents li {
        font-size: 0.75rem; /* Smaller list text */
    }
}


@media (max-width: 400px) {
    .mission-grid { grid-template-columns: 1fr !important; }
}

/* =========================================
   ENGAGEMENT SECTION: 3-COLUMN FULL CONTENT FIX
   ========================================= */

@media (max-width: 900px) {

    /* 1. Force 3 Columns in One Row (No Scrolling) */
    .engagement-grid {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important; /* 3 Equal Columns */
        gap: 5px; /* Tiny gap to save space */
        padding: 0 5px;
        align-items: stretch; /* Make all cards same height */
    }

    /* 2. Card Container Styling */
    .engage-card {
        padding: 15px 5px; /* Minimal padding */
        width: 100%;
        min-width: 0; /* Allow shrinking */
        margin: 0;
        border-radius: 8px;
        display: flex;
        flex-direction: column;
        justify-content: space-between; /* Push button to bottom */
    }

    /* 3. RESTORE THE CONTENT (Vertical Expansion) */
    .engage-card .card-body p, 
    .engage-card .check-list {
        display: block !important; /* Show the text and lists again */
    }

    /* 4. Text Scaling for Narrow Columns */
    .icon-circle {
        width: 40px; height: 40px;
        font-size: 1rem;
        margin-bottom: 10px;
    }

    .engage-card h3 {
        font-size: 0.65rem; /* Tiny title to prevent wrapping */
        font-weight: 800;
        margin-bottom: 5px;
        word-wrap: break-word;
    }

    .model-desc {
        font-size: 0.5rem;
        margin-bottom: 10px;
        color: #64748b;
    }

    .card-body p {
        font-size: 0.55rem; /* Very small text */
        line-height: 1.3;
        margin-bottom: 10px;
        display: -webkit-box;
        -webkit-line-clamp: 4; /* Limit description lines if needed */
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* 5. Compact the Checklist */
    .check-list {
        margin-bottom: 15px;
        padding-left: 2px;
    }

    .check-list li {
        font-size: 0.5rem; /* Tiny list text */
        margin-bottom: 5px;
        gap: 3px;
        line-height: 1.2;
    }

    .check-list i {
        font-size: 0.5rem;
    }

    /* 6. Button Styling */
    .engage-card a[class*="btn"] {
        padding: 8px 0;
        font-size: 0.6rem;
        width: 100%;
        margin-top: auto; /* Force to bottom */
    }

    /* 7. Featured Card Adjustments */
    .featured-card {
        transform: none !important;
        z-index: 0;
        padding-top: 25px;
    }

    .rec-badge {
        font-size: 0.45rem;
        padding: 2px 4px;
        top: -5px;
        white-space: nowrap;
    }
}

/* =========================================
   CINEMATIC SECTION: SIDE-BY-SIDE + SCROLL FIX
   ========================================= */

@media (max-width: 900px) {

    /* 1. Lock the Height of the Section */
    .cinematic-wrapper {
        display: flex !important;
        flex-direction: row !important;
        /* FIXED HEIGHT is key: Matches a typical phone screen height minus headers */
        height: 500px !important; 
        min-height: 500px;
        overflow: hidden; /* Contains everything inside */
        border-bottom: 1px solid #e2e8f0;
    }

    /* 2. Image Side (Left - 50%) */
    /* Stays static and fully visible because height is locked */
    .cinematic-visual {
        width: 50%;
        flex: 0 0 50%;
        height: 100%; /* Fill the 500px container */
        background-size: cover !important;
        background-position: center center !important;
    }

    /* 3. Content Side (Right - 50%) with SCROLLBAR */
    .cinematic-content {
        width: 50%;
        flex: 0 0 50%;
        height: 100%; /* Fill the 500px container */
        padding: 25px 15px; /* Clean padding */
        
        /* THE MAGIC FIX: Enable Internal Scrollbar */
        overflow-y: auto !important; 
        -webkit-overflow-scrolling: touch; /* Smooth scroll on iOS */
    }

    /* 4. Text Scaling */
    .content-header h3 {
        font-size: 1.2rem;
        margin-bottom: 10px;
    }

    .content-header p {
        font-size: 0.75rem;
        line-height: 1.4;
        margin-bottom: 25px;
    }

    /* 5. Compact Feature Rows */
    .feature-list-vertical {
        gap: 15px;
        padding-bottom: 20px; /* Space at bottom of scroll area */
    }

    .feature-row {
        padding: 10px;
        border: 1px solid #f1f5f9;
    }

    .f-info h4 { font-size: 0.85rem; margin-bottom: 5px; }
    .f-info p { font-size: 0.65rem; line-height: 1.3; }

    /* 6. Style the Scrollbar (Make it thin and subtle) */
    .cinematic-content::-webkit-scrollbar {
        width: 4px;
    }
    .cinematic-content::-webkit-scrollbar-track {
        background: #f1f5f9;
    }
    .cinematic-content::-webkit-scrollbar-thumb {
        background: #cbd5e1;
        border-radius: 4px;
    }
}