/* ==========================================================================
   PORTAFOLIO PREMIUM - ESTILOS PRINCIPALES
   ========================================================================== */

/* Variables y Tokens de Diseño */
:root {
    --bg-primary: #040914;
    --bg-secondary: #0a1424;
    --bg-tertiary: #12243d;
    --primary: #0077b6;
    --primary-light: #90e0ef;
    --secondary: #0096c7;
    --accent: #00b4d8;
    --accent-rgb: 0, 180, 216;
    --success: #10b981;
    --error: #ef4444;
    
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --primary-grad: linear-gradient(135deg, var(--primary), var(--secondary));
    --accent-grad: linear-gradient(135deg, var(--secondary), var(--accent));
    --dark-grad: linear-gradient(180deg, var(--bg-primary), var(--bg-secondary));
    
    --glass-bg: rgba(18, 18, 33, 0.6);
    --glass-border: rgba(255, 255, 255, 0.07);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    
    --font-heading: 'Plus Jakarta Sans', sans-serif;
    --font-body: 'Outfit', sans-serif;
    
    --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-fast: all 0.2s ease;
}

/* Reset de Estilos */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

body {
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    background: linear-gradient(to bottom, #1e6b9c 0%, #0a3354 25%, #041424 60%, #040914 100%);
    background-attachment: scroll;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Rayos de Sol Submarinos (Caustics Effect) */
#sunlight-rays {
    position: fixed;
    top: -50%;
    left: -50%;
    right: -50%;
    bottom: -50%;
    background: repeating-linear-gradient(
        -45deg,
        rgba(144, 224, 239, 0.04) 0px,
        rgba(144, 224, 239, 0.04) 50px,
        transparent 100px,
        transparent 200px
    );
    filter: blur(45px);
    pointer-events: none;
    z-index: 1;
    mix-blend-mode: overlay;
    animation: ray-shimmer 25s ease-in-out infinite alternate;
}

@keyframes ray-shimmer {
    0% {
        transform: rotate(-8deg) translateY(0);
        opacity: 0.5;
    }
    50% {
        transform: rotate(-4deg) translateY(-30px);
        opacity: 1;
    }
    100% {
        transform: rotate(-10deg) translateY(15px);
        opacity: 0.5;
    }
}

/* Scrollbar Personalizado */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 5px;
    border: 2px solid var(--bg-primary);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Tipografía y Elementos Comunes */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition-fast);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Clases de Utilidad */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section-padding {
    padding: 8rem 0;
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--glass-shadow);
    transition: var(--transition-smooth);
}

.text-gradient {
    background: var(--primary-grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Cabecera de Secciones */
.section-header {
    text-align: center;
    margin-bottom: 5rem;
}

.section-tagline {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: block;
}

.section-title {
    font-size: 2.8rem;
    font-weight: 800;
    position: relative;
    display: inline-block;
    padding-bottom: 1rem;
}

.header-line {
    width: 60px;
    height: 4px;
    background: var(--primary-grad);
    margin: 0.5rem auto 0;
    border-radius: 2px;
}

/* Botones */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 50px;
    transition: var(--transition-smooth);
    cursor: pointer;
    font-family: var(--font-heading);
}

.btn-primary {
    background: var(--primary-grad);
    color: #fff;
    border: none;
    box-shadow: 0 4px 20px rgba(0, 119, 182, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 119, 182, 0.5);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--glass-border);
    backdrop-filter: blur(8px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--text-primary);
    transform: translateY(-3px);
}

/* Canvas de Fondo */
#hero-canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    opacity: 0.45;
}

#hero-canvas {
    width: 100%;
    height: 100%;
}

