:root {
    --bg-color: #030408;
    --primary: #38bdf8;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow-x: hidden;
    min-height: 100vh;
}

/* --- FONDO GALÁCTICO COMPARTIDO --- */
.galaxy-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #030408;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.nebula-purple {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(112, 26, 117, 0.25) 0%, transparent 70%);
    top: -10%;
    left: 10%;
    filter: blur(40px);
    animation: floatNebula 20s infinite alternate ease-in-out;
}

.nebula-blue {
    position: absolute;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(14, 116, 144, 0.2) 0%, transparent 70%);
    bottom: -20%;
    right: -10%;
    filter: blur(60px);
    animation: floatNebula 25s infinite alternate-reverse ease-in-out;
}

@keyframes floatNebula {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 30px) scale(1.1); }
}

.dynamic-stars, .shooting-stars-container {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.star {
    position: absolute;
    background-color: #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.8);
    animation: pulseStar infinite ease-in-out;
}

@keyframes pulseStar {
    0%, 100% { opacity: 0.2; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

.shooting-star {
    position: absolute;
    height: 2px;
    background: linear-gradient(-45deg, #ffffff, var(--primary), rgba(0,0,0,0));
    filter: drop-shadow(0 0 8px var(--primary));
    opacity: 0;
    animation: shooting linear forwards;
}

@keyframes shooting {
    0% {
        transform: translateX(0) translateY(0) rotate(-45deg) scale(0);
        opacity: 0;
    }
    5% {
        opacity: 1;
        transform: translateX(-50px) translateY(50px) rotate(-45deg) scale(1);
    }
    100% {
        transform: translateX(-600px) translateY(600px) rotate(-45deg) scale(0);
        opacity: 0;
    }
}

/* --- HEADER COMPARTIDO & RESPONSIVE --- */
header {
    width: 100%;
    padding: 1rem 8%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(3, 4, 8, 0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
}

.logo { 
    font-size: 1.5rem; 
    font-weight: 800; 
    color: var(--primary); 
    text-decoration: none; 
}

nav { 
    display: flex; 
    gap: 2rem; 
    align-items: center; 
}

nav a { 
    color: var(--text-main); 
    text-decoration: none; 
    font-weight: 500; 
    font-size: 0.95rem;
    transition: color 0.3s; 
}

nav a:hover { 
    color: var(--primary); 
}

.btn-cv { 
    background: transparent; 
    border: 2px solid var(--primary); 
    color: var(--primary); 
    padding: 0.4rem 1.1rem; 
    border-radius: 6px; 
    font-weight: 600; 
    text-decoration: none; 
    transition: all 0.3s; 
}

.btn-cv:hover { 
    background: var(--primary); 
    color: #030408; 
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.4); 
}

.hamburger {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s;
}

.hamburger:hover {
    color: var(--primary);
}

.btn-back {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.3s;
}
.btn-back:hover { color: var(--primary); }

/* --- ADAPTACIÓN MÓVIL --- */
@media (max-width: 868px) {
    .hamburger {
        display: block;
    }

    nav {
        position: fixed;
        top: 60px;
        right: -100%;
        width: 100%;
        height: calc(100vh - 60px);
        background: rgba(3, 4, 8, 0.95);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        gap: 2rem;
        transition: right 0.4s ease-in-out;
        border-top: 1px solid rgba(255, 255, 255, 0.05);
    }

    nav.nav-active {
        right: 0;
    }

    nav a {
        font-size: 1.2rem;
    }
}