:root {
    --primary-color: #ff0000;
    --secondary-color: #7d6c6c;
    --accent-color: #ffd2d2;
    --dark-color: #212529;
    --light-color: #f8f9fa;
    --text-color: #333;
    --font-family: 'Poppins', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--text-color);
    background-color: #fff;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Navbar --- */
.navbar {
    background: rgba(255, 255, 255, 1);
    backdrop-filter: blur(10px);
    position: sticky;
    width: 100%;
    top: 0;
    z-index: 1000;
    padding: 1rem 0;
    transition: all 0.3s ease;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-color);
    text-decoration: none;
}

.nav-menu {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--dark-color);
    font-weight: 600;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--primary-color);
}

/* --- Hero Section --- */
/* --- NUEVO HERO SECTION --- */
.hero {
    background-color: #270a0a; /* Un fondo oscuro y elegante */
    color: #fff;
    overflow: hidden; /* Para que las formas animadas no se salgan */
    position: relative;
}

.hero-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: calc(100vh - 80px);
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 20px;
    gap: 4rem;
}

.hero-text {
    flex: 1;
    z-index: 2;
}

.hero-text h1 {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1rem;
}

.hero-text h1 span {
    background: linear-gradient(90deg, #ff0000, #ff5053);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#typewriter {
    font-size: 2rem;
    font-weight: 600;
    color: var(--accent-color);
    min-height: 2.5rem; /* Evita saltos de layout */
    border-right: 3px solid var(--accent-color);
    animation: blink-cursor 0.8s infinite;
}

@keyframes blink-cursor {
    0%, 50% { border-color: var(--accent-color); }
    51%, 100% { border-color: transparent; }
}

.hero-text p {
    font-size: 1.1rem;
    max-width: 500px;
    margin: 1.5rem 0;
    color: #b0b3c1;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

/* --- Elementos Gráficos Animados --- */
.hero-graphics {
    flex: 1;
    position: relative;
    height: 600px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.floating-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.7;
}

.shape-1 {
    width: 300px;
    height: 300px;
    background: linear-gradient(45deg, #ff0000, #ff5053);
    top: 10%;
    right: 10%;
    animation: float 6s ease-in-out infinite;
}

.shape-2 {
    width: 250px;
    height: 250px;
    background: linear-gradient(45deg, #c3a64f, #ff6b6b);
    bottom: 10%;
    left: 5%;
    animation: float 8s ease-in-out infinite reverse;
}

.shape-3 {
    width: 200px;
    height: 200px;
    background: linear-gradient(45deg, #e91e63, #9c27b0);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: float 7s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    33% {
        transform: translateY(-20px) rotate(120deg);
    }
    66% {
        transform: translateY(20px) rotate(240deg);
    }
}

/* --- Botones del Hero --- */
.hero-buttons .btn {
    padding: 14px 32px;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.hero-buttons .btn-primary {
    background: linear-gradient(90deg, #ff0000, #ff5053);
    color: #fff;
    border: none;
}

.hero-buttons .btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 123, 255, 0.3);
}

.hero-buttons .btn-secondary {
    background-color: transparent;
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.hero-buttons .btn-secondary:hover {
    background-color: #fff;
    color: var(--dark-color);
    border-color: #fff;
    transform: translateY(-3px);
}

/* --- Responsive Design Hero --- */
@media screen and (max-width: 968px) {
    .hero-container {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
        min-height: auto;
        padding-top: 4rem;
        padding-bottom: 4rem;
    }

    .hero-text h1 {
        font-size: 2.8rem;
    }
    
    #typewriter {
        font-size: 1.5rem;
    }

    .hero-graphics {
        height: 400px;
        width: 100%;
    }
    
    .shape-1, .shape-2, .shape-3 {
        opacity: 0.4; /
    }
}

@media screen and (max-width: 600px) {
    .hero-text h1 {
        font-size: 2.2rem;
    }
    
    #typewriter {
        font-size: 1.2rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .hero-buttons .btn {
        width: 100%;
        max-width: 300px;
    }
}

/* --- Buttons --- */
.btn {
    padding: 12px 28px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
}

.btn-primary {
    background-color: var(--primary-color);
    color: #fff;
    border: 2px solid var(--primary-color);
}

.btn-primary:hover {
    background-color: transparent;
    color: var(--primary-color);
}

.btn-secondary {
    background-color: transparent;
    color: #fff;
    border: 2px solid #fff;
}

.btn-secondary:hover {
    background-color: #fff;
    color: var(--dark-color);
}

/* --- Sections --- */
.section {
    padding: 80px 0;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    position: relative;
    color: var(--dark-color);
}

.section-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: var(--primary-color);
    margin: 10px auto 0;
    border-radius: 2px;
}

.bg-light {
    background-color: var(--light-color);
}

.bg-dark {
    background-color: var(--dark-color);
    color: #fff;
}

.bg-dark .section-title {
    color: #fff;
}

/* --- About Section --- */
.about-content p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    text-align: center;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* --- Portfolio Section --- */
/* --- ESTILOS DE LA SECCIÓN DE PROYECTOS --- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.project-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.12);
}

.project-image {
    width: 100%;
    height: 220px;
    overflow: hidden;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.project-card:hover .project-image img {
    transform: scale(1.05);
}

.project-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Hace que el contenido ocupe el espacio restante */
}

.project-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.project-type {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary-color);
    background-color: rgba(255, 0, 0, 0.1);
    padding: 4px 10px;
    border-radius: 5px;
    align-self: flex-start;
    margin-bottom: 1rem;
}

.project-description {
    font-size: 1rem;
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
    flex-grow: 1; /* Empuja las etiquetas y el enlace hacia abajo */
}

.project-tech {
    margin-bottom: 1.5rem;
}

.tech-tag {
    display: inline-block;
    background-color: #e9ecef;
    color: #495057;
    padding: 5px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    margin-right: 5px;
    margin-bottom: 5px;
}

.project-link {
    display: inline-block;
    text-decoration: none;
    font-weight: 600;
    color: var(--primary-color);
    position: relative;
    transition: color 0.3s ease;
}

.project-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 0;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.project-link:hover::after {
    width: 100%;
}

/* --- Responsive Design para Proyectos --- */
@media screen and (max-width: 600px) {
    .project-title {
        font-size: 1.3rem;
    }
    .projects-grid {
        grid-template-columns: 1fr;
    }
}

.portfolio-img img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.portfolio-info {
    padding: 1.5rem;
}

.portfolio-info h3 {
    margin-bottom: 0.5rem;
}

.portfolio-info p {
    margin-bottom: 1.5rem;
    color: var(--secondary-color);
}

/* --- Skills Section --- */
.skills {
            background: var(--light-color);
        }
        
        .skills-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 20px;
        }
        
        .skill-category {
            background: rgba(255, 255, 255, 1);
            padding: 25px;
            border-radius: 15px;
            backdrop-filter: blur(10px);
            border: 1px solid rgba(255, 255, 255, 1);
            transition: all 0.3s ease;
        }
        
        .skill-category:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 20px rgba(255, 0, 0, 0.1);
            border-color: var(--primary-color);
        }
        
        .skill-category h3 {
            color:var(--primary-color);
            margin-bottom: 15px;
            font-size: 1.2rem;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        
        .skill-list {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
        }
        
        .skill-item {
            background: rgba(255, 0, 0, 0.5);
            color: #ffffff;
            padding: 6px 12px;
            border-radius: 15px;
            font-size: 0.85rem;
            border: 1px solid rgba(255, 215, 0, 0.2);
}

/* --- Timeline Section --- */
/* --- NUEVO DISEÑO DE EXPERIENCIA (ZIGZAG) --- */
.timeline-zigzag {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr; /* Dos columnas */
    gap: 1rem; /* Espacio entre las tarjetas */
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

.timeline-item {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* La animación se activa con la clase .show del JS */
.timeline-item.show {
    opacity: 1;
    transform: translateY(0);
}

.timeline-content {
    background-color: #fff;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    height: 100%; /* Para que todas las tarjetas tengan la misma altura */
    display: flex;
    flex-direction: column;
}

.timeline-content h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.4rem;
}

.timeline-content h4 {
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.timeline-date {
    color: var(--secondary-color);
    font-size: 0.9rem;
    display: block;
    margin-bottom: 1.5rem;
}

.timeline-content ul {
    list-style: none;
    padding-left: 0;
    margin-top: auto; /* Empuja la lista hacia abajo si hay espacio */
}

.timeline-content ul li {
    margin-bottom: 0.8rem;
    position: relative;
    padding-left: 20px;
    font-size: 0.95rem;
}

.timeline-content ul li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--accent-color);
    font-weight: bold;
}

/* --- Responsive Design para el Timeline Zigzag --- */
@media screen and (max-width: 768px) {
    .timeline-zigzag {
        grid-template-columns: 1fr; /* Una sola columna en móvil */
        gap: 1.5rem;
    }
}

/* --- Education Section --- */
.education-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    text-align: center;
}