/* ==========================================================================
   NAVEGACIÓN (Navbar)
   ========================================================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 1rem 0;
    background: rgba(12, 64, 110, 0.55); /* Azul turquesa traslúcido más claro y brillante */
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 8px 32px rgba(4, 20, 36, 0.15);
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.navbar.scrolled {
    padding: 1rem 0;
    background: rgba(12, 64, 110, 0.7); /* Se vuelve un poco más densa al hacer scroll */
    box-shadow: 0 8px 32px rgba(4, 20, 36, 0.25);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.logo {
    font-size: 1.4rem;
    font-weight: 800;
    font-family: var(--font-heading);
    letter-spacing: -0.03em;
}

.logo-accent {
    color: var(--accent);
    font-weight: 600;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2.5rem;
}

.nav-link {
    font-size: 0.95rem;
    font-weight: 500;
    position: relative;
    padding: 0.5rem 0;
    color: var(--text-secondary);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--primary-grad);
    border-radius: 4px 4px 0 0; /* Forma de ola redondeada */
    transition: var(--transition-smooth);
    box-shadow: 0 0 8px rgba(144, 224, 239, 0.8); /* Brillo de ola */
}

.nav-link:hover, .nav-link.active {
    color: var(--text-primary);
}

.nav-link:hover::after, .nav-link.active::after {
    width: 100%;
}

.btn-contact {
    padding: 0.5rem 1.4rem;
    border: 1px solid var(--primary-light);
    border-radius: 50px; /* Cápsula / óvalo completo orgánico */
    color: var(--primary-light);
    transition: var(--transition-smooth);
}

.btn-contact::after {
    display: none;
}

.btn-contact:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 4px 15px rgba(0, 119, 182, 0.3);
}

/* Menú Hamburguesa */
.hamburger {
    display: none; /* Oculto en computadoras */
    cursor: pointer;
    background: rgba(144, 224, 239, 0.08); /* Fondo de burbuja traslúcida */
    border: 1px solid rgba(144, 224, 239, 0.25);
    border-radius: 50%;
    width: 42px;
    height: 42px;
    position: relative;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 0 10px rgba(144, 224, 239, 0.05);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.hamburger:hover, .hamburger.active {
    background: rgba(144, 224, 239, 0.2);
    border-color: rgba(144, 224, 239, 0.6);
    box-shadow: 0 0 15px rgba(144, 224, 239, 0.3);
}

.bar {
    display: block;
    width: 18px; /* Más delicado */
    height: 2px; /* Más delgado */
    background-color: var(--text-primary);
    border-radius: 1px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: absolute;
}

.bar:nth-child(1) {
    transform: translateY(-5px);
}
.bar:nth-child(2) {
    transform: scaleX(0.7); /* La del medio más corta (estilo ola) */
    transform-origin: center;
}
.bar:nth-child(3) {
    transform: translateY(5px);
}

/* ==========================================================================
   SECCIÓN HERO (Inicio)
   ========================================================================== */
.hero-section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    text-align: center;
    padding: 38vh 2rem 0 2rem;
    position: relative;
    z-index: 2;
}

.hero-content {
    max-width: 850px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    animation: fadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.badge {
    background: rgba(0, 119, 182, 0.12);
    border: 1px solid rgba(0, 119, 182, 0.25);
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-light);
    letter-spacing: 0.05em;
    backdrop-filter: blur(8px);
}

