* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: #f3f0e9;
    color: #111;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
}

.nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    z-index: 100;
    mix-blend-mode: difference;
}

.nav a {
    color: white;
    text-decoration: none;
    font-size: 10px;
    letter-spacing: .08em;
}

.nav nav {
    display: flex;
    gap: 25px;
}

.nav-projects {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.projects-page .nav {
    transition: transform .22s ease, opacity .22s ease, visibility 0s linear;
}

.projects-page .nav.is-hidden {
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition-delay: 0s, 0s, .22s;
}

.hero {
    min-height: 100vh;
    min-height: 100svh;
    position: relative;
    display: grid;
    place-items: center;
    overflow: hidden;
    touch-action: pan-y;
    background: #f3f0e9;
}

.carousel {
    position: absolute;
    inset: 6vh 9vw 9vh;
}

.carousel-slides,
.carousel-slide {
    position: absolute;
    inset: 0;
    list-style: none;
}

.carousel-slide {
    z-index: 0;
    overflow: hidden;
    opacity: 0;
    transform: none;
    transition: opacity .12s ease-in-out;
    pointer-events: none;
}

.carousel-slide.is-current {
    z-index: 1;
    opacity: 1;
    pointer-events: auto;
}

.carousel-slide.is-leaving {
    z-index: 2;
    opacity: 0;
}

.carousel-slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform .28s ease;
}

.hero.is-paused .carousel-slide.is-current img {
    transform: scale(.985);
}

.section {
    min-height: 100vh;
    padding: 140px 20px;
    position: relative;
}

.label {
    position: absolute;
    top: 38px;
    left: 20px;
    font-size: 9px;
    letter-spacing: .1em;
    opacity: .5;
}

.about h1 {
    grid-area: heading;
    font-size: clamp(56px, min(9vw, 17vh), 140px);
    font-weight: 400;
    line-height: .8;
    letter-spacing: -.08em;
}

.about {
    display: flex;
    align-items: center;
}

.about.section {
    min-height: calc(100svh - 52px);
    padding: 64px 20px 28px;
}

.about-grid {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, .72fr);
    grid-template-areas:
        "heading portrait"
        "copy portrait";
    grid-template-rows: auto auto;
    align-items: start;
    column-gap: 8vw;
    padding-right: 48px;
}

.about-copy {
    grid-area: copy;
    max-width: 700px;
}

.bio-copy {
    max-width: 490px;
    margin-top: 24px;
    font-size: clamp(14px, min(1.15vw, 1.8vh), 19px);
    line-height: 1.25;
}

.bio-copy p + p {
    margin-top: 12px;
}

.about-portrait {
    grid-area: portrait;
    display: block;
    width: 100%;
    max-height: 76vh;
    object-fit: cover;
    align-self: center;
}

.contact-links {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    font-size: 16px;
}

.contact-links a {
    color: #111;
    text-decoration: none;
}

.contact-links a:hover,
.contact-links a:focus-visible {
    text-decoration: underline;
}

.about-signature {
    display: block;
    width: min(270px, 100%);
    height: auto;
    margin: -80px 210px 20px auto;
}

.location {
    margin-top: 24px;
    font-size: 9px;
    letter-spacing: .1em;
    opacity: .5;
}

footer {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    font-size: 9px;
    opacity: .5;
}

.home-page footer {
    position: fixed;
    z-index: 5;
    right: 0;
    bottom: 12px;
    left: 0;
    padding: 12px 20px;
    pointer-events: none;
}

.projects-section {
    min-height: 100svh;
    padding: 110px 20px 60px;
}

.projects-heading {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(17, 17, 17, .3);
}

.projects-heading h1 {
    font-size: 12px;
    font-weight: 400;
    letter-spacing: .08em;
}

.projects-heading span {
    font-size: 9px;
    letter-spacing: .08em;
    opacity: .55;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    column-gap: 18px;
    row-gap: 38px;
    padding-top: 18px;
}

.project-card {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    color: inherit;
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.project-frame {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 4 / 5;
    overflow: hidden;
}

.project-frame img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity .25s ease;
}

.project-preview {
    opacity: 0;
}

