:root {
    --bg-0: #ffffff;
    --bg-1: #f8f6fc;
    --bg-2: #f1ecfa;
    --card: #f8f6fc;
    --line: #e6def5;
    --ink: #231b30;
    --muted: #6e6480;
    --accent: #8b5fbf;
    --accent-2: #5b3a8f;
    --accent-soft: rgba(139, 95, 191, 0.10);
    --radius: 16px;
}

/* ===== BASE ===== */

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

html {
    scroll-behavior: smooth;
}

body {
    background:
        radial-gradient(900px 500px at 85% -5%,
            rgba(139, 95, 191, 0.09),
            transparent 60%),
        radial-gradient(700px 400px at -5% 10%,
            rgba(201, 163, 247, 0.08),
            transparent 55%),
        var(--bg-0);

    color: var(--ink);
    font-family: 'Inter', sans-serif;
    line-height: 1.65;
}

h1,
h2,
h3 {
    font-family: 'Sora', sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

.wrap {
    max-width: 1020px;
    margin: 0 auto;
    padding: 0 32px;
}

img {
    display: block;
    max-width: 100%;
}


/* =========================================================
   HEADER
   ========================================================= */

header {
    position: sticky;
    top: 0;
    z-index: 30;

    background: rgba(255, 255, 255, 0.92);

    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    border-bottom: 1px solid var(--line);
}

.nav-inner {
    max-width: 1020px;
    margin: 0 auto;
    padding: 18px 32px;

    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    width: 38px;
    height: 38px;

    border-radius: 10px;

    background: linear-gradient(155deg,
            var(--accent),
            #5b3a8f);

    display: flex;
    align-items: center;
    justify-content: center;

    font-family: 'Sora';
    font-weight: 700;
    font-size: 0.95rem;

    color: #fff;
}

.nav-links {
    display: flex;
    gap: 30px;
    list-style: none;
}

.nav-links a {
    font-size: 0.9rem;
    color: var(--muted);

    transition: color 0.15s ease;
}

.nav-links a:hover {
    color: var(--ink);
}

.nav-cta {
    padding: 9px 18px;

    border-radius: 999px;

    background: var(--accent);

    color: #fff;

    font-size: 0.85rem;
    font-weight: 600;
}

.nav-cta:hover {
    opacity: 0.9;
}


/* =========================================================
   SECCIONES
   ========================================================= */

section {
    position: relative;

    padding: 64px 0;

    /* Quitamos las líneas horizontales */
    border-top: none;

    overflow: hidden;
}

.hero {
    position: relative;

    padding: 70px 0 40px;

    overflow: hidden;
}

.contact-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}


/* =========================================================
   PARTICLES
   ========================================================= */

/*
   IMPORTANTE:
   Las partículas SE CONSERVAN.
*/

#particles-hero {
    position: absolute;

    inset: 0;

    z-index: 0;

    pointer-events: none;
}


/* =========================================================
   PARALLAX BLOBS
   ========================================================= */

/*
   Se desactivan solamente los blobs que generaban
   el bloque/halo cuadrado del lado derecho.
*/

.parallax-blob {
    display: none !important;
}


/* =========================================================
   CONTENIDO SOBRE LAS PARTICULAS
   ========================================================= */

.hero-grid,
.hero-name,
.btn-row,
.social-row,
.sec-head,
.about-text,
#proyectos .proj-card,
.skills-grid,
.timeline,
.contact-grid {
    position: relative;

    z-index: 1;
}


/* =========================================================
   ICONOS TECNOLÓGICOS
   ========================================================= */

.tech-icons {
    position: absolute;

    inset: 0;

    z-index: 0;

    pointer-events: none;

    overflow: hidden;
}

.tech-icon-wrap {
    position: absolute;

    will-change: transform;
}

.tech-icon {
    width: 100%;
    height: 100%;

    display: flex;
    align-items: center;
    justify-content: center;

    color: var(--accent);

    opacity: 0.5;

    animation: iconFloat 6s ease-in-out infinite;
}

.tech-icon svg {
    width: 100%;
    height: 100%;
}

@keyframes iconFloat {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-14px) rotate(4deg);
    }
}


/* =========================================================
   REDES SOCIALES (barra superior del hero)
   ========================================================= */

