/* Variables de Diseño global */
:root {
    --bg-main: #0f172a;
    --bg-alt: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #10b981;
    --accent-hover: #059669;
    --card-bg: #1e293b;
    --border-color: #334155;
    --font-sans: 'Inter', sans-serif;
    --font-mono: 'Fira Code', monospace;
}

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

html {
    scroll-behavior: smooth;
}

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

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
}

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

.logo {
    font-family: var(--font-mono);
    color: var(--accent);
    font-weight: bold;
    text-decoration: none;
    font-size: 1.2rem;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.3s;
}

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

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 6rem 2rem 2rem 2rem;
}

.hero-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 3rem;
    width: 100%;
}

.hero-content {
    flex: 1;
}

.hero-subtitle {
    font-family: var(--font-mono);
    color: var(--accent);
    margin-bottom: 1rem;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 0.5rem;
}

.hero-tech {
    font-size: 2.2rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.hero-description {
    max-width: 650px;
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 2.5rem;
}

.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
}

.btn-primary {
    background-color: var(--accent);
    color: #0f172a;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
}

.contact-item {
    color: var(--text-main);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    padding: 0.6rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: all 0.3s;
}

.contact-item:hover {
    border-color: var(--accent);
    color: var(--accent);
    background-color: rgba(16, 185, 129, 0.05);
}

.hero-image img {
    width: 260px;
    height: 260px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent);
    box-shadow: 0 0 25px rgba(16, 185, 129, 0.25);
    transition: transform 0.5s ease;
}

.hero-image img:hover {
    transform: scale(1.03);
}

/* Secciones Generales */
.section {
    padding: 6rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.bg-alt {
    max-width: 100%;
    background-color: var(--bg-alt);
}

.bg-alt>* {
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    font-size: 2rem;
    margin-bottom: 3rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 50px;
    height: 4px;
    background-color: var(--accent);
}

/* Sobre Mí */
.about-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
}

.about-text p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.about-highlights {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.5rem;
}

.highlight-item {
    background-color: var(--bg-alt);
    padding: 1rem;
    border-radius: 4px;
    border-left: 3px solid var(--accent);
}

.highlight-item i {
    color: var(--accent);
    margin-right: 0.5rem;
}

/* Experiencia */
.timeline {
    border-left: 2px solid var(--border-color);
    padding-left: 2rem;
    margin: 0 auto;
    max-width: 800px;
}

.timeline-item {
    position: relative;
    margin-bottom: 3rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: calc(-2rem - 7px);
    top: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--accent);
}

.timeline-date {
    font-family: var(--font-mono);
    color: var(--accent);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.timeline-content h3 {
    font-size: 1.3rem;
    margin-bottom: 0.25rem;
}

.timeline-content h4 {
    color: var(--text-muted);
    font-weight: 400;
    margin-bottom: 1rem;
}

.timeline-content p {
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

/* Habilidades */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.skill-category {
    background-color: var(--bg-alt);
    padding: 2rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.skill-category h3 {
    margin-bottom: 1.5rem;
    color: var(--accent);
    font-size: 1.2rem;
}

.skill-category ul {
    list-style: none;
}

.skill-category li {
    margin-bottom: 0.75rem;
    color: var(--text-muted);
}

.skill-category li i {
    margin-right: 0.5rem;
    width: 20px;
    text-align: center;
}

/* Proyectos (Reajustado a 3 columnas estables y renderizado nativo de imágenes) */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.project-card {
    background-color: var(--card-bg);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.4s ease, border-color 0.4s ease;
}

.project-card:hover {
    transform: translateY(-6px);
    border-color: var(--accent);
    box-shadow: 0 12px 25px rgba(16, 185, 129, 0.15);
}

.project-img {
    height: 180px;
    background-color: #0f172a;
    overflow: hidden;
}

.project-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 1;
    /* Imagen totalmente nítida y visible al 100% desde el inicio */
    filter: none;
    /* Sin difuminados ni filtros oscuros */
    transition: transform 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* Animación sutil de zoom en la imagen limpia al pasar el cursor */
.project-card:hover .project-img img {
    transform: scale(1.04);
}

.project-info {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.project-info h3 {
    margin-bottom: 0.75rem;
    font-size: 1.2rem;
}

.project-info p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    flex-grow: 1;
    /* El contenedor se adapta de forma fluida al texto sin recortarlo */
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: auto;
}

.project-tags span {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--accent);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

/* Footer */
footer {
    text-align: center;
    padding: 2.5rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Media Queries Responsivo */
@media (min-width: 1024px) {
    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
        /* Volvemos estrictamente a 3 columnas por fila en pantallas grandes */
    }
}

@media (max-width: 768px) {
    .hero-container {
        flex-direction: column-reverse;
        text-align: center;
        gap: 2rem;
    }

    .hero-buttons {
        justify-content: center;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-tech {
        font-size: 1.6rem;
    }

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

    .nav-links {
        display: none;
    }

    .menu-toggle {
        display: block;
    }
}