:root {
    --primary: #00d2ff;
    --primary-glow: rgba(0, 210, 255, 0.4);
    --secondary: #925cff;
    --accent: #ff00c8;
    --bg-dark: #050b18;
    --bg-card: rgba(255, 255, 255, 0.03);
    --text-main: #eef2f7;
    --text-muted: #a0aec0;
    --gradient-hero: radial-gradient(circle at top right, #1a1a3a, #050b18 70%);
    --gradient-accent: linear-gradient(90deg, var(--primary), var(--secondary));
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-background: rgba(8, 18, 35, 0.92);
    /* Higher opacity for better readability */
    --font-main: 'Outfit', sans-serif;
}

/* Eco-Mode Variables */
body.eco-theme {
    --primary: #4ade80;
    /* Green tint */
    --secondary: #22c55e;
    --bg-dark: #020617;
    /* Even darker */
    --gradient-hero: #020617;
    /* No gradients */
    --bg-card: #0f172a;
    /* Solid background */
    --accent: #4ade80;
}

/* Industrial Theme */
body.theme-industrial {
    --primary: #F59E0B;
    /* Amber/Security Orange for visibility */
    --secondary: #7C2D12;
    --accent: #F59E0B;
    --bg-dark: #020617;
    --gradient-accent: linear-gradient(90deg, #F59E0B, #7C2D12);
    --primary-glow: rgba(245, 158, 11, 0.3);
}

/* Medical Theme */
body.theme-medical {
    --primary: #14B8A6;
    --secondary: #22C55E;
    --accent: #0EA5E9;
    --bg-dark: #f0fdfa;
    --text-main: #134e4a;
    --text-muted: #1f2937;
    --gradient-accent: linear-gradient(90deg, #14B8A6, #22C55E);
    --glass-background: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(20, 184, 166, 0.2);
}

/* Luxury Theme */
body.theme-luxury {
    --primary: #C7A14A;
    /* Fixed: Gold instead of background color */
    --secondary: #020617;
    --accent: #C7A14A;
    --bg-dark: #020617;
    --text-main: #f8fafc;
    --gradient-accent: linear-gradient(90deg, #1e1b4b, #C7A14A);
    --primary-glow: rgba(199, 161, 74, 0.4);
}

/* Elite Pulse Branding */
.btn-pulse {
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0% {
        box-shadow: 0 0 0 0 var(--primary-glow);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(0, 0, 0, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.8s cubic-bezier(0.22, 1, 0.36, 1),
        color 0.8s cubic-bezier(0.22, 1, 0.36, 1),
        border-color 0.8s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.8s ease;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Navigation Header */
.glass-header {
    position: fixed;
    top: 0;
    width: 100%;
    height: 80px;
    z-index: 1000;
    background: var(--glass-background);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--text-main);
}

.logo span {
    color: var(--primary);
}

.nav-links {
    display: flex;
    align-items: center;
}

.nav-links a {
    margin: 0 1rem;
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
}

/* Mega Menu */
.nav-item-dropdown {
    position: relative;
    display: flex;
    align-items: center;
}

.mega-menu {
    position: absolute;
    top: 100%;
    /* Position right below the nav item */
    padding-top: 20px;
    /* Bridge gap */
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    width: 90vw;
    max-width: 1000px;
    background: var(--glass-background);
    background-clip: padding-box;
    /* Ensures background doesn't bleed into padding bridge */
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 2.5rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.6);
}

.nav-item-dropdown:hover .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.mega-menu-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.mega-column {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.column-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 0.5rem;
}

.mega-column a {
    margin: 0 !important;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background 0.3s;
}

.mega-column a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.mega-column i {
    width: 20px;
    color: var(--primary);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-cta {
    background: var(--gradient-accent);
    color: white !important;
    padding: 0.7rem 1.8rem;
    border-radius: 50px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.8px;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px var(--primary-glow);
}

.nav-cta:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
    box-shadow: 0 8px 20px var(--primary-glow);
}

/* Eco Toggle */
#eco-toggle {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#eco-toggle i {
    color: #4ade80;
}

body.eco-theme #eco-toggle {
    background: var(--primary);
    color: white;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 120px 0 80px 0;
    background: var(--gradient-hero);
    position: relative;
    overflow: hidden;
}

.hero-bg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, rgba(0, 210, 255, 0.05), transparent);
    pointer-events: none;
}

.hero-content {
    max-width: 800px;
    z-index: 10;
}

.badge {
    background: rgba(0, 210, 255, 0.1);
    color: var(--primary);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid var(--primary-glow);
    margin-bottom: 1.5rem;
    display: inline-block;
}

.hero h1 {
    font-size: clamp(2.5rem, 8vw, 5rem);
    line-height: 1;
    margin-bottom: 2rem;
    font-weight: 700;
}

.hero h1 span {
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 3.5rem;
    max-width: 650px;
    line-height: 1.8;
}

.hero-actions {
    display: flex;
    gap: 1.5rem;
}

.btn-primary {
    background: var(--gradient-accent);
    color: white;
    padding: 1.2rem 2.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    box-shadow: 0 10px 25px var(--primary-glow);
}

.btn-secondary {
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 1.2rem 2.5rem;
    border-radius: 50px;
    text-decoration: none;
    backdrop-filter: blur(5px);
}

/* Bento Grid */
.bento-section {
    padding: 8rem 0;
}

.section-header {
    text-align: center;
    margin-bottom: 5rem;
}

.section-header h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.section-header h2 span {
    color: var(--primary);
}

.bento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 280px);
    gap: 1.5rem;
}

