:root {
    --bg0: #000000;
    --bg1: #090101;
    --ink: #b8877c;
    --ink-bright: #d7aea5;
    --muted: #8e5e54;
    --amber: #a56a2a;
    --wood: #2a0806;
    --line: rgba(58, 22, 14, 0.18);
    --shadow:
        0 28px 80px rgba(7, 2, 2, 0.55),
        0 6px 18px rgba(0, 0, 0, 0.45);
    --max: 1240px;
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    color: var(--ink);
    font-family: ui-sans-serif, system-ui, -apple-system,
        "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background:
        radial-gradient(
            1050px 680px at 68% 20%,
            rgba(90, 40, 18, 0.07),
            transparent 56%
        ),
        radial-gradient(
            900px 600px at 18% 72%,
            rgba(55, 20, 12, 0.06),
            transparent 62%
        ),
        linear-gradient(180deg, var(--bg0), var(--bg1));
}

a {
    color: inherit;
}

.wrap {
    width: min(100% - 36px, var(--max));
    margin: 0 auto;
    padding: 32px 0 28px;
}

/* Header */

.site-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 0;
}

.mark {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    line-height: 1;
}

.sigil {
    display: flex;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 20px;
    background:
        radial-gradient(
            circle at 30% 30%,
            rgba(10, 0, 0, 0.45),
            transparent 55%
        ),
        linear-gradient(
            135deg,
            rgba(24, 1, 1, 0.25),
            rgba(26, 4, 4, 0.2)
        ),
        var(--wood);
    box-shadow: var(--shadow);
}

.sigil img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.brand-block {
    display: flex;
    flex-direction: column;
    transform: translateY(4px);
}

.brand {
    margin: 0;
    font-family: "MedievalSharp", ui-sans-serif, system-ui;
    font-size: 34px;
    font-weight: 400;
    line-height: 1;
    letter-spacing: 0.02em;
}

.tagline {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 3px 0 0 8px;
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    opacity: 0.85;
}

.tagline::before,
.tagline::after {
    height: 1px;
    background: currentColor;
    content: "";
    opacity: 0.6;
}

.tagline::before {
    width: 25px;
}

.tagline::after {
    width: 43px;
}

.site-navigation {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.site-navigation a {
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(10, 6, 4, 0.35);
    font-size: 15px;
    text-decoration: none;
    backdrop-filter: blur(6px);
    transition:
        color 0.18s ease,
        border-color 0.18s ease,
        background 0.18s ease;
}

.site-navigation a:hover {
    color: #754e06;
    border-color: rgb(75, 44, 1);
}

/* Gallery */

main {
    padding: clamp(44px, 6vw, 76px) 0 clamp(58px, 7vw, 92px);
}

.gallery-heading {
    margin-bottom: clamp(28px, 4vw, 48px);
}

.gallery-heading h2 {
    margin: 0;
    color: var(--ink-bright);
    font-family: "MedievalSharp", system-ui;
    font-size: clamp(3.4rem, 7vw, 6rem);
    font-weight: 400;
    line-height: 1;
}

.gallery-heading p {
    margin: 18px 0 0;
    color: var(--muted);
    font-family: "MedievalSharp", system-ui;
    font-size: clamp(1rem, 1.7vw, 1.25rem);
}

.gallery-introduction {
    padding-left: 8px;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
    gap: clamp(12px, 1.5vw, 18px);
    align-items: start;
}

@media (min-width: 1450px) {
    .image-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

.gallery-entry {
    margin: 0;
    min-width: 0;
}

.gallery-item {
    display: block;
    width: 100%;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #080505;
    overflow: hidden;
    cursor: zoom-in;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.28);
    transition: transform 0.2s, border-color 0.2s;
}

.gallery-item img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    background: #080505;
}

.gallery-item:hover {
    transform: translateY(-3px);
    border-color: rgba(165, 106, 42, 0.55);
}

.gallery-entry figcaption {
    margin: 10px 3px 0;
    color: var(--muted);
    font-family: "MedievalSharp", system-ui;
    font-size: 1.05rem;
    text-align: center;
}

/* Full-screen viewer */

body.viewer-open {
    overflow: hidden;
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    background: #080505;
    color: var(--ink);
}

.lightbox.open {
    display: block;
}

.lightbox-inner {
    position: relative;
    width: 100%;
    height: 100%;
    background: #080505;
}

