:root {
    --color-background: #0a0c11;
    --color-surface: #131722;
    --color-surface-soft: #181d29;

    --color-ivory: #f5f1e9;

    --color-gold: #cfa85a;
    --color-gold-soft: #e2c783;
    --color-gold-glow: rgba(225, 153, 19, 0.204);

    --color-muted: #9299a7;
    --color-border: rgba(255, 255, 255, 0.08);

    --color-success: #45c981;
    --color-overlay: rgba(3, 5, 9, 0.94);

    --page-padding: clamp(16px, 3vw, 42px);
    --content-max-width: 1800px;
    --gallery-gap: clamp(10px, 1.4vw, 22px);

    --transition-fast: 180ms ease;
    --transition-normal: 280ms ease;
}


* {
    box-sizing: border-box;
}


html {
    scroll-behavior: smooth;
}


body {
    margin: 0;
    min-height: 100vh;

    background:
        radial-gradient(
            circle at top left,
            var(--color-gold-glow),
            transparent 30%
        ),
        var(--color-background);

    color: var(--color-ivory);

    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    -webkit-font-smoothing: antialiased;
}


button,
img {
    -webkit-tap-highlight-color: transparent;
}


button {
    font: inherit;
}


/* Main page header. */
.site-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 28px;

    width: min(
        calc(100% - (var(--page-padding) * 2)),
        var(--content-max-width)
    );

    margin: 0 auto;

    padding:
        clamp(28px, 4vw, 52px)
        0
        clamp(26px, 3.5vw, 40px);

    border-bottom: 1px solid var(--color-border);
}


.brand {
    min-width: 0;
}


/*
    Main 9Birdphoto logo.

    The logo is shifted slightly left
    to align better with the title.
*/
.brand-logo {
    display: block;

    width: clamp(280px, 32vw, 520px);

    max-width: 100%;

    height: auto;

    margin: 0 0 14px;

    transform: translateX(-18px);

    object-fit: contain;

    filter:
        drop-shadow(
            0 8px 24px
            rgba(207, 168, 90, 0.14)
        );
}


/*
    Main gallery title.

    The title is intentionally larger
    to strengthen the visual hierarchy.
*/
.gallery-title {
    margin: 0;

    color: var(--color-ivory);

    font-family:
        "Cormorant Garamond",
        Georgia,
        "Times New Roman",
        serif;

    font-size:
        clamp(
            3.3rem,
            5.4vw,
            5.9rem
        );

    font-weight: 500;

    line-height: 0.98;

    letter-spacing: -0.03em;
}


.project-name {
    margin: 14px 0 0;

    color: var(--color-muted);

    font-size: 0.95rem;

    line-height: 1.5;

    letter-spacing: 0.04em;

    overflow-wrap: anywhere;
}


/* Live indicator. */
.live-status {
    display: inline-flex;
    align-items: center;
    gap: 9px;

    flex-shrink: 0;

    margin-top: 4px;

    padding: 9px 14px;

    border:
        1px solid
        rgba(69, 201, 129, 0.28);

    border-radius: 999px;

    background:
        rgba(69, 201, 129, 0.08);

    color: #91e8b9;

    font-size: 0.78rem;

    font-weight: 700;

    letter-spacing: 0.1em;

    text-transform: uppercase;
}


.live-dot {
    width: 8px;
    height: 8px;

    border-radius: 50%;

    background: var(--color-success);

    box-shadow:
        0 0 0 0
        rgba(69, 201, 129, 0.55);

    animation:
        live-pulse
        2s
        infinite;
}


@keyframes live-pulse {
    0% {
        box-shadow:
            0 0 0 0
            rgba(69, 201, 129, 0.55);
    }

    70% {
        box-shadow:
            0 0 0 9px
            rgba(69, 201, 129, 0);
    }

    100% {
        box-shadow:
            0 0 0 0
            rgba(69, 201, 129, 0);
    }
}


/* Main gallery page. */
.gallery-page {
    width: min(
        calc(100% - (var(--page-padding) * 2)),
        var(--content-max-width)
    );

    margin: 0 auto;

    padding: 28px 0 80px;
}


/* Category navigation. */
.category-tabs {
    display: flex;

    gap: 10px;

    overflow-x: auto;

    padding: 0 0 8px;

    scrollbar-width: none;
}


.category-tabs::-webkit-scrollbar {
    display: none;
}


