:root {
    color-scheme: light;
    --ink: #151515;
    --muted: #6a6560;
    --paper: #fbfaf8;
    --panel: #ffffff;
    --line: #e5dfd8;
    --accent: #de3c7e;
    --accent-strong: #b91f61;
    --green: #1f7a68;
    --gold: #b98628;
    --stage: #1c1a18;
    --stage-alt: #24211f;
    --button-surface: rgba(255, 255, 255, .94);
    --focus-ring: color-mix(in srgb, var(--accent) 55%, white);
    --shadow: rgba(0, 0, 0, .14);
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --ink: #f3f0eb;
    --muted: #b9b0a8;
    --paper: #151413;
    --panel: #201e1c;
    --line: #3a3430;
    --accent: #ff72aa;
    --accent-strong: #ff9cc3;
    --green: #69d2ba;
    --gold: #dfb867;
    --stage: #0e0d0c;
    --stage-alt: #171513;
    --button-surface: rgba(32, 30, 28, .94);
    --focus-ring: color-mix(in srgb, var(--accent) 60%, black);
    --shadow: rgba(0, 0, 0, .42);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    background: var(--paper);
    color: var(--ink);
}

img {
    display: block;
    max-width: 100%;
}

button {
    font: inherit;
}

h1,
h2,
p,
dl {
    margin-top: 0;
}

h1 {
    font-size: clamp(2.2rem, 4vw, 5rem);
    line-height: 1;
    letter-spacing: 0;
    margin-bottom: 1.25rem;
}

.brand-mark,
.brand-strip {
    font-weight: 800;
    letter-spacing: 0;
}

.brand-mark {
    color: var(--accent);
    font-size: 1.3rem;
    margin-bottom: 2rem;
}

.brand-strip {
    align-self: flex-start;
    border-bottom: 3px solid var(--accent);
    color: var(--ink);
    padding-bottom: .25rem;
    margin-bottom: 3rem;
}

.empty-state {
    min-height: 100vh;
    display: grid;
    place-content: center;
    padding: 2rem;
    text-align: center;
}

.empty-state h1 {
    font-size: clamp(2rem, 5vw, 4rem);
}

.empty-state p,
.description,
.muted,
.meta-line {
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1.6;
}

.artwork-view {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 440px);
    gap: clamp(1.5rem, 4vw, 4rem);
    padding: clamp(1rem, 3vw, 3rem);
}

.artwork-stage {
    min-height: calc(100vh - 2rem);
    display: grid;
    place-items: center;
    background: var(--stage);
    border-radius: 8px;
    overflow: hidden;
}

.artwork-stage img {
    width: 100%;
    height: 100%;
    max-height: calc(100vh - 2rem);
    object-fit: contain;
}

.detail-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(1rem, 2vw, 2rem) 0;
}

.eyebrow {
    color: var(--accent-strong);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .12em;
    margin-bottom: .9rem;
    text-transform: uppercase;
}

.metadata {
    display: grid;
    gap: .9rem;
    margin: 2rem 0 0;
}

.metadata div {
    border-top: 1px solid var(--line);
    display: grid;
    gap: .25rem;
    padding-top: .8rem;
}

.metadata dt {
    color: var(--muted);
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.metadata dd {
    margin: 0;
    font-size: 1rem;
}

.metadata-compact {
    gap: .4rem;
    margin-top: .75rem;
}

.metadata-compact div {
    border: 0;
    padding: 0;
}

.metadata-compact dt {
    display: none;
}

.metadata-compact dd {
    color: var(--muted);
    font-size: .92rem;
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: 1.5rem;
}

.tag-row span {
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--green);
    font-size: .9rem;
    padding: .35rem .75rem;
}

.collection-hero {
    min-height: 72vh;
    display: grid;
    grid-template-columns: minmax(0, .95fr) minmax(300px, 1.05fr);
    gap: clamp(2rem, 5vw, 5rem);
    align-items: center;
    padding: clamp(1.25rem, 4vw, 4rem);
}

.collection-copy {
    max-width: 680px;
}

.collection-lead {
    aspect-ratio: 4 / 3;
    background: var(--stage-alt);
    border-radius: 8px;
    overflow: hidden;
}

.collection-lead img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.collection-gallery-shell {
    min-height: 100vh;
    padding: clamp(1.25rem, 4vw, 4rem);
}

.collection-gallery-header {
    display: grid;
    grid-template-columns: minmax(140px, 220px) minmax(0, 760px);
    gap: clamp(1.5rem, 4vw, 4rem);
    align-items: start;
    margin-bottom: clamp(1.5rem, 4vw, 3.5rem);
}

.collection-gallery-header h1 {
    font-size: clamp(2rem, 5vw, 4.5rem);
}

.empty-collection {
    border: 1px dashed var(--line);
    border-radius: 8px;
    display: grid;
    min-height: 280px;
    place-content: center;
    text-align: center;
}

.empty-collection h2 {
    color: var(--muted);
    font-size: 1.1rem;
    margin: 0;
}

.collection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.25rem;
    padding: 0 0 1rem;
}

