@font-face {
    font-family: 'Cormorant Garamond';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/cormorant-garamond-400-IEHZ6-k.woff2") format('woff2');
}

@font-face {
    font-family: 'Cormorant Garamond';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("../fonts/cormorant-garamond-500-IEHZ6-k.woff2") format('woff2');
}

@font-face {
    font-family: 'Cormorant Garamond';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("../fonts/cormorant-garamond-600-IEHZ6-k.woff2") format('woff2');
}

@font-face {
    font-family: 'Cormorant Garamond';
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/cormorant-garamond-400-italic-d4WsxB6.woff2") format('woff2');
}

:root {
    --bg-color: #fafafa;
    --text-main: #111111;
    --text-muted: #666666;
    --accent-hover: #999999;
    --year-wheel-width: 110px;
    --werke-gap: 16px;

    /* Main content padding */
    --main-pt: 10px;
    --main-pb: 30px;

    /* Typography dimensions & margins */
    --h1-size: clamp(2.2rem, 6vw, 4.5rem);
    --h1-line-height: 1.05;
    --h1-mt: 1rem;
    --h1-mb: 0.5rem;
    --subtitle-size: clamp(0.9rem, 2.5vw, 1.2rem);
    --subtitle-line-height: 1.6;
    --subtitle-mb: 1.25rem;

    /* Hero image bottom margin */
    --img-mb: 1.5rem;

    /*
     * Total height of everything above and below the hero image
     * (header padding + header content + main padding + typography
     * + image's bottom margin). Overridden per breakpoint.
     */
    --header-height: 4rem; /* 1rem pad + 2rem content + 1rem pad */

    --hero-vertical-overhead: calc(
        var(--header-height) + var(--main-pt) + var(--h1-mt) +
            (var(--h1-size) * var(--h1-line-height)) + var(--h1-mb) +
            (var(--subtitle-size) * var(--subtitle-line-height)) +
            var(--subtitle-mb) + var(--img-mb) + var(--main-pb)
    );
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Cormorant Garamond', Garamond, 'Times New Roman', serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    margin: 0;
    padding: 0;
}

/* Base paragraph */
p {
    margin: 0 0 1rem 0;
    line-height: 1.6;
    color: var(--text-main);
}

/* Page subtitle */
.subtitle {
    font-size: var(--subtitle-size);
    font-weight: 400;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 0 0 var(--subtitle-mb) 0;
}

/* ── Header/footer ───────────────────────────────────────── */

header {
    padding: 1rem 1.5rem;
}

.header-inner {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 2rem;
}

footer {
    text-align: center;
    padding: 2rem 1rem 1.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

footer p {
    margin: 0;
}

/* ── Main navigation ─────────────────────────────────────── */

.main-nav {
    max-width: 900px;
}

.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 24px 36px;
}

.main-nav a {
    text-decoration: none;
    color: var(--text-main);
    font-size: clamp(0.85rem, 1.8vw, 0.95rem);
    font-weight: 400;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    transition: color 0.2s ease;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--accent-hover);
}

/* ── Locale switcher ─────────────────────────────────────── */

.locale-switcher {
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
}

.locale-switcher ul {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
}

.locale-switcher li + li {
    margin-left: 0.25rem;
    padding-left: 0.25rem;
    border-left: 1px solid rgba(0, 0, 0, 0.15);
}

.locale-switcher a {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-decoration: none;
    color: rgba(0, 0, 0, 0.35);
    transition: color 0.15s ease;
}

.locale-switcher a:hover {
    color: rgba(0, 0, 0, 0.7);
}

.locale-switcher a.active {
    color: #1a1a1a;
    font-weight: 600;
}

/* ── Main layout ─────────────────────────────────────────── */

main {
    text-align: center;
    padding: var(--main-pt) 5vw var(--main-pb);
}

.section-container h1 {
    text-align: center;
    margin-top: 16px;
    margin-bottom: 32px;
}