.social-row {
    display: flex;

    gap: 10px;

    margin-bottom: 26px;
}

.social-row a {
    width: 36px;
    height: 36px;

    border-radius: 50%;

    border: 1px solid var(--line);

    display: flex;
    align-items: center;
    justify-content: center;

    color: var(--muted);

    font-size: 0.85rem;
}

.social-row a:hover {
    border-color: var(--accent);

    color: var(--accent);
}


/* =========================================================
   TEXTOS
   ========================================================= */

.eyebrow {
    color: var(--accent);

    font-weight: 600;

    font-size: 0.98rem;

    margin-bottom: 6px;
}

.hero-sub {
    color: var(--muted);

    font-weight: 500;

    margin-bottom: 18px;
}

.hero-grid {
    display: grid;

    grid-template-columns: 1.15fr 0.85fr;

    gap: 36px;

    align-items: center;

    margin-bottom: 26px;
}

.hero-grid p {
    color: var(--muted);

    max-width: 52ch;

    font-size: 1.02rem;
}


/* =========================================================
   FOTO DE PERFIL — FLIP 3D (solo Hero)
   ========================================================= */

.photo-flip {
    position: relative;

    justify-self: end;

    width: 320px;
    height: 320px;

    perspective: 1200px;

    z-index: 1;

    cursor: pointer;
}

/* Tooltip que aparece al cargar y se desvanece solo, como el de hero-name */
.photo-flip-tip {
    position: absolute;

    top: -34px;
    left: 50%;
    transform: translateX(-50%);

    white-space: nowrap;

    padding: 6px 14px;

    border-radius: 999px;

    background: var(--ink);

    color: #fff;

    font-family: 'Inter', sans-serif;
    font-size: 0.76rem;
    font-weight: 600;

    opacity: 0;

    pointer-events: none;

    z-index: 3;

    animation: photoTip 5s ease forwards;
}

.photo-flip-tip::after {
    content: "";

    position: absolute;

    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);

    width: 10px;
    height: 10px;

    background: var(--ink);

    border-radius: 2px;

    rotate: 45deg;
}

@keyframes photoTip {

    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(6px);
    }

    12%,
    78% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }

    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(0);
    }
}

/* Badge permanente con pulso: la pista visual que se queda siempre */
.photo-flip-badge {
    position: absolute;

    bottom: 12px;
    right: 12px;

    width: 40px;
    height: 40px;

    border-radius: 50%;

    background: rgba(255, 255, 255, 0.92);

    display: flex;
    align-items: center;
    justify-content: center;

    color: var(--accent-2);

    box-shadow: 0 8px 18px -6px rgba(35, 27, 48, 0.4);

    z-index: 2;
}

.photo-flip-badge svg {
    width: 19px;
    height: 19px;
}

.photo-flip-badge::before {
    content: "";

    position: absolute;

    inset: -6px;

    border-radius: 50%;

    border: 2px solid #fff;

    opacity: 0.6;

    animation: badgePulse 2.2s ease-out infinite;
}

@keyframes badgePulse {

    0% {
        transform: scale(0.85);
        opacity: 0.6;
    }

    100% {
        transform: scale(1.35);
        opacity: 0;
    }
}

.photo-flip:hover .photo-flip-badge,
.photo-flip.is-flipped .photo-flip-badge {
    opacity: 0;
}

.photo-flip-inner {
    position: relative;

    width: 100%;
    height: 100%;

    border-radius: 28px;

    transform-style: preserve-3d;

    transition: transform 0.7s cubic-bezier(.16, .84, .44, 1);

    box-shadow:
        0 30px 60px -20px rgba(139, 95, 191, 0.32);
}

.photo-flip:hover .photo-flip-inner {
    transform: rotateY(180deg);
}

.photo-flip.is-flipped .photo-flip-inner {
    transform: rotateY(180deg);
}

