:root {
    --bg-primary: #020817;
    --bg-secondary: #0f172a;
    --surface: rgba(255, 255, 255, 0.1);
    --surface-hover: rgba(255, 255, 255, 0.15);
    --accent: #00e5ff;
    --accent-glow: rgba(0, 229, 255, 0.4);
    --text-primary: #ffffff;
    --text-secondary: #e2e8f0;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.15);
    --gradient-1: linear-gradient(135deg, #00e5ff, #7c3aed);
    --gradient-2: linear-gradient(135deg, #ec4899, #8b5cf6);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px var(--accent-glow);
    --radius: 16px;
    --radius-sm: 12px;
    font-family: "Inter", system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    background: linear-gradient(180deg, var(--bg-primary) 0%, #000 100%);
    color: var(--text-primary);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    position: relative;
    cursor: none;
}

/* ===== CORRECCIÓN MENÚ LATERAL - SIEMPRE VISIBLE ===== */
.side-nav {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 0 20px;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: all !important;
}

.nav-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    position: relative;
    opacity: 1 !important;
}

.nav-items {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 0;
    padding: 0;
    opacity: 1 !important;
    visibility: visible !important;
}

.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 15px;
    opacity: 1 !important;
}

.nav-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s ease-in-out;
    position: relative;
    z-index: 2;
    backdrop-filter: blur(10px);
    overflow: hidden;
    opacity: 1 !important;
    visibility: visible !important;
}

.nav-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--gradient-1);
    transition: left 0.3s ease-in-out;
    z-index: -1;
}

.nav-icon:hover::before {
    left: 0;
}

.nav-icon:hover {
    background: transparent;
    border-color: transparent;
    transform: translateX(-5px);
    box-shadow: 0 0 20px var(--accent-glow);
    color: var(--bg-primary) !important;
}

.nav-icon.active {
    background: var(--gradient-1);
    color: var(--bg-primary);
    border-color: transparent;
    box-shadow: 0 0 25px var(--accent-glow);
    transform: translateX(-5px);
}

.nav-icon.active::before {
    display: none;
}

.nav-label {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
    white-space: nowrap;
    pointer-events: none;
    position: absolute;
    right: 100%;
    margin-right: 15px;
    background: var(--surface);
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
    backdrop-filter: blur(10px);
    z-index: 3;
}

.nav-item:hover .nav-label {
    opacity: 1;
    transform: translateX(0);
}

.nav-indicator {
    position: absolute;
    right: -10px;
    width: 3px;
    height: 50px;
    background: var(--gradient-1);
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px var(--accent-glow);
    opacity: 0;
}

.nav-indicator.active {
    opacity: 1;
}

/* ===== CURSOR PERSONALIZADO ===== */
.cursor {
    width: 20px;
    height: 20px;
    border: 2px solid var(--accent);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    transition: transform 0.1s ease, opacity 0.3s, background-color 0.2s;
    opacity: 0;
    mix-blend-mode: difference;
    transform: translate(-50%, -50%);
    left: 0;
    top: 0;
}

.cursor.active {
    transform: translate(-50%, -50%) scale(1.5);
    background-color: var(--accent);
    opacity: 0.8;
}

/* ===== HEADER ORGANIZADO ===== */
.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    position: relative;
    z-index: 100;
}

.banner-brand {
    display: flex;
    align-items: center;
    gap: 15px;
}

.banner-logo {
    width: 60px;
    height: 60px;
    background: var(--gradient-1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 24px;
    color: var(--bg-primary);
    box-shadow: var(--shadow-glow);
}

.banner-brand-text h1 {
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    font-size: 28px;
    background: linear-gradient(135deg, var(--text-primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
}

.banner-brand-text p {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
}

.social-links {
    display: flex;
    gap: 15px;
}

/* ===== ESTILOS MEJORADOS PARA TODAS LAS REDES SOCIALES ===== */
.social-link {
    width: 45px;
    height: 45px;
    border-radius: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 1;
}

.social-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-1);
    border-radius: 10px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.social-link:hover::before {
    opacity: 1;
}

.social-link:hover {
    background: transparent;
    border-color: transparent;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 0 25px var(--accent-glow);
}

.social-link svg {
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.3));
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}

