/* ========================================
   ESTILO PROFESIONAL - HACKING ELEGANTE
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #0a0c0f;
    color: #c9d1d9;
    line-height: 1.7;
    min-height: 100vh;
    position: relative;
    font-size: clamp(16px, 1.2vw + 10px, 22px);
}

/* ===== FONDO CON TEXTURA SUTIL ===== */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(88, 166, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(88, 166, 255, 0.02) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: #0a0c0f;
}
::-webkit-scrollbar-thumb {
    background: #1a1e24;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #58a6ff;
}

/* ===== CONTAINER ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px;
    position: relative;
    z-index: 1;
}

/* ===== HERO - DOS COLUMNAS ===== */
.hero {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 48px;
    align-items: center;
    min-height: 60vh;
    padding: 32px 0 48px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    position: relative;
}

/* Línea decorativa con código */
.hero::after {
    content: '/* root@kr3s4l4:~$ whoami */';
    position: absolute;
    bottom: -10px;
    right: 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6rem;
    color: #1a1e24;
    letter-spacing: 1px;
    opacity: 0.4;
}

/* ===== AVATAR CON MARCO NEON ===== */
.hero-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    position: relative;
}

/* Círculo de fondo animado */
.hero-left::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: clamp(200px, 25vw, 320px);
    height: clamp(200px, 25vw, 320px);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(88, 166, 255, 0.06) 0%, transparent 70%);
    animation: pulse-ring 3s ease-in-out infinite;
    z-index: 0;
}

@keyframes pulse-ring {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
    50% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
}

/* Wrapper con borde gradiente NEON */
.hero-avatar-wrapper {
    position: relative;
    z-index: 1;
    padding: 4px;
    border-radius: 50%;
    background: linear-gradient(135deg, #58a6ff, #1f6feb, #238636, #58a6ff);
    background-size: 400% 400%;
    animation: gradient-spin 6s ease-in-out infinite;
    box-shadow: 0 0 40px rgba(88, 166, 255, 0.15);
    transition: all 0.4s ease;
}

.hero-avatar-wrapper:hover {
    box-shadow: 0 0 60px rgba(88, 166, 255, 0.3), 0 0 100px rgba(88, 166, 255, 0.1);
    transform: scale(1.02);
}

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

.hero-avatar {
    width: clamp(120px, 15vw, 200px);
    height: clamp(120px, 15vw, 200px);
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #0a0c0f;
    display: block;
    transition: all 0.4s ease;
    filter: grayscale(0.1) contrast(1.05);
}

.hero-avatar-wrapper:hover .hero-avatar {
    filter: grayscale(0) contrast(1.1);
    transform: scale(1.02);
}

/* Estado */
.hero-status {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(0.5rem, 0.7vw, 0.65rem);
    color: #3fb950;
    background: rgba(63, 185, 80, 0.06);
    padding: 4px 14px;
    border-radius: 12px;
    border: 1px solid rgba(63, 185, 80, 0.08);
}

.hero-status::before {
    content: '● ';
    animation: pulse-dot 1.8s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Redes sociales */
.hero-social {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.hero-social a {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(0.5rem, 0.8vw, 0.7rem);
    padding: 4px 14px;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.04);
    color: #6e7681;
    text-decoration: none;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
}

.hero-social a:hover {
    border-color: #58a6ff;
    color: #58a6ff;
    background: rgba(88, 166, 255, 0.04);
}

/* ===== COLUMNA DERECHA ===== */
.hero-right h1 {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 700;
    margin-bottom: 2px;
    color: #f0f6fc;
    letter-spacing: -0.5px;
}

.hero-right h1 .highlight {
    color: #58a6ff;
    background: none;
    -webkit-text-fill-color: #58a6ff;
    text-shadow: 0 0 40px rgba(88, 166, 255, 0.08);
}

.hero-right .subtitle {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(0.8rem, 1.5vw, 1.3rem);
    color: #6e7681;
    margin-bottom: 12px;
}

.hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 14px;
}

.hero-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(0.5rem, 0.8vw, 0.75rem);
    padding: 3px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.04);
    color: #6e7681;
    background: rgba(255,255,255,0.02);
    transition: all 0.3s ease;
}

.hero-badge:hover {
    border-color: #58a6ff;
    color: #58a6ff;
}

.hero-right .description {
    font-size: clamp(0.9rem, 1.4vw, 1.2rem);
    color: #8b949e;
    max-width: 520px;
    line-height: 1.8;
    font-weight: 300;
    margin-bottom: 18px;
}

.description-highlight {
    color: #58a6ff;
    font-weight: 500;
}

/* ===== BOTONES ===== */
.cta-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn {
    font-family: 'JetBrains Mono', monospace;
    display: inline-block;
    padding: clamp(8px, 0.8vw + 6px, 14px) clamp(18px, 2vw + 10px, 32px);
    border-radius: 5px;
    font-weight: 600;
    font-size: clamp(0.65rem, 0.9vw, 0.9rem);
    text-decoration: none;
    transition: all 0.3s ease;
    letter-spacing: 0.3px;
}