h1 {
    font-size: var(--h1-size);
    font-weight: 400;
    line-height: 1.05;
    letter-spacing: -0.01em;
    margin: var(--h1-mt) 0 var(--h1-mb) 0;
    overflow-wrap: break-word;
}

/* Homepage hero card */
.artwork-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 750px;
    margin: 0 auto;
}

.artwork-card img {
    display: block;
    max-width: 100%;
    max-height: calc(100dvh - var(--hero-vertical-overhead));
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 2px;
    margin-bottom: var(--img-mb);
}

.section-container {
    max-width: 700px;
    margin: 0 auto;
    text-align: left;
}

.bio-quote {
    margin: 0 0 2rem;
    font-style: italic;
}

.bio-quote blockquote {
    margin: 0;
}

.bio-quote blockquote p {
    font-size: 1.5rem;
    line-height: 1.4;
    margin: 0 0 0.5rem;
}

.bio-quote figcaption {
    font-size: 1rem;
    font-style: normal;
    text-align: right;
}

.bio-quote cite {
    font-style: normal;
    font-weight: 600;
}

.bio-image {
    margin: 2.5rem auto;
    max-width: 40rem;
    text-align: center;
}

.bio-image img {
    display: block;
    width: 100%;
    height: auto;
}

.bio-intro {
    font-size: 1.25rem;
    line-height: 1.6;
    margin-bottom: 2.5rem;
    color: var(--text-main);
}

.exhibition-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.exhibition-list li {
    font-size: 1.1rem;
    line-height: 1.8;
    display: flex;
    gap: 1.5rem;
}

.exhibition-list .year {
    font-weight: 600;
    min-width: 50px;
}

/* ── Works page ──────────────────────────────────────────── */

.werke-layout {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: var(--werke-gap);
    width: fit-content;
    max-width: 100%;
    margin: 0 auto;
    /* Compensates for the sticky nav so the artwork column stays visually centred */
    padding-right: calc(var(--year-wheel-width) + var(--werke-gap));
}

.year-wheel-sidebar {
    position: sticky;
    top: 25vh;
    width: var(--year-wheel-width);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.scroll-wheel-btn {
    background: transparent;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    padding: 2px 6px;
    display: inline-flex;
    justify-content: center;
    align-items: center;

    /* Toggled by JS via --scroll-opacity (0 = hidden). */
    opacity: var(--scroll-opacity, 0);
    pointer-events: none;
    transition:
        transform 0.25s ease,
        opacity 0.15s ease;
}

.scroll-top-btn:hover {
    transform: translateY(-4px);
}

.scroll-bottom-btn:hover {
    transform: translateY(4px);
}

.scroll-wheel-btn svg {
    width: 32px;
    height: 32px;
    stroke-width: 2.5;
}

/* Desktop shows vertical arrows only. */
.scroll-wheel-btn .icon-arrow-left,
.scroll-wheel-btn .icon-arrow-right {
    display: none;
}

.year-wheel-nav {
    position: relative;
    height: 50vh;
    width: 100%;
    flex-shrink: 0;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;

    --fade-size: 5rem;
    --fade-top: 0px;
    --fade-bottom: 0px;

    -webkit-mask-image: linear-gradient(
        to bottom,
        transparent 0,
        #000 var(--fade-top),
        #000 calc(100% - var(--fade-bottom)),
        transparent 100%
    );
    mask-image: linear-gradient(
        to bottom,
        transparent 0,
        #000 var(--fade-top),
        #000 calc(100% - var(--fade-bottom)),
        transparent 100%
    );
}

.year-wheel-nav.fade-top {
    --fade-top: var(--fade-size);
}

.year-wheel-nav.fade-bottom {
    --fade-bottom: var(--fade-size);
}

.year-wheel-nav::-webkit-scrollbar {
    display: none;
}

.year-wheel {
    list-style: none;
    padding: 16px 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 22px;
}

.year-link {
    text-decoration: none;
    color: var(--text-main);
    font-size: 1.35rem;
    letter-spacing: 0.08em;
    opacity: 0.72;
    transition: all 0.25s ease;
    display: block;
    padding: 2px 6px;
}

.year-link:hover {
    opacity: 0.95;
    color: var(--text-main);
}

.year-link.active {
    opacity: 1;
    color: var(--text-main);
    font-weight: 600;
    font-size: 1.75rem;
    transform: scale(1.1);
}

.artworks-container {
    width: 100%;
    max-width: 650px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 60px;
}

.artwork-item {
    width: 100%;
    margin: 0 auto;
    scroll-margin-top: 40px;
    text-align: center;
}

.artwork-item:has(+ .artwork-item)::after {
    content: '';
    display: block;
    width: 160px;
    height: 1px;
    background: rgba(0, 0, 0, 0.25);
    margin: 1.5rem auto 0;
}

.artwork-title {
    font-size: clamp(1.1rem, 2.2vw, 1.6rem);
    font-weight: 400;
    margin-top: 12px;
    margin-bottom: 0;
    color: var(--text-main);
    letter-spacing: 0.05em;
    text-align: center;
}

.artwork-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 75vh;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    border-radius: 2px;
}

