/* Premium Portfolio CSS - Diseño Moderno y Elegante */

/* Variables CSS para la paleta de colores premium */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --accent-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --background-primary: #0f172a;
    --background-secondary: #1e293b;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --border-color: rgba(148, 163, 184, 0.1);
    --shadow-primary: rgba(0, 0, 0, 0.25);
    --shadow-secondary: rgba(59, 130, 246, 0.15);
    --glow-blue: rgba(59, 130, 246, 0.3);
    --glow-purple: rgba(147, 51, 234, 0.3);
}

/* Reset y configuración base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

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

/* HERO Optimizado */
.hero-optimized {
    position: relative;
}

.hero-title {
    font-size: clamp(2.8rem, 6vw, 4.75rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.02em;
    background: linear-gradient(to right, #fff, #cbd5e1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: clamp(1rem, 1.4vw, 1.25rem);
    color: #94a3b8;
}

.hero-panel {
    min-height: 340px;
}

.mini-stat {
    text-align: center;
    background: rgba(30,41,59,0.4);
    border: 1px solid rgba(59,130,246,0.2);
    border-radius: 0.75rem;
    padding: 1rem 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.mini-stat .value { font-size: 1.35rem; font-weight: 600; color: #fff; }
.mini-stat .label { font-size: 0.65rem; letter-spacing: .05em; text-transform: uppercase; color: #94a3b8; }

.pill {
    background: rgba(59,130,246,0.15);
    color: #60a5fa;
    border: 1px solid rgba(59,130,246,0.25);
    font-size: .65rem;
    padding: .35rem .65rem;
    border-radius: 999px;
    font-weight: 500;
    letter-spacing: .03em;
}

/* About Optimizado */
.about-optimized {
    position: relative;
}
.about-optimized::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 30%, rgba(59,130,246,0.08), transparent 60%);
    pointer-events: none;
}

.focus-list li { display:flex; align-items: flex-start; }
.focus-list i { margin-top: 2px; }

@media (max-width: 1024px) {
    .hero-optimized { padding-top: 8rem; }
}

@media (max-width: 640px) {
    .hero-title { font-size: 2.4rem; }
    .hero-panel { min-height: auto; }
}

/* Animaciones de fondo */
@keyframes blob {
    0% { transform: translate(0px, 0px) scale(1); }
    33% { transform: translate(30px, -50px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
    100% { transform: translate(0px, 0px) scale(1); }
}

.animate-blob {
    animation: blob 7s infinite;
}

.animation-delay-2000 {
    animation-delay: 2s;
}

.animation-delay-4000 {
    animation-delay: 4s;
}

/* Navegación */
.nav-link {
    color: #cbd5e1;
    text-decoration: none;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: #ffffff;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    transition: width 0.3s ease;
}

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

.social-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.5rem;
    background-color: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(51, 65, 85, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-icon:hover {
    color: #ffffff;
    background-color: rgba(51, 65, 85, 0.5);
    border-color: rgba(71, 85, 105, 0.5);
    transform: scale(1.1);
}

/* Hero Section */
.hero-gradient {
    background-size: 200% 200%;
    animation: gradient 3s ease infinite;
}

@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.skill-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    background-color: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(51, 65, 85, 0.5);
    color: #cbd5e1;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.skill-badge:hover {
    border-color: rgba(59, 130, 246, 0.5);
    background-color: rgba(51, 65, 85, 0.5);
}

/* Botones */
.btn-primary {
    display: inline-flex;
    align-items: center;
    padding: 1rem 2rem;
    border-radius: 1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(to right, #3b82f6, #8b5cf6);
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.btn-primary:hover {
    background: linear-gradient(to right, #2563eb, #7c3aed);
    transform: scale(1.05);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    padding: 1rem 2rem;
    border-radius: 1rem;
    font-weight: 600;
    color: white;
    background-color: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(51, 65, 85, 0.5);
    text-decoration: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.btn-secondary:hover {
    background-color: rgba(51, 65, 85, 0.5);
    border-color: rgba(71, 85, 105, 0.5);
    transform: scale(1.05);
}

/* Títulos de sección */
.section-title {
    font-size: 3rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1.5rem;
    background: linear-gradient(to right, #ffffff, #cbd5e1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

@media (min-width: 768px) {
    .section-title {
        font-size: 4rem;
    }
}

/* Tarjetas de cristal */
.glass-card {
    border-radius: 1rem;
    backdrop-filter: blur(16px);
    border: 1px solid rgba(51, 65, 85, 0.5);
    background: linear-gradient(to bottom right, rgba(30, 41, 59, 0.4), rgba(15, 23, 42, 0.4));
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transition: all 0.5s ease;
}

.glass-card:hover {
    box-shadow: 0 25px 50px -12px rgba(59, 130, 246, 0.1);
}

/* Estadísticas */
.stat-card {
    text-align: center;
    padding: 1.5rem;
    border-radius: 0.75rem;
    background-color: rgba(30, 41, 59, 0.3);
    border: 1px solid rgba(51, 65, 85, 0.3);
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-color: rgba(59, 130, 246, 0.3);
}

/* Tecnologías */
.tech-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    border-radius: 0.5rem;
    background-color: rgba(30, 41, 59, 0.3);
    border: 1px solid rgba(51, 65, 85, 0.3);
    text-align: center;
    transition: all 0.3s ease;
}

.tech-item:hover {
    border-color: rgba(59, 130, 246, 0.3);
    background-color: rgba(51, 65, 85, 0.3);
}

.tech-item i {
    font-size: 1.5rem;
}

.tech-item span {
    font-size: 0.875rem;
    color: #cbd5e1;
    font-weight: 500;
}

/* Tarjetas de proyectos */
.project-card {
    border-radius: 1rem;
    backdrop-filter: blur(16px);
    border: 1px solid rgba(51, 65, 85, 0.5);
    background: linear-gradient(to bottom right, rgba(30, 41, 59, 0.4), rgba(15, 23, 42, 0.4));
    overflow: hidden;
    transition: all 0.5s ease;
}

.project-card:hover {
    transform: scale(1.05);
    box-shadow: 0 25px 50px -12px rgba(59, 130, 246, 0.2);
}

.project-header {
    padding: 1.5rem;
    padding-bottom: 1rem;
}

.project-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    background: linear-gradient(to bottom right, rgba(59, 130, 246, 0.2), rgba(147, 51, 234, 0.2));
    border: 1px solid rgba(59, 130, 246, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #60a5fa;
    font-size: 1.25rem;
}

.project-link {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.5rem;
    background-color: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(51, 65, 85, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    text-decoration: none;
    transition: all 0.3s ease;
}

.project-link:hover {
    color: #ffffff;
    background-color: rgba(51, 65, 85, 0.5);
    border-color: rgba(71, 85, 105, 0.5);
}

.project-content {
    padding: 0 1.5rem 1.5rem;
}

.project-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.75rem;
    transition: color 0.3s ease;
}

.project-card:hover .project-title {
    color: #60a5fa;
}

.project-description {
    color: #94a3b8;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tech-tag {
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
    background-color: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

/* Efectos de scroll */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Responsive design mejorado */
@media (max-width: 768px) {
    .section-title {
        font-size: 2.25rem;
    }
    
    .btn-primary,
    .btn-secondary {
        padding: 0.75rem 1.5rem;
        font-size: 0.875rem;
    }
    
    .skill-badge {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
}

/* Scrollbar personalizada */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--background-primary);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #3b82f6, #8b5cf6);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #2563eb, #7c3aed);
}

/* Efectos especiales */
.glow-effect {
    filter: drop-shadow(0 0 20px var(--glow-blue));
}

/* Mejoras de accesibilidad */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles */
a:focus,
button:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Utilidades adicionales */
.backdrop-blur-strong {
    backdrop-filter: blur(20px);
}

.text-gradient {
    background: linear-gradient(to right, #60a5fa, #a855f7);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.border-gradient {
    border-image: linear-gradient(90deg, #3b82f6, #8b5cf6) 1;
}

/* === Ajustes Foto de Perfil (16:9) === */
/* Mejora de centrado, proporción visual y sutil realce sin tocar el HTML */
.my-photo-container {
    max-width: 480px;          /* Limita el ancho para evitar que se estire demasiado */
    margin: 1.75rem auto 0;    /* Centrado horizontal + separación del texto */
    padding: 0 0.5rem;         /* Un pequeño respiro lateral en mobile */
    position: relative;
}

/* Contenedor del marco (el div interior ya existente) */
.my-photo-container > div {
    aspect-ratio: 16 / 9;              /* Refuerza proporción por si un navegador ignora inline */
    width: 100%;
    position: relative;
    background: linear-gradient(to bottom right, rgba(59,130,246,0.15), rgba(147,51,234,0.15));
    backdrop-filter: saturate(1.1) blur(2px);
    transition: box-shadow .5s ease;
}

/* Halo sutil y borde interno */
.my-photo-container > div::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.05), 0 6px 28px -8px rgba(59,130,246,0.35);
    border-radius: inherit;
    opacity: 0.9;
}

/* Imagen */
.my-photo-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(1.05) contrast(1.05);
    transition: transform .6s ease, filter .6s ease;
}

/* Hover elegante */
.my-photo-container:hover img {
    transform: scale(1.025);
    filter: saturate(1.1) contrast(1.08);
}

/* Ajustes responsive finos */
@media (max-width: 640px) {
    .my-photo-container { margin-top: 1.25rem; }
}

/* === Optimizaciones de rendimiento sin perder estética === */
.deferred-section {
    content-visibility: auto; /* Evita renderizar hasta que esté cerca del viewport */
    contain-intrinsic-size: 600px; /* Reserva espacio aproximado para evitar salto */
}

@media (max-width: 640px) {
    /* Menos costo de blur en mobile: sustituir algunos filtros intensos */
    .glass-card { backdrop-filter: blur(10px); }
    .project-card { backdrop-filter: blur(10px); }
    /* Animaciones de blobs desactivadas para reducir repaints */
    .animate-blob { animation: none; opacity: 0.4; }
    /* Sombras más suaves */
    .project-card, .glass-card { box-shadow: 0 12px 28px -10px rgba(0,0,0,0.35); }
}

@media (prefers-reduced-motion: reduce) {
    .animate-blob { animation: none !important; }
    .my-photo-container img { transition: none; }
}

