/* === MODERN & PROFESSIONAL GLASSMORPHISM THEME === */

/* --- VARIABLES DE COLOR Y DISEÑO --- */
:root {
    --color-accent: #8A2BE2; /* Un violeta más vibrante */
    --color-accent-glow: rgba(138, 43, 226, 0.5);
    --color-bg: #0a0a18; /* Fondo aún más oscuro para mayor contraste */
    --color-bg-offset: #101024;
    --color-text-primary: #FFFFFF; /* Blanco puro para máxima legibilidad */
    --color-text-secondary: #b0b0d0; /* Un gris azulado suave */
    --color-border: rgba(255, 255, 255, 0.1); /* Borde blanco sutil para el efecto de borde de cristal */
    
    /* Se agrega 'Nunito' como fuente principal y se elimina 'Inter' */
    --font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', system-ui, sans-serif;
    
    --font-header: clamp(2.5rem, 5vw, 4rem);
    --font-subheader: clamp(2rem, 4vw, 2.8rem);
    --radius: 16px;
    --transition: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-family);
    background-color: var(--color-bg);
    color: var(--color-text-primary);
    line-height: 1.7;
    position: relative;
    overflow-x: hidden;
}

/* --- Fondo 'Glamorfista' con Blobs Múltiples --- */
body::before {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    width: 600px;
    height: 600px;
    margin: -300px 0 0 -300px;
    border-radius: 50%;
    z-index: -2;
    filter: blur(80px);
    opacity: 0.25;
    will-change: transform;
    
    background-image: 
        radial-gradient(circle at 20% 20%, var(--color-accent) 0%, transparent 40%),
        radial-gradient(circle at 80% 30%, #3b82f6 0%, transparent 40%),
        radial-gradient(circle at 50% 80%, #be185d 0%, transparent 40%);
    
    background-size: 100% 100%;
    background-position: center;

    animation: 
        blob-transform 20s ease-in-out infinite alternate,
        blob-pan 30s linear infinite;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAMAAAAp4XiDAAAAUVBMVEWFhYWDg4N3d3dtbW17e3t1dXVpaWl0dHTg4ODZ2dnt7e3x8fH4+PjY2NjU1NTU1NTk5OTa2trh4eHq6urx8fH19fX29vb5+fn39/fb29vj4+P/fxZMAAAA/0lEQVR42uzSAQoAMAgDQXh7/7/CEeEgtx2sJoJg4kI/rTQeEN95oA2Ea2x1oQ2Ea2x1oQ2Ea2x1oQ2Ea2x1oQ2Ea2x1oQ2Ea2x1oQ2Ea2x1oQ2Ea2x1oQ2Ea2x1oQ2Ea2x1oQ2Ea2x1oQ2Ea2x1oQ2Ea2x1oQ2Ea2x1oQ2Ea2x1oQ2Ea2x1oQ2Ea2x1oQ2Ea2x1oQ2Ea2x1oQ2Ea2x1oQ2Ea2x1oQ2Ea2x1oQ2Ea2x1oQ2Ea2x1oQ2Ea2x1oQ3UAEDZg/iHj9gAAAAASUVORK5CYII=');
    opacity: 0.04;
    z-index: -1;
    pointer-events: none;
}

@keyframes blob-transform {
    0% { transform: scale(1.0) rotate(0deg); }
    100% { transform: scale(1.3) rotate(180deg); }
}

@keyframes blob-pan {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* --- ESTILOS GENERALES Y ANIMACIONES --- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
img { max-width: 100%; height: auto; display: block; }

:focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: 4px;
    border-radius: 16px;
}

.fade-in-up {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform, opacity;
}
.fade-in-up.is-visible { 
    opacity: 1; 
    transform: translateY(0);
}
.services-grid .fade-in-up:nth-child(2), 
.portfolio-grid .fade-in-up:nth-child(2) { 
    transition-delay: 0.1s; 
}
.services-grid .fade-in-up:nth-child(3), 
.portfolio-grid .fade-in-up:nth-child(3) { 
    transition-delay: 0.2s; 
}

/* NAVBAR */
.navbar {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 2rem);
    max-width: 1100px;
    z-index: 1000;
    padding: 1rem 2rem;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0));
    backdrop-filter: blur(25px);
    border: 1px solid var(--color-border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all var(--transition);
}

