/* ===========================================================================
   SECTION — GALLERY WALL
   ---------------------------------------------------------------------------
   --tile is capped deliberately. The source images are 206 × 206px, so a tile
   above ~100px would soften on a 2× display. Holding it small keeps every
   frame sharp and makes the density read as intentional.
   =========================================================================== */

.gallery { overflow: hidden; }

.gallery__head {
    display: grid;
    gap: clamp(1rem, 3vw, 2.5rem);
    margin-bottom: clamp(2rem, 4vw, 3rem);
}

.gallery__head .h2 { max-width: 16ch; }

.gallery__hand {
    display: block;
    color: var(--turq-d);
}

/* ---------------------------------------------------------------------------
   The wall
   --------------------------------------------------------------------------- */
.gallery__wall {
    --tile: 84px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--tile), 1fr));
    gap: 6px;
    padding-inline: var(--gutter);
    /* Sixty tiles: a tight step so the cascade sweeps rather than drags */
    --stagger-lead: 0.35s;
    --stagger-step: 0.018s;
}

.shot {
    position: relative;
    margin: 0;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--pale-2);
    border-radius: var(--r-sm);
    /* The frame never moves on hover — only the photo inside it zooms, so the
       grid stays still and nothing overlaps its neighbours */
    isolation: isolate;
    transition: box-shadow 0.6s var(--ease);
}

.shot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* The source frames are soft and flat — a light grade pulls the wall together */
    filter: saturate(1.14) contrast(1.06);
    transform-origin: center;
    transition: transform 1.2s var(--ease), filter 0.8s var(--ease);
    will-change: transform;
}

.shot::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(9, 62, 98, 0.72) 0%, rgba(9, 62, 98, 0) 42%);
    opacity: 0;
    transition: opacity 0.45s var(--ease);
    pointer-events: none;
}

.shot:hover {
    z-index: 3;
    box-shadow: 0 12px 30px rgba(9, 62, 98, 0.28);
}

/* Subtle, slow zoom within the frame; a touch more clarity as it comes in */
.shot:hover img { transform: scale(1.08); filter: saturate(1.2) contrast(1.1) brightness(1.04); }
.shot:hover::after { opacity: 1; }

.shot__cap {
    position: absolute;
    inset: auto 0 0 0;
    z-index: 4;
    padding: 0.375rem 0.5rem;
    font-family: var(--font-ui);
    font-size: 0.5625rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1.25;
    color: var(--turq);
    opacity: 0;
    transform: translateY(5px);
    transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
    pointer-events: none;
}

.shot:hover .shot__cap { opacity: 1; transform: none; }

.gallery__foot {
    margin-top: clamp(1.25rem, 2.5vw, 2rem);
    font-family: var(--font-ui);
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--steel-2);
}

@media (prefers-reduced-motion: reduce) {
    .shot:hover img { transform: none; }
}