.category-button {
    flex-shrink: 0;

    padding: 10px 17px;

    border:
        1px solid
        var(--color-border);

    border-radius: 999px;

    background:
        var(--color-surface);

    color:
        var(--color-muted);

    cursor: pointer;

    transition:
        color var(--transition-fast),
        background var(--transition-fast),
        border-color var(--transition-fast),
        transform var(--transition-fast),
        box-shadow var(--transition-fast);
}


.category-button:hover {
    color: var(--color-ivory);

    border-color:
        rgba(240, 184, 75, 0.45);

    transform: translateY(-1px);
}


.category-button.is-active {
    background:
        var(--color-gold);

    border-color:
        var(--color-gold);

    color: #111318;

    font-weight: 750;

    box-shadow:
        0 8px 28px
        rgba(240, 184, 75, 0.12);
}


/* Gallery information row. */
.gallery-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    margin: 18px 0 20px;

    color: var(--color-muted);

    font-size: 0.86rem;
}


.gallery-summary p {
    margin: 0;
}


.gallery-message {
    text-align: right;
}


/* Masonry gallery layout. */
.gallery-grid {
    column-count: 3;

    column-gap:
        var(--gallery-gap);
}


.gallery-item {
    position: relative;

    display: inline-block;

    width: 100%;

    margin:
        0
        0
        var(--gallery-gap);

    break-inside: avoid;

    overflow: hidden;

    border-radius: 14px;

    background:
        var(--color-surface-soft);

    cursor: zoom-in;

    isolation: isolate;

    box-shadow:
        0 10px 36px
        rgba(0, 0, 0, 0.14);

    opacity: 0;

    transform: translateY(10px);

    animation:
        gallery-fade-in
        520ms
        ease
        forwards;
}


@keyframes gallery-fade-in {
    to {
        opacity: 1;

        transform: translateY(0);
    }
}


.gallery-item::after {
    content: "";

    position: absolute;

    inset: 0;

    pointer-events: none;

    background:
        linear-gradient(
            180deg,
            transparent 65%,
            rgba(0, 0, 0, 0.2)
        );

    opacity: 0;

    transition:
        opacity
        var(--transition-normal);
}


.gallery-item:hover::after {
    opacity: 1;
}


.gallery-image {
    display: block;

    width: 100%;

    height: auto;

    object-fit: contain;

    background:
        var(--color-surface-soft);

    transition:
        transform
        550ms
        cubic-bezier(
            0.2,
            0.75,
            0.25,
            1
        ),
        filter
        var(--transition-normal);
}


.gallery-item:hover .gallery-image {
    transform: scale(1.025);
}


/* Image loading animation. */
.gallery-item.is-loading {
    min-height: 220px;

    background:
        linear-gradient(
            90deg,
            var(--color-surface) 25%,
            var(--color-surface-soft) 50%,
            var(--color-surface) 75%
        );

    background-size: 200% 100%;

    animation:
        image-loading
        1.5s
        infinite
        linear;
}


@keyframes image-loading {
    from {
        background-position: 200% 0;
    }

    to {
        background-position: -200% 0;
    }
}


/* Empty gallery message. */
.empty-state {
    padding: 80px 20px;

    text-align: center;

    color:
        var(--color-muted);
}


.empty-state p {
    margin: 0;
}


/* Full-screen lightbox. */
.lightbox {
    position: fixed;

    inset: 0;

    z-index: 1000;

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

    padding: 24px;

    background:
        var(--color-overlay);

    backdrop-filter: blur(14px);

    -webkit-backdrop-filter: blur(14px);
}


.lightbox[hidden] {
    display: none;
}


.lightbox-content {
    position: relative;

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

    max-width: 100%;
    max-height: 100%;
}


.lightbox-image {
    display: block;

    max-width:
        min(
            92vw,
            1800px
        );

    max-height: 88vh;

    width: auto;
    height: auto;

    object-fit: contain;

    user-select: none;

    animation:
        lightbox-image-in
        240ms
        ease;

    box-shadow:
        0 24px 80px
        rgba(0, 0, 0, 0.5);
}


@keyframes lightbox-image-in {
    from {
        opacity: 0;

        transform: scale(0.985);
    }

    to {
        opacity: 1;

        transform: scale(1);
    }
}


.lightbox-close {
    position: fixed;

    top: 18px;
    right: 18px;

    z-index: 1002;

    display: grid;

    place-items: center;

    width: 44px;
    height: 44px;

    padding: 0;

    border:
        1px solid
        rgba(255, 255, 255, 0.13);

    border-radius: 50%;

    background:
        rgba(18, 21, 29, 0.78);

    color:
        var(--color-ivory);

    font-size: 1.7rem;

    line-height: 1;

    cursor: pointer;

    backdrop-filter: blur(10px);

    -webkit-backdrop-filter: blur(10px);

    transition:
        background var(--transition-fast),
        transform var(--transition-fast);
}


