:root {
    color-scheme: dark;
    --ink: #f6f3ec;
    --muted: #aca8a2;
    --surface: #111113;
    --surface-raised: #19191d;
    --line: rgba(255, 255, 255, 0.13);
    --accent: #a99aff;
    --accent-strong: #d3caff;
    --content-width: 1200px;
}

* {
    box-sizing: border-box;
}

html {
    background: #09090b;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 80% 0%, rgba(81, 60, 145, 0.18), transparent 32rem),
        #09090b;
    color: var(--ink);
    font-family: "Segoe UI", Helvetica, Arial, sans-serif;
    line-height: 1.6;
}

a {
    color: inherit;
}

img {
    display: block;
    max-width: 100%;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1,
h2,
h3 {
    font-weight: 500;
    letter-spacing: -0.035em;
    line-height: 1.05;
}

h1 {
    max-width: 13ch;
    font-size: clamp(3rem, 9vw, 8rem);
}

h2 {
    font-size: clamp(2rem, 4vw, 3.6rem);
}

h3 {
    font-size: 1.35rem;
}

.site {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

.content-shell {
    width: min(calc(100% - 2rem), var(--content-width));
    margin-inline: auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    border-bottom: 1px solid var(--line);
    background: rgba(9, 9, 11, 0.84);
    backdrop-filter: blur(18px);
}

.site-header__inner {
    min-height: 4.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.brand {
    color: var(--ink);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.28em;
    text-decoration: none;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: clamp(1rem, 3vw, 2.5rem);
}

.site-nav a {
    border-bottom: 1px solid transparent;
    color: var(--muted);
    font-size: 0.86rem;
    letter-spacing: 0.08em;
    text-decoration: none;
    text-transform: uppercase;
}

.site-nav a:hover,
.site-nav a.active {
    border-color: var(--accent);
    color: var(--ink);
}

.hero {
    position: relative;
    min-height: min(82vh, 860px);
    display: grid;
    align-items: end;
    overflow: hidden;
    border-bottom: 1px solid var(--line);
}

.hero__image,
.hero__veil {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.hero__image {
    object-fit: cover;
}

.hero__veil {
    background:
        linear-gradient(90deg, rgba(4, 4, 5, 0.88), rgba(4, 4, 5, 0.18)),
        linear-gradient(0deg, rgba(4, 4, 5, 0.84), transparent 70%);
}

.hero__content {
    position: relative;
    z-index: 1;
    padding-block: clamp(5rem, 12vw, 9rem);
}

.hero__content h1 {
    margin-bottom: 1.5rem;
}

.hero__tagline {
    max-width: 42rem;
    margin-bottom: 2rem;
    color: #d4d0ca;
    font-size: clamp(1.15rem, 2vw, 1.45rem);
}

.eyebrow {
    margin-bottom: 0.8rem;
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.button,
.text-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    text-decoration: none;
}

.button {
    min-height: 3rem;
    padding: 0.75rem 1.3rem;
    border: 1px solid var(--accent);
    border-radius: 999px;
}

.button--primary {
    background: var(--accent);
    color: #111016;
}

.button--primary:hover {
    background: var(--accent-strong);
}

.text-link {
    border-bottom: 1px solid var(--accent);
    color: var(--accent-strong);
}

.section,
.gallery-section {
    padding-block: clamp(4rem, 9vw, 8rem);
}

.section-heading {
    margin-bottom: 2.5rem;
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 2rem;
}

.section-heading h2 {
    margin-bottom: 0;
}

.page-hero {
    padding-block: clamp(5rem, 12vw, 10rem) clamp(3rem, 7vw, 6rem);
}

.page-hero h1 {
    margin-bottom: 1rem;
}

.page-hero > p:last-child {
    max-width: 44rem;
    color: var(--muted);
    font-size: 1.15rem;
}

.art-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: clamp(1.25rem, 2vw, 2rem);
}

.art-card {
    grid-column: span 4;
}

.art-card:nth-child(5n + 1),
.art-card:nth-child(5n + 4) {
    grid-column: span 8;
}

.art-card__image-link {
    display: block;
    overflow: hidden;
    background: var(--surface-raised);
}

.art-card__image,
.art-card__placeholder {
    width: 100%;
    aspect-ratio: 4 / 5;
}

.art-card:nth-child(5n + 1) .art-card__image,
.art-card:nth-child(5n + 1) .art-card__placeholder,
.art-card:nth-child(5n + 4) .art-card__image,
.art-card:nth-child(5n + 4) .art-card__placeholder {
    aspect-ratio: 16 / 10;
}

.art-card__image {
    object-fit: cover;
    transition: transform 450ms ease;
}

.art-card__image-link:hover .art-card__image {
    transform: scale(1.025);
}

.art-card__placeholder {
    display: block;
    background:
        linear-gradient(135deg, rgba(169, 154, 255, 0.15), transparent),
        var(--surface-raised);
}

.art-card__body {
    padding-block: 1rem 2rem;
}

.art-card__body h2,
.art-card__body h3 {
    margin-bottom: 0.5rem;
}

.art-card__body h2 {
    font-size: 1.6rem;
}

.art-card__body a {
    text-decoration: none;
}

.art-card__body > p:not(.art-card__category) {
    max-width: 40rem;
    color: var(--muted);
}

.art-card__category {
    margin-bottom: 0.4rem;
    color: var(--accent);
    font-size: 0.74rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.filters {
    margin-bottom: 2.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.filter {
    padding: 0.45rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.85rem;
    text-decoration: none;
}

.filter:hover,
.filter--active {
    border-color: var(--accent);
    color: var(--ink);
}

.status-message {
    padding: 2rem 0;
    color: var(--muted);
}

.about-layout {
    padding-bottom: clamp(5rem, 12vw, 10rem);
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: clamp(2rem, 7vw, 7rem);
    align-items: start;
}

.about-layout__portrait {
    min-height: 20rem;
    background: var(--surface-raised);
}

.about-layout__portrait img {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
}

.about-layout--without-portrait {
    grid-template-columns: minmax(0, 48rem);
}

.lead {
    color: #d9d5cf;
    font-size: clamp(1.2rem, 2.4vw, 1.75rem);
    line-height: 1.45;
}

.prose {
    max-width: 46rem;
    color: #cbc7c1;
    font-size: 1.05rem;
}

.prose p {
    margin-bottom: 1.25rem;
}

.about-meta {
    margin-top: 2rem;
    color: var(--muted);
}

.about-meta span {
    margin-right: 0.5rem;
    color: var(--ink);
    font-weight: 600;
}

.social-links {
    margin-top: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1.4rem;
}

.social-links a {
    border-bottom: 1px solid var(--accent);
    color: var(--accent-strong);
    text-decoration: none;
}

.artwork-detail {
    padding-block: clamp(5rem, 10vw, 9rem);
}

.artwork-detail__header {
    margin-bottom: clamp(3rem, 7vw, 6rem);
    display: grid;
    grid-template-columns: minmax(0, 8fr) minmax(14rem, 4fr);
    gap: 3rem;
    align-items: end;
}

.artwork-detail__header h1 {
    margin-bottom: 1.5rem;
}

.artwork-facts {
    margin: 0;
    border-top: 1px solid var(--line);
}

.artwork-facts > div {
    padding: 0.8rem 0;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid var(--line);
}

.artwork-facts dt {
    color: var(--muted);
}

.artwork-facts dd {
    margin: 0;
    text-align: right;
}

.artwork-gallery {
    display: grid;
    gap: clamp(1rem, 3vw, 3rem);
}

.artwork-gallery img {
    width: 100%;
    max-height: 90vh;
    object-fit: contain;
    background: var(--surface);
}

.artwork-detail__body {
    width: min(100%, 48rem);
    margin: clamp(3rem, 8vw, 7rem) auto 0;
}

.tag-list {
    margin: 2rem 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
}

.tag-list li {
    padding: 0.3rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.8rem;
}

.site-footer {
    margin-top: auto;
    border-top: 1px solid var(--line);
}

.site-footer__inner {
    padding-block: 2rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    color: var(--muted);
    font-size: 0.85rem;
}

.site-footer p {
    margin: 0;
}

#blazor-error-ui {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    left: 1rem;
    z-index: 1000;
    display: none;
    padding: 1rem;
    background: #5f261f;
    color: white;
}

@media (max-width: 800px) {
    .art-card,
    .art-card:nth-child(5n + 1),
    .art-card:nth-child(5n + 4) {
        grid-column: span 6;
    }

    .art-card:nth-child(5n + 1) .art-card__image,
    .art-card:nth-child(5n + 1) .art-card__placeholder,
    .art-card:nth-child(5n + 4) .art-card__image,
    .art-card:nth-child(5n + 4) .art-card__placeholder {
        aspect-ratio: 4 / 5;
    }

    .about-layout,
    .artwork-detail__header {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .site-header__inner {
        min-height: 4rem;
    }

    .brand {
        font-size: 0.8rem;
        letter-spacing: 0.18em;
    }

    .site-nav {
        gap: 0.8rem;
    }

    .site-nav a {
        font-size: 0.72rem;
    }

    .section-heading,
    .site-footer__inner {
        align-items: flex-start;
        flex-direction: column;
    }

    .art-card,
    .art-card:nth-child(5n + 1),
    .art-card:nth-child(5n + 4) {
        grid-column: 1 / -1;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .art-card__image {
        transition: none;
    }
}
