@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

/* El menú móvil siempre oculto por defecto (se muestra solo en móvil via JS) */
.mobile-menu {
    display: none;
}

:root {
    --bg-main: #ffffff;
    --card-white: #ffffff;
    --blue-light: #f0f7ff;
    --blue-medium: #e0f2fe;
    --blue-vibrant: #2563eb;
    --blue-deep: #1e40af;
    --blue-darkest: #0f172a;
    --accent: #06b6d4;
    --accent-cyan: #06b6d4;
    --text-main: #0f172a;
    --text-muted: #475569;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --shadow-soft: 0 8px 32px 0 rgba(37, 99, 235, 0.05);
    --shadow-hover: 0 20px 48px -12px rgba(37, 99, 235, 0.12);
    --primary-logo: #185f89;
    --radius-l: 32px;
    --transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    --tech-grid-opacity: 0.05;
}

/* DARK MODE OVERRIDES */
body.dark-mode {
    --bg-main: #030712;
    --card-white: #0a0f1d;
    --blue-light: rgba(37, 99, 235, 0.05);
    --blue-medium: rgba(37, 99, 235, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-bg: rgba(15, 23, 42, 0.6);
    --glass-border: rgba(255, 255, 255, 0.05);
    --shadow-soft: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 20px 48px -12px rgba(0, 0, 0, 0.5);
    --tech-grid-opacity: 0.12;
}

body.dark-mode nav.scrolled .nav-container {
    background: rgba(10, 15, 29, 0.85);
    border-color: rgba(255, 255, 255, 0.08);
}

body.dark-mode .logo-text {
    color: #ffffff;
}

body.dark-mode .btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

body.dark-mode .trust-bar {
    background: #030712;
    border-color: rgba(255, 255, 255, 0.05);
}

body.dark-mode .tech-item {
    background: rgba(37, 99, 235, 0.1);
}

body.dark-mode .service-icon {
    background: rgba(37, 99, 235, 0.15);
    color: var(--accent);
}

body.dark-mode footer {
    background: #02040a;
    border-color: rgba(255, 255, 255, 0.05);
}

body.dark-mode .card-hero-main {
    background: linear-gradient(135deg, #0a0f1d 0%, #030712 100%);
    border-color: rgba(255, 255, 255, 0.05);
}

body.dark-mode .hero-pod {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.2) 0%, rgba(6, 182, 212, 0.25) 100%);
    border-color: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* --- Layout --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

section {
    padding: 180px 0;
}

/* --- Bento Grid Base --- */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: minmax(100px, auto);
    gap: 20px;
}

.bento-card {
    background: var(--card-white);
    border-radius: var(--radius-l);
    padding: 32px;
    border: 1px solid rgba(0, 0, 0, 0.03);
    box-shadow: var(--shadow-soft);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.bento-card:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: var(--shadow-hover);
    border-color: var(--blue-vibrant);
}

.bento-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at var(--x, 50%) var(--y, 50%), rgba(37, 99, 235, 0.05) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.bento-card:hover::after {
    opacity: 1;
}

/* Glassmorphism Effect */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
}

/* --- Navigation --- */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 24px 0;
    /* Add space via padding */
    display: flex;
    justify-content: center;
    z-index: 1000;
    pointer-events: none;
    transition: var(--transition);
}

/* No background on nav itself, it's just a positioner */
nav.scrolled {
    padding: 12px 0;
}

.nav-container {
    background: rgba(255, 255, 255, 0.15);
    /* Slightly clearer glass */
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    padding: 12px 32px;
    border-radius: 100px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 10px 40px rgba(37, 99, 235, 0.08);
    width: 90%;
    max-width: 1100px;
    pointer-events: auto;
    transition: var(--transition);
}

nav.scrolled .nav-container {
    background: rgba(255, 255, 255, 0.7);
    /* More opaque when scrolled over content */
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.05);
    border-color: rgba(255, 255, 255, 0.5);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo img {
    height: 32px;
}

.logo-text {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--blue-darkest);
    /* Este es el tono "gris" oscuro */
    letter-spacing: -0.5px;
}

