/* ===========================
   PALETA DE COLORES - MATRIX
   ========================== */

:root {
    --matrix-green: #00ff00;
    --matrix-dark: #0a0e27;
    --matrix-black: #000000;
    --matrix-light-green: #39ff14;
    --matrix-dim-green: #00b300;
    --text-primary: #00ff00;
    --text-secondary: #39ff14;
    --accent: #00ff00;
    --border-color: #00b300;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===========================
   ESTILOS GLOBALES
   ========================== */

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Courier New', monospace;
    background-color: var(--matrix-dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Fondo animado tipo Matrix */
.matrix-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 255, 0, 0.03) 0px,
        rgba(0, 255, 0, 0.03) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    z-index: -1;
    animation: scanlines 8s linear infinite;
}

@keyframes scanlines {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(10px);
    }
}

::selection {
    background-color: var(--matrix-green);
    color: var(--matrix-black);
}

/* ===========================
   BARRA DE NAVEGACIÓN
   ========================== */

.navbar {
    position: sticky;
    top: 0;
    background-color: rgba(10, 14, 39, 0.95);
    border-bottom: 2px solid var(--matrix-green);
    backdrop-filter: blur(10px);
    z-index: 100;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
}

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

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--matrix-green);
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
    letter-spacing: 2px;
}

.brace {
    color: var(--text-secondary);
}

.name {
    color: var(--matrix-green);
    animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% {
        text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
    }
    50% {
        text-shadow: 0 0 20px rgba(0, 255, 0, 0.8), 0 0 30px rgba(57, 255, 20, 0.6);
    }
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.95rem;
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--matrix-green);
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.nav-link:hover {
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.8);
    color: var(--text-secondary);
}

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

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--matrix-green);
    margin: 5px 0;
    transition: 0.3s;
    box-shadow: 0 0 5px rgba(0, 255, 0, 0.6);
}

/* ===========================
   SECCIÓN HERO
   ========================== */

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(0, 255, 0, 0.1) 0%, rgba(0, 0, 0, 0) 50%);
}

.hero::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(0, 255, 0, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translate(-50%, -50%) translateY(0);
    }
    50% {
        transform: translate(-50%, -50%) translateY(-30px);
    }
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.title {
    font-size: 4rem;
    font-weight: bold;
    margin-bottom: 1rem;
    color: var(--matrix-green);
    text-shadow: 0 0 20px rgba(0, 255, 0, 0.8), 0 0 40px rgba(0, 255, 0, 0.5);
    animation: titleGlow 3s ease-in-out infinite;
}

@keyframes titleGlow {
    0%, 100% {
        text-shadow: 0 0 20px rgba(0, 255, 0, 0.8), 0 0 40px rgba(0, 255, 0, 0.5);
    }
    50% {
        text-shadow: 0 0 30px rgba(57, 255, 20, 0.8), 0 0 50px rgba(0, 255, 0, 0.6);
    }
}

.subtitle {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    animation: fadeInUp 1s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cursor {
    display: inline-block;
    font-size: 2rem;
    color: var(--matrix-green);
    animation: blink 1s infinite;
    margin-left: 10px;
}

@keyframes blink {
    0%, 49% {
        opacity: 1;
    }
    50%, 100% {
        opacity: 0;
    }
}

/* ===========================
   SECCIONES GENERALES
   ========================== */

.section {
    padding: 5rem 2rem;
    position: relative;
}

.section:nth-child(odd) {
    background: linear-gradient(180deg, transparent 0%, rgba(0, 255, 0, 0.05) 50%, transparent 100%);
}

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

.section-title {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    text-align: center;
    color: var(--matrix-green);
    text-shadow: 0 0 20px rgba(0, 255, 0, 0.6);
    position: relative;
    z-index: 2;
}

.bracket {
    color: var(--text-secondary);
    font-weight: bold;
}

/* ===========================
   SECCIÓN SOBRE MÍ
   ========================== */

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

/* Contenedor de perfil (foto + bio) */
.profile {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.about-photo {
    width: 160px;
    height: 160px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid var(--matrix-green);
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.5), inset 0 0 10px rgba(0, 255, 0, 0.15);
    background: radial-gradient(circle at 30% 30%, rgba(57,255,20,0.08), transparent 40%);
}

.bio {
    flex: 1;
}

@media (max-width: 768px) {
    .profile {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .about-photo {
        width: 140px;
        height: 140px;
    }
}

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

.text-glow {
    color: var(--text-primary);
    font-size: 1.1rem;
    line-height: 1.8;
    padding: 1rem;
    border-left: 3px solid var(--matrix-green);
    border-radius: 5px;
    background: rgba(0, 255, 0, 0.05);
    transition: all 0.3s ease;
    margin-bottom: 0; /* Removed global margin-bottom */
}

.text-glow:hover {
    background: rgba(0, 255, 0, 0.1);
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.3);
    transform: translateX(10px);
}

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

.skills-title {
    color: var(--text-secondary);
    font-size: 1.3rem;
    text-shadow: 0 0 10px rgba(57, 255, 20, 0.5);
}

.skills-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.skill-item {
    padding: 1rem;
    background: rgba(0, 255, 0, 0.1);
    border: 2px solid var(--matrix-green);
    border-radius: 5px;
    color: var(--text-primary);
    text-align: center;
    font-weight: bold;
    transition: all 0.3s ease;
    cursor: default;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.2);
}

