/* --- VIEWPORT: MOBILE (<768px) --- */
.hamburger {
    display: none;
}

@media screen and (max-width: 768px) {
    .hamburger {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 30px;
        height: 21px;
        cursor: pointer;
        order: 3;
        margin-left: 16px;
        z-index: 1100;
    }

    .nav-container .lang-switch {
        margin-left: auto;
    }

    .hamburger .bar {
        height: 3px;
        width: 100%;
        background-color: var(--text-main);
        border-radius: 3px;
        transition: var(--transition);
    }

    .hamburger.active .bar:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }
    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }
    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }

    .main-nav {
        position: absolute;
        top: max(7vh, 60px);
        right: 0;
        width: 100%;
        height: auto;
        background-color: rgba(6, 13, 31, 0.97);
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        overflow: hidden;
        max-height: 0;
        visibility: hidden;
        padding: 0;
        transition: max-height 0.4s ease-in-out, padding 0.4s ease-in-out, visibility 0.4s;
        border-bottom: 2px solid transparent;
        display: flex !important;
    }

    .main-nav.active {
        max-height: 450px;
        visibility: visible;
        padding-top: 10px;
        padding-bottom: 10px;
        border-bottom: 2px solid var(--primary-color);
        box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    }

    .main-nav__item {
        width: 100%;
        text-align: center;
        padding-right: 0;
    }

    .main-nav__item a {
        display: block;
        padding: 15px 0;
        font-size: var(--text-md);
    }

    .main-nav__item a:hover,
    .main-nav__item a.active {
        background-color: rgba(10, 54, 180, 0.2);
        border-bottom: 2px solid transparent;
    }

    #container-certificate {
        position: relative;
        left: 50%;
        margin-left: -450px;
    }

    .certificado {
        transform: scale(0.85);
    }

    .certificado.activo {
        transform: scale(1.05);
    }

    #titulo {
        flex-direction: column-reverse;
        justify-content: center;
        text-align: center;
        padding-top: calc(max(7vh, 60px) + 30px);
        gap: 0;
    }

    .hero-texto {
        align-items: center;
    }

    .hero-texto h1 { text-align: center; font-size: 3.6rem; }
    .hero-role { font-size: 2rem; }
    .hero-stack { font-size: var(--text-sm); }

    .hero-imagen { margin-bottom: 30px; }
    .hero-imagen img { max-width: 220px; }

    .hero-btns {
        justify-content: center;
    }

    .hero-social {
        width: 100%;
        justify-content: center;
    }

    #container-projects {
        grid-template-columns: 1fr;
    }

    .about-text {
        padding: 24px;
    }
}
