/* ── Default: hide hamburger, always visible above 900px ── */
#menu {
    display: none;
}

@media (max-width: 1775px) {
    #typewriter-line {
        display: block;
        margin-top: 5px;
        font-size: 0.75em;
    }
}

@media (max-width:1510px) {
    #home {
        gap: 5rem;
    }

    #profile-photo img {
        height: 45vh;
    }

    #typewriter-line {
        display: block;
        margin-top: 5px;
        font-size: 0.61em;
    }

    .btn {
        font-size: 0.4em;
    }

    #project-btn {
        font-size: 0.7em;
    }
}



/* Large tablets and small laptops */
@media (max-width: 1200px) {
    header {
        padding: 1em 1.5em 1em 2em;
    }

    section {
        width: 88vw;
        padding: 3.5em;
        min-height: auto;
    }

    #home {
        gap: 2rem;
    }

    #typewriter-line {
        display: block;
        margin-top: 5px;
        font-size: 0.62em;
    }

    #introduction {
        font-size: 1.65em;
    }

    .btn {
        font-size: 0.4em;
    }

    #profile-photo img {
        height: 45vh;
    }

    #project-section {
        grid-template-columns: repeat(2, 1fr);
    }

    .project {
        width: auto;
        height: 100%;
    }

    .project-image {
        width: 100%;
        height: 24vh;
    }

    #skills-sections {
        grid-template-columns: repeat(2, 1fr);
    }

    .skill-section {
        width: 100%;
        height: auto;
        min-height: 20vh;
    }

    #contact-section {
        flex-wrap: wrap;
        gap: 1rem;
        justify-content: center;
    }

    .contact-links {
        width: 22vw;
        min-width: 170px;
        height: 3.4rem;
    }
}

@media (max-width: 1100px) {
    header h1{
        font-size: 1.25em;
    }
}

/* Tablets */
@media (max-width: 992px) {
    header {
        padding: 1em 1.25em;
    }

    header h1 {
        font-size: 1.2rem;
    }

    header nav ul {
        gap: 0.65rem;
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    header nav a {
        font-size: 0.82rem;
        padding: 0.35em 0.55em;
    }

    section {
        width: 92vw;
        padding: 2.5em;
        margin: 8vh auto;
    }

    #home {
        flex-direction: column-reverse;
        text-align: center;
    }

    #typewriter-line {
        display: inline;
        font-size: 1em;
    }

    #introduction {
        width: 100%;
        font-size: 1.55em;
    }

    .home-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }

    #profile-photo img {
        height: 42vh;
    }

    #project-section {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    #skills-sections {
        grid-template-columns: repeat(2, 1fr);
    }

    #contact-section {
        flex-wrap: wrap;
    }

    .contact-links {
        width: 30vw;
    }

    footer {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
        padding: 0 1rem;
    }
}

@media (max-width:915px) {
    header nav {
        display: none;
    }

    #menu {
        display: block;
        top: 1.2rem;
        right: 1rem;
    }

    header h1 {
        font-size: 2em;
        letter-spacing: 1px;
    }
}

