:root {
    --page-background: #b8945f;
    --page-background-dark: #a98757;
    --page-border: #9f7f54;

    --outer-background: #4c3a63;
    --outer-background-dark: #2f2440;

    --button-background: #f4ead8;
    --button-border: #6f5435;
    --button-text: #3f2f1f;
    --button-hover: #fff7e8;

    --arrow-background: #cfc2e6;
    --arrow-hover: #ddd2f0;

    --violet-hover: #5a3c8c;

    --text-dark: #2f2440;
    --paper-white: #fffaf0;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    width: 100%;
    min-height: 100%;
}

body {
    background:
        linear-gradient(45deg, rgba(255, 255, 255, 0.04) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(255, 255, 255, 0.04) 25%, transparent 25%),
        linear-gradient(135deg, var(--outer-background), var(--outer-background-dark));

    background-size: 42px 42px, 42px 42px, 100% 100%;
    font-family: system-ui, sans-serif;
}

/* Gallery page */

.container {
    width: 100vw;
    height: 100vh;

    padding: 1.5rem 3rem 2rem;

    display: grid;
    grid-template-rows: auto 1fr auto auto;
    align-items: center;

    overflow: hidden;
}

.gallery-header {
    text-align: center;
    color: #f4ead8;

    padding-bottom: 0.25rem;
}

.gallery-header h1 {
    margin: 0;

    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.1;
}

.gallery-header p {
    margin: 0.1rem 0 0;

    font-size: 0.85rem;
    font-weight: 600;

    color: #cfc2e6;

    letter-spacing: 0.03em;
    opacity: 0.95;
}

.grid {
    width: min(92vw, 1180px);
    height: min(70vh, 680px);

    margin: 0 auto;
    padding: 1.25rem;

    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));

    column-gap: 0.15rem;
    row-gap: 1rem;

    justify-items: center;
    align-items: center;

    background:
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.14), transparent 22%),
        radial-gradient(circle at 80% 30%, rgba(255, 255, 255, 0.08), transparent 20%),
        radial-gradient(circle at 40% 80%, rgba(0, 0, 0, 0.08), transparent 24%),
        linear-gradient(135deg, var(--page-background), var(--page-background-dark));

    border: 2px solid var(--page-border);
    border-radius: 0.35rem;

    box-shadow:
        0 1rem 2rem rgba(0, 0, 0, 0.3),
        inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.grid img {
    max-width: 96%;
    max-height: 31vh;

    object-fit: contain;
    cursor: pointer;
}

.grid img:focus-visible {
    outline: 3px solid var(--arrow-background);
    outline-offset: 0.35rem;
    border-radius: 0.25rem;
}

.nav {
    display: flex;
    justify-content: center;
    align-items: center;

    gap: 1.5rem;
    padding-top: 1rem;
}

button {
    font-family: inherit;
    cursor: pointer;
}

/* Arrow buttons */

.arrow-button {
    width: 3.5rem;
    height: 3.5rem;

    display: flex;
    align-items: center;
    justify-content: center;

    background: var(--arrow-background);

    border: 3px solid var(--button-border);
    border-radius: 50%;

    box-shadow:
        0 4px 0 rgba(63, 47, 31, 0.30),
        0 2px 8px rgba(0, 0, 0, 0.12);

    transition:
        transform 0.12s ease,
        box-shadow 0.12s ease,
        background-color 0.12s ease;
}

.arrow-button svg {
    width: 2.25rem;
    height: 2.25rem;

    stroke: var(--button-text);
    stroke-width: 3.5;
    stroke-linecap: round;
    stroke-linejoin: round;

    fill: none;
}

.arrow-button:hover {
    background: var(--arrow-hover);

    transform: translateY(1px);

    box-shadow:
        0 3px 0 rgba(63, 47, 31, 0.30),
        0 2px 6px rgba(0, 0, 0, 0.12);
}

.arrow-button:active {
    transform: translateY(3px);

    box-shadow:
        0 1px 0 rgba(63, 47, 31, 0.30);
}

.return-button {
    background: var(--button-background);
    color: var(--button-text);

    border: 2px solid var(--button-border);
    border-radius: 999px;

    padding: 0.85rem 1.4rem;

    font-size: 1rem;
    font-weight: 700;

    box-shadow: 0 3px 0 rgba(63, 47, 31, 0.35);
}

.return-button:hover {
    background: var(--button-hover);
}

