:root {
    --public-nav-base-height: 78px;
    --public-nav-height: 78px;
    --public-viewport-height: 100svh;
    --public-bg: #090909;
    --public-surface: #111111;
    --public-surface-2: #191919;
    --public-text: #f4f4f2;
    --public-muted: #a7a7a2;
    --public-border: rgba(255,255,255,.16);
    --public-control-bg: rgba(9,9,9,.82);
    --public-shadow: 0 18px 50px rgba(0,0,0,.26);
}

html[data-theme="light"] {
    --public-bg: #f6f5f1;
    --public-surface: #ffffff;
    --public-surface-2: #eceae4;
    --public-text: #151515;
    --public-muted: #686861;
    --public-border: rgba(0,0,0,.17);
    --public-control-bg: rgba(255,255,255,.9);
    --public-shadow: 0 18px 50px rgba(0,0,0,.1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html.lightbox-open {
    overflow: hidden;
    overscroll-behavior: none;
}
body {
    margin: 0;
    min-height: 100vh;
    background: var(--public-bg);
    color: var(--public-text);
    font-family: var(--public-body-font, serif);
    font-weight: 200;
    transition: background-color .25s ease, color .25s ease;
}
body.lightbox-open {
    position: fixed;
    top: var(--lightbox-scroll-offset, 0);
    right: 0;
    left: 0;
    width: 100%;
    overflow: hidden;
    overscroll-behavior: none;
}
img { max-width: 100%; }
a { color: inherit; }
button, input, textarea, select { font: inherit; }
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}
[data-protected-media],
.portfolio-card__media,
.portfolio-carousel__image-button,
.portrait-button,
.exhibition-gallery__showcase-button,
.exhibition-gallery__thumbnail,
.gallery-lightbox {
    -webkit-user-drag: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.public-nav {
    position: fixed;
    inset: 0 0 auto;
    z-index: 1000;
    min-height: var(--public-nav-base-height);
    background: color-mix(in srgb, var(--public-bg) 96%, transparent);
    border-bottom: 1px solid var(--public-border);
    backdrop-filter: blur(14px);
}
.public-nav__inner {
    width: min(100%, 1760px);
    min-height: var(--public-nav-base-height);
    margin: 0 auto;
    padding: 0 clamp(1rem, 3vw, 3rem);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}
.public-nav__brand {
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-family: var(--public-heading-font, serif);
    font-size: clamp(1rem, 1.4vw, 1.25rem);
    font-weight: 300;
    white-space: nowrap;
}
.public-nav__links { display: flex; align-items: center; gap: clamp(.9rem, 2vw, 1.65rem); }
.public-nav__link {
    position: relative;
    padding: .55rem 0;
    color: var(--public-muted);
    text-decoration: none;
    font-size: .86rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    font-weight: 300;
    transition: color .2s ease;
}
.public-nav__link:hover,
.public-nav__link.is-active { color: var(--public-text); }
.public-nav__link.is-active::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: .25rem;
    left: 0;
    height: 1px;
    background: currentColor;
}
.public-nav__menu {
    display: none;
    border: 0;
    background: transparent;
    color: var(--public-text);
    width: 42px;
    height: 42px;
    cursor: pointer;
}
.public-theme-toggle {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--public-border);
    border-radius: 999px;
    background: transparent;
    color: var(--public-text);
    cursor: pointer;
}
.theme-icon-light { display: none; }
html[data-theme="light"] .theme-icon-light { display: inline-block; }
html[data-theme="light"] .theme-icon-dark { display: none; }

.public-shell {
    width: min(100%, 1760px);
    margin: 0 auto;
    padding: calc(var(--public-nav-height) + clamp(1.5rem, 3vw, 3rem)) clamp(1rem, 3vw, 3rem) clamp(3rem, 7vw, 7rem);
}
.public-empty {
    min-height: calc(100vh - var(--public-nav-height));
    display: grid;
    place-items: center;
    color: var(--public-muted);
    text-align: center;
}

/* Listing pages */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(2rem, 5vw, 5rem) clamp(1rem, 3vw, 2.5rem);
}
.portfolio-card { min-width: 0; }
.portfolio-card__link { display: block; text-decoration: none; }
.portfolio-card__media {
    position: relative;
    background: var(--public-surface);
    aspect-ratio: 4 / 3;
}
.portfolio-card__media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    object-position: center;
    transition: opacity .25s ease;
}
.portfolio-card__link:hover img { opacity: .9; }
.portfolio-card__title {
    margin: .85rem 0 0;
    font-family: var(--public-heading-font, serif);
    font-size: clamp(1.15rem, 2vw, 1.7rem);
    font-weight: 200;
}

