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

html {
    scroll-behavior: smooth;
}

body {
    background-color: #1a1714;
    font-family: 'DM Sans', sans-serif;
}

/* ── Grain overlay for texture ── */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
    opacity: 0.35;
}

/* ── Masonry columns ── */
.masonry {
    column-count: 4;
    column-gap: 0.75rem;
}

@media (max-width: 1280px) {
    .masonry {
        column-count: 3;
    }
}

@media (max-width: 900px) {
    .masonry {
        column-count: 2;
    }
}

@media (max-width: 500px) {
    .masonry {
        column-count: 1;
    }
}

.masonry-item {
    break-inside: avoid;
    margin-bottom: 0.75rem;
    display: block;
}

/* ── Scroll-reveal animation ── */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ── Image card ── */
.gallery-card {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border-radius: 3px;
    display: block;
}

.gallery-card img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.gallery-card:hover img {
    transform: scale(1.06);
}

.gallery-card .overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(26, 23, 20, 0.82) 0%, rgba(26, 23, 20, 0.1) 55%, transparent 100%);
    opacity: 0;
    transition: opacity 0.35s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.1rem;
}

.gallery-card:hover .overlay,
.gallery-card:focus .overlay {
    opacity: 1;
}

.gallery-card .zoom-icon {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 2rem;
    height: 2rem;
    background: rgba(212, 133, 10, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.7rem;
    opacity: 0;
    transform: scale(0.7);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.gallery-card:hover .zoom-icon,
.gallery-card:focus .zoom-icon {
    opacity: 1;
    transform: scale(1);
}

/* ── Filter pill active state ── */
.filter-btn.active {
    /* background-color: #d4850a; */
    background: #ffb42e;
    color: #1a1714;
    border-color: #d4850a;
}

/* ── Lightbox ── */
#lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(26, 23, 20, 0.96);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#lightbox.open {
    opacity: 1;
    pointer-events: all;
}

#lightbox .lb-img-wrap {
    position: relative;
    max-width: min(90vw, 1100px);
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

#lightbox img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 3px;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.7);
    transform: scale(0.92);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

#lightbox.open img {
    transform: scale(1);
}

#lightbox .lb-caption {
    position: absolute;
    bottom: -2.4rem;
    left: 0;
    right: 0;
    text-align: center;
}

#lb-close {
    position: fixed;
    top: 1.25rem;
    right: 1.5rem;
    width: 2.5rem;
    height: 2.5rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    color: #f5f0e8;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
    z-index: 10000;
}

#lb-close:hover {
    background: rgba(212, 133, 10, 0.4);
}

#lb-prev,
#lb-next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 2.8rem;
    height: 2.8rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    color: #f5f0e8;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
    z-index: 10000;
}

#lb-prev {
    left: 1rem;
}

#lb-next {
    right: 1rem;
}

#lb-prev:hover,
#lb-next:hover {
    background: rgba(212, 133, 10, 0.35);
}

/* ── Header line animation ── */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-anim {
    animation: slideIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.hero-anim-2 {
    animation: slideIn 0.8s 0.15s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero-anim-3 {
    animation: slideIn 0.8s 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #1a1714;
}

::-webkit-scrollbar-thumb {
    background: #8b6e4e;
    border-radius: 3px;
}

/* ── Focus outline (accessibility) ── */
.gallery-card:focus {
    outline: 2px solid #d4850a;
    outline-offset: 2px;
}