.navbar-scrolled {
    background: linear-gradient(135deg, rgba(20, 20, 40, 0.5), rgba(20, 20, 40, 0.3));
    border-color: rgba(255, 255, 255, 0.15);
    top: 0.5rem;
}

.nav-container { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}
.nav-logo { text-decoration: none; }
.nav-logo h2 {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, #FFF 0%, #c084fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.nav-menu { 
    display: flex; 
    list-style: none; 
    gap: 0.4rem; /* AJUSTE: Espacio entre enlaces reducido */
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: var(--color-text-secondary);
    font-weight: 500;
    padding: 0.5rem 0.8rem; /* AJUSTE: Relleno de enlaces reducido */
    font-size: 0.95rem; /* AJUSTE: Tamaño de fuente ligeramente reducido */
    border-radius: 10px;
    transition: all var(--transition);
    white-space: nowrap;
}

.nav-link:hover { 
    color: var(--color-text-primary); 
    background: rgba(255, 255, 255, 0.08); 
}

/* NAVBAR ACTIONS */
.navbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem; /* AJUSTE: Espacio entre botones reducido */
}

.nav-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    color: var(--color-text-secondary);
    font-family: var(--font-family);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    padding: 0.5rem 1rem;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--color-text-primary);
}

.nav-btn span {
    transition: color var(--transition);
}

.nav-btn .active {
    color: var(--color-text-primary);
}

.lang-divider {
    margin: 0 0.25rem;
    color: var(--color-border);
}

.nav-toggle { display: none; }

/* HERO */
.hero { padding: 220px 0 180px; text-align: center; }
.hero-container { position: relative; z-index: 1; max-width: 950px; margin: 0 auto; }
.hero-title {
    font-size: var(--font-header);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.04em;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, #FFFFFF 50%, #d8b4fe 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-description {
    font-size: 1.25rem;
    color: var(--color-text-secondary);
    margin: 0 auto 3.5rem;
    max-width: 700px;
    line-height: 1.8;
}
.hero-buttons { display: flex; justify-content: center; gap: 1.5rem; flex-wrap: wrap; }

/* BUTTONS */
.btn {
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    padding: 16px 36px;
    border: 1px solid transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    transition: all var(--transition);
    text-decoration: none;
}
.btn-primary {
    background: var(--color-accent);
    color: white;
    box-shadow: 0 8px 24px var(--color-accent-glow);
}
.btn-primary:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px var(--color-accent-glow);
    background: #9333ea;
}
.btn-secondary {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0));
    color: var(--color-text-primary);
    border: 1px solid var(--color-border);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-4px);
}

/* SECTIONS & CARDS */
.section { padding: 120px 0; }
.section-header { text-align: center; max-width: 800px; margin: 0 auto 5rem; }
.section-header h2 {
    font-size: var(--font-subheader);
    background: linear-gradient(135deg, #FFFFFF 70%, #d8b4fe 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1.5rem;
}
.section-header p { color: var(--color-text-secondary); font-size: 1.1rem; }

/* SERVICES */
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 2rem; }
.service-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01));
    backdrop-filter: blur(10px);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 2rem;
    transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    will-change: transform;
}
.service-card:hover {
    transform: translateY(-10px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
}
.service-icon {
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.1), rgba(138, 43, 226, 0.05));
    color: var(--color-accent);
    width: 64px; height: 64px;
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(138, 43, 226, 0.3);
    font-size: 2rem;
}
.service-card h3 { font-size: 1.3rem; margin-bottom: 0.75rem; }
.service-card p { color: var(--color-text-secondary); font-size: 1rem; }

/* ABOUT */
.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01));
    backdrop-filter: blur(25px);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 4rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}
.about-image img {
    border-radius: var(--radius);
    transition: all var(--transition);
}
.about-image img:hover {
    transform: scale(1.05);
}
.about-title {
    font-size: 2.2rem;
    margin-bottom: 1rem;
}
.about-text p{
    color: var(--color-text-secondary);
    margin-bottom: 1rem;
    line-height: 1.8;
}

/* TEAM */
.team-grid { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: 2rem; 
}

