* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    min-height: 100vh;
    background: #14160f;
    color: #f4f1e8;
    font-family: Barlow, "Segoe UI", sans-serif;
    line-height: 1.6;
}

img {
    max-width: 100%;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(20, 22, 15, 0.94);
    border-bottom: 1px solid rgba(196, 163, 90, 0.35);
    backdrop-filter: blur(12px);
}

.site-header__bar {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 64px;
    padding: 8px 16px;
}

.brand,
.page-title,
.story-card h2,
.story-modal__caption strong {
    font-family: "Stardos Stencil", "Arial Narrow", Impact, sans-serif;
    letter-spacing: 0.04em;
}

.brand {
    color: #f4f1e8;
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1;
}

.nav-toggle {
    display: none;
    border: 1px solid rgba(196, 163, 90, 0.45);
    background: transparent;
    color: #f4f1e8;
    border-radius: 999px;
    padding: 6px 12px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
}

.nav-link {
    color: #e6d3a3;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 999px;
    font-weight: 600;
}

.nav-link:hover,
.nav-link:focus-visible {
    color: #f4f1e8;
    background: rgba(196, 163, 90, 0.16);
}

.nav-link.is-active {
    color: #14160f;
    background: #c4a35a;
}

.email-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    border: 1px solid rgba(196, 163, 90, 0.45);
    background: transparent;
    color: #f4f1e8;
    border-radius: 999px;
    padding: 8px 14px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.email-btn:hover,
.email-btn:focus-visible {
    border-color: #c4a35a;
    color: #c4a35a;
}

.page-title {
    margin: 0;
    color: #f4f1e8;
    font-size: clamp(2rem, 5vw, 3.4rem);
    font-weight: 700;
    line-height: 1.1;
}

.lede {
    max-width: 42rem;
    margin: 0.8rem 0 0;
    color: #e6d3a3;
    font-size: 1.15rem;
}

.hero {
    min-height: 72vh;
    display: flex;
    align-items: flex-end;
    padding: 48px 20px 88px;
    background:
        linear-gradient(180deg, rgba(20, 22, 15, 0.1) 0%, rgba(20, 22, 15, 0.82) 78%),
        url("../images/b24.jpg") center 30% / cover no-repeat;
}

.hero__inner,
.story-wrap,
.page-shell {
    width: min(960px, calc(100% - 32px));
    margin-left: auto;
    margin-right: auto;
}

.hero__inner {
    width: min(920px, 100%);
}

.hero .lede {
    color: #f4f1e8;
}

.story-wrap {
    margin-top: -48px;
    margin-bottom: 56px;
}

.page-shell {
    margin-top: 28px;
    margin-bottom: 56px;
}

.page-shell .story-card {
    margin-top: 22px;
}

.story-card,
.panel {
    background: #2c3420;
    color: #f4f1e8;
    border: 1px solid rgba(196, 163, 90, 0.28);
    border-radius: 18px;
    padding: clamp(20px, 4vw, 40px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.22);
}

.story-card h2,
.panel h2 {
    margin: 1.6rem 0 0.7rem;
    color: #e6d3a3;
    font-size: 1.7rem;
    font-weight: 400;
}

.story-card h2:first-child,
.panel h2:first-child {
    margin-top: 0;
}

.story-card h3 {
    margin: 1.2rem 0 0.4rem;
    font-size: 1.15rem;
}

.story-card p,
.story-card li,
.panel p {
    font-size: 1.05rem;
    line-height: 1.65;
}

.feature-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px 18px;
    margin: 0.8rem 0 1rem;
    padding: 0;
    list-style: none;
}

.feature-list li {
    padding: 10px 12px;
    border-left: 3px solid #c4a35a;
    background: rgba(20, 22, 15, 0.28);
}

.timeline {
    margin: 1rem 0 1.5rem;
    padding-left: 1.4rem;
    border-left: 3px solid #c4a35a;
}

.timeline-item {
    position: relative;
    margin: 0 0 1.4rem;
}

.timeline-item::before {
    content: "";
    position: absolute;
    left: calc(-1.4rem - 7px);
    top: 0.45rem;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #c4a35a;
}

.timeline-meta {
    margin: 0;
    color: #e6d3a3;
    font-size: 0.92rem;
    font-weight: 600;
}

.hero-still {
    display: block;
    width: 100%;
    border-radius: 12px;
    margin-bottom: 1rem;
}

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

.photo-grid {
    margin-top: 1.5rem;
}

.photo-card,
.gallery-item {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 0 0 12px;
    overflow: hidden;
    text-align: left;
    color: inherit;
    background: #1c2118;
    border: 1px solid rgba(196, 163, 90, 0.2);
    border-radius: 14px;
    font: inherit;
    cursor: pointer;
}

.photo-card img,
.gallery-item img.thumbnail {
    width: 100%;
    aspect-ratio: 4 / 3;
    height: auto;
    object-fit: cover;
    background: #10130c;
}

.photo-card__title,
.image-title {
    padding: 12px 12px 0;
    font-size: 0.98rem;
    font-weight: 600;
    line-height: 1.3;
    border: 0;
}

.image-tags,
.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 12px 0;
}

.tags-list {
    padding: 12px 0 0;
}

.tag,
.tag-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-radius: 999px;
    padding: 3px 8px;
    background: rgba(196, 163, 90, 0.18);
    color: #e6d3a3;
    font-size: 0.78rem;
}

.empty-note,
.no-images,
.status-note {
    color: #d7c39a;
    margin-top: 12px;
}

.no-images {
    grid-column: 1 / -1;
    padding: 28px;
    text-align: center;
    background: #1c2118;
    border-radius: 14px;
}

