:root {
    --bg: #05060d;
    --bg-soft: #0a0d1a;
    --surface: rgba(255, 255, 255, 0.045);
    --surface-strong: rgba(255, 255, 255, 0.08);
    --border: rgba(255, 255, 255, 0.09);
    --border-strong: rgba(125, 211, 252, 0.35);
    --accent: #38bdf8;
    --accent-2: #a78bfa;
    --accent-3: #f472b6;
    --text: #eef1f8;
    --text-muted: #97a1c0;
    --radius-lg: 22px;
    --radius-md: 16px;
    --gradient: linear-gradient(120deg, var(--accent), var(--accent-2) 60%, var(--accent-3));
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    position: relative;
    overflow-x: hidden;
}

/* Fondo con manchas de luz difuminadas */
body::before,
body::after {
    content: '';
    position: fixed;
    width: 45vw;
    height: 45vw;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.22;
    z-index: -1;
    pointer-events: none;
}
body::before {
    top: -10%;
    left: -10%;
    background: var(--accent);
}
body::after {
    bottom: -15%;
    right: -10%;
    background: var(--accent-2);
}

h1, h2, h3 {
    font-family: 'Space Grotesk', 'Segoe UI', sans-serif;
    letter-spacing: -0.02em;
}

/* Barra de progreso de scroll */
#scroll-progress {
    position: fixed;
    top: 0; left: 0;
    height: 3px;
    width: 0%;
    background: var(--gradient);
    z-index: 1100;
    transition: width 0.1s ease-out;
}

nav {
    position: fixed;
    top: 22px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px;
    background: rgba(10, 13, 26, 0.65);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: 999px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    z-index: 1000;
}
nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 9px 18px;
    border-radius: 999px;
    transition: all 0.25s ease;
}
nav a:hover,
nav a.active {
    color: var(--bg);
    background: var(--gradient);
}

.lang-switch {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 4px;
    padding-left: 10px;
    border-left: 1px solid var(--border);
    flex-shrink: 0;
}

.lang-flag {
    width: 26px;
    height: 18px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: none;
    cursor: pointer;
    overflow: hidden;
    opacity: 0.55;
    flex-shrink: 0;
    transition: opacity 0.2s ease, transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.lang-flag svg { display: block; width: 100%; height: 100%; }
.lang-flag:hover { opacity: 0.9; transform: scale(1.08); }
.lang-flag.active {
    opacity: 1;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25);
}

header {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 140px 40px 60px 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.hero-container {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 60px;
    align-items: center;
    width: 100%;
}

.profile-header-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 22px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--accent);
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 6px 14px;
    border-radius: 999px;
}
.eyebrow::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 1px solid var(--border-strong);
    box-shadow: 0 0 30px rgba(56, 189, 248, 0.18);
    background: var(--surface);
    flex-shrink: 0;
    padding: 6px;
}

.hero-left h1 {
    font-size: clamp(2.6rem, 6vw, 4.4rem);
    line-height: 1.05;
    font-weight: 700;
}

.hero-left h1 .first-name {
    display: block;
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-left h1 .last-name {
    display: block;
    color: var(--text);
}

.hero-subtitle {
    max-width: 480px;
    color: var(--text-muted);
    font-size: 1.05rem;
}

.hero-cta {
    display: flex;
    gap: 14px;
    margin-top: 6px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 26px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.92rem;
    text-decoration: none;
    transition: all 0.25s ease;
    border: 1px solid transparent;
}
.btn-primary {
    background: var(--gradient);
    color: #05060d;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(56, 189, 248, 0.28);
}
.btn-ghost {
    color: var(--text);
    border-color: var(--border);
    background: var(--surface);
}
.btn-ghost:hover {
    border-color: var(--border-strong);
    background: var(--surface-strong);
    transform: translateY(-2px);
}

/* Nube de palabras */
.word-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    padding: 32px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.tag {
    color: var(--text);
    transition: all 0.3s ease;
    cursor: default;
}

.tag:hover {
    color: var(--accent);
    transform: scale(1.12);
}

.tag-xl { font-size: 1.05rem; font-weight: 700; background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tag-lg { font-size: 0.95rem; font-weight: 600; opacity: 0.9; }
.tag-md { font-size: 0.85rem; font-weight: 500; opacity: 0.75; }
.tag-sm { font-size: 0.75rem; font-weight: 400; opacity: 0.55; }

section { padding: 110px 20px; max-width: 960px; margin: auto; }

.section-header { margin-bottom: 48px; }
.section-header .eyebrow { margin-bottom: 16px; }
h2 { font-size: clamp(1.9rem, 4vw, 2.6rem); font-weight: 700; }

h3 { color: var(--text); font-size: 1.15rem; margin-bottom: 14px; font-weight: 600; }

p a { color: var(--accent); font-weight: 600; text-decoration: none; border-bottom: 1px solid rgba(56, 189, 248, 0.35); transition: border-color 0.2s ease; }
p a:hover { border-color: var(--accent); }

.info-timeline { position: relative; padding-left: 46px; }
.info-timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: linear-gradient(180deg, var(--accent), var(--accent-2), transparent);
}
.info-step { margin-bottom: 40px; position: relative; }
.info-step:last-child { margin-bottom: 0; }

.info-icon {
    position: absolute;
    left: -46px;
    top: -2px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-soft);
    border: 1px solid var(--border-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.2);
}
.info-icon svg {
    width: 16px;
    height: 16px;
    stroke: var(--accent);
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.info-step h3 { margin-bottom: 6px; }
.info-step p { color: var(--text-muted); font-size: 0.95rem; }

.lang-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.lang-item { display: flex; justify-content: space-between; align-items: center; background: rgba(255, 255, 255, 0.03); padding: 10px 14px; border-radius: 10px; font-size: 0.92rem; border: 1px solid var(--border); }
.lang-item span:first-child { color: var(--text); font-weight: 500; }
.lang-badge { background: rgba(56, 189, 248, 0.15); color: var(--accent); padding: 3px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 700; }

.skills-subheading {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text);
    text-align: center;
    margin: 0 0 28px 0;
}
.skills-bars ~ .skills-subheading { margin-top: 64px; }

