:root {
    --transition-speed: 0.3s;
    --mouse-x: 50%;
    --mouse-y: 50%;
    --scroll-y: 0px;
    --scroll-offset: 0px;
    --scroll-rotate: 0deg;
    --scroll-scale: 1;
    --scroll-opacity: 0.5;
}

body {
    background: rgb(249 250 251);
    color: rgb(17 24 39);
    transition: background 0.3s ease, color 0.3s ease;
    position: relative;
    overflow-x: hidden;
}

/* Asegurar que el contenido principal esté por encima del fondo */
main {
    position: relative;
    z-index: 10;
}

main section {
    position: relative;
    z-index: 10;
}

nav {
    position: fixed;
    z-index: 1000;
}

footer {
    position: relative;
    z-index: 10;
}

/* Asegurar que todos los elementos interactivos estén visibles */
h1, h2, h3, h4, h5, h6, p, a, button, img, video, div {
    position: relative;
}

/* Capa base del fondo - Red neuronal compleja con curvas */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -10;
    transform: translateY(var(--scroll-offset)) rotate(calc(var(--scroll-rotate) * 0.1)) scale(var(--scroll-scale));
    transition: transform 0.1s ease-out;
    will-change: transform;
    background-image: 
        /* Curvas Bézier simuladas con gradientes radiales elongados */
        radial-gradient(ellipse 400px 2px at 15% 20%, rgba(6, 182, 212, 0.12) 0%, transparent 100%),
        radial-gradient(ellipse 350px 2px at 30% 35%, rgba(103, 232, 249, 0.1) 0%, transparent 100%),
        radial-gradient(ellipse 500px 2px at 45% 15%, rgba(6, 182, 212, 0.08) 0%, transparent 100%),
        
        /* Conexiones diagonales curvas */
        radial-gradient(ellipse 300px 1.5px at 60% 45%, rgba(165, 243, 252, 0.12) 0%, transparent 100%),
        radial-gradient(ellipse 450px 2px at 75% 25%, rgba(6, 182, 212, 0.1) 0%, transparent 100%),
        radial-gradient(ellipse 380px 1.5px at 85% 55%, rgba(103, 232, 249, 0.12) 0%, transparent 100%),
        
        /* Más curvas en diferentes ángulos */
        radial-gradient(ellipse 2px 350px at 20% 60%, rgba(6, 182, 212, 0.1) 0%, transparent 100%),
        radial-gradient(ellipse 1.5px 400px at 40% 75%, rgba(103, 232, 249, 0.08) 0%, transparent 100%),
        radial-gradient(ellipse 2px 320px at 65% 80%, rgba(6, 182, 212, 0.12) 0%, transparent 100%),
        radial-gradient(ellipse 1.5px 380px at 80% 70%, rgba(165, 243, 252, 0.1) 0%, transparent 100%),
        
        /* Líneas diagonales más pronunciadas */
        linear-gradient(125deg, transparent 0%, transparent 18%, rgba(6, 182, 212, 0.08) 18%, rgba(6, 182, 212, 0.08) 18.3%, transparent 18.3%, transparent 100%),
        linear-gradient(55deg, transparent 0%, transparent 32%, rgba(103, 232, 249, 0.08) 32%, rgba(103, 232, 249, 0.08) 32.3%, transparent 32.3%, transparent 100%),
        linear-gradient(145deg, transparent 0%, transparent 48%, rgba(6, 182, 212, 0.06) 48%, rgba(6, 182, 212, 0.06) 48.3%, transparent 48.3%, transparent 100%),
        linear-gradient(35deg, transparent 0%, transparent 65%, rgba(103, 232, 249, 0.08) 65%, rgba(103, 232, 249, 0.08) 65.3%, transparent 65.3%, transparent 100%),
        
        /* Nodos (puntos de conexión) */
        radial-gradient(circle 5px at 15% 20%, rgba(6, 182, 212, 0.4) 0%, rgba(6, 182, 212, 0.12) 50%, transparent 100%),
        radial-gradient(circle 4px at 30% 35%, rgba(103, 232, 249, 0.35) 0%, rgba(103, 232, 249, 0.1) 50%, transparent 100%),
        radial-gradient(circle 6px at 45% 15%, rgba(6, 182, 212, 0.3) 0%, rgba(6, 182, 212, 0.08) 50%, transparent 100%),
        radial-gradient(circle 4.5px at 60% 45%, rgba(165, 243, 252, 0.4) 0%, rgba(165, 243, 252, 0.12) 50%, transparent 100%),
        radial-gradient(circle 5px at 75% 25%, rgba(6, 182, 212, 0.35) 0%, rgba(6, 182, 212, 0.1) 50%, transparent 100%),
        radial-gradient(circle 4px at 85% 55%, rgba(103, 232, 249, 0.4) 0%, rgba(103, 232, 249, 0.12) 50%, transparent 100%),
        
        radial-gradient(circle 5px at 20% 65%, rgba(6, 182, 212, 0.35) 0%, rgba(6, 182, 212, 0.1) 50%, transparent 100%),
        radial-gradient(circle 6px at 40% 75%, rgba(103, 232, 249, 0.3) 0%, rgba(103, 232, 249, 0.08) 50%, transparent 100%),
        radial-gradient(circle 4.5px at 65% 80%, rgba(6, 182, 212, 0.4) 0%, rgba(6, 182, 212, 0.12) 50%, transparent 100%),
        radial-gradient(circle 5px at 80% 70%, rgba(165, 243, 252, 0.35) 0%, rgba(165, 243, 252, 0.1) 50%, transparent 100%),
        
        /* Gradiente de fondo */
        linear-gradient(
            135deg,
            rgba(207, 250, 254, 0.08) 0%,
            rgba(249, 250, 251, 0) 50%,
            rgba(165, 243, 252, 0.06) 100%
        );
    animation: neuralPulse 3s ease-in-out infinite;
}