/* Project and commission details */
.portfolio-detail {
    min-height: var(--public-viewport-height);
    padding-top: var(--public-nav-height);
}
.portfolio-carousel {
    min-height: 300px;
    height: calc(var(--public-viewport-height) - var(--public-nav-height));
}
.portfolio-carousel {
    width: min(100%, 1840px);
    margin: 0 auto;
    padding: clamp(1rem, 2vw, 2rem) clamp(.25rem, 1.5vw, 1.5rem);
    display: grid;
    grid-template-columns: clamp(44px, 6vw, 92px) minmax(0, 1fr) clamp(44px, 6vw, 92px);
    grid-template-rows: minmax(0, 1fr) auto;
    align-items: stretch;
    outline: none;
}
.portfolio-carousel__viewport {
    grid-column: 2;
    position: relative;
    min-width: 0;
    min-height: 0;
    background: var(--public-surface);
    overflow: hidden;
}
.portfolio-carousel__slide {
    position: absolute;
    inset: 0;
    margin: 0;
    display: grid;
    place-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
}
.portfolio-carousel__slide.is-active { opacity: 1; pointer-events: auto; }
.portfolio-carousel__text-slide {
    display: block;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: clamp(2rem, 7vw, 7rem);
    scrollbar-width: thin;
}
.portfolio-carousel__text-content {
    width: min(100%, 840px);
    min-height: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.portfolio-carousel__text-title {
    margin: 0;
    font-family: var(--public-heading-font, serif);
    font-size: clamp(2.2rem, 3vw, 6.5rem);
    font-weight: 200;
    line-height: 1.02;
}
.portfolio-carousel__text-description {
    margin-top: clamp(1.4rem, 3vw, 2.5rem);
    color: var(--public-text);
    font-size: clamp(1rem, 1.45vw, 1.25rem);
    font-weight: 200;
    line-height: 1.8;
    white-space: pre-line;
    overflow-wrap: anywhere;
}
.portfolio-carousel__image-button {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    display: grid;
    place-items: center;
    background: transparent;
    cursor: zoom-in;
}
.portfolio-carousel__image-button:focus-visible {
    outline: 2px solid var(--public-text);
    outline-offset: -4px;
}
.portfolio-carousel__image-button img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}
.portfolio-carousel__control {
    align-self: stretch;
    border: 0;
    background: transparent;
    color: var(--public-text);
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: clamp(1rem, 2vw, 1.35rem);
}
.portfolio-carousel__control span {
    display: grid;
    place-items: center;
    width: clamp(36px, 4.5vw, 54px);
    height: clamp(36px, 4.5vw, 54px);
    border: 1px solid var(--public-border);
    border-radius: 999px;
    background: var(--public-control-bg);
}
.portfolio-carousel__prev { grid-column: 1; grid-row: 1; }
.portfolio-carousel__next { grid-column: 3; grid-row: 1; }
.portfolio-carousel__counter {
    grid-column: 2;
    grid-row: 2;
    justify-self: center;
    padding-top: .65rem;
    color: var(--public-muted);
    font-size: .8rem;
    letter-spacing: .08em;
}
.portfolio-carousel.is-single { grid-template-columns: 0 minmax(0, 1fr) 0; }
.portfolio-carousel.is-single .portfolio-carousel__control,
.portfolio-carousel.is-single .portfolio-carousel__counter { display: none; }