.skills-bars { display: flex; flex-direction: column; gap: 28px; max-width: 680px; margin: 0 auto; }
.skill-bar-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; gap: 12px; }
.skill-name { font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 1.05rem; color: var(--text); }
.skill-tier {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    padding: 3px 11px;
    border-radius: 999px;
    border: 1px solid transparent;
    white-space: nowrap;
}
.skill-tier.tier-high { color: #05060d; background: var(--gradient); }
.skill-tier.tier-mid { color: var(--accent); background: rgba(56, 189, 248, 0.14); border-color: rgba(56, 189, 248, 0.3); }
.skill-tier.tier-basic { color: var(--text-muted); background: var(--surface); border-color: var(--border); }

.skill-track {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border);
    overflow: hidden;
}
.skill-fill {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    transition: width 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.skill-bar.visible .skill-fill { width: var(--level); }
.skill-fill.tier-high { background: var(--gradient); }
.skill-fill.tier-mid { background: var(--accent); }
.skill-fill.tier-basic { background: var(--text-muted); opacity: 0.55; }

p.intro-link { margin-bottom: 40px; color: var(--text-muted); font-size: 1.02rem; }

.timeline { position: relative; padding-left: 46px; counter-reset: step; }
.timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: linear-gradient(180deg, var(--accent), var(--accent-2), transparent);
}
.step { margin-bottom: 48px; position: relative; }
.step:last-child { margin-bottom: 0; }
.step::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    left: -46px;
    top: -2px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-soft);
    border: 1px solid var(--border-strong);
    color: var(--accent);
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.2);
}

ul { list-style: none; }
li { margin-bottom: 10px; position: relative; padding-left: 22px; color: var(--text-muted); font-size: 0.96rem; }
li::before { content: '→'; position: absolute; left: 0; color: var(--accent); font-weight: 700; }

/* Sección Contacto */
.contact-box {
    background: linear-gradient(180deg, var(--surface), rgba(255,255,255,0.02));
    border-radius: var(--radius-lg);
    padding: 44px;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
    text-align: center;
}
.contact-box::before {
    content: '';
    position: absolute;
    inset: -1px;
    background: var(--gradient);
    opacity: 0.06;
    z-index: -1;
}

.contact-icon-large {
    width: 54px;
    height: 54px;
    stroke: var(--accent);
    fill: none;
    stroke-width: 1.5;
    opacity: 0.9;
    margin: 0 auto 20px auto;
    filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.3));
}

.contact-box p {
    max-width: 520px;
    margin: 0 auto;
    color: var(--text-muted);
}

#email-container {
    margin-top: 28px;
}

#email-container a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 30px;
    border-radius: 999px;
    background: var(--gradient);
    color: #05060d !important;
    font-weight: 700;
    font-size: 1.02rem;
    text-decoration: none;
    border: none !important;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
#email-container a:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(56, 189, 248, 0.3);
}

#topBtn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    background: var(--surface-strong);
    backdrop-filter: blur(10px);
    color: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    border: 1px solid var(--border-strong);
    font-weight: bold;
    font-size: 1.1rem;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
    transition: transform 0.2s ease, background 0.2s ease;
}
#topBtn:hover { transform: translateY(-3px); background: var(--surface); }

footer {
    text-align: center;
    padding: 44px;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
}

/* Animación de aparición al hacer scroll */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 768px) {
    nav { top: 14px; padding: 6px; gap: 0; max-width: calc(100vw - 24px); overflow-x: auto; }
    nav a { padding: 8px 12px; font-size: 0.78rem; white-space: nowrap; }
    .lang-switch { padding-left: 6px; margin-left: 2px; }
    .lang-flag { width: 22px; height: 15px; }
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .profile-header-wrapper {
        align-items: center;
    }
    .hero-subtitle { max-width: 100%; }
    .hero-cta { justify-content: center; }
    header { min-height: auto; padding: 120px 24px 50px 24px; }
    section { padding: 80px 20px; }
    .word-cloud { padding: 22px; }
    .timeline { padding-left: 40px; }
    .step::before { left: -40px; }
    .info-timeline { padding-left: 40px; }
    .info-icon { left: -40px; }
    .contact-box { padding: 32px 22px; }
}

@media (max-width: 480px) {
    header { padding: 110px 16px 40px 16px; }
    section { padding: 64px 16px; }
    .profile-avatar { width: 80px; height: 80px; }
    .hero-left h1 { font-size: clamp(2.1rem, 11vw, 2.8rem); }
    .hero-cta { flex-direction: column; width: 100%; }
    .btn { justify-content: center; width: 100%; }
    .card { padding: 20px; }
    .contact-box { padding: 26px 18px; }
    #email-container a { width: 100%; justify-content: center; padding: 14px 18px; }
    .timeline { padding-left: 34px; }
    .step::before { left: -34px; width: 28px; height: 28px; font-size: 0.78rem; }
    .info-timeline { padding-left: 34px; }
    .info-icon { left: -34px; width: 28px; height: 28px; }
    #topBtn { bottom: 18px; right: 18px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .reveal { opacity: 1; transform: none; transition: none; }
    * { animation: none !important; transition: none !important; }
}
