@charset "UTF-8";
/* =========================================================
   MUMUME STUDIO  V6  /  WORKS poster gallery
   Every selector starts with .works-gallery or .works-card,
   so nothing here can touch another section. Tokens come
   from style.css (:root). The poster frames reuse the V6
   .media component (load state, reveal wipe, missing-file
   placeholder) and only adjust it inside the gallery.
   ========================================================= */

.works-gallery{
  /* Poster width follows the viewport width AND height, so the
     heading, controls, posters and footer label share one screen
     on laptops. 2:3 is enforced by aspect-ratio on the frame. */
  --poster-w:clamp(190px,min(24vw,calc((100svh - 470px) * 2 / 3)),370px);
  --gap:clamp(14px,1.8vw,28px);
  position:relative;
}

/* ---------- Controls bar ---------- */
.works-gallery__bar{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:14px}
.works-gallery__hint{margin:0}
.works-gallery__controls{display:flex;align-items:center;gap:10px}
.works-gallery__count{margin:0 14px 0 0;color:var(--muted);font-variant-numeric:tabular-nums;white-space:nowrap}
.works-gallery__count b{color:var(--ink);font-weight:500}
.works-gallery__btn{display:grid;place-items:center;width:44px;height:44px;border:1px solid var(--line);color:var(--ink);transition:background .35s,color .35s,border-color .35s,opacity .3s}
.works-gallery__btn:hover:not(:disabled),
.works-gallery__btn:focus-visible{background:var(--ink);color:var(--bg);border-color:var(--ink)}
.works-gallery__btn:disabled{opacity:.28;cursor:default}
.works-gallery__progress{height:1px;margin-bottom:20px;background:var(--line-2);overflow:hidden}
.works-gallery__progress i{display:block;height:100%;background:var(--ink);transform:scaleX(var(--p,.1667));transform-origin:left}

/* ---------- Scroll area (native overflow, so touch swipe is native) ---------- */
.works-gallery__viewport{
  margin-inline:calc(var(--pad) * -1);           /* bleeds to the section edges */
  overflow-x:auto;overflow-y:hidden;
  overscroll-behavior-x:contain;
  scrollbar-width:none;-webkit-overflow-scrolling:touch;
  cursor:grab;
  -webkit-user-select:none;user-select:none;
  touch-action:pan-x pan-y;                       /* swipe sideways and still scroll the page */
}
.works-gallery__viewport::-webkit-scrollbar{display:none}
.works-gallery__viewport:focus-visible{outline:2px solid var(--ink);outline-offset:-2px}
.works-gallery.is-dragging .works-gallery__viewport{cursor:grabbing}
.works-gallery.is-dragging .works-card__link{pointer-events:none}

.works-gallery__track{display:flex;gap:var(--gap);width:max-content;margin:0;padding:0 0 0 var(--pad);list-style:none}
/* Trailing space lets the last poster reach the left edge, so every
   poster can become "current". works.js sets the exact value. */
.works-gallery__track::after{content:"";flex:0 0 var(--works-spacer,calc(100vw - var(--pad) - var(--poster-w) - var(--gap) - 16px))}

/* ---------- Poster card ---------- */
.works-card{flex:0 0 var(--poster-w);min-width:0;margin:0}
.works-card__link{position:relative;display:block;color:var(--ink);-webkit-user-drag:none}
.works-card__media{width:100%;height:auto;aspect-ratio:2 / 3}
.works-gallery .works-card__media img{filter:saturate(.9) brightness(.86);-webkit-user-drag:none;pointer-events:none}
/* neutralise the stock .media hover (grayscale to colour) inside the gallery */
.works-gallery .works-card__media.is-in:hover{--s:1}
.works-gallery .works-card__media.is-in:hover img{filter:saturate(.9) brightness(.86)}
/* poster scrim: dark at the foot for the title, hairline border kept from .media */
.works-gallery .works-card__media::after{background:linear-gradient(180deg,rgba(0,0,0,.42),transparent 22%,transparent 46%,rgba(0,0,0,.88))}