.logo-text span {
    color: var(--primary-logo);
    /* Este es el tono azul */
}

.nav-links {
    display: flex;
    gap: 30px;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-main);
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    padding: 0.2rem 0;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--blue-vibrant), var(--accent));
    transition: width 0.3s ease;
    border-radius: 2px;
}

.nav-links a:hover {
    color: var(--blue-vibrant);
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-links a.active {
    color: var(--blue-vibrant);
}

.nav-links a.active::after {
    width: 100%;
}


.nav-cta {
    background: var(--blue-deep);
    color: white !important;
    padding: 10px 24px;
    border-radius: 50px;
}

.nav-cta::after {
    display: none !important;
}

.nav-cta:hover {
    background: var(--blue-darkest);
    transform: scale(1.05);
    color: white !important;
}

/* --- Hero Bento --- */
.hero-grid .bento-grid {
    grid-template-columns: repeat(10, 1fr);
}

.hero-grid {
    padding-top: 120px;
    padding-bottom: 120px;
}

.card-hero-main {
    grid-column: span 7;
    grid-row: span 2;
    background: linear-gradient(135deg, white 0%, #f1f5f9 100%);
    justify-content: center;
}

/* --- Bot Animation --- */
.bot-animation-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    /* To allow glow to spread */
}

.bot-frame {
    max-width: 120%;
    /* Increased for impact */
    height: auto;
    object-fit: contain;
    z-index: 2;
    background: transparent !important;
    transition: filter 0.3s ease;
}

.bot-animation-container:hover .bot-frame {
    filter: drop-shadow(0 0 50px rgba(37, 99, 235, 0.4)) brightness(1.1);
}

.hero-visual-area {
    grid-column: span 3;
    grid-row: span 2;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 20px;
}

.hero-image-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-l);
    overflow: hidden;
}

.hero-visual-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-l);
    animation: image-breathe 8s ease-in-out infinite;
}

.image-overlay-glow {
    display: none;
}

@keyframes image-breathe {

    0%,
    100% {
        transform: scale(1);
        filter: brightness(1);
    }

    50% {
        transform: scale(1.03);
        filter: brightness(1.1);
    }
}

/* Central Pod for Logo */
.hero-pod {
    width: 180px;
    height: 180px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(6, 182, 212, 0.15) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08), inset 0 0 15px rgba(255, 255, 255, 0.5);
    position: relative;
    z-index: 2;
    animation: pod-float 6s ease-in-out infinite;
}

.hero-pod::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 41px;
    background: linear-gradient(135deg, var(--blue-vibrant), var(--accent));
    opacity: 0.4;
    z-index: -1;
}

.hero-logo-floating {
    width: 110px;
    /* Slightly larger */
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.05));
    /* Removed invert */
    animation: logo-spin 20s linear infinite;
    z-index: 5;
}

@keyframes pod-float {

    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-15px) scale(1.02);
    }
}

/* Breathe animation for logo */
@keyframes logo-spin {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.03);
        opacity: 0.95;
    }
}

.floating-testimonial-card {
    position: absolute;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--gray-200);
    padding: 12px;
    border-radius: 16px;
    width: 180px;
    font-size: 0.72rem;
    color: var(--gray-800);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.06);
    z-index: 3;
    animation: floating 8s ease-in-out infinite;
    pointer-events: none;
}

.testimonial-1 {
    top: 5%;
    right: 5%;
    animation-delay: 0s;
}

.testimonial-2 {
    bottom: 5%;
    left: 5%;
    animation-delay: 2s;
}

.testimonial-text {
    font-weight: 500;
    line-height: 1.5;
    margin-bottom: 8px;
    min-height: 44px;
    color: var(--dark);
}

.testimonial-author {
    display: block;
    font-size: 0.7rem;
    color: var(--blue-vibrant);
    font-weight: 700;
}

@media (max-width: 1100px) {
    .show-on-desktop {
        display: none !important;
    }
}

.hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--blue-light);
    color: var(--blue-deep);
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 8px;
    margin-bottom: 20px;
    width: fit-content;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 10px var(--accent);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.5);
        opacity: 0.5;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.btn-cta-main {
    background: linear-gradient(135deg, var(--blue-deep), var(--blue-vibrant));
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.25);
    border: none !important;
}

.btn-cta-main:hover {
    box-shadow: 0 15px 35px rgba(37, 99, 235, 0.4);
    transform: translateY(-2px) scale(1.02) !important;
}

.card-hero-main h1 {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 24px;
    letter-spacing: -2px;
}

.gradient-text {
    background: linear-gradient(135deg, var(--blue-deep) 0%, var(--blue-vibrant) 50%, var(--accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin-bottom: 32px;
}

.btn-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--blue-deep);
    color: white;
}

.btn-primary:hover {
    background: var(--blue-darkest);
    transform: scale(1.02);
}

.btn-secondary {
    background: white;
    color: var(--blue-deep);
    border: 1px solid var(--blue-medium);
}

.btn-secondary:hover {
    background: var(--blue-light);
}

/* --- Stats Cards --- */
.hero-grid .card-stat:nth-child(3) {
    grid-column: span 3;
}

.hero-grid .card-stat:nth-child(4) {
    grid-column: span 4;
}

.hero-grid .card-stat:nth-child(5) {
    grid-column: span 3;
}

.card-stat {
    grid-column: span 1;
    text-align: center;
    justify-content: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--blue-deep);
}

/* --- Trust Bar --- */
.trust-bar {
    background: white;
    padding: 40px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.trust-label {
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 30px;
}

.tech-stack-scroll {
    display: flex;
    gap: 40px;
    justify-content: center;
    flex-wrap: wrap;
    animation: fade-in-up 1s ease-out;
}

.tech-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: var(--blue-deep);
    background: var(--blue-light);
    padding: 10px 20px;
    border-radius: 50px;
    transition: var(--transition);
    cursor: default;
}

.tech-item:hover {
    background: var(--blue-vibrant);
    color: white;
    transform: translateY(-3px);
}