.lightbox-close:hover {
    background:
        rgba(240, 184, 75, 0.22);

    transform: rotate(4deg);
}


.lightbox-navigation {
    position: fixed;

    top: 50%;

    z-index: 1001;

    display: grid;

    place-items: center;

    width: 52px;
    height: 52px;

    padding: 0;

    border:
        1px solid
        rgba(255, 255, 255, 0.12);

    border-radius: 50%;

    background:
        rgba(18, 21, 29, 0.72);

    color:
        var(--color-ivory);

    font-size: 2.2rem;

    line-height: 1;

    cursor: pointer;

    transform: translateY(-50%);

    backdrop-filter: blur(10px);

    -webkit-backdrop-filter: blur(10px);

    transition:
        background var(--transition-fast),
        transform var(--transition-fast),
        opacity var(--transition-fast);
}


.lightbox-navigation:hover {
    background:
        rgba(240, 184, 75, 0.2);

    transform:
        translateY(-50%)
        scale(1.04);
}


.lightbox-previous {
    left: 20px;
}


.lightbox-next {
    right: 20px;
}


.lightbox-counter {
    position: fixed;

    left: 50%;
    bottom: 18px;

    z-index: 1001;

    margin: 0;

    padding: 8px 12px;

    border:
        1px solid
        rgba(255, 255, 255, 0.1);

    border-radius: 999px;

    background:
        rgba(18, 21, 29, 0.72);

    color:
        var(--color-ivory);

    font-size: 0.82rem;

    letter-spacing: 0.05em;

    transform: translateX(-50%);

    backdrop-filter: blur(10px);

    -webkit-backdrop-filter: blur(10px);
}


/* Tablet layout. */
@media (max-width: 1100px) {
    .gallery-grid {
        column-count: 2;
    }
}


/* Mobile layout. */
@media (max-width: 700px) {
    :root {
        --page-padding: 14px;
        --gallery-gap: 9px;
    }

    .site-header {
        align-items: flex-start;

        gap: 14px;

        padding-top: 22px;
        padding-bottom: 22px;
    }

    .brand-logo {
        width:
            clamp(
                210px,
                62vw,
                320px
            );

        margin-bottom: 12px;

        transform: translateX(-20px);
    }

    .gallery-title {
        font-size:
            clamp(
                2.65rem,
                12vw,
                3.9rem
            );

        line-height: 0.98;

        letter-spacing: -0.035em;
    }

    .project-name {
        margin-top: 10px;

        font-size: 0.8rem;
    }

    .live-status {
        margin-top: 2px;

        padding: 7px 10px;

        font-size: 0.66rem;
    }

    .gallery-page {
        padding-top: 20px;
    }

    .category-tabs {
        gap: 8px;
    }

    .category-button {
        padding: 9px 14px;

        font-size: 0.82rem;
    }

    .gallery-summary {
        align-items: flex-start;

        flex-direction: column;

        gap: 4px;

        margin-top: 14px;
    }

    .gallery-message {
        text-align: left;
    }

    .gallery-grid {
        column-count: 2;
    }

    .gallery-item {
        border-radius: 8px;
    }

    .lightbox {
        padding: 8px;
    }

    .lightbox-image {
        max-width: 100%;
        max-height: 90vh;
    }

    .lightbox-navigation {
        width: 42px;
        height: 42px;

        font-size: 1.8rem;
    }

    .lightbox-previous {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

    .lightbox-counter {
        bottom: 12px;
    }
}


/* Very small mobile screens. */
@media (max-width: 360px) {
    .gallery-grid {
        column-count: 1;
    }

    .site-header {
        gap: 10px;
    }

    .brand-logo {
        width: 195px;

        transform: translateX(-16px);
    }

    .gallery-title {
        font-size: 2.4rem;
    }

    .live-status {
        margin-top: 0;
    }

    .lightbox-navigation {
        width: 38px;
        height: 38px;

        font-size: 1.6rem;
    }
}


/* Respect accessibility preferences. */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior:
            auto
            !important;

        animation-duration:
            0.01ms
            !important;

        animation-iteration-count:
            1
            !important;

        transition-duration:
            0.01ms
            !important;
    }
}