.project-card:hover .project-cover,
.project-card:focus-visible .project-cover {
    opacity: 0;
}

.project-card:hover .project-preview,
.project-card:focus-visible .project-preview {
    opacity: 1;
}

.project-card:focus-visible {
    outline: none;
}

.project-card:focus-visible .project-meta {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.project-card:focus:not(:focus-visible) {
    outline: none;
}

.project-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding-top: 10px;
    font-size: 10px;
    letter-spacing: .06em;
}

.project-count {
    font-size: 10px;
    color: #dddddd;
    margin-right: 8px;
    opacity: 1;
    white-space: nowrap;
}

.project-dialog {
    width: min(1400px, calc(100vw - 40px));
    max-width: none;
    max-height: calc(100svh - 40px);
    margin: auto;
    padding: 20px;
    border: 0;
    color: #111;
    background: #f3f0e9;
    overflow: auto;
}

.project-dialog::backdrop {
    background: rgba(0, 0, 0, .78);
}

.project-dialog-header {
    position: sticky;
    top: -20px;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: -20px -20px 16px;
    padding: 16px 20px;
    background: #f3f0e9;
}

.project-dialog-header h2 {
    font-size: 11px;
    font-weight: 400;
    letter-spacing: .08em;
}

.project-dialog-close {
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    color: inherit;
    background: transparent;
    font: inherit;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.project-dialog-close:focus-visible {
    outline: 1px solid currentColor;
}

.project-dialog-gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.project-dialog-gallery img {
    display: block;
    width: 100%;
    height: min(72svh, 760px);
    object-fit: contain;
}

@media (max-width: 700px) {
    .nav {
        padding: 15px;
    }

    .nav nav {
        gap: 12px;
    }

    .nav-projects {
        top: 16px;
    }

    .carousel {
        inset: 70px 8px 74px;
    }

    .section {
        padding: 110px 15px 70px;
    }

    .about.section {
        min-height: calc(100svh - 52px);
        padding: 64px 15px 18px;
        align-items: flex-start;
    }

    .about h1 {
        font-size: clamp(48px, 13vw, 64px);
    }

    .label {
        left: 15px;
        top: 33px;
    }

    .about-grid {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "heading"
            "portrait"
            "copy";
        grid-template-rows: auto auto 1fr;
        align-items: start;
        min-height: calc(100svh - 134px);
        gap: 12px;
        padding-right: 0;
    }

    .about-copy {
        grid-area: copy;
        min-width: 0;
    }

    .about-portrait {
        grid-area: portrait;
        align-self: center;
        justify-self: center;
        width: min(100%, 112px);
        height: clamp(90px, 17svh, 140px);
        max-height: 140px;
        aspect-ratio: 3 / 4;
        object-fit: cover;
        transform: translateY(10px);
    }

    .bio-copy {
        margin-top: 18px;
        font-size: clamp(13px, 3.7vw, 16px);
        line-height: 1.22;
    }

    .contact-links {
        margin-top: 18px;
        font-size: 14px;
    }

    .about-signature {
        width: min(160px, 60%);
        margin: -33px 20px 0 auto;
        transform: translateY(-32px);
    }

    .location {
        margin-top: 16px;
    }

    footer {
        flex-direction: column;
        gap: 8px;
    }

    .about-page footer {
        flex-direction: row;
        gap: 10px;
        padding: 10px 15px;
        font-size: 8px;
    }

    .home-page footer {
        flex-direction: row;
        gap: 10px;
        padding: 10px 15px;
        font-size: 8px;
    }

    .projects-section {
        padding: 80px 15px 35px;
    }

    .projects-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 12px;
        row-gap: 28px;
        padding-top: 14px;
    }

    .project-meta {
        font-size: 9px;
    }

    .project-dialog {
        width: calc(100vw - 20px);
        max-height: calc(100svh - 20px);
        padding: 12px;
    }

    .project-dialog-header {
        top: -12px;
        margin: -12px -12px 12px;
        padding: 12px;
    }

    .project-dialog-gallery {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .project-dialog-gallery img {
        height: min(72svh, 620px);
    }
}

@media (min-width: 701px) and (max-width: 1050px) {
    .projects-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}
