/* --- Variables de Color y Fuentes --- */
:root {
    --bg-color: #0f172a; /* Fondo azul muy oscuro */
    --surface-color: #1e293b; /* Fondo de tarjetas */
    --text-main: #f8fafc; /* Texto principal claro */
    --text-muted: #94a3b8; /* Texto secundario */
    --accent-color: #10b981; /* Verde esmeralda para destacar */
    --font-sans: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* --- Reseteo Básico --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth; /* Desplazamiento suave al hacer clic en los enlaces */
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
}

/* --- Barra de Navegación --- */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 5%;
    background-color: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent-color);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--accent-color);
}

/* --- Sección Hero --- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    /* Agregamos padding superior para evitar que el menú tape el título */
    padding: 8rem 10% 4rem; 
}

.hero-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4rem;
    max-width: 1200px; /* Ampliado para dar espacio a la imagen */
    margin: 0 auto;
    width: 100%;
    /* Permite que la imagen baje suavemente si la pantalla es estrecha */
    flex-wrap: wrap; 
}

.hero-text {
    /* Le damos un tamaño base flexible para que no se aplaste */
    flex: 1 1 500px; 
    max-width: 650px;
}

.hero-image {
    flex: 1 1 350px; 
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-image img {
    width: 100%;
    max-width: 480px; 
    height: auto;
    object-fit: contain; 
    filter: drop-shadow(0 20px 30px rgba(16, 185, 129, 0.2)); 
    animation: float 6s ease-in-out infinite; 
}

/* Animación Flotante */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
    100% { transform: translateY(0px); }
}

.subtitle {
    color: var(--accent-color);
    font-family: monospace;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.hero h1 {
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: 0.5rem;
}

.role {
    font-size: 2.2rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.bio {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 2.5rem;
}

/* --- Botones --- */
.btn-primary, .btn-outline {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--accent-color);
    color: var(--bg-color);
}

.btn-primary:hover {
    background-color: #059669;
    transform: translateY(-2px);
}

.btn-outline {
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    background: transparent;
}

.btn-outline:hover {
    background-color: rgba(16, 185, 129, 0.1);
}

/* --- Sección de Proyectos --- */
.projects-section {
    padding: 6rem 10%;
}

.section-title {
    font-size: 2rem;
    margin-bottom: 3rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.section-title::after {
    content: "";
    height: 1px;
    background-color: var(--surface-color);
    flex-grow: 1;
    max-width: 300px;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

/* --- Ajuste para Tarjetas Enlazables --- */
a.project-card {
    text-decoration: none;
    color: inherit;
    display: block;
    cursor: pointer;
}

.project-card {
    background-color: var(--surface-color);
    border-radius: 8px;
    padding: 0; /* Ajustado para las imágenes */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid transparent;
    overflow: hidden; 
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
    box-shadow: 0 10px 30px -15px rgba(2, 12, 27, 0.7);
}

/* --- Estilos para las Imágenes en Tarjetas (index.html) --- */
.project-image {
    width: 100%;
    height: 200px; 
    background-color: #334155; 
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; 
    transition: transform 0.5s ease;
}

.project-card:hover .project-image img {
    transform: scale(1.05); 
}

.project-content {
    padding: 2rem; 
    flex-grow: 1;
}

.project-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.project-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.tech-stack span {
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--accent-color);
}

/* --- Contacto y Footer --- */
.contact-section {
    padding: 6rem 10%;
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.contact-section p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.contact-section .section-title {
    justify-content: center;
}
.contact-section .section-title::after {
    display: none;
}

footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-family: monospace;
}

/* --- Responsividad (Móviles y Tablets) --- */
@media (max-width: 992px) {
    .hero {
        /* Evita que el contenido se centre y se corte por arriba en celulares/laptops pequeñas */
        align-items: flex-start; 
        padding-top: 8rem;
    }
    .hero-container {
        flex-direction: column; /* El texto se queda arriba, la ilustración baja */
        text-align: left; 
        gap: 3rem;
    }
    .hero-text { 
        display: flex; 
        flex-direction: column; 
        align-items: flex-start;
    }
    .hero-image img { 
        max-width: 380px; /* Reducimos la ilustración un poco para que no estorbe */
    }
}

/* --- Ajustes de Botones Hero --- */
.hero-buttons {
    display: flex;
    gap: 1.5rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

/* --- Sección Sobre Mí (Terminal) --- */
.about-section {
    padding: 2rem 10% 6rem;
}

.terminal-container {
    max-width: 850px;
    margin: 0 auto;
    background-color: #050505; /* Fondo negro profundo */
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    overflow: hidden;
    border: 1px solid #334155;
}

.terminal-header {
    background-color: #1e293b;
    padding: 0.8rem 1rem;
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid #334155;
}

.terminal-header .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot.red { background-color: #ef4444; }
.dot.yellow { background-color: #f59e0b; }
.dot.green { background-color: #10b981; }

.terminal-body {
    padding: 2rem;
    font-family: 'Courier New', Courier, monospace; /* Fuente de código */
    font-size: 0.95rem;
    line-height: 1.6;
    color: #cbd5e1;
}

.terminal-body p {
    margin-bottom: 0.5rem;
}

.prompt {
    color: var(--accent-color);
    font-weight: bold;
    margin-right: 0.5rem;
}

.output {
    color: #94a3b8;
    margin-bottom: 2rem;
    padding-left: 1rem;
    border-left: 2px solid #334155;
}

.keyword {
    color: #3b82f6; /* Azul técnico para resaltar habilidades */
    font-weight: bold;
}

.cursor {
    color: var(--accent-color);
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* --- Ajuste responsivo para el contenedor de botones --- */
@media (max-width: 992px) {
    .hero-buttons {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .hero h1 { font-size: 2.5rem; }
    .role { font-size: 1.6rem; }
    .nav-links { display: none; }
    
    /* Centramos todo solo cuando ya es un celular (pantalla muy chica) */
    .hero-container { text-align: center; }
    .hero-text { align-items: center; }
    
    .hero { padding-left: 5%; padding-right: 5%; }
    .projects-section, .contact-section { padding-left: 5%; padding-right: 5%; }
}