/* Small tablets and large phones */
@media (max-width: 768px) {
    header {
        padding: 1rem 1rem;
        height: auto;
        min-height: 9vh;
    }

    header h1 {
        font-size: 1.75em;
        letter-spacing: 1px;
    }

    header nav {
        display: none;
    }

    #menu {
        display: block;
        top: 1.2rem;
        right: 1rem;
    }

    #toggle-drawer {
        height: 34px;
        width: 34px;
    }

    #drawer {
        width: min(78vw, 360px);
        padding: 2rem 1.5rem;
    }

    .hide {
        transform: translateX(100%);
    }

    .show {
        transform: translateX(0);
    }

    section {
        width: 94vw;
        padding: 2rem 1.25rem;
        margin: 7vh auto;
        border-radius: 0.75rem;
    }

    #home {
        gap: 1.5rem;
    }

    #introduction {
        font-size: 1.3em;
        line-height: 1.4;
    }

    .home-buttons {
        margin-top: 1.2rem;
    }

    .btn {
        padding: 0.9rem 1rem;
        font-size: 0.95rem;
    }

    .cv {
        font-size: 0.75rem;
    }

    #profile-photo img {
        height: 34vh;
        max-width: 85vw;
    }

    section h1 {
        font-size: 1.7rem;
    }

    section p {
        font-size: 1rem;
        letter-spacing: 0.04em;
        word-spacing: 0.08em;
        line-height: 1.6em;
    }

    #project-section {
        grid-template-columns: 1fr;
        padding: 0;
    }

    .project {
        width: 100%;
        min-height: 22rem;
    }

    .project-image {
        width: 100%;
        height: 18rem;
    }

    #skills-sections {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .skill-section {
        width: 100%;
        min-height: auto;
    }

    .skill-names {
        grid-template-columns: repeat(3, 1fr);
    }

    #educations {
        gap: 0.9rem;
    }

    .degree-name,
    .time-span {
        display: block;
        font-size: 1.05rem;
    }

    .institution-name {
        font-size: 0.95rem;
        word-break: break-word;
    }

    #contact-section {
        flex-direction: column;
        align-items: stretch;
    }

    .contact-links {
        width: 100%;
        min-width: 0;
        height: 3.6rem;
    }

    hr {
        width: 88vw;
    }
}

/* Phones */
@media (max-width: 576px) {
    header {
        padding: 0.85rem 0.9rem;
    }

    header h1 {
        font-size: 1.5em;
        max-width: 70vw;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    #menu {
        top: 0.9rem;
        right: 0.8rem;
    }

    section {
        width: 94vw;
        padding: 1.35rem 1rem;
        margin: 6vh auto;
        scroll-margin-top: 14vh;
    }

    #home {
        min-height: auto;
    }

    #introduction {
        font-size: 1.12em;
    }

    #profile-photo img {
        height: 28vh;
    }

    .home-buttons {
        gap: 0.6rem;
    }

    .btn {
        width: auto;
        text-align: center;
        font-size: 0.88rem;
    }

    section h1 {
        font-size: 1.45rem;
        margin-bottom: 0.25rem;
    }

    section p {
        font-size: 0.95rem;
        line-height: 1.7em;
        margin-bottom: 1.25rem;
    }

    .project {
        min-height: 19rem;
        padding: 0.85rem;
    }

    .project-image {
        height: 14rem;
    }

    .project-name {
        font-size: 1rem;
        margin-top: 0.4rem;
    }

    .project-description {
        font-size: 0.9rem;
    }

    .skill-heading {
        font-size: 1rem;
    }

    .skill-names {
        grid-template-columns: repeat(2, 1fr);
    }

    .skill-name {
        font-size: 0.75rem;
        padding: 0.28rem 0.55rem;
    }

    .degree {
        padding: 0.9rem;
    }

    .degree-name,
    .time-span {
        font-size: 1rem;
    }

    .institution-name {
        font-size: 0.88rem;
    }

    #drawer {
        width: 84vw;
    }

    #drawer>ul {
        gap: 1.35rem;
    }

    #drawer>ul a {
        font-size: 1.15rem;
    }

    footer {
        font-size: 0.82rem;
    }
}

/* Very small phones */
@media (max-width: 380px) {
    header h1 {
        font-size: 1.25em;
    }

    section {
        padding: 1.1rem 0.85rem;
    }

    #introduction {
        font-size: 1rem;
    }

    #profile-photo img {
        height: 24vh;
    }

    .btn {
        font-size: 0.8rem;
        padding: 0.8rem 0.9rem;
    }

    .project {
        min-height: 17rem;
    }

    .project-image {
        height: 12rem;
    }

    .skill-names {
        grid-template-columns: 1fr;
    }

    .contact-links {
        height: 3.2rem;
        font-size: 0.92rem;
    }
}