@keyframes neuralPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Capa de formas animadas con scroll */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -9;
    transform: translateY(calc(var(--scroll-offset) * -0.5)) rotate(calc(var(--scroll-rotate) * -0.05));
    transition: transform 0.1s ease-out;
    will-change: transform;
    background-image: 
        /* Formas geométricas abstractas muy tenues */
        radial-gradient(ellipse 800px 600px at 20% 30%, rgba(6, 182, 212, 0.03) 0%, transparent 60%),
        radial-gradient(ellipse 600px 800px at 80% 70%, rgba(103, 232, 249, 0.025) 0%, transparent 60%),
        radial-gradient(circle 500px at 50% 50%, rgba(6, 182, 212, 0.02) 0%, transparent 55%),
        /* Círculos adicionales */
        radial-gradient(circle 300px at 10% 80%, rgba(165, 243, 252, 0.03) 0%, transparent 70%),
        radial-gradient(circle 350px at 90% 20%, rgba(6, 182, 212, 0.025) 0%, transparent 65%);
    will-change: transform;
}

/* Capa adicional de detalles */
#bg-layer-1,
#bg-layer-2,
#bg-layer-3 {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -8;
    will-change: transform;
}

#bg-layer-1 {
    background: radial-gradient(circle 400px at var(--mouse-x, 20%) var(--mouse-y, 20%), rgba(6, 182, 212, 0.02) 0%, transparent 70%);
}

#bg-layer-2 {
    background: radial-gradient(circle 600px at var(--mouse-x, 80%) var(--mouse-y, 80%), rgba(103, 232, 249, 0.015) 0%, transparent 70%);
}

#bg-layer-3 {
    background: 
        linear-gradient(135deg, 
            rgba(207, 250, 254, 0.03) 0%, 
            rgba(6, 182, 212, 0.015) 50%, 
            rgba(165, 243, 252, 0.025) 100%
        );
}

html.dark body {
    background: rgb(0 0 0);
    color: rgb(243 244 246);
}