.artwork-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
}

.artwork-card-button {
    appearance: none;
    background: transparent;
    border: 0;
    color: inherit;
    cursor: pointer;
    display: grid;
    height: 100%;
    padding: 0;
    text-align: left;
    width: 100%;
}

.artwork-card-button:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 3px;
}

.artwork-card-button:hover .artwork-card-title {
    color: var(--accent-strong);
}

.artwork-thumb {
    display: block;
    background: var(--stage-alt);
}

.artwork-thumb img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
}

.artwork-card-body {
    display: block;
    min-height: 138px;
    padding: 1rem;
}

.artwork-card-title {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: .5rem;
    overflow-wrap: anywhere;
}

.collection-detail-view {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 440px);
    grid-template-rows: auto minmax(0, 1fr);
    gap: clamp(1rem, 3vw, 3rem);
    padding: clamp(1rem, 3vw, 3rem);
}

.detail-toolbar {
    display: flex;
    grid-column: 1 / -1;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.detail-toolbar .brand-strip {
    margin-bottom: 0;
}

.collection-detail-stage {
    position: relative;
    min-height: calc(100vh - 8rem);
    display: grid;
    place-items: center;
    background: var(--stage);
    border-radius: 8px;
    overflow: hidden;
}

.collection-detail-stage img {
    width: 100%;
    height: 100%;
    max-height: calc(100vh - 8rem);
    object-fit: contain;
}

.collection-detail-panel h1 {
    font-size: clamp(2rem, 4vw, 4.25rem);
    overflow-wrap: anywhere;
}

.icon-button,
.nav-button,
.secondary-button {
    border: 1px solid var(--line);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color .15s ease, color .15s ease, opacity .15s ease, transform .15s ease;
}

.icon-button,
.nav-button {
    width: 3rem;
    height: 3rem;
    display: inline-grid;
    place-items: center;
    background: var(--button-surface);
    color: var(--ink);
    font-size: 2rem;
    line-height: 1;
}

.icon-button:hover:not(:disabled),
.nav-button:hover:not(:disabled),
.secondary-button:hover {
    border-color: var(--accent);
    color: var(--accent-strong);
}

.icon-button:focus-visible,
.nav-button:focus-visible,
.secondary-button:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 3px;
}

.icon-button:disabled,
.nav-button:disabled {
    cursor: default;
    opacity: .35;
}

.close-button {
    flex: 0 0 auto;
}

.nav-button {
    position: absolute;
    top: 50%;
    z-index: 1;
    transform: translateY(-50%);
}

.nav-button-left {
    left: 1rem;
}

.nav-button-right {
    right: 1rem;
}

.detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    margin-top: 2rem;
}

.secondary-button {
    background: var(--panel);
    color: var(--ink);
    min-height: 3rem;
    padding: .65rem 1rem;
}

.detail-stepper {
    display: flex;
    gap: .5rem;
}

.theme-toggle {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    min-height: 2.6rem;
    padding: .45rem .75rem .45rem .55rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: color-mix(in srgb, var(--panel) 90%, transparent);
    box-shadow: 0 .65rem 1.75rem var(--shadow);
    color: var(--ink);
    cursor: pointer;
    font: inherit;
    font-size: .9rem;
    font-weight: 700;
    line-height: 1;
    backdrop-filter: blur(10px);
    transition: border-color .15s ease, color .15s ease, transform .15s ease;
}

.theme-toggle:hover {
    border-color: var(--accent);
    color: var(--accent-strong);
}

.theme-toggle:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 3px;
}

.theme-toggle-indicator {
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 50%;
    background: var(--gold);
    box-shadow: inset -.35rem -.35rem 0 color-mix(in srgb, var(--paper) 65%, transparent);
}

:root[data-theme="dark"] .theme-toggle-indicator {
    background: var(--ink);
    box-shadow: inset -.45rem -.2rem 0 var(--panel);
}

@media (max-width: 860px) {
    .artwork-view,
    .collection-hero,
    .collection-detail-view {
        grid-template-columns: 1fr;
    }

    .collection-gallery-header {
        grid-template-columns: 1fr;
    }

    .artwork-stage {
        min-height: 55vh;
    }

    .artwork-stage img {
        max-height: 70vh;
    }

    .brand-strip {
        margin-bottom: 1.5rem;
    }

    .collection-detail-stage {
        min-height: 58vh;
    }

    .collection-detail-stage img {
        max-height: 58vh;
    }

    .collection-detail-panel {
        padding: 0;
    }
}

@media (max-width: 560px) {
    .theme-toggle {
        top: .75rem;
        right: .75rem;
        padding-right: .55rem;
    }

    .theme-toggle-text {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    .collection-grid {
        grid-template-columns: 1fr;
    }

    .nav-button {
        width: 2.6rem;
        height: 2.6rem;
        font-size: 1.8rem;
    }

    .nav-button-left {
        left: .5rem;
    }

    .nav-button-right {
        right: .5rem;
    }

    .detail-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .detail-stepper {
        justify-content: space-between;
    }
}
