@media screen and (max-width: 1100px) {
    .site-nav {
        gap: 14px;
        padding: 14px 16px 14px 20px;
    }
    .nav-panel {
        gap: 12px;
    }
    .nav-links {
        padding: 5px;
    }
    .nav-links a {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
    .nav-actions {
        gap: 8px;
    }
    .nav-actions .button {
        min-height: 44px;
        padding: 0 14px;
        font-size: 0.9rem;
    }
    .nav-actions .theme-toggle {
        width: 44px;
        height: 44px;
    }
    .hero,
    .contact-panel {
        grid-template-columns: 1fr;
    }
    .hero-signals,
    .overview-grid,
    .project-grid,
    .skills-grid,
    .profile-focus-layout {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .timeline-meta {
        padding-bottom: 16px;
    }
    .hero h1 {
        max-width: 14ch;
    }
}
@media screen and (max-width: 860px) {
    :root {
        --nav-height: 64px;
        --shell: min(100vw - 28px, 100%);
        --edge-offset: max(14px, calc((100vw - var(--shell)) / 2));
    }
    html {
        scroll-padding-top: 92px;
    }
    .site-header {
        padding-top: 10px;
    }
    .site-nav {
        --mobile-nav-surface: #fff8f0;
        --mobile-nav-overlay-surface: linear-gradient(180deg, #fffaf3 0%, #f8efdf 100%);
        --mobile-nav-radius: 36px;
        position: relative;
        gap: 10px;
        padding: 10px 14px;
        min-height: 64px;
        border-radius: var(--mobile-nav-radius);
        border: 1px solid var(--border-strong);
        background: var(--mobile-nav-surface);
        box-shadow: 0 14px 34px rgba(35, 25, 16, 0.14);
        backdrop-filter: none;
        transition: border-radius 280ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 260ms ease, border-color 220ms ease, background-color 220ms ease;
    }
    body.dark-mode .site-nav {
        --mobile-nav-surface: #14181d;
        --mobile-nav-overlay-surface: linear-gradient(180deg, #11161c 0%, #18212a 100%);
        background: var(--mobile-nav-surface);
        box-shadow: 0 14px 34px rgba(0, 0, 0, 0.34);
    }
    .site-nav.is-scrolled {
        background: var(--mobile-nav-surface);
        border-color: var(--border-strong);
        box-shadow: 0 14px 34px rgba(35, 25, 16, 0.14);
    }
    body.dark-mode .site-nav.is-scrolled {
        background: var(--mobile-nav-surface);
        box-shadow: 0 14px 34px rgba(0, 0, 0, 0.34);
    }
    .site-nav.menu-open {
        border-radius: var(--mobile-nav-radius);
        background: var(--mobile-nav-surface);
        box-shadow: 0 12px 26px rgba(35, 25, 16, 0.16);
    }
    body.dark-mode .site-nav.menu-open {
        box-shadow: 0 12px 26px rgba(0, 0, 0, 0.38);
    }
    .nav-mobile-controls {
        display: inline-flex;
        position: relative;
        z-index: 6;
    }
    .brand {
        position: relative;
        z-index: 6;
        font-size: 0.98rem;
        letter-spacing: 0.085em;
    }
    .nav-toggle {
        display: inline-flex;
    }
    .theme-toggle-mobile {
        display: inline-flex;
        width: 44px;
        height: 44px;
    }
    .nav-mobile-controls .theme-toggle-mobile,
    .nav-mobile-controls .nav-toggle {
        width: 44px;
        height: 44px;
        border-width: 1px;
        border-style: solid;
        border-color: var(--border-strong);
        background: rgba(255, 255, 255, 0.16);
    }
    .nav-actions .theme-toggle {
        display: none;
    }
    .nav-panel {
        position: fixed;
        inset: 0;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 12px;
        padding: calc(var(--nav-height) + 40px) 16px 16px;
        background: var(--mobile-nav-overlay-surface);
        border: 0;
        box-shadow: 0 12px 38px rgba(35, 25, 16, 0.22);
        backdrop-filter: none;
        overflow-y: hidden;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateY(-10px);
        transition: opacity 220ms ease, transform 280ms cubic-bezier(0.22, 1, 0.36, 1), visibility 0ms linear 280ms;
        z-index: 4;
    }
    body.dark-mode .nav-panel {
        background: var(--mobile-nav-overlay-surface);
        box-shadow: 0 12px 38px rgba(0, 0, 0, 0.45);
    }
    .nav-panel.is-open {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateY(0);
        transition: opacity 240ms ease, transform 320ms cubic-bezier(0.22, 1, 0.36, 1), visibility 0ms;
    }
    .nav-links,
    .nav-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .theme-toggle {
        justify-content: center;
    }
    .nav-links {
        gap: 6px;
        background: transparent;
        border-radius: 0;
        padding: 0;
    }
    body.dark-mode .nav-links {
        background: transparent;
    }
    .nav-links a,
    .nav-actions .button {
        display: flex;
        justify-content: center;
        align-items: center;
        text-align: center;
        width: 100%;
        min-height: 40px;
        padding: 10px 12px;
        border-radius: 14px;
        font-size: clamp(0.98rem, 3.9vw, 1.15rem);
        letter-spacing: 0.03em;
        font-weight: 800;
    }
    .nav-links a {
        background: transparent;
        border: 1px solid transparent;
    }
    body.dark-mode .nav-links a:not(.nav-active) {
        background: transparent;
        border-color: transparent;
        color: var(--text-soft);
    }
    .nav-links a::after {
        display: none;
    }
    .nav-links .nav-indicator {
        display: none;
    }
    .nav-links a.nav-active {
        color: var(--accent-strong);
        background: var(--accent-soft);
        border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
    }
    .nav-links a:hover,
    .nav-links a:focus-visible,
    .nav-links a.nav-active:hover,
    .nav-links a.nav-active:focus-visible {
        color: var(--accent-strong);
        background: var(--accent-soft);
    }
    .nav-actions {
        gap: 6px;
    }
    body.nav-open {
        overflow: hidden;
    }
    body.nav-open .back-to-top {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateY(8px);
    }
    .hero {
        min-height: auto;
        padding-top: 28px;
        display: flex;
        flex-direction: column;
        gap: 18px;
    }
    .hero-aside {
        order: -1;
        width: 100%;
        gap: 14px;
    }
    .profile-card {
        display: flex;
        flex-direction: column;
    }
    .profile-portrait-wrap {
        order: 1;
    }
    .profile-card-copy {
        order: 2;
    }
    .profile-mobile-actions {
        order: 3;
    }
    .signal-grid {
        order: 4;
    }
    .profile-focus-layout {
        order: 2;
    }
    .hero-copy {
        display: flex;
        flex-direction: column;
        margin-top: 0;
    }
    .hero-copy .hero-social-row,
    .hero-copy .hero-actions {
        display: none;
    }
    .profile-mobile-actions {
        display: grid;
        gap: 12px;
    }
    .hero-copy .eyebrow {
        order: 1;
        margin-bottom: 14px;
    }
    .hero-copy h1 {
        order: 2;
    }
    .hero-copy .hero-lede {
        order: 3;
        margin-top: 16px;
    }
    .hero-copy .hero-role-strip {
        order: 4;
        margin-top: 18px;
    }
    .hero-copy .hero-signals {
        order: 5;
        margin-top: 22px;
    }
    .profile-card {
        gap: 18px;
    }
    .profile-portrait-wrap {
        width: min(220px, 74vw);
        padding: 6px;
        border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border-strong));
        overflow: hidden;
        margin-inline: auto;
    }
    .profile-portrait {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
        border: 0;
    }
    .hero h1 {
        max-width: none;
        font-size: clamp(2.6rem, 10vw, 4.4rem);
    }
    .resume-page {
        gap: 20px;
        padding-top: 28px;
        padding-bottom: 48px;
    }
    .resume-hero {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .resume-meta-card {
        width: 100%;
        justify-self: stretch;
        order: 2;
    }
    .resume-hero-copy {
        order: 1;
    }
    .resume-viewer-section {
        padding: 20px;
    }
    .resume-viewer-header {
        margin-bottom: 16px;
    }
    .resume-document-frame,
    .resume-document {
        min-height: 620px;
    }
    .hero-signals,
    .overview-grid,
    .project-grid,
    .skills-grid,
    .focus-panel,
    .signal-grid,
    .profile-focus-layout {
        grid-template-columns: 1fr;
    }
    .project-card.featured {
        grid-column: auto;
    }
    .project-card-header,
    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
    }
    .footer-inner {
        flex-direction: row;
        justify-content: center;
        align-items: center;
        text-align: center;
        gap: 0;
    }
    .footer-inner p {
        white-space: nowrap;
        overflow-wrap: normal;
        font-size: clamp(0.74rem, 2.9vw, 1rem);
        line-height: 1.2;
        max-width: 100%;
    }
    .education-brand-row {
        grid-template-columns: 1fr;
        align-items: flex-start;
    }
    .contact-form-wrap,
    .project-card,
    .timeline-card,
    .profile-card,
    .contact-panel,
    .education-card,
    .skill-panel,
    .info-card {
        padding: 20px;
    }
    .contact-link-card {
        justify-content: flex-start;
        text-align: left;
    }
    .profile-focus-primary .profile-support-list {
        grid-template-columns: 1fr;
    }
}
@media screen and (max-width: 600px) {
    .button {
        width: 100%;
    }
    .resume-hero .hero-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .resume-viewer-section {
        padding: 16px;
    }
    .resume-viewer-header h2 {
        font-size: clamp(1.55rem, 8vw, 2.1rem);
    }
    .resume-document-frame,
    .resume-document {
        min-height: 480px;
    }
    .hero-social-row {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
    .profile-mobile-actions .hero-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
        margin-top: 0;
    }
    .social-pill {
        justify-content: center;
    }
    .contact-links {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .contact-link-card {
        justify-content: center;
        gap: 8px;
        min-height: 54px;
        padding: 12px 8px;
    }
    .contact-link-label {
        display: inline;
        font-size: 0.82rem;
        white-space: nowrap;
    }
    .contact-link-icon {
        width: 28px;
        height: 28px;
    }
    .hero-actions {
        display: grid;
        grid-template-columns: 1fr;
    }
    .hero-role-strip,
    .tag-row,
    .contact-links {
        gap: 10px;
    }
    .hero,
    .section {
        padding-top: 40px;
    }
    .site-footer {
        padding-bottom: 64px;
    }
    .footer-inner p {
        white-space: nowrap;
        overflow-wrap: normal;
        font-size: clamp(0.72rem, 3.15vw, 0.94rem);
    }
}

@media screen and (max-width: 420px) {
    :root {
        --nav-height: 60px;
    }
    .site-nav {
        padding: 9px 12px;
        min-height: 60px;
    }
    .brand {
        font-size: 0.88rem;
        letter-spacing: 0.07em;
    }
    .nav-mobile-controls {
        gap: 8px;
    }
    .nav-mobile-controls .theme-toggle-mobile,
    .nav-mobile-controls .nav-toggle {
        width: 40px;
        height: 40px;
        border-radius: 14px;
    }
    .nav-panel {
        padding: calc(var(--nav-height) + 30px) 12px 12px;
        gap: 10px;
    }
    .nav-links {
        gap: 4px;
    }
    .nav-links a,
    .nav-actions .button {
        min-height: 36px;
        padding: 8px 10px;
        font-size: clamp(0.92rem, 3.8vw, 1.02rem);
    }
    .footer-inner p {
        font-size: clamp(0.68rem, 3.25vw, 0.84rem);
    }
}

@media (hover: none) and (pointer: coarse) {
    .theme-toggle:hover,
    .theme-toggle:focus-visible,
    .theme-toggle:active {
        transform: none;
        border-color: var(--border-strong);
        color: var(--text);
        background: rgba(255, 255, 255, 0.16);
    }

    .nav-toggle:hover,
    .nav-toggle:focus-visible,
    .nav-toggle:active {
        transform: none;
        border-color: var(--border-strong);
        background: rgba(255, 255, 255, 0.16);
    }
    .nav-toggle:hover span,
    .nav-toggle:focus-visible span,
    .nav-toggle:active span {
        background: var(--text);
    }

    .button:hover,
    .button:focus-visible,
    .button:active {
        transform: none;
        box-shadow: none;
    }

    .button-solid:hover,
    .button-solid:focus-visible,
    .button-solid:active {
        background: var(--text);
        color: var(--surface-strong);
    }

    .button-outline:hover,
    .button-outline:focus-visible,
    .button-outline:active {
        border-color: var(--border-strong);
        color: var(--text);
        background: rgba(255, 255, 255, 0.16);
    }

    .social-pill:hover,
    .social-pill:focus-visible,
    .social-pill:active {
        transform: none;
        border-color: var(--border);
        color: var(--text);
        background: rgba(255, 255, 255, 0.28);
        box-shadow: none;
    }

    .project-action:hover,
    .project-action:focus-visible,
    .project-action:active {
        transform: none;
        border-color: var(--border);
        color: var(--text);
        background: rgba(255, 255, 255, 0.16);
        box-shadow: none;
    }

    .contact-link-card:hover,
    .contact-link-card:focus-visible,
    .contact-link-card:active {
        transform: none;
        border-color: var(--border);
        color: var(--text);
        background: rgba(255, 255, 255, 0.16);
        box-shadow: none;
    }
    .contact-link-card:hover .contact-link-label,
    .contact-link-card:focus-visible .contact-link-label,
    .contact-link-card:active .contact-link-label {
        color: var(--text);
    }

    .back-to-top:hover,
    .back-to-top:focus-visible,
    .back-to-top:active {
        transform: translateY(0);
        border-color: var(--border-strong);
        color: var(--text);
    }
}
