/* One motion treatment for browsable media, not for players, menus or forms.
   The card (including its rim and caption) moves as a unit. The thumbnail's
   own crop is untouched; a second image-only zoom would compound the scale. */
:is(.card,.poster,.obs-card,.yt-card,.yt-mini,.an-card,.an-home-card,.an-next,.filmcard,.row-film) {
  position:relative;
  transform-origin:50% 0%;
  transition:transform 190ms cubic-bezier(.2,.7,.3,1),border-color 170ms,box-shadow 170ms;
}
.card:hover img,.yt-thumb:hover>img,.yt-mini:hover>img,.filmcard:hover .frame img {transform:none}
/* Override legacy unconditional :hover rules, including sticky touch hover. */
.card:hover,.poster:hover {transform:none;box-shadow:var(--glass-hi,none)}
@media (hover:hover) and (pointer:fine) {
  :where(html[data-effects="full"]) :is(.card,.poster,.obs-card,.yt-card,.yt-mini,.an-card,.an-home-card,.an-next,.filmcard,.row-film):not(:disabled):hover {
    transform:translateY(-3px) scale(1.025);z-index:2;
  }
  .yt-card:has(.yt-pop:not([hidden])) {z-index:4}
}
/* An inner watch link may be deliberately cropped to the thumbnail. Keep an
   exterior keyboard indicator on its card, clear of the scrolling viewport. */
:is(.card,.poster,.obs-card,.an-card,.yt-card):has(:focus-visible) {outline:2px solid var(--accent2,#a2d9ff);outline-offset:2px}
/* Keep horizontal shelves scrollable. Leave real paint space *inside* their
   scrollport; overflow-y:visible would compute to auto beside overflow-x:auto.
   Outdent by the side padding so the resting covers still line up with the grid. */
:is(.row:has(>.card,>.poster),.an-home-row,.yt-shelf) {
  --rail-room:10px;
  padding-block-start:var(--rail-room);padding-block-end:max(16px,var(--rail-room));
  padding-inline:var(--rail-room);margin-inline:calc(-1 * var(--rail-room));
  margin-block-start:-6px;scroll-padding-inline:var(--rail-room);
}

/* The Galaxy catalogues render new tiles as results arrive. One opt-in on the
   outer tile covers both poster and caption, with no JS or permanent GPU layer. */
:root {
  --nb-pop-time: 180ms;
  --nb-pop-ease: cubic-bezier(.22,.7,.28,1);
}
[data-media-tile], button.lp-card, .nb-sheet-choice {
  position:relative;
  transform-origin:center;
  transition:transform var(--nb-pop-time) var(--nb-pop-ease),
             border-color 150ms, background-color 150ms, box-shadow 150ms;
}
@media (max-width:680px) {
  /* The radar becomes a horizontal scrollport. Reserve the scaled outline inside it. */
  .gl-radar .gl-picks { padding:5px; margin:-3px; scroll-padding-inline:5px; }
}
[data-media-tile="wide"] { --nb-pop-scale: 1.012; }
.nb-sheet-choice { --nb-pop-scale: 1.022; }
/* The featured picture is one canvas with an iris reveal. Magnify that plane,
   not the player or the controls over it, and never scale an entire shelf. */
.gl-screen > .gl-projection { transition:transform 220ms var(--nb-pop-ease); transform-origin:center; }
@media (hover:hover) and (pointer:fine) {
  html[data-effects="full"] :is([data-media-tile],button.lp-card,.nb-sheet-choice):not(:disabled):hover {
    transform:scale(var(--nb-pop-scale,1.028)); z-index:2;
  }
  html[data-effects="full"] .gl-screen:hover > .gl-projection { transform:scale(1.025); }
  .gl-actions .nb-sheet-choice:not(:disabled):hover { border-color:#927aa9; background:#302738; color:#fff; }
}
/* Keyboard gets the same selection feedback (not sticky :focus-within after
   a click or tap). The existing account-level motion switch stays authoritative. */
html[data-effects="full"] :is([data-media-tile],button.lp-card,.nb-sheet-choice):not(:disabled):is(:focus-visible,:has(:focus-visible)) {
  transform:scale(var(--nb-pop-scale,1.028)); z-index:2;
}
html[data-effects="full"] .gl-screen:has(:focus-visible) > .gl-projection { transform:scale(1.025); }
:is(.nb-sheet-choice,.nb-sheet-x):focus-visible {
  outline:2px solid #e0c7ff; outline-offset:2px;
}
.gl-actions .nb-sheet-choice:focus-visible { border-color:#ab92c2; background:#302738; }
:is([data-media-tile],button.lp-card):is(:focus-visible,:has(:focus-visible)) { outline:2px solid #c9b6df; outline-offset:2px; }
html[data-effects="reduced"] :is([data-media-tile],button.lp-card,.nb-sheet-choice,.gl-screen > .gl-projection) { transform:none; }
@media (hover:none), (pointer:coarse) {
  .nb-sheet-choice:enabled:hover:not(:focus-visible) { transform:none; }
  .gl-actions .nb-sheet-choice:enabled:active { background:#302738; border-color:#927aa9; }
}
