@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800;900&display=swap');

*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    text-decoration: none;
    border: none;
    outline: none;
    scroll-behavior: smooth;
    font-family: 'Poppins', sans-serif;
}

:root{
    --bg-color: #1c1c1e;
    --second-bg-color: #2c2c2e;
    --text-color: #f5f5f7;
    --main-color: #7f00b2;
}

html{
        font-size: 62.5%;
        overflow-x: hidden; 
        scroll-padding-top: 9rem;

}

body{
    background: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
    min-height: 100vh;
    -webkit-tap-highlight-color: transparent;
}

/* ================= HEADER ================= */
.header{
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.4rem 10% 2.4rem;
    background: transparent;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    transition: .3s;
}
.header.sticky{
    background: var(--bg-color);
}
.logo{
    position: relative;
    font-size: 2.5rem;
    color: var(--text-color);
    font-weight: 600;
}
.navbar{
    position: relative;
}
.navbar a{
    font-size: 1.7rem;
    color: var(--text-color);
    font-weight: 500;
    margin-left: 3.5rem;
    transition: .3s;
}
.navbar a:hover,
.navbar a.active{
    color: var(--main-color);
}
#menu-icon{
    position: relative;
    font-size: 3.6rem;
    color: var(--text-color);
    cursor: pointer;
    display: none;
}

/* ================= SECTION BASE ================= */
section{
    min-height: 100vh;
    min-height: 100dvh;
    padding: 13rem 9% 2rem !important;
}

/* ================= HOME ================= */
.home{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4rem;
    padding: 8rem 9% 4rem !important;
    min-height: 100vh;
    min-height: 100dvh;
    background-color: #1c1c1e;
    position: relative;
    overflow: hidden;
}

.home-content{
     max-width: 60rem;
    z-index: 99;
    flex: 1;
    padding-top: 2rem;
}

.home-content h1{
    position: relative;
    display: block;              /* antes: inline-block */
    font-size: clamp(3.2rem, 6vw, 5.6rem);
    font-weight: 700;
    line-height: 1.3;
    margin-top: 1rem;            /* respiro extra */
}

.home-content h1 span{
    color: var(--text-color);
}

.home-content .text-animate{
    position: relative;
    width: 32.8rem;
    max-width: 100%;
}

.home-content .text-animate h3{
    font-size: clamp(2rem, 3.5vw, 3.2rem);
    font-weight: 700;
    color: transparent;
    -webkit-text-stroke: .7px var(--main-color);
    background-image: linear-gradient(var(--main-color), var(--main-color));
    background-repeat: no-repeat;
    -webkit-background-clip: text;
    background-position: -33rem 0;
    animation: homeBgText 6s linear infinite;
    animation-delay: 2s;
}

.home.show-animate .home-content .text-animate{
    animation: homeBgText 6s linear infinite;
    animation-delay: 2s;
}

.home-content .text-animate h3::before{
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    border-right: 2px solid var(--main-color);
    z-index: -1;
    animation: homeCursorText 6s linear infinite;
    animation-delay: 2s;
}

.home.show-animate .home-content .text-animate h3::before{
    animation: homeCursorText 6s linear infinite;
    animation-delay: 2s;
}

.home-content p{
    position: relative;
    font-size: 1.6rem;
    margin: 2rem 0 4rem;
}

/* Imagen ovalada (derecha) */
.home-image{
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    z-index: 1;
}

.home-image img{
    width: 100%;
    max-width: 42rem;
    height: auto;
    aspect-ratio: 42 / 55;
    object-fit: cover;
    object-position: center;
    border-radius: 50% / 50%;
    border: 5px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.6);
    animation: floatImage 4s ease-in-out infinite;
}

/* Botón principal (curiosidades) */
.btn{
    display: inline-block;
    padding: 14px 32px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    font-size: 1.6rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    user-select: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    z-index: 2;
    text-align: center;
    white-space: nowrap;
}
.btn:hover{
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(99, 102, 241, 0.65);
}
.btn:active{
    transform: translateY(0) scale(0.97);
}