html.dark body::before {
    background-image: 
        /* Curvas Bézier en modo oscuro - más tenues */
        radial-gradient(ellipse 400px 2px at 15% 20%, rgba(6, 182, 212, 0.08) 0%, transparent 100%),
        radial-gradient(ellipse 350px 2px at 30% 35%, rgba(103, 232, 249, 0.06) 0%, transparent 100%),
        radial-gradient(ellipse 500px 2px at 45% 15%, rgba(6, 182, 212, 0.05) 0%, transparent 100%),
        
        /* Conexiones diagonales curvas */
        radial-gradient(ellipse 300px 1.5px at 60% 45%, rgba(165, 243, 252, 0.08) 0%, transparent 100%),
        radial-gradient(ellipse 450px 2px at 75% 25%, rgba(6, 182, 212, 0.06) 0%, transparent 100%),
        radial-gradient(ellipse 380px 1.5px at 85% 55%, rgba(103, 232, 249, 0.08) 0%, transparent 100%),
        
        /* Más curvas en diferentes ángulos */
        radial-gradient(ellipse 2px 350px at 20% 60%, rgba(6, 182, 212, 0.06) 0%, transparent 100%),
        radial-gradient(ellipse 1.5px 400px at 40% 75%, rgba(103, 232, 249, 0.05) 0%, transparent 100%),
        radial-gradient(ellipse 2px 320px at 65% 80%, rgba(6, 182, 212, 0.08) 0%, transparent 100%),
        radial-gradient(ellipse 1.5px 380px at 80% 70%, rgba(165, 243, 252, 0.06) 0%, transparent 100%),
        
        /* Líneas diagonales más tenues */
        linear-gradient(125deg, transparent 0%, transparent 18%, rgba(6, 182, 212, 0.05) 18%, rgba(6, 182, 212, 0.05) 18.3%, transparent 18.3%, transparent 100%),
        linear-gradient(55deg, transparent 0%, transparent 32%, rgba(103, 232, 249, 0.05) 32%, rgba(103, 232, 249, 0.05) 32.3%, transparent 32.3%, transparent 100%),
        linear-gradient(145deg, transparent 0%, transparent 48%, rgba(6, 182, 212, 0.04) 48%, rgba(6, 182, 212, 0.04) 48.3%, transparent 48.3%, transparent 100%),
        linear-gradient(35deg, transparent 0%, transparent 65%, rgba(103, 232, 249, 0.05) 65%, rgba(103, 232, 249, 0.05) 65.3%, transparent 65.3%, transparent 100%),
        
        /* Nodos más tenues en modo oscuro */
        radial-gradient(circle 5px at 15% 20%, rgba(6, 182, 212, 0.25) 0%, rgba(6, 182, 212, 0.08) 50%, transparent 100%),
        radial-gradient(circle 4px at 30% 35%, rgba(103, 232, 249, 0.22) 0%, rgba(103, 232, 249, 0.06) 50%, transparent 100%),
        radial-gradient(circle 6px at 45% 15%, rgba(6, 182, 212, 0.2) 0%, rgba(6, 182, 212, 0.05) 50%, transparent 100%),
        radial-gradient(circle 4.5px at 60% 45%, rgba(165, 243, 252, 0.25) 0%, rgba(165, 243, 252, 0.08) 50%, transparent 100%),
        radial-gradient(circle 5px at 75% 25%, rgba(6, 182, 212, 0.22) 0%, rgba(6, 182, 212, 0.06) 50%, transparent 100%),
        radial-gradient(circle 4px at 85% 55%, rgba(103, 232, 249, 0.25) 0%, rgba(103, 232, 249, 0.08) 50%, transparent 100%),
        
        radial-gradient(circle 5px at 20% 65%, rgba(6, 182, 212, 0.22) 0%, rgba(6, 182, 212, 0.06) 50%, transparent 100%),
        radial-gradient(circle 6px at 40% 75%, rgba(103, 232, 249, 0.2) 0%, rgba(103, 232, 249, 0.05) 50%, transparent 100%),
        radial-gradient(circle 4.5px at 65% 80%, rgba(6, 182, 212, 0.25) 0%, rgba(6, 182, 212, 0.08) 50%, transparent 100%),
        radial-gradient(circle 5px at 80% 70%, rgba(165, 243, 252, 0.22) 0%, rgba(165, 243, 252, 0.06) 50%, transparent 100%),
        
        /* Gradiente de fondo más tenue */
        linear-gradient(
            135deg,
            rgba(6, 182, 212, 0.025) 0%,
            rgba(0, 0, 0, 0) 50%,
            rgba(103, 232, 249, 0.02) 100%
        );
    animation: neuralPulseDark 3s ease-in-out infinite;
}

@keyframes neuralPulseDark {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

html.dark body::after {
    background-image: 
        /* Formas muy tenues en modo oscuro */
        radial-gradient(ellipse 800px 600px at 20% 30%, rgba(6, 182, 212, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse 600px 800px at 80% 70%, rgba(103, 232, 249, 0.03) 0%, transparent 50%),
        radial-gradient(circle 400px at 50% 50%, rgba(6, 182, 212, 0.025) 0%, transparent 50%);
}

html.dark #bg-layer-1 {
    background: radial-gradient(circle 300px at var(--mouse-x, 20%) var(--mouse-y, 20%), rgba(6, 182, 212, 0.025) 0%, transparent 70%);
}

html.dark #bg-layer-2 {
    background: radial-gradient(circle 500px at var(--mouse-x, 80%) var(--mouse-y, 80%), rgba(103, 232, 249, 0.02) 0%, transparent 70%);
}

