/* ==========================================================================
   STELLARIS DESIGN SYSTEM - VERSIÓN FINAL CORREGIDA
   ========================================================================== */

/* --- Google Fonts Import --- */
@import url('https://fonts.googleapis.com/css2?family=Exo+2:wght@700;800&family=Roboto+Mono&family=Orbitron:wght@400;700&family=Rajdhani:wght@500;700&display=swap');

/* ==========================================================================
   CSS Variables & Core Setup
   ========================================================================== */
:root {
    /* Theme: Andromeda Violet */
    --color-background: #070007;
    --color-text-body: #C4C3E0;
    --color-text-title: #FFFFFF;
    --color-neon-primary: #4B0082; /* Violet */
    --color-neon-secondary: #DCDCDC; /* Ethereal Pink */
    --color-accent: #E5E4E2; /* Cyan */
    --color-neon-primary-rgb: 75, 0, 130;
    --color-neon-secondary-rgb: 220, 220, 220;
    --color-accent-rgb: 229, 228, 226;
    --glass-background: rgba(20, 18, 40, 0.4);
    --glass-border: rgba(127, 0, 255, 0.2);
    --font-display: 'Exo 2', sans-serif;
    --font-body: 'Roboto Mono', monospace;
    --border-radius: 20px;
    --transition-speed: 0.3s ease-in-out;
    --section-spacing: 6rem;
}

/* ==========================================================================
   Global Resets & Background
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: clamp(14px, 1.2vw, 16px);
}

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

.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -3;
    overflow: hidden;
}

.background__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.3;
}

#starfield-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* ==========================================================================
   Layout & General Styles
   ========================================================================== */
.main {
    position: relative;
    width: 100%;
    z-index: 2;
}

p {
    text-align: justify;
    hyphens: auto;
}

.section {
    width: 90%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-top: var(--section-spacing);
    padding-bottom: var(--section-spacing);
}

.section__title {
    font-family: var(--font-display);
    color: var(--color-text-title);
    font-size: clamp(2rem, 1vw + 1.5rem, 2.8rem);
    text-transform: uppercase;
    letter-spacing: 5px;
    text-align: center;
    margin-bottom: 4rem;
    text-shadow: 0 0 5px var(--color-accent), 0 0 15px var(--color-neon-secondary);
}

.card {
    position: relative;
    overflow: hidden; /* ¡Crítico! Oculta el escáner cuando está fuera de la tarjeta. */

    /* 1. ADVANCED BACKGROUND: Using optimal opacity values from the research [cite: 67] */
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 255, 255, 0.05) 100%);
    
    /* 2. ADVANCED BACKDROP-FILTER: Using saturate(180%) is a key best practice [cite: 26] */
    backdrop-filter: blur(2px) saturate(180%) contrast(110%);
    -webkit-backdrop-filter: blur(2px) saturate(180%) contrast(110%);
    
    /* 3. MULTI-LAYER SHADOW SYSTEM: For primary, secondary, and ambient depth [cite: 7, 8] */
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.1), /* Sombra principal [cite: 20] */
        0 8px 16px rgba(0, 0, 0, 0.08), /* Profundidad secundaria [cite: 21] */
        0 16px 32px rgba(0, 0, 0, 0.05), /* Sombra ambiental [cite: 22] */
        inset 0 1px 1px rgba(255, 255, 255, 0.3); /* Resalte interno [cite: 23] */

    border-radius: var(--border-radius);
    overflow: hidden;
    padding: clamp(1.2rem, 2vw + 0.8rem, 2.2rem);
    
    /* 4. PERFORMANCE: Forcing GPU acceleration is critical for smooth animation [cite: 152, 158] */
    transform: translateZ(0);
    will-change: auto;
    
    /* 5. BORDER: We remove the simple border to replace it with the advanced masked border below */
    border: 1px solid transparent; 
}

/* 6. SPECULAR HIGHLIGHT: Simulates a natural light reflection on the top half [cite: 128] */
.card::before {
 display: none;
}



/* Este es nuestro nuevo escáner holográfico */
.card::after {
    content: '';
    position: absolute;
    left: 0;
    top: -100%; /* Comienza fuera de la vista, por encima de la tarjeta */
    width: 100%;
    z-index: 1; /* Se coloca sobre el fondo pero debajo del texto */
    pointer-events: none;

    /* Gradiente que crea la línea de luz (puedes cambiar el color en --color-accent-rgb) */
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(var(--color-accent-rgb), 0.1) 40%,
        rgba(var(--color-accent-rgb), 0.5) 50%,
        rgba(var(--color-accent-rgb), 0.1) 60%,
        transparent 100%
    );

    opacity: 0;
    transition: opacity 0.5s ease;
}

/* Cuando el usuario pasa el mouse, se activa la animación del escáner */
.card:hover::after {
    top: -100%; /* Reinicia la posición en cada hover */
    opacity: 1;
    animation: scan-effect 2s ease-out; /* Puedes cambiar la duración para hacerlo más rápido o lento */
}

/* Animación que mueve el escáner de arriba hacia abajo */
@keyframes scan-effect {
    0% {
        top: -100%;
        opacity: 0;
    }
    10% {
        opacity: 1; /* Aparece rápidamente */
    }
    90% {
        opacity: 1;
    }
    100% {
        top: 100%; /* Termina su recorrido abajo */
        opacity: 0; /* Se desvanece */
    }
}

/*
 * SOLUCIÓN: Aquí puedes modificar las dimensiones del escáner.
 */
.card::after {
    /* Para cambiar el GROSOR (altura) de la línea, modifica este valor: */
    height: 80px; /* Prueba con '40px' para una línea más sutil. */
}

/* ==========================================================================
   Header & Navigation - ENHANCED NEON SYSTEM
   ========================================================================== */