.tech-icon {
    font-size: 1.2rem;
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Hero Stats --- */
.section-header {
    text-align: center;
    margin-bottom: 70px;
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
}

.services-grid {
    grid-template-columns: repeat(3, 1fr);
}

.card-service {
    padding: 40px;
}

.service-icon {
    width: 60px;
    height: 60px;
    background: var(--blue-light);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    color: var(--blue-deep);
}

.card-service h3 {
    margin-bottom: 12px;
    font-size: 1.25rem;
}

.card-service p {
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* --- Why NexaCore --- */
.card-why-main {
    grid-column: span 2;
    grid-row: span 2;
}

.card-feature {
    grid-column: span 1;
    background: var(--blue-light);
    border: none;
}

/* --- Process --- */
.process-grid {
    grid-template-columns: repeat(4, 1fr);
}

.card-step {
    text-align: center;
}

.step-number {
    width: 40px;
    height: 40px;
    background: var(--blue-deep);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-weight: 700;
}

/* --- Sectors --- */
.sectors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* --- CTA --- */
.card-cta {
    grid-column: span 4;
    background: linear-gradient(135deg, var(--blue-deep), var(--blue-darkest));
    color: white;
    text-align: center;
    padding: 80px 40px;
}

.card-cta h2 {
    font-size: 3rem;
    margin-bottom: 20px;
}

.card-cta p {
    opacity: 0.9;
    margin-bottom: 40px;
}

/* --- Footer --- */
footer {
    background: #0f172a;
    color: #cbd5e1;
    padding: 60px 0 2rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

body.dark-mode footer {
    background: #02040a;
    border-color: rgba(255, 255, 255, 0.05);
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-brand .logo {
    margin-bottom: 1rem;
}

.footer-brand p {
    color: #64748b;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.footer-social {
    display: flex;
    gap: 0.8rem;
}

.footer-social a {
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-sm, 8px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    transition: var(--transition, 0.3s ease);
}

body.dark-mode .footer-social a {
    background: rgba(255, 255, 255, 0.06);
    color: #64748b;
}

.footer-social a:hover {
    background: var(--blue-vibrant);
    color: #fff;
    transform: translateY(-2px);
}

.footer-social a svg {
    width: 18px;
    height: 18px;
}

.footer-column h4 {
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-links a {
    color: #64748b;
    font-size: 0.95rem;
    text-decoration: none;
    transition: var(--transition, 0.3s ease);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.footer-links a:hover {
    color: var(--blue-medium, #e0f2fe);
    transform: translateX(3px);
}

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #64748b;
    font-size: 0.9rem;
    flex-wrap: wrap;
    gap: 1rem;
}

body.dark-mode .footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* --- 3D Abstract Elements (CSS-based) --- */
.glass-sphere {
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle at 30% 30%, rgba(37, 99, 235, 0.2), rgba(6, 182, 212, 0.05));
    border-radius: 50%;
    filter: blur(60px);
    z-index: -1;
    pointer-events: none;
    animation: floating 8s ease-in-out infinite;
}

@keyframes floating {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(5deg);
    }
}

.sphere-1 {
    top: -150px;
    right: -100px;
    background: radial-gradient(circle at 30% 30%, var(--accent), transparent);
    opacity: 0.15;
    animation: drift 15s ease-in-out infinite alternate;
}

.sphere-2 {
    bottom: -200px;
    left: -150px;
    background: radial-gradient(circle at 70% 70%, var(--blue-deep), transparent);
    opacity: 0.1;
    animation: drift 20s ease-in-out infinite alternate-reverse;
}

@keyframes drift {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(100px, 50px) scale(1.1);
    }
}

/* --- Tech Grid Background --- */
.tech-bg-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.tech-grid {
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    background-image:
        linear-gradient(rgba(37, 99, 235, var(--tech-grid-opacity)) 1px, transparent 1px),
        linear-gradient(90deg, rgba(37, 99, 235, var(--tech-grid-opacity)) 1px, transparent 1px);
    background-size: 50px 50px;
    transform: perspective(500px) rotateX(60deg);
    animation: gridMove 20s linear infinite;
    transition: background-image 0.5s ease;
}

@keyframes gridMove {
    0% {
        transform: perspective(500px) rotateX(60deg) translateY(0);
    }

    100% {
        transform: perspective(500px) rotateX(60deg) translateY(50px);
    }
}

/* --- Theme Toggle Floating Button --- */
.theme-toggle-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--blue-vibrant);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.3);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.theme-toggle-btn:hover {
    transform: scale(1.1) rotate(15deg);
    background: var(--blue-deep);
}

.theme-toggle-btn svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sun-icon {
    display: none;
}

body.dark-mode .sun-icon {
    display: block;
}

body.dark-mode .moon-icon {
    display: none;
}

/* Consolidating styles */

/* ===========================
   RESPONSIVE — TABLET (1024px)
   =========================== */
@media (max-width: 1024px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .card-hero-main,
    .hero-visual-area,
    .card-cta {
        grid-column: span 2;
    }

    .card-hero-main h1 {
        font-size: 2.5rem;
    }

    section {
        padding: 100px 0;
    }

    .hero-grid {
        padding-top: 100px;
        padding-bottom: 80px;
    }
}

/* ===========================
   RESPONSIVE — MOBILE (640px)
   =========================== */
@media (max-width: 640px) {

    /* --- Layout general --- */
    section {
        padding: 60px 0;
    }

    .hero-grid {
        padding-top: 90px;
        padding-bottom: 40px;
    }

    .container {
        padding: 0 16px;
    }

    /* --- Bento grid en 1 columna --- */
    .bento-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .card-hero-main,
    .card-hero-visual,
    .card-cta,
    .card-service,
    .card-why-main,
    .card-feature,
    .card-step,
    .hero-visual-area {
        grid-column: span 1 !important;
        grid-row: span 1 !important;
    }

    /* --- Navbar hamburguesa (desktop oculta UL en móvil) --- */
    .nav-links {
        display: none;
    }

    /* ---- DRAWER LATERAL DERECHO ---- */
    /* Oculto por defecto */
    .mobile-menu {
        display: none;
    }

    /* Drawer abierto */
    .mobile-menu.open {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        right: 0;
        left: auto;
        bottom: 0;
        width: min(80vw, 300px);
        list-style: none;

        /* Glass oscuro premium */
        background: rgba(10, 15, 25, 0.95);
        backdrop-filter: blur(25px) saturate(180%);
        -webkit-backdrop-filter: blur(25px) saturate(180%);
        border-left: 1px solid rgba(255, 255, 255, 0.1);

        align-items: flex-start;
        justify-content: flex-start;
        padding: 80px 32px 40px;
        gap: 0;

        z-index: 998;
        box-shadow: -10px 0 40px rgba(0, 0, 0, 0.4);

        /* Animación desde la derecha */
        animation: drawerSlideRight 0.35s cubic-bezier(0.23, 1, 0.32, 1);
    }

    @keyframes drawerSlideRight {
        from {
            transform: translateX(100%);
            opacity: 0.8;
        }

        to {
            transform: translateX(0);
            opacity: 1;
        }
    }

    /* Etiqueta "Menú" pequeña arriba */
    .mobile-menu.open::before {
        content: 'MENÚ';
        position: absolute;
        top: 55px;
        left: 32px;
        font-size: 0.62rem;
        font-weight: 700;
        letter-spacing: 3px;
        color: rgba(255, 255, 255, 0.3);
        pointer-events: none;
    }

    @keyframes itemSlideInRight {
        from {
            opacity: 0;
            transform: translateX(16px);
        }

        to {
            opacity: 1;
            transform: translateX(0);
        }
    }

    /* Contenedor ul dentro del drawer */
    .mobile-menu.open ul {
        list-style: none;
        padding: 0;
        margin: 0;
        width: 100%;
    }

    /* Items de lista */
    .mobile-menu.open li {
        width: 100%;
        opacity: 0;
        animation: itemSlideInRight 0.4s cubic-bezier(0.23, 1, 0.32, 1) forwards;
    }

    .mobile-menu.open li:nth-child(1) {
        animation-delay: 0.08s;
    }

    .mobile-menu.open li:nth-child(2) {
        animation-delay: 0.14s;
    }

    .mobile-menu.open li:nth-child(3) {
        animation-delay: 0.20s;
    }

    .mobile-menu.open li:nth-child(4) {
        animation-delay: 0.26s;
    }

    .mobile-menu.open li:last-child {
        animation-delay: 0.32s;
    }

    /* Separadores */
    .mobile-menu.open li+li {
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }

    /* Links */
    .mobile-menu.open a {
        display: block;
        width: 100%;
        font-size: 1.05rem;
        font-weight: 500;
        color: rgba(255, 255, 255, 0.85);
        text-decoration: none;
        padding: 17px 0;
        transition: color 0.25s ease, padding-left 0.25s ease;
    }

    .mobile-menu.open a:hover {
        color: #38bdf8;
        padding-left: 8px;
    }

    /* "Contacto" al final: botón CTA */
    .mobile-menu.open li:last-child {
        border-top: none;
        margin-top: 24px;
    }

    .mobile-menu.open li:last-child a {
        display: block;
        background: linear-gradient(135deg, #2563eb, #06b6d4);
        color: white;
        padding: 14px;
        text-align: center;
        border-radius: 12px;
        font-size: 1rem;
        font-weight: 700;
        box-shadow: 0 4px 15px rgba(37, 99, 235, 0.35);
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }

    .mobile-menu.open li:last-child a:hover {
        padding-left: 0;
        transform: translateY(-2px);
        box-shadow: 0 6px 22px rgba(37, 99, 235, 0.55);
    }

    /* --- Botón hamburguesa (glass pill compacto) --- */
    .hamburger {
        display: flex;
        flex-direction: column;
        gap: 5px;
        cursor: pointer;
        background: rgba(255, 255, 255, 0.14);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border: 1px solid rgba(255, 255, 255, 0.22);
        border-radius: 10px;
        padding: 9px 11px;
        z-index: 1001;
        pointer-events: auto;
        transition: background 0.25s ease, border-color 0.25s ease;
    }

    .hamburger:hover {
        background: rgba(255, 255, 255, 0.24);
        border-color: rgba(255, 255, 255, 0.38);
    }

    .hamburger.open {
        background: rgba(255, 255, 255, 0.1);
        border-color: rgba(255, 255, 255, 0.18);
    }

    .hamburger span {
        display: block;
        width: 20px;
        height: 2px;
        background: var(--blue-deep);
        border-radius: 2px;
        transition: all 0.32s cubic-bezier(0.23, 1, 0.32, 1);
    }

    .hamburger.open span {
        background: white;
    }

    .hamburger.open span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .hamburger.open span:nth-child(2) {
        opacity: 0;
        transform: scaleX(0);
    }

    .hamburger.open span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    .nav-cta {
        display: none;
    }

    .nav-container {
        padding: 10px 20px;
        width: 95%;
    }

    /* --- Hero: ocultar animación del robot en móvil --- */
    .hero-visual-area {
        display: none !important;
    }

    /* --- Hero tipografía --- */
    .card-hero-main h1 {
        font-size: 2rem;
        letter-spacing: -1px;
        margin-bottom: 16px;
    }

    .hero-subtitle {
        font-size: 0.95rem;
        margin-bottom: 24px;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .hero-buttons .btn-pill {
        width: 100%;
        justify-content: center;
    }

    /* --- Stats en fila horizontal --- */
    .hero-grid .bento-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .hero-grid .card-hero-main {
        grid-column: span 3 !important;
    }

    .hero-grid .card-stat {
        grid-column: span 1 !important;
    }

    .stat-number {
        font-size: 1.6rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }

    /* --- Servicios --- */
    .card-service {
        padding: 28px;
    }

    /* --- Por qué NexaCore --- */
    #porque {
        padding-top: 60px !important;
    }

    .card-why-main {
        padding: 28px;
    }

    /* --- Proceso: 2 columnas en móvil --- */
    .process-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* --- CTA --- */
    .card-cta {
        padding: 48px 24px;
    }

    .card-cta h2 {
        font-size: 1.8rem;
        margin-bottom: 14px;
    }

    .card-cta p {
        font-size: 0.95rem;
    }

    /* --- Section headers --- */
    .section-header {
        margin-bottom: 40px;
    }

    .section-header h2 {
        font-size: 1.8rem;
    }

    /* --- Trust Bar --- */
    .tech-stack-scroll {
        gap: 10px;
    }

    .tech-item {
        padding: 8px 14px;
        font-size: 0.85rem;
    }

    /* --- Footer --- */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    footer {
        padding: 48px 0 32px;
    }
}

/* === SECTORS BENTO LAYOUT (Redesigned) === */
.sectors-layout {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 60px;
    align-items: center;
    position: relative;
    z-index: 1;
}

.sectors-grid-column {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.sectors-bento-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 240px;
    gap: 20px;
    min-height: 500px;
}

/* Pattern A: 2 Squares Top, 1 Rectangle Bottom */
.pattern-a .sector-card-wrapper:nth-child(1) {
    grid-column: span 1;
    grid-row: span 1;
}

.pattern-a .sector-card-wrapper:nth-child(2) {
    grid-column: span 1;
    grid-row: span 1;
}

.pattern-a .sector-card-wrapper:nth-child(3) {
    grid-column: span 2;
    grid-row: span 1;
}

/* Pattern B: 1 Rectangle Top, 2 Squares Bottom */
.pattern-b .sector-card-wrapper:nth-child(1) {
    grid-column: span 2;
    grid-row: span 1;
}

.pattern-b .sector-card-wrapper:nth-child(2) {
    grid-column: span 1;
    grid-row: span 1;
}

.pattern-b .sector-card-wrapper:nth-child(3) {
    grid-column: span 1;
    grid-row: span 1;
}

.sector-card-wrapper {
    cursor: pointer;
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    height: 100%;
    width: 100%;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    background: var(--card-white);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.sector-card-wrapper:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.sector-card-face {
    height: 100%;
    width: 100%;
    position: relative;
}

.sector-card-face img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1.2s ease;
}

.sector-card-wrapper:hover img {
    transform: scale(1.1);
}

.sector-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(15, 23, 42, 0.9) 100%);
    z-index: 1;
}