html.dark #bg-layer-3 {
    background: 
        linear-gradient(135deg, transparent 0%, rgba(6, 182, 212, 0.015) 50%, transparent 100%);
}

/* Navegación */
nav {
    background-color: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(16px) saturate(180%);
    border-bottom: 1px solid rgba(6, 182, 212, 0.1);
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

html.dark nav {
    background-color: rgba(0, 0, 0, 0.7);
    border-color: rgba(103, 232, 249, 0.15);
    box-shadow: 0 4px 6px -1px rgba(6, 182, 212, 0.15);
}

/* Botones y enlaces */
.btn-primary {
    background: linear-gradient(135deg, rgb(6 182 212), rgb(8 145 178));
    color: white;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(8px);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(6, 182, 212, 0.4);
}

.btn-primary:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.5);
}

html.dark .btn-primary {
    background: linear-gradient(135deg, rgb(6 182 212), rgb(103 232 249));
}

html.dark .btn-primary:hover {
    box-shadow: 0 10px 20px -5px rgba(103, 232, 249, 0.4);
}

/* Botones outline (solo borde) */
.btn-outline {
    background: transparent;
    color: rgb(6 182 212);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    border: 2px solid rgb(6 182 212);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-outline::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(6, 182, 212, 0.1);
    transition: left 0.5s ease;
}

.btn-outline:hover::before {
    left: 100%;
}

.btn-outline:hover {
    transform: translateY(-2px);
    background: rgba(6, 182, 212, 0.05);
    box-shadow: 0 10px 20px -5px rgba(6, 182, 212, 0.3);
    border-color: rgb(8 145 178);
}

.btn-outline:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.3);
}

html.dark .btn-outline {
    color: rgb(103 232 249);
    border-color: rgb(103 232 249);
}

html.dark .btn-outline::before {
    background: rgba(103, 232, 249, 0.1);
}

html.dark .btn-outline:hover {
    background: rgba(103, 232, 249, 0.05);
    box-shadow: 0 10px 20px -5px rgba(103, 232, 249, 0.3);
    border-color: rgb(6 182 212);
}


/* Tarjetas de proyectos */
.project-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid rgba(6, 182, 212, 0.1);
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 
                0 0 0 1px rgba(6, 182, 212, 0.05);
    transition: all 0.3s ease;
    position: relative;
}

.project-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 0.5rem;
    padding: 1px;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(103, 232, 249, 0.1));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
}

html.dark .project-card {
    background: rgba(0, 0, 0, 0.8);
    border-color: rgba(103, 232, 249, 0.15);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5),
                0 0 0 1px rgba(103, 232, 249, 0.1);
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 25px -5px rgba(6, 182, 212, 0.2),
                0 10px 10px -5px rgba(6, 182, 212, 0.1);
}

.project-card:hover::before {
    opacity: 1;
}

/* Etiquetas de categoría */
.category-tag {
    font-size: 0.875rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    background: linear-gradient(135deg, rgba(207, 250, 254, 0.8), rgba(165, 243, 252, 0.6));
    backdrop-filter: blur(8px);
    color: rgb(8 145 178);
    border: 1px solid rgba(6, 182, 212, 0.2);
}

html.dark .category-tag {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.25), rgba(103, 232, 249, 0.15));
    color: rgb(103 232 249);
    border-color: rgba(103, 232, 249, 0.3);
}

/* Formulario */
input, textarea {
    background-color: white;
    border: 1px solid rgb(229 231 235);
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    width: 100%;
    transition: all 0.3s ease;
}

input:focus, textarea:focus {
    outline: none;
    border-color: rgb(6 182 212);
    box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.2);
}

html.dark input,
html.dark textarea {
    background-color: rgba(0, 0, 0, 0.8);
    border-color: rgba(103, 232, 249, 0.2);
}

html.dark input:focus,
html.dark textarea:focus {
    border-color: rgb(103 232 249);
    box-shadow: 0 0 0 2px rgba(103, 232, 249, 0.3);
}