.artwork-image-link {
    display: block;
    cursor: zoom-in;
}

/* ── Werke overview (collections grid) ───────────────────── */

.werke-collections {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 5vw;
}

.werke-collection-card {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    text-decoration: none;
    color: #fff;
    background: #111;
    border-radius: 2px;
}

.werke-collection-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0.85;
    transition:
        transform 0.4s ease,
        opacity 0.4s ease;
}

.werke-collection-card:hover img {
    transform: scale(1.03);
    opacity: 0.7;
}

.werke-collection-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 1rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.1));
}

.werke-collection-name {
    font-size: clamp(1.4rem, 4vw, 2.2rem);
    font-weight: 400;
    letter-spacing: 0.05em;
    line-height: 1.15;
}

.werke-collection-count {
    font-size: 0.85rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    opacity: 0.85;
    margin-top: 0.5rem;
}

.werke-collections-empty {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    margin: 2rem auto;
}

/*
 * Collection intro block. The heading and description share the
 * artwork column's 650px width so they line up with the images
 * below. On mobile the parent's own padding brings the effective
 * width down to match the artwork items.
 */
.werke-collection-intro {
    max-width: 650px;
    margin: 0 auto;
    text-align: left;
}

.werke-collection-intro h1 {
    text-align: center;
    margin-top: 16px;
    margin-bottom: 32px;
}

.werke-back {
    margin-bottom: 1rem;
    font-size: 1rem;
}

.werke-back a {
    color: var(--text-muted);
    text-decoration: none;
}

.werke-back a:hover {
    color: var(--text-main);
}

.werke-collection-description {
    font-size: 1.2rem;
    line-height: 1.6;
    margin: 0 0 1.5rem;
}

/* ── Lightbox ────────────────────────────────────────────── */

.image-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.85);
    padding: 2rem;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.image-lightbox.is-open {
    display: grid;
    place-items: center;
}

.image-lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.5);
}

.image-lightbox-close {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 101;

    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;

    font-family:
        system-ui,
        -apple-system,
        'Segoe UI',
        Roboto,
        sans-serif;
    font-size: 1.5rem;
    font-weight: 300;
    line-height: 1;

    color: rgba(255, 255, 255, 0.75);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    text-decoration: none;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);

    transition: color 0.15s;
}

.image-lightbox-close:hover,
.image-lightbox-close:focus-visible {
    color: #ffffff;
}

/* ── Books ───────────────────────────────────────────────── */

