/* =========================================
   GLOBAL VARIABLES & RESETS
   ========================================= */
:root {
    --bg-main: #ffffff; 
    --text-main: #1a2b4c; 
    --text-muted: #6c757d;
    --accent: #0056d2; 
    --font-heading: 'Plus Jakarta Sans', sans-serif;
    --font-body: 'Inter', sans-serif;
    --glass-border: rgba(0, 86, 210, 0.1);
}
html {
    -webkit-text-size-adjust: 100%; 
}

h1, h2, h3, h4, h5, p, span, a, li, .eyebrow-text {
    overflow-wrap: break-word;
    word-wrap: break-word;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { background-color: var(--bg-main); color: var(--text-main); font-family: var(--font-body); overflow-x: hidden; line-height: 1.6; }
h1, h2, h3, h4, .btn, .nav-links a { font-family: var(--font-heading); }

/* =========================================
   SMOOTH THEME TRANSITION
   ========================================= */
* {
    transition: background-color 0.5s ease, color 0.5s ease, border-color 0.5s ease, box-shadow 0.5s ease;
}

.video-overlay, 
.hero-bg-video-section,
.bento-card,
.glass-card,
.team-card {
    transition: all 0.5s ease-in-out !important;
}

#theme-toggle {
    transition: transform 0.4s ease, background-color 0.3s ease;
}

/* Buttons */
.btn { display: inline-block; padding: 12px 24px; text-decoration: none; border-radius: 8px; font-weight: bold; transition: 0.3s; cursor: pointer; border: none; }
.primary-btn { background: var(--accent); color: #ffffff; box-shadow: 0 4px 15px rgba(0, 86, 210, 0.2); }
.primary-btn:hover { box-shadow: 0 6px 20px rgba(0, 86, 210, 0.4); transform: translateY(-2px); }
.btn-small { padding: 10px 20px; font-size: 0.85rem; }

/* =========================================
   UNIVERSAL NAVIGATION BAR (CLASSIC)
   ========================================= */
.top-nav { position: fixed; top: 0; left: 0; width: 100%; padding: 15px 5%; background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid rgba(0, 0, 0, 0.05); display: flex; justify-content: space-between; align-items: center; z-index: 2000; }
.logo { display: flex; align-items: center; }
.logo img { height: 75px; width: auto; object-fit: contain; }

.nav-links { display: flex; list-style: none; gap: 25px; margin: 0; padding: 0; }
.nav-links a { color: var(--text-main); text-decoration: none; font-size: 0.9rem; font-weight: 600; transition: color 0.3s; }
.nav-links a:hover { color: var(--accent); }

.nav-actions { display: flex; align-items: center; gap: 20px; }
.hamburger-menu { display: none !important; background: none; border: none; cursor: pointer; color: var(--text-main); }

/* =========================================
   MOBILE MENU DRAWER
   ========================================= */
.menu-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100vh; background: rgba(10, 25, 47, 0.4); backdrop-filter: blur(4px); z-index: 2500; opacity: 0; pointer-events: none; transition: 0.3s; }
.menu-overlay.active { opacity: 1; pointer-events: auto; }
.mobile-menu { position: fixed; top: 0; right: 0; width: 320px; max-width: 85vw; height: 100vh; background: #ffffff; padding: 30px 25px; box-shadow: -10px 0 30px rgba(0,0,0,0.1); display: flex; flex-direction: column; z-index: 3000; transform: translateX(100%); transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1); }
.mobile-menu.active { transform: translateX(0); }
.mobile-menu-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--glass-border); padding-bottom: 20px; margin-bottom: 30px; }
.close-menu { background: none; border: none; font-size: 2.2rem; color: var(--text-main); cursor: pointer; line-height: 1; }
.mobile-nav-links { list-style: none; display: flex; flex-direction: column; gap: 20px; padding: 0; margin: 0; }
.mobile-nav-links a { font-size: 1.2rem; color: var(--text-main); text-decoration: none; font-weight: 600; font-family: var(--font-heading);}
.mobile-nav-links a:hover { color: var(--accent); }

/* =========================================
   BENTO BOX FOOTER
   ========================================= */