/* Modal */
#about-modal {
    transition: opacity var(--transition-speed);
    opacity: 0;
    pointer-events: none;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 6rem 2rem 2rem 2rem;
    z-index: 9999;
    overflow-y: auto;
}

#about-modal.active {
    opacity: 1;
    pointer-events: auto;
}

#about-modal .modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(6, 182, 212, 0.1);
    border-radius: 1rem;
    padding: 2rem;
    transform: scale(0.95);
    transition: transform 0.3s ease;
    touch-action: pan-y;
    will-change: transform;
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
    max-width: 900px;
    width: 100%;
    margin: auto;
    box-shadow: 0 20px 25px -5px rgba(6, 182, 212, 0.1),
                0 10px 10px -5px rgba(6, 182, 212, 0.05);
    scrollbar-width: thin;
    scrollbar-color: rgba(6, 182, 212, 0.3) rgba(6, 182, 212, 0.05);
}

/* Scrollbar personalizado para el modal - Webkit (Chrome, Safari, Edge) */
#about-modal .modal-content::-webkit-scrollbar {
    width: 8px;
}

#about-modal .modal-content::-webkit-scrollbar-track {
    background: rgba(6, 182, 212, 0.05);
    border-radius: 10px;
}

#about-modal .modal-content::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgb(6 182 212), rgb(103 232 249));
    border-radius: 10px;
    transition: background 0.3s ease;
}

#about-modal .modal-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgb(8 145 178), rgb(6 182 212));
}

html.dark #about-modal .modal-content {
    scrollbar-color: rgba(103, 232, 249, 0.4) rgba(103, 232, 249, 0.1);
}

html.dark #about-modal .modal-content::-webkit-scrollbar-track {
    background: rgba(103, 232, 249, 0.1);
}

html.dark #about-modal .modal-content::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgb(103 232 249), rgb(6 182 212));
}

html.dark #about-modal .modal-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgb(165 243 252), rgb(103 232 249));
}

/* Botones de redes sociales fijos en el modal */
.modal-social-buttons {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.75rem;
    z-index: 20;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    padding: 0.75rem;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.2);
}

html.dark .modal-social-buttons {
    background: rgba(0, 0, 0, 0.95);
    border-color: rgba(103, 232, 249, 0.2);
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.2);
}

.modal-social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(6, 182, 212, 0.1);
    color: rgb(6 182 212);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.modal-social-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgb(6 182 212), rgb(103 232 249));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.modal-social-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(6, 182, 212, 0.4);
    color: white;
}

.modal-social-link:hover::before {
    opacity: 1;
}

html.dark .modal-social-link {
    background: rgba(103, 232, 249, 0.1);
    color: rgb(103 232 249);
}

html.dark .modal-social-link::before {
    background: linear-gradient(135deg, rgb(103 232 249), rgb(6 182 212));
}

html.dark .modal-social-link:hover {
    box-shadow: 0 6px 16px rgba(103, 232, 249, 0.4);
}

/* Animación de entrada para los botones */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

#about-modal.active .modal-social-buttons {
    animation: slideInRight 0.4s ease 0.3s both;
}

/* Ajustes para móvil */
@media (max-width: 768px) {
    .modal-social-buttons {
        bottom: 1rem;
        right: 1rem;
        gap: 0.5rem;
        padding: 0.5rem;
    }
    
    .modal-social-link {
        width: 36px;
        height: 36px;
    }
    
    .modal-social-link svg {
        width: 18px;
        height: 18px;
    }
}

#about-modal.active .modal-content {
    transform: scale(1);
}

@media (max-width: 768px) {
    #about-modal {
        align-items: flex-end;
        justify-content: flex-end;
        padding: 0;
    }
    
    #about-modal .modal-content {
        width: 100%;
        max-width: 100%;
        border-top-left-radius: 1rem;
        border-top-right-radius: 1rem;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
        padding-top: 3rem;
        max-height: 90vh;
        margin: 0;
        transform: translateY(100%);
    }

    #about-modal.active .modal-content {
        transform: translateY(0);
    }
}

html.dark #about-modal .modal-content {
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px) saturate(180%);
    border-color: rgba(103, 232, 249, 0.25);
    box-shadow: 0 20px 25px -5px rgba(103, 232, 249, 0.25),
                0 10px 10px -5px rgba(103, 232, 249, 0.15);
}

#about-modal .modal-content::after {
    content: '';
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
}

