:root {
    color-scheme: dark;
    --background: #120f0d;
    --background-raised: #1a1512;
    --surface: #211a16;
    --surface-hover: #29201a;
    --border: #49372b;
    --border-bright: #74543b;
    --text: #f0e5d4;
    --text-muted: #bbaa96;
    --accent: #c7864d;
    --accent-light: #e0ad77;
    --danger: #e59a87;
    --shadow: rgb(0 0 0 / 42%);
    --content-width: 80rem;
    --serif: Georgia, "Times New Roman", serif;
    --sans:
        Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
        "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 20rem;
    background: var(--background);
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(
            circle at 20% -10%,
            rgb(113 70 38 / 22%),
            transparent 34rem
        ),
        var(--background);
    font-family: var(--sans);
    line-height: 1.5;
    text-rendering: optimizeLegibility;
}

img {
    display: block;
    max-width: 100%;
}

.skip-link {
    position: fixed;
    z-index: 100;
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.65rem 1rem;
    color: var(--background);
    background: var(--accent-light);
    border-radius: 0.25rem;
    font-weight: 700;
    transform: translateY(-200%);
}

.skip-link:focus {
    transform: translateY(0);
}

.site-header {
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--border);
    background:
        linear-gradient(
            105deg,
            rgb(20 15 12 / 96%),
            rgb(45 31 23 / 92%)
        ),
        var(--surface);
}

.site-header::before,
.site-header::after {
    position: absolute;
    right: -7rem;
    width: 28rem;
    height: 1px;
    background: var(--border-bright);
    content: "";
    opacity: 0.5;
    transform: rotate(-35deg);
}

.site-header::before {
    top: 3rem;
}

.site-header::after {
    top: 5rem;
}

.site-header__inner {
    position: relative;
    width: min(100% - 2rem, var(--content-width));
    margin-inline: auto;
    padding-block: clamp(1.25rem, 2.5vw, 2.25rem);
}

.site-header__inner::before {
    position: absolute;
    top: 1.25rem;
    bottom: 1.25rem;
    left: 0;
    width: 1px;
    background: repeating-linear-gradient(
        to bottom,
        var(--accent) 0 0.35rem,
        transparent 0.35rem 0.75rem
    );
    content: "";
    opacity: 0.65;
}

.site-header__eyebrow,
.gallery__eyebrow {
    margin: 0 0 0.7rem;
    color: var(--accent-light);
    font-size: 0.72rem;
    font-weight: 750;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.site-header__eyebrow,
.site-header__title,
.site-header__tagline {
    margin-left: clamp(1.25rem, 4vw, 3rem);
}

.site-header__title {
    max-width: none;
    margin-top: 0;
    margin-bottom: 0;
    font-family: var(--serif);
    font-size: clamp(2.4rem, 6vw, 5.25rem);
    font-weight: 400;
    letter-spacing: -0.045em;
    line-height: 0.95;
    text-wrap: balance;
}

.site-header__tagline {
    max-width: 34rem;
    margin-top: 1rem;
    margin-bottom: 0;
    color: var(--text-muted);
    font-size: clamp(1rem, 2vw, 1.2rem);
}

.gallery {
    width: min(100% - 2rem, var(--content-width));
    margin-inline: auto;
    padding-block: clamp(3rem, 7vw, 6rem);
}

.gallery__heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 2rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
}

.gallery__title {
    margin: 0;
    font-family: var(--serif);
    font-size: clamp(2rem, 4vw, 3.25rem);
    font-weight: 400;
    letter-spacing: -0.025em;
    line-height: 1;
}

.gallery-status {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.82rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.gallery-status--error {
    color: var(--danger);
    text-transform: none;
}

.gallery-grid {
    display: grid;
    grid-template-columns:
        repeat(
        auto-fit,
        minmax(min(100%, 18rem), 1fr)
    );
    gap: clamp(1rem, 2.5vw, 2rem);
    margin: 0;
    padding: 0;
    list-style: none;
}

.gallery-item {
    min-width: 0;
    animation: card-arrival 500ms ease-out both;
}

.gallery-item:nth-child(2) {
    animation-delay: 70ms;
}

.gallery-item:nth-child(3) {
    animation-delay: 140ms;
}

.gallery-item:nth-child(4) {
    animation-delay: 210ms;
}

.item-card {
    position: relative;
    height: 100%;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.35rem;
    box-shadow: 0 1.25rem 3rem -2rem var(--shadow);
    transition:
        border-color 180ms ease,
        background-color 180ms ease,
        transform 180ms ease;
}

.item-card:hover {
    background: var(--surface-hover);
    border-color: var(--border-bright);
    transform: translateY(-0.2rem);
}

.item-card__figure {
    position: relative;
    aspect-ratio: 4 / 3;
    margin: 0;
    overflow: hidden;
    background: #0b0908;
    border-bottom: 1px solid var(--border);
}

.item-card__figure::after {
    position: absolute;
    inset: auto 0 0;
    height: 35%;
    background: linear-gradient(
        transparent,
        rgb(12 9 7 / 35%)
    );
    content: "";
    pointer-events: none;
}

.item-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 500ms ease;
}

.item-card:hover .item-card__image {
    transform: scale(1.025);
}

.item-card__caption {
    padding: 1.2rem 1.25rem 1.35rem;
}

.item-card__heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
}

.item-card__title {
    margin: 0;
    font-family: var(--serif);
    font-size: 1.35rem;
    font-weight: 400;
    line-height: 1.15;
}

