@media (max-width: 860px) {
    :root {
        --nav-height: 66px;
    }

    .portfolio-section {
        padding: clamp(64px, 15vw, 96px) 0;
    }

    .experience-sequence.portfolio-section {
        padding: 0;
    }

    .section-inner {
        width: min(var(--container-wide), calc(100% - 30px));
    }

    .public-menu-button {
        display: inline-grid;
        gap: 4px;
        width: 42px;
        height: 42px;
        place-content: center;
        background: transparent;
        border: 1px solid var(--border-soft);
        border-radius: 50%;
    }

    .public-menu-button span:not(.sr-only) {
        display: block;
        width: 18px;
        height: 2px;
        background: var(--text-primary);
    }

    .public-links {
        position: absolute;
        top: calc(var(--nav-height) - 6px);
        left: 18px;
        right: 18px;
        display: none;
        flex-direction: column;
        align-items: stretch;
        padding: 18px;
        background: rgba(3, 4, 6, 0.96);
        border: 1px solid var(--border-soft);
        border-radius: var(--radius-panel);
    }

    .public-links.is-open {
        display: flex;
    }

    .hero-inner,
    .music-layout,
    .project-grid,
    .skill-grid {
        grid-template-columns: 1fr;
    }

    .hero-portrait-wrap {
        order: -1;
        opacity: 0.72;
    }

    .hero-section {
        min-height: auto;
        align-items: start;
        padding-top: calc(var(--nav-height) + 26px);
        padding-bottom: 76px;
    }

    .hero-inner {
        gap: 28px;
    }

    .hero-copy h1 {
        max-width: 6.5ch;
        font-size: clamp(3.65rem, 17vw, 5.15rem);
        line-height: 0.9;
    }

    .hero-title {
        margin-top: 18px;
        font-size: clamp(1.25rem, 5.6vw, 1.7rem);
        line-height: 1.18;
    }

    .hero-support {
        max-width: 34ch;
        font-size: 1rem;
        line-height: 1.55;
    }

    .hero-meta {
        gap: 8px;
        margin: 20px 0;
    }

    .hero-meta span,
    .tool-list li {
        padding: 6px 9px;
        font-size: 0.76rem;
    }

    .hero-actions {
        gap: 10px;
    }

    .hero-actions .button-primary,
    .hero-actions .button-secondary {
        min-height: 40px;
        padding-inline: 13px;
        font-size: 0.86rem;
    }

    .hero-portrait {
        width: min(68vw, 300px);
        height: min(68vw, 300px);
        inline-size: min(68vw, 300px);
        block-size: min(68vw, 300px);
    }

    .hero-background-cog {
        width: clamp(360px, 96vw, 560px);
        inset: auto clamp(-310px, -42vw, -170px) clamp(-185px, -15vh, -100px) auto;
        opacity: 0.48;
    }

    .music-brand-title {
        font-size: clamp(3.1rem, 17vw, 5.6rem);
    }

    .music-brand-subtitle {
        max-width: 16ch;
    }

    .hero-coordinate-label {
        display: none;
    }

    .system-cog {
        width: 58px;
        height: 58px;
        right: 14px;
        bottom: calc(env(safe-area-inset-bottom, 0px) + 14px);
    }

    .cog-gear {
        font-size: 28px;
    }
}

@media (max-width: 520px) {
    .public-nav {
        padding-inline: 16px;
    }

    .public-brand {
        width: 42px;
        height: 42px;
        font-size: 0.98rem;
    }

    .portfolio-section {
        padding-block: 58px;
    }

    .experience-sequence.portfolio-section {
        padding-block: 0;
    }

    .hero-section {
        padding-top: calc(var(--nav-height) + 18px);
        padding-bottom: 58px;
    }

    .hero-inner {
        gap: 22px;
    }

    .hero-copy h1 {
        font-size: clamp(3.15rem, 15.5vw, 4.2rem);
    }

    .hero-title {
        font-size: clamp(1.15rem, 5vw, 1.45rem);
    }

    .hero-support {
        font-size: 0.96rem;
    }

    .hero-portrait {
        width: min(62vw, 260px);
        height: min(62vw, 260px);
        inline-size: min(62vw, 260px);
        block-size: min(62vw, 260px);
    }

    .hero-meta span {
        font-size: 0.72rem;
    }

    .chatbot-launch {
        right: 12px;
        bottom: calc(env(safe-area-inset-bottom, 0px) + 76px);
        min-height: 38px;
        max-width: calc(100vw - 118px);
        padding-inline: 12px;
        gap: 8px;
        font-size: 0.76rem;
        white-space: nowrap;
    }

    .chatbot-launch::before {
        width: 7px;
        height: 7px;
        flex: 0 0 auto;
    }

    .system-cog {
        width: 52px;
        height: 52px;
    }

    .cog-gear {
        font-size: 25px;
    }
}

@media (max-width: 370px) {
    .chatbot-launch {
        width: 44px;
        min-width: 44px;
        max-width: 44px;
        padding-inline: 0;
        overflow: hidden;
        color: transparent;
    }

    .chatbot-launch::before {
        margin: 0;
    }
}