html.dark #about-modal .modal-content::after {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Estilos para la imagen del perfil en el modal */
#about-modal .profile-image {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 50%;
    margin: 0 auto 2rem;
    display: block;
    box-shadow: 0 10px 30px -5px rgba(6, 182, 212, 0.3);
    border: 4px solid rgba(6, 182, 212, 0.2);
    transition: all 0.3s ease;
}

#about-modal .profile-image:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 40px -5px rgba(6, 182, 212, 0.4);
}

html.dark #about-modal .profile-image {
    box-shadow: 0 10px 30px -5px rgba(103, 232, 249, 0.3);
    border-color: rgba(103, 232, 249, 0.2);
}

html.dark #about-modal .profile-image:hover {
    box-shadow: 0 15px 40px -5px rgba(103, 232, 249, 0.4);
}

@media (max-width: 768px) {
    #about-modal .profile-image {
        width: 150px;
        height: 150px;
    }
    
    #about-modal .skill-tags {
        display: flex;
        flex-wrap: wrap;
        gap: 0.4rem;
        justify-content: center;
    }
    
    #about-modal .skill-tag {
        padding: 0.35rem 0.75rem;
        font-size: 0.75rem;
    }
}

/* Habilidades - Estilo elegante sin cápsulas */
.skill-tag {
    background: transparent;
    color: rgb(8 145 178);
    padding: 0.5rem 0;
    font-size: 1rem;
    font-weight: 300;
    letter-spacing: 0.05em;
    border: none;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    position: relative;
}

.skill-tag::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, rgb(6 182 212), rgb(103 232 249));
    transition: width 0.3s ease;
}

.skill-tag:hover::after {
    width: 100%;
}

html.dark .skill-tag {
    color: rgb(103 232 249);
}

.skill-tag:hover {
    transform: translateX(5px);
    color: rgb(6 182 212);
}

html.dark .skill-tag:hover {
    color: rgb(165 243 252);
}

/* Animaciones */
.fade-in {
    animation: fadeIn 0.6s ease-in forwards;
    opacity: 0;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Prevenir scroll cuando el modal está abierto */
body.modal-open {
    overflow: hidden;
}

/* Fuente */
.font-poppins {
    font-family: 'Poppins', sans-serif;
}

/* Ajustes de peso de fuente */
h1, h2, h3 {
    font-weight: 300;
}

.font-thin {
    font-weight: 100;
}

.font-extralight {
    font-weight: 200;
}

.font-light {
    font-weight: 300;
}

/* Ajustes para textos descriptivos */
p {
    font-weight: 300;
    line-height: 1.7;
}

/* Botones y elementos interactivos */
button, a {
    font-weight: 300;
}

/* Elementos que necesitan más énfasis */
.font-medium {
    font-weight: 500;
}

.font-semibold {
    font-weight: 600;
}

/* Para títulos y elementos que necesitan destacar */
.font-bold {
    font-weight: 700;
}

/* Portafolio Multimedia */
.masonry-grid {
    columns: 1;
    column-gap: 1.5rem;
}

@media (min-width: 640px) {
    .masonry-grid {
        columns: 2;
    }
}

@media (min-width: 1024px) {
    .masonry-grid {
        columns: 3;
    }
}

.masonry-item {
    break-inside: avoid;
    margin-bottom: 1.5rem;
    position: relative;
    border-radius: 1rem;
    overflow: hidden;
    transform: translateY(50px);
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.masonry-item:hover {
    box-shadow: 0 20px 25px -5px rgba(6, 182, 212, 0.15),
                0 10px 10px -5px rgba(6, 182, 212, 0.1);
}

.masonry-item:hover .media-overlay {
    opacity: 1;
    transform: translateY(0);
}

.media-item {
    width: 100%;
    display: block;
    border-radius: 1rem;
    transition: transform 0.5s ease;
}

/* Miniaturas de imágenes en la galería */
.masonry-item img.media-item {
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* Imágenes largas (landing pages) en miniaturas */
.masonry-item img[src*="lp.webp"] {
    height: 400px;
    object-fit: cover;
    object-position: top;
}

.media-item.landing-preview {
    height: 300px;
    object-fit: cover;
    object-position: top;
}

.media-item.tall {
    height: 600px;
    object-fit: cover;
}

.masonry-item:hover .media-item {
    transform: scale(1.05);
}

.media-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, 
        rgba(0, 0, 0, 0.9) 0%,
        rgba(0, 0, 0, 0) 100%);
    backdrop-filter: blur(8px);
    padding: 2rem;
    color: white;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(50px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Ajustes para modo oscuro */
html.dark .masonry-item {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
}

html.dark .media-overlay {
    background: linear-gradient(to top, 
        rgba(0, 0, 0, 0.95) 0%,
        rgba(0, 0, 0, 0) 100%);
}

/* Botón Mostrar más */
#load-more-container {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 0.6s ease-in forwards;
    animation-delay: 0.3s;
    width: 100%;
}

#load-more {
    transition: all 0.3s ease;
    position: relative;
    padding-bottom: 2px;
}

#load-more::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: 0;
    left: 0;
    background-color: currentColor;
    transition: width 0.3s ease;
}