.btn-primary {
    background: #238636;
    color: #ffffff;
    border: 1px solid rgba(46, 160, 67, 0.3);
}

.btn-primary:hover {
    background: #2ea043;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(35, 134, 54, 0.15);
}

.btn-secondary {
    background: transparent;
    color: #c9d1d9;
    border: 1px solid rgba(255,255,255,0.06);
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.03);
    transform: translateY(-2px);
    border-color: #58a6ff;
}

/* ===== SECCIONES ===== */
section {
    padding: 40px 0;
    border-top: 1px solid rgba(255,255,255,0.03);
    position: relative;
}

/* Línea decorativa en cada sección */
section::before {
    content: '//';
    position: absolute;
    top: -8px;
    left: 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.5rem;
    color: #1a1e24;
    opacity: 0.5;
}

h2 {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(1.2rem, 2.2vw, 2rem);
    color: #f0f6fc;
    margin-bottom: 18px;
    letter-spacing: -0.3px;
}

h2::before {
    content: '# ';
    color: #58a6ff;
    opacity: 0.5;
}

/* ===== TARJETAS ===== */
.stat-card, .cert-card, .writeup-card, .skill-category, .exp-card, .doc-card {
    background: rgba(255,255,255,0.02);
    padding: 16px 20px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.04);
    backdrop-filter: blur(4px);
    transition: all 0.3s ease;
}

.stat-card:hover, .cert-card:hover, .writeup-card:hover,
.skill-category:hover, .exp-card:hover, .doc-card:hover {
    border-color: rgba(88, 166, 255, 0.15);
    transform: translateY(-2px);
    background: rgba(255,255,255,0.03);
}

/* ===== STATS ===== */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    padding: 28px 0;
}

.stat-number {
    font-family: 'JetBrains Mono', monospace;
    display: block;
    font-size: clamp(1.5rem, 3vw, 2.8rem);
    font-weight: 700;
    color: #58a6ff;
    letter-spacing: -1px;
}

.stat-label {
    font-size: clamp(0.65rem, 0.9vw, 0.9rem);
    color: #6e7681;
    font-weight: 300;
}

/* ===== ABOUT ===== */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

.about-text p {
    color: #8b949e;
    font-size: clamp(0.85rem, 1.1vw, 1.05rem);
    margin-bottom: 8px;
    font-weight: 300;
}

.about-text ul {
    list-style: none;
    padding: 0;
}

.about-text ul li {
    color: #8b949e;
    padding: 2px 0;
    font-size: clamp(0.8rem, 1vw, 0.95rem);
}

.about-text ul li::before {
    content: '▸ ';
    color: #58a6ff;
    opacity: 0.6;
}

.about-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-content: start;
}

.tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(0.5rem, 0.8vw, 0.75rem);
    padding: 4px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.04);
    color: #6e7681;
    background: rgba(255,255,255,0.02);
    transition: all 0.3s ease;
}

.tag:hover {
    border-color: #58a6ff;
    color: #58a6ff;
}

/* ===== CERTIFICACIONES ===== */
.cert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.cert-card h4 {
    color: #f0f6fc;
    font-weight: 500;
    font-size: clamp(0.75rem, 1vw, 0.95rem);
}

.cert-card p {
    color: #6e7681;
    font-size: clamp(0.65rem, 0.8vw, 0.8rem);
    font-weight: 300;
}

/* ===== EXPERIENCE ===== */
.exp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.exp-card h4 {
    color: #f0f6fc;
    font-size: clamp(0.75rem, 0.9vw, 0.9rem);
    font-weight: 500;
}

.exp-card p {
    color: #6e7681;
    font-size: clamp(0.6rem, 0.7vw, 0.75rem);
    margin-bottom: 4px;
}

.exp-card ul {
    list-style: none;
    padding: 0;
}

.exp-card ul li {
    color: #8b949e;
    font-size: clamp(0.65rem, 0.75vw, 0.8rem);
    padding: 1px 0 1px 14px;
    position: relative;
}

.exp-card ul li::before {
    content: '▸';
    color: #58a6ff;
    opacity: 0.5;
    position: absolute;
    left: 0;
}

/* ===== WRITEUPS ===== */
.writeup-category {
    margin-bottom: 24px;
}

.writeup-category h3 {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(0.8rem, 1.2vw, 1.1rem);
    color: #f0f6fc;
    margin-bottom: 8px;
}

.writeup-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
}

.writeup-card h4 {
    color: #f0f6fc;
    font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    margin: 4px 0 2px;
}

.writeup-card p {
    color: #6e7681;
    font-size: clamp(0.6rem, 0.7vw, 0.75rem);
}

.difficulty {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(0.45rem, 0.6vw, 0.6rem);
    padding: 1px 10px;
    border-radius: 8px;
    font-weight: 600;
}

