/* nm-media-fit (14 Oct 2026): one rule for video and pictures inside a glass card.
   The card hugs its media. Every item is sized from its source's real shape, so there is no empty
   space inside the card and nothing is cropped.

   Markup:
     <div class="wd-shell"><div class="nm-fit" style="--acc:#d987c6">
       <button class="nm-fit-i" style="--r:1.7778" ...><img ...><span class="nm-fit-p"></span><span class="nm-fit-t">Label</span></button>
       <button class="nm-fit-i" style="--r:0.5625" ...>...</button>
     </div></div>

   --r is the source's width divided by its height: 16:9 = 1.7778, 9:16 = 0.5625, 4:5 = 0.8, 3:2 = 1.5, 5:4 = 1.25.
   Items sit in one row, each as wide as its shape needs, all the same height.
   .is-stack on .nm-fit puts the items in a column instead (each full width).
   .nm-fit-p is the play disc (leave it out on items that are not playable, such as a link or a photo).
   .nm-fit-t is a small label; it hides itself on very narrow items.
   Phone: .is-wrap-sm on the card plus .is-wide on landscape items (see the end of this file). */
.nm-fit{--fit-gap:12px;--fit-pad:12px;display:flex;align-items:stretch;gap:var(--fit-gap);padding:var(--fit-pad);background:radial-gradient(110% 90% at 15% 0%,color-mix(in srgb,var(--acc,#6300ff) 26%,transparent),transparent 58%),linear-gradient(160deg,#2a1f52,#160a34)}
.nm-fit>.nm-fit-i{position:relative;display:block;flex:var(--r,1.7778) 1 0;min-width:0;aspect-ratio:var(--r,1.7778);container-type:inline-size;margin:0;padding:0;border:0;border-radius:24px;overflow:hidden;background:#241a44;color:#fff;font:inherit;text-align:left;text-decoration:none;cursor:pointer;box-shadow:0 22px 40px -26px rgba(0,0,0,.8);transition:transform .16s cubic-bezier(.23,1,.32,1)}
.nm-fit>.nm-fit-i>img,.nm-fit>.nm-fit-i>video{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;display:block}
.nm-fit>video.nm-fit-i{object-fit:cover;width:auto;height:auto}
.nm-fit>.nm-fit-i>img{transition:transform .5s cubic-bezier(.23,1,.32,1)}
.nm-fit>.nm-fit-i:active{transform:scale(.985)}
.nm-fit>.nm-fit-i:focus-visible{outline:2px solid #ffeca0;outline-offset:3px}
@media (hover:hover) and (pointer:fine){.nm-fit>.nm-fit-i:hover>img{transform:scale(1.03)}}
.nm-fit.is-stack{flex-direction:column}
.nm-fit.is-stack>.nm-fit-i{flex:none;width:100%}
.nm-fit-i.is-still{cursor:default}
a.nm-fit-i.is-link{cursor:pointer}
.nm-fit-p{position:absolute;left:min(14px,6cqw);bottom:min(14px,6cqw);z-index:2;width:clamp(30px,17cqw,52px);aspect-ratio:1;border-radius:50%;background:#ffeca0;box-shadow:0 12px 30px -10px rgba(0,0,0,.6)}
.nm-fit-p::after{content:'';position:absolute;inset:0;background:#160a34;clip-path:polygon(39% 28%,39% 72%,75% 50%)}
.nm-fit-t{position:absolute;left:8px;top:8px;z-index:2;max-width:calc(100% - 16px);padding:4px 8px;border-radius:24px;background:rgba(13,5,34,.74);font-size:13px;font-weight:600;line-height:1.3;color:#fff}
@container (max-width:150px){.nm-fit-t{display:none}}
/* phone: add .is-wrap-sm to the card and .is-wide to landscape items. Landscape items then take a full row
   and portrait items share the next row two to a row (use two portraits, or one portrait with .is-wide off and a partner). */
@media (max-width:560px){.nm-fit.is-wrap-sm{flex-wrap:wrap}.nm-fit.is-wrap-sm>.is-wide{flex:0 0 100%}.nm-fit.is-wrap-sm>.nm-fit-i:not(.is-wide){flex:1 1 calc(50% - var(--fit-gap))}}
@media (max-width:560px){.nm-fit{--fit-gap:8px;--fit-pad:8px}.nm-fit-t{font-size:12px;padding:4px 8px}}
@media (prefers-reduced-motion:reduce){.nm-fit>.nm-fit-i,.nm-fit>.nm-fit-i>img{transition:none}}

/* 22 Oct 2026: on a laptop or desktop the tile under the pointer grows and lifts over its neighbours; the play button grows with it. */
@media (hover:hover) and (pointer:fine){
.nm-fit:not(.is-stack)>.nm-fit-i{transition:transform .35s cubic-bezier(.23,1,.32,1),box-shadow .35s cubic-bezier(.23,1,.32,1)}
.nm-fit:not(.is-stack)>.nm-fit-i:not(.is-still):hover{transform:scale(1.12);z-index:3;box-shadow:0 34px 70px -24px rgba(0,0,0,.75)}
.nm-fit>.nm-fit-i:not(.is-still):hover .nm-fit-p{transform:scale(1.18)}
.nm-fit-p{transition:transform .3s cubic-bezier(.23,1,.32,1)}
}
