/* Base & Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #6a0dad; /* Púrpura */
    --secondary-color: #333;
    --accent-color: #ffffff; /* Blanco */
    --background-dark: #1a1a1a;
    --background-light: #f4f4f4;
    --text-light: #ffffff;
    --text-dark: #333;
    --border-radius: 8px;
    --transition-speed: 0.3s ease;
}

body {
    font-family: 'Open Sans', sans-serif;
    line-height: 1.6;
    color: var(--text-light);
    scroll-behavior: smooth;
    background-color:#000000;
    background-image:
        linear-gradient(rgba(26, 26, 26, 0.85), rgba(26, 26, 26, 0.85)),
        url('img/world.gif');
    background-size: 80vh;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    background-size: cover, 80vh; 
    
    background-position: center, center; /* Ambos centrados */
    background-attachment: fixed;
    background-repeat: no-repeat;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-speed);
}

a:hover {
    color: var(--accent-color);
}

h1, h2, h3 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-light);
}

h2 {
    font-size: 2.5em;
    text-align: center;
    margin-bottom: 50px;
    position: relative;
    padding-bottom: 10px;
}

h2::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

/* Navbar */
.main-header {
    background-color: transparent;
    padding: 15px 0;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: background-color var(--transition-speed);
    border-radius: 8px;
}

.main-header.scrolled {
    background-color: rgba(26, 26, 26, 0.95); /* Fondo oscuro semitransparente al hacer scroll */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.navbar {
    display: grid;
    grid-template-columns: 1fr auto 1fr; 
    align-items: center;
    width: 100%; 
}

.logo {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.8em;
    font-weight: 700;
    color: var(--text-light);
    grid-column: 1; 
    justify-self: start; 
}

.nav-links {
    list-style: none;
    display: flex;
    grid-column: 2; 
    justify-self: center; 
    padding: 0; 
}

.nav-links li {
    margin-left: 30px;
}

.nav-links a {
    color: var(--text-light);
    font-weight: 400;
    font-size: 1.1em;
    position: relative;
    padding-bottom: 5px;
}

.nav-links a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-color);
    transition: width var(--transition-speed);
}

.nav-links a:hover::after {
    width: 100%;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 25px;
    border-radius: var(--border-radius);
    font-weight: 600;
    text-align: center;
    transition: all var(--transition-speed);
    cursor: pointer;
    margin-right: 15px; /* Espacio entre botones */
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--text-light);
    border: 2px solid var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: var(--text-dark);
    transform: translateY(-3px);
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: var(--text-light);
    transform: translateY(-3px);
}

.btn-outline {
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 8px 18px;
    font-size: 0.9em;
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: var(--text-light);
}

section {
    padding: 100px 0;
}

/* Hero Section */
.hero-section {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    background-color: transparent; /* Transparente para ver el fondo body */
    padding: 100px 20px 50px 20px; 
}

/* Typed.js Cursor */
.typed-cursor {
    opacity: 1;
    -webkit-animation: blink 0.7s infinite;
    -moz-animation: blink 0.7s infinite;
    animation: blink 0.7s infinite;
}
@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0; }
    100% { opacity: 1; }
}

/* About Section */
.about-section {
    padding: 100px 0; 
    text-align: center; 
}

.about-content {
    background-color: rgba(44, 44, 44, 0.85);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    color: var(--text-light);
    padding: 100px 20px; 
    border-radius: 20px;
    box-shadow: 
        0 0 15px rgba(106, 13, 173, 0.6),
        0 0 30px rgba(106, 13, 173, 0.4),
        0 0 45px rgba(255, 193, 7, 0.3);
    animation: electricGlow 4s infinite alternate ease-in-out;
    margin: 0 auto; 
    max-width: 1200px; 
    width: calc(100% - 40px); 
}