.difficulty.hard { background: #da3633; color: #fff; }
.difficulty.medium { background: #d29922; color: #fff; }
.difficulty.easy { background: #238636; color: #fff; }

.btn-small {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(0.5rem, 0.7vw, 0.65rem);
    padding: 3px 12px;
    background: rgba(35, 134, 54, 0.2);
    color: #3fb950;
    text-decoration: none;
    border-radius: 4px;
    border: 1px solid rgba(35, 134, 54, 0.1);
    transition: all 0.3s ease;
}

.btn-small:hover {
    background: rgba(35, 134, 54, 0.3);
}

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

.skill-category h4 {
    color: #f0f6fc;
    font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    font-weight: 500;
}

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

.skill-category ul li {
    color: #6e7681;
    font-size: clamp(0.65rem, 0.75vw, 0.8rem);
    padding: 1px 0;
}

.skill-category ul li::before {
    content: '• ';
    color: #58a6ff;
    opacity: 0.4;
}

/* ===== HOBBIES ===== */
.hobbies-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.hobby-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(0.5rem, 0.8vw, 0.7rem);
    padding: 3px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.04);
    color: #6e7681;
    background: rgba(255,255,255,0.02);
    transition: all 0.3s ease;
}

.hobby-tag:hover {
    border-color: #58a6ff;
    color: #58a6ff;
}

/* ===== GALLERY ===== */
.carousel {
    max-width: 500px;
    margin: 12px auto 0;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.04);
    position: relative;
}

.carousel-container {
    display: flex;
    transition: transform 0.6s ease;
}

.carousel-slide {
    min-width: 100%;
    aspect-ratio: 16/9;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.04);
    padding: 6px 12px;
    cursor: pointer;
    border-radius: 50%;
    font-size: clamp(0.8rem, 1vw, 1.1rem);
    transition: all 0.3s ease;
    z-index: 2;
}

.carousel-btn:hover {
    background: rgba(255,255,255,0.05);
    border-color: #58a6ff;
}

.carousel-btn.prev { left: 8px; }
.carousel-btn.next { right: 8px; }

.carousel-dots {
    text-align: center;
    margin-top: 8px;
}

.carousel-dots .dot {
    display: inline-block;
    width: clamp(6px, 0.6vw, 8px);
    height: clamp(6px, 0.6vw, 8px);
    margin: 0 3px;
    background: #1a1e24;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-dots .dot.active {
    background: #58a6ff;
}

/* ===== CONTACT ===== */
.contact {
    text-align: center;
}

.social-links {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 14px 0;
}

.social-icon {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(0.6rem, 0.9vw, 0.8rem);
    padding: clamp(6px, 0.6vw + 4px, 10px) clamp(14px, 1.5vw + 8px, 24px);
    background: rgba(255,255,255,0.02);
    color: #c9d1d9;
    text-decoration: none;
    border-radius: 5px;
    border: 1px solid rgba(255,255,255,0.04);
    transition: all 0.3s ease;
}

.social-icon:hover {
    border-color: #58a6ff;
    color: #58a6ff;
    background: rgba(88, 166, 255, 0.04);
    transform: translateY(-2px);
}

.contact-note {
    color: #6e7681;
    font-size: clamp(0.65rem, 0.8vw, 0.8rem);
    font-weight: 300;
}

/* ===== FOOTER ===== */
footer {
    text-align: center;
    padding: 16px 0;
    border-top: 1px solid rgba(255,255,255,0.03);
    margin-top: 12px;
    color: #6e7681;
    font-size: clamp(0.6rem, 0.7vw, 0.8rem);
    font-weight: 300;
    letter-spacing: 0.5px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 820px) {
    .hero {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 20px;
        padding: 40px 0 32px;
    }
    .hero-avatar {
        width: clamp(100px, 25vw, 160px);
        height: clamp(100px, 25vw, 160px);
    }
    .hero-left {
        order: -1;
    }
    .hero-right .description {
        margin: 0 auto 14px;
    }
    .cta-buttons {
        justify-content: center;
    }
    .hero-badges {
        justify-content: center;
    }
    .about-grid {
        grid-template-columns: 1fr;
    }
    .about-tags {
        justify-content: center;
    }
    .hero::after {
        right: auto;
        left: 0;
    }
    .hero-left::before {
        width: clamp(160px, 35vw, 240px);
        height: clamp(160px, 35vw, 240px);
    }
}

@media (max-width: 480px) {
    .hero-right h1 {
        font-size: clamp(1.5rem, 6vw, 2.2rem);
    }
    .hero-avatar {
        width: clamp(80px, 20vw, 120px);
        height: clamp(80px, 20vw, 120px);
    }
    .writeup-grid {
        grid-template-columns: 1fr;
    }
    .skills-grid {
        grid-template-columns: 1fr;
    }
    .cert-grid {
        grid-template-columns: 1fr;
    }
    .exp-grid {
        grid-template-columns: 1fr;
    }
    .hero-left::before {
        width: clamp(140px, 40vw, 180px);
        height: clamp(140px, 40vw, 180px);
    }
}