.social-link:hover svg {
    transform: scale(1.15) rotate(5deg);
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.6));
    color: var(--accent) !important;
}

/* Efecto de partículas al hacer hover */
.social-link::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.4s ease;
    z-index: -2;
}

.social-link:hover::after {
    width: 80px;
    height: 80px;
}

/* ===== HERO SECTION MEJORADA ===== */
.hero-centered {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
}

.hero-container {
    max-width: 800px;
    padding: 0 20px;
}

/* ===== ANIMACIONES PARA TÍTULOS ===== */
.gradient-text {
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    font-size: clamp(2.5rem, 5vw, 4rem);
    background: linear-gradient(135deg, #00e5ff, #7c3aed, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 24px;
    line-height: 1.1;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease forwards;
}

.section-content h2.gradient-text {
    text-align: center;
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    font-size: clamp(2rem, 4vw, 3rem);
    background: linear-gradient(135deg, #00e5ff, #7c3aed, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 24px;
    line-height: 1.1;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease forwards 0.3s;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes glowPulse {
    0%, 100% {
        text-shadow: 0 0 20px rgba(0, 229, 255, 0.5);
    }
    50% {
        text-shadow: 0 0 30px rgba(0, 229, 255, 0.8), 0 0 40px rgba(124, 58, 237, 0.6);
    }
}

/* Animación específica para el título principal */
#home .gradient-text {
    animation: fadeInUp 1s ease forwards 0.5s, glowPulse 3s ease-in-out infinite 1.5s;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
    line-height: 1.6;
}

.hero-action-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 60px;
    flex-wrap: wrap;
}

.hero-action-btn {
    padding: 16px 32px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.hero-action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--gradient-1);
    transition: left 0.3s ease;
    z-index: -1;
}

.hero-action-btn:hover::before {
    left: 0;
}

.hero-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
    color: var(--bg-primary);
}

/* ===== TECNOLOGÍAS MEJORADAS ===== */
.tech-stack {
    margin-top: 40px;
}

/* ===== CORRECCIÓN TÍTULO NUESTROS LENGUAJES ===== */
.tech-title {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--accent), #00ff88);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 30px;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease forwards 0.6s;
}

.tech-icons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.tech-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.tech-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--gradient-1);
    transition: left 0.3s ease;
    z-index: -1;
}

.tech-icon:hover::before {
    left: 0;
}

.tech-icon:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-glow);
}

.tech-icon i {
    font-size: 2.5rem;
    transition: all 0.3s ease;
}

.tech-icon:hover i {
    transform: scale(1.2);
    filter: brightness(1.2);
}

.tech-icon span {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.tech-icon:hover span {
    color: var(--bg-primary);
}

/* ===== SERVICIOS ===== */
.section {
    min-height: 100vh;
    padding: 80px 20px;
    display: none;
}

.section.active {
    display: block;
}

.section-content {
    max-width: 1200px;
    margin: 0 auto;
}

.section-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 60px;
    line-height: 1.6;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.service-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px 30px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--gradient-2);
    transition: left 0.3s ease;
    z-index: -1;
}

.service-card:hover::before {
    left: 0;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-glow);
}

.service-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    display: block;
}

.service-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.service-card p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.service-card:hover h3,
.service-card:hover p {
    color: var(--bg-primary);
}

/* ===== PORTAFOLIO MEJORADO ===== */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.portfolio-item {
    aspect-ratio: 4/3;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.portfolio-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--gradient-1);
    transition: left 0.3s ease;
    z-index: -1;
}

.portfolio-item:hover::before {
    left: 0;
}

.portfolio-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-glow);
}

.portfolio-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.portfolio-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.portfolio-item:hover .portfolio-image img {
    transform: scale(1.05);
}

.portfolio-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.95));
    padding: 25px;
    transform: translateY(100%);
    transition: all 0.4s ease;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.portfolio-item:hover .portfolio-overlay {
    transform: translateY(0);
}

.portfolio-overlay h3 {
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 1.25rem;
    font-weight: 600;
}