/* Tablet: 2 columnas */
@media (width < 1024px) and (width > 768px) {
    .team-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Móvil: 1 columna */
@media (width < 768px) {
    .team-grid {
        grid-template-columns: 1fr;
    }
}

.team-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01));
    backdrop-filter: blur(25px);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: all var(--transition);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    text-align: center;
}
.team-card:hover {
    transform: translateY(-10px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
}
.team-image {
    width: 180px;
    height: 180px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--color-accent);
    box-shadow: 0 8px 24px var(--color-accent-glow);
}
.team-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition);
}
.team-card:hover .team-image img {
    transform: scale(1.1);
}
.team-info h3 {
    font-size: 1.4rem;
    margin-bottom: 0.2rem;
    color: var(--color-text-primary);
}
.team-role {
    color: var(--color-accent);
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 1rem;
}
.team-bio {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* PORTFOLIO */
.portfolio-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); gap: 2rem; }
.portfolio-item {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01));
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    transition: all var(--transition);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}
.portfolio-item:hover {
    transform: translateY(-10px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
}
.portfolio-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--transition);
}
.portfolio-item:hover img { transform: scale(1.1); }
.portfolio-overlay {
    position: absolute; inset: 0;
    padding: 2rem;
    display: flex; flex-direction: column; justify-content: flex-end;
    opacity: 0;
    transition: opacity var(--transition);
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, transparent 100%);
}
.portfolio-item:hover .portfolio-overlay { opacity: 1; }
.portfolio-overlay h3 { font-size: 1.5rem; margin-bottom: 0.5rem; }


/* CONTACT */
.contact-container {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 4rem;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01));
    backdrop-filter: blur(25px);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 4rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}
.contact-info h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}
.contact-info p {
    color: var(--color-text-secondary);
    margin-bottom: 2.5rem;
}
.contact-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}
.contact-item i {
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.1), rgba(138, 43, 226, 0.05));
    color: var(--color-accent);
    width: 56px; height: 56px;
    flex-shrink: 0;
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid rgba(138, 43, 226, 0.3);
    font-size: 1.5rem;
}
.contact-item div h4 {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    font-weight: 500;
    margin-bottom: 0.25rem;
}
.contact-item div a {
    text-decoration: none;
    color: var(--color-text-primary);
    font-weight: 500;
    transition: color var(--transition);
}
.contact-item div a:hover {
    color: var(--color-accent);
}
.contact-map iframe {
    border-radius: var(--radius);
    width: 100%;
    height: 200px;
}
.whatsapp-contact {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem 2rem;
    min-height: 350px;
}
.whatsapp-contact h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--color-text-primary);
}
.whatsapp-contact p {
    color: var(--color-text-secondary);
    margin-bottom: 2.5rem;
    max-width: 450px;
}
.btn-whatsapp {
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: white;
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4);
    font-size: 1.1rem;
    padding: 18px 40px;
}
.btn-whatsapp:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(37, 211, 102, 0.6);
    background: linear-gradient(135deg, #128C7E, #25D366);
}
.btn-whatsapp i {
    font-size: 1.3rem;
}

/* FOOTER */
.footer {
    background: linear-gradient(rgba(10, 10, 24, 0.5), rgba(10, 10, 24, 0.8));
    border-top: 1px solid var(--color-border);
    padding: 80px 0 40px;
}
.footer-content { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 4rem; margin-bottom: 4rem; }
.footer-section h4 { color: var(--color-text-primary); margin-bottom: 1.5rem; }
.footer-section ul { list-style: none; }
.footer-section ul li { margin-bottom: 0.8rem; }
.footer-section ul li a { color: var(--color-text-secondary); text-decoration: none; transition: color var(--transition); }
.footer-section ul li a:hover { color: var(--color-accent); }
.footer-bottom { border-top: 1px solid var(--color-border); padding-top: 2.5rem; text-align: center; font-size: 0.9rem; }

/* RESPONSIVE */