.bento-item {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.bento-item:hover {
    transform: scale(1.02);
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary);
}

/* Sector Switcher UI */
.showcase-section {
    padding: 8rem 0;
    background: rgba(0, 0, 0, 0.1);
}

.sector-switcher {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-top: 3rem;
}

.sector-btn {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 1rem 2rem;
    border-radius: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-weight: 600;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.sector-btn i {
    font-size: 1.2rem;
    color: var(--primary);
}

.sector-btn:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
}

.sector-btn.active {
    background: var(--gradient-accent);
    color: white;
    border: none;
}

.sector-btn.active i {
    color: white;
}

/* Metrics Section */
.metrics-section {
    padding: 4rem 0;
    background: rgba(146, 92, 255, 0.05);
}

.metrics-grid {
    grid-template-rows: auto;
}

.metric-card {
    text-align: center;
}

.metric-card h2 {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.gradient-text {
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.bento-item.large {
    grid-column: span 2;
    flex-direction: row;
    align-items: center;
    gap: 2rem;
}

.icon-box i {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

/* The Lab Section */
.lab-section {
    padding: 8rem 0;
    background: linear-gradient(180deg, var(--bg-dark), rgba(0, 0, 0, 0.4));
}

.lab-grid {
    grid-template-rows: repeat(2, 220px);
}

.tech-stack {
    justify-content: space-between !important;
}

.tech-logos {
    display: flex;
    gap: 2rem;
    font-size: 3rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.tech-logos i {
    color: var(--text-muted);
    transition: all 0.4s;
}

.tech-logos i:hover {
    color: var(--primary);
    transform: translateY(-5px) scale(1.1);
}

.icon-elite {
    font-size: 2.5rem;
    color: var(--accent);
    margin-bottom: 1rem;
}

/* Immersive Demo Window */
.showcase-window {
    margin-top: 4rem;
    padding: 3rem;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 32px;
    backdrop-filter: blur(20px);
    position: relative;
    overflow: hidden;
}

.demo-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.demo-text h3 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.demo-mockup {
    background: var(--gradient-accent);
    height: 350px;
    border-radius: 24px;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
    transition: all 0.5s ease;
}

.mockup-ui {
    background: rgba(0, 0, 0, 0.5);
    height: 100%;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem;
}

.mockup-line {
    height: 10px;
    background: rgba(255, 255, 255, 0.05);
    margin-bottom: 10px;
    border-radius: 5px;
}

/* Blog Section */
.blog-section {
    padding: 8rem 0;
}

.blog-grid {
    grid-template-rows: repeat(2, 300px);
}

.blog-card {
    position: relative;
    overflow: hidden;
}

.blog-card img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.3;
    transition: 0.5s;
}

.blog-card:hover img {
    opacity: 0.5;
    transform: scale(1.1);
}

.blog-meta {
    position: relative;
    z-index: 2;
    margin-top: auto;
}

.blog-tag {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--primary);
    font-weight: 700;
}

.contact-section {
    padding: 8rem 0;
    background: rgba(0, 0, 0, 0.2);
}

.contact-wrapper {
    display: flex;
    gap: 4rem;
    align-items: center;
}

.contact-form-container {
    flex: 1;
    padding: 3rem;
    border-radius: 30px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
}

.form-group {
    margin-bottom: 1.5rem;
}

input,
select,
textarea {
    width: 100%;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    appearance: none;
    /* Modern look */
}

/* Fix for unreadable dropdown options */
select option {
    background-color: var(--bg-dark);
    color: white;
}

.btn-submit {
    width: 100%;
    padding: 1.2rem;
    background: var(--gradient-accent);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
}

/* Animations Off in Eco Mode */
body.eco-theme * {
    animation: none !important;
    transition: none !important;
}

/* Responsiveness */
@media (max-width: 968px) {
    .bento-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    .bento-item.large {
        grid-column: auto;
        flex-direction: column;
    }

    .contact-wrapper {
        flex-direction: column;
    }

    .nav-links {
        display: none;
    }
}

/* Service Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
}

.modal-content {
    background: var(--glass-background);
    border: 1px solid var(--glass-border);
    padding: 3rem;
    border-radius: 24px;
    max-width: 500px;
    width: 90%;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--primary);
}

#modal-title {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

#modal-desc {
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 2rem;
}


/* Mobile Menu Toggle Fix */
.mobile-menu-btn {
    display: none;
    font-size: 1.5rem;
    color: var(--text-main);
    cursor: pointer;
}

@media (max-width: 968px) {
    .mobile-menu-btn {
        display: block;
    }
}


/* Mobile Menu Toggle Fix - Ensure this is at the end */
.mobile-menu-btn {
    display: none !important;
}

@media (max-width: 968px) {
    .mobile-menu-btn {
        display: block !important;
    }
}


/* NAVIGATION STABILITY FIXES */
.nav-container,
.nav-links,
.nav-item-dropdown {
    height: 100% !important;
}

.nav-item-dropdown {
    display: flex;
    align-items: center;
}

.mega-menu {
    top: 100% !important;
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* Ensure mobile button is hidden on desktop overrides */
.mobile-menu-btn {
    display: none !important;
}

@media (max-width: 968px) {
    .mobile-menu-btn {
        display: block !important;
    }
}


/* EMERGENCY MOBILE FIXES */
html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

img,
svg,
video {
    max-width: 100%;
    height: auto;
}

/* Adjust Header for Mobile to prevent overflow */
@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    .logo {
        font-size: 1.4rem;
    }

    .nav-cta {
        padding: 0.5rem 1rem;
        font-size: 0.75rem;
    }

    .nav-actions {
        gap: 0.5rem;
    }

    .glass-header {
        height: 70px;
    }
}


/* BUTTON & FOCUS POLISH */
button:focus,
a:focus,
.btn-primary:focus,
.nav-cta:focus {
    outline: none !important;
    box-shadow: 0 0 0 4px var(--primary-glow) !important;
}

button:active,
a:active {
    transform: scale(0.98);
}

/* Ensure border-radius is respected by everything inside buttons */
button,
.btn-primary,
.nav-cta,
.btn-secondary {
    overflow: hidden;
}


/* FINAL POLISH - SHADOWS & MOBILE HEADER */
.btn-primary,
.btn-secondary,
.nav-cta,
button {
    box-shadow: none !important;
    /* Reset generic shadows */
    position: relative;
    border-radius: 50px !important;
    /* Enforce pill shape */
    overflow: hidden !important;
    /* Clip content/shadows */
}

/* Custom rounded shadow using pseudo-element for smoothness */
.btn-primary::after,
.nav-cta::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50px;
    box-shadow: 0 5px 15px var(--primary-glow);
    z-index: -1;
    transition: opacity 0.3s;
}

/* Mobile Header Tweak - Prevent overlap */
@media (max-width: 400px) {
    .logo {
        font-size: 1.2rem !important;
    }

    .logo span {
        display: none;
        /* Hide 'Studio' on very small screens to save space */
    }

    .logo::after {
        content: '.';
        color: var(--primary);
    }

    .nav-cta {
        padding: 0.5rem 0.8rem !important;
        font-size: 0.7rem !important;
    }
}


/* FINAL MOBILE SHOWCASE FIX */
@media (max-width: 968px) {
    .demo-content {
        grid-template-columns: 1fr;
        /* Stack vertically */
        gap: 2rem;
    }

    .demo-mockup {
        padding: 1rem;
        /* Reduce padding for more space */
        height: auto;
        min-height: 300px;
    }

    .demo-text {
        text-align: center;
    }

    .demo-text h3 {
        font-size: 1.8rem;
        /* Smaller title */
    }
}