:root {
    color-scheme: light;
    --background: #f5f5f3;
    --surface: #ffffff;
    --text: #1f1f1f;
    --muted: #6b6b6b;
    --border: #deded8;
    --shadow: 0 14px 35px rgba(0, 0, 0, 0.08);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--background);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.6;
}

body.lightbox-open {
    overflow: hidden;
}

main {
    width: min(1500px, calc(100% - 32px));
    margin: 0 auto;
}

.intro {
    max-width: 850px;
    margin: 0 auto;
    padding: 72px 0 54px;
    text-align: center;
}

.intro h1 {
    margin: 0 0 18px;
    font-size: clamp(2.2rem, 7vw, 5rem);
    line-height: 1;
    letter-spacing: -0.045em;
}

.intro p {
    margin: 0;
    color: var(--muted);
    font-size: clamp(1rem, 2vw, 1.25rem);
}

.gallery-list {
    display: grid;
    gap: 64px;
    padding-bottom: 90px;
}

.gallery-section {
    min-width: 0;
}

.gallery-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.gallery-heading h2 {
    margin: 0;
    font-size: clamp(1.5rem, 3vw, 2.4rem);
}

.gallery-heading span {
    color: var(--muted);
    white-space: nowrap;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.image-button {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: var(--radius);
    background: #ddd;
    cursor: zoom-in;
    aspect-ratio: 4 / 3;
    box-shadow: var(--shadow);
}

.image-button img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.image-button:hover img,
.image-button:focus-visible img {
    transform: scale(1.035);
    filter: brightness(0.92);
}

.image-button:focus-visible {
    outline: 3px solid #222;
    outline-offset: 4px;
}

.empty-state {
    padding: 36px;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    text-align: center;
}

.empty-state p {
    margin: 8px 0;
}

.site-footer {
    border-top: 1px solid var(--border);
    background: var(--surface);
}

.footer-content {
    width: min(900px, calc(100% - 32px));
    margin: 0 auto;
    padding: 56px 0;
}

.footer-content h2 {
    margin-top: 0;
}

.footer-content p {
    margin: 16px 0;
}

.copyright {
    color: var(--muted);
    font-size: 0.92rem;
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    background: rgba(0, 0, 0, 0.92);
    padding: 24px;
}

.lightbox[hidden] {
    display: none;
}

.lightbox figure {
    display: grid;
    place-items: center;
    max-width: min(92vw, 1500px);
    max-height: 88vh;
    margin: 0;
}

.lightbox img {
    display: block;
    max-width: 100%;
    max-height: 82vh;
    object-fit: contain;
    border-radius: 10px;
}

.lightbox figcaption {
    margin-top: 12px;
    color: #fff;
    text-align: center;
}

.lightbox-close,
.lightbox-nav {
    position: fixed;
    z-index: 1001;
    border: 0;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    cursor: pointer;
    backdrop-filter: blur(10px);
}

.lightbox-close {
    top: 18px;
    right: 18px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 2rem;
    line-height: 1;
}

.lightbox-nav {
    top: 50%;
    width: 54px;
    height: 72px;
    border-radius: 14px;
    transform: translateY(-50%);
    font-size: 3rem;
    line-height: 1;
}

.lightbox-prev {
    left: 18px;
}

.lightbox-next {
    right: 18px;
}

.lightbox-close:hover,
.lightbox-nav:hover,
.lightbox-close:focus-visible,
.lightbox-nav:focus-visible {
    background: rgba(255, 255, 255, 0.25);
    outline: 2px solid #fff;
}

@media (max-width: 700px) {
    main {
        width: min(100% - 20px, 1500px);
    }

    .intro {
        padding: 48px 8px 38px;
    }

    .gallery-list {
        gap: 44px;
        padding-bottom: 64px;
    }

    .image-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .image-button {
        border-radius: 11px;
    }

    .gallery-heading {
        align-items: flex-end;
    }

    .lightbox {
        padding: 12px;
    }

    .lightbox-nav {
        top: auto;
        bottom: 18px;
        width: 58px;
        height: 52px;
        transform: none;
    }

    .lightbox-prev {
        left: calc(50% - 68px);
    }

    .lightbox-next {
        right: calc(50% - 68px);
    }

    .lightbox img {
        max-height: 72vh;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}