.item-card__price {
    flex: none;
    margin: 0;
    color: var(--accent-light);
    font-size: 0.86rem;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.item-card__description {
    max-width: 46ch;
    margin: 0.75rem 0 0;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.item-card__open {
    position: absolute;
    z-index: 2;
    inset: 0;
    width: 100%;
    padding: 0;
    cursor: pointer;
    background: transparent;
    border: 0;
    border-radius: inherit;
}

.item-card__open:focus-visible {
    outline: 3px solid var(--accent-light);
    outline-offset: -4px;
}

.dialog-open {
    overflow: hidden;
}

.lightbox {
    width: min(96vw, 90rem);
    max-width: none;
    height: min(94dvh, 60rem);
    max-height: none;
    padding: 0;
    color: var(--text);
    background: #0d0b09;
    border: 1px solid var(--border-bright);
    border-radius: 0.4rem;
    box-shadow: 0 2rem 6rem rgb(0 0 0 / 70%);
}

.lightbox[open] {
    animation: lightbox-arrival 180ms ease-out;
}

.lightbox::backdrop {
    background: rgb(5 4 3 / 86%);
    backdrop-filter: blur(0.25rem);
}

.lightbox__surface {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    height: 100%;
}

.lightbox__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    min-height: 5rem;
    padding: 0.9rem 1.25rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.lightbox__eyebrow {
    margin: 0 0 0.2rem;
    color: var(--accent-light);
    font-size: 0.66rem;
    font-weight: 750;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.lightbox__title {
    margin: 0;
    font-family: var(--serif);
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 400;
    line-height: 1.1;
}

.lightbox__close,
.lightbox__navigation {
    display: grid;
    flex: none;
    place-items: center;
    padding: 0;
    color: var(--text);
    cursor: pointer;
    background: rgb(0 0 0 / 22%);
    border: 1px solid var(--border-bright);
    border-radius: 50%;
}

.lightbox__close {
    width: 2.75rem;
    height: 2.75rem;
    font-size: 1.8rem;
    line-height: 1;
}

.lightbox__close:hover,
.lightbox__navigation:hover:not(:disabled) {
    color: var(--background);
    background: var(--accent-light);
    border-color: var(--accent-light);
}

.lightbox__close:focus-visible,
.lightbox__navigation:focus-visible {
    outline: 3px solid var(--accent-light);
    outline-offset: 3px;
}

.lightbox__viewport {
    display: grid;
    grid-template-columns: 4rem minmax(0, 1fr) 4rem;
    min-height: 0;
    overflow: hidden;
    touch-action: pan-y;
    background:
        radial-gradient(
            circle,
            rgb(70 50 36 / 24%),
            transparent 65%
        ),
        #090706;
}

.lightbox__image-frame {
    display: grid;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    place-items: center;
    padding: 1rem;
}

.lightbox__image {
    width: auto;
    height: auto;
    min-width: 0;
    min-height: 0;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.lightbox__navigation {
    align-self: center;
    width: 3rem;
    height: 3rem;
    margin-inline: auto;
    font-size: 2.3rem;
    line-height: 1;
}

.lightbox__navigation:disabled {
    cursor: default;
    opacity: 0.25;
}

.lightbox__caption {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    min-height: 5rem;
    padding: 0.9rem 1.25rem;
    background: var(--surface);
    border-top: 1px solid var(--border);
}

.lightbox__description {
    max-width: 56rem;
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.lightbox__details {
    display: flex;
    flex: none;
    align-items: center;
    gap: 1rem;
}

.lightbox__counter,
.lightbox__price {
    margin: 0;
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.lightbox__counter {
    color: var(--text-muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.lightbox__price {
    color: var(--accent-light);
    font-weight: 750;
}

.site-footer {
    width: min(100% - 2rem, var(--content-width));
    margin-inline: auto;
    padding-block: 1.5rem 2.5rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    font-family: var(--serif);
    font-size: 0.9rem;
    font-style: italic;
}

.site-footer p {
    margin: 0;
}

@keyframes card-arrival {
    from {
        opacity: 0;
        transform: translateY(0.75rem);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes lightbox-arrival {
    from {
        opacity: 0;
        transform: scale(0.985);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@media (max-width: 40rem) {
    .site-header__inner,
    .gallery,
    .site-footer {
        width: min(100% - 1.25rem, var(--content-width));
    }

    .site-header__inner {
        padding-block: 1.125rem;
    }

    .gallery {
        padding-block: 2.75rem;
    }

    .gallery__heading {
        display: block;
    }

    .gallery-status {
        margin-top: 1rem;
    }

    .item-card__caption {
        padding-inline: 1rem;
    }

    .lightbox {
        width: 100vw;
        height: 100dvh;
        border: 0;
        border-radius: 0;
    }

    .lightbox__header,
    .lightbox__caption {
        padding-inline: 0.8rem;
    }

    .lightbox__viewport {
        position: relative;
        grid-template-columns: minmax(0, 1fr);
    }

    .lightbox__image-frame {
        grid-column: 1;
        grid-row: 1;
        padding: 0.5rem;
    }

    .lightbox__navigation {
        position: absolute;
        z-index: 2;
        top: 50%;
        width: 2.75rem;
        height: 2.75rem;
        transform: translateY(-50%);
    }

    .lightbox__navigation--previous {
        left: 0.5rem;
    }

    .lightbox__navigation--next {
        right: 0.5rem;
    }

    .lightbox__caption {
        display: block;
    }

    .lightbox__details {
        justify-content: space-between;
        margin-top: 0.6rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .gallery-item {
        animation: none;
    }

    .item-card,
    .item-card__image,
    .skip-link {
        transition: none;
    }

    .item-card:hover {
        transform: none;
    }

    .item-card:hover .item-card__image {
        transform: none;
    }

    .lightbox[open] {
        animation: none;
    }
}