.sector-card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px;
    z-index: 2;
}

.sector-card-content h3 {
    color: white;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 6px;
    line-height: 1.2;
}

.sector-cta-hint {
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 600;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
    display: inline-block;
}

.sector-card-wrapper:hover .sector-cta-hint {
    opacity: 1;
    transform: translateX(0);
}

/* Info Column & Filters */
.sectors-info-column {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.sectors-info-column .section-header {
    text-align: left;
    margin: 0;
}

.sectors-filters-sidebar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.sector-filter-btn {
    padding: 10px 22px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 50px;
    background: white;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sector-filter-btn:hover {
    background: rgba(37, 99, 235, 0.05);
    border-color: var(--blue-vibrant);
    color: var(--blue-vibrant);
}

.sector-filter-btn.active {
    background: var(--blue-vibrant);
    color: white;
    border-color: var(--blue-vibrant);
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.2);
}

/* Controls */
.sectors-controls {
    display: flex;
    align-items: center;
    gap: 24px;
}

.carousel-arrow {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: white;
    color: var(--blue-deep);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.carousel-arrow:hover:not(:disabled) {
    background: var(--blue-vibrant);
    color: white;
    border-color: var(--blue-vibrant);
    transform: scale(1.1);
}

.carousel-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.sectors-dots {
    display: flex;
    gap: 8px;
}

.sector-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #cbd5e1;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sector-dot.active {
    background: var(--blue-vibrant);
    width: 32px;
    border-radius: 10px;
}

/* Modal Restored & Fixed */
.sector-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    backdrop-filter: blur(0);
    opacity: 0;
    visibility: hidden;
}

