/* ================================
   VARIABLES
   ================================ */
:root {
    --bg-primary: #0a0e12;
    --bg-secondary: #111519;
    --bg-card: #151a1f;
    --text-primary: #e8eaed;
    --text-secondary: #9ca3af;
    --accent: #10b981;
    --accent-dark: #059669;
    --accent-light: #34d399;
    --border: #1f2937;
    --code-bg: #0d1117;
}

/* ================================
   RESET & BASE STYLES
   ================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Sora', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ================================
   UTILITIES
   ================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ================================
   HEADER & NAVIGATION
   ================================ */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(10, 14, 18, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    animation: slideDown 0.6s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

.logo {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--accent);
}

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

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 400;
    transition: color 0.3s ease;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s ease;
}

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

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

/* ================================
   HERO SECTION
   ================================ */

.hero {
    margin-top: 80px;
    padding: 8rem 0 6rem;
    position: relative;
}

.hero-content {
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

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

.hero-tag {
    display: inline-block;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
    color: var(--accent);
    background: rgba(16, 185, 129, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    border: 1px solid rgba(16, 185, 129, 0.2);
    margin-bottom: 2rem;
}

h1 {
    font-size: 4rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-weight: 300;
}

.hero-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin-bottom: 3rem;
    line-height: 1.8;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Foto perfil*/
.hero-image {
    order: 2;
    animation: fadeInScale 1s ease-out 0.4s both;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Hero layout con foto */
.hero-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-image {
    order: 2; /* Foto a la derecha */
}

.hero-image img {
    width: 100%;
    max-width: 400px;
    height: auto;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(16, 185, 129, 0.2);
    border: 3px solid var(--accent);
    transition: transform 0.3s ease;
}

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

/* Responsive */
@media (max-width: 768px) {
    .hero-wrapper {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .hero-image {
        order: 1; /* Foto arriba en móvil */
        text-align: center;
    }
    
    .hero-image img {
        max-width: 250px;
    }
}
/* ================================
   BUTTONS
   ================================ */
.btn {
    padding: 1rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--accent);
    color: var(--bg-primary);
    border: 2px solid var(--accent);
}

.btn-primary:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.2);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/*Button CV*/

.about-actions {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
}

.download-cv-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1.5rem;
    background: rgba(34, 197, 94, 0.1);
    border: 1.5px solid #10b981; /* 👈 Verde consistente */
    border-radius: 8px;
    color: #10b981; /* 👈 Verde consistente */
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    
    /* Animación de entrada */
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
    animation-delay: 0.3s;
}

/* 👇 HOVER MEJORADO - se ve el texto */
.download-cv-btn:hover {
    background: #10b981; /* Fondo verde */
    color: #0a0e15; /* Texto gris muy oscuro pero legible */
    border-color: #10b981;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

.download-cv-btn svg {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
}

/* El ícono también cambia de color en hover */
.download-cv-btn:hover svg {
    transform: translateY(2px);
    stroke: #0a0e15; /* Ícono oscuro cuando hace hover */
}

/* Animación */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ================================
   SECTIONS
   ================================ */
section {
    padding: 6rem 0;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.section-title::before {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--accent);
    border-radius: 2px;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 4rem;
    margin-top: 1.5rem;
}

/* ================================
   PROJECTS SECTION
   ================================ */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.project-card:hover::before {
    transform: scaleX(1);
}

.project-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.project-header {
    margin-bottom: 1.5rem;
}

.project-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.project-year {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.project-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tech-tag {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    padding: 0.4rem 0.8rem;
    background: var(--code-bg);
    color: var(--accent);
    border-radius: 6px;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

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

.project-link {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    transition: color 0.3s ease;
}

.project-link:hover {
    color: var(--accent-light);
}

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

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

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

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

.skill-list li {
    padding: 0.7rem 0;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.skill-list li:last-child {
    border-bottom: none;
}

.skill-list li::before {
    content: '▹';
    color: var(--accent);
    font-weight: bold;
}

/* ================================
   ABOUT SECTION
   ================================ */
.about-content {
    max-width: 900px;
    margin: 0 auto;
}

.about-text {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.9;
    margin-bottom: 2rem;
}

.education-list {
    list-style: none;
    margin-top: 3rem;
}

.education-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 8px;
}

.education-item h4 {
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.education-item p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ================================
   CONTACT SECTION
   ================================ */
.contact-content {
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
}

.contact-text {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    line-height: 1.8;
}

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

.social-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-link:hover {
    border-color: var(--accent);
    background: rgba(16, 185, 129, 0.1);
    transform: translateY(-3px);
}

/* ================================
   FOOTER
   ================================ */
footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 3rem 0;
    text-align: center;
}

footer p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ================================
   ANIMATIONS
   ================================ */
.fade-in {
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ================================
   RESPONSIVE DESIGN
   ================================ */
@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

    .hero-description {
        font-size: 1rem;
    }

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

    .nav-links {
        display: none;
    }

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

    nav {
        padding: 1rem;
    }

    .container {
        padding: 0 1rem;
    }
    
    .cta-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 2rem;
    }
    
    .hero {
        padding: 6rem 0 4rem;
    }
    
    section {
        padding: 4rem 0;
    }
    
    .project-card {
        padding: 1.5rem;
    }
}

/* ================================
   MOBILE MENU
   ================================ */
.menu-toggle {
    display: none;
    flex-direction: column;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    gap: 0.4rem;
}

.menu-toggle span {
    width: 25px;
    height: 2px;
    background: var(--text-primary);
    transition: all 0.3s ease;
}

/* Mostrar hamburguesa en mobile */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }
    
    .nav-links {
        display: flex;  /* 👈 AGREGÁ ESTA LÍNEA */
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--bg-primary);
        flex-direction: column;
        padding: 2rem;
        gap: 1.5rem;
        border-top: 1px solid var(--border);
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);  /* 👈 AGREGÁ ESTA LÍNEA (opcional) */
    }
    
    .nav-links.active {
        transform: translateX(0);
    }
    
    /* Animación del icono hamburguesa */
    .menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
}