.portfolio-overlay p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.5;
}

.portfolio-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0;
}

.tech-tag {
    background: rgba(0, 229, 255, 0.2);
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

.portfolio-links {
    display: flex;
    gap: 12px;
    margin-top: 12px;
}

.portfolio-link {
    padding: 8px 16px;
    background: var(--accent);
    color: var(--bg-primary);
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.portfolio-link:hover {
    background: transparent;
    color: var(--accent);
    border-color: var(--accent);
    transform: translateY(-2px);
}

/* ===== CONTACTO MEJORADO ===== */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    margin-top: 40px;
    align-items: start;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.form-group {
    position: relative;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 16px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 20px var(--accent-glow);
}

.input-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-1);
    border-radius: var(--radius);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.contact-form input:focus ~ .input-glow,
.contact-form textarea:focus ~ .input-glow {
    opacity: 0.3;
}

.submit-btn {
    padding: 16px 32px;
    background: var(--gradient-1);
    border: none;
    border-radius: var(--radius);
    color: var(--bg-primary);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-glow {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--gradient-2);
    transition: left 0.3s ease;
    z-index: -1;
}

.submit-btn:hover .btn-glow {
    left: 0;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.contact-info-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 25px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.contact-info-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--gradient-1);
    transition: left 0.3s ease;
    z-index: -1;
}

.contact-info-item:hover::before {
    left: 0;
}

.contact-info-item:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-glow);
}

.contact-icon-wrapper {
    position: relative;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.contact-icon {
    font-size: 1.5rem;
    z-index: 2;
}

.icon-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-1);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.contact-info-item:hover .icon-glow {
    opacity: 0.3;
}

.contact-text h4 {
    color: var(--text-primary);
    margin-bottom: 5px;
    font-size: 1.125rem;
}

.contact-text p {
    color: var(--text-secondary);
}

.contact-info-item:hover .contact-text h4,
.contact-info-item:hover .contact-text p {
    color: var(--bg-primary);
}

/* ===== FOOTER ===== */
footer {
    background: var(--bg-secondary);
    padding: 40px 20px;
    border-top: 1px solid var(--border);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 15px;
}

.footer-brand-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
}

.footer-brand-link:hover {
    transform: translateY(-2px);
}

.footer-brand-link:hover .footer-logo {
    box-shadow: 0 0 20px var(--accent-glow);
}

.footer-logo {
    width: 50px;
    height: 50px;
    background: var(--gradient-1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 20px;
    color: var(--bg-primary);
}

.footer-brand-text h3 {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 20px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.footer-brand-text p {
    color: var(--text-muted);
    font-size: 12px;
}

.footer-copy p {
    color: var(--text-muted);
    font-size: 14px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .header-content {
        padding: 20px;
        flex-direction: column;
        gap: 20px;
    }
    
    .hero-action-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .portfolio-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .tech-icons {
        grid-template-columns: repeat(2, 1fr);
    }

    .portfolio-overlay {
        padding: 20px;
    }

    .portfolio-links {
        flex-direction: column;
    }
}

/* ===== ANIMACIONES PARA TECNOLOGÍAS ===== */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.tech-icon {
    animation: float 3s ease-in-out infinite;
}

.tech-icon:nth-child(2) { animation-delay: 0.2s; }
.tech-icon:nth-child(3) { animation-delay: 0.4s; }
.tech-icon:nth-child(4) { animation-delay: 0.6s; }
.tech-icon:nth-child(5) { animation-delay: 0.8s; }
.tech-icon:nth-child(6) { animation-delay: 1s; }
.tech-icon:nth-child(7) { animation-delay: 1.2s; }
.tech-icon:nth-child(8) { animation-delay: 1.4s; }

/* ===== FONDO MEJORADO - ESTRELLAS GRANDES SIN CUADROS ===== */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    pointer-events: none;
}

.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(0, 229, 255, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(0, 229, 255, 0.02) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.01) 0%, transparent 30%);
    z-index: -1;
    pointer-events: none;
    opacity: 0.4;
}

/* Partículas flotantes */
.particle-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    animation: floatParticle linear infinite;
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.5);
}

