/* ========== Variables ========== */
:root {
    --color-first: #16181d;      /* Navbar / fondos oscuros */
    --color-second: #ff3b24;     /* Acento (más legible sobre oscuro) */
    --color-second-dark: #d92410;/* Acento sobre fondo claro (contraste AA) */
    --color-third: #e9ecef;
    --color-fourth: #f8f9fa;
    --color-fifth: #495057;
    --color-sixth: #ced4da;
    --color-txt-light: #f8f9fa;
    --color-txt: #1f2328;
    --color-box-shadow: rgba(0, 0, 0, .12);
    --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-code: 'JetBrains Mono', ui-monospace, Consolas, monospace;
    --nav-w: 280px;
    --radius: 12px;
}

/* ========== Base ========== */
html { scroll-behavior: smooth; scroll-padding-top: 1rem; }
body { font-family: var(--font-body); color: var(--color-txt); line-height: 1.65; display: block; }
p { max-width: 70ch; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -.02em; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--color-second); outline-offset: 3px; border-radius: 4px; }
ul { padding-left: 1.2rem; }
li::marker { color: var(--color-second-dark); }

.skip-link { position: fixed; top: -60px; left: 1rem; z-index: 10000; background: var(--color-second); color: #fff; padding: .6rem 1rem; border-radius: 6px; transition: top .2s; }
.skip-link:focus { top: 1rem; }

.cont-skills, .cont-skills-about { list-style: none; padding-left: 0; }
.cont-skills li::marker, .cont-skills-about li::marker { content: none; }

/* ========== Navbar ========== */
.vertical-nav {
    position: fixed; inset: 0 auto 0 0; width: var(--nav-w); z-index: 1000;
    display: flex; flex-direction: column; padding: 2rem 1rem 1rem;
    background: var(--color-first); overflow-y: auto;
    transition: transform .3s ease;
}
.vertical-nav .nav-link { padding: 14px 14px; font-size: 16px; font-weight: 500; color: var(--color-txt-light); border-radius: 8px; margin-bottom: 2px; transition: background-color .2s; }
.vertical-nav .nav-link:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.vertical-nav .nav-link.active { background: var(--color-second); color: #fff; }

.nav-cont-name-img { display: flex; flex-direction: column; align-items: center; text-align: center; }
.nav-img-perfil { margin-bottom: 14px; height: 115px; width: 115px; border-radius: 50%; object-fit: cover; border: 3px solid var(--color-second); }
.nav-txt-perfil { color: var(--color-txt-light); font-size: 22px; font-weight: 700; margin: 0; }
.nav-role { color: var(--color-sixth); font-size: 14px; margin: 0; }
.separador-navbar { color: var(--color-txt-light); opacity: .25; margin: 1.5rem 0 1rem; }

.cont-redes { margin-top: auto; padding-top: 1rem; border-top: 1px solid rgba(255, 255, 255, .15); display: flex; justify-content: space-between; }
.redes { height: 45px; width: 45px; display: flex; align-items: center; justify-content: center; border-radius: 8px; transition: background-color .2s; }
.redes:hover { background: var(--color-second); }
.redes-icon { font-size: 26px; color: var(--color-txt-light); }

.nav-toggle { display: none; position: fixed; top: 12px; left: 12px; z-index: 1100; width: 46px; height: 46px; border: 0; border-radius: 10px; background: var(--color-first); color: #fff; font-size: 26px; align-items: center; justify-content: center; box-shadow: 0 2px 10px var(--color-box-shadow); }

.content { margin-left: var(--nav-w); }

/* ========== Secciones ========== */
.section { padding: clamp(3rem, 7vw, 6rem) clamp(1.5rem, 6vw, 5.5rem); }
.section-light { background: var(--color-fourth); }
.section-gray { background: var(--color-third); }
.lead-text { font-size: 1.15rem; }

.txt-title { font-size: clamp(1.9rem, 4vw, 2.4rem); font-weight: 800; margin-bottom: 1.5rem; padding-bottom: .5rem; display: inline-block; border-bottom: 4px solid var(--color-second); }

/* ========== Hero / Contacto ========== */
.hero {
    position: relative; min-height: 92vh; display: flex; align-items: center; justify-content: flex-end;
    padding: 2rem clamp(1.5rem, 6vw, 5rem);
    background: linear-gradient(90deg, rgba(10, 11, 14, .15), rgba(10, 11, 14, .75)), url(/static/img/code_walp.webp) center / cover fixed, var(--color-first);
    color: var(--color-txt-light);
}
.hero-contact { min-height: 60vh; }
.cont-intro { max-width: 640px; text-align: right; }
.cont-intro p { margin-left: auto; }
.txt-name { font-size: clamp(2.8rem, 8vw, 5.2rem); font-weight: 800; margin-bottom: 1rem; }
.txt-sub-name { font-size: clamp(1.1rem, 2.4vw, 1.5rem); color: #e4e7ea; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: flex-end; margin-top: 1.75rem; }

.btn-main, .btn-ghost, .custom-btn {
    display: inline-flex; align-items: center; gap: .5rem; padding: .75rem 1.3rem;
    font-weight: 600; text-decoration: none; border-radius: 8px; transition: transform .2s, background-color .2s, color .2s;
}
.btn-main { background: var(--color-second); color: #fff; border: 2px solid var(--color-second); }
.btn-main:hover { background: #fff; color: var(--color-second-dark); border-color: #fff; }
.btn-ghost { color: #fff; border: 2px solid rgba(255, 255, 255, .7); }
.btn-ghost:hover { background: #fff; color: var(--color-first); }

.cont-arrow {
    position: absolute; bottom: 1.5rem; left: 50%; translate: -50% 0; height: 54px; width: 54px;
    display: flex; align-items: center; justify-content: center; border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .5); animation: bounceFade 2s infinite;
}
.row-icon { font-size: 26px; color: #fff; }

/* ========== Sobre mí ========== */
.cont-about-img { display: flex; gap: 2.5rem; padding: 1.5rem 0 2rem; align-items: flex-start; }
.img-perfil { flex: none; height: 325px; width: 325px; object-fit: cover; border-radius: var(--radius); box-shadow: 12px 12px 0 var(--color-second); }
.cont-about h3 { font-weight: 700; }
.cont-points { display: grid; gap: .35rem; margin: 1rem 0 1.25rem; padding: 1rem 1.25rem; background: #fff; border-left: 4px solid var(--color-second); border-radius: 0 8px 8px 0; font-size: .95rem; }
.cont-points div { display: flex; gap: .5rem; }
.cont-points dt { min-width: 110px; font-weight: 700; }
.cont-points dd { margin: 0; }

.cont-skills-about { display: flex; flex-wrap: wrap; justify-content: space-around; align-items: center; gap: 1rem; margin: 1.5rem 0 0; padding: 1.5rem 0; border-top: 2px solid var(--color-second); }
.skill-about { height: 64px; width: auto; }

/* ========== Proyectos ========== */
.cont-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.75rem; margin-top: 2rem; align-items: stretch; }
.card { display: flex; flex-direction: column; overflow: hidden; border: 0; border-radius: var(--radius); background: #fff; box-shadow: 0 2px 14px var(--color-box-shadow); transition: transform .25s, box-shadow .25s; }
.card:hover { transform: translateY(-4px); box-shadow: 0 10px 26px var(--color-box-shadow); }
.card-featured { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1.1fr; border-top: 4px solid var(--color-second); }
.card-img-top { width: 100%; height: 250px; object-fit: cover; }
.card-featured .card-img-top { height: 100%; min-height: 320px; }
.card-body { display: flex; flex-direction: column; padding: 1.5rem; }
.card-title { font-size: 1.3rem; font-weight: 700; }
.badge-publi { display: inline-block; vertical-align: middle; margin-left: .4rem; padding: .15rem .6rem; font-size: .72rem; font-weight: 700; color: #fff; background: var(--color-second-dark); border-radius: 999px; }
.txt-details { color: var(--color-fifth); font-size: .92rem; }
.card-body ul.txt-details { margin-bottom: 1rem; }
.cont-skills { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .8rem; margin: auto 0 0; padding-top: 1rem; }
.img-skills { height: 32px; width: auto; }
.card-link { margin-top: 1rem; font-weight: 700; color: var(--color-second-dark); text-decoration: none; }
.card-link:hover { text-decoration: underline; }

.cont-main-auric-data { display: flex; justify-content: space-around; gap: 1rem; padding: .75rem 0 1rem; margin-bottom: .5rem; border-block: 1px solid var(--color-sixth); }
.cont-auric-data { text-align: center; }
.tittle-data { font-size: 1.9rem; font-weight: 800; color: var(--color-first); margin: 0; line-height: 1; }
.txt-data { font-size: .85rem; color: var(--color-fifth); margin: .25rem 0 0; }

.library-summary { margin-top: 3.5rem; padding-top: 2.5rem; border-top: 2px solid var(--color-second); }
.library-summary h3 { font-family: var(--font-code); font-weight: 500; }
pre { padding: 1.25rem; background: var(--color-first); color: var(--color-txt-light); border-radius: var(--radius); overflow-x: auto; font-family: var(--font-code); font-size: .85rem; line-height: 1.6; margin: .75rem 0 1rem; }
pre code { font-family: inherit; color: inherit; }
.code-red { color: #ff6b5a; }
.code-blue { color: #6cb6ff; }
.code-white { color: var(--color-fourth); }
.custom-btn { background: var(--color-second-dark); color: #fff; margin: .25rem .5rem .25rem 0; }
.custom-btn:hover { background: var(--color-first); color: #fff; transform: translateY(-2px); }

/* ========== Formación ========== */
.cont-formacion { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.5rem; margin-top: 2rem; }
.img-certificate { height: 230px; width: auto; max-width: 100%; border-radius: 8px; box-shadow: 0 2px 12px var(--color-box-shadow); transition: transform .25s; }
.img-certificate:hover { transform: scale(1.04); }

/* ========== Footer ========== */
.footer { padding: 2rem 1rem; text-align: center; background: var(--color-first); color: var(--color-sixth); border-top: 3px solid var(--color-second); }
.footer p { margin: 0 auto; }

/* ========== Animación de aparición ========== */
.fade-in { opacity: 0; transform: translateY(16px); transition: opacity .7s ease-out, transform .7s ease-out; }
.fade-in.visible { opacity: 1; transform: none; }
@media (scripting: none) { .fade-in { opacity: 1; transform: none; } #loader { display: none; } }

/* ========== Loader ========== */
#loader { position: fixed; inset: 0; z-index: 9999; display: flex; justify-content: center; align-items: center; background: var(--color-first); transition: opacity .4s; }
#loader.done { opacity: 0; pointer-events: none; }
.spinner { width: 50px; height: 50px; border: 8px solid var(--color-fourth); border-top-color: var(--color-second); border-radius: 50%; animation: spin 1s linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bounceFade { 0%, 100% { transform: translateY(-5px); opacity: 1; } 50% { transform: translateY(8px); opacity: .3; } }

/* ========== Responsive ========== */
@media (max-width: 1200px) {
    .vertical-nav { transform: translateX(-100%); box-shadow: none; }
    .vertical-nav.open { transform: none; box-shadow: 8px 0 30px rgba(0, 0, 0, .4); }
    .nav-toggle { display: flex; }
    .content { margin-left: 0; }
    .hero { background-attachment: scroll; }
}
@media (max-width: 900px) {
    .card-featured { grid-template-columns: 1fr; }
    .card-featured .card-img-top { min-height: 0; height: 250px; }
}
@media (max-width: 768px) {
    .hero { justify-content: center; }
    .cont-intro { text-align: center; padding: 1.5rem; background: rgba(0, 0, 0, .55); border-radius: var(--radius); }
    .cont-intro p { margin-inline: auto; }
    .hero-actions { justify-content: center; }
    .cont-about-img { flex-direction: column; align-items: center; }
    .img-perfil { height: 260px; width: 260px; }
    .cont-points div { flex-direction: column; gap: 0; }
    .card-img-top, .card-featured .card-img-top { height: 170px; }
    .img-certificate { height: 150px; }
    .skill-about { height: 48px; }
}

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