.header {
    justify-content: center; /* Centrado en desktop */
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem 2rem;
    position: fixed; /* [cite: 269] with 'fixed' instead of 'sticky' for your layout */
    top: 0; /* [cite: 270] */
    left: 0;
    width: 100%;
    z-index: 1000; /* [cite: 271] */
    
    /* Best-practice background for navigation  */
    background: rgba(20, 18, 40, 0.4); /* Using a darker base that matches your theme */

    /* Best-practice filter for navigation  */
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    
    /* Best-practice border for navigation [cite: 269] */
    border-bottom: 1px solid rgba(255, 255, 255, 0.2); 
    
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.1),
        inset 0 1px 1px rgba(255, 255, 255, 0.2);
}

.header__nav {
    display: flex;
    gap: clamp(1rem, 4vw, 2rem);
}

.mobile-nav-toggle,
.mobile-nav-menu {
    display: none; /* Ocultos en desktop */
}

@media (max-width: 768px) {
    .header {
        justify-content: flex-end; /* Botón de hamburguesa a la derecha */
    }
    .header__nav {
        display: none; /* Oculta el nav de desktop */
    }
    .mobile-nav-toggle {
        display: block; /* Muestra el botón hamburguesa */
        background: transparent;
        border: none;
        color: var(--color-text-title);
        font-size: 2.2rem;
        cursor: pointer;
        z-index: 1001;
    }
    .mobile-nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: min(70vw, 320px);
        height: 100vh;
        background: rgba(7, 0, 7, 0.85);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        z-index: 1000;
        transition: right 0.4s ease-in-out;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2rem;
    }
    body.mobile-menu-open .mobile-nav-menu {
        right: 0;
    }
}

.header__link {
    font-family: var(--font-display);
    font-size: 1rem;
    letter-spacing: 2px;
    font-weight: 700;
    color: var(--color-text-body);
    text-decoration: none;
    text-transform: uppercase;
    padding: 0.8rem 1.2rem;
    position: relative;
    transition: all var(--transition-speed);
    overflow: hidden;
}

/* Brilliant neon effect on hover - silver meets violet, mate! */
.header__link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent,
        rgba(229, 228, 226, 0.4), /* Silver accent */
        rgba(75, 0, 130, 0.3), /* Violet primary */
        transparent
    );
    transition: left 0.6s ease;
    z-index: -1;
}

.header__link:hover {
    color: var(--color-text-title);
    /* Proper lush neon glow combining silver and violet */
    text-shadow: 
        0 0 5px rgba(229, 228, 226, 0.8),  /* Silver glow */
        0 0 10px rgba(220, 220, 220, 0.6), /* Ethereal pink */
        0 0 20px rgba(75, 0, 130, 0.4),    /* Violet accent */
        0 0 30px rgba(75, 0, 130, 0.2);    /* Outer violet glow */
    transform: translateY(-1px);
}

.header__link:hover::before {
    left: 100%;
}

/* Active section indicator - absolutely pukka neon effect! */
.header__link.active {
    color: var(--color-text-title);
    text-shadow: 
        0 0 8px rgba(229, 228, 226, 1),    /* Bright silver core */
        0 0 15px rgba(220, 220, 220, 0.8), /* Pink mid-glow */
        0 0 25px rgba(75, 0, 130, 0.6),    /* Violet outer */
        0 0 35px rgba(75, 0, 130, 0.3);    /* Extended glow */
    /* Subtle bottom border for active state */
    border-bottom: 2px solid var(--color-accent);
    background: linear-gradient(135deg,
        rgba(75, 0, 130, 0.1) 0%,
        rgba(229, 228, 226, 0.05) 100%);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
    position: relative;
    min-height: 100vh;
    width: 90%;
    max-width: 1400px;
    margin: 0 auto;
    padding-top: 5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* FIX: Asegurar que el hero esté visible */
    z-index: 5;
    isolation: isolate; /* Crea un contexto de apilamiento limpio */
}

.hero__robot-container {
    flex: 1 1 40%; /* CAMBIO: era 100%, ahora 40% para balance visual */
    display: flex;
    align-items: center;
    justify-content: center;
    height: 90vh; /* CAMBIO: era 50vh, ahora 90vh para mayor impacto */
    max-height: 600px; /* NUEVO: limita la altura máxima */
}

.hero__content {
    flex: 1 1 60%;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    z-index: 10; /* NUEVO: asegurar visibilidad sobre otros elementos */
    position: relative; /* NUEVO: contexto de posicionamiento */
}

.hero__title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 1.5vw + 1.5rem, 4.5rem);
    color: var(--color-text-title);
    text-transform: uppercase;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    max-width: 950px;
    text-shadow: 0 0 8px var(--color-accent), 0 0 20px var(--color-neon-primary);
}

.hero-card-container.card {
    max-width: 650px;
    margin: 1.5rem 0;
    padding: 1.5rem;
}

.hero-card-text {
    text-align: right;
    font-size: 1.1rem;
    line-height: 1.6;
}

.hero__buttons {
    display: flex;
    gap: 1.5rem;
    margin-top: 2rem;
}

/* ==========================================================================
   PROJECTS SECTION (FINAL VERSION 2.0)
   ========================================================================== */

/* --- Grid Layout --- */
.proyectos__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
}

/* --- Main Project Card Structure --- */
.proyecto-card {
    display: flex;
    flex-direction: column;
    height: 420px;
    padding: 0; /* Override global .card padding */
}

/* --- Carousel System --- */
.proyecto-card__carousel {
    position: relative;
    width: 100%;
    height: 100%;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s;
    display: flex;
    flex-direction: column;
}

.carousel-slide.active {
    opacity: 1;
    visibility: visible;
    z-index: 10;
}

/* --- Content Slide Styling --- */
.proyecto-card__contenido {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1.5rem;
    padding-bottom: 3rem; /* FIX: Adds space at the bottom for indicators */
}

.proyecto-card__header {
    display: flex;
    align-items: center; /* Vertically aligns icon with the title text */
    gap: 0.75rem; /* The space between the icon and title */
    margin-bottom: 1.2rem; /* FIX: Adds space between header and description */
}

.proyecto-card__icono {
    font-size: 1.8rem;
    color: var(--color-neon-primary);
    text-shadow: 0 0 6px var(--color-neon-primary);
    flex-shrink: 0;
}