.site-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;

    gap: 0.5rem 1rem;

    padding-top: 0.7rem;

    color: #f4ead8;
    font-size: 0.85rem;
    text-align: center;
    opacity: 0.95;
}

.site-footer span::before {
    content: "·";
    margin-right: 1rem;
    opacity: 0.65;
}

.site-footer strong {
    font-weight: 800;
}

.site-footer a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px dotted rgba(244, 234, 216, 0.55);
}

.site-footer a:hover {
    border-bottom-color: rgba(244, 234, 216, 1);
}

/* Lightbox */

.lightbox {
    position: fixed;
    inset: 0;

    background: #3b3845;

    display: flex;
    justify-content: center;
    align-items: center;

    z-index: 10;
}

.lightbox img {
    max-width: 92vw;
    max-height: 92vh;

    object-fit: contain;
}

.hidden {
    display: none;
}

.close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;

    width: 3.5rem;
    height: 3.5rem;

    display: flex;
    align-items: center;
    justify-content: center;

    color: var(--button-text);
    background: var(--arrow-background);

    border: 3px solid var(--button-border);
    border-radius: 50%;

    box-shadow:
        0 4px 0 rgba(63, 47, 31, 0.30),
        0 2px 8px rgba(0, 0, 0, 0.18);

    transition:
        transform 0.12s ease,
        box-shadow 0.12s ease,
        background-color 0.12s ease;
}

.close svg {
    width: 1.9rem;
    height: 1.9rem;

    stroke: var(--button-text);
    stroke-width: 3.5;
    stroke-linecap: round;
    stroke-linejoin: round;

    fill: none;
}

.close:hover {
    color: var(--button-text);
    background: var(--arrow-hover);

    transform: translateY(1px);

    box-shadow:
        0 3px 0 rgba(63, 47, 31, 0.30),
        0 2px 6px rgba(0, 0, 0, 0.18);
}

.close:active {
    transform: translateY(3px);

    box-shadow:
        0 1px 0 rgba(63, 47, 31, 0.30);
}

.close:focus-visible {
    outline: 3px solid var(--paper-white);
    outline-offset: 0.25rem;
}

/* Accessibility page */

.accessibility-wrapper {
    min-height: 100vh;
    padding: 3rem 1.5rem;

    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.accessibility-page {
    width: min(92vw, 820px);

    padding: 2.5rem;

    background: var(--paper-white);
    color: var(--text-dark);

    border: 2px solid rgba(47, 36, 64, 0.18);
    border-radius: 0.35rem;

    box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.28);

    line-height: 1.6;
}

.accessibility-page h1,
.accessibility-page h2 {
    line-height: 1.2;
}

.accessibility-page h1 {
    margin-top: 0;
}

.accessibility-page a {
    color: #4c3a63;
    font-weight: 700;
}

.accessibility-page a:hover {
    color: #8b2f4d;
}

.description-list {
    margin: 2rem 0 0;
    padding-left: 1.5rem;
}

.description-item {
    margin-bottom: 1.75rem;
}

.description-item h2 {
    margin-bottom: 0.5rem;
    font-size: 1.15rem;
}

.description-item p {
    margin: 0.35rem 0;
}

.filename {
    font-size: 0.9rem;
    opacity: 0.75;
}

@media (max-width: 900px) {
    .container {
        padding: 1rem;
    }

    .gallery-header {
    padding-bottom: 0.2rem;
}

.gallery-header h1 {
    font-size: 1rem;
}

.gallery-header p {
    font-size: 0.75rem;
}

    .grid {
        width: 94vw;
        height: min(68vh, 640px);

        grid-template-columns: repeat(2, minmax(0, 1fr));

        column-gap: 0.25rem;
        row-gap: 0.75rem;

        padding: 0.75rem;
    }

    .grid img {
        max-width: 98%;
        max-height: 28vh;
    }

    .nav {
        gap: 0.75rem;
        padding-top: 0.75rem;
    }

    .arrow-button {
        width: 3rem;
        height: 3rem;
    }

    .arrow-button svg {
        width: 1.8rem;
        height: 1.8rem;
    }

    .return-button {
        font-size: 0.85rem;
        padding: 0.65rem 1rem;
    }

    .site-footer {
        font-size: 0.75rem;
    }

    .close {
        width: 3rem;
        height: 3rem;
    }

    .close svg {
        width: 1.7rem;
        height: 1.7rem;
    }

    .accessibility-page {
        padding: 1.5rem;
    }
}