.skill-item:hover {
    background: rgba(0, 255, 0, 0.2);
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.5);
    transform: translateY(-5px);
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.8);
}

/* ===========================
   SECCIÓN EXPERIENCIA
   ========================== */

.experience-items {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.experience-item {
    padding: 2rem;
    background: linear-gradient(135deg, rgba(0, 255, 0, 0.05) 0%, transparent 100%);
    border: 2px solid var(--matrix-green);
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.2), inset 0 0 15px rgba(0, 255, 0, 0.05);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.experience-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 0, 0.2), transparent);
    transition: left 0.5s ease;
}

.experience-item:hover {
    box-shadow: 0 0 25px rgba(0, 255, 0, 0.5), inset 0 0 15px rgba(0, 255, 0, 0.1);
    transform: translateX(10px);
}

.experience-item:hover::before {
    left: 100%;
}

.exp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.exp-title {
    color: var(--text-secondary);
    font-size: 1.3rem;
}

.exp-date {
    color: var(--matrix-dim-green);
    font-size: 0.9rem;
    background: rgba(0, 255, 0, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid var(--matrix-dim-green);
}

.exp-company {
    color: var(--matrix-dim-green);
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.exp-description {
    color: var(--text-primary);
    line-height: 1.7;
}

/* ===========================
   SECCIÓN PROYECTOS
   ========================== */

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.project-card {
    padding: 2rem;
    background: linear-gradient(135deg, rgba(0, 255, 0, 0.08) 0%, rgba(0, 180, 0, 0.02) 100%);
    border: 2px solid var(--matrix-green);
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.project-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0, 255, 0, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-card:hover {
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.6), inset 0 0 15px rgba(0, 255, 0, 0.1);
    transform: translateY(-15px) scale(1.02);
    border-color: var(--text-secondary);
}

.project-card:hover::before {
    opacity: 1;
}

.project-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.project-title {
    color: var(--text-secondary);
    font-size: 1.3rem;
    flex: 1;

/* Espaciado específico entre los dos párrafos dentro de .bio */
.bio .text-glow + .text-glow {
    margin-top: 10px; /* Increased spacing between the two bio paragraphs */
}
}

.project-tag {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    background: rgba(0, 255, 0, 0.2);
    border: 1px solid var(--matrix-green);
    border-radius: 20px;
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: bold;
}

.project-description {
    color: var(--text-primary);
    line-height: 1.6;
    flex-grow: 1;
}

.project-links {
    display: flex;
    gap: 1rem;
}

.project-link {
    color: var(--matrix-green);
    text-decoration: none;
    border: 1px solid var(--matrix-green);
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.project-link:hover {
    background: var(--matrix-green);
    color: var(--matrix-black);
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.7);
}

/* ===========================
   SECCIÓN CONTACTO
   ========================== */

.contact-content {
    max-width: 600px;
    margin: 0 auto;
}

.contact-text {
    text-align: center;
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.form-group {
    display: flex;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    background: rgba(0, 255, 0, 0.05);
    border: 2px solid var(--matrix-green);
    border-radius: 5px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--matrix-dim-green);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    background: rgba(0, 255, 0, 0.1);
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.5), inset 0 0 10px rgba(0, 255, 0, 0.1);
}

.btn-submit {
    padding: 1rem;
    background: linear-gradient(135deg, var(--matrix-green) 0%, var(--text-secondary) 100%);
    border: 2px solid var(--matrix-green);
    color: var(--matrix-black);
    font-weight: bold;
    font-size: 1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.5);
}

.btn-submit:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 30px rgba(0, 255, 0, 0.8), 0 0 20px rgba(57, 255, 20, 0.6);
}

.btn-submit:active {
    transform: translateY(-1px);
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.social-link {
    color: var(--matrix-green);
    text-decoration: none;
    font-weight: bold;
    padding: 0.5rem 1rem;
    border: 2px solid var(--matrix-green);
    border-radius: 5px;
    transition: all 0.3s ease;
}

.social-link:hover {
    background: var(--matrix-green);
    color: var(--matrix-black);
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.7);
}

/* ===========================
   FOOTER
   ========================== */

.footer {
    background: linear-gradient(180deg, rgba(0, 255, 0, 0.05) 0%, transparent 100%);
    border-top: 2px solid var(--matrix-green);
    padding: 2rem;
    text-align: center;
    color: var(--text-primary);
    box-shadow: 0 -10px 30px rgba(0, 255, 0, 0.2);
}

.heart {
    color: var(--matrix-green);
    animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.2);
    }
    50% {
        transform: scale(1);
    }
}

/* ===========================
   RESPONSIVE DESIGN
   ========================== */

@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: rgba(10, 14, 39, 0.98);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        gap: 1rem;
        padding: 2rem 0;
        border-bottom: 2px solid var(--matrix-green);
    }

    .nav-menu.active {
        left: 0;
    }

    .title {
        font-size: 2.5rem;
    }

    .subtitle {
        font-size: 1.2rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .about-content {
        grid-template-columns: 1fr;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .exp-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }

    .contact-links {
        flex-direction: column;
        gap: 1rem;
    }
}