/* Card modal */
.card{
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: min(92vw, 460px);
    max-height: 90vh;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 22px;
    padding: 32px 28px 26px;
    text-align: center;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 0.3s ease;
    z-index: 1000;
}

.card.show{
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    pointer-events: auto;
}

.card.salto{
    animation: saltar 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes saltar{
    0%   { transform: translate(-50%, -50%) scale(1); }
    35%  { transform: translate(-50%, -68%) scale(1.06) rotate(-1.5deg); }
    65%  { transform: translate(-50%, -46%) scale(0.98) rotate(1deg); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

.card .emoji{
    font-size: 3.2rem;
    display: block;
    margin-bottom: 12px;
    animation: flotar 2.5s ease-in-out infinite;
}

@keyframes flotar{
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-8px); }
}

.card h3{
    margin: 0 0 12px;
    font-size: clamp(1.2rem, 2.5vw, 1.35rem);
    background: linear-gradient(135deg, #a5b4fc, #f0abfc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.card p{
    margin: 0 0 20px;
    font-size: clamp(0.9rem, 2vw, 1rem);
    line-height: 1.6;
    color: #e2e8f0;
}

.card .cerrar{
    padding: 10px 26px;
    border: none;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.card .cerrar:hover{
    background: rgba(255, 255, 255, 0.25);
}

/* Overlay */
.overlay{
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 999;
}
.overlay.show{
    opacity: 1;
    pointer-events: auto;
}

/* Animación flotante */
@keyframes floatImage{
    0%, 100%{ transform: translateY(0); }
    50%{ transform: translateY(-1.5rem); }
}

/* ================= BTN BOX ================= */
.btn-box{
    position: relative;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    max-width: 34.5rem;
    height: 5rem;
    flex-wrap: wrap;
}
.btn-box .btn{
    position: relative;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    flex: 1 1 15rem;
    min-width: 14rem;
    height: 100%;
    background: var(--main-color);
    border: .2rem solid var(--main-color);
    border-radius: .8rem;
    font-size: 1.8rem;
    font-weight: 600;
    letter-spacing: .1rem;
    color: var(--bg-color);
    z-index: 1;
    overflow: hidden;
    transition: .5s;
}
.btn-box .btn:hover{
    color: var(--main-color);
}
.btn-box .btn:nth-child(2){
    background: transparent;
    color: var(--main-color);
}
.btn-box .btn:nth-child(2):hover{
    color: var(--bg-color);
}
.btn-box .btn:nth-child(2)::before{
    background: var(--main-color);
}
.btn-box .btn::before{
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: var(--bg-color);
    z-index: -1;
    transition: .5s;
}
.btn-box .btn:hover::before{
    width: 100%;
}

/* ================= SOCIAL ICONS ================= */
.home-sci{
    position: absolute;
    bottom: 2.5rem;
    left: 9%;
    width: 170px;
    display: flex;
    justify-content: space-between;
    gap: .6rem;
}
.home-sci a{
    position: relative;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: .2rem solid var(--main-color);
    border-radius: 50%;
    font-size: 20px;
    color: var(--main-color);
    z-index: 1;
    overflow: hidden;
    transition: .5s;
}
.home-sci a:hover{
    color: var(--bg-color);
}
.home-sci a::before{
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: var(--main-color);
    z-index: -1;
    transition: .5s;
}
.home-sci a:hover::before{
    width: 100%;
}

.home-imgHover{
    position: absolute;
    top: 0;
    right: 0;
    width: 45%;
    height: 100%;
    background: transparent;
    transition: 3s;
}
.home-imgHover:hover{
    background: var(--bg-color);
    opacity: .8;
}

/* ================= ABOUT ================= */
.about{
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 2rem;
    background: var(--second-bg-color);
    padding-bottom: 6rem;
}
.heading{
    position: relative;
    font-size: clamp(3rem, 6vw, 5rem);
    margin-bottom: 3rem;
    text-align: center;
}
span{
    color: var(--main-color);
}
.about-img{
    position: relative;
    width: 25rem;
    height: 25rem;
    max-width: 80vw;
    max-height: 80vw;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}
.about-img img{
    width: 90%;
    border-radius: 50%;
    border: .2rem solid var(--main-color);
}
.about-img .circle-spin{
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(0);
    width: 98%;
    height: 98%;
    border-radius: 50%;
    border-top: .2rem solid var(--second-bg-color);
    border-bottom: .2rem solid var(--second-bg-color);
    border-left: .2rem solid var(--main-color);
    border-right: .2rem solid var(--main-color);
    animation: aboutSpinner 8s linear infinite;
}
.about-content{
    text-align: center;
}
.about-content h3{
    position: relative;
    display: inline-block;
    font-size: 2.6rem;
}
.about-content p{
    position: relative;
    font-size: 1.6rem;
    margin: 2rem 0 3rem;
}
.btn-box.btns{
    display: inline-block;
    width: 15rem;
}
.btn-box.btns a::before{
    background: var(--second-bg-color);
}

/* ================= EDUCATION ================= */
.education{
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    min-height: auto;
    padding-bottom: 5rem;
}
.education .education-row{
    display: flex;
    flex-wrap: wrap;
    gap: 5rem;
}
.education-row .education-column{
    flex: 1 1 40rem;
}
.education-column .title{
    position: relative;
    display: inline-block;
    font-size: 2.5rem;
    margin: 0 0 1.5rem 2rem;
}
.education-column .education-box{
    position: relative;
    border-left: .2rem solid var(--main-color);
}
.education-box .education-content{
    position: relative;
    padding-left: 2rem;
}
.education-box .education-content::before{
    content: '';
    position: absolute;
    top: 0;
    left: -1.1rem;
    width: 2rem;
    height: 2rem;
    background: var(--main-color);
    border-radius: 50%;
}
.education-content .content{
    position: relative;
    padding: 1.5rem;
    border: .2rem solid var(--main-color);
    border-radius: .6rem;
    margin-bottom: 2rem;
    overflow: hidden;
}
.education-content .content::before{
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: var(--second-bg-color);
    z-index: -1;
    transition: .5s;
}
.education-content .content:hover::before{
    width: 100%;
}
.education-content .content .year{
    font-size: 1.5rem;
    color: var(--main-color);
    padding-bottom: .5rem;
}
.education-content .content .year i{
    padding-right: .5rem;
}
.education-content .content h3{
    font-size: 2rem;
}
.education-content .content p{
    font-size: 1.6rem;
    padding-top: .5rem;
}

/* ================= CONTACT ================= */
.contact{
    min-height: auto;
    padding-bottom: 7rem;
}
.contact h2{
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}
.contact form{
    max-width: 70rem;
    margin: 0 auto;
    text-align: center;
}
.contact form .input-box{
    position: relative;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1.6rem;
}
.contact form .input-box .input-field{
    position: relative;
    width: 49%;
    margin: 0;
}
.contact form .input-box .input-field input,
.contact form .textarea-field textarea{
    width: 100%;
    height: 100%;
    padding: 1.5rem;
    font-size: 1.6rem;
    color: var(--text-color);
    background: transparent;
    border-radius: .6rem;
    border: .2rem solid var(--main-color);
}
.contact form .input-box .input-field input::placeholder,
.contact form .textarea-field textarea::placeholder{
    color: var(--text-color);
}
.contact form .focus{
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: var(--second-bg-color);
    border-radius: .6rem;
    z-index: -1;
    transition: .5s;
}
.contact form .input-box .input-field input:focus~.focus,
.contact form .input-box .input-field input:valid~.focus,
.contact form .textarea-field textarea:focus~.focus,
.contact form .textarea-field textarea:valid~.focus{
    width: 100%;
}
.contact .textarea-field{
    position: relative;
    margin: .8rem 0 2.7rem;
    display: flex;
}
.contact form .textarea-field textarea{
    resize: none;
}
.contact form .btn-box.btns .btn{
    cursor: pointer;
}

/* ================= FOOTER ================= */
.footer{
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    padding: 2rem 9%;
    background: var(--second-bg-color);
}
.footer-text,
.footer-iconTop{
    position: relative;
}
.footer-text p{
    font-size: 1.6rem;
}
.footer-iconTop a{
    position: relative;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: .8rem;
    background: var(--main-color);
    border: .2rem solid var(--main-color);
    border-radius: .6rem;
    z-index: 1;
    overflow: hidden;
}
.footer-iconTop a::before{
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: var(--second-bg-color);
    z-index: -1;
    transition: .5s;
}
.footer-iconTop a:hover::before{
    width: 100%;
}
.footer-iconTop a i{
    font-size: 2.4rem;
    color: var(--bg-color);
    transition: .5s;
}
.footer-iconTop a:hover i{
    color: var(--main-color);
}

/* ================= ANIMATIONS SCROLL ================= */
.animate{
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    z-index: 98;
}
.animate.home-img{
    width: 50%;
}
.logo .animate,
.navbar .animate,
#menu-icon .animate,
.home.show-animate .animate{
    animation: showRight 1s ease forwards;
    animation-delay: calc(.3s * var(--i));
}
.animate.scroll{
    transition: 1s ease;
    transition-delay: calc(.3s / var(--i));
    animation: none;
}
section:nth-child(odd) .animate.scroll,
.footer .animate.scroll{
    background: var(--second-bg-color);
}
.education .education-box .animate.scroll{
    width: 105%;
}
.about.show-animate .animate.scroll,
.education.show-animate .animate.scroll,
.skills.show-animate .animate.scroll,
.contact.show-animate .animate.scroll,
.footer.show-animate .animate.scroll{
    transition-delay: calc(.3s * var(--i));
    width: 0;
}

/* =====================================================
   BREAKPOINTS RESPONSIVE — TABLET / CELULAR ESTÁNDAR
   ===================================================== */

/* ---------- 1200px: Tablets grandes / laptops chicas ---------- */
@media (max-width: 1200px){
    html{ font-size: 55%; }
    .header{ padding: 2rem 5%; }
    section{ padding: 10rem 5% 2rem; }
    .home{ padding: 0 5%; }
    .home-sci{ left: 5%; }
    .footer{ padding: 2rem 5%; }
}

/* ---------- 1024px: Tablets horizontales (iPad landscape) ---------- */
@media (max-width: 1024px){
    .header{ padding: 1.8rem 4%; }
    section{ padding: 10rem 4% 2rem; }
    .home{
        padding: 9rem 4% 6rem;
        gap: 3rem;
    }
    .home-content{ max-width: 55rem; }
    .home-image img{ max-width: 36rem; }
    .home-sci{ left: 4%; }
    .footer{ padding: 2rem 4%; }
    .education .education-row{ gap: 3rem; }
    .education-row .education-column{ flex: 1 1 100%; }
}

/* ---------- 991px: Tablet vertical / transición a columna ---------- */
@media (max-width: 991px){
    html{ font-size: 57.5%; }

    .home{
        flex-direction: column;
        justify-content: center;
        text-align: center;
        gap: 3rem;
        padding: 10rem 5% 8rem;
        min-height: auto;
    }
    .home-content{
        max-width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .home-content .text-animate{
        margin: 0 auto;
        width: 100%;
        max-width: 36rem;
    }
    .home-content .text-animate h3{
        text-align: center;
    }
    .home-image{
        justify-content: center;
        width: 100%;
    }
    .home-image img{
        max-width: 32rem;
    }
    .home-sci{
        position: relative;
        bottom: auto;
        left: auto;
        margin-top: 3rem;
    }
    .home-imgHover{ display: none; }
    .btn-box{
        justify-content: center;
        max-width: 34rem;
    }

    .about{ padding-bottom: 5rem; }
    .about-img{ width: 22rem; height: 22rem; }

    .contact form .input-box .input-field{
        width: 48%;
    }
}

/* ---------- 850px: Tablets verticales medianas ---------- */
@media (max-width: 850px){
    .animate.home-img{ width: 55%; }
    .heading{ font-size: 4rem; }
    .education-column .title{ margin-left: 1rem; }
}

/* ---------- 768px: Tablets pequeñas / menú hamburguesa ---------- */
@media (max-width: 768px){
    html{ font-size: 55%; }

    .header{
        padding: 1.6rem 4%;
        background: var(--bg-color);
    }
    .logo{ font-size: 2.3rem; }

    #menu-icon{
        display: block;
        font-size: 3.4rem;
    }

    .navbar{
        position: absolute;
        top: 100%;
        left: -100%;
        width: 100%;
        padding: 1rem 4%;
        background: var(--main-color);
        box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .2);
        z-index: 1;
        transition: .25s ease;
        transition-delay: .25s;
    }
    .navbar.active{ left: 0; transition-delay: 0s; }

    .navbar .active-nav{
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: var(--bg-color);
        border-top: .1rem solid rgba(0, 0, 0, .2);
        z-index: -1;
        transition: .25s ease;
        transition-delay: 0s;
    }
    .navbar.active .active-nav{ left: 0; transition-delay: .25s; }

    .navbar a{
        display: block;
        font-size: 2rem;
        margin: 3rem 0;
        transform: translateX(-20rem);
        transition: .25s ease;
        transition-delay: 0s;
    }
    .navbar.active a{
        transform: translateX(0);
        transition-delay: .25s;
    }

    .home{
        padding: 8rem 4% 6rem;
        gap: 2.5rem;
    }
    .home-content h1{
        font-size: clamp(3rem, 7vw, 4.4rem);
    }
    .home-content .text-animate{
        max-width: 30rem;
    }
    .home-content .text-animate h3{
        font-size: clamp(1.8rem, 4.5vw, 2.6rem);
    }
    .home-content p{
        font-size: 1.5rem;
        margin: 1.6rem 0 3rem;
    }
    .home-image img{
        max-width: 28rem;
    }
    .btn{
        font-size: 1.5rem;
        padding: 12px 26px;
    }

    .about{ padding: 8rem 4% 5rem; }
    .about-img{ width: 20rem; height: 20rem; }
    .about-content h3{ font-size: 2.3rem; }
    .about-content p{ font-size: 1.5rem; }

    .education{ padding: 8rem 4% 5rem; }
    .education .education-row{
        flex-direction: column;
        gap: 3rem;
    }
    .education-row .education-column{ flex: 1 1 100%; }
    .education-column .title{
        font-size: 2.2rem;
        margin-left: 1rem;
    }
    .education-content .content{ padding: 1.2rem; }
    .education-content .content h3{ font-size: 1.8rem; }
    .education-content .content p{ font-size: 1.5rem; }

    .contact{ padding: 8rem 4% 6rem; }
    .contact form .input-box{ gap: 1.2rem; }
    .contact form .input-box .input-field{ width: 100%; }
    .contact form .textarea-field{ margin: .6rem 0 2.4rem; }

    .footer{
        padding: 2rem 4%;
        gap: 1rem;
    }
    .footer-text p{ font-size: 1.4rem; }

    .card{
        padding: 26px 22px 22px;
        width: min(92vw, 420px);
    }
    .card h3{ font-size: 1.4rem; }
    .card p{ font-size: 1rem; }
}

/* ---------- 600px: Móviles grandes (iPhone Plus, Android XL) ---------- */
@media (max-width: 600px){
    html{ font-size: 52.5%; }

    .header{ padding: 1.4rem 4%; }
    .logo{ font-size: 2.1rem; }

    .home{
        padding: 7rem 4% 5rem;
        gap: 2rem;
    }
    .home-content h1{
        font-size: clamp(2.6rem, 8vw, 3.8rem);
        line-height: 1.25;
    }
    .home-content .text-animate{ max-width: 100%; }
    .home-content .text-animate h3{
        font-size: clamp(1.6rem, 5vw, 2.2rem);
    }
    .home-image img{ max-width: 24rem; }

    .home-sci{
        width: 150px;
        gap: .8rem;
    }
    .home-sci a{
        width: 36px;
        height: 36px;
        font-size: 1.6rem;
    }

    .btn-box{
        max-width: 100%;
        gap: 1rem;
        height: auto;
    }
    .btn-box .btn{
        min-width: 12rem;
        height: 4.4rem;
        font-size: 1.5rem;
    }

    .heading{ font-size: 3.4rem; }

    .about-img{ width: 18rem; height: 18rem; }
    .about-content h3{ font-size: 2.1rem; }
    .about-content p{ font-size: 1.4rem; }

    .education-content .content h3{ font-size: 1.7rem; }
    .education-content .content p{ font-size: 1.4rem; }

    .contact form .input-box .input-field input,
    .contact form .textarea-field textarea{
        font-size: 1.5rem;
        padding: 1.2rem;
    }

    .footer{
        flex-direction: column-reverse;
        text-align: center;
        gap: 1.5rem;
    }
    .footer-text p{ font-size: 1.3rem; }
}

/* ---------- 520px: Móviles medianos (iPhone 12/13/14) ---------- */
@media (max-width: 520px){
    html{ font-size: 50%; }

    .home-content h1{
        display: flex;
        flex-direction: column;
        align-items: center;
        font-size: clamp(2.4rem, 9vw, 3.6rem);
    }
    .home-image img{
        max-width: 22rem;
        border-width: 4px;
    }

    .home-sci{
        width: 140px;
        gap: .6rem;
        justify-content: center;
    }
    .home-sci a{
        width: 34px;
        height: 34px;
        font-size: 1.5rem;
    }

    .btn-box{
        flex-direction: column;
        height: auto;
        gap: 1.2rem;
        align-items: center;
    }
    .btn-box .btn{
        width: 100%;
        max-width: 26rem;
        height: 4.6rem;
        flex: none;
        font-size: 1.5rem;
    }

    .card{
        padding: 22px 18px 20px;
        width: 94vw;
        border-radius: 18px;
    }
    .card .emoji{ font-size: 2.8rem; }
    .card h3{ font-size: 1.3rem; }
    .card p{ font-size: 0.95rem; }
    .card .cerrar{ padding: 9px 22px; font-size: 1rem; }

    .about-img{ width: 16rem; height: 16rem; }
    .heading{ font-size: 3rem; }
}

/* ---------- 462px: Móviles compactos (iPhone SE, Android chicos) ---------- */
@media (max-width: 462px){
    html{ font-size: 47.5%; }

    .home-content h1{
        font-size: clamp(2.2rem, 9vw, 3.2rem);
    }
    .home-content .text-animate h3{
        font-size: clamp(1.5rem, 5.5vw, 2rem);
    }
    .home-content p{
        font-size: 1.35rem;
        margin: 1.4rem 0 2.4rem;
    }
    .home-image img{ max-width: 20rem; }

    .education{
        padding: 8rem 4% 5rem 5%;
    }
    .education-column .title{ font-size: 2rem; }
    .education-content .content{ margin-bottom: 1.6rem; }
    .education-content .content h3{ font-size: 1.6rem; }
    .education-content .content p{ font-size: 1.3rem; }
    .education-content .content .year{ font-size: 1.3rem; }

    .contact form .input-box .input-field{ width: 100%; }

    .footer{
        flex-direction: column-reverse;
        gap: 1.5rem;
    }
    .footer p{
        margin-top: 1.5rem;
        text-align: center;
    }

    .card{ width: 96vw; }
    .card p{ font-size: 0.9rem; }
}

/* ---------- 371px: Móviles muy pequeños (iPhone SE 1st gen) ---------- */
@media (max-width: 371px){
    html{ font-size: 45%; }

    .header{ padding: 1.2rem 4%; }
    .logo{ font-size: 2rem; }
    #menu-icon{ font-size: 3rem; }

    .home{
        justify-content: center;
        padding: 6rem 4% 4rem;
    }
    .home-content{
        display: flex;
        align-items: center;
        flex-direction: column;
        text-align: center;
    }
    .home-content h1{ font-size: clamp(2rem, 10vw, 3rem); }
    .home-content .text-animate h3{ font-size: clamp(1.4rem, 6vw, 1.8rem); }
    .home-content p{ font-size: 1.3rem; }
    .home-image img{ max-width: 18rem; }

    .home-sci{ width: 130px; }
    .home-sci a{ width: 32px; height: 32px; font-size: 1.4rem; }

    .btn-box .btn{
        max-width: 100%;
        height: 4.2rem;
        font-size: 1.4rem;
    }

    .heading{ font-size: 2}

    .about-img{
        width: 14rem;
        height: 14rem;
    }
    .about-content h3{
        font-size: 2rem;
    }
    .about-content p{
        font-size: 1.3rem;
        margin: 1.4rem 0 2rem;
    }

    .card{
        width: 96vw;
        padding: 20px 16px 18px;
        border-radius: 16px;
    }
    .card .emoji{
        font-size: 2.4rem;
        margin-bottom: 8px;
    }
    .card h3{
        font-size: 1.2rem;
        margin-bottom: 8px;
    }
    .card p{
        font-size: 0.85rem;
        margin-bottom: 16px;
    }
    .card .cerrar{
        padding: 8px 20px;
        font-size: 0.95rem;
    }

    .overlay{
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
    }
}

/* =====================================================
   ORIENTACIÓN LANDSCAPE EN MÓVILES (pantalla baja)
   ===================================================== */
@media (max-width: 900px) and (orientation: landscape) and (max-height: 500px){
    section{
        min-height: auto;
        padding: 6rem 4% 2rem;
    }

    .home{
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        text-align: left;
        gap: 2rem;
        padding: 6rem 4% 2rem;
        min-height: auto;
    }
    .home-content{
        max-width: 55%;
        align-items: flex-start;
    }
    .home-content h1{
        font-size: clamp(2.2rem, 5vw, 3.2rem);
        line-height: 1.2;
    }
    .home-content .text-animate{
        width: 100%;
        max-width: 28rem;
        margin: 0;
    }
    .home-content .text-animate h3{
        font-size: clamp(1.5rem, 3.5vw, 2rem);
        text-align: left;
    }
    .home-content p{
        font-size: 1.3rem;
        margin: 1rem 0 1.8rem;
    }
    .home-image{
        justify-content: flex-end;
        width: auto;
        flex: 0 0 auto;
    }
    .home-image img{
        max-width: 16rem;
        aspect-ratio: 42 / 55;
        border-width: 3px;
    }
    .home-sci{
        position: relative;
        bottom: auto;
        left: auto;
        margin-top: 1.2rem;
        width: 130px;
    }
    .home-sci a{
        width: 30px;
        height: 30px;
        font-size: 1.3rem;
    }
    .home-imgHover{
        display: none;
    }
}

/* =====================================================
   KEYFRAMES
   ===================================================== */
@keyframes homeBgText{
    0%,
    10%,
    100%{
        background-position: -33rem 0;
    }
    65%,
    85%{
        background-position: 0 0;
    }
}

@keyframes homeCursorText{
    0%,
    10%,
    100%{
        width: 0;
    }
    65%,
    78%,
    85%{
        width: 100%;
        opacity: 1;
    }
    75%,
    81%{
        opacity: 0;
    }
}

@keyframes aboutSpinner{
    100%{
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

@keyframes showRight{
    100%{
        width: 0;
    }
}
.home{
    padding-top: max(9rem, 8rem + env(safe-area-inset-top, 0px));
}

.home-content h1{
    margin-top: 1rem;
}