:root {
    color-scheme: dark;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #0f172a;
    color: #f8fafc;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-snap-type: y mandatory;
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(ellipse at top, rgba(66, 9, 101, 0.3), transparent 50%),
        #213480;
}

.hero {
    width: min(72rem, calc(100% - 2rem));
    margin-inline: auto;
    padding-block: 3rem 2rem;
    text-align: center;
}

.hero h1 {
    margin: 0;
    font-size: clamp(2rem, 6vw, 3.5rem);
    letter-spacing: -0.04em;
}

.hero p {
    margin: 0.75rem 0 0;
    color: #89aedb;
    font-size: 1.1rem;
}

.timeline {
    width: 100%;
}

.art-card {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    align-items: center;
    gap: clamp(2rem, 6vw, 6rem);
    min-height: 100vh;
    min-height: 100svh;
    padding: 3rem max(1rem, calc((100vw - 72rem) / 2));
    border-bottom: 1px solid rgb(148 163 184 / 14%);
    opacity: 1;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    transform: none;
    transition: opacity 700ms ease, transform 700ms ease;
}

.art-info {
    grid-column: 1;
    grid-row: 1;
}

.art-info h2 {
    margin: 0;
    font-size: clamp(2.5rem, 5vw, 5rem);
    letter-spacing: -0.04em;
}

.art-info p {
    margin: 1rem 0 0;
    color: #cbd5e1;
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    line-height: 1.6;
}

.art-image-wrap {
    display: grid;
    grid-column: 2;
    grid-row: 1;
    place-items: center;
    width: 100%;
    height: min(72svh, 52rem);
    overflow: hidden;
    border: 1px solid rgb(148 163 184 / 18%);
    border-radius: 1.25rem;
    background: #111c31;
    box-shadow: 0 1rem 3rem rgb(0 0 0 / 24%);
}

.art-image-wrap img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.artwork-open-button {
    display: grid;
    width: 100%;
    height: 100%;
    padding: 0;
    place-items: center;
    border: 0;
    background: transparent;
    cursor: zoom-in;
}

.artwork-open-button:focus-visible {
    outline: 2px solid #7dd3fc;
    outline-offset: -4px;
}

.artwork-modal {
    width: fit-content;
    max-width: none;
    height: fit-content;
    max-height: none;
    margin: auto;
    padding: 0;
    overflow: visible;
    border: 0;
    background: transparent;
    color: #f8fafc;
}

.artwork-modal::backdrop {
    background: rgb(2 6 23 / 88%);
    backdrop-filter: blur(8px);
}

.lightbox-content {
    width: fit-content;
    height: fit-content;
    padding: 1rem;
}

.lightbox-figure {
    display: grid;
    grid-template-rows: auto auto;
    gap: 0.75rem;
    width: fit-content;
    height: fit-content;
    margin: 0;
}

.lightbox-image-frame {
    position: relative;
    display: grid;
    width: fit-content;
    height: fit-content;
    place-items: center;
    border: 1px solid rgb(148 163 184 / 24%);
    border-radius: 1rem;
    background: #111c31;
    box-shadow: 0 1rem 3rem rgb(0 0 0 / 40%);
}

.expanded-artwork {
    display: block;
    width: auto;
    height: auto;
    max-width: calc(100vw - 4rem);
    max-height: calc(100vh - 7rem);
    max-height: calc(100svh - 7rem);
    border-radius: 0.95rem;
    object-fit: contain;
}

.lightbox-action {
    position: absolute;
    top: 1rem;
    display: inline-flex;
    min-width: 2.75rem;
    min-height: 2.75rem;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 1rem;
    border: 1px solid rgb(148 163 184 / 32%);
    border-radius: 999px;
    background: rgb(15 23 42 / 88%);
    color: #f8fafc;
    cursor: pointer;
    font: inherit;
    text-decoration: none;
    backdrop-filter: blur(12px);
}

.lightbox-download {
    left: 1rem;
}

.lightbox-close {
    right: 1rem;
    padding: 0.5rem;
    font-size: 1.5rem;
    line-height: 1;
}

.lightbox-action:hover {
    background: #334155;
}

.lightbox-action:focus-visible {
    outline: 2px solid #7dd3fc;
    outline-offset: 3px;
}

.lightbox-figure figcaption {
    color: #cbd5e1;
    text-align: center;
}

.gallery-ready .art-card {
    opacity: 0.18;
    transform: scale(0.985);
}

.gallery-ready .art-card.is-active {
    opacity: 1;
    transform: scale(1);
}

.gallery-controls {
    position: fixed;
    z-index: 10;
    bottom: max(1rem, env(safe-area-inset-bottom));
    left: 50%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid rgb(148 163 184 / 24%);
    border-radius: 999px;
    background: rgb(15 23 42 / 88%);
    box-shadow: 0 0.5rem 2rem rgb(0 0 0 / 32%);
    color: #f8fafc;
    transform: translateX(-50%);
    backdrop-filter: blur(12px);
}

.gallery-controls > span {
    min-width: 7rem;
    color: #cbd5e1;
    font-size: 0.9rem;
    text-align: center;
}

.arrow-button {
    display: grid;
    width: 2.75rem;
    height: 2.75rem;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: #1e293b;
    color: #f8fafc;
    cursor: pointer;
    font: inherit;
    font-size: 1.5rem;
    line-height: 1;
    transition: background-color 180ms ease, opacity 180ms ease;
}

.arrow-button:hover:not(:disabled) {
    background: #334155;
}

.arrow-button:focus-visible {
    outline: 2px solid #7dd3fc;
    outline-offset: 3px;
}

.arrow-button:disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

.site-stats {
    min-height: 70vh;
    min-height: 70svh;
    display: grid;
    align-content: center;
    padding: 5rem max(1rem, calc((100vw - 72rem) / 2)) 8rem;
    border-top: 1px solid rgb(148 163 184 / 14%);
    background:
        radial-gradient(circle at 50% 100%, rgba(125, 211, 252, 0.12), transparent 42%);
    text-align: center;
    scroll-snap-align: end;
}

.stats-kicker {
    margin: 0 0 0.5rem;
    color: #7dd3fc;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.site-stats h2 {
    margin: 0;
    font-size: clamp(2rem, 5vw, 3.5rem);
    letter-spacing: -0.04em;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin: 2.5rem 0 0;
}

.stat-card {
    min-width: 0;
    padding: 1.5rem 1rem;
    border: 1px solid rgb(148 163 184 / 18%);
    border-radius: 1rem;
    background: rgb(15 23 42 / 55%);
    box-shadow: 0 1rem 3rem rgb(0 0 0 / 18%);
    backdrop-filter: blur(12px);
}

.stat-card dt {
    color: #9fc1e8;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.stat-card dd {
    margin: 0.75rem 0 0;
    color: #f8fafc;
    font-size: clamp(2rem, 4vw, 3.25rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 48rem) {
    .hero {
        padding-block: 2.5rem 1.5rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .site-stats {
        padding-inline: 1rem;
    }

    .art-card {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto minmax(0, 1fr);
        gap: 1.5rem;
        padding: 2rem 1rem 5.5rem;
    }

    .art-info {
        grid-column: 1;
        grid-row: 1;
    }

    .art-image-wrap {
        grid-column: 1;
        grid-row: 2;
        height: min(58svh, 34rem);
    }
}

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

    .art-card,
    .arrow-button {
        transition: none;
    }
}