.hero-title {
    font-size: 4rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 650px;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.hero-actions {
    display: flex;
    gap: 1.5rem;
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.mouse {
    width: 26px;
    height: 42px;
    border: 2px solid var(--text-muted);
    border-radius: 20px;
    position: relative;
}

.wheel {
    width: 4px;
    height: 8px;
    background-color: var(--accent);
    border-radius: 2px;
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    animation: scrollMouse 1.5s infinite;
}

/* ==========================================================================
   SECCIÓN SOBRE MÍ
   ========================================================================== */
/* ==========================================================================
   SECCIÓN SOBRE MÍ Y HABILIDADES (Simplificada)
   ========================================================================== */
.about-section {
    min-height: 95vh;
    display: flex;
    align-items: center;
    padding: 4rem 0;
}

.about-section .container {
    width: 100%;
}

.about-clean-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 4rem;
    align-items: start;
}

.about-text, .skills-clean {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.about-title {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.lead-text {
    font-size: 1.2rem;
    color: var(--text-primary);
    line-height: 1.7;
    font-weight: 500;
}

.about-text p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.7;
}

.skills-intro {
    color: var(--text-secondary);
    font-size: 1.05rem;
}

.skills-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.skill-tag {
    background: rgba(0, 180, 216, 0.05);
    border: 1px solid rgba(0, 180, 216, 0.15);
    padding: 0.55rem 1.1rem;
    border-radius: 50% 40% 60% 40% / 50% 40% 60% 50%;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.5s ease-in-out;
    display: inline-block;
}

/* Unique organic variations for bubble shapes */
.skill-tag:nth-child(2n) {
    border-radius: 45% 55% 40% 60% / 55% 40% 60% 45%;
}

.skill-tag:nth-child(3n) {
    border-radius: 55% 45% 65% 35% / 45% 55% 45% 55%;
}

.skill-tag:hover {
    background: rgba(0, 180, 216, 0.18);
    border-color: rgba(144, 224, 239, 0.4);
    color: var(--text-primary);
    border-radius: 40% 60% 40% 60% / 40% 60% 40% 60%;
    transform: translateY(-4px) scale(1.04);
    box-shadow: 0 8px 20px rgba(0, 180, 216, 0.25);
}

/* ==========================================================================
   SECCIÓN PROYECTOS (Simplificada)
   ========================================================================== */
.projects-section {
    min-height: 85vh;
    display: flex;
    align-items: center;
    padding: 8rem 0 4rem;
}

.projects-section .container {
    width: 100%;
}

.projects-grid-clean {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto;
}

.project-card-clean {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    transition: var(--transition-smooth);
}


.project-image-wrapper-clean {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/10;
    border: 1px solid var(--glass-border);
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.8s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.8s ease;
    box-shadow: 0 8px 30px rgba(0, 180, 216, 0.08);
}

/* Morphing jellyfish animations for each project card to avoid sync */
.project-card-clean:nth-child(1) .project-image-wrapper-clean {
    animation: jellyfish-morph-1 12s ease-in-out infinite;
}

.project-card-clean:nth-child(2) .project-image-wrapper-clean {
    animation: jellyfish-morph-2 15s ease-in-out infinite;
}

.project-card-clean:nth-child(3) .project-image-wrapper-clean {
    animation: jellyfish-morph-3 18s ease-in-out infinite;
}


.project-card-clean:hover .project-image-wrapper-clean {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 35px rgba(0, 180, 216, 0.25);
    border-color: rgba(0, 180, 216, 0.4);
}

.project-grad-1 {
    background: linear-gradient(135deg, #0077b6 0%, #00b4d8 100%);
}

.project-grad-2 {
    background: linear-gradient(135deg, #0a9396 0%, #005f73 100%);
}

.project-grad-3 {
    background: linear-gradient(135deg, #00b4d8 0%, #90e0ef 100%);
}

.project-image-clean {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0; /* Oculta por defecto */
    transform: scale(1.08); /* Ligeramente más grande para zoom-out suave en hover */
    transition: opacity 0.6s cubic-bezier(0.25, 0.8, 0.25, 1), transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.project-card-clean:hover .project-image-clean {
    opacity: 1; /* Se muestra con fundido suave */
    transform: scale(1); /* Vuelve a su tamaño normal */
}

/* Jellyfish Keyframes (Originales de dos pasos) */
@keyframes jellyfish-morph-1 {
    0%, 100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
    50% {
        border-radius: 50% 50% 50% 50% / 50% 50% 50% 50%;
    }
}

@keyframes jellyfish-morph-2 {
    0%, 100% {
        border-radius: 50% 50% 35% 65% / 55% 45% 55% 45%;
    }
    50% {
        border-radius: 65% 35% 50% 50% / 45% 55% 45% 55%;
    }
}

@keyframes jellyfish-morph-3 {
    0%, 100% {
        border-radius: 40% 60% 60% 40% / 60% 40% 60% 40%;
    }
    50% {
        border-radius: 55% 45% 35% 65% / 40% 60% 40% 60%;
    }
}




.project-info-clean {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.project-category-clean {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.project-title-clean {
    font-size: 1.3rem;
    font-weight: 700;
}

.project-title-clean a:hover {
    color: var(--primary-light);
}

.project-description-clean {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

.project-tags-clean {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.project-tags-clean span {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* ==========================================================================
   SECCIÓN CONTACTO (Simplificada)
   ========================================================================== */
.contact-section {
    min-height: 80vh;
    display: flex;
    align-items: center;
    padding: 4rem 0;
}

.contact-section .container {
    width: 100%;
}

.contact-clean-content {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

/* Burbuja Medusa Interactiva */
.contact-interactive-bubble {
    width: 120px;
    height: 75px;
    background: radial-gradient(circle at 35% 30%, rgba(144, 224, 239, 0.45) 0%, rgba(0, 180, 216, 0.08) 75%);
    border-radius: 50% 50% 25% 25% / 65% 65% 35% 35%;
    border: 1px solid rgba(0, 180, 216, 0.25);
    filter: drop-shadow(0 0 15px rgba(0, 180, 216, 0.25));
    margin-bottom: 3.5rem; /* Espacio para los tentáculos largos */
    animation: jellyfish-swim 6s ease-in-out infinite, jellyfish-bell 6s ease-in-out infinite;
    transition: all 0.5s ease-out;
    position: relative;
    cursor: pointer;
}

/* Tentáculos Individuales */
.tentacle {
    position: absolute;
    width: 1px;
    background: linear-gradient(to bottom, rgba(0, 180, 216, 0.5), rgba(144, 224, 239, 0.15) 50%, transparent);
    bottom: -45px;
    transform-origin: top center;
    border-radius: 50%;
}

.t1 { left: 20%; height: 50px; animation: tentacle-sway-1 4s ease-in-out infinite alternate; }
.t2 { left: 35%; height: 75px; animation: tentacle-sway-2 5s ease-in-out infinite alternate 0.5s; }
.t3 { left: 50%; height: 85px; animation: tentacle-sway-3 4.5s ease-in-out infinite alternate 0.2s; }
.t4 { left: 65%; height: 70px; animation: tentacle-sway-4 5.2s ease-in-out infinite alternate 0.7s; }
.t5 { left: 80%; height: 45px; animation: tentacle-sway-5 3.8s ease-in-out infinite alternate 0.4s; }

.contact-interactive-bubble:hover {
    transform: scale(1.08) translateY(-15px);
    filter: drop-shadow(0 0 30px rgba(0, 180, 216, 0.6));
    background: radial-gradient(circle at 35% 30%, rgba(144, 224, 239, 0.65) 0%, rgba(0, 180, 216, 0.15) 75%);
    border-color: rgba(144, 224, 239, 0.5);
}

/* Al pasar el mouse, los tentáculos brillan más */
.contact-interactive-bubble:hover .tentacle {
    background: linear-gradient(to bottom, rgba(144, 224, 239, 0.8), rgba(0, 180, 216, 0.3) 60%, transparent);
}

/* Animación de Nado/Propulsión (Contracción y deslizamiento) */
@keyframes jellyfish-swim {
    0%, 100% {
        transform: translateY(0) scaleX(1) scaleY(1);
    }
    30% {
        /* Propulsión rápida hacia arriba (se encoge horizontalmente y se estira verticalmente) */
        transform: translateY(-22px) scaleX(0.88) scaleY(1.12);
    }
    40% {
        /* Pico de altura del nado */
        transform: translateY(-24px) scaleX(0.88) scaleY(1.12);
    }
    70% {
        /* Desplazamiento planeado (se ensancha al relajarse) */
        transform: translateY(6px) scaleX(1.08) scaleY(0.92);
    }
}

/* Animación de la Campana (Silueta ondulante coordinada con el nado) */
@keyframes jellyfish-bell {
    0%, 100% {
        border-radius: 50% 50% 25% 25% / 65% 65% 35% 35%;
    }
    30%, 40% {
        /* Campana cerrada/afilada en la propulsión */
        border-radius: 46% 46% 15% 15% / 75% 75% 25% 25%;
    }
    70% {
        /* Campana ensanchada/paraguas en el planeo */
        border-radius: 54% 54% 35% 35% / 55% 55% 45% 45%;
    }
}

/* Oscilaciones asíncronas para dar fluidez natural a los tentáculos */
@keyframes tentacle-sway-1 { 0% { transform: rotate(-6deg); } 100% { transform: rotate(6deg); } }
@keyframes tentacle-sway-2 { 0% { transform: rotate(-9deg) scaleY(0.9); } 100% { transform: rotate(9deg) scaleY(1.1); } }
@keyframes tentacle-sway-3 { 0% { transform: rotate(-4deg) scaleY(0.95); } 100% { transform: rotate(4deg) scaleY(1.05); } }
@keyframes tentacle-sway-4 { 0% { transform: rotate(-8deg); } 100% { transform: rotate(8deg); } }
@keyframes tentacle-sway-5 { 0% { transform: rotate(-5deg) scaleY(0.85); } 100% { transform: rotate(5deg) scaleY(1.15); } }

.contact-subtle-title {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--primary-light);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.contact-single-line {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.contact-single-link {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition-fast);
    padding: 0.2rem 0;
    border-bottom: 1px solid transparent;
}

.contact-single-link:hover {
    color: var(--primary-light);
    border-bottom: 1px solid var(--primary-light);
}

.contact-divider {
    color: var(--text-muted);
    font-weight: 300;
}

.social-link-item:hover {
    color: var(--primary-light);
    transform: translateY(-2px);
}

/* Contenedor de Medusa Decorativa en Proyectos */
.projects-decor-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 8rem;
    margin-bottom: 8rem;
    padding: 2rem 0;
}

.jellyfish-cobalt {
    width: 120px;
    height: 75px;
    background: radial-gradient(circle at 35% 30%, rgba(72, 149, 239, 0.4) 0%, rgba(67, 97, 238, 0.08) 75%);
    border-radius: 50% 50% 25% 25% / 65% 65% 35% 35%;
    border: 1px solid rgba(67, 97, 238, 0.25);
    filter: drop-shadow(0 0 15px rgba(67, 97, 238, 0.25));
    animation: jellyfish-swim 6s ease-in-out infinite, jellyfish-bell 6s ease-in-out infinite;
    animation-delay: 1.5s; /* Desincronizada */
    transition: all 0.5s ease-out;
    position: relative;
    cursor: pointer;
}

.jellyfish-cobalt:hover {
    transform: scale(1.08) translateY(-15px);
    filter: drop-shadow(0 0 30px rgba(67, 97, 238, 0.6));
    background: radial-gradient(circle at 35% 30%, rgba(72, 149, 239, 0.6) 0%, rgba(67, 97, 238, 0.15) 75%);
    border-color: rgba(72, 149, 239, 0.5);
}

.jellyfish-cobalt .tentacle {
    position: absolute;
    width: 1px;
    background: linear-gradient(to bottom, rgba(67, 97, 238, 0.5), rgba(72, 149, 239, 0.15) 50%, transparent);
    bottom: -45px;
    transform-origin: top center;
    border-radius: 50%;
}

.jellyfish-cobalt:hover .tentacle {
    background: linear-gradient(to bottom, rgba(72, 149, 239, 0.8), rgba(67, 97, 238, 0.3) 60%, transparent);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer {
    border-top: 1px solid var(--glass-border);
    padding: 2rem 0;
    background: transparent;
    margin-top: auto; /* Empuja el footer al fondo si hay poco contenido */
}

.footer-content-minimal {
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.footer-content-minimal p {
    color: var(--text-muted);
    font-size: 0.85rem;
    letter-spacing: 0.02em;
}

/* ==========================================================================
   ANIMACIONES
   ========================================================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scrollMouse {
    0% {
        opacity: 1;
        transform: translate(-50%, 0);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, 15px);
    }
}

/* ==========================================================================
   DISEÑO RESPONSIVO (Media Queries)
   ========================================================================== */
@media (max-width: 1024px) {
    .about-clean-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .projects-grid-clean {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 15px;
    }
    
    .section-padding {
        padding: 5rem 0;
    }
    
    /* Evitar que el navbar fijo tape los títulos de páginas secundarias en celular */
    .projects-section,
    .exercises-section,
    .encargos-section,
    .about-section,
    .contact-section {
        padding-top: 9rem; /* Aumentado a 9rem para dar más aire respecto al menú fijo */
    }
    
    .hero-title {
        font-size: 2.8rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .hero-actions {
        flex-direction: column;
        width: 100%;
        gap: 1rem;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .hamburger {
        display: flex;
        z-index: 1010; /* Asegura estar por encima del menú desplegable */
    }
    
    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
        transform: scaleX(0);
    }
    
    .hamburger.active .bar:nth-child(1) {
        transform: rotate(45deg);
    }
    
    .hamburger.active .bar:nth-child(3) {
        transform: rotate(-45deg);
    }
    
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 0;
        flex-direction: column;
        /* Fondo de gradiente radial abisal más sólido para ocultar el fondo */
        background: radial-gradient(circle at center, rgba(14, 43, 73, 0.985) 0%, rgba(6, 15, 30, 0.995) 100%);
        backdrop-filter: blur(25px);
        -webkit-backdrop-filter: blur(25px);
        width: 100%;
        height: 100vh;
        justify-content: center;
        align-items: center;
        gap: 2.5rem;
        transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
        z-index: 999;
    }

    /* Brillo bioluminiscente en el centro del menú móvil */
    .nav-menu::before {
        content: '';
        position: absolute;
        width: 280px;
        height: 280px;
        background: radial-gradient(circle, rgba(144, 224, 239, 0.13) 0%, rgba(0, 180, 216, 0) 70%);
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        pointer-events: none;
        z-index: -1;
        animation: menu-glow-pulse 6s ease-in-out infinite alternate;
    }

    @keyframes menu-glow-pulse {
        0% { transform: translate(-50%, -50%) scale(0.9); opacity: 0.6; }
        100% { transform: translate(-50%, -50%) scale(1.25); opacity: 1; }
    }
    
    .nav-menu.active {
        left: 0;
    }

    /* Animación secuencial de los enlaces (estilo burbujas que suben al abrir el menú) */
    .nav-menu .nav-item {
        opacity: 0;
        transform: translateY(25px);
        transition: opacity 0.5s cubic-bezier(0.25, 0.8, 0.25, 1), transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
        width: 100%;
        text-align: center;
    }

    .nav-menu .nav-link {
        font-size: 1.25rem; /* Más elegante y delicado en celular */
        font-weight: 500;
        letter-spacing: 0.04em;
        display: inline-block;
        padding: 0.5rem 2rem;
    }

    /* Anular el botón estirado de Contacto en celular para que luzca como un enlace normal */
    .nav-menu .nav-link.btn {
        background: none !important;
        border: none !important;
        box-shadow: none !important;
        color: var(--text-primary) !important;
        width: auto !important;
        display: inline-block !important;
        padding: 0.5rem 2rem !important;
        font-weight: 500 !important;
        transform: none !important;
    }

    .nav-menu .nav-link.btn:hover {
        background: none !important;
        transform: none !important;
    }

    .nav-menu.active .nav-item {
        opacity: 1;
        transform: translateY(0);
    }

    .nav-menu.active .nav-item:nth-child(1) { transition-delay: 0.15s; }
    .nav-menu.active .nav-item:nth-child(2) { transition-delay: 0.25s; }
    .nav-menu.active .nav-item:nth-child(3) { transition-delay: 0.35s; }
    .nav-menu.active .nav-item:nth-child(4) { transition-delay: 0.45s; }
    
    .projects-grid-clean {
        grid-template-columns: 1fr;
    }
    
      .contact-single-line {
          flex-direction: column;
          align-items: center;
          gap: 1rem;
      }
      .contact-divider {
          display: none;
      }
}

/* ==========================================================================
   ELEMENTOS DE TEMÁTICA MARINA ADICIONALES (Medusa, Coral y Anémona)
   ========================================================================== */

/* Divisor de Coral en el Navbar */
.navbar-coral-divider {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 12px;
    overflow: hidden;
    line-height: 0;
    pointer-events: none;
}
.navbar-coral-divider svg {
    width: 100%;
    height: 12px;
}

/* Iconos de Títulos Lineales */
.title-icon-jelly, .title-icon-coral {
    width: 32px;
    height: 32px;
    vertical-align: middle;
    margin-right: 0.8rem;
    color: var(--primary-light);
    display: inline-block;
    transition: transform 0.5s ease, filter 0.5s ease;
    filter: drop-shadow(0 0 5px rgba(0, 180, 216, 0.3));
}

.section-title:hover .title-icon-jelly {
    transform: translateY(-4px);
    animation: title-jelly-swim 2s ease-in-out infinite alternate;
    filter: drop-shadow(0 0 10px rgba(0, 180, 216, 0.7));
}

.about-title:hover .title-icon-coral {
    transform: rotate(6deg) scale(1.08);
    filter: drop-shadow(0 0 10px rgba(0, 180, 216, 0.7));
}

/* Animación de la Medusa de Título */
@keyframes title-jelly-swim {
    0% {
        transform: translateY(-2px) scaleY(1);
    }
    100% {
        transform: translateY(-7px) scaleY(1.15) scaleX(0.9);
    }
}



/* Burbujas flotantes en los enlaces del menú al pasar el cursor (hover) */
.nav-item {
    position: relative;
}

.nav-item::before, .nav-item::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(144, 224, 239, 0.7);
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%) translateY(0) scale(0.5);
    opacity: 0;
    pointer-events: none;
}

/* Burbuja izquierda */
.nav-item::before {
    width: 6px;
    height: 6px;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

/* Burbuja derecha */
.nav-item::after {
    width: 4px;
    height: 4px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Animación al hacer hover */
.nav-item:hover::before {
    animation: menu-bubble-left 1.2s ease-out infinite;
}

.nav-item:hover::after {
    animation: menu-bubble-right 1.2s ease-out infinite 0.3s;
}

@keyframes menu-bubble-left {
    0% {
        transform: translateX(-15px) translateY(10px) scale(0.4);
        opacity: 0;
    }
    30% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.4;
    }
    100% {
        transform: translateX(-25px) translateY(-35px) scale(1.3);
        opacity: 0;
    }
}

@keyframes menu-bubble-right {
    0% {
        transform: translateX(10px) translateY(10px) scale(0.4);
        opacity: 0;
    }
    30% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.4;
    }
    100% {
        transform: translateX(20px) translateY(-30px) scale(1.2);
        opacity: 0;
    }
}

/* ==========================================================================
   NUEVOS EFECTOS INTERACTIVOS MARINOS (Destellos)
   ========================================================================== */

/* 2. Destello de Luz Marina en los Textos (Text Shimmer) */
.water-shimmer-text {
    background: linear-gradient(
        120deg,
        #ffffff 30%,
        rgba(144, 224, 239, 0.9) 45%,
        #ffffff 55%,
        rgba(144, 224, 239, 0.9) 65%,
        #ffffff 80%
    );
    background-size: 200% auto;
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    animation: textRefractionAnimation 5s linear infinite;
    display: inline-block;
}

@keyframes textRefractionAnimation {
    0% {
        background-position: 200% center;
    }
    100% {
        background-position: -200% center;
    }
}

/* ==========================================================================
   SECCIÓN DE CÓDIGO CREATIVO Y EXPERIMENTOS
   ========================================================================== */
.experiments-grid {
    display: flex;
    justify-content: center;
    margin-top: 3.5rem;
}

.experiment-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 18px;
    overflow: hidden;
    max-width: 360px; /* Reducido de 480px para que se vea más delicado e integrado */
    width: 100%;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

.experiment-card:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(144, 224, 239, 0.25);
    box-shadow: 0 15px 35px rgba(0, 180, 216, 0.18);
}

.experiment-image-wrapper {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: #020a13;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.experiment-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.experiment-card:hover .experiment-image {
    transform: scale(1.04);
}

/* Play Icon Overlay */
.play-icon-overlay {
    position: absolute;
    inset: 0;
    background: rgba(3, 10, 19, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.85;
    transition: opacity 0.4s ease, background 0.4s ease;
}

.experiment-card:hover .play-icon-overlay {
    opacity: 1;
    background: rgba(3, 10, 19, 0.2);
}

.play-icon-overlay svg {
    filter: drop-shadow(0 0 8px rgba(144, 224, 239, 0.5));
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.experiment-card:hover .play-icon-overlay svg {
    transform: scale(1.15);
}

.experiment-info {
    padding: 1.5rem;
}

.experiment-category {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    font-weight: 700;
}

.experiment-title {
    font-size: 1.2rem;
    margin-top: 0.4rem;
    margin-bottom: 0.6rem;
    font-family: var(--font-heading);
}

.experiment-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.experiment-title a:hover {
    color: var(--primary);
}

.experiment-description {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 1.25rem;
}

.experiment-tags {
    display: flex;
    gap: 0.5rem;
}

.experiment-tags span {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* ==========================================================================
   PÁGINA DE EJERCICIOS (Contenedor de Pestañas e Iframe Minimalista)
   ========================================================================== */
.tabs-control-container {
    display: flex;
    width: fit-content;
    margin: 2.5rem auto 2rem;
    align-items: center;
    background: rgba(14, 43, 73, 0.45);
    border: 1px solid rgba(144, 224, 239, 0.2);
    padding: 6px;
    border-radius: 50px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    gap: 6px;
}

.tab-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    padding: 0.65rem 1.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: inherit;
    border-radius: 50px;
    letter-spacing: 0.02em;
    position: relative;
    outline: none;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(144, 224, 239, 0.08);
    border-color: rgba(144, 224, 239, 0.15);
}

.tab-btn.active {
    background: rgba(0, 180, 216, 0.22);
    border-color: rgba(144, 224, 239, 0.4);
    color: #ffffff;
    box-shadow: 0 4px 20px rgba(0, 180, 216, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    text-shadow: 0 0 12px rgba(144, 224, 239, 0.6);
}

/* Contenido de las pestañas */
.tabs-content-container {
    margin-top: 1.5rem;
}

.tab-content {
    display: none;
    animation: tab-fade-in 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.tab-content.active {
    display: block;
}

@keyframes tab-fade-in {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.exercise-info-header {
    text-align: center;
    margin-bottom: 2.2rem;
}

.exercise-info-header h2,
.exercise-info-header h3 {
    font-size: 1.75rem;
    color: var(--text-primary);
    font-weight: 700;
    margin-bottom: 0;
    letter-spacing: -0.02em;
}

.exercise-intro-text {
    color: var(--text-secondary);
    font-size: 1.2rem;
    max-width: 650px;
    margin: 0 auto;
    opacity: 0.9;
    line-height: 1.6;
}

/* Contenedor Iframe Flotante y Sin Bordes Pesados */
.exercise-preview-card {
    background: transparent;
    border: none;
    padding: 0;
    max-width: 960px;
    margin: 0 auto;
}

.iframe-wrapper {
    position: relative;
    width: 100%;
    height: 580px;
    border-radius: 20px;
    overflow: hidden;
    background: transparent; /* Permite ver el fondo estelar */
    border: 1px solid rgba(255, 255, 255, 0.08); /* Borde sumamente delgado y sutil */
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.35), 
                0 0 50px rgba(0, 180, 216, 0.05); /* Brillo abisal flotante */
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.iframe-wrapper:hover {
    border-color: rgba(144, 224, 239, 0.25);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45), 
                0 0 60px rgba(0, 180, 216, 0.12); /* Brillo bioluminiscente dinámico */
}

.iframe-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    background: transparent;
}

.exercise-actions {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
}

/* Responsividad para el selector de encargos */
@media (max-width: 768px) {
    .tabs-control-container {
        max-width: 92%;
        margin: 2rem auto 1.5rem;
        padding: 4px;
        gap: 4px;
    }
    
    .tab-btn {
        font-size: 0.88rem;
        padding: 0.5rem 1.2rem;
    }
    
    .iframe-wrapper {
        height: 420px; /* Tamaño ideal para teléfonos */
        border-radius: 16px;
    }
}

/* Utilidad de Accesibilidad (Oculto visualmente pero legible por lectores de pantalla y validadores) */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