/* Exhibitions */
.exhibitions-flow { display: grid; gap: clamp(5rem, 11vw, 11rem); }
.exhibition-entry { border-bottom: 1px solid var(--public-border); padding-bottom: clamp(4rem, 8vw, 8rem); }
.exhibition-entry:last-child { border-bottom: 0; padding-bottom: 0; }
.exhibition-entry__text { max-width: 920px; margin-bottom: clamp(2rem, 5vw, 4.5rem); }
.exhibition-entry__title {
    margin: 0 0 1rem;
    font-family: var(--public-heading-font, serif);
    font-size: clamp(1vw);
    line-height: 1;
    font-weight: 200;
}
.exhibition-entry__meta { display: flex; flex-wrap: wrap; gap: .4rem 1.5rem; color: var(--public-muted); text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; }
.exhibition-entry__description { margin-top: 1.75rem; white-space: pre-line; font-size: clamp(1rem, 1.4vw, 1.15rem); line-height: 1.85; }
.exhibition-gallery {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}
.exhibition-gallery__showcase {
    position: relative;
    height: clamp(420px, 68vh, 820px);
    min-width: 0;
    background: var(--public-surface);
}
.exhibition-gallery__showcase-button {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
}
.exhibition-gallery__showcase-button:focus-visible,
.exhibition-gallery__thumbnail:focus-visible,
.portrait-button:focus-visible {
    outline: 2px solid var(--public-text);
    outline-offset: 2px;
}
.exhibition-gallery__showcase-image {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}
.exhibition-gallery__thumb-region {
    width: 100%;
    min-width: 0;
    margin-top: clamp(.65rem, 1.3vw, 1rem);
    display: grid;
    grid-template-columns: 0 minmax(0, 1fr) 0;
    gap: clamp(.35rem, .8vw, .75rem);
    align-items: center;
}
.exhibition-gallery__thumb-region.has-overflow {
    grid-template-columns: 42px minmax(0, 1fr) 42px;
}
.exhibition-gallery__thumb-track {
    grid-column: 2;
    min-width: 0;
    display: flex;
    gap: clamp(.5rem, 1vw, .85rem);
    padding: .2rem;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    scrollbar-color: var(--public-muted) transparent;
    touch-action: pan-x;
}
.exhibition-gallery__scroll-prev { grid-column: 1; }
.exhibition-gallery__scroll-next { grid-column: 3; }
.exhibition-gallery__thumbnail {
    position: relative;
    flex: 0 0 clamp(68px, 8vw, 104px);
    aspect-ratio: 1;
    padding: 0;
    border: 1px solid var(--public-border);
    border-radius: 2px;
    background: var(--public-surface);
    cursor: pointer;
    scroll-snap-align: start;
    scroll-snap-stop: normal;
}
.exhibition-gallery__thumbnail.is-active {
    border-color: var(--public-text);
    box-shadow: 0 0 0 1px var(--public-text);
}
.exhibition-gallery__thumbnail img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}
.exhibition-gallery__scroll-button {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid var(--public-border);
    border-radius: 999px;
    background: var(--public-control-bg);
    color: var(--public-text);
    cursor: pointer;
}
.exhibition-gallery__scroll-button:disabled {
    opacity: .3;
    cursor: default;
}
.exhibition-gallery__scroll-button[hidden] { display: none; }

/* Portraits */
.portrait-grid { columns: 3 320px; column-gap: clamp(.75rem, 1.5vw, 1.5rem); }
.portrait-card { break-inside: avoid; margin: 0 0 clamp(.75rem, 1.5vw, 1.5rem); }
.portrait-button { width: 100%; padding: 0; border: 0; background: transparent; cursor: zoom-in; }
.portrait-button img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
    object-position: center;
}

/* Shared full-screen gallery viewer */
.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: grid;
    grid-template-columns: clamp(48px, 7vw, 100px) minmax(0, 1fr) clamp(48px, 7vw, 100px);
    grid-template-rows: clamp(48px, 7vh, 68px) minmax(0, 1fr);
    align-items: center;
    padding: clamp(.5rem, 2vw, 1.5rem);
    background: rgba(0,0,0,.94);
    touch-action: pan-y;
}
.gallery-lightbox[hidden] { display: none; }
.gallery-lightbox.is-single {
    grid-template-columns: 0 minmax(0, 1fr) 0;
}
.gallery-lightbox__image {
    grid-column: 2;
    grid-row: 2;
    justify-self: center;
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    min-width: 0;
    min-height: 0;
    object-fit: contain;
    object-position: center;
}
.gallery-lightbox__button {
    border: 1px solid rgba(255,255,255,.38);
    border-radius: 999px;
    background: rgba(0,0,0,.45);
    color: #fff;
    width: 48px;
    height: 48px;
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: 1.55rem;
    line-height: 1;
}
.gallery-lightbox__button:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}
.gallery-lightbox__prev { grid-column: 1; grid-row: 2; justify-self: center; }
.gallery-lightbox__next { grid-column: 3; grid-row: 2; justify-self: center; }
.gallery-lightbox__close {
    grid-column: 1 / -1;
    grid-row: 1;
    justify-self: end;
}