.particle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300%;
    height: 300%;
    background: radial-gradient(circle, rgba(0, 229, 255, 0.3) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    border-radius: 50%;
}

@keyframes floatParticle {
    0% {
        transform: translateY(100vh) rotate(0deg) scale(0.5);
        opacity: 0;
    }
    10% {
        opacity: 1;
        transform: translateY(90vh) rotate(0deg) scale(1);
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) rotate(360deg) scale(1.2);
        opacity: 0;
    }
}

/* Tamaños y duraciones específicas para partículas */
@media (min-width: 768px) {
    .particle:nth-child(1) { left: 5%; animation-duration: 25s; animation-delay: 0s; width: 3px; height: 3px; }
    .particle:nth-child(2) { left: 15%; animation-duration: 30s; animation-delay: 3s; width: 2px; height: 2px; }
    .particle:nth-child(3) { left: 25%; animation-duration: 35s; animation-delay: 6s; width: 4px; height: 4px; }
    .particle:nth-child(4) { left: 35%; animation-duration: 40s; animation-delay: 9s; width: 3px; height: 3px; }
    .particle:nth-child(5) { left: 45%; animation-duration: 45s; animation-delay: 12s; width: 2px; height: 2px; }
    .particle:nth-child(6) { left: 55%; animation-duration: 50s; animation-delay: 15s; width: 3px; height: 3px; }
    .particle:nth-child(7) { left: 65%; animation-duration: 55s; animation-delay: 18s; width: 4px; height: 4px; }
    .particle:nth-child(8) { left: 75%; animation-duration: 60s; animation-delay: 21s; width: 2px; height: 2px; }
    .particle:nth-child(9) { left: 85%; animation-duration: 65s; animation-delay: 24s; width: 3px; height: 3px; }
    .particle:nth-child(10) { left: 95%; animation-duration: 70s; animation-delay: 27s; width: 4px; height: 4px; }
}

/* ===== CORRECCIONES PARA VISUALIZACIÓN ===== */
.section {
    min-height: 100vh;
    padding: 80px 20px;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.section:not(.active) {
    display: none !important;
}

.section.active {
    display: block !important;
}

.tech-icons {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)) !important;
    gap: 20px !important;
    max-width: 800px !important;
    margin: 0 auto !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.tech-icon {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 20px !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
}

.header-content {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 20px 40px !important;
    position: relative !important;
    z-index: 100 !important;
    opacity: 1 !important;
    visibility: visible !important;
}

#home.active {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.hero-container {
    max-width: 800px !important;
    padding: 0 20px !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.side-nav {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    height: 100vh !important;
    z-index: 1000 !important;
    display: flex !important;
    align-items: center !important;
    padding: 0 20px !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: all !important;
}

/* ===== CORRECCIÓN: DESACTIVAR CURSOR EN MÓVILES ===== */

/* Ocultar cursor personalizado en dispositivos táctiles (móviles) */
@media (hover: none) and (pointer: coarse) {
    .cursor {
        display: none !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }
    
    body {
        cursor: auto !important;
    }
    
    /* Restaurar cursor normal para todos los elementos interactivos */
    a, button, .nav-icon, .service-card, .portfolio-item, 
    .hero-action-btn, .social-link, .submit-btn, .tech-icon,
    input, textarea, select {
        cursor: pointer !important;
    }
}

/* Alternativa adicional: Ocultar en pantallas menores a 768px (móviles) */
@media (max-width: 768px) {
    .cursor {
        display: none !important;
    }
    
    body {
        cursor: auto;
    }
}

/* Mantener cursor personalizado activo en tablets y PC */
@media (min-width: 769px) and (hover: hover) and (pointer: fine) {
    .cursor {
        display: block !important;
    }
    
    body {
        cursor: none;
    }
}

/* ===== MEJORAS SOLICITADAS ===== */

