/* ========================================================
   EDEVS LAB - MOBILE RESPONSIVENESS OVERRIDES
   ======================================================== */

/* Desktop-only elements hidden on mobile */
.mobile-fab-menu {
    display: none;
}

.mobile-nav-overlay {
    display: none;
}

@media (max-width: 860px) {

    .hero-carousel-nav {
        display: none !important;
    }

    /* 1. Global Navbar Collapse */
    .navbar {
        padding: 10px 16px;
        border-radius: 20px;
    }

    .nav-links,
    .nav-actions {
        display: none !important;
    }

    .brand-wing {
        display: none !important;
    }

    /* Hide subtext under logo to save space */

    /* 2. Hero Section Typography Shrink */
    .hero-display-title {
        font-size: clamp(2rem, 10vw, 2.5rem) !important;
        line-height: 1.1 !important;
        margin-top: 40px !important;
        word-break: keep-all !important;
        overflow-wrap: normal !important;
    }

    .hero-subtext {
        font-size: 1rem !important;
        margin-top: 0.5rem !important;
    }

    .hero-content {
        padding: 24px !important;
        text-align: left;
    }

    .hero-rotator-viewport {
        opacity: 0.4 !important;
    }

    /* Dim background graphics on mobile for text readability */
    .hero-fullscreen {
        height: auto !important;
        min-height: 100vh !important;
        justify-content: flex-start !important;
        padding-top: 50px !important;
        /* Fix upper truncation */
        padding-bottom: 120px !important;
        /* Space for the bottom FAB */
        padding-left: 20px !important;
        padding-right: 20px !important;
    }

    .hero-founder-spotlight {
        position: relative !important;
        bottom: auto !important;
        right: auto !important;
        margin-top: 16px !important;
        /* Reduced gap */
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Mobile Character Image inside Spotlight Card */
    .spotlight-character-mobile {
        display: block !important;
        width: 100%;
        height: 200px;
        margin-top: 10px;
        margin-bottom: 16px;
        border-radius: 16px;
        overflow: hidden;
        border: 1px solid rgba(16, 185, 129, 0.35);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), inset 0 0 15px rgba(16, 185, 129, 0.15);
        position: relative;
        background: #080A12;
    }

    .spotlight-character-img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center 20%;
        display: block;
        border-radius: 15px;
        transition: opacity 0.3s ease, transform 0.3s ease;
    }

    /* 3. Master Grid Stacking (Bento Cards to 1fr) */
    .hero-bento,
    .services-bento,
    .labs-bento,
    .features-grid,
    .chrono-grid,
    .estimate-meta-row {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    /* 4. Pad Reduction for Deep Containers */
    .bento-card,
    .testi-card,
    .footer-card,
    .chronology-card {
        padding: 24px !important;
    }

    .timeline-node,
    .chrono-node {
        text-align: left !important;
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .chrono-badge-icon {
        margin: 0 !important;
    }

    /* 5. Mobile FAB Hamburger Activation */
    .mobile-fab-menu {
        display: flex !important;
        position: fixed;
        bottom: 24px;
        right: 24px;
        width: 56px;
        height: 56px;
        background: #0E111C;
        border-radius: 50%;
        color: #fff;
        align-items: center;
        justify-content: center;
        font-size: 1.5rem;
        box-shadow: 0 8px 30px rgba(16, 185, 129, 0.4);
        z-index: 9999;
        cursor: pointer;
        border: 2px solid #10B981;
    }

    /* 6. Mobile Fullscreen Overlay Nav - High Tech Cyber Glassmorphism */
    .mobile-nav-overlay {
        display: none;
        position: fixed;
        inset: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(6, 9, 15, 0.96);
        backdrop-filter: blur(25px);
        -webkit-backdrop-filter: blur(25px);
        z-index: 9998;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        overflow: hidden;
    }

    .mobile-nav-overlay.active {
        display: flex;
        opacity: 1;
        visibility: visible;
    }

    .mobile-nav-content {
        width: 100%;
        height: 100%;
        display: flex;
        flex-direction: column;
        padding: 20px 18px 24px 18px;
        box-sizing: border-box;
        max-width: 500px;
        margin: 0 auto;
    }

    /* Header Bar */
    .mobile-nav-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding-bottom: 16px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        margin-bottom: 16px;
    }

    .mobile-nav-brand {
        display: flex;
        align-items: center;
        gap: 10px;
        text-decoration: none;
    }

    .mobile-nav-logo {
        width: 28px;
        height: 28px;
        object-fit: contain;
    }

    .mobile-brand-name {
        font-family: 'Outfit', sans-serif;
        font-size: 1.3rem;
        font-weight: 900;
        color: #FFFFFF;
        letter-spacing: 0.02em;
    }

    .mobile-brand-name .brand-accent {
        color: #10B981;
        margin-left: 3px;
    }

    .mobile-nav-status {
        display: flex;
        align-items: center;
        gap: 6px;
        font-family: var(--font-mono);
        font-size: 0.7rem;
        font-weight: 700;
        color: #10B981;
        background: rgba(16, 185, 129, 0.1);
        border: 1px solid rgba(16, 185, 129, 0.3);
        padding: 4px 10px;
        border-radius: 12px;
    }

    .status-live-dot {
        width: 6px;
        height: 6px;
        background: #10B981;
        border-radius: 50%;
        box-shadow: 0 0 8px #10B981;
        animation: pulseGlow 2s infinite;
    }

    .mobile-nav-close {
        background: rgba(255, 255, 255, 0.06);
        border: 1px solid rgba(255, 255, 255, 0.12);
        color: #94A3B8;
        width: 36px;
        height: 36px;
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.1rem;
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .mobile-nav-close:active {
        background: rgba(239, 68, 68, 0.2);
        color: #EF4444;
        border-color: rgba(239, 68, 68, 0.4);
        transform: scale(0.92);
    }

    /* Scrollable Links Grid */
    .mobile-nav-links {
        flex: 1;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
        gap: 10px;
        padding-right: 4px;
        -webkit-overflow-scrolling: touch;
    }

    .mobile-nav-links::-webkit-scrollbar {
        width: 4px;
    }

    .mobile-nav-links::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.15);
        border-radius: 4px;
    }

    .mobile-nav-card {
        display: flex;
        align-items: center;
        gap: 14px;
        background: rgba(15, 23, 42, 0.65);
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 14px;
        padding: 12px 14px;
        text-decoration: none;
        transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
        position: relative;
        overflow: hidden;
    }

    .mobile-nav-card:active,
    .mobile-nav-card:hover {
        background: rgba(16, 185, 129, 0.1);
        border-color: rgba(16, 185, 129, 0.4);
        transform: translateX(4px);
    }

    .nav-card-icon {
        width: 42px;
        height: 42px;
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.15rem;
        flex-shrink: 0;
        transition: transform 0.2s ease;
    }

    .mobile-nav-card:hover .nav-card-icon {
        transform: scale(1.08);
    }

    .icon-home {
        background: rgba(16, 185, 129, 0.15);
        color: #10B981;
        border: 1px solid rgba(16, 185, 129, 0.3);
    }

    .icon-ai {
        background: rgba(167, 139, 250, 0.15);
        color: #A78BFA;
        border: 1px solid rgba(167, 139, 250, 0.3);
    }

    .icon-robotics {
        background: rgba(16, 185, 129, 0.15);
        color: #10B981;
        border: 1px solid rgba(16, 185, 129, 0.3);
    }

    .icon-iot {
        background: rgba(245, 158, 11, 0.15);
        color: #F59E0B;
        border: 1px solid rgba(245, 158, 11, 0.3);
    }

    .icon-services {
        background: rgba(236, 72, 153, 0.15);
        color: #EC4899;
        border: 1px solid rgba(236, 72, 153, 0.3);
    }

    .icon-about {
        background: rgba(5, 150, 105, 0.15);
        color: #059669;
        border: 1px solid rgba(5, 150, 105, 0.3);
    }

    .icon-why {
        background: rgba(16, 185, 129, 0.15);
        color: #34D399;
        border: 1px solid rgba(16, 185, 129, 0.3);
    }

    .nav-card-info {
        display: flex;
        flex-direction: column;
        gap: 2px;
        flex: 1;
    }

    .nav-card-title {
        font-family: 'Outfit', sans-serif;
        font-size: 0.92rem;
        font-weight: 800;
        color: #F8FAFC;
        letter-spacing: 0.03em;
    }

    .nav-card-sub {
        font-size: 0.74rem;
        color: #94A3B8;
        font-weight: 500;
    }

    .nav-card-arrow {
        color: #64748B;
        font-size: 0.85rem;
        transition: all 0.2s ease;
    }

    .mobile-nav-card:hover .nav-card-arrow {
        color: #10B981;
        transform: translateX(3px);
    }

    /* Footer Action Bar */
    .mobile-nav-footer {
        padding-top: 14px;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        margin-top: 12px;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .mobile-btn-estimate {
        width: 100%;
        padding: 13px;
        border-radius: 12px;
        background: linear-gradient(135deg, #10B981 0%, #059669 100%);
        color: #FFFFFF;
        text-decoration: none;
        font-family: 'Outfit', sans-serif;
        font-weight: 800;
        font-size: 0.88rem;
        letter-spacing: 0.04em;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        box-shadow: 0 4px 16px rgba(16, 185, 129, 0.35);
        transition: all 0.2s ease;
        box-sizing: border-box;
    }

    .mobile-btn-estimate:active {
        transform: scale(0.98);
        box-shadow: 0 2px 10px rgba(16, 185, 129, 0.2);
    }

    .mobile-nav-badge {
        font-size: 0.7rem;
        color: #64748B;
        text-align: center;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
    }

    /* 8. Global Subpage Layout & Grid Responsiveness Overrides */
    html,
    body {
        overflow-x: hidden !important;
        width: 100vw !important;
        max-width: 100% !important;
    }

    /* Force all inline grid-column spans to stack full width */
    [style*="grid-column: span"],
    [style*="grid-column: 1 / -1"] {
        grid-column: 1 / -1 !important;
    }

    [style*="grid-template-columns: repeat(3,"],
    [style*="grid-template-columns: repeat(2,"],
    [style*="grid-template-columns: 1fr 1fr"],
    [style*="grid-template-columns: 1fr 1.2fr"],
    [style*="grid-template-columns: 1.2fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    /* Service Cards (services.html) */
    .service-card {
        display: flex !important;
        flex-direction: column !important;
        grid-template-columns: 1fr !important;
        padding: 0 !important;
        overflow: hidden !important;
    }

    .service-body {
        padding: 24px 20px !important;
    }

    .service-media {
        min-height: 240px !important;
        max-height: 280px !important;
        width: 100% !important;
    }

    .cyber-feature-box {
        padding: 14px !important;
    }

    .service-footer {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
        margin-top: 16px !important;
    }

    .service-footer .btn-primary {
        width: 100% !important;
        justify-content: center !important;
    }

    /* Founder Hero Sections (silico.html, techbeast.html, technos.html) */
    .founder-hero {
        padding: 80px 20px 40px 20px !important;
        min-height: auto !important;
    }

    .founder-hero-content {
        flex-direction: column !important;
        gap: 30px !important;
    }

    .founder-hero-name {
        font-size: clamp(2.5rem, 12vw, 3.5rem) !important;
    }

    .radar-chart-wrapper {
        width: 100% !important;
        max-width: 320px !important;
        margin: 0 auto !important;
    }

    /* Bento & Case Studies (case-studies.html, about.html) */
    .case-study-card {
        flex-direction: column !important;
        padding: 20px !important;
    }

    .case-study-card.cs-reverse {
        flex-direction: column !important;
    }

    .cs-image {
        min-height: 200px !important;
        width: 100% !important;
    }

    .cs-metrics {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .cs-tech-stack {
        flex-wrap: wrap !important;
    }

    /* Labs Explorer (labs.html) */
    .lab-tabs {
        flex-wrap: wrap !important;
        gap: 8px !important;
    }

    .lab-tab-btn {
        flex: 1 1 calc(50% - 8px) !important;
        font-size: 0.8rem !important;
        padding: 8px 12px !important;
        justify-content: center !important;
    }

    .lab-content-panel {
        grid-template-columns: 1fr !important;
    }

    /* Footer Mobile Responsiveness */
    .footer-top {
        flex-direction: column !important;
        gap: 32px !important;
    }

    .footer-links-group {
        flex-direction: column !important;
        gap: 24px !important;
        width: 100% !important;
    }

    .f-col {
        width: 100% !important;
        min-width: unset !important;
    }

    .footer-bottom {
        flex-direction: column !important;
        gap: 16px !important;
        text-align: center !important;
    }

    .footer-badges {
        justify-content: center !important;
    }

    @keyframes fadeIn {
        from {
            opacity: 0;
        }

        to {
            opacity: 1;
        }
    }
}