/* ========================================
   Works gallery — irregular grid, quiet chrome
   ======================================== */

.works__intro {
    max-width: 72ch;
    margin: 22px 0 0;
    text-align: left;
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    line-height: 1.9;
}

.gal {
    max-width: 1500px;
    margin: 0 auto;
    padding: 0 clamp(20px, 5vw, 64px);
}

.gal__filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.55rem;
    max-width: 1040px;
    margin: clamp(2.2rem, 4vw, 3.4rem) auto clamp(2.2rem, 4.5vw, 3.6rem);
}

.gal__filter {
    appearance: none;
    padding: 0.72em 1.2em;
    border: 1px solid rgba(201, 168, 76, 0.26);
    border-radius: 999px;
    background: transparent;
    color: var(--color-text-secondary);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    line-height: 1;
    cursor: pointer;
    transition: color 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}

.gal__filter:hover {
    color: var(--color-text-primary);
    border-color: rgba(201, 168, 76, 0.55);
}

.gal__filter.is-active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #0a0e1a;
}

.gal__filter .zh--inline {
    color: inherit;
    margin-left: 0.45em;
    letter-spacing: 0.1em;
}

.gal__grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: clamp(1.6rem, 2.8vw, 2.8rem);
    align-items: start;
}

.gal__item {
    grid-column: span 6;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.gal__item[hidden] {
    display: none;
}

.gal__item--full {
    grid-column: span 12;
}

.gal__item--third {
    grid-column: span 4;
}

/* media */
.gal__media {
    position: relative;
    overflow: hidden;
    background: #0d1220;
    aspect-ratio: 4 / 3;
    isolation: isolate;
}

.gal__item--full .gal__media {
    aspect-ratio: 21 / 9;
}

.gal__item--third .gal__media {
    aspect-ratio: 1 / 1;
}

.gal__item--strip .gal__media {
    aspect-ratio: 3.4 / 1;
}

.gal__item--video .gal__media {
    aspect-ratio: 16 / 9;
}

.gal__item--portrait .gal__media {
    aspect-ratio: 3 / 4;
}

.gal__item--wide {
    grid-column: span 8;
}

.gal__item--square .gal__media {
    aspect-ratio: 1 / 1;
}

.gal__media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(10, 14, 26, 0.5) 0%, rgba(10, 14, 26, 0) 42%);
    pointer-events: none;
}

.gal__media img,
.gal__media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transform: scale(1.005);
    transition: transform 1.4s cubic-bezier(0.16, 0.6, 0.3, 1);
}

.gal__item:hover .gal__media img,
.gal__item:hover .gal__media video {
    transform: scale(1.04);
}

.gal__item--fit .gal__media img {
    object-fit: contain;
    background: #060a14;
}

.gal__item--light .gal__media {
    background: #f2efe8;
}

.gal__tag {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 2;
    padding: 0.52em 0.85em;
    background: rgba(10, 14, 26, 0.55);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #f0ece4;
    font-size: 0.66rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    line-height: 1;
}

.gal__tag .zh--inline {
    color: rgba(240, 236, 228, 0.7);
    margin-left: 0.5em;
    letter-spacing: 0.1em;
}

.gal__item--light .gal__tag {
    background: rgba(10, 14, 26, 0.75);
}

/* caption */
.gal__body {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding-top: 1.1rem;
}

.gal__meta {
    display: flex;
    align-items: baseline;
    gap: 0.9rem;
    font-size: 0.68rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--color-primary);
}

.gal__index {
    font-variant-numeric: tabular-nums;
    opacity: 0.7;
}

.gal__cat {
    color: var(--color-text-tertiary);
    letter-spacing: 0.18em;
}

.gal__title {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    font-size: clamp(1.02rem, 1.5vw, 1.28rem);
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.35;
    color: var(--color-text-primary);
}

.gal__title .zh {
    font-size: 0.66em;
    font-weight: 400;
    letter-spacing: 0.08em;
    color: var(--color-text-secondary);
}

.gal__desc {
    max-width: 64ch;
    font-size: 0.9rem;
    line-height: 1.85;
    color: var(--color-text-tertiary);
}

.gal__desc .zh {
    margin-top: 0.65em;
    font-size: 0.84em;
    line-height: 1.9;
}

.gal__client {
    font-size: 0.68rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(201, 168, 76, 0.75);
}

/* thumbnails */
.gal__thumbs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
    margin-top: 0.9rem;
}

.gal__thumbs div {
    overflow: hidden;
    background: #0d1220;
    aspect-ratio: 4 / 3;
}

.gal__thumbs img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.82;
    transition: opacity 0.4s ease, transform 1.2s ease;
}

.gal__thumbs div:hover img {
    opacity: 1;
    transform: scale(1.05);
}

.gal__note {
    margin-top: clamp(2.4rem, 5vw, 3.8rem);
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    color: var(--color-text-tertiary);
}

.gal__note .zh {
    display: inline;
    margin-left: 0.6em;
    font-size: 0.95em;
    letter-spacing: 0.06em;
}

/* ---------- responsive ---------- */
@media (max-width: 1024px) {
    .gal__item--third {
        grid-column: span 6;
    }

    .gal__item--third .gal__media {
        aspect-ratio: 4 / 3;
    }
}

@media (max-width: 760px) {
    .gal__grid {
        grid-template-columns: 1fr;
        gap: 2.4rem;
    }

    .gal__item,
    .gal__item--full,
    .gal__item--third,
    .gal__item--wide {
        grid-column: span 1;
    }

    .gal__item .gal__media,
    .gal__item--third .gal__media {
        aspect-ratio: 4 / 3;
    }

    .gal__item--full .gal__media,
    .gal__item--video .gal__media {
        aspect-ratio: 16 / 10;
    }

    .gal__item--strip .gal__media {
        aspect-ratio: 2.4 / 1;
    }

    .gal__item--portrait .gal__media {
        aspect-ratio: 3 / 4;
    }

    .gal__item--wide .gal__media {
        aspect-ratio: 16 / 10;
    }

    .gal__filters {
        gap: 0.45rem;
        justify-content: flex-start;
    }

    .gal__filter {
        font-size: 0.72rem;
        padding: 0.66em 1em;
    }

    .gal__filter .zh--inline {
        display: block;
        margin: 0.28em 0 0;
    }

    .gal__desc {
        font-size: 0.86rem;
        line-height: 1.8;
    }

    .gal__tag {
        top: 0.7rem;
        left: 0.7rem;
        font-size: 0.6rem;
    }
}

/* ===== Pair: one artwork cut in half, both halves side by side ===== */
.gal__item--pair {
    grid-column: span 12;
}

.gal__item--pair .gal__media {
    aspect-ratio: 1800 / 1380;
}

.gal__media--pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
    background: #f2efe8;
}

.gal__media--pair img {
    transform: none;
}

.gal__item:hover .gal__media--pair img {
    transform: none;
}

/* ===== Wide strips: a row of frames from one shot list ===== */
.gal__item--panorama .gal__media {
    aspect-ratio: 1519 / 639;
}

.gal__item--panorama-tall .gal__media {
    aspect-ratio: 1285 / 406;
}

@media (max-width: 760px) {
    .gal__item--pair {
        grid-column: span 1;
    }

    /* keep the two halves side by side on phones: the point is the wall of icons */
    .gal__item--pair .gal__media {
        aspect-ratio: 1800 / 1380;
    }

    .gal__item--panorama .gal__media {
        aspect-ratio: 2.2 / 1;
    }

    .gal__item--panorama-tall .gal__media {
        aspect-ratio: 2.8 / 1;
    }
}