.footer-bento-wrapper { background: #f8fafc; padding: 60px 5% 40px; border-top: 1px solid var(--glass-border); position: relative; z-index: 10;}
.bento-footer-grid { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.bento-f-card { background: #ffffff; border-radius: 20px; padding: 40px; border: 1px solid rgba(0, 0, 0, 0.05); box-shadow: 0 10px 30px rgba(0, 86, 210, 0.03); display: flex; flex-direction: column; transition: 0.3s; }
.bento-f-card:hover { transform: translateY(-3px); box-shadow: 0 15px 40px rgba(0, 86, 210, 0.08); }
.brand-card { grid-column: span 2; justify-content: space-between; }
.bento-logo { height: 85px; object-fit: contain; margin-bottom: 20px; align-self: flex-start; }
.brand-card p { color: var(--text-muted); font-size: 1.05rem; max-width: 400px; margin-bottom: 30px; }
.bento-contact-info { display: flex; gap: 20px; color: var(--text-main); font-size: 0.95rem; }
.newsletter-card { background: var(--text-main); color: #ffffff; grid-column: span 1; justify-content: center; }
.newsletter-card h4 { font-size: 1.3rem; margin-bottom: 10px; color: #ffffff; }
.newsletter-card p { color: #a0aec0; font-size: 0.95rem; margin-bottom: 25px; }
.bento-form { display: flex; gap: 10px; }
.bento-form input { flex: 1; padding: 12px 15px; border-radius: 8px; border: none; font-family: var(--font-body); }
.bento-form button { background: var(--accent); color: #fff; border: none; border-radius: 8px; padding: 0 20px; font-size: 1.2rem; cursor: pointer; transition: 0.3s; }
.bento-form button:hover { background: #0044a8; }
.legal-card { grid-column: span 3; flex-direction: row; justify-content: space-between; align-items: center; padding: 25px 40px; }
.legal-card p { margin: 0; color: var(--text-muted); font-size: 0.9rem; }
.legal-links a { color: var(--text-muted); text-decoration: none; font-size: 0.9rem; margin-left: 20px; transition: 0.3s; }
.legal-links a:hover { color: var(--accent); }

/* =========================================
   COMPACT CARDS & IMAGES 
   ========================================= */
.glass-card {
    background: #fff;
    border: 1px solid rgba(0,86,210,.1);
    border-radius: 15px;
    padding: 25px 20px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,86,210,.05);
    transition: transform .4s ease, box-shadow .4s ease;
}
.glass-card:hover { transform: translateY(-8px); box-shadow: 0 15px 40px rgba(0,86,210,.15); border-color: rgba(0,86,210,.3); }

.service-img { 
    width: 100%; 
    height: 130px; 
    object-fit: cover; 
    border-radius: 10px; 
    margin-bottom: 15px; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.06); 
    transition: transform 0.4s ease; 
}
.glass-card:hover .service-img { transform: scale(1.03); }

.centered-card h3 { font-size: 1.15rem; margin-bottom: 8px; color: var(--accent); }
.centered-card p { font-size: 0.85rem; margin: 0; max-width: 250px; color: var(--text-muted); line-height: 1.5; }

/* =========================================
   DARK MODE TOGGLE BUTTON
   ========================================= */
.theme-btn { background: none; border: none; font-size: 1.4rem; cursor: pointer; padding: 5px 10px; transition: transform 0.3s ease; color: var(--text-main); display: flex; align-items: center; justify-content: center; }
.theme-btn:hover { transform: scale(1.15); }

/* =========================================
   DARK MODE COLOR PALETTE & OVERRIDES
   ========================================= */
body.dark-theme { --bg-main: #0a0f1a; --text-main: #f8fafc; --text-muted: #94a3b8; --accent: #3b82f6; --glass-border: rgba(255, 255, 255, 0.1); }
body.dark-theme .top-nav { background: rgba(10, 15, 26, 0.95); border-bottom: 1px solid var(--glass-border); }
body.dark-theme .mobile-menu { background: #0a0f1a; }
body.dark-theme .footer-bento-wrapper { background: #05080f; border-top: 1px solid var(--glass-border); }

/* Remove White Backgrounds in Dark Mode */
body.dark-theme .process-section, body.dark-theme .about-cta, body.dark-theme .stats-section, body.dark-theme .tech-stack-section { background: transparent !important; }

/* Dark Slate Cards */
body.dark-theme .glass-card, body.dark-theme .bento-f-card, body.dark-theme .team-card, body.dark-theme .timeline-card, body.dark-theme .stats-container, body.dark-theme .custom-card, body.dark-theme .pillar-card, body.dark-theme .glass-form { background: #111827; border-color: var(--glass-border); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); }
body.dark-theme .bento-f-card.newsletter-card { background: #1e293b; color: #fff; }
body.dark-theme .stat-divider { background: var(--glass-border); }
body.dark-theme .step-node { background: #111827; }
body.dark-theme .tech-tag { background: rgba(255, 255, 255, 0.05); color: #fff; }
body.dark-theme .tech-tag:hover { background: rgba(255, 255, 255, 0.1); }
body.dark-theme input, body.dark-theme textarea { background: #1f2937; color: #fff; border-color: #374151; }
body.dark-theme input:focus, body.dark-theme textarea:focus { background: #111827; }

/* Software Page Mockup Overrides */
body.dark-theme .mockup-browser, body.dark-theme .mockup-phone, body.dark-theme .ui-card { background: #111827; border-color: #374151; }
body.dark-theme .browser-top { background: #1f2937; border-color: #374151; }
body.dark-theme .b-sidebar, body.dark-theme .p-card { background: #1f2937; }

/* =========================================
   DARK MODE PATCH FOR ALL PAGES
   ========================================= */

/* Fix Video Overlay in Dark Mode */
body.dark-theme .video-overlay {
    background: linear-gradient(to right, rgba(10, 15, 26, 0.95) 0%, rgba(10, 15, 26, 0.7) 60%, rgba(10, 15, 26, 0) 100%) !important;
    position: fixed;
}
/* Homepage Service Cards Dark Mode Fix */
body.dark-theme .service-img {
    mix-blend-mode: normal;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    padding: 10px;
}
/* Fix Hero and Section Backgrounds */
body.dark-theme .careers-hero, body.dark-theme .perks-section, body.dark-theme .jobs-section, body.dark-theme .story-content, body.dark-theme .curriculum-section, body.dark-theme .lab-setup-section, body.dark-theme .customization-section, body.dark-theme .contact-section, body.dark-theme .contact-card, body.dark-theme .contact-form-panel { background-color: var(--bg-main) !important; background: var(--bg-main) !important; }

/* Fix Standard Cards */
body.dark-theme .perk-card, body.dark-theme .job-card, body.dark-theme .custom-card, body.dark-theme .timeline-card, body.dark-theme .contact-form-panel { background-color: #111827 !important; border-color: #374151 !important; }

/* Fix R&D Bento Cards & Strip Gradients */
body.dark-theme .bento-card, body.dark-theme .card-erp, body.dark-theme .card-crm, body.dark-theme .card-lms, body.dark-theme .card-custom { background: #111827 !important; background-image: none !important; border-color: #374151 !important; }
body.dark-theme .bento-card h3 { color: #f8fafc !important; }
body.dark-theme .bento-card p, body.dark-theme .feature-list li { color: #94a3b8 !important; }
body.dark-theme .bento-card .card-icon { background: rgba(255, 255, 255, 0.05) !important; }

/* Fix the Isometric Grid in Careers */
body.dark-theme .isometric-grid { background-image: linear-gradient(rgba(255,255,255,0.05) 2px, transparent 2px), linear-gradient(90deg, rgba(255,255,255,0.05) 2px, transparent 2px) !important; }

/* Ensure specific text colors are readable */
body.dark-theme .job-meta .meta-tag { background: #1f2937 !important; color: #f8fafc !important; }
body.dark-theme .story-content p, body.dark-theme .job-card p, body.dark-theme .contact-info-panel p { color: var(--text-muted) !important; }


/* =========================================
   SOCIAL MEDIA ICONS (CONTACT PAGE)
   ========================================= */
.social-links { display: flex; gap: 15px; margin-top: 40px; list-style: none; padding: 0; }
.social-links a { display: flex; align-items: center; justify-content: center; width: 45px; height: 45px; background: rgba(255, 255, 255, 0.1); border-radius: 50%; color: #ffffff; text-decoration: none; transition: all 0.3s ease; }
.social-links a:hover { background: var(--accent); transform: translateY(-3px); box-shadow: 0 5px 15px rgba(0, 86, 210, 0.3); }
.social-links svg { width: 20px; height: 20px; fill: currentColor; }

/* =========================================
   FLOATING WHATSAPP BUTTON
   ========================================= */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: #25D366;
    color: #fff;
    border-radius: 50px;
    box-shadow: 0px 4px 15px rgba(37, 211, 102, 0.4);
    z-index: 4000;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0px 6px 20px rgba(37, 211, 102, 0.6);
    color: #fff;
}
.whatsapp-float svg { width: 35px; height: 35px; fill: currentColor; }
/* =========================================
   GLOBAL MOBILE RESPONSIVENESS
   ========================================= */
@media (max-width: 1200px) {
    .nav-links, .desktop-cta { display: none !important; }
    .hamburger-menu { display: flex !important; align-items: center; }
    .bento-footer-grid { grid-template-columns: 1fr; }
    .brand-card, .newsletter-card, .legal-card { grid-column: span 1; }
    .legal-card { flex-direction: column; gap: 15px; text-align: center; }
    .bento-contact-info { flex-direction: column; gap: 5px; }
}

@media (max-width: 968px) {
    /* 1. THE IRONCLAD WRAPPER: Force everything inside the screen */
    html, body { 
        overflow-x: hidden !important; 
        width: 100% !important;
        max-width: 100% !important; 
        position: relative; 
        margin: 0; 
        padding: 0;
    }

    /* Contain background animations and grids */
    header, section, footer, main {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
    }

    .top-nav { width: 100% !important; box-sizing: border-box !important; }

    /* 2. TYPOGRAPHY SCALING: Shrink massive words to fit mobile screens */
    h1 { font-size: 2.2rem !important; line-height: 1.2 !important; }
    h2 { font-size: 1.8rem !important; line-height: 1.3 !important; }
    h3 { font-size: 1.4rem !important; }

    /* Allow the blue pill tags to wrap cleanly */
    .eyebrow-text {
        white-space: normal !important;
        height: auto !important;
        text-align: center;
        font-size: 0.75rem !important;
        padding: 8px 15px !important;
        display: inline-block;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* 3. CARD PADDING REDUCTION: Stop cards from pushing the edges */
    .glass-card, .bento-f-card, .team-card, .mv-card, .custom-card, .pillar-card, .job-card, .perk-card, .contact-info-panel, .contact-form-panel {
        padding: 25px 20px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* 4. FOOTER FORM FIX: Force stack the email input and button */
    .footer-bento-wrapper { padding: 50px 5% 60px !important; width: 100% !important; box-sizing: border-box !important; }
    .bento-footer-grid { display: flex; flex-direction: column; gap: 20px; width: 100% !important; box-sizing: border-box !important;}
    
    footer .bento-form {
        display: flex !important;
        flex-direction: column !important;
        gap: 12px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    footer .bento-form input, footer .bento-form button {
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 8px !important;
        padding: 14px !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }

    /* 5. WHATSAPP BUTTON SIZING */
    .whatsapp-float { bottom: 20px; right: 20px; width: 50px; height: 50px; z-index: 4000; }
    .whatsapp-float svg, .whatsapp-float img { width: 28px; height: 28px; }

    /* 6. SOFTWARE PAGE MOCKUP FIX: Shrinks the CSS art so it fits on screens */
    .service-visual {
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden !important;
        display: flex !important;
        justify-content: center !important;
        box-sizing: border-box !important;
    }
    .mockup-uiux, .mockup-browser, .mockup-phone {
        transform: scale(0.7) !important; /* Shrinks the art to 70% size */
        transform-origin: center center !important;
        margin: -30px 0 !important;
    }
}