.education-item {
    background: #fff;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.education-item h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.education-item span {
    color: var(--secondary-color);
    font-size: 0.9rem;
}

/* --- Contact Section --- */
/* --- NUEVO FOOTER INNOVADOR --- */
.footer-innovador {
    background: linear-gradient(135deg, #0a0e27 0%, #1a1f3a 100%);
    color: #fff;
    padding: 80px 0 20px 0;
    position: relative;
    overflow: hidden;
}

.footer-innovador::before { /* Elemento decorativo de fondo */
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(0, 123, 255, 0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.footer-main-content {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 4rem;
    align-items: center;
    position: relative;
    z-index: 2;
}

.footer-cta h2 {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.footer-cta h2 span {
    background: linear-gradient(90deg, #ff0000, #ff5053);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-cta p {
    font-size: 1.1rem;
    color: #b0b3c1;
    max-width: 400px;
}

.footer-contact h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: #fff;
}

.footer-contact-list {
    list-style: none;
}

.footer-contact-list li {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    color: #b0b3c1;
    font-size: 1.1rem;
}

.footer-contact-list li svg {
    margin-right: 15px;
    color: var(--primary-color);
    flex-shrink: 0; /* Evita que el icono se encoja */
    transition: transform 0.3s ease;
}

.footer-contact-list li a {
    color: #b0b3c1;
    text-decoration: none;
    position: relative;
    transition: color 0.3s ease;
}

.footer-contact-list li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--accent-color);
    transition: width 0.3s ease;
}

.footer-contact-list li:hover a {
    color: #fff;
}

.footer-contact-list li:hover a::after {
    width: 100%;
}

.footer-contact-list li:hover svg {
    transform: scale(1.1);
}

.footer-bottom {
    margin-top: 60px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    color: #8892b0;
    position: relative;
    z-index: 2;
}

.footer-bottom .heart {
    color: #ff6b6b;
    animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* --- Animación de aparición para el footer --- */
.footer-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.footer-animate.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.footer-animate:nth-child(1) { transition-delay: 0.1s; }
.footer-animate:nth-child(2) { transition-delay: 0.2s; }
.footer-contact-list .footer-animate:nth-child(1) { transition-delay: 0.3s; }
.footer-contact-list .footer-animate:nth-child(2) { transition-delay: 0.4s; }
.footer-contact-list .footer-animate:nth-child(3) { transition-delay: 0.5s; }


/* --- Responsive Design para el Footer --- */
@media screen and (max-width: 768px) {
    .footer-main-content {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }

    .footer-cta h2 {
        font-size: 2rem;
    }

    .footer-contact-list {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .footer-contact-list li {
        flex-direction: column;
        text-align: center;
    }

    .footer-contact-list li svg {
        margin-right: 0;
        margin-bottom: 10px;
    }
}

/* --- Animations --- */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeIn 1s ease forwards;
}

.fade-in:nth-child(1) { animation-delay: 0.2s; }
.fade-in:nth-child(2) { animation-delay: 0.4s; }
.fade-in:nth-child(3) { animation-delay: 0.6s; }

@keyframes fadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Responsive Design --- */
@media screen and (max-width: 768px) {
    .hero-content h1 { font-size: 2.5rem; }
    .hero-buttons { flex-direction: column; align-items: center; }
    .nav-menu { flex-direction: column; gap: 1rem; }
    
    .timeline::after { left: 31px; }
    .timeline-item { width: 100%; padding-left: 70px; padding-right: 25px; }
    .timeline-item::before { left: 60px; border: medium solid white; border-width: 10px 10px 10px 0; border-color: transparent white transparent transparent; }
    .left::after, .right::after { left: 21px; }
    .right { left: 0%; }
    
    .contact-content { grid-template-columns: 1fr; }
}

/* --- Menú de Hamburguesa --- */
.hamburger {
    display: none;
    cursor: pointer;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    -webkit-transition: all 0.3s ease-in-out;
    transition: all 0.3s ease-in-out;
    background-color: var(--dark-color);
}

/* --- Estilos Responsive para el Menú --- */
@media screen and (max-width: 768px) {
    .navbar .container {
        position: relative;
    }

    .nav-menu {
        position: fixed;
        left: -100%; /* Lo esconde fuera de la pantalla */
        top: 70px; /* Justo debajo del navbar */
        flex-direction: column;
        background-color: var(--dark-color);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding: 2rem 0;
    }

    .nav-menu.active {
        left: 0; /* Lo desliza hacia adentro */
    }

    .nav-item {
        margin: 1.5rem 0;
    }

    .nav-link {
        color: #fff;
        font-size: 1.2rem;
    }

    .hamburger {
        display: block;
    }

    /* Animación para convertir la hamburguesa en una 'X' */
    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
}