.proyecto-card__titulo {
    font-family: var(--font-display);
    color: var(--color-text-title);
    font-size: 1.25rem;
    line-height: 1.2;
    text-shadow: 0 0 6px var(--color-neon-secondary);
}

.proyecto-card__descripcion {
    font-size: 0.9rem;
    line-height: 1.6;
    flex-grow: 1;
    overflow: hidden;
    margin-bottom: 1rem;
}

.proyecto-card__enlace {
    margin-top: auto;
    text-align: center;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    color: var(--color-text-body);
    font-family: var(--font-display);
    font-size: 0.9rem;
    border: 2px solid var(--glass-border);
    text-decoration: none;
    text-transform: uppercase;
    font-weight: 700;
    background: transparent;
    transition: all 0.3s ease;
    z-index: 12;
    position: relative;
}

.proyecto-card__enlace:hover {
    background-color: var(--color-neon-primary);
    border-color: var(--color-neon-primary);
    color: var(--color-text-title);
    box-shadow: #C4C3E0;
    /* Efecto de texto iluminado plata */
    text-shadow: 
        0 0 5px rgba(255, 255, 255, 0.8),
        0 0 10px rgba(220, 220, 220, 0.6),
        0 0 15px rgba(229, 228, 226, 0.4);
    transform: translateY(-1px);
    transition: all 0.3s ease;
}


/* --- Screenshot Slide Styling --- */
.proyecto-screenshot {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    gap: 1rem;
    height: 100%;
}

.proyecto-screenshot .proyecto-card__titulo {
    flex-shrink: 0;
    text-align: center;
}

.screenshot-image {
    width: 100%;
    flex-grow: 1;
    object-fit: contain;
    border-radius: 12px;
    min-height: 0;
}

/* --- Carousel Navigation Styling --- */
.project-carousel__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-body);
    cursor: pointer;
    font-size: 20px;
    transition: all 0.3s ease;
    z-index: 15;
    backdrop-filter: blur(2px);
    
    /* Initially hidden */
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

/* Show navigation buttons ONLY on hover of their parent carousel */
.project-carousel:hover.project-carousel__nav {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

.project-carousel__nav:hover {
    background: var(--color-neon-primary);
    color: var(--color-background);
    box-shadow: 0 0 8px var(--color-neon-primary);
}

.project-carousel__nav--prev { left: 10px; }
.project-carousel__nav--next { right: 10px; }

/* --- Carousel Indicator Styling --- */
.carousel-indicators {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 15;
    background: rgba(0, 0, 0, 0.2);
    padding: 5px 8px;
    border-radius: 20px;
    backdrop-filter: blur(0px);
}

.indicator {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
}

.indicator.active {
    background: var(--color-accent);
    box-shadow: 0 0 8px var(--color-accent);
    transform: scale(1.1);
}

/* ==========================================================================
   Other Sections (RESTORED)
   ========================================================================== */

/* --- Sobre Mí --- */
.sobre-mi__imagen {
    display: block;
    margin: 0 auto 2.5rem auto;
    width: 100%;
    max-width: 250px;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    border: 3px solid var(--color-neon-primary);
    box-shadow: 0 0 12px var(--color-neon-primary);
    object-fit: cover;
}

.sobre-mi__tarjeta p:not(:last-child) {
    margin-bottom: 1.5rem;
}

/* --- Habilidades --- */
.habilidades__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2.5rem;
}

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

.habilidad-card__icono {
    font-size: 4rem;
    color: var(--color-neon-primary);
    text-shadow: 0 0 12px var(--color-neon-primary);
    margin-bottom: 1.5rem;
}

.habilidad-card__titulo {
    font-family: var(--font-display);
    color: var(--color-text-title);
    font-size: 1.6rem;
    margin-bottom: 1rem;
}

/* --- CV & Buttons --- */
/* Sistema de CV de dos columnas con glassmorphism */
.cv__container {
    display: grid;
    grid-template-columns: 300px 1fr;
    grid-template-rows: 1fr auto;
    gap: 2.5rem;
    padding: 2.5rem;
    border-radius: 50px;
    position: relative;
}

/* Columna izquierda: Foto y contacto */
.cv__columna-izquierda {
    grid-row: 1 / 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.5rem;
}

.cv__foto {
    width: 280px;
    height: 280px;
    border-radius: 0%;
    margin-bottom: 1rem;
}

.cv__contacto {
    width: 100%;
}

.cv__nombre {
    font-family: var(--font-display);
    color: var(--color-text-title);
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 5px var(--color-accent);
}