.gallery-page-head,
.filter,
.panel {
    margin-bottom: 18px;
}

.filter {
    background: #2c3420;
    border: 1px solid rgba(196, 163, 90, 0.28);
    border-radius: 18px;
    padding: 16px;
}

.filter-toolbar,
.gallery-search-row,
.filter-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.filter-label,
.filter-control-label {
    font-weight: 600;
    color: #e6d3a3;
}

.filter-toolbar select,
.gallery-search-input,
.tag-filter-input,
.button {
    font: inherit;
}

.filter-toolbar select,
.gallery-search-input {
    padding: 8px 12px;
    border: 1px solid rgba(196, 163, 90, 0.35);
    border-radius: 8px;
    background: #14160f;
    color: #f4f1e8;
}

.gallery-search-input {
    flex: 1 1 220px;
    min-width: 180px;
}

.tag-filter {
    border: 1px solid rgba(196, 163, 90, 0.28);
    border-radius: 12px;
    background: rgba(20, 22, 15, 0.35);
    padding: 8px 10px;
}

.tag-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag-filter-chips:empty {
    display: none;
}

.tag-filter-chips:not(:empty) {
    margin-bottom: 6px;
}

.tag-filter-chip-remove {
    border: 0;
    background: transparent;
    color: #e6d3a3;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
}

.tag-filter-input-wrap {
    position: relative;
}

.tag-filter-input {
    width: 100%;
    border: 0;
    outline: none;
    background: transparent;
    color: #f4f1e8;
    font-size: 1rem;
    padding: 6px 2px;
}

.tag-filter-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 5;
    max-height: 220px;
    overflow: auto;
    margin: 0;
    padding: 6px 0;
    list-style: none;
    background: #1c2118;
    border: 1px solid rgba(196, 163, 90, 0.35);
    border-radius: 10px;
}

.tag-filter-dropdown[hidden] {
    display: none;
}

.tag-filter-option,
.tag-filter-empty {
    padding: 8px 14px;
    cursor: pointer;
}

.tag-filter-option:hover,
.tag-filter-option.is-active {
    background: rgba(196, 163, 90, 0.18);
}

.button {
    border: 0;
    border-radius: 999px;
    padding: 8px 16px;
    background: #c4a35a;
    color: #14160f;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.button-secondary {
    background: transparent;
    color: #e6d3a3;
    border: 1px solid rgba(196, 163, 90, 0.45);
}

.story-modal {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(8, 10, 6, 0.92);
}

.story-modal[hidden] {
    display: none;
}

.story-modal__panel {
    width: min(1100px, 100%);
    color: #f4f1e8;
}

.story-modal__stage {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 8px;
    align-items: center;
}

.story-modal__stage img {
    width: 100%;
    max-height: 72vh;
    object-fit: contain;
}

.story-modal__nav,
.story-modal__close,
.popup .close,
.nav-arrow {
    border: 0;
    border-radius: 999px;
    background: rgba(196, 163, 90, 0.16);
    color: #f4f1e8;
    cursor: pointer;
}

.story-modal__nav,
.story-modal__close {
    width: 44px;
    height: 44px;
    font-size: 28px;
}

.story-modal__close {
    display: block;
    margin-left: auto;
}

.story-modal__caption {
    text-align: center;
    padding: 12px 8px 0;
    line-height: 1.5;
}

.story-modal__caption strong {
    display: block;
    margin-bottom: 6px;
    font-size: 1.35rem;
    font-weight: 400;
}

.popup {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 40;
    align-items: center;
    justify-content: center;
    background: rgba(8, 10, 6, 0.92);
}

.popup-content {
    position: relative;
    display: flex;
    width: min(1100px, 94%);
    max-height: 92vh;
    overflow: hidden;
    background: #1c2118;
    color: #f4f1e8;
    border: 1px solid rgba(196, 163, 90, 0.28);
    border-radius: 16px;
}

.image-container {
    position: relative;
    flex: 1;
    min-width: 0;
    background: #10130c;
}

#popup-image {
    display: block;
    width: 100%;
    max-height: 92vh;
    object-fit: contain;
}

#popup-info {
    width: min(340px, 36%);
    overflow: auto;
    padding: 56px 20px 20px;
}

#popup-title {
    margin: 0 0 12px;
    font-family: "Stardos Stencil", "Arial Narrow", sans-serif;
    font-weight: 400;
    color: #e6d3a3;
}

#popup-description {
    white-space: pre-wrap;
}

.popup .close,
.nav-arrow {
    position: absolute;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup .close {
    top: 12px;
    right: 12px;
    width: 44px;
    height: 44px;
    font-size: 28px;
}

.nav-arrow {
    top: 50%;
    width: 44px;
    height: 44px;
    transform: translateY(-50%);
    font-size: 24px;
}

.nav-arrow.prev { left: 12px; }
.nav-arrow.next { right: 12px; left: auto; }

.site-footer {
    background: #10130c;
    color: #d7c39a;
    border-top: 1px solid rgba(196, 163, 90, 0.25);
    text-align: center;
    padding: 16px;
}

@media (max-width: 1020px) {
    .nav-toggle {
        display: inline-flex;
    }

    .site-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 12px;
        right: 12px;
        flex-direction: column;
        align-items: stretch;
        padding: 10px;
        background: #1c2118;
        border: 1px solid rgba(196, 163, 90, 0.28);
        border-radius: 14px;
    }

    .site-nav.is-open {
        display: flex;
    }

    .email-btn__value {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
    }
}

@media (max-width: 700px) {
    .photo-grid,
    .gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .popup-content {
        flex-direction: column;
    }

    #popup-info {
        width: 100%;
    }

    .nav-arrow.next {
        right: 12px;
    }
}