.works-card__shade{position:absolute;inset:0;z-index:2;pointer-events:none;opacity:0;background:linear-gradient(180deg,rgba(0,0,0,.3),transparent 32%,rgba(0,0,0,.34));transition:opacity .6s var(--ease-out)}
.works-card__num,.works-card__view{position:absolute;z-index:3;top:16px;margin:0;color:var(--ink)}
.works-card__num{left:16px;opacity:.6;transition:opacity .5s,transform .7s var(--ease-out)}
.works-card__view{right:16px;padding-bottom:5px;opacity:0;transform:translate3d(0,-6px,0);background:linear-gradient(currentColor,currentColor) left bottom / 0 1px no-repeat;border-bottom:1px solid rgba(255,255,255,.3);transition:opacity .5s,transform .7s var(--ease-out),background-size .7s var(--ease-out)}
.works-card__info{position:absolute;z-index:3;left:16px;right:16px;bottom:18px;display:flex;flex-direction:column;gap:6px;transition:transform .7s var(--ease-out)}
.works-card__info::after{content:"";display:block;width:0;height:1px;margin-top:6px;background:var(--ink);transition:width .7s var(--ease-out)}
.works-card__cat{margin:0;color:var(--ink-2)}
.works-card__title{margin:0;font-size:clamp(14px,1.45vw,21px);font-weight:700;line-height:1.15;letter-spacing:-.01em;text-transform:uppercase;color:var(--ink)}
.works-card__jp{font-family:var(--jp);font-size:clamp(12px,1vw,14px);letter-spacing:.08em;color:var(--ink-2)}

/* ---------- Hover and keyboard focus (pointer devices, not while dragging) ---------- */
@media (hover:hover){
  .works-gallery:not(.is-dragging) .works-card__link:is(:hover,:focus-visible) .works-card__media.is-in{--s:1.05}
  .works-gallery:not(.is-dragging) .works-card__link:is(:hover,:focus-visible) .works-card__media.is-in img{filter:saturate(1) brightness(.98)}
}
.works-gallery:not(.is-dragging) .works-card__link:is(:hover,:focus-visible) .works-card__shade{opacity:1}
.works-gallery:not(.is-dragging) .works-card__link:is(:hover,:focus-visible) .works-card__num{opacity:1;transform:translate3d(0,0,0)}
.works-gallery:not(.is-dragging) .works-card__link:is(:hover,:focus-visible) .works-card__view{opacity:1;transform:none;background-size:100% 1px}
.works-gallery:not(.is-dragging) .works-card__link:is(:hover,:focus-visible) .works-card__info{transform:translate3d(0,-6px,0)}
.works-gallery:not(.is-dragging) .works-card__link:is(:hover,:focus-visible) .works-card__info::after{width:36px}
.works-card__link:focus-visible{outline:2px solid var(--ink);outline-offset:3px}

/* ---------- Footer label ---------- */
.works .works-gallery__foot{margin-top:clamp(16px,3svh,32px)}

/* ---------- Touch devices: native swipe with gentle snapping ---------- */
@media (pointer:coarse){
  .works-gallery__viewport{scroll-snap-type:x proximity;scroll-padding-left:var(--pad)}
  .works-gallery__viewport.is-gliding{scroll-snap-type:none}
  .works-card{scroll-snap-align:start}
}
@media (hover:none){
  .works-card__num{opacity:1}
  .works-card__view{opacity:.9;transform:none;background-size:100% 1px}
}

/* ---------- Tablet and phone ---------- */
@media (max-width:900px){
  .works-gallery{--poster-w:min(72vw,340px);--gap:14px}
  .works-gallery__bar{flex-wrap:wrap;gap:12px}
  .works-gallery__btn{width:42px;height:42px}
  .works-card__title{font-size:clamp(15px,4.4vw,20px)}
  .works-card__jp{font-size:13px}
}
@media (max-width:420px){
  .works-gallery__bar{flex-direction:column;align-items:flex-start}
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion:reduce){
  .works-gallery .works-card__media.is-in{--s:1!important}
  .works-gallery .works-card__info{transform:none!important}
}