/* AJUSTE: Breakpoint para el menú móvil ahora es más grande para evitar colisiones */
@media (max-width: 1024px) {
    .about-content, .contact-container { grid-template-columns: 1fr; gap: 3.5rem; }
    .footer-content { grid-template-columns: 1fr; text-align: center; }

    /* --- INICIO DE REGLAS DE NAVBAR MÓVIL --- */
    .navbar {
        top: 0;
        left: 0;
        width: 100%;
        transform: none;
        border-radius: 0;
        padding: 0.75rem 1.5rem;
        max-width: none;
    }
    .navbar-scrolled { top: 0; }
    
    .nav-container { flex-wrap: nowrap; }
    
    /* Oculta los enlaces de escritorio y los prepara para móvil */
    .nav-menu { 
        position: fixed; 
        top: 0; 
        right: -100%; 
        width: 100%; 
        height: 100vh; 
        background: linear-gradient(135deg, rgba(20, 20, 40, 0.95), rgba(20, 20, 40, 0.85));
        backdrop-filter: blur(20px); 
        flex-direction: column; 
        align-items: center; 
        justify-content: center; 
        transition: right 0.3s var(--transition); 
        z-index: 1000; 
        gap: 1.5rem;
    }
    .nav-menu.active { right: 0; }
    .nav-link { font-size: 1.3rem; padding: 1rem 2rem; }

    /* En móvil, los botones se alinean a la derecha con auto-margen */
    .navbar-actions { margin-left: auto; }
    
    /* Muestra el botón de hamburguesa */
    .nav-toggle { 
        display: flex; 
        flex-direction: column; 
        gap: 4px;
        z-index: 1001; 
        cursor: pointer; 
        background: none; 
        border: none;
        padding: 0.5rem;
        margin-left: 0.75rem;
    }
    .bar { 
        width: 24px; 
        height: 2px; 
        background: var(--color-text-primary); 
        border-radius: 1px; 
        transition: all 0.3s ease; 
    }
    
    .nav-toggle.active .bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
    .nav-toggle.active .bar:nth-child(2) { opacity: 0; }
    .nav-toggle.active .bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

    /* Oculta el texto del botón de tema */
    .theme-text {
        display: none;
    }

    /* Ajusta el padding del botón de tema para que sea más cuadrado */
    #theme-toggle {
        padding: 0.6rem;
    }
    /* --- FIN DE REGLAS DE NAVBAR MÓVIL --- */
}

@media (max-width: 768px) {
    /* Este bloque ahora solo maneja el contenido, no el navbar */
    .hero { padding: 160px 0 120px; }
    .btn { width: 100%; max-width: 350px; }
    .hero-buttons { flex-direction: column; align-items: center; }
    .services-grid, .portfolio-grid { grid-template-columns: 1fr; }
    .about-content, .contact-container { padding: 2rem; }
    
    /* Ocultar el divisor y el idioma inactivo en móvil */
    .lang-divider {
        display: none;
    }
    
    .lang-es:not(.active),
    .lang-en:not(.active) {
        display: none;
    }
}

/* --- LIGHT THEME --- */
body.light-theme {
    --color-accent: #6b21a8;
    --color-accent-glow: rgba(107, 33, 168, 0.18);
    --color-bg: #f6f7fb;
    --color-text-primary: #0b1220;
    --color-text-secondary: #495066;
    --color-border: rgba(11, 18, 32, 0.1);
}
body.light-theme .hero-title,
body.light-theme .section-header h2,
body.light-theme .nav-logo h2 {
    background: none;
    -webkit-background-clip: initial;
    background-clip: initial;
    -webkit-text-fill-color: var(--color-text-primary);
}
body.light-theme .btn-secondary {
    color: var(--color-text-primary);
    background: rgba(255, 255, 255, 0.5);
}
body.light-theme .navbar-scrolled {
    background: linear-gradient(135deg, rgba(246, 247, 251, 0.8), rgba(246, 247, 251, 0.6));
    border-color: rgba(11, 18, 32, 0.15);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

body.light-theme .nav-link:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--color-text-primary);
}
body.light-theme .footer {
    background: linear-gradient(rgba(246, 247, 251, 0.8), rgba(246, 247, 251, 1));
    border-top: 1px solid var(--color-border);
}
body.light-theme .footer-section ul li a:hover {
    color: var(--color-accent);
}
body.light-theme .nav-menu {
    background: linear-gradient(135deg, rgba(246, 247, 251, 0.95), rgba(246, 247, 251, 0.85));
}
/* --- ESTILOS PARA EL BOTÓN DE TEMA CON SVG --- */

.nav-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.theme-text {
    line-height: 1;
}

/* Por defecto (modo oscuro): se muestra el sol y se oculta la luna */
.moon-icon {
    display: none;
}
.sun-icon {
    display: block;
}

/* Cuando el modo claro está activo: se oculta el sol y se muestra la luna */
body.light-theme .moon-icon {
    display: block;
}
body.light-theme .sun-icon {
    display: none;
}

/* Opcional: Animación de rotación al hacer clic para dar feedback */
#theme-toggle:active svg {
    transform: rotate(45deg);
}