.book-list {
    list-style: none;
    padding: 0;
    margin: 2rem 0 0;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.book-item {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.book-cover {
    display: block;
    width: 160px;
    height: auto;
    flex-shrink: 0;
    object-fit: cover;
}

.book-cover-link {
    display: block;
    flex-shrink: 0;
    cursor: zoom-in;
}

.book-info {
    flex: 1;
    min-width: 0;
}

.book-title {
    font-weight: 600;
    font-size: 1.5rem;
    margin: 0 0 0.35rem;
}

.book-meta {
    margin: 0;
    font-size: 1.2rem;
    color: #444;
}

.book-description {
    margin: 0.75rem 0 0;
    font-size: 1rem;
    line-height: 1.5;
    color: #444;
}

.book-list-empty {
    color: #444;
    font-style: italic;
}

/* ── Contact ─────────────────────────────────────────────── */

.contact-info {
    font-size: 1.25rem;
    line-height: 1.4;
    margin-bottom: 2.5rem;
    color: var(--text-main);
}

.email-image {
    height: 0.6em;
    width: auto;
    display: inline;
}

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 900px) {
    :root {
        /* header padding 1rem+1rem + wrapped nav (~2 rows) + gap 1rem + locale switcher (~1.2rem) */
        --header-height: 8rem;
    }

    header {
        padding: 1rem 0;
    }

    .header-inner {
        max-width: 700px;
        margin: 0 auto;
        padding: 0 5vw;
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        min-height: 0;
    }

    .main-nav {
        display: flex;
        justify-content: center;
    }

    .main-nav ul {
        gap: 8px 16px;
    }

    .locale-switcher {
        position: static;
        transform: none;
        align-self: flex-end;
    }

    .locale-switcher li + li {
        margin-left: 0.25rem;
        padding-left: 0.25rem;
    }
}

@media (max-width: 768px) {
    .werke-layout {
        flex-direction: column;
        gap: 15px;
        padding-right: 0;
        width: 100%;
        max-width: 100%;
    }

    .year-wheel-sidebar {
        position: sticky;
        top: 0;
        width: 100%;
        z-index: 10;
        background-color: var(--bg-color);
        padding: 5px 10px;
        border-bottom: 1px solid rgba(0, 0, 0, 0.08);
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }

    .scroll-wheel-btn {
        padding: 4px 8px;
        flex: 0 0 auto;
    }

    .scroll-wheel-btn svg {
        width: 24px;
        height: 24px;
    }

    /* Swap to horizontal arrows on mobile. */
    .scroll-wheel-btn .icon-arrow-up,
    .scroll-wheel-btn .icon-arrow-down {
        display: none;
    }
    .scroll-wheel-btn .icon-arrow-left,
    .scroll-wheel-btn .icon-arrow-right {
        display: inline;
    }

    .scroll-top-btn:hover,
    .scroll-bottom-btn:hover {
        transform: none;
    }

    .year-wheel-nav {
        flex: 1 1 0;
        min-width: 0;
        height: auto;

        --fade-size: 2.5rem;

        -webkit-mask-image: linear-gradient(
            to right,
            transparent 0,
            #000 var(--fade-top),
            #000 calc(100% - var(--fade-bottom)),
            transparent 100%
        );
        mask-image: linear-gradient(
            to right,
            transparent 0,
            #000 var(--fade-top),
            #000 calc(100% - var(--fade-bottom)),
            transparent 100%
        );
    }

    .year-wheel {
        flex-direction: row;
        align-items: center;
        padding: 0 15px;
        gap: 16px;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .year-wheel::-webkit-scrollbar {
        display: none;
    }

    .year-link {
        font-size: 1.1rem;
        opacity: 0.75;
    }

    .year-link.active {
        font-size: 1.3rem;
    }

    .artwork-item {
        max-width: 90vw;
    }
}

@media (max-width: 480px) {
    :root {
        /* narrower viewport → nav wraps to 3 rows */
        --header-height: 10rem;
    }

    header {
        padding: 20px 0 0;
    }

    .header-inner {
        padding: 0 2vw;
    }

    main {
        padding: 15px 2vw 40px;
    }
}

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

    .year-link,
    nav a {
        transition: none;
    }
}
