/* Hero gallery motion (hero-fx.js): a tile leans after the pointer and catches a rank-tinted sheen;
   the clicked portrait carries over into the hero page. Mouse only, never under reduced motion. */
@media (hover:hover) and (pointer:fine) and (prefers-reduced-motion:no-preference){
  .hc-grid .hc-tile,.hc-grid .hc-tile:hover{
    transform:perspective(900px) rotateX(calc(var(--ty,0) * -5deg)) rotateY(calc(var(--tx,0) * 6deg)) translateY(var(--lift,0px));
    transition:border-color .3s var(--ease),transform .6s var(--rise)}
  .hc-grid .hc-tile:hover{--lift:-2px}
  /* while the pointer moves the tile follows it directly; the long ease is for settling back */
  .hc-grid .hc-tile.fx-on{--lift:-4px;transition:border-color .3s var(--ease),transform .14s linear}
  .hc-grid .hc-tile .hc-pic img{transform:scale(1.045) translate(calc(var(--tx,0) * -5px),calc(var(--ty,0) * -5px));transition:transform .6s var(--rise)}
  .hc-grid .hc-tile.fx-on .hc-pic img{transition:transform .14s linear}
  /* sheen: a soft spot under the pointer plus a streak that slides across with it */
  .hc-grid .hc-tile .hc-pic::after{content:"";position:absolute;inset:0;pointer-events:none;opacity:0;mix-blend-mode:screen;transition:opacity .45s var(--ease);
    background:
      radial-gradient(70% 55% at var(--mx,50%) var(--my,50%),rgba(var(--fx-c,228,234,240),var(--fx-a,.16)),transparent 70%),
      linear-gradient(112deg,transparent 38%,rgba(var(--fx-c2,var(--fx-c,228,234,240)),var(--fx-s,.1)) 49%,transparent 60%) var(--mx,50%) 0/260% 100% no-repeat}
  .hc-grid .hc-tile.fx-on .hc-pic::after{opacity:1}
  /* the higher the rank, the brighter the sheen; the discharge colour starts at A */
  .hc-tile[data-rk="C"]{--fx-c:185,208,234;--fx-a:.2;--fx-s:.13}
  .hc-tile[data-rk="B"]{--fx-c:211,226,243;--fx-a:.26;--fx-s:.2}
  .hc-tile[data-rk="A"]{--fx-c:211,226,243;--fx-c2:92,225,240;--fx-a:.28;--fx-s:.3}
  .hc-tile[data-rk="S"]{--fx-c:141,235,246;--fx-c2:92,225,240;--fx-a:.3;--fx-s:.42}
  .hc-tile.fx-on[data-rk="A"],.hc-tile.fx-on[data-rk="S"]{border-color:rgba(92,225,240,.45)}
}
/* the small picture the gallery already loaded sits under the full one until it arrives */
#heroes .hs-portrait .hc-pic.big{background-image:var(--morph-pic,none);background-size:cover;background-position:50% 18%}
@media (prefers-reduced-motion:no-preference){
  html.vx-morphing .hs-portrait .hc-pic{view-transition-name:vx-hero-pic}
  ::view-transition-group(vx-hero-pic){animation-duration:.55s;animation-timing-function:var(--rise,cubic-bezier(.22,1,.36,1));overflow:hidden;border-radius:4px}
  ::view-transition-old(vx-hero-pic),::view-transition-new(vx-hero-pic){width:100%;height:100%;object-fit:cover;animation-duration:.3s}
}
