/* --- Variables Globales y Estilos Base --- */
:root {
    --primary-color: #00ff41; /* Verde neón */
    --secondary-color: #00d4ff; /* Cian */
    --background-color: #0a0a0a;
    --surface-color: #1a1a1a;
    --text-color: #e0e0e0;
    --heading-font: 'Courier New', Courier, monospace;
    --body-font: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--body-font);
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

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

h1, h2, h3 {
    font-family: var(--heading-font);
    color: var(--primary-color);
    margin-bottom: 20px;
}

h2 {
    font-size: 2.5rem;
    text-align: center;
    position: relative;
    padding-bottom: 15px;
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: var(--primary-color);
}

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

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

/* --- Navegación --- */
header {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 15px 0;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo {
    font-family: var(--heading-font);
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

nav ul {
    list-style: none;
    display: flex;
    gap: 25px;
}

nav ul a {
    font-weight: bold;
    font-size: 1rem;
}

/* --- Sección 1: Home --- */
#home {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-content h1 {
    font-size: 3.5rem;
    color: #fff;
}

.hero-content p {
    font-size: 1.5rem;
    font-family: var(--heading-font);
    min-height: 2em; /* Evita saltos de layout */
}

.typing-text .typed {
    border-right: 3px solid var(--primary-color);
    animation: blink-cursor 0.75s step-end infinite;
}

@keyframes blink-cursor {
    from, to { border-color: transparent; }
    50% { border-color: var(--primary-color); }
}

.cta-button {
    display: inline-block;
    margin-top: 30px;
    padding: 12px 30px;
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    font-family: var(--heading-font);
    font-size: 1.1rem;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.cta-button:hover {
    color: var(--background-color);
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background-color: var(--primary-color);
    transition: left 0.3s ease;
    z-index: -1;
}

.cta-button:hover::before {
    left: 0;
}

.background-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle, var(--primary-color) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: background-move 60s linear infinite;
    opacity: 0.05;
}

@keyframes background-move {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

/* --- Sección 2: Sobre Mí --- */
.about-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    align-items: center;
}

.about-img img {
    width: 100%;
    max-width: 300px;
    border-radius: 10px;
    border: 3px solid var(--primary-color);
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.3);
}

.skills ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 10px;
}

.skills li {
    background-color: var(--surface-color);
    padding: 5px 15px;
    border-radius: 20px;
    border: 1px solid var(--primary-color);
}

/* --- Sección 3: Servicios --- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.service-card {
    background-color: var(--surface-color);
    padding: 30px;
    border-radius: 10px;
    border-left: 5px solid var(--primary-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0, 255, 65, 0.2);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

/* --- Sección 4: Proyectos --- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.project-card {
    background-color: var(--surface-color);
    padding: 25px;
    border-radius: 10px;
    border-top: 2px solid var(--primary-color);
}

.tech-tag {
    display: inline-block;
    background-color: #333;
    color: var(--primary-color);
    padding: 3px 10px;
    border-radius: 5px;
    font-size: 0.8rem;
    margin-right: 10px;
    margin-top: 10px;
}

/* --- Sección 5: Contacto --- */
.contact-form {
    max-width: 600px;
    margin: 40px auto 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 15px;
    background-color: var(--surface-color);
    border: 1px solid #444;
    color: var(--text-color);
    border-radius: 5px;
    font-family: var(--body-font);
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.2);
}

/* --- Footer --- */
footer {
    text-align: center;
    padding: 30px 20px;
    background-color: var(--surface-color);
    border-top: 1px solid #333;
}

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

.social-links a {
    margin: 0 15px;
}

/* --- Animaciones al hacer Scroll --- */
.hidden {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.hidden.show {
    opacity: 1;
    transform: translateY(0);
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
    nav ul {
        flex-direction: column;
        gap: 10px;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .hero-content p {
        font-size: 1.2rem;
    }

    h2 {
        font-size: 2rem;
    }

    .about-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .about-img {
        order: -1; /* Pone la imagen arriba en móvil */
    }

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