*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    --color-bg: #ffffff;
    --color-text: #111111;
    --color-muted: #888888;
    --color-border: #e0e0e0;
    --font-serif: Georgia, "Times New Roman", serif;
    --font-sans: system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    --max-width: 680px;
}

html,
body {
    margin: 0;
    padding: 0 1.5rem;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.6;
}

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

header {
    text-align: center;
    padding: 3.5rem 1rem 2.5rem;
    margin-bottom: 3rem;
}

header h1 {
    font-family: var(--font-serif);
    font-size: clamp(2.4rem, 8vw, 4.5rem);
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin: 0;
}

header h1 img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

header h1 a {
    color: inherit;
    text-decoration: none;
}

header h1 a:hover {
    opacity: 0.6;
}

header .contact {
    display: block;
    margin-top: 1.5rem;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    color: var(--color-muted, #888);
    text-decoration: none;
}

header .contact:hover {
    color: var(--color-text, #111);
}

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

main {
    padding: 0 0 6rem;
}

/* ── Grid ──────────────────────────────────────────────────────────────────── */

.grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
}

.grid__item {
    display: block;
    aspect-ratio: 1;
    overflow: hidden;
}

.grid__item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.grid__item--audio {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    background: var(--color-border);
    padding: 0.75rem;
}

.grid__item--audio audio {
    width: 100%;
}

.grid__item-title {
    font-size: 0.75rem;
    color: var(--color-muted);
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

/* ── Empty state ───────────────────────────────────────────────────────────── */

.empty {
    text-align: center;
    color: var(--color-muted);
    padding: 5rem 0;
    font-style: italic;
    font-size: 0.9rem;
}

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

#lightbox {
    position: fixed;
    inset: 0;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    cursor: pointer;
}

#lightbox[hidden] {
    display: none;
}

#lightbox-figure {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    max-width: 90vw;
    margin: 0;
}

#lightbox-img {
    max-height: 70vh;
    max-width: 100%;
    object-fit: contain;
    cursor: s-resize;
    display: block;
}

#lightbox-title {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 1.2rem;
    color: var(--color-muted);
    text-align: center;
}

/* ── Scroll sentinel ───────────────────────────────────────────────────────── */

#scroll-sentinel {
    height: 80px;
}

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

@media (max-width: 800px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .grid {
        grid-template-columns: 1fr;
    }
    header {
        padding: 2rem 1rem 1.5rem;
        margin-bottom: 2rem;
    }
    main {
        padding: 0 0 4rem;
    }
}
