@media (max-width: 1180px) {
    .header,
    .section-shell,
    .hero,
    .footer {
        padding-left: 6%;
        padding-right: 6%;
    }

    .navbar {
        gap: 2px;
    }

    .navbar a {
        padding: 8px;
        font-size: 0.86rem;
    }

    .hero h1 {
        font-size: 3.9rem;
    }

    .hero__content {
        gap: 44px;
    }

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

@media (max-width: 1080px) {
    :root {
        --header-height: 76px;
    }

    .navbar {
        position: absolute;
        top: calc(100% + 10px);
        right: 6%;
        width: min(320px, 88vw);
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        border: 1px solid var(--border);
        border-radius: var(--radius);
        background: var(--surface);
        padding: 10px;
        box-shadow: var(--shadow);
    }

    .navbar.active {
        display: flex;
    }

    .navbar a {
        padding: 12px;
    }

    .menu-mobile {
        display: inline-flex;
    }

    .hero {
        min-height: auto;
        padding-top: calc(var(--header-height) + 52px);
    }

    .hero__content,
    .about-layout,
    .contact-panel {
        grid-template-columns: 1fr;
    }

    .hero__text {
        justify-items: start;
    }

    .hero__visual {
        width: min(330px, 100%);
        max-width: 330px;
        justify-self: start;
    }

    .profile-card img {
        height: 300px;
    }

    .architecture-card {
        display: none;
    }

    .metrics-grid,
    .tech-categories,
    .projects-grid {
        grid-template-columns: 1fr 1fr;
    }

    .project-card--featured {
        grid-template-columns: 1fr;
    }

    .project-card--featured .project-info {
        padding: 0 24px 26px;
    }

    .project-card--featured .carousel-viewport {
        min-height: 330px;
    }

    .work-grid,
    .cert-grid {
        grid-template-columns: 1fr;
    }

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

@media (min-width: 900px) and (max-width: 1080px) {
    .hero__content {
        grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.5fr);
        align-items: center;
        gap: 34px;
    }

    .hero__visual {
        width: min(300px, 100%);
        max-width: 300px;
        justify-self: end;
    }

    .profile-card img {
        height: 300px;
    }
}

@media (max-width: 760px) {
    .header,
    .section-shell,
    .hero,
    .footer {
        padding-left: 5%;
        padding-right: 5%;
    }

    .header {
        gap: 12px;
    }

    .logo__text small {
        display: none;
    }

    .section-shell {
        padding-top: 68px;
        padding-bottom: 68px;
    }

    .section-title h2,
    .contact-copy h2 {
        font-size: 1.85rem;
    }

    .hero {
        padding-top: calc(var(--header-height) + 40px);
        padding-bottom: 46px;
    }

    .hero__content {
        gap: 30px;
    }

    .hero__text {
        justify-items: stretch;
    }

    .hero h1 {
        font-size: 3.05rem;
    }

    .hero__role {
        font-size: 1.2rem;
        margin-bottom: 12px;
    }

    .hero__description {
        font-size: 1rem;
        line-height: 1.72;
    }

    .hero__visual {
        width: min(300px, 82vw);
        max-width: 300px;
        justify-self: center;
    }

    .profile-card img {
        height: 300px;
        padding: 10px;
    }

    .architecture-card {
        display: none;
    }

    .hero__actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        margin-top: 24px;
        width: 100%;
    }

    .hero__actions .btn {
        min-height: 46px;
        padding: 12px 10px;
        font-size: 0.9rem;
        text-align: center;
        width: 100%;
    }

    .resume-preview-link {
        margin-top: 10px;
    }

    .hero__stack {
        gap: 8px;
        margin-top: 22px;
    }

    .hero__stack li {
        padding: 7px 9px;
        font-size: 0.8rem;
    }

    .metrics-grid,
    .tech-categories,
    .projects-grid,
    .roadmap-grid {
        grid-template-columns: 1fr;
    }

    .metric-card {
        min-height: 112px;
    }

    .about-card,
    .work-card,
    .tech-category,
    .experience-card,
    .cert-card,
    .roadmap-card {
        padding: 22px;
    }

    .experience-card__header,
    .resume-modal__header,
    .resume-modal__footer,
    .footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .experience-date {
        white-space: normal;
    }

    .project-carousel {
        padding: 14px;
    }

    .project-card--featured .carousel-viewport {
        min-height: 230px;
    }

    .project-info,
    .project-card--featured .project-info {
        padding: 0 18px 22px;
    }

    .project-buttons,
    .contact-actions {
        flex-direction: column;
    }

    .btn-github,
    .btn-demo,
    .contact-actions .btn {
        width: 100%;
    }

    .resume-modal {
        padding: 14px;
    }

    .resume-modal__dialog {
        max-height: calc(100vh - 28px);
    }

    .resume-modal__content,
    .resume-modal__content iframe {
        min-height: 58vh;
    }

    .contact-panel {
        padding: 20px;
    }

    .contact-form textarea {
        min-height: 112px;
    }

    #backToTop {
        right: 16px;
        bottom: 16px;
        width: 44px;
        height: 44px;
    }

    .footer-links {
        width: 100%;
    }
}

@media (max-width: 560px) {
    .logo__text {
        display: none;
    }

    .language-button {
        padding-left: 10px;
        padding-right: 10px;
    }

    .language-button__label {
        max-width: 82px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .header-actions {
        gap: 6px;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero__visual {
        width: min(250px, 76vw);
    }

    .profile-card img {
        height: 250px;
    }

    .section-title h2,
    .contact-copy h2 {
        font-size: 1.65rem;
    }

    .carousel-arrow {
        width: 36px;
        height: 36px;
    }

    .carousel-arrow--prev {
        left: 8px;
    }

    .carousel-arrow--next {
        right: 8px;
    }
}

@media (max-width: 420px) {
    .header {
        gap: 8px;
    }

    .language-button {
        width: 42px;
        justify-content: center;
        padding: 0;
    }

    .language-button__label {
        display: none;
    }

    .language-menu {
        right: -52px;
        min-width: 176px;
    }

    .theme-toggle,
    .menu-mobile {
        width: 40px;
        min-height: 40px;
    }
}
