
/* ==========================================================================
   Variables y Configuración Global
   ========================================================================== */
:root {
    --bg-main: #0a0a0a;
    --bg-surface: #141414;
    --bg-card: #1c1c1c;
    --gold-primary: #d4af37;
    --gold-hover: #f3e5ab;
    --text-main: #ffffff;
    --text-muted: #a0a0a0;
    --border-gold: rgba(212, 175, 55, 0.15);
}

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: 'Montserrat', sans-serif; 
}

body { 
    background-color: var(--bg-main); 
    color: var(--text-main); 
    line-height: 1.6; 
}

.container { 
    max-width: 1100px; 
    margin: 0 auto; 
    padding: 0 24px; 
}

/* ==========================================================================
   Encabezado (Hero Section)
   ========================================================================== */
header { 
    padding: 120px 0 60px; 
    border-bottom: 1px solid var(--border-gold); 
}

.hero-title { 
    font-size: 3rem; 
    font-weight: 800; 
    line-height: 1.2; 
    margin-bottom: 20px; 
    letter-spacing: -1px; 
}

.hero-title span { 
    color: var(--gold-primary); 
    background: linear-gradient(to right, #d4af37, #f3e5ab); 
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent; 
}

.hero-subtitle { 
    font-size: 1.15rem; 
    color: var(--text-muted); 
    max-width: 750px; 
    margin-bottom: 35px; 
    font-weight: 300; 
}

/* ==========================================================================
   Etiquetas Globales (Tech Tags)
   ========================================================================== */
.tech-tags span { 
    display: inline-block; 
    background: rgba(212, 175, 55, 0.05); 
    color: var(--gold-primary); 
    padding: 6px 16px; 
    border-radius: 4px; 
    font-size: 0.8rem; 
    margin: 0 8px 8px 0; 
    font-weight: 600; 
    border: 1px solid var(--border-gold); 
}

/* ==========================================================================
   Sección de Proyectos y Grid
   ========================================================================== */
.projects { 
    padding: 80px 0; 
}

.section-title { 

    font-size: 2rem; 
    margin-bottom: 40px; 
    font-weight: 800; 
    letter-spacing: -0.5px; 
}

.section-title::after { 
    content: ''; 
    display: block; 
    width: 50px; 
    height: 3px; 
    background: var(--gold-primary); 
    margin-top: 10px; 
}

.grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); 
    gap: 30px; 
}

/* ==========================================================================
   Tarjetas de Proyecto Dinámicas
   ========================================================================== */
.card { 
    background: var(--bg-card); 
    border-radius: 8px; 
    padding: 35px; 
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1); 
    border: 1px solid rgba(255,255,255,0.03); 
    display: flex; 
    flex-direction: column; 
    justify-content: space-between; 
    margin: 0 10px 0 10px;
}

.card:hover { 
    transform: translateY(-5px); 
    border-color: var(--gold-primary); 
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.05); 
}

.card-header { 
    display: flex; 
    align-items: center; 
    gap: 15px; 
    margin-bottom: 15px; 
}

/* Estilos para los íconos PNG */
.project-main-icon { 
    width: 48px; 
    height: 48px; 
    object-fit: contain; 
    border-radius: 8px; 
    background: rgba(255, 255, 255, 0.03); 
    padding: 6px; 
    border: 1px solid var(--border-gold); 
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5); 
}

.card h3 { 
    font-size: 1.4rem; 
    font-weight: 600; 
}

.metrics { 
    display: flex; 
    gap: 10px; 
    margin-bottom: 20px; 
    flex-wrap: wrap; 
}

.metric { 
    background: rgba(255, 255, 255, 0.05); 
    padding: 4px 10px; 
    border-radius: 4px; 
    font-size: 0.75rem; 
    color: var(--text-muted); 
    font-weight: 600; 
}

.card p { 
    color: var(--text-muted); 
    font-size: 0.95rem; 
    margin-bottom: 25px; 
    font-weight: 300; 
}

/* ==========================================================================
   Enlaces dentro de las Tarjetas
   ========================================================================== */