/* About */
.about-layout {
    display: grid;
    grid-template-columns: minmax(250px, .72fr) minmax(0, 1.55fr);
    gap: clamp(2.5rem, 7vw, 8rem);
    align-items: start;
}
.about-profile { position: sticky; top: calc(var(--public-nav-height) + 2rem); }
.about-profile__image { width: 100%; max-width: 480px; display: block; background: var(--public-surface); }
.about-profile__name { margin: 1.4rem 0 .5rem; font-family: var(--public-heading-font, serif); font-size: clamp(1.7rem, 3vw, 2.8rem); }
.about-profile__contact { display: grid; gap: .45rem; color: var(--public-muted); }
.about-profile__contact a { text-decoration: none; }
.about-socials { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: 1.15rem; }
.about-socials a { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--public-border); border-radius: 999px; text-decoration: none; }
.about-content { min-width: 0; }
.about-bio { margin: 0 0 clamp(3rem, 7vw, 6rem); font-size: clamp(1.08rem, 1.7vw, 1.4rem); line-height: 1.9; white-space: pre-line; }
.about-section { padding: 0 0 clamp(2.6rem, 5vw, 4.8rem); margin-bottom: clamp(2.6rem, 5vw, 4.8rem); border-bottom: 1px solid var(--public-border); }
.about-section:last-of-type { border-bottom: 0; }
.about-section__title { margin: 0 0 1.25rem; font-family: var(--public-heading-font, serif); font-size: clamp(1.55rem, 2.4vw, 2.1rem); font-weight: 200; }
.about-section__body { white-space: pre-line; font-size: 1rem; line-height: 1.85; }
.about-section__link { display: inline-block; margin-top: 1rem; text-underline-offset: .25em; }
.cv-list { list-style: none; margin: 0; padding: 0; }
.cv-list li { padding: 1rem 0; border-top: 1px solid var(--public-border); line-height: 1.6; }
.cv-list li:last-child { border-bottom: 1px solid var(--public-border); }
.cv-list a { text-underline-offset: .25em; }
.about-copyright { margin-top: clamp(2rem, 5vw, 5rem); color: var(--public-muted); font-size: .82rem; letter-spacing: .04em; }

@media (max-width: 900px) {
    :root {
        --public-nav-base-height: 70px;
        --public-nav-height: 70px;
    }
    .public-nav__menu { display: grid; place-items: center; }
    .public-nav__links {
        position: absolute;
        top: var(--public-nav-height);
        right: 0;
        left: 0;
        display: none;
        align-items: stretch;
        padding: 1rem clamp(1rem, 3vw, 3rem) 1.4rem;
        background: var(--public-bg);
        border-bottom: 1px solid var(--public-border);
    }
    .public-nav__links.is-open { display: grid; gap: .25rem; }
    .public-nav__link { padding: .75rem 0; }
    .public-theme-toggle { margin-top: .5rem; }
    .portfolio-grid { grid-template-columns: 1fr; }
    .about-layout { grid-template-columns: 1fr; }
    .about-profile { position: static; }
    .about-profile__image { max-width: 520px; }
}

@media (max-width: 620px) {
    .portfolio-carousel { grid-template-columns: 44px minmax(0, 1fr) 44px; padding-right: 0; padding-left: 0; }
    .portfolio-carousel__text-slide { padding: clamp(1.25rem, 6vw, 2rem); }
    .portfolio-carousel__text-content { justify-content: flex-start; padding: clamp(1rem, 7vh, 3.5rem) 0; }
    .portfolio-carousel__text-title { font-size: clamp(2rem, 12vw, 3.6rem); }
    .portfolio-carousel__text-description { font-size: clamp(.98rem, 4.2vw, 1.08rem); line-height: 1.7; }
    .exhibition-gallery__showcase { height: clamp(280px, 55vh, 560px); }
    .exhibition-gallery__thumb-region.has-overflow { grid-template-columns: 36px minmax(0, 1fr) 36px; gap: .3rem; }
    .exhibition-gallery__scroll-button { width: 36px; height: 36px; }
    .exhibition-gallery__thumbnail { flex-basis: clamp(64px, 22vw, 84px); }
    .portrait-grid { columns: 2 150px; }
    .gallery-lightbox { grid-template-columns: 44px minmax(0, 1fr) 44px; padding: .35rem; }
    .gallery-lightbox.is-single { grid-template-columns: 0 minmax(0, 1fr) 0; }
    .gallery-lightbox__button { width: 40px; height: 40px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .portfolio-carousel__slide,
    .portfolio-card__media img {
        transition: none;
    }
    .exhibition-gallery__thumb-track { scroll-behavior: auto; }
}