.cv__titulo-profesional {
    color: var(--color-neon-secondary);
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cv__datos-contacto {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.cv__datos-contacto p {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--color-text-body);
}

.cv__datos-contacto i {
    color: var(--color-neon-primary);
    font-size: 1rem;
}

/* Estilos para habilidades en columna izquierda */
.cv__habilidades-seccion {
    width: 100%;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.cv__subtitulo-izquierda {
    font-family: var(--font-display);
    color: var(--color-text-title);
    font-size: 0.95rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 0 3px var(--color-accent);
    text-align: center;
}

.cv__habilidades-grid-izquierda {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.cv__habilidades-grid-izquierda .cv__categoria-habilidad {
    text-align: center;
}

.cv__habilidades-grid-izquierda .cv__categoria-titulo {
    font-size: 0.8rem;
    display: block;
    margin-bottom: 0.3rem;
}

.cv__habilidades-grid-izquierda .cv__habilidades-lista {
    font-size: 0.75rem;
    line-height: 1.3;
}

/* Redes sociales iluminadas */
.cv__redes-sociales {
    width: 100%;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.cv__iconos-redes {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.cv__icono-red {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--color-text-body);
    text-decoration: none;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.cv__icono-red:hover {
    background: var(--color-neon-primary);
    border-color: var(--color-neon-primary);
    color: var(--color-text-title);
    transform: translateY(-2px) scale(1.1);
    box-shadow: 0 0 15px var(--color-neon-primary);
    /* Efecto de texto iluminado como en los botones de proyecto */
    text-shadow: 
        0 0 5px rgba(255, 255, 255, 0.8),
        0 0 10px rgba(220, 220, 220, 0.6),
        0 0 15px rgba(229, 228, 226, 0.4);
}

/* Efectos específicos por red social */
.cv__icono-red:nth-child(1):hover { /* LinkedIn */
    background: #0077B5;
    box-shadow: 0 0 15px #0077B5;
}

.cv__icono-red:nth-child(2):hover { /* GitHub */
    background: #070007;
    box-shadow: 0 0 15px #666;
}

.cv__icono-red:nth-child(3):hover { /* Twitter/X */
    background: #070007;
    box-shadow: 0 0 15px #1DA1F2;
}

.cv__icono-red:nth-child(4):hover { /* Instagram */
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    box-shadow: 0 0 15px #e6683c;
}



/* Columna derecha: Contenido detallado */
.cv__columna-derecha {
    grid-row: 1 / 2;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.cv__seccion {
    border-left: 2px solid rgba(255, 255, 255, 0.1);
    padding-left: 1.5rem;
}

.cv__subtitulo {
    font-family: var(--font-display);
    color: var(--color-text-title);
    font-size: 1.1rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 3px var(--color-accent);
}

.cv__texto {
    line-height: 1.6;
    color: var(--color-text-body);
    text-align: justify;
}

.cv__texto strong {
    color: var(--color-text-title);
    text-shadow: 0 0 2px var(--color-accent);
}

/* Sección de experiencia */
.cv__experiencia {
    margin-bottom: 1rem;
}

.cv__puesto {
    font-family: var(--font-display);
    color: var(--color-text-title);
    font-size: 1rem;
    margin-bottom: 0.3rem;
}

.cv__empresa {
    color: var(--color-neon-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
    font-weight: 600;
}

.cv__logros {
    list-style: none;
    padding: 0;
}

.cv__logros li {
    position: relative;
    padding-left: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--color-text-body);
    font-size: 0.9rem;
    line-height: 1.4;
}

.cv__logros li::before {
    content: '▶';
    position: absolute;
    left: 0;
    color: var(--color-neon-primary);
    font-size: 0.7rem;
}

/* Grid de habilidades */
.cv__habilidades-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cv__categoria-habilidad {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.cv__categoria-titulo {
    font-family: var(--font-display);
    color: var(--color-text-title);
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cv__habilidades-lista {
    color: var(--color-text-body);
    font-size: 0.85rem;
    line-height: 1.4;
}

/* Sección de educación */
.cv__educacion {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cv__educacion p {
    color: var(--color-text-body);
    font-size: 0.9rem;
    line-height: 1.4;
    text-align: left;
}

.cv__educacion strong {
    color: var(--color-text-title);
}

/* Botón de descarga centrado */
.cv__boton-descarga {
    grid-column: 1 / -1;
    grid-row: 2 / 3;
    display: flex;
    justify-content: center;
    margin-top: 1rem;
}

/* Responsive para CV */
@media (max-width: 768px) {
    .cv__container {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        gap: 2rem;
        padding: 2rem;
        text-align: center;
    }
    
    .cv__columna-izquierda {
        grid-row: 1 / 2;
    }
    
    .cv__columna-derecha {
        grid-row: 2 / 3;
    }
    
    .cv__boton-descarga {
        grid-row: 3 / 4;
    }
    
    .cv__seccion {
        border-left: none;
        border-top: 2px solid rgba(255, 255, 255, 0.1);
        padding-left: 0;
        padding-top: 1rem;
    }
}


.gradient-button-container {
    border-radius: 50px;
    padding: 2px;
    position: relative;
    background: linear-gradient(120deg, var(--color-neon-primary), var(--color-neon-secondary), var(--color-accent), var(--color-neon-primary));
    background-size: 300% 300%;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    display: inline-block;
}

.gradient-button-container:hover {
    transform: scale(1.05);
    box-shadow: 0 0 12px var(--color-neon-primary);
    animation: gradient-flow 3s ease-in-out infinite;
}

@keyframes gradient-flow {
    to { background-position: 100% center; }
}

.gradient-button {
    display: block;
    background: var(--color-background);
    color: var(--color-text-title);
    text-decoration: none;
    border-radius: 50px;
    padding: 0.8rem 1.8rem;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    text-align: center;
    border: none;
    cursor: pointer;
    transition: background 0.4s ease;
}

.gradient-button-container:hover .gradient-button {
    background: transparent;
    text-shadow: 0 0 5px rgba(0,0,0,0.5);
}



/* --- Ajustes para Móviles --- */
/* Ya no necesitamos media queries para la altura del iframe,
   `aspect-ratio` lo maneja todo automáticamente. */


/* --- Contact Form --- */
.contacto__contenido {
    max-width: 800px;
    margin: 0 auto;
}

.contacto__subtitulo {
    font-family: var(--font-display);
    text-align: center;
    font-size: 1.8rem;
    color: var(--color-text-title);
    margin-bottom: 2.5rem;
}

.contacto__form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contacto__grupo {
    position: relative;
}

.contacto__input,
.contacto__textarea {
    width: 100%;
    padding: 1rem;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: var(--color-text-body);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: all var(--transition-speed);
}

.contacto__input:focus,
.contacto__textarea:focus {
    outline: none;
    border-color: var(--color-neon-primary);
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5), 0 0 8px var(--color-neon-primary);
}

.contacto__textarea {
    min-height: 150px;
    resize: vertical;
}

.contacto__label {
    position: absolute;
    top: 1rem;
    left: 1rem;
    color: var(--color-text-body);
    pointer-events: none;
    transition: all var(--transition-speed);
}

.contacto__input:focus + .contacto__label,
.contacto__input:not(:placeholder-shown) + .contacto__label,
.contacto__textarea:focus + .contacto__label,
.contacto__textarea:not(:placeholder-shown) + .contacto__label {
    top: -0.75rem;
    left: 0.75rem;
    font-size: 0.8rem;
    background-color: var(--color-background);
    padding: 0 0.5rem;
    color: var(--color-neon-primary);
}

.contacto__boton-container {
    margin: 1.5rem auto 0;
}

/*/* ==========================================================================
   RESPONSIVE DESIGN OPTIMIZADO PARA ROBOT SPLINE
   ========================================================================== */

/* --- Configuración base (Desktop - 1200px+) --- */
.hero__robot-container {
    flex: 1 1 40%;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 90vh; /* Altura máxima en desktop */
    max-height: 600px; /* Limitamos la altura máxima */
}

.hero__robot-3d {
    width: 100%;
    height: 100%;
    /* Aseguramos que el robot mantenga proporciones */
    max-width: 500px; /* Limitamos el ancho máximo en desktop */
}

/* --- Large Desktop (1400px+) --- */
@media (min-width: 1400px) {
    .hero__robot-container {
        height: 100vh; /* Reducimos ligeramente en pantallas muy grandes */
        max-height: 650px;
    }
    
    .hero__robot-3d {
        max-width: 550px; /* Permitimos un poco más de ancho */
    }
}

/* --- Standard Desktop (1200px - 1399px) --- */
@media (max-width: 1399px) and (min-width: 1200px) {
    .hero__robot-container {
        height: 80vh;
        max-height: 550px;
    }
    
    .hero__robot-3d {
        max-width: 480px;
    }
}

/* --- Small Desktop / Large Tablet Landscape (992px - 1199px) --- */
@media (max-width: 1199px) and (min-width: 992px) {
    .hero {
        gap: 2rem;
    }
    
    .hero__robot-container {
        height: 70vh; /* Empezamos a reducir más notablemente */
        max-height: 480px;
        min-height: 350px; /* Establecemos un mínimo */
    }
    
    .hero__robot-3d {
        max-width: 420px;
    }
}

/* --- Tablet Portrait / Small Laptop (768px - 991px) --- */
/* ESTE ES EL RANGO CRÍTICO PARA TABLETS */
@media (max-width: 991px) and (min-width: 768px) {
    .hero {
        flex-direction: column;
        text-align: center;
        padding-top: 6rem; /* Reducimos el padding superior */
        gap: 1.5rem;
    }

    .hero__content {
        align-items: center;
        text-align: center;
        order: 2; /* El contenido va después del robot */
    }
    
    .hero__robot-container {
        order: 1; /* El robot va primero */
        height: 50vh; /* CLAVE: Reducimos significativamente la altura */
        max-height: 400px; /* Limitamos la altura máxima */
        min-height: 280px; /* Pero mantenemos un mínimo funcional */
        width: 100%;
        flex: none; /* Removemos el flex para control total */
    }
    
    .hero__robot-3d {
        max-width: 350px; /* Limitamos el ancho en tablets */
        width: 80%; /* Usamos porcentaje para mejor control */
    }
}

/* --- Large Mobile / Small Tablet (576px - 767px) --- */
@media (max-width: 767px) and (min-width: 576px) {
    .hero {
        flex-direction: column;
        text-align: center;
        padding-top: 5rem;
        gap: 1.5rem;
    }

    .hero__content {
        align-items: center;
        text-align: center;
        order: 2;
    }
    
    .hero__robot-container {
        order: 1;
        height: 45vh; /* Más pequeño en tablets pequeñas */
        max-height: 350px;
        min-height: 250px;
        width: 100%;
    }
    
    .hero__robot-3d {
        max-width: 300px;
        width: 85%;
    }
}

/* --- Mobile (575px y menos) --- */
@media (max-width: 575px) {
    :root {
        --section-spacing: 5rem;
    }
    
    .header__nav {
       display: none;
    }

    .hero {
        flex-direction: column;
        text-align: center;
        padding-top: 4rem; /* Menos padding en móviles */
        gap: 1rem;
    }

    .hero__content {
        align-items: center;
        text-align: center;
        order: 2;
    }
    
    .hero__robot-container {
        order: 1;
        height: 40vh; /* El más pequeño para móviles */
        max-height: 300px;
        min-height: 220px;
        width: 100%;
    }
    
    .hero__robot-3d {
        max-width: 280px; /* Muy controlado en móviles */
        width: 90%;
    }

    .hero__buttons {
        flex-direction: column;
        align-items: center;
        width: 100%;
        max-width: 300px;
    }
    
    .gradient-button-container {
        width: 100%;
    }

    /* Mejora para el botón de contacto */
    .contacto__boton-container {
        width: 100%;
        max-width: 300px;
        margin: 1.5rem auto 0;
    }
    
    .contacto__boton-container .gradient-button {
        width: 100%;
        padding: 1rem 1.5rem;
        font-size: 0.9rem;
    }
}

/* --- Extra Small Mobile (400px y menos) --- */
@media (max-width: 400px) {
    .hero__robot-container {
        height: 35vh; /* Para pantallas muy pequeñas */
        max-height: 250px;
        min-height: 200px;
    }
    
    .hero__robot-3d {
        max-width: 240px;
        width: 95%;
    }
}

/* --- Optimizaciones adicionales para el robot Spline --- */
.hero__robot-3d {
    /* Aseguramos que el robot se renderice correctamente */
    object-fit: contain;
    object-position: center;
    
    /* Mejoramos la performance */
    transform: translateZ(0);
    will-change: auto;
    
    /* Transiciones suaves cuando cambia el tamaño */
    transition: width 0.3s ease, height 0.3s ease;
}

/* --- Landscape específico para tablets --- */
@media (max-width: 1024px) and (orientation: landscape) and (max-height: 768px) {
    .hero__robot-container {
        height: 60vh; /* Ajuste específico para landscape en tablets */
        max-height: 350px;
    }
    
    .hero__robot-3d {
        max-width: 320px;
    }
}


/* ==========================================================================
   RELIABLE ROBOT INTERACTION SYSTEM - SIMPLIFIED APPROACH
   ========================================================================== */

/* Remove any conflicting styles from previous attempts */
.hero__robot-3d::before,
.hero__robot-3d::after {
    display: none;
}

/* Watermark cover overlay - simple and effective */
.spline-watermark-cover {
    position: absolute;
    bottom: 10px;
    left: 10px;
    width: 110px;
    height: 30px;
    background-color: var(--color-background);
    border-radius: 6px;
    z-index: 20;
    pointer-events: none;
    opacity: 1;
}

/* Enhanced interaction hint styling */
.robot-interaction-hint {
    /* Position and dimensions will be set by JavaScript */
    display: flex;
    align-items: center;
    justify-content: center;
    
    /* Visual styling */
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.12) 0%, 
        rgba(255, 255, 255, 0.06) 100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    
    /* Typography */
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--color-text-title);
    text-align: center;
    
    /* Subtle shadow for definition */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    
    /* Smooth transitions */
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.3s ease;
    
    /* Ensure proper text layout */
    white-space: nowrap;
    overflow: hidden;
}

/* Icon styling within the hint */
.robot-interaction-hint .hint-icon {
    margin-right: 4px;
    font-size: 0.75rem;
    color: var(--color-accent);
    flex-shrink: 0;
}

/* Text styling within the hint */
.robot-interaction-hint .hint-text {
    flex: 1;
    min-width: 0;
}

/* Hover effect for interactivity */
.robot-interaction-hint:hover {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.18) 0%, 
        rgba(255, 255, 255, 0.10) 100%);
    transform: scale(1.02);
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .spline-watermark-cover {
        width: 100px;
        height: 25px;
        bottom: 8px;
        left: 8px;
    }
    
    .robot-interaction-hint .hint-icon {
        font-size: 0.7rem;
        margin-right: 3px;
    }
}

@media (max-width: 480px) {
    .spline-watermark-cover {
        width: 90px;
        height: 22px;
        bottom: 6px;
        left: 6px;
    }
    
    .robot-interaction-hint .hint-icon {
        font-size: 0.65rem;
        margin-right: 2px;
    }
}

/* Accessibility support */
@media (prefers-reduced-motion: reduce) {
    .robot-interaction-hint {
        transition: opacity 0.2s ease;
    }
}

/* --- CARRUSEL DE PROYECTOS --- */
/* Ocultamos las flechas por defecto */
.carousel-nav {
    display: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    /* ... otros estilos base que ya tenías ... */
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    width: 36px; height: 36px;
    align-items: center; justify-content: center;
    color: var(--color-text-body);
    cursor: pointer; font-size: 20px;
    transition: all 0.3s ease; z-index: 15;
}
/* Las mostramos ÚNICAMENTE al pasar el mouse sobre la tarjeta */
.proyecto-card:hover .carousel-nav {
    display: flex;
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

/* 3. CRÍTICO: Ocultar flechas del carrusel en el área del hero/robot */
.hero .carousel-nav {
    display: none !important;
}
.hero__robot-container .carousel-nav {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* 4. Asegurar que solo las flechas del robot aparezcan en el hero */
.hero__robot-container .robot-interaction-arrow {
    display: block !important;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2.5rem;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.7);
    z-index: 1000;
    pointer-events: none;
    user-select: none;
}

/* SOLUCIÓN COMPLETA: Solo flechas del robot en el hero */

/* 1. FORZAR la ocultación de flechas del carrusel en el hero */
.hero .carousel-nav,
.hero__robot-container .carousel-nav,
.hero * .carousel-nav {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    position: absolute !important;
    left: -9999px !important; /* Mover fuera de la pantalla */
}


/* 3. Solo mostrar flechas del carrusel en tarjetas de proyecto */
.proyectos .proyecto-card:hover .carousel-nav {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

/* 4. FORZAR estilos de las flechas del robot para que se vean */
.hero__robot-container .robot-interaction-arrow {
    display: block !important;
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    font-size: 2.5rem !important;
    font-weight: bold !important;
    color: rgba(255, 255, 255, 0.7) !important;
    z-index: 1000 !important;
    pointer-events: none !important;
    user-select: none !important;
    opacity: 0.7 !important;
    
    /* Asegurar que se muestren */
    visibility: visible !important;
    left: auto !important;
    right: auto !important;
}

/* 5. Posicionamiento específico para las flechas del robot */
.hero__robot-container .robot-interaction-arrow--left {
    left: 15% !important;
    right: auto !important;
}

.hero__robot-container .robot-interaction-arrow--right {
    right: 15% !important;
    left: auto !important;
}

/* 6. Animación de las flechas del robot */
.hero__robot-container .robot-interaction-arrow {
    animation: arrowPulse 2s ease-in-out infinite !important;
}

@keyframes arrowPulse {
    0%, 100% { 
        opacity: 0.7; 
        transform: translateY(-50%) scale(1);
    }
    50% { 
        opacity: 1; 
        transform: translateY(-50%) scale(1.1);
    }
}

/* 7. Responsive para las flechas del robot */
@media (max-width: 768px) {
    .hero__robot-container .robot-interaction-arrow {
        font-size: 2rem !important;
    }
    
    .hero__robot-container .robot-interaction-arrow--left {
        left: 8% !important;
    }
    
    .hero__robot-container .robot-interaction-arrow--right {
        right: 8% !important;
    }
}

@media (max-width: 480px) {
    .hero__robot-container .robot-interaction-arrow {
        font-size: 1.5rem !important;
    }
    
    .hero__robot-container .robot-interaction-arrow--left {
        left: 5% !important;
    }
    
    .hero__robot-container .robot-interaction-arrow--right {
        right: 5% !important;
    }
}

/* ÚLTIMO RECURSO: Eliminar cualquier flecha que no sea del robot */
.hero *:not(.robot-interaction-arrow) {
    /* Si es una flecha que no es del robot, ocultarla */
}

.hero [class*="carousel"]:not([class*="robot"]) {
    display: none !important;
}

/* ==========================================================================
   SOLUCIÓN COMPLETA PARA LOS 4 PROBLEMAS IDENTIFICADOS
   ========================================================================== */

/* 1. ELIMINAR COMPLETAMENTE LA FLECHA SOLA DEL HERO */
/* Ocultar TODAS las flechas del carrusel en el hero con máxima especificidad */
.hero .carousel-nav,
.hero .carousel-nav--prev,
.hero .carousel-nav--next,
.hero__robot-container .carousel-nav,
.hero__robot-container .carousel-nav--prev,
.hero__robot-container .carousel-nav--next,
.hero * .carousel-nav,
.hero * .carousel-nav--prev,
.hero * .carousel-nav--next {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    position: absolute !important;
    left: -99999px !important;
    top: -99999px !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    z-index: -9999 !important;
}

/* Asegurar que SOLO las flechas del carrusel en proyectos funcionen */
.proyectos .proyecto-card .carousel-nav {
    /* Restablecer las propiedades para proyectos */
    display: flex !important;
    position: absolute !important;
    left: auto !important;
    top: 50% !important;
    width: 36px !important;
    height: 36px !important;
    opacity: 0;
    visibility: hidden;
    z-index: 15 !important;
    transform: translateY(-50%);
    transition: all 0.3s ease;
}

.proyectos .proyecto-card:hover .carousel-nav {
    opacity: 1;
    visibility: visible;
}

.proyectos .proyecto-card .carousel-nav--prev {
    left: 10px !important;
    right: auto !important;
}

.proyectos .proyecto-card .carousel-nav--next {
    right: 10px !important;
    left: auto !important;
}

/* 2. CENTRAR EL ROBOT EN TABLETS Y MÓVILES */
@media (max-width: 991px) {
    .hero {
        flex-direction: column;
        text-align: center;
        padding-top: 6rem;
        gap: 1.5rem;
        align-items: center; /* NUEVO: Centrar elementos */
    }

    .hero__robot-container {
        order: 1;
        height: 50vh;
        max-height: 400px;
        min-height: 280px;
        width: 100%;
        flex: none;
        
        /* NUEVO: Centrar el robot horizontalmente */
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        margin: 0 auto !important;
    }
    
    .hero__robot-3d {
        max-width: 350px;
        width: 80%;
        
        /* NUEVO: Asegurar centrado */
        margin: 0 auto !important;
        display: block !important;
    }

    .hero__content {
        order: 2;
        align-items: center;
        text-align: center;
        width: 100%;
        max-width: 600px; /* NUEVO: Limitar ancho para mejor legibilidad */
        margin: 0 auto; /* NUEVO: Centrar el contenido */
    }
}

@media (max-width: 767px) {
    .hero__robot-container {
        height: 45vh;
        max-height: 350px;
        min-height: 250px;
        
        /* REFORZAR: Centrado en móviles */
        justify-content: center !important;
        align-items: center !important;
    }
    
    .hero__robot-3d {
        max-width: 300px;
        width: 85%;
        margin: 0 auto !important;
    }

        /* Adicional: Mejora la legibilidad del texto en la tarjeta del hero */
    .hero-card-text {
        text-align: left;
    }
}


@media (max-width: 575px) {
    .hero__robot-container {
        height: 40vh;
        max-height: 300px;
        min-height: 220px;
        
        /* REFORZAR: Centrado en móviles pequeños */
        justify-content: center !important;
        align-items: center !important;
    }
    
    .hero__robot-3d {
        max-width: 280px;
        width: 90%;
        margin: 0 auto !important;
    }
}

/* 3. ALINEAR TEXTO A LA IZQUIERDA EN TABLETS Y MÓVILES */
@media (max-width: 991px) {
    /* Texto en tarjetas glassmorphism alineado a la izquierda */
    .hero-card-container.card {
        text-align: left !important;
    }
    
    .hero-card-text {
        text-align: left !important;
    }
    
    /* También aplicar a otras tarjetas con glassmorphism */
    .card p,
    .card .proyecto-card__descripcion,
    .sobre-mi__tarjeta p,
    .habilidad-card p,
    .contacto__contenido {
        text-align: left !important;
    }
    
    /* Mantener títulos centrados pero texto justificado a la izquierda */
    .section__title,
    .contacto__subtitulo {
        text-align: center !important;
    }
}
/*
  Ocultamos con máxima prioridad cualquier flecha de carrusel
  que intente aparecer dentro de la sección .hero.
*/
.hero .carousel-nav,
.hero .carousel-nav--prev,
.hero .carousel-nav--next {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Las mostramos ÚNICAMENTE al pasar el mouse sobre una tarjeta de proyecto */
.proyectos .proyecto-card:hover .carousel-nav {
    display: flex; /* Las volvemos visibles y funcionales */
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

.proyectos .proyecto-card .carousel-nav:hover {
    background: var(--color-neon-primary);
    color: var(--color-text-title);
    box-shadow: 0 0 10px var(--color-neon-primary);
}


/* --- 3. SOLUCIÓN PARA EL CENTRADO EN MÓVILES --- */
/* Aplicamos estos estilos en pantallas de tablet hacia abajo */
@media (max-width: 991px) {
    /* Centra el robot y el contenido de texto en la sección hero */
    .hero {
        align-items: center;
    }
    
    /* Alinea el texto de la tarjeta del hero a la izquierda para mejor lectura */
    .hero-card-text {
        text-align: left;
    }
}




/* Botón de menú hamburguesa (oculto en escritorio) */
.mobile-nav-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--color-text-title);
    font-size: 2rem;
    cursor: pointer;
    z-index: 1001; /* Asegura que esté por encima de otros elementos */
}

/* Estilos para pantallas de tablet y móviles */
@media (max-width: 768px) {
    /* Ocultamos la navegación de escritorio */
    .header__nav {
        display: none;
    }
    
    /* Mostramos el botón de menú hamburguesa */
    .mobile-nav-toggle {
        display: block;
    }

    /* Estilos del panel del menú móvil (inicialmente fuera de la pantalla) */
    .mobile-nav-menu {
        position: fixed;
        top: 0;
        right: -100%; /* Inicia fuera de la pantalla */
        width: 70%;
        max-width: 320px;
        height: 100vh;
        background: var(--glass-background);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        z-index: 1000;
        transition: right 0.4s ease-in-out;
        
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2rem;
    }
    
    /* Estado activo: cuando el menú está abierto */
    .mobile-menu-open .mobile-nav-menu {
        right: 0; /* Desplaza el menú a la vista */
    }

    /* Estilos para los enlaces dentro del menú móvil */
    .mobile-nav-menu .header__link {
        font-size: 1.2rem;
        color: var(--color-text-title);
    }
}


/* ==========================================================================
   REFACTORIZACIÓN PROFESIONAL DE COMPONENTES Y RESPONSIVE
   ========================================================================== */

/* --- 1. REPRODUCTOR DE MÚSICA PROPORCIONAL Y RESPONSIVO --- */

.musica__embed-container {
    width: 90%;
    max-width: 660px;
    margin: 2rem auto;
    padding: 12px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    backdrop-filter: blur(15px) saturate(160%);
    -webkit-backdrop-filter: blur(15px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    border-radius: var(--border-radius);
}

.musica__embed-container iframe {
    width: 100%;
    height: 450px;
    display: block;
    border: none;
    border-radius: calc(var(--border-radius) - 8px);
}

/* --- 2. NAVBAR RESPONSIVA CON MENÚ HAMBURGUESA --- */

/* El header ahora justifica su contenido al extremo derecho en móvil */
.header {
    justify-content: center; /* Centrado por defecto en desktop */
}

.mobile-nav-toggle {
    display: none; /* Oculto en desktop */
    background: transparent;
    border: none;
    color: var(--color-text-title);
    font-size: 2.2rem;
    cursor: pointer;
    z-index: 1001;
}

.mobile-nav-menu {
    display: none; /* Oculto por completo en desktop */
}

/* --- 3. LÓGICA RESPONSIVE PARA TABLET Y MÓVILES --- */

@media (max-width: 768px) {
    .header {
        justify-content: flex-end; /* Alinea el botón de hamburguesa a la derecha */
    }

    /* Ocultamos la navegación de escritorio */
    .header__nav {
        display: none;
    }
    
    /* Mostramos el botón de menú hamburguesa */
    .mobile-nav-toggle {
        display: block;
    }

    /* Estilos del panel del menú móvil (inicialmente fuera de la pantalla) */
    .mobile-nav-menu {
        position: fixed;
        top: 0;
        right: -100%; /* Inicia fuera de la pantalla */
        width: 70%;
        max-width: 320px;
        height: 100vh;
        background: rgba(7, 0, 7, 0.85); /* Fondo oscuro semitransparente */
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        z-index: 1000;
        transition: right 0.4s ease-in-out;
        
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2rem;
    }
    
    /* Clase que se añade con JS para mostrar el menú */
    body.mobile-menu-open .mobile-nav-menu {
        right: 0; /* Desplaza el menú a la vista */
    }

    /* Estilos para los enlaces dentro del menú móvil */
    .mobile-nav-menu .header__link {
        font-size: 1.2rem;
        color: var(--color-text-title);
        opacity: 0; /* Para animación de aparición */
        transform: translateY(10px);
        animation: fadeInLink 0.3s ease forwards;
    }

    /* Animación escalonada para los enlaces */
    .mobile-menu-open .mobile-nav-menu .header__link:nth-child(1) { animation-delay: 0.2s; }
    .mobile-menu-open .mobile-nav-menu .header__link:nth-child(2) { animation-delay: 0.3s; }
    .mobile-menu-open .mobile-nav-menu .header__link:nth-child(3) { animation-delay: 0.4s; }
    .mobile-menu-open .mobile-nav-menu .header__link:nth-child(4) { animation-delay: 0.5s; }
    .mobile-menu-open .mobile-nav-menu .header__link:nth-child(5) { animation-delay: 0.6s; }

    @keyframes fadeInLink {
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    /* Centrado del robot */
    .hero {
        align-items: center;
    }
}


/* ==========================================================================
   SOLUCIÓN PRECISA PARA EL CARRUSEL
   ========================================================================== */

/* 1. Ocultamos las flechas del carrusel por defecto de forma segura */
.carousel-nav {
    display: none;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 15;
    /* ... (mantén tus otros estilos como color, fondo, etc.) ... */
}

/* 2. FORZAMOS la ocultación de las flechas en la sección HERO */
.hero .carousel-nav {
    display: none !important;
}

/* 3. Mostramos las flechas ÚNICAMENTE al hacer hover 
      en una tarjeta DENTRO de la sección de proyectos. */
.proyectos .proyecto-card:hover .carousel-nav {
    display: flex; /* O el valor que uses para mostrarlas */
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

/* 4. Estilos de hover para las flechas (ya los tienes, pero asegúrate de que estén) */
.proyectos .proyecto-card .carousel-nav:hover {
    background: var(--color-neon-primary);
    color: var(--color-text-title);
    box-shadow: 0 0 10px var(--color-neon-primary);
}

/* ==========================================================================
   LANGUAGE TOGGLE
   ========================================================================== */

.lang-group {
    display: flex;
    align-items: center;
    gap: 0;
    margin-left: 0.5rem;
}

.lang-globe {
    font-size: 0.85rem;
    color: rgba(196, 195, 224, 0.4);
    margin-right: 0.4rem;
    pointer-events: none;
}

.lang-btn {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(196, 195, 224, 0.35);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.4rem 0.5rem;
    transition: color 0.25s ease, text-shadow 0.25s ease;
    line-height: 1;
}

.lang-btn.active {
    color: var(--color-text-title);
    text-shadow:
        0 0 6px rgba(229, 228, 226, 0.9),
        0 0 14px rgba(75, 0, 130, 0.6);
}

.lang-btn:hover:not(.active) {
    color: var(--color-text-body);
}

.lang-sep {
    color: rgba(196, 195, 224, 0.2);
    font-family: var(--font-display);
    font-size: 0.75rem;
    user-select: none;
    pointer-events: none;
}

/* Mobile nav: center the toggle in the menu column */
.mobile-nav-menu .lang-group {
    margin-left: 0;
    margin-top: 0.5rem;
    justify-content: center;
}