.card-links { 
    display: flex; 
    gap: 15px; 
    margin-top: 20px; 
    padding-top: 20px; 
    border-top: 1px solid rgba(255,255,255,0.05); 
}

.btn-link { 
    display: inline-flex; 
    align-items: center; 
    gap: 8px; 
    color: var(--text-main); 
    font-size: 0.85rem; 
    font-weight: 600; 
    text-decoration: none; 
    transition: color 0.2s ease; 
}

.btn-link:hover { 
    color: var(--gold-primary); 
}

.btn-link i { 
    color: var(--gold-primary); 
}

/* ==========================================================================
   Pie de página
   ========================================================================== */
footer { 
    text-align: center; 
    padding: 60px 0; 
    color: var(--text-muted); 
    border-top: 1px solid var(--border-gold); 
    font-size: 0.85rem; 
}

/* ==========================================================================
   Media Queries (Móviles)
   ========================================================================== */
@media (max-width: 600px) {
    .hero-title { font-size: 2.2rem; }
    header { padding-top: 60px; }
}


/* ==========================================================================
   ESTILOS ESPECÍFICOS DEL CURRÍCULUM (cv.html)
   ========================================================================== */
.cv-body {
    padding: 60px 20px;
    background-color: var(--bg-main);
}

.cv-container {
    max-width: 850px;
    margin: 0 auto;
    background: var(--bg-surface);
    padding: 60px;
    border-radius: 12px;
    border: 1px solid var(--border-gold);
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

/* Encabezado CV */
.cv-header {
    text-align: center;
    border-bottom: 2px solid var(--gold-primary);
    padding-bottom: 30px;
    margin-bottom: 40px;
}
.cv-name {
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 5px;
    letter-spacing: -1px;
}
.cv-title {
    font-size: 1.2rem;
    color: var(--gold-primary);
    font-weight: 400;
    margin-bottom: 20px;
}
.cv-contact {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    font-size: 0.9rem;
    color: var(--text-muted);
}
.cv-contact span {
    display: flex;
    align-items: center;
    gap: 8px;
}
.cv-contact i { color: var(--gold-primary); }

/* Secciones CV */
.cv-section { margin-bottom: 40px; }
.cv-section-title {
    
    font-size: 1.4rem;
    color: var(--gold-primary);
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 800;
}
.cv-section p {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 15px;
}

/* Trabajos / Experiencia */
.cv-job { margin-bottom: 25px; }
.cv-job-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.cv-job h4 {
    font-size: 1.15rem;
    color: var(--text-main);
}
.cv-date {
    font-size: 0.9rem;
    color: var(--gold-primary);
    font-weight: 600;
}
.cv-job ul {
    list-style: none;
    margin-left: 10px;
}
.cv-job ul li {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 8px;
    position: relative;
    padding-left: 20px;
}
.cv-job ul li::before {
    content: '▹';
    color: var(--gold-primary);
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* Habilidades */
.skill-category {
    color: var(--text-muted);
    margin-bottom: 12px;
    font-size: 0.95rem;
}
.skill-category strong {
    color: var(--text-main);
}

/* Botones flotantes (No se imprimen) */
.btn-download, .btn-back {
    position: fixed;
    top: 20px;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    z-index: 100;
    transition: all 0.3s;
}
.btn-download {
    right: 20px;
    background: var(--gold-primary);
    color: var(--bg-main);
    border: none;
}
.btn-download:hover { background: var(--gold-hover); transform: translateY(-2px); }

.btn-back {
    left: 20px;
    background: var(--bg-surface);
    color: var(--text-main);
    border: 1px solid var(--border-gold);
}
.btn-back:hover { border-color: var(--gold-primary); color: var(--gold-primary); }

/* ==========================================================================
   REGLAS PARA IMPRESIÓN (Generación de PDF Blanco/Negro)
   ========================================================================== */
@media print {
    /* Ocultar botones */
    .no-print { display: none !important; }
    
    /* Invertir colores para que sea papel blanco y letras oscuras */
    body.cv-body { background-color: #fff; padding: 0; }
    .cv-container {
        border: none;
        box-shadow: none;
        padding: 0;
        max-width: 100%;
        background: #fff;
    }
    .cv-name, .cv-job h4, .skill-category strong { color: #000; }
    .cv-title, .cv-section-title, .cv-date, .cv-job ul li::before { color: #333; }
    .cv-contact, .cv-section p, .cv-job ul li, .skill-category { color: #444; }
    .cv-header { border-bottom: 2px solid #333; }
}


/* ==========================================================================
   Media Queries (Optimización 100% Móvil)
   ========================================================================== */
@media (max-width: 768px) {
    /* 1. Ajuste de contenedores para aprovechar toda la pantalla */
    .container { 
        padding: 0 16px; 
    }
    
    /* 2. Encabezado centrado y tipografía ajustada */
    header { 
        padding: 80px 0 40px; 
        text-align: center; 
    }
    
    .hero-title { 
        font-size: 2.2rem; 
        letter-spacing: -0.5px;
    }
    
    .hero-subtitle { 
        font-size: 1rem; 
        margin-bottom: 25px;
        margin-left: auto;
        margin-right: auto;
    }

    /* 3. Etiquetas de tecnología organizadas y centradas */
    .tech-tags {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }
    .tech-tags span { 
        margin: 0; 
        font-size: 0.75rem; 
        padding: 6px 12px;
    }

    /* 4. Títulos de sección centrados */
    .section-title { 
        margin-top: 20px;
        font-size: 1.6rem; 
        text-align: center;
    }
    .section-title::after { 
        margin: 10px auto 0; /* Centra la pequeña línea dorada */
    }

    /* 5. Tarjetas a 1 sola columna y diseño interno centrado */
    .grid { 
        grid-template-columns: 1fr; 
        gap: 20px;
    }

    .card { 
        padding: 25px; 
        text-align: center; /* Centrar textos en tarjetas */
    }

    .card-header {
        flex-direction: column;
        justify-content: center;
        gap: 10px;
    }

    .metrics {
        justify-content: center;
    }

    /* 6. Botones de proyectos amigables para los pulgares (Touch targets) */
    .card-links {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    .btn-link {
        width: 100%;
        justify-content: center;
        padding: 12px;
        background: rgba(255,255,255,0.03);
        border-radius: 8px;
        border: 1px solid rgba(255,255,255,0.05);
        font-size: 0.9rem;
    }

    /* 7. Botón de descargar CV en el Hero */
    .btn-cv-mobile {
        width: 100%;
        justify-content: center;
        padding: 14px;
        margin-top: 20px;
    }

    .profile-img {
        margin: 0 auto 20px auto; /* Centra la imagen en móviles */
    }
}

/* Foto de perfil en el portafolio */
.profile-img {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover; /* Evita que la foto se estire */
    border: 3px solid var(--gold-primary); /* Borde dorado */
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.15); /* Resplandor sutil */
    margin-bottom: 25px;
    display: block;
}



/* ==========================================================================
   Banner de Perfil (Fondo Integrado)
   ========================================================================== */
.hero-banner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 60vh;
    background-color: var(--bg-main); /* Rellena el fondo con el negro de tu web */
    background-image: url('/assets/perfilp.png');
    /* La clave: altura al 100%, ancho automático (no se estira) */
    background-size: auto 100%; 
    background-position: center top; 
    background-repeat: no-repeat;
    z-index: 0;
}
.hero-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* var(--bg-main) es #0a0a0a, transparente es rgba(10,10,10,0) */
    background: linear-gradient(to right, var(--bg-main) 0%, rgba(10,10,10,0) 25%, rgba(10,10,10,0) 75%, var(--bg-main) 100%);
    z-index: 1;
}

/* Degradado Inferior (Funde la parte de abajo hacia el contenido) */
.hero-banner::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(10,10,10,0) 40%, var(--bg-main) 100%);
    z-index: 2;
}

/* Ajuste del Encabezado para que el texto caiga sobre el degradado */
header { 
    position: relative;
    z-index: 1; /* Asegura que el texto esté por encima de la imagen */
    padding: 20vh 0 60px; /* Empuja el texto hacia abajo para mostrar tu rostro */
    border-bottom: none; /* Quitamos la línea para no romper la inmersión */
}