.lightbox-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.lightbox-stage img {
    display: block;
    width: auto;
    height: auto;
    max-width: calc(100vw - 120px);
    max-height: calc(100dvh - 80px);
    object-fit: contain;
    border: 0;
    background: #080505;
    cursor: pointer;
    transition:
        max-width 0.18s ease,
        max-height 0.18s ease;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.lightbox.info-hidden .lightbox-stage img {
    max-width: 100vw;
    max-height: 100dvh;
}

.lightbox-caption {
    position: absolute;
    left: 50%;
    bottom: 24px;
    z-index: 1;
    width: min(620px, calc(100vw - 80px));
    padding: 8px 22px 9px;
    transform: translateX(-50%);
    border: 1px solid rgba(165, 106, 42, 0.38);
    border-radius: 22px;
    background: rgba(24, 9, 8, 0.65);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.38);
    text-align: center;
    backdrop-filter: blur(8px);
    transition:
        opacity 0.18s ease,
        visibility 0.18s ease;
}

.lightbox.info-hidden .lightbox-caption {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

.lightbox-caption h3 {
    margin: 0;
    color: var(--ink-bright);
    font-family: "MedievalSharp", system-ui;
    font-size: clamp(0.9rem, 1.4vw, 1.1rem);
    font-weight: 400;
    line-height: 1.1;
}

.lightbox-caption p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.25;
}

.lightbox-close,
.lightbox-nav {
    position: absolute;
    z-index: 2;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(24, 9, 8, 0.85);
    color: var(--ink-bright);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.lightbox-close:hover,
.lightbox-nav:hover {
    border-color: var(--amber);
}

.lightbox-close {
    top: 16px;
    right: 18px;
    width: 44px;
    height: 44px;
    font-size: 29px;
    line-height: 1;
}

.lightbox-nav {
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 64px;
    font-size: 38px;
}

.lightbox-prev {
    left: 14px;
}

.lightbox-next {
    right: 14px;
}

:focus-visible {
    outline: 2px solid var(--amber);
    outline-offset: 3px;
}

/* Footer */

.footer {
    margin-top: 60px;
    color: rgba(116, 77, 77, 0.75);
    font-size: 12px;
    line-height: 1.6;
    letter-spacing: 0.06em;
    text-align: left;
    hyphens: auto;
}


@media (max-width: 640px) {
    .wrap {
        width: min(100% - 20px, var(--max));
        padding: 18px 0 22px;
    }

    .site-header {
        flex-direction: column;
        gap: 12px;
        padding: 12px 0 16px;
    }

    .mark {
        gap: 10px;
    }

    .sigil {
        width: 42px;
        height: 42px;
        border-radius: 16px;
    }

    .brand-block {
        transform: none;
    }

    .brand {
        position: relative;
        top: 2px;
        font-size: 25px;
        line-height: 1.05;
    }

    .tagline {
        margin: 4px 0 0 2px;
        font-size: 0.6rem;
        letter-spacing: 0.1em;
    }

    .tagline::before {
        width: 22px;
    }

    .tagline::after {
        width: 34px;
    }

    .site-navigation {
        width: 100%;
    }

    .site-navigation a {
        padding: 9px 11px;
        font-size: 14px;
    }
}

@media (max-width: 520px) {
    .wrap {
        width: min(100% - 16px, var(--max));
        padding: 14px 0 20px;
    }

    .site-header {
        gap: 10px;
        padding: 10px 0 14px;
    }

    .mark {
        gap: 9px;
    }

    .sigil {
        width: 38px;
        height: 38px;
        border-radius: 14px;
    }

    .brand {
        top: 4px;
        font-size: 24px;
    }

    .tagline {
        font-size: 0.56rem;
        letter-spacing: 0.08em;
    }

    .tagline::before {
        width: 16px;
    }

    .tagline::after {
        width: 29px;
    }
}

/* Responsive gallery */

@media (max-width: 900px) {
    .image-grid {
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
    }
}

@media (max-width: 640px) {
    .image-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .gallery-entry figcaption {
        font-size: 0.95rem;
    }

    .lightbox-stage img {
        max-width: calc(100vw - 20px);
        max-height: calc(100dvh - 20px);
    }

    .lightbox.info-hidden .lightbox-stage img {
        max-width: 100vw;
        max-height: 100dvh;
    }

    .lightbox-caption {
        bottom: 14px;
        width: calc(100vw - 28px);
        padding: 9px 16px 10px;
    }

    .lightbox-nav {
        width: 30px;
        height: 48px;
        font-size: 26px;
        background: rgba(24, 9, 8, 0.65);
    }

    .lightbox-prev {
        left: 2px;
    }

    .lightbox-next {
        right: 2px;
    }

    .lightbox-close {
        top: 10px;
        right: 10px;
    }
}

@media (max-width: 380px) {
    .image-grid {
        grid-template-columns: 1fr;
    }
}

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