:root
{
    --w: 90vw;
    --h: 95vh;
    --r: 12px;
    --shadow: 0 20px 60px rgba(0,0,0,.35);
}

.thumb
{
    border:0;
    padding:0;
    background:transparent;
    cursor:pointer;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,.18);
    outline: none;
}

.thumb img
{
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .25s ease;
}

.thumb:hover img
{
    transform: scale(1.05); 
}

.thumb:focus-visible
{
    outline:3px solid rgba(255,255,255,.8); 
    outline-offset:4px; 
}

.modal
{
    position:fixed;
    inset:0;
    display:none;
    place-items:center;
    padding:24px;
    background: rgba(0,0,0,.62);
    backdrop-filter: blur(6px);
    z-index:999;
}

.modal.is-open
{
    display:grid;
}

.viewer
{
    width: var(--w);
    max-height: var(--h);
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: var(--r);
    overflow:hidden;
    box-shadow: var(--shadow);
    position:relative;
}

.track
{
    display:flex;
    height: min(var(--h), 90vh);
    transition: transform .5s ease;
    will-change: transform;
}

.slide
{
    flex: 0 0 100%;
    position:relative;
    display:grid;
    place-items:center;
    background: rgba(0,0,0,.25);
}

.slide img
{
    width: 100%;
    height: 100%;
    object-fit: scale-down;
    display: block;
}

/* Controls */
.btn
{
    position:absolute;
    top:50%;
    transform:translateY(-50%);
    width:44px;
    height:44px;
    border-radius:999px;
    border:1px solid rgba(255,255,255,.18);
    background: rgba(0,0,0,.45);
    color:#fff;
    display:grid;
    place-items:center;
    cursor:pointer;
    user-select:none;
    font-size:26px;
    line-height:1;
    backdrop-filter: blur(8px);
}
.btn:hover{ background: rgba(0,0,0,.6); }
.btn:focus-visible{ outline:3px solid rgba(255,255,255,.8); outline-offset:3px; }
.prev{ left:12px; }
.next{ right:12px; }

.close
{
    top:14px;
    right:14px;
    transform:none;
    font-size:22px;
}

.dots
{
    position:absolute;
    left:0; right:0;
    bottom:12px;
    display:flex;
    justify-content:center;
    gap:10px;
    pointer-events:auto;
}

.dot
{
    width:10px;
    height:10px;
    border-radius:999px;
    background: rgba(255,255,255,.35);
    border:0;
    cursor:pointer;
}

.dot[aria-current="true"]
{
    background:#fff;
    transform: scale(1.2);
}

@media (prefers-reduced-motion: reduce)
{
    .track{ transition:none; }
    .thumb img{ transition:none; }
}
