.mobile-portfolio {
    display: none;
}

@media (max-width: 768px) {
    html.mobile-portfolio-active {
        min-height: 100%;
        scroll-behavior: smooth;
        background: #fff;
    }

    body.mobile-portfolio-active {
        min-height: 100%;
        overflow-x: hidden;
        overflow-y: auto;
        background: #fff;
        color: #111;
        overscroll-behavior-y: none;
    }

    body.mobile-portfolio-active > main,
    body.mobile-portfolio-active > .skip-link {
        display: none !important;
    }

    body.mobile-portfolio-active #social-bar {
        display: none !important;
    }

    body.mobile-menu-open {
        overflow: hidden;
    }

    .mobile-portfolio {
        --mp-ink: #111;
        --mp-muted: #696969;
        --mp-line: #d8d8d8;
        --mp-soft: #f1f1ef;
        --mp-blue: #1649aa;
        display: block;
        min-height: 100svh;
        overflow: visible;
        background: #fff;
        color: var(--mp-ink);
        font-family: 'Space Grotesk', sans-serif;
    }

    .mobile-portfolio[hidden],
    .mobile-portfolio [hidden] {
        display: none !important;
    }

    .mobile-portfolio a,
    .mobile-portfolio button {
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-portfolio :focus-visible {
        outline: 2px solid var(--mp-blue);
        outline-offset: 3px;
    }

    .mp-header {
        position: sticky;
        top: 0;
        z-index: 120;
        display: grid;
        grid-template-columns: 48px minmax(0, 1fr) 48px;
        align-items: center;
        width: 100%;
        min-height: 64px;
        padding: 0 8px;
        border-bottom: 1px solid rgba(17, 17, 17, 0.1);
        background: rgba(255, 255, 255, 0.96);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }

    .mp-wordmark {
        grid-column: 2;
        color: var(--mp-ink);
        font-family: 'Raleway', sans-serif;
        font-size: 0.78rem;
        font-weight: 300;
        letter-spacing: 4px;
        line-height: 1;
        text-align: center;
        text-decoration: none;
        text-transform: uppercase;
        white-space: nowrap;
    }

    .mp-back,
    .mp-menu-toggle {
        position: relative;
        z-index: 123;
        display: grid;
        place-items: center;
        width: 48px;
        height: 48px;
        padding: 0;
        border: 0;
        background: transparent;
        color: var(--mp-ink);
    }

    .mp-back {
        grid-column: 1;
        grid-row: 1;
    }

    .mp-back .lucide {
        width: 24px;
        height: 24px;
        stroke-width: 1.5;
    }

    .mp-menu-toggle {
        grid-column: 3;
        grid-row: 1;
    }

    .mp-menu-glyph {
        width: 24px;
        height: 8px;
        overflow: visible;
        fill: currentColor;
    }

    .mp-menu-glyph rect {
        transform-origin: center center;
        transition: transform 0.3s ease;
    }

    .mp-menu-toggle[aria-expanded="true"] .mp-menu-glyph rect:first-child {
        transform: rotate(45deg) translate(0, 3px);
    }

    .mp-menu-toggle[aria-expanded="true"] .mp-menu-glyph rect:last-child {
        transform: rotate(-45deg) translate(3px, 0);
    }

    .mp-menu-backdrop {
        position: fixed;
        inset: 0;
        z-index: 118;
        width: 100%;
        height: 100%;
        padding: 0;
        border: 0;
        background: rgba(0, 0, 0, 0.22);
    }

    .mp-menu {
        position: fixed;
        inset: 0 0 0 auto;
        z-index: 121;
        display: flex;
        flex-direction: column;
        width: min(92vw, 420px);
        height: 100svh;
        padding: 22px 24px 40px;
        overflow-y: auto;
        border-left: 1px solid var(--mp-line);
        background: #fff;
        box-shadow: -20px 0 60px rgba(0, 0, 0, 0.12);
    }

    .mp-menu-label {
        min-height: 42px;
        padding: 6px 52px 20px 0;
        border-bottom: 1px solid var(--mp-line);
        color: var(--mp-muted);
        font-size: 0.7rem;
        font-weight: 600;
        text-transform: uppercase;
    }

    .mp-menu-links {
        display: grid;
        margin-top: 44px;
    }

    .mp-menu-links a {
        display: grid;
        grid-template-columns: 42px 1fr;
        align-items: baseline;
        padding: 18px 0;
        border-bottom: 1px solid var(--mp-line);
        color: var(--mp-ink);
        font-size: 2.25rem;
        line-height: 1;
        text-decoration: none;
    }

    .mp-menu-links a span {
        color: var(--mp-muted);
        font-size: 0.67rem;
        font-weight: 600;
    }

    .mp-menu-links a[aria-current="true"] {
        color: var(--mp-blue);
    }

    .mp-menu-connect {
        margin-top: auto;
        padding-top: 40px;
    }

    .mp-menu-connect > p {
        margin: 0 0 14px;
        color: var(--mp-muted);
        font-size: 0.67rem;
        font-weight: 600;
        text-transform: uppercase;
    }

    .mp-social-links {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .mp-social-link {
        display: grid;
        place-items: center;
        width: 42px;
        height: 42px;
        border: 1px solid var(--mp-line);
        background: transparent;
        color: var(--mp-ink);
        text-decoration: none;
    }

    .mp-social-link svg {
        width: 18px;
        height: 18px;
        fill: currentColor;
    }

    .mp-social-link svg.lucide {
        fill: none;
        stroke: currentColor;
        stroke-width: 1.7;
    }

    .mp-loading {
        display: grid;
        place-content: center;
        min-height: calc(100svh - 64px);
        padding: 24px;
        font-family: 'Raleway', sans-serif;
        font-size: 0.82rem;
        font-weight: 300;
        letter-spacing: 4px;
        text-align: center;
        text-transform: uppercase;
    }

    .mp-loading-line {
        position: relative;
        display: block;
        width: 100%;
        height: 1px;
        margin-top: 18px;
        overflow: hidden;
        background: var(--mp-line);
    }

    .mp-loading-line::after {
        content: '';
        position: absolute;
        inset: 0;
        background: var(--mp-ink);
        transform: translateX(-100%);
        animation: mp-loading 1.2s ease-in-out infinite;
    }

    @keyframes mp-loading {
        50%, 100% { transform: translateX(100%); }
    }

    .mp-home,
    .mp-project-page {
        width: 100%;
    }

    .mp-intro,
    .mp-section,
    .mp-footer {
        padding-right: 20px;
        padding-left: 20px;
    }

    .mp-intro {
        display: grid;
        padding-top: 48px;
        padding-bottom: 44px;
        border-bottom: 1px solid var(--mp-line);
    }

    .mp-eyebrow {
        margin: 0 0 10px;
        color: var(--mp-muted);
        font-size: 0.68rem;
        font-weight: 600;
        text-transform: uppercase;
    }

    .mp-intro h1 {
        max-width: 11ch;
        margin: 0;
        font-size: 3.25rem;
        font-weight: 500;
        line-height: 0.95;
    }

    .mp-intro > p:last-child {
        max-width: 35rem;
        margin: 28px 0 0;
        color: var(--mp-muted);
        font-size: 0.96rem;
        line-height: 1.55;
    }

    .mp-section {
        padding-top: 64px;
        scroll-margin-top: 64px;
    }

    .mp-section-heading {
        display: flex;
        align-items: flex-end;
        justify-content: space-between;
        gap: 16px;
        padding-bottom: 18px;
        border-bottom: 1px solid var(--mp-line);
    }

    .mp-section-heading h2 {
        margin: 0;
        font-size: 2.4rem;
        font-weight: 500;
        line-height: 1;
    }

    .mp-count {
        color: var(--mp-blue);
        font-size: 1.65rem;
        font-variant-numeric: tabular-nums;
        line-height: 1;
    }

    .mp-project-list {
        display: grid;
    }

    .mp-project-card {
        display: grid;
        gap: 16px;
        padding: 24px 0 30px;
        border-bottom: 1px solid var(--mp-line);
        color: var(--mp-ink);
        text-decoration: none;
    }

    .mp-project-media {
        position: relative;
        width: 100%;
        aspect-ratio: 4 / 3;
        overflow: hidden;
        background: var(--mp-soft);
    }

    .mp-project-media img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .mp-project-fallback {
        display: grid;
        place-items: center;
        width: 100%;
        height: 100%;
        padding: 24px;
        background: var(--mp-blue);
        color: #fff;
        font-size: 1.7rem;
        text-align: center;
    }

    .mp-project-meta-row,
    .mp-project-title-row {
        display: flex;
        justify-content: space-between;
        gap: 16px;
    }

    .mp-project-meta-row {
        color: var(--mp-muted);
        font-size: 0.7rem;
        font-weight: 600;
        text-transform: uppercase;
    }

    .mp-project-title-row {
        align-items: flex-start;
    }

    .mp-project-title-row h3 {
        margin: 0;
        font-size: 1.55rem;
        font-weight: 500;
        line-height: 1.08;
    }

    .mp-project-title-row .lucide {
        flex: 0 0 auto;
        width: 22px;
        height: 22px;
        stroke-width: 1.5;
    }

    .mp-project-card p {
        margin: -6px 0 0;
        color: var(--mp-muted);
        font-size: 0.9rem;
        line-height: 1.45;
    }

    .mp-empty,
    .mp-load-error {
        padding: 32px 0;
        color: var(--mp-muted);
        line-height: 1.5;
    }

    .mp-load-error button {
        margin-top: 18px;
        padding: 10px 14px;
        border: 1px solid var(--mp-ink);
        border-radius: 0;
        background: var(--mp-ink);
        color: #fff;
        font: inherit;
    }

    .mp-resume {
        padding-bottom: 72px;
    }

    .mp-download {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        min-height: 40px;
        padding: 0 12px;
        border: 1px solid var(--mp-ink);
        background: var(--mp-ink);
        color: #fff;
        font-size: 0.78rem;
        font-weight: 600;
        text-decoration: none;
    }

    .mp-download .lucide {
        width: 16px;
        height: 16px;
    }

    .mp-cv-sheet {
        display: grid;
        gap: 32px;
        margin-top: 20px;
        padding: 22px;
        border: 1px solid var(--mp-line);
        background: #fff;
    }

    .mp-cv-profile {
        display: grid;
        grid-template-columns: 88px minmax(0, 1fr);
        gap: 18px;
        align-items: start;
    }

    .mp-cv-photo {
        width: 88px;
        aspect-ratio: 3 / 4;
        object-fit: cover;
        background: var(--mp-soft);
        filter: grayscale(1);
    }

    .mp-cv-role {
        margin: 0 0 8px;
        color: var(--mp-blue);
        font-size: 0.65rem;
        font-weight: 600;
        text-transform: uppercase;
    }

    .mp-cv-profile h3 {
        margin: 0;
        font-size: 1.55rem;
        font-weight: 500;
        line-height: 1.05;
    }

    .mp-cv-summary {
        grid-column: 1 / -1;
        margin: 0;
        color: #414141;
        font-size: 0.84rem;
        line-height: 1.55;
    }

    .mp-cv-availability {
        display: grid;
        gap: 12px;
        padding: 15px 0 2px;
        border-top: 1px solid var(--mp-ink);
    }

    .mp-cv-availability-heading {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 0.68rem;
        text-transform: uppercase;
    }

    .mp-cv-availability-heading span {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: #167c42;
    }

    .mp-cv-availability ul {
        display: flex;
        flex-wrap: wrap;
        gap: 7px;
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .mp-cv-availability li {
        padding: 6px 8px;
        border: 1px solid var(--mp-line);
        color: #333;
        font-size: 0.7rem;
        line-height: 1.2;
    }

    .mp-cv-section {
        display: grid;
        gap: 14px;
        padding-top: 18px;
        border-top: 1px solid var(--mp-line);
    }

    .mp-cv-section h4 {
        margin: 0;
        color: var(--mp-muted);
        font-size: 0.65rem;
        font-weight: 600;
        text-transform: uppercase;
    }

    .mp-cv-entry {
        display: grid;
        gap: 4px;
    }

    .mp-cv-entry-head {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 12px;
        align-items: baseline;
    }

    .mp-cv-entry h5,
    .mp-cv-entry p {
        margin: 0;
    }

    .mp-cv-entry h5 {
        font-size: 0.9rem;
        font-weight: 600;
    }

    .mp-cv-entry time {
        color: var(--mp-muted);
        font-size: 0.66rem;
        white-space: nowrap;
    }

    .mp-cv-entry .mp-cv-org {
        color: var(--mp-blue);
        font-size: 0.76rem;
    }

    .mp-cv-entry .mp-cv-detail {
        color: var(--mp-muted);
        font-size: 0.76rem;
        line-height: 1.45;
        white-space: pre-line;
    }

    .mp-cv-entry a {
        color: var(--mp-ink);
        text-decoration-color: var(--mp-blue);
        text-underline-offset: 3px;
    }

    .mp-cv-list {
        display: flex;
        flex-wrap: wrap;
        gap: 7px;
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .mp-cv-list li {
        padding: 6px 8px;
        border: 1px solid var(--mp-line);
        color: #333;
        font-size: 0.7rem;
        line-height: 1.2;
    }

    .mp-cv-contact-list {
        display: grid;
        gap: 8px;
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .mp-cv-contact-list a {
        color: var(--mp-ink);
        font-size: 0.76rem;
        overflow-wrap: anywhere;
        text-decoration-color: var(--mp-blue);
        text-underline-offset: 3px;
    }

    .mp-footer {
        display: grid;
        gap: 26px;
        padding-top: 36px;
        padding-bottom: calc(24px + env(safe-area-inset-bottom));
        border-top: 0;
        background: var(--mp-ink);
        color: #fff;
    }

    .mp-footer-brand {
        display: grid;
        gap: 8px;
        color: rgba(255, 255, 255, 0.62);
        font-size: 0.67rem;
        text-transform: uppercase;
    }

    .mp-footer-wordmark {
        color: #fff;
        font-family: 'Raleway', sans-serif;
        font-size: 0.76rem;
        font-weight: 300;
        letter-spacing: 3px;
        white-space: nowrap;
    }

    .mp-footer-social {
        justify-content: flex-start;
    }

    .mp-footer .mp-social-link {
        border-color: rgba(255, 255, 255, 0.28);
        color: #fff;
    }

    .mp-footer-meta {
        display: flex;
        justify-content: space-between;
        gap: 16px;
        padding-top: 18px;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
        color: rgba(255, 255, 255, 0.55);
        font-size: 0.62rem;
        text-transform: uppercase;
    }

    .mp-project-hero {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        min-height: calc(100svh - 64px);
    }

    .mp-project-cover {
        width: 100%;
        min-height: 48svh;
        object-fit: cover;
        background: var(--mp-soft);
    }

    .mp-project-cover-fallback {
        display: grid;
        place-items: center;
        min-height: 48svh;
        padding: 24px;
        background: var(--mp-blue);
        color: #fff;
        font-size: 2.2rem;
        line-height: 1;
        text-align: center;
    }

    .mp-project-heading {
        display: grid;
        min-width: 0;
        overflow-wrap: anywhere;
        align-content: end;
        gap: 14px;
        padding: 34px 20px 30px;
    }

    .mp-project-heading h1 {
        margin: 0;
        font-size: 2.75rem;
        font-weight: 500;
        line-height: 0.98;
    }

    .mp-project-subtitle {
        margin: 0;
        color: var(--mp-muted);
        font-size: 0.98rem;
        line-height: 1.5;
    }

    .mp-project-details {
        display: flex;
        min-width: 0;
        flex-wrap: wrap;
        gap: 18px 14px;
        margin-top: 10px;
        padding-top: 20px;
    }

    .mp-project-detail {
        display: grid;
        min-width: 0;
        max-width: 100%;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: center;
        gap: 8px;
    }

    .mp-project-detail > div { display: grid; min-width: 0; gap: 4px; overflow-wrap: anywhere; }
    .mp-project-detail:not(:has(.mp-content-icon)) { grid-template-columns: minmax(0, 1fr); }

    .mp-content-icon {
        display: inline-block;
        width: 1em;
        height: 1em;
        flex: 0 0 auto;
        color: var(--mp-block-accent, var(--mp-blue));
        font-size: 1.25rem;
    }

    .mp-project-detail dt {
        color: var(--mp-muted);
        font-size: 0.63rem;
        font-weight: 600;
        text-transform: uppercase;
    }

    .mp-project-detail dd {
        margin: 0;
        font-size: 0.78rem;
        line-height: 1.4;
    }

    .mp-project-blocks {
        display: grid;
        gap: 0;
        padding: 28px 0 0;
    }

    .mp-project-bookmarks {
        position: sticky;
        z-index: 25;
        top: 64px;
        display: flex;
        gap: 18px;
        overflow-x: auto;
        padding: 12px 20px;
        border-bottom: 1px solid var(--mp-line);
        background: rgba(255, 255, 255, 0.96);
        scrollbar-width: none;
    }

    .mp-project-bookmarks::-webkit-scrollbar { display: none; }

    .mp-project-bookmarks button {
        flex: 0 0 auto;
        padding: 3px 0;
        border: 0;
        border-bottom: 1px solid transparent;
        background: transparent;
        color: var(--mp-muted);
        font: inherit;
        font-size: 0.72rem;
        cursor: pointer;
    }

    .mp-project-bookmarks button.is-active {
        border-bottom-color: currentColor;
        color: var(--mp-ink);
    }

    .mp-bookmark-target { scroll-margin-top: 118px; }
    [data-bookmark-scroll-align="center"] .mp-bookmark-target { scroll-margin-block: 0; }

    .mp-block--text,
    .mp-block--quote,
    .mp-block--stats,
    .mp-block--code,
    .mp-block--link,
    .mp-block--two-column,
    .mp-block--divider,
    .mp-block--section,
    .mp-block--process,
    .mp-block--insight,
    .mp-block--findings,
    .mp-block--cards {
        margin-right: 20px;
        margin-left: 20px;
    }

    .mp-block--caption,
    .mp-block--timeline,
    .mp-block--grid-spec { margin-right: 20px; margin-left: 20px; }

    .mp-block--section,
    .mp-block--process,
    .mp-block--insight,
    .mp-block--findings,
    .mp-block--cards {
        padding: 28px 0;
    }

    .mp-block--findings.is-centered-list {
        margin-right: 34px;
        margin-left: 34px;
    }

    .mp-block--section.is-centered { padding-block: 52px; text-align: center; }
    .mp-block--section.is-centered > p { margin-inline: auto; }
    .mp-block--section.is-editorial { display: grid; gap: 16px; }
    .mp-block--section.is-serif h2,
    .mp-block--findings.is-serif > h2,
    .mp-block--cards.is-serif > h2 { font-family: Georgia, 'Times New Roman', serif; font-style: italic; font-weight: 400; }

    .mp-block-label {
        display: block;
        margin-bottom: 10px;
        color: var(--mp-blue);
        font-size: 0.65rem;
        font-weight: 700;
        text-transform: uppercase;
    }

    .mp-block--section h2,
    .mp-block--process > h2,
    .mp-block--insight h2,
    .mp-block--findings > h2,
    .mp-block--cards > h2 {
        margin: 0;
        font-size: 1.85rem;
        font-weight: 500;
        line-height: 1.08;
    }

    .mp-block--section > p,
    .mp-block--insight > p {
        margin: 12px 0 0;
        color: var(--mp-muted);
        line-height: 1.6;
    }

    .mp-block--process ol,
    .mp-block--findings ul {
        display: grid;
        gap: 8px;
        margin: 18px 0 0;
        padding: 0;
        list-style: none;
    }

    .mp-block--process li {
        display: grid;
        grid-template-columns: 34px minmax(0, 1fr);
        gap: 12px;
        padding: 14px 0;
    }

    .mp-block--process li > span { color: var(--mp-blue); font-size: 0.68rem; }
    .mp-block--process h3,
    .mp-block--findings h3,
    .mp-block--cards h3 { margin: 0; font-size: 0.96rem; }
    .mp-block--process p,
    .mp-block--findings p,
    .mp-block--cards p { margin: 6px 0 0; color: var(--mp-muted); font-size: 0.84rem; line-height: 1.5; }

    .mp-block--insight {
        padding-right: 18px;
        padding-left: 18px;
        border: 1px solid var(--mp-block-accent, var(--mp-blue));
        border-radius: 8px;
        background: color-mix(in srgb, var(--mp-block-accent, var(--mp-blue)) 8%, #fff);
        text-align: center;
    }

    .mp-block--insight > .mp-content-icon { margin-bottom: 10px; }

    .mp-block--findings li {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
        padding: 14px;
        border: 1px solid var(--mp-line);
        background: #f7f7f5;
    }

    .mp-block--findings li.has-icon { grid-template-columns: 28px minmax(0, 1fr); }
    .mp-block--findings li > .mp-item-marker {
        display: grid;
        width: 28px;
        height: 28px;
        place-items: center;
        background: none !important;
        box-shadow: none !important;
    }
    .mp-block--findings li > .mp-item-marker .mp-finding-icon {
        margin: 0;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: none !important;
        box-shadow: none !important;
        color: #454541;
        font-size: 1.3rem;
    }

    .mp-block--findings li[data-tone="warning"] { background: #fff2f4; }
    .mp-block--findings li[data-tone="warning"] > .mp-item-marker .mp-finding-icon { color: #a92f49; }
    .mp-block--findings li[data-tone="positive"] { background: #edf7e8; }
    .mp-block--findings li[data-tone="positive"] > .mp-item-marker .mp-finding-icon { color: #2d7c42; }

    .mp-card-grid { display: grid; gap: 8px; margin-top: 18px; }
    .mp-card-grid article { padding: 18px; border: 1px solid var(--mp-line); border-radius: 8px; }
    .mp-card-grid article > .mp-content-icon { margin-bottom: 28px; }

    .mp-block--text {
        padding: 18px 0 30px;
        color: #2f2f2f;
        font-size: 0.94rem;
        line-height: 1.65;
    }

    .mp-block--text h2,
    .mp-block--text h3,
    .mp-block--two-column h2,
    .mp-block--two-column h3 {
        margin: 0 0 16px;
        color: var(--mp-ink);
        font-size: 1.65rem;
        font-weight: 500;
        line-height: 1.08;
    }

    .mp-block--text p,
    .mp-block--two-column p {
        margin: 0 0 14px;
    }

    .mp-block--text ul,
    .mp-block--text ol,
    .mp-block--two-column ul,
    .mp-block--two-column ol {
        margin: 0 0 14px;
        padding-left: 20px;
    }

    .mp-block--text a,
    .mp-block--two-column a {
        color: var(--mp-blue);
        text-underline-offset: 3px;
    }

    .mp-block--image,
    .mp-block--image-full,
    .mp-block--gallery,
    .mp-block--before-after,
    .mp-block--media {
        margin: 0 0 28px;
    }

    .mp-block--image img,
    .mp-block--two-column img,
    .mp-ba-stage img {
        display: block;
        width: 100%;
        height: auto;
        border-radius: 8px;
    }

    .mp-block--image-full img {
        display: block;
        width: 100%;
        height: auto;
        border-radius: 0;
        box-shadow: none;
        filter: none;
    }

    .mp-block--image:not(.mp-block--image-full) {
        margin-right: 20px;
        margin-left: 20px;
    }

    .mp-caption {
        padding: 8px 20px 0;
        color: var(--mp-muted);
        font-size: 0.7rem;
        line-height: 1.4;
        text-align: center;
        text-transform: uppercase;
    }

    .mp-block--image:not(.mp-block--image-full) .mp-caption {
        padding-right: 0;
        padding-left: 0;
    }

    .mp-block--gallery {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        padding: 0 20px;
        grid-auto-flow: dense;
    }

    .mp-gallery-item {
        position: relative;
        min-height: 0;
        padding: 0;
        border: 0;
        background: var(--mp-soft);
        text-align: left;
    }

    .mp-gallery-item img {
        display: block;
        width: 100%;
        height: auto;
        border-radius: 8px;
    }

    .mp-gallery-item .mp-caption {
        position: static;
        padding: 8px 2px 0;
        background: transparent;
        color: var(--mp-muted);
    }

    .mp-gallery--grid .mp-gallery-item--wide,
    .mp-gallery--grid .mp-gallery-item--large { grid-column: span 2; }

    .mp-gallery--masonry {
        display: block;
        columns: 2;
        column-gap: 10px;
    }
    .mp-gallery--masonry .mp-gallery-item {
        display: inline-block;
        width: 100%;
        margin: 0 0 10px;
        break-inside: avoid;
    }

    .mp-gallery--featured,
    .mp-gallery--mosaic {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-auto-rows: 132px;
    }
    .mp-gallery--editorial {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        grid-auto-rows: 94px;
    }
    .mp-gallery--featured .mp-gallery-item,
    .mp-gallery--mosaic .mp-gallery-item,
    .mp-gallery--editorial .mp-gallery-item {
        display: grid;
        height: 100%;
        min-height: 0;
        grid-template-rows: minmax(0, 1fr) auto;
    }
    .mp-gallery--featured .mp-gallery-item img,
    .mp-gallery--mosaic .mp-gallery-item img,
    .mp-gallery--editorial .mp-gallery-item img {
        width: 100%;
        height: 100%;
        min-height: 0;
        object-fit: cover;
    }

    .mp-gallery--featured .mp-gallery-item:first-child { grid-column: span 2; grid-row: span 2; }
    .mp-gallery--featured .mp-gallery-item--wide,
    .mp-gallery--mosaic .mp-gallery-item--wide { grid-column: span 2; }
    .mp-gallery--featured .mp-gallery-item--tall,
    .mp-gallery--mosaic .mp-gallery-item--tall { grid-row: span 2; }
    .mp-gallery--featured .mp-gallery-item--large,
    .mp-gallery--mosaic .mp-gallery-item--large { grid-column: span 2; grid-row: span 2; }

    .mp-gallery--editorial .mp-gallery-item:nth-child(4n + 1) { grid-column: span 3; grid-row: span 3; }
    .mp-gallery--editorial .mp-gallery-item:nth-child(4n + 2) { grid-column: span 1; grid-row: span 2; }
    .mp-gallery--editorial .mp-gallery-item:nth-child(4n + 3) { grid-column: span 2; grid-row: span 2; }
    .mp-gallery--editorial .mp-gallery-item:nth-child(4n + 4) { grid-column: span 2; grid-row: span 2; }
    .mp-gallery--editorial .mp-gallery-item.mp-gallery-item--wide { grid-column: span 4; grid-row: span 2; }
    .mp-gallery--editorial .mp-gallery-item.mp-gallery-item--tall { grid-column: span 2; grid-row: span 4; }
    .mp-gallery--editorial .mp-gallery-item.mp-gallery-item--large { grid-column: span 4; grid-row: span 4; }

    .mp-block--caption { padding: 4px 0 24px; color: var(--mp-muted); font: 600 0.68rem/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; text-align: center; text-transform: uppercase; }
    .mp-block--caption.is-left { text-align: left; }
    .mp-block--caption.is-right { text-align: right; }

    .mp-structured-scroll { overflow-x: auto; padding-bottom: 10px; }
    .mp-timeline-canvas,
    .mp-grid-spec-canvas { overflow: hidden; border: 1px solid var(--mp-line); border-radius: 8px; background: #fff; }
    .mp-timeline-periods,
    .mp-timeline-chart { display: grid; grid-template-columns: repeat(var(--mp-timeline-columns), minmax(var(--mp-timeline-column-width), 1fr)); }
    .mp-timeline-periods { padding: 18px 18px 0; }
    .mp-timeline-periods span { padding: 8px; border-left: 1px solid var(--mp-line); color: var(--mp-muted); font-size: 0.62rem; font-weight: 700; text-align: center; text-transform: uppercase; }
    .mp-timeline-chart { grid-auto-rows: var(--mp-timeline-row-height); padding: 14px 18px 22px; background-image: repeating-linear-gradient(to right, transparent 0 calc((100% / var(--mp-timeline-columns)) - 1px), var(--mp-line) calc((100% / var(--mp-timeline-columns)) - 1px) calc(100% / var(--mp-timeline-columns))); }
    .mp-timeline-phase { align-self: center; justify-self: start; box-sizing: border-box; width: max(18px, calc(var(--mp-phase-width) - 10px)); min-width: 0; margin: 7px 0 7px calc(var(--mp-phase-left) + 5px); padding: 16px; border: 1px solid var(--mp-phase-color); border-radius: 8px; background: color-mix(in srgb, var(--mp-phase-color) 9%, #fff); }
    .mp-timeline-phase .mp-content-icon { margin-bottom: 12px; color: var(--mp-phase-color); }
    .mp-timeline-phase h3 { margin: 0; font-size: 1rem; }
    .mp-timeline-phase p { margin: 6px 0 0; color: var(--mp-muted); font-size: 0.72rem; line-height: 1.4; }

    .mp-grid-spec-canvas { min-width: 680px; padding: 18px; border: 0; border-radius: 0; background: var(--mp-grid-background); box-shadow: none; }
    .mp-grid-spec-row { position: relative; min-height: var(--mp-grid-row-height); margin: 0; overflow: visible; border: 0; border-top: 1px dashed var(--mp-grid-accent); border-right: 1px dashed var(--mp-grid-accent); border-left: 1px dashed var(--mp-grid-accent); border-radius: 8px 8px 0 0; color: var(--mp-grid-accent); }
    .mp-grid-spec-row:last-child { border-bottom: 1px dashed var(--mp-grid-accent); border-radius: 8px; }
    .mp-grid-columns { position: absolute; inset: 0; display: grid; overflow: hidden; grid-template-columns: repeat(var(--mp-grid-columns), minmax(0, 1fr)); gap: var(--mp-grid-gutter); padding-inline: var(--mp-grid-margin); border-radius: 7px 7px 0 0; }
    .mp-grid-columns span { background: color-mix(in srgb, var(--mp-grid-accent) 7%, #fff); }
    .mp-grid-spec-copy { position: relative; z-index: 1; display: grid; grid-template-rows: 1fr 1fr; min-height: inherit; padding: 12px; text-align: center; }
    .mp-grid-spec-copy strong { align-self: end; padding-bottom: 14px; font: 700 0.9rem ui-monospace, SFMono-Regular, Menlo, monospace; }
    .mp-grid-spec-copy span { align-self: start; padding-top: 14px; font: 600 0.58rem ui-monospace, SFMono-Regular, Menlo, monospace; }
    .mp-grid-spec-measure { position: absolute; top: 50%; right: -1px; left: -1px; border-top: 1px solid currentColor; }
    .mp-grid-spec-measure::before,
    .mp-grid-spec-measure::after { position: absolute; top: -4px; width: 7px; height: 7px; border-top: 1px solid currentColor; content: ''; }
    .mp-grid-spec-measure::before { left: 1px; border-left: 1px solid currentColor; transform: rotate(-45deg); }
    .mp-grid-spec-measure::after { right: 1px; border-right: 1px solid currentColor; transform: rotate(45deg); }
    .mp-grid-spec-canvas.is-single .mp-grid-spec-row { width: 100% !important; min-height: var(--mp-grid-single-height); border-radius: 0; }
    .mp-grid-spec-canvas.is-single .mp-grid-columns { border-radius: 0; }

    .mp-ba-stage {
        position: relative;
        width: 100%;
        overflow: hidden;
        touch-action: pan-y;
        background: var(--mp-soft);
    }

    .mp-ba-stage > img {
        min-height: 260px;
        object-fit: cover;
    }

    .mp-ba-after {
        position: absolute;
        inset: 0;
        overflow: hidden;
        clip-path: inset(0 0 0 50%);
    }

    .mp-ba-after img {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .mp-ba-divider {
        position: absolute;
        top: 0;
        bottom: 0;
        left: 50%;
        width: 2px;
        background: #fff;
        pointer-events: none;
    }

    .mp-ba-divider::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 36px;
        height: 36px;
        border: 2px solid #fff;
        border-radius: 50%;
        background: rgba(17, 17, 17, 0.45);
        transform: translate(-50%, -50%);
    }

    .mp-ba-label {
        position: absolute;
        top: 12px;
        z-index: 2;
        padding: 5px 7px;
        background: #fff;
        color: var(--mp-ink);
        font-size: 0.62rem;
        font-weight: 600;
        text-transform: uppercase;
    }

    .mp-ba-label:first-of-type { left: 12px; }
    .mp-ba-label:last-of-type { right: 12px; }

    .mp-block--quote {
        margin-top: 16px;
        margin-bottom: 32px;
        padding: 22px 0 22px 18px;
    }

    .mp-block--quote blockquote {
        margin: 0;
        font-size: 1.25rem;
        line-height: 1.4;
    }

    .mp-block--quote cite {
        display: block;
        margin-top: 12px;
        color: var(--mp-muted);
        font-size: 0.72rem;
        font-style: normal;
    }

    .mp-block--stats {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin-top: 10px;
        margin-bottom: 32px;
    }

    .mp-stat {
        padding: 18px 12px;
    }

    .mp-stat-icon {
        display: block;
        margin-bottom: 10px;
        color: var(--mp-ink);
        font-size: 1.2rem;
    }

    .mp-stat strong {
        display: block;
        color: var(--mp-blue);
        font-size: 1.55rem;
        font-weight: 500;
    }

    .mp-stat span {
        color: var(--mp-muted);
        font-size: 0.65rem;
        text-transform: uppercase;
    }

    .mp-block--two-column {
        display: grid;
        gap: 20px;
        margin-top: 14px;
        margin-bottom: 34px;
        color: #2f2f2f;
        font-size: 0.9rem;
        line-height: 1.6;
    }

    .mp-block--two-column.is-image-first .mp-two-column-image {
        order: -1;
    }

    .mp-block--code {
        margin-top: 12px;
        margin-bottom: 32px;
        overflow: hidden;
        background: #111;
        color: #f5f5f5;
    }

    .mp-code-label {
        padding: 8px 12px;
        color: #aaa;
        font-size: 0.65rem;
        text-transform: uppercase;
    }

    .mp-block--code pre {
        margin: 0;
        padding: 16px;
        overflow-x: auto;
        font-size: 0.76rem;
        line-height: 1.55;
    }

    .mp-block--media {
        width: 100%;
        margin-inline: auto;
        background: #111;
    }

    .mp-block--media iframe,
    .mp-block--media video {
        display: block;
        width: 100%;
        height: 100%;
        border: 0;
        object-fit: contain;
    }

    .mp-block--divider {
        padding: 20px 0;
    }

    .mp-block--divider hr {
        border: 0;
        border-top: 1px solid var(--mp-line);
    }

    .mp-block--divider.is-dotted hr { border-top-style: dotted; }
    .mp-block--divider.is-thick hr { border-top-width: 3px; }

    .mp-block--link {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 18px;
        margin-top: 12px;
        margin-bottom: 32px;
        padding: 18px 0;
        color: var(--mp-ink);
        text-decoration: none;
    }

    .mp-block--link strong,
    .mp-block--link small {
        display: block;
    }

    .mp-block--link small {
        margin-top: 4px;
        color: var(--mp-muted);
        overflow-wrap: anywhere;
    }

    .mp-block--link .lucide {
        flex: 0 0 auto;
        width: 22px;
        height: 22px;
        stroke-width: 1.5;
    }

    .mp-project-end {
        display: grid;
        gap: 14px;
        padding: 56px 20px calc(36px + env(safe-area-inset-bottom));
    }

    .mp-project-end button {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 12px;
        width: 100%;
        min-height: 54px;
        padding: 0;
        border: 0;
        border-bottom: 1px solid var(--mp-ink);
        background: transparent;
        color: var(--mp-ink);
        font: 500 1.25rem/1 'Space Grotesk', sans-serif;
        text-align: left;
    }

    .mp-project-end .lucide {
        width: 22px;
        height: 22px;
    }

    .mp-lightbox {
        position: fixed;
        inset: 0;
        z-index: 200;
        display: grid;
        place-items: center;
        padding: 20px;
        background: rgba(0, 0, 0, 0.9);
    }

    .mp-lightbox img {
        display: block;
        width: auto;
        max-width: 100%;
        height: auto;
        max-height: calc(100svh - 40px);
        object-fit: contain;
    }

    .mp-lightbox button {
        position: absolute;
        top: max(12px, env(safe-area-inset-top));
        right: 12px;
        z-index: 1;
        display: grid;
        place-items: center;
        width: 44px;
        height: 44px;
        padding: 0;
        border: 1px solid rgba(255, 255, 255, 0.5);
        border-radius: 50%;
        background: rgba(0, 0, 0, 0.55);
        color: #fff;
    }

    .mp-lightbox .lucide {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 360px) {
    .mp-wordmark {
        font-size: 0.7rem;
        letter-spacing: 3px;
    }

    .mp-intro h1 {
        font-size: 2.8rem;
    }

    .mp-cv-profile {
        grid-template-columns: 72px minmax(0, 1fr);
    }

    .mp-cv-photo {
        width: 72px;
    }
}

@media (max-width: 768px) and (prefers-reduced-motion: reduce) {
    html.mobile-portfolio-active {
        scroll-behavior: auto;
    }

    .mp-menu-glyph rect,
    .mp-loading-line::after {
        transition: none;
        animation: none;
    }
}

@media print {
    @page {
        size: A4 portrait;
        margin: 12mm;
    }

    body.mobile-portfolio-active {
        background: #fff;
    }

    .mp-header,
    .mp-intro,
    .mp-works,
    .mp-footer,
    .mp-section-heading {
        display: none !important;
    }

    .mp-resume {
        padding: 0 !important;
    }

    .mp-cv-sheet {
        margin: 0;
        padding: 0;
        border: 0;
    }
}