#load-more:hover::after {
    width: 100%;
}

/* Estilos específicos para videos */
video.media-item {
    object-fit: cover;
    height: 100%;
    min-height: 300px;
    background-color: rgb(17 24 39 / 0.1); /* Fondo mientras carga */
}

html.dark video.media-item {
    background-color: rgba(0, 0, 0, 0.5);
}

/* Lightbox Modal */
#content-modal {
    transition: opacity 0.3s ease;
    opacity: 0;
    pointer-events: none;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

#content-modal.active {
    opacity: 1;
    pointer-events: auto;
}

#content-modal .content-container {
    transform: scale(0.95);
    transition: transform 0.3s ease;
    max-width: 1200px;
    margin: auto;
    padding: 2rem 1rem;
    width: 100%;
}

#content-modal.active .content-container {
    transform: scale(1);
}

/* Para imágenes largas, permitir scroll desde arriba */
#content-modal.has-tall-image {
    align-items: flex-start;
}

#content-modal.has-tall-image .content-container {
    margin-top: 2rem;
    margin-bottom: 2rem;
}

#content-modal video {
    max-height: 90vh;
    width: auto;
    max-width: 100%;
    margin: 0 auto;
    border-radius: 0.5rem;
    box-shadow: 0 0 2rem rgba(0, 0, 0, 0.3);
}

#content-modal img {
    width: 100%;
    max-width: 1200px;
    height: auto;
    margin: 0 auto;
    border-radius: 0.5rem;
    box-shadow: 0 0 2rem rgba(0, 0, 0, 0.3);
}

#content-modal .content-info {
    position: absolute;
    bottom: 1rem;
    left: 0;
    right: 0;
    padding: 2rem;
    background: linear-gradient(to top, 
        rgba(0, 0, 0, 0.9) 0%,
        rgba(0, 0, 0, 0) 100%);
    color: white;
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* En desktop, desvanecer el overlay al hover */
@media (min-width: 768px) {
    #content-modal .content-container:hover .content-info {
        opacity: 0;
    }
}

/* En móvil, mover el overlay debajo del video */
@media (max-width: 767px) {
    #content-modal .content-info {
        position: relative;
        background: rgba(0, 0, 0, 0.9);
        margin-top: 1rem;
        border-radius: 0.5rem;
    }
}

/* Ajuste para el fondo de secciones en modo oscuro */
html.dark section {
    background: transparent;
}

html.dark .bg-gray-50 {
    background-color: rgba(0, 0, 0, 0.3) !important;
}

html.dark .bg-gray-800\/50 {
    background-color: rgba(0, 0, 0, 0.5) !important;
}

/* Menú móvil */
#mobile-menu {
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
}

#mobile-menu.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Animación del botón hamburguesa */
#mobile-menu-button {
    transition: transform 0.3s ease;
}

#mobile-menu-button.active {
    transform: rotate(90deg);
}

/* Botón seguir */
#scroll-down {
    opacity: 0;
    animation: fadeIn 1s ease forwards;
    animation-delay: 1s;
}

#scroll-down svg {
    transition: transform 0.3s ease;
}

#scroll-down:hover svg {
    transform: translateY(4px);
}

/* Estilos para zoom en lightbox */
.lightbox-zoom-container {
    overflow: auto;
    max-height: 90vh;
    max-width: 100%;
}

.lightbox-zoom-container img {
    transition: transform 0.3s ease;
}

.lightbox-zoom-container img.zoomed {
    transform: scale(1.5);
    cursor: zoom-out;
}

/* Modal de Proyecto */
#project-modal {
    display: none;
    position: fixed;
    inset: 0;
    background-color: white;
    z-index: 50;
    overflow: hidden; /* Previene scroll horizontal */
}