.about-section p {
    font-size: 1.1em;
    margin-bottom: 20px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Skills Section */
.skills-section {
    text-align: center;
}

.skills-section .container {
    background-color: rgba(44, 44, 44, 0.85); 
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px); 
    
    padding-top: 100px; 
    padding-bottom: 100px;
    border-radius: 20px; 
    
    box-shadow: 
        0 0 15px rgba(106, 13, 173, 0.6),
        0 0 30px rgba(106, 13, 173, 0.4),
        0 0 45px rgba(255, 193, 7, 0.3);
    animation: electricGlow 4s infinite alternate ease-in-out;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.skill-item {
    background-color: #2c2c2c;
    padding: 30px 20px;
    border-radius: var(--border-radius);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.skill-item:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.skill-item .skill-icon {
    font-size: 3.5em;
    color: var(--primary-color);
    margin-bottom: 15px;
    animation: pulse 2s infinite ease-in-out;
}

.skill-item h3 {
    font-size: 1.5em;
    margin-bottom: 10px;
    color: var(--text-light);
}

.skill-item p {
    font-size: 0.95em;
    color: #bbb;
}

/* Projects Section */
.projects-section {
    padding: 100px 0; 
}

.projects-content {
    background-color: rgba(44, 44, 44, 0.85);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    color: var(--text-light);
    padding: 100px 20px; 
    padding-bottom: 150px; 
    border-radius: 30px;
    box-shadow: 
        0 0 15px rgba(106, 13, 173, 0.6),
        0 0 30px rgba(106, 13, 173, 0.4),
        0 0 45px rgba(255, 193, 7, 0.3);
    animation: electricGlow 4s infinite alternate ease-in-out;
    margin: 0 auto; 
    max-width: 1200px; 
    width: calc(100% - 40px); 
}

.projects-grid {
    display: flex;         
    flex-wrap: wrap;        
    justify-content: flex-start;  
    gap: 40px;              
    margin-top: 50px;
}

.project-card {
    background-color: var(--background-dark);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    width: 350px;
}

.project-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.project-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 1px solid #333;
}

.project-card h3 {
    padding: 20px 20px 0;
    font-size: 1.8em;
    color: var(--primary-color);
}

.project-card p {
    padding: 0 20px 20px;
    font-size: 1em;
    flex-grow: 1; 
    color: #ccc;
}

.project-links {
    padding: 0 20px 20px;
    display: flex;
    gap: 10px;
    justify-content: center; 
}


/* Contact Section */
.contact-section {
    background-color: transparent;
    text-align: center;
}

.contact-card {
    background-color: rgba(44, 44, 44, 0.85);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: var(--border-radius);
    max-width: 600px;
    margin: 50px auto 0;
    box-shadow: 
        0 0 15px rgba(106, 13, 173, 0.6),
        0 0 30px rgba(106, 13, 173, 0.4),
        0 0 45px rgba(255, 193, 7, 0.3);
    animation: electricGlow 4s infinite alternate ease-in-out;
}

.contact-card h3 {
    font-size: 2em;
    color: var(--primary-color);
    margin-bottom: 25px;
}

.contact-card p {
    margin-bottom: 30px;
    font-size: 1.1em;
    color: #ccc;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid #555;
    border-radius: var(--border-radius);
    background-color: #3a3a3a;
    color: var(--text-light);
    font-size: 1em;
    transition: border-color var(--transition-speed);
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(106, 13, 173, 0.3);
}

.contact-form textarea {
    resize: vertical;
}

.contact-form button {
    width: auto;
}


.social-links {
    margin-top: 0px;
}

.social-links a {
    margin: 0 10px;
    color: var(--text-light);
    font-size: 1.3em; 
    transition: color var(--transition-speed), transform var(--transition-speed);
}

.social-links a:last-child {
    margin-right: 0; 
}

.social-links a:hover {
    color: var(--primary-color);
    transform: translateY(-5px);
}

/* Footer */
.main-footer {
    background-color: #111;
    color: #aaa;
    text-align: center;
    padding: 40px 0;
    font-size: 0.9em;
}

.main-footer p {
    margin-bottom: 10px;
}

.form-footer {
    display: flex;
    justify-content: space-between; 
    align-items: center;          
    width: 100%;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* ===================
   TARJETA DE PERFIL
   =================== */

.profile-card-container {
    z-index: 2;
    width: 100%;
    max-width: 420px; 
    /* Eliminamos el 'animation: fadeIn' aquí porque usaremos la clase spring-up */
}

.profile-card {
    background-color: rgba(44, 44, 44, 0.85); /* Fondo opaco */
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    overflow: hidden;
    width: 100%;
    text-align: center;
    position: relative;
    transition: transform 0.3s ease;
    box-shadow: 
        0 0 15px rgba(106, 13, 173, 0.6),
        0 0 30px rgba(106, 13, 173, 0.4),
        0 0 45px rgba(255, 193, 7, 0.3);
    animation: electricGlow 4s infinite alternate ease-in-out;
}

.profile-card:hover {
    transform: translateY(-5px) scale(1.01);
}

.profile-card__header {
    height: 120px;
    background: url('img/technology-1283624_640.webp') no-repeat center center;
    background-size: cover; 
    border-top-left-radius: 18px;  
    border-top-right-radius: 18px;
}

.profile-card__image {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    border: 5px solid var(--background-dark); 
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    margin: -90px auto 0 auto; 
    position: relative;
    z-index: 3;
    background-color: var(--background-dark); 
}

.profile-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 35% center; 
}

.profile-card__content {
    padding: 25px 25px 0 25px;
    margin-top: -10px; 
}

.profile-card__name {
    font-size: 2.2em;
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 5px;
}

.profile-card__title {
    font-size: 1.2em;
    font-weight: 300;
    color: var(--primary-color); 
    min-height: 30px; 
    margin-bottom: 10px;
}

.profile-card__location {
    font-size: 1em;
    color: #aaa;
    margin-bottom: 20px;
}

.profile-card__location i {
    margin-right: 5px;
    color: var(--primary-color);
}

.profile-card__stats {
    display: flex;
    justify-content: space-around;
    padding: 20px;
    background-color: rgba(0, 0, 0, 0.2); 
    border-top: 1px solid #444;
    border-bottom: 1px solid #444;
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat__value {
    font-size: 1.5em;
    font-weight: 700;
    color: var(--text-light);
}

.stat__label {
    font-size: 0.9em;
    color: #aaa;
    text-transform: uppercase;
}

.profile-card__actions {
    padding: 25px;
    display: flex;
    flex-direction: column; 
    gap: 15px; 
}


.profile-card__actions .btn {
    width: 100%;
    margin: 0; 
}

/*Arreglos para dispositivos móviles <3 */
@media (max-width: 768px) {
    .navbar {
        display: flex;
        flex-direction: column;
        padding: 15px 0;
    }
    .logo {
        grid-column: auto;
        justify-self: center;
    }
    .nav-links {
        grid-column: auto;
        justify-self: center;
        margin-top: 15px;
        flex-wrap: wrap; 
        justify-content: center;
    }
    .nav-links li {
        margin: 5px 10px;
    }
    
    .projects-section {
        height: auto !important; 
        padding-bottom: 50px;
        overflow: visible !important; 
    }
    .projects-content {
        width: 100% !important; 
        padding: 20px 10px !important; 
        box-sizing: border-box;
    }
    .projects-grid {
        grid-template-columns: 1fr;
        height: auto; 
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
    }
    .project-card {
        width: 100% !important;
        max-width: 100% !important; 
        margin: 0 0 30px 0 !important; 
        box-sizing: border-box;
    }
    .project-card img {
        width: 100%;
        height: auto; 
    }

    .contact-card {
        padding: 30px 20px;
    }
    .form-footer {
        flex-direction: column; 
        align-items: center; 
        gap: 30px; 
    }
    .contact-form button {
        width: 100%; 
    }
    .social-links {
        margin-top: 0; 
    }
    .social-links a {
        font-size: 2em; 
        margin: 0 15px; 
    }

    .main-footer {
        display: block; 
        padding: 40px 20px;
        position: relative;
    }

    .btn {
        width: auto;
        margin-bottom: 0;
    }

    .profile-card__actions .btn {
        width: 100%;
    }
}

/* Animación para el efecto de borde */
@keyframes electricGlow {
    0% {
        box-shadow: 
            0 0 15px rgba(106, 13, 173, 0.6),
            0 0 30px rgba(106, 13, 173, 0.4),
            0 0 45px rgba(255, 193, 7, 0.3);
    }
    50% {
        box-shadow: 
            0 0 20px rgba(106, 13, 173, 0.8),
            0 0 40px rgba(106, 13, 173, 0.5),
            0 0 60px rgba(255, 193, 7, 0.4);
    }
    100% {
        box-shadow: 
            0 0 15px rgba(106, 13, 173, 0.6),
            0 0 30px rgba(106, 13, 173, 0.4),
            0 0 45px rgba(255, 193, 7, 0.3);
    }
}

/* =========================================
   ANIMACIONES "SPRING PHYSICS" (REBOTE)
   ========================================= */

/* Estado inicial: Invisible, desplazado hacia abajo y ligeramente más pequeño */
.spring-up {
    opacity: 0;
    transform: translateY(80px) scale(0.95); 
    /* Magia: Curva spring */
    transition: 
        opacity 0.8s ease-out,
        transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1); 
}

/* Estado final (cuando el JS añade la clase .active) */
.spring-up.active {
    opacity: 1;
    transform: translateY(0) scale(1); 
}

/* Opcional: Un ligero retraso para elementos secuenciales */
.spring-delay-1 { transition-delay: 0.2s; }
.spring-delay-2 { transition-delay: 0.4s; }