/* 1. ANIMACIÓN DE COLORES PARA DISPOSITIVOS MÓVILES Y TABLETS */
@media (max-width: 1024px) {
  /* Animación para íconos de redes sociales */
  .social-link {
    animation: colorShiftSocial 4s ease-in-out infinite;
  }
  
  /* Animación para íconos del menú lateral */
  .nav-icon {
    animation: colorShiftNav 4s ease-in-out infinite;
  }
  
  /* Animación para títulos principales */
  .gradient-text {
    animation: colorShiftTitles 6s ease-in-out infinite;
  }
  
  /* Animación específica para el título "Nuestros Lenguajes" */
  .tech-title {
    animation: colorShiftTitles 6s ease-in-out infinite;
  }
}

/* Animaciones de cambio de color */
@keyframes colorShiftSocial {
  0%, 100% {
    color: var(--text-primary);
    border-color: var(--border);
  }
  25% {
    color: var(--accent);
    border-color: var(--accent);
  }
  50% {
    color: #7c3aed; /* Color púrpura del gradiente */
    border-color: #7c3aed;
  }
  75% {
    color: #ec4899; /* Color rosa del gradiente */
    border-color: #ec4899;
  }
}

@keyframes colorShiftNav {
  0%, 100% {
    color: var(--text-primary);
    border-color: var(--border);
  }
  33% {
    color: var(--accent);
    border-color: var(--accent);
  }
  66% {
    color: #7c3aed;
    border-color: #7c3aed;
  }
}