html.dark #project-modal {
    background-color: black;
}

html.dark #project-modal .bg-white {
    background-color: rgb(17 24 39);
}

#project-modal:not(.hidden) {
    display: block;
}

#project-modal .h-screen {
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden; /* Previene scroll horizontal */
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

/* Estilos para la barra de desplazamiento */
#project-modal .h-screen::-webkit-scrollbar {
    width: 8px;
}

#project-modal .h-screen::-webkit-scrollbar-track {
    background: transparent;
}

#project-modal .h-screen::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
}

#project-modal .h-screen::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* Ajustes para el contenido */
#project-modal .relative.w-full.h-screen {
    height: 100vh;
    width: 100%;
    position: relative;
}

#project-modal .project-hero {
    width: 100%;
    height: 100vh;
    object-fit: cover;
}

#project-modal .bg-white {
    width: 100%;
    position: relative;
}

#project-modal .max-w-6xl {
    max-width: 72rem;
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
    box-sizing: border-box;
}

/* Ajustes para el contenido del proceso */
#project-modal .project-process .grid {
    display: grid;
    gap: 2rem;
}

@media (max-width: 768px) {
    #project-modal .project-process .grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

#project-modal .project-process img {
    width: 100%;
    height: 16rem;
    object-fit: cover;
}

/* Ajustes para resultados */
#project-modal .project-results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

/* Ajustes para aprendizajes */
#project-modal .project-learnings {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

/* Ajustes para las imágenes de la galería */
#project-modal .project-gallery {
    width: 100%;
    margin: 0 auto;
}

#project-modal .project-gallery img {
    width: 100%;
    height: auto;
    border-radius: 0.5rem;
    transition: transform 0.3s ease;
}

#project-modal .project-gallery img:hover {
    transform: scale(1.05);
}

/* Carrusel */
.carousel {
    overflow: hidden;
    position: relative;
    border-radius: 0.5rem;
}

.carousel-container {
    display: flex;
    width: 100%;
}

.carousel-container img {
    width: 100%;
    flex-shrink: 0;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    transition: background-color 0.3s ease;
}

.carousel-dot.active {
    background-color: rgba(255, 255, 255, 1);
}

@media (max-width: 768px) {
    .carousel {
        max-width: 100%;
    }
    
    /* Optimizar hero del modal de proyectos en mobile */
    #project-modal .relative.w-full.h-screen .absolute.bottom-0 {
        padding: 1.5rem 1rem !important;
    }
    
    #project-modal .project-title {
        font-size: 2rem !important;
        line-height: 1.2;
        margin-bottom: 1rem !important;
        text-align: left;
    }
    
    #project-modal .project-tagline {
        font-size: 1rem !important;
        line-height: 1.4;
        margin-bottom: 1.5rem !important;
        text-align: left;
    }
    
    #project-modal .project-categories {
        margin-bottom: 1rem !important;
        justify-content: flex-start;
    }
    
    #project-modal .project-categories .category-tag {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }
    
    #project-modal .flex.flex-wrap.gap-8 {
        gap: 1rem !important;
        flex-direction: column;
        align-items: flex-start;
    }
    
    #project-modal .flex.flex-wrap.gap-8 > div {
        margin: 0;
    }
    
    #project-modal .flex.flex-wrap.gap-8 .text-sm {
        font-size: 0.8rem;
    }
    
    /* Optimizar contenido del modal en mobile */
    #project-modal .max-w-6xl {
        padding: 0 1rem;
    }
    
    #project-modal .px-8 {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    #project-modal .py-24 {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }
    
    #project-modal .mb-32 {
        margin-bottom: 2rem;
    }
    
    #project-modal .pb-32 {
        padding-bottom: 2rem;
    }
    
    #project-modal h3 {
        font-size: 1.5rem;
        text-align: left;
    }
    
    #project-modal h4 {
        font-size: 1.125rem;
        text-align: left;
    }
    
    #project-modal p {
        text-align: left;
    }
    
    #project-modal .text-center {
        text-align: left !important;
    }
    
    #project-modal .project-results {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    #project-modal .project-results > div {
        text-align: left;
        padding: 1rem;
        background: rgba(6, 182, 212, 0.05);
        border-radius: 0.5rem;
    }
    
    #project-modal .project-learnings {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    #project-modal .project-process .grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}