.photo-front,
.photo-back {
    position: absolute;
    inset: 0;

    border-radius: 28px;

    overflow: hidden;

    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.photo-front img {
    width: 100%;
    height: 100%;

    object-fit: cover;
}

.photo-back {
    transform: rotateY(180deg);

    background: linear-gradient(155deg,
            var(--accent),
            #5b3a8f);

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 20px;
}

.social-icons-flip {
    display: grid;

    grid-template-columns: repeat(2, 1fr);

    gap: 18px;
}

.social-icons-flip a {
    width: 54px;
    height: 54px;

    border-radius: 50%;

    background: rgba(255, 255, 255, 0.15);

    display: flex;
    align-items: center;
    justify-content: center;

    color: #fff;

    transition:
        background 0.25s ease,
        transform 0.25s ease,
        color 0.25s ease;
}

.social-icons-flip svg {
    width: 24px;
    height: 24px;
}

.social-icons-flip a:hover {
    background: #fff;

    color: var(--accent-2);

    transform: translateY(-3px);
}

.photo-flip-back-btn {
    display: flex;
    align-items: center;
    gap: 6px;

    padding: 8px 16px;

    border-radius: 999px;

    border: 1px solid rgba(255, 255, 255, 0.4);

    background: rgba(255, 255, 255, 0.1);

    color: #fff;

    font-size: 0.78rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;

    cursor: pointer;

    transition:
        background 0.25s ease,
        color 0.25s ease;
}

.photo-flip-back-btn svg {
    width: 14px;
    height: 14px;
}

.photo-flip-back-btn:hover {
    background: #fff;

    color: var(--accent-2);
}


/* =========================================================
   NOMBRE ANIMADO
   ========================================================= */

.hero-name {
    position: relative;

    font-size: 5.4rem;

    font-weight: 800;

    line-height: 1.05;

    letter-spacing: -0.02em;

    margin: 14px 0 30px;
}

.hero-name::after {
    content: "Pasa el mouse para cámara lenta";

    position: absolute;

    left: 0;

    bottom: -22px;

    font-family: 'Inter', sans-serif;

    font-size: 0.72rem;

    font-weight: 700;

    letter-spacing: 0.5px;

    text-transform: uppercase;

    color: var(--muted);

    opacity: 0;

    animation: tip 3s forwards;
}

@keyframes tip {

    0%,
    100% {
        opacity: 0;
    }

    15%,
    75% {
        opacity: 1;
    }
}

.name-line {
    display: inline-block;
}

.letter {
    display: inline-block;

    will-change: transform, opacity, filter;

    filter: blur(0);
}


/* =========================================================
   TEXTO CON GRADIENTE
   ========================================================= */

.animate-charcter {
    background-image:
        linear-gradient(-225deg,
            #231557 0%,
            #44107a 29%,
            #ff1361 67%,
            #fff800 100%);

    background-size: 200% auto;

    color: #fff;

    background-clip: text;

    -webkit-background-clip: text;

    -webkit-text-fill-color: transparent;

    animation: textclip 2s linear infinite;

    display: inline-block;
}

@keyframes textclip {

    to {
        background-position: 200% center;
    }
}


/* =========================================================
   BOTONES
   ========================================================= */

.btn-row {
    display: flex;

    gap: 12px;

    flex-wrap: wrap;
}

.btn {
    padding: 12px 22px;

    border-radius: 10px;

    font-size: 0.92rem;

    font-weight: 600;

    border: 1px solid var(--line);
}

.btn.primary {
    background: var(--accent);

    color: #fff;

    border-color: var(--accent);
}

.btn.primary:hover {
    opacity: 0.9;
}

.btn.ghost {
    background: var(--card);

    color: var(--ink);
}

.btn.ghost:hover {
    border-color: var(--accent);

    color: var(--accent);
}


/* =========================================================
   ENCABEZADOS
   ========================================================= */

.sec-head {
    display: flex;

    align-items: center;

    justify-content: space-between;

    margin-bottom: 36px;

    gap: 20px;
}

.sec-head .eyebrow {
    margin-bottom: 4px;
}

.sec-head h2 {
    font-size: 1.9rem;

    font-weight: 700;
}


/* =========================================================
   SOBRE MÍ
   ========================================================= */

.about-text p {
    color: var(--muted);

    margin-bottom: 16px;

    max-width: 64ch;

    font-size: 1.02rem;
}

.about-text p strong {
    color: var(--ink);

    font-weight: 600;
}


/* =========================================================
   PROYECTOS
   ========================================================= */

.proj-card {
    display: grid;

    grid-template-columns: 220px 1fr;

    gap: 26px;

    background: var(--card);

    border: 1px solid var(--line);

    border-radius: var(--radius);

    padding: 22px;

    margin-bottom: 20px;

    align-items: center;

    position: relative;

    z-index: 1;
}

.proj-thumb {
    height: 130px;

    border-radius: 12px;

    background:
        linear-gradient(135deg,
            var(--accent),
            #5b3a8f);

    display: flex;

    align-items: center;

    justify-content: center;

    color: #fff;

    font-family: 'Sora';

    font-weight: 700;

    font-size: 1.05rem;

    text-align: center;

    padding: 10px;
}

.proj-card h3 {
    font-size: 1.12rem;

    font-weight: 700;

    margin-bottom: 8px;
}

.status {
    font-size: 0.72rem;

    font-weight: 600;

    padding: 3px 10px;

    border-radius: 999px;

    margin-left: 10px;

    vertical-align: middle;
}

.status.progress {
    background: rgba(139, 95, 191, 0.15);

    color: var(--accent);
}

.status.done {
    background: rgba(91, 58, 143, 0.15);

    color: var(--accent-2);
}

.tag-row {
    display: flex;

    gap: 8px;

    margin-bottom: 10px;

    flex-wrap: wrap;
}

.tag {
    font-size: 0.72rem;

    color: var(--accent);

    background: var(--accent-soft);

    padding: 3px 10px;

    border-radius: 999px;
}

.proj-card p {
    color: var(--muted);

    font-size: 0.94rem;

    margin-bottom: 12px;
}

.proj-links {
    display: flex;

    gap: 16px;
}

.proj-links a {
    font-size: 0.85rem;

    color: var(--ink);

    border-bottom: 1px solid var(--line);
}

.proj-links a:hover {
    color: var(--accent);

    border-color: var(--accent);
}


/* =========================================================
   HABILIDADES
   ========================================================= */

.skills-grid {
    display: grid;

    grid-template-columns: repeat(4, 1fr);

    gap: 16px;
}

.skill-card {
    position: relative;

    overflow: hidden;

    background: var(--card);

    border: 1px solid var(--line);

    border-radius: var(--radius);

    padding: 26px 18px;

    text-align: center;

    opacity: 0;

    transform:
        translateY(22px) scale(0.96);

    transition:
        opacity 0.7s cubic-bezier(.16, .84, .44, 1),
        transform 0.7s cubic-bezier(.16, .84, .44, 1),
        border-color 0.35s ease,
        box-shadow 0.35s ease;
}

.skill-card.is-visible {
    opacity: 1;

    transform:
        translateY(0) scale(1);
}

.skill-card::before {
    content: "";

    position: absolute;

    inset: 0;

    border-radius: inherit;

    background:
        linear-gradient(120deg,
            transparent 30%,
            rgba(139, 95, 191, 0.16) 50%,
            transparent 70%);

    background-size: 220% 100%;

    background-position: 120% 0;

    opacity: 0;

    transition:
        opacity 0.35s ease,
        background-position 0.8s ease;

    pointer-events: none;
}

.skill-card:hover {
    border-color: var(--accent);

    box-shadow:
        0 22px 44px -22px rgba(139, 95, 191, 0.4);

    transform: translateY(-6px);
}

.skill-card:hover::before {
    opacity: 1;

    background-position: -20% 0;
}

.skill-card svg {
    width: 38px;

    height: 38px;

    margin: 0 auto 14px;

    color: var(--accent);

    transition:
        transform 0.5s cubic-bezier(.34, 1.56, .64, 1),
        color 0.35s ease;
}

.skill-card:hover svg {
    transform:
        translateY(-3px) rotate(-6deg) scale(1.12);

    color: var(--accent-2);
}

.skill-card strong {
    font-size: 0.9rem;

    font-weight: 600;

    position: relative;

    transition: color 0.3s ease;
}

.skill-card:hover strong {
    color: var(--ink);
}


/* =========================================================
   FRASE
   ========================================================= */

.quote-band {
    background: var(--bg-1);

    border-top: none;

    border-bottom: none;

    padding: 56px 0;
}

.quote-band .wrap {
    display: flex;

    align-items: center;

    gap: 26px;
}

.quote-band p {
    font-family: 'Sora';

    font-size: 1.5rem;

    font-weight: 600;

    line-height: 1.35;

    max-width: 60ch;
}

.quote-band .accentword {
    color: var(--accent);
}


/* =========================================================
   EXPERIENCIA
   ========================================================= */

.timeline {
    position: relative;

    padding-left: 30px;
}

.timeline::before {
    content: "";

    position: absolute;

    left: 5px;

    top: 6px;

    bottom: 6px;

    width: 1px;

    background: var(--line);
}

.t-item {
    position: relative;

    padding-bottom: 38px;

    display: grid;

    grid-template-columns: 160px 1fr;

    gap: 20px;
}

.t-item:last-child {
    padding-bottom: 0;
}

.t-item::before {
    content: "";

    position: absolute;

    left: -30px;

    top: 5px;

    width: 11px;

    height: 11px;

    border-radius: 50%;

    background: var(--bg-0);

    border: 2px solid var(--accent);
}

.t-period {
    color: var(--muted);

    font-size: 0.85rem;

    font-weight: 600;
}

.t-place {
    color: var(--muted);

    font-size: 0.8rem;

    margin-top: 2px;
}

.t-item h3 {
    font-size: 1.05rem;

    font-weight: 700;

    margin-bottom: 8px;
}

.t-item p {
    color: var(--muted);

    font-size: 0.94rem;

    max-width: 56ch;
}


/* =========================================================
   CONTACTO
   ========================================================= */

.contact-grid {
    display: grid;

    grid-template-columns: 0.8fr 1.2fr;

    gap: 0;

    border-radius: var(--radius);

    overflow: hidden;

    border: 1px solid var(--line);
}

.contact-photo {
    background:
        linear-gradient(160deg,
            var(--accent),
            #5b3a8f);

    min-height: 320px;

    display: flex;

    align-items: center;

    justify-content: center;

    color: #fff;

    font-family: 'Sora';

    font-weight: 700;

    font-size: 3rem;
}

.contact-box {
    background: var(--card);

    padding: 40px;
}

.contact-box .eyebrow {
    margin-bottom: 6px;
}

.contact-box h2 {
    font-size: 1.7rem;

    font-weight: 700;

    margin-bottom: 16px;
}

.contact-box p {
    color: var(--muted);

    margin-bottom: 22px;

    max-width: 50ch;
}


/* =========================================================
   FOOTER
   ========================================================= */

footer {
    padding: 34px 0;

    text-align: center;

    color: var(--muted);

    font-size: 0.82rem;

    border-top: none;
}

footer a {
    color: var(--accent);
}


/* =========================================================
   FOCUS
   ========================================================= */

:focus-visible {
    outline: 2px solid var(--accent);

    outline-offset: 2px;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 760px) {

    .wrap {
        padding: 0 20px;
    }

    .nav-inner {
        padding: 14px 20px;
    }

    .hero {
        padding: 45px 0 30px;
    }

    .hero-grid {
        grid-template-columns: 1fr;
    }

    .photo-flip {
        justify-self: start;

        width: 210px;
        height: 210px;
    }

    .social-icons-flip {
        gap: 12px;
    }

    .social-icons-flip a {
        width: 40px;
        height: 40px;
    }

    .social-icons-flip svg {
        width: 18px;
        height: 18px;
    }

    .hero-name {
        font-size: 3.1rem;
    }

    .nav-links {
        display: none;
    }

    .proj-card,
    .t-item {
        grid-template-columns: 1fr;
    }

    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }

    .contact-photo {
        min-height: 160px;
    }

    .quote-band p {
        font-size: 1.2rem;
    }

    .tech-icons {
        display: none;
    }

    section {
        padding: 48px 0;
    }

    .sec-head h2 {
        font-size: 1.6rem;
    }

    .contact-box {
        padding: 28px 22px;
    }
}


/* =========================================================
   REDUCIR MOVIMIENTO
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    html {
        scroll-behavior: auto;
    }

    .tech-icon {
        animation: none;
    }

    .skill-card,
    .skill-card svg {
        transition: none;

        opacity: 1;

        transform: none;
    }

    .skill-card::before {
        display: none;
    }

    .animate-charcter {
        animation: none;
    }

    .hero-name::after {
        animation: none;

        opacity: 0;
    }

    .photo-flip-inner {
        transition: none;
    }

    .photo-flip-badge::before {
        animation: none;
        display: none;
    }

    .photo-flip-tip {
        animation: none;
        opacity: 1;
    }
}