.sector-modal-overlay.active {
    background: rgba(15, 23, 42, 0.85);
    pointer-events: all;
    backdrop-filter: blur(12px);
    opacity: 1;
    visibility: visible;
}

.sector-modal {
    width: 500px;
    max-width: 90vw;
    height: 500px;
    max-height: 85vh;
    perspective: 2000px;
    transform: scale(0.9);
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sector-modal-overlay.active .sector-modal {
    transform: scale(1);
}

.sector-modal-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.sector-modal-inner.flipped {
    transform: rotateY(180deg);
}

.sector-modal-front,
.sector-modal-back {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    border-radius: 32px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.sector-modal-front {
    display: flex;
    align-items: flex-end;
}

.sector-modal-front img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sector-modal-front-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(15, 23, 42, 1) 100%);
}

.sector-modal-front h3 {
    position: relative;
    z-index: 2;
    color: white;
    font-size: 2.2rem;
    padding: 3rem;
    font-weight: 800;
}

.sector-modal-back {
    background: #0f172a;
    color: white;
    transform: rotateY(180deg);
    padding: 3.5rem;
    display: flex;
    flex-direction: column;
}

.sector-modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.sector-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.sector-modal-back h3 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: white;
}

.solutions-header {
    color: var(--accent);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 2px;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

#sectorModalList {
    list-style: none;
    flex: 1;
    overflow-y: auto;
    padding-right: 10px;
}

#sectorModalList li {
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    line-height: 1.4;
}

#sectorModalList li::before {
    content: '→';
    color: var(--accent);
    font-weight: bold;
    flex-shrink: 0;
}

/* Responsive */
@media (max-width: 1024px) {
    .sectors-layout {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .sectors-info-column {
        order: -1;
        text-align: center;
    }

    .sectors-info-column .section-header {
        text-align: center;
    }

    .sectors-filters-sidebar {
        justify-content: center;
    }

    .sectors-controls {
        justify-content: center;
    }
}

@media (max-width: 640px) {
    .sectors-bento-grid {
        grid-auto-rows: 200px;
    }
}

.hidden-card {
    display: none !important;
}