@keyframes colorShiftTitles {
  0%, 100% {
    background: linear-gradient(135deg, #00e5ff, #7c3aed, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }
  33% {
    background: linear-gradient(135deg, #7c3aed, #ec4899, #00e5ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }
  66% {
    background: linear-gradient(135deg, #ec4899, #00e5ff, #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }
}

/* 2. AJUSTE DE TAMAÑO DEL BOTÓN "HABLEMOS" */
/* Asegurar que ambos botones tengan el mismo ancho */
.hero-action-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-bottom: 60px;
  flex-wrap: wrap;
}

.hero-action-btn {
  /* Añadir estas propiedades para igualar el tamaño */
  min-width: 160px; /* Ancho mínimo para ambos botones */
  flex: 1; /* Ambos botones crecen igual */
  max-width: 200px; /* Ancho máximo para mantener proporción */
  text-align: center;
  padding: 16px 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

/* Media query para dispositivos móviles */
@media (max-width: 480px) {
  .hero-action-buttons {
    flex-direction: column;
    align-items: center;
    width: 100%;
  }
  
  .hero-action-btn {
    width: 100%; /* Ocupar todo el ancho disponible en móviles */
    max-width: 280px; /* Limitar el ancho máximo */
  }
}

/* ===== CORRECCIONES ESPECÍFICAS PARA 617x623px ===== */

/* Ajustes para tabletas y pantallas medianas (617px y similares) */
@media (max-width: 768px) and (min-width: 480px) {
  
  /* 1. CORRECCIÓN HEADER - Evitar desbordamiento */
  .header-content {
    padding: 15px 20px !important;
    flex-wrap: wrap;
    gap: 15px;
  }
  
  .banner-brand {
    flex: 1;
    min-width: 0; /* Permite que se ajuste */
  }
  
  .banner-logo {
    width: 50px !important;
    height: 50px !important;
    font-size: 20px !important;
  }
  
  .banner-brand-text h1 {
    font-size: 22px !important; /* Reducir tamaño de texto */
  }
  
  .banner-brand-text p {
    font-size: 12px !important;
  }
  
  .social-links {
    gap: 10px !important;
  }
  
  .social-link {
    width: 40px !important;
    height: 40px !important;
  }
  
  /* 2. CORRECCIÓN HERO SECTION - Ajustar contenido principal */
  .hero-container {
    padding: 0 15px !important;
    max-width: 100% !important;
  }
  
  .gradient-text {
    font-size: clamp(1.8rem, 4vw, 2.5rem) !important; /* Texto más adaptable */
    margin-bottom: 20px !important;
  }
  
  .hero-subtitle {
    font-size: 1rem !important; /* Reducir tamaño */
    padding: 0 10px;
    margin-bottom: 30px !important;
  }
  
  /* 3. CORRECCIÓN BOTONES - Mantener dentro de pantalla */
  .hero-action-buttons {
    gap: 15px !important;
    margin-bottom: 40px !important;
    padding: 0 10px;
  }
  
  .hero-action-btn {
    min-width: 140px !important; /* Ancho más compacto */
    padding: 14px 24px !important;
    font-size: 0.9rem !important;
  }
  
  /* 4. CORRECCIÓN TECNOLOGÍAS - Reorganizar grid */
  .tech-stack {
    margin-top: 30px !important;
    padding: 0 10px;
  }
  
  .tech-title {
    font-size: 1.3rem !important;
    margin-bottom: 20px !important;
  }
  
  .tech-icons {
    grid-template-columns: repeat(3, 1fr) !important; /* 3 columnas en lugar de 4 */
    gap: 15px !important;
    max-width: 100% !important;
  }
  
  .tech-icon {
    padding: 15px 10px !important; /* Padding más compacto */
  }
  
  .tech-icon i {
    font-size: 2rem !important; /* Íconos más pequeños */
  }
  
  .tech-icon span {
    font-size: 0.8rem !important; /* Texto más pequeño */
  }
  
  /* 5. CORRECCIÓN SECCIONES GENERALES */
  .section {
    padding: 60px 15px !important; /* Padding lateral reducido */
  }
  
  .section-content {
    max-width: 100% !important;
    padding: 0 10px;
  }
  
  .section-subtitle {
    font-size: 1rem !important;
    margin-bottom: 40px !important;
    padding: 0 10px;
  }
  
  /* 6. CORRECCIÓN SERVICIOS - Grid más compacto */
  .services-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important;
    gap: 20px !important;
  }
  
  .service-card {
    padding: 30px 20px !important;
  }
  
  .service-icon {
    font-size: 2.5rem !important;
    margin-bottom: 15px !important;
  }
  
  .service-card h3 {
    font-size: 1.3rem !important;
  }
  
  .service-card p {
    font-size: 0.9rem !important;
  }
  
  /* 7. CORRECCIÓN PORTAFOLIO - Grid más compacto */
  .portfolio-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)) !important;
    gap: 20px !important;
  }
  
  .portfolio-overlay {
    padding: 20px !important;
  }
  
  .portfolio-overlay h3 {
    font-size: 1.1rem !important;
  }
  
  .portfolio-overlay p {
    font-size: 0.8rem !important;
  }
  
  /* 8. CORRECCIÓN CONTACTO - Layout más compacto */
  .contact-grid {
    grid-template-columns: 1fr !important; /* Una columna en tablet */
    gap: 40px !important;
  }
  
  .contact-form {
    gap: 20px !important;
  }
  
  .contact-form input,
  .contact-form textarea {
    padding: 14px 16px !important;
  }
  
  .contact-info-item {
    padding: 20px !important;
    gap: 15px !important;
  }
  
  .contact-icon-wrapper {
    width: 50px !important;
    height: 50px !important;
  }
  
  .contact-text h4 {
    font-size: 1rem !important;
  }
  
  .contact-text p {
    font-size: 0.9rem !important;
  }
  
  /* 9. CORRECCIÓN FOOTER - Texto más compacto */
  .footer-content {
    padding: 0 10px;
    flex-direction: column !important;
    gap: 20px !important;
    text-align: center;
  }
  
  .footer-logo {
    width: 45px !important;
    height: 45px !important;
    font-size: 18px !important;
  }
  
  .footer-brand-text h3 {
    font-size: 18px !important;
  }
  
  .footer-copy p {
    font-size: 0.85rem !important;
    line-height: 1.4;
  }
  
  /* 10. CORRECCIÓN NAVEGACIÓN LATERAL - Más compacta */
  .side-nav {
    padding: 0 15px !important;
  }
  
  .nav-icon {
    width: 45px !important;
    height: 45px !important;
  }
  
  .nav-label {
    font-size: 12px !important;
    padding: 6px 12px !important;
  }
}

/* Ajustes adicionales específicos para 617px */
@media (max-width: 620px) and (min-width: 480px) {
  
  /* Ajustes extra para la resolución específica 617px */
  .tech-icons {
    grid-template-columns: repeat(2, 1fr) !important; /* 2 columnas en lugar de 3 */
  }
  
  .hero-action-buttons {
    flex-direction: column;
    align-items: center;
  }
  
  .hero-action-btn {
    width: 100%;
    max-width: 250px;
  }
  
  /* Asegurar que el texto no se desborde */
  .gradient-text,
  .section-subtitle,
  .hero-subtitle {
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
  
  /* Prevenir desbordamiento horizontal */
  body {
    overflow-x: hidden;
  }
  
  .app {
    max-width: 100vw;
    overflow: hidden;
  }
}

/* ===== CORRECCIONES GLOBALES PARA EVITAR DESBORDAMIENTO ===== */

/* Asegurar que todos los contenedores respeten el ancho de viewport */
.container, .section-content, .hero-container {
  max-width: 100vw !important;
  box-sizing: border-box;
}

/* Prevenir scroll horizontal */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}

/* Asegurar que las imágenes y elementos no excedan el ancho */
img, canvas, .portfolio-image, .service-card {
  max-width: 100%;
  height: auto;
}

/* Textos responsivos adicionales */
h1, h2, h3, h4, h5, h6 {
  word-wrap: break-word;
}

p, span, li {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* ===== CORRECCIONES PARA PORTAFOLIO EN MÓVIL/TABLET ===== */

/* 1. Comportamiento base para móvil - Mostrar overlay permanentemente */
@media (max-width: 1024px) {
  .portfolio-item {
    cursor: pointer; /* Indicar que es clickeable */
  }
  
  .portfolio-overlay {
    transform: translateY(0) !important; /* Mostrar siempre en móvil */
    background: linear-gradient(transparent, rgba(2, 8, 23, 0.95)) !important; /* Fondo más oscuro para mejor legibilidad */
    position: relative; /* Cambiar a relativo para mejor flujo */
    padding: 20px 15px !important; /* Padding más compacto */
    min-height: 120px; /* Altura mínima consistente */
  }
  
  /* Ocultar overlay inicialmente y mostrar con clase active */
  .portfolio-overlay {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
  }
  
  .portfolio-item.active .portfolio-overlay {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 2. Ajustes específicos para tablets (768px - 1024px) */
@media (max-width: 1024px) and (min-width: 769px) {
  .portfolio-overlay {
    padding: 25px 20px !important;
  }
  
  .portfolio-overlay h3 {
    font-size: 1.1rem !important;
  }
  
  .portfolio-overlay p {
    font-size: 0.85rem !important;
  }
}

/* 3. Ajustes específicos para móviles (hasta 768px) */
@media (max-width: 768px) {
  .portfolio-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important;
    gap: 20px !important;
  }
  
  .portfolio-overlay {
    padding: 15px 12px !important;
    min-height: 100px; /* Altura más compacta en móvil */
  }
  
  .portfolio-overlay h3 {
    font-size: 1rem !important;
    margin-bottom: 6px !important;
  }
  
  .portfolio-overlay p {
    font-size: 0.8rem !important;
    line-height: 1.4 !important;
    margin-bottom: 10px !important;
  }
  
  .portfolio-tech {
    gap: 6px !important;
    margin: 6px 0 !important;
  }
  
  .tech-tag {
    padding: 3px 8px !important;
    font-size: 0.7rem !important;
  }
  
  .portfolio-links {
    gap: 8px !important;
    margin-top: 10px !important;
  }
  
  .portfolio-link {
    padding: 6px 12px !important;
    font-size: 0.8rem !important;
    flex: 1; /* Botones de igual ancho */
    text-align: center;
  }
}

/* 4. Ajustes para móviles muy pequeños (hasta 480px) */
@media (max-width: 480px) {
  .portfolio-grid {
    grid-template-columns: 1fr !important; /* Una columna en móviles pequeños */
  }
  
  .portfolio-overlay {
    padding: 12px 10px !important;
  }
  
  .portfolio-links {
    flex-direction: column; /* Botones en columna */
  }
}

/* 5. Asegurar que el hover solo funcione en desktop */
@media (min-width: 1025px) {
  .portfolio-item:hover .portfolio-overlay {
    transform: translateY(0) !important; /* Mantener comportamiento original */
  }
}