/* Ambient hero effects (Seb, 15 Nov): drifting, pulsing specks and Santa's sleigh as a passing shadow. Festive Specials and End of Year only.
   Transform and opacity only. Every name starts with vsa-fx. fx.js sets data-fx-idle on the host while it is off screen or the tab is hidden. */

.vsa-fx{ position:absolute; inset:0; z-index:1; overflow:hidden; pointer-events:none; contain:layout paint style; transition:opacity .45s ease-out;
  --cyc:34s;              /* one loop: 12 s left to right, 5 s off screen, 12 s right to left, 5 s off screen */
  --sl-top:9%; --sl-w:clamp(220px, 25%, 560px); --sl-o:.32; --sl-b:1px; --arc:-42%; }
.vsa-fx *{ pointer-events:none; }

/* ---- specks: the <i> drifts on a slow three-leg path, the <b> inside it breathes (glow up and down, never a blink) ---- */
.vsa-fx__s{ position:absolute; left:var(--x); top:var(--y); width:var(--s); height:var(--s); margin:calc(var(--s) / -2) 0 0 calc(var(--s) / -2);
  animation:vsa-fx-drift var(--dd) ease-in-out var(--dl) infinite alternate; }
.vsa-fx__s b{ display:block; width:100%; height:100%; border-radius:50%; opacity:var(--lo);
  background:radial-gradient(circle closest-side, rgb(var(--c) / 1) 0 var(--k), rgb(var(--c) / .42) calc(var(--k) + 9%), rgb(var(--c) / .12) 62%, rgb(var(--c) / 0) 100%);
  animation:vsa-fx-pulse var(--pd) ease-in-out var(--pl) infinite alternate; }
@keyframes vsa-fx-drift{
  0%  { transform:translate3d(0,0,0); }
  33% { transform:translate3d(var(--dx), calc(var(--dy) * .4), 0); }
  66% { transform:translate3d(calc(var(--dx) * .35), var(--dy), 0); }
  100%{ transform:translate3d(calc(var(--dx) * -.4), calc(var(--dy) * .55), 0); } }
@keyframes vsa-fx-pulse{ from{ opacity:var(--lo); transform:scale(.78); } to{ opacity:var(--hi); transform:scale(1.12); } }

/* ---- the sleigh: run carries x across the hero (its width is the hero's), sl adds its own width so it starts and ends fully off screen,
   arc lifts it gently mid-crossing, bob keeps the reindeer moving, and the image flips while it waits off screen on the right ---- */
.vsa-fx__run,.vsa-fx__sl,.vsa-fx__arc,.vsa-fx__img{ animation-duration:var(--cyc); animation-delay:1.2s; animation-iteration-count:infinite; animation-fill-mode:both; }
.vsa-fx__run{ position:absolute; left:0; top:var(--sl-top); width:100%; height:0; animation-name:vsa-fx-x; animation-timing-function:linear; will-change:transform; }
.vsa-fx__sl{ position:absolute; right:100%; top:0; width:var(--sl-w); animation-name:vsa-fx-x; animation-timing-function:linear; will-change:transform; }
.vsa-fx__arc{ display:block; animation-name:vsa-fx-arc, vsa-fx-bob; animation-duration:var(--cyc), 2.6s; animation-timing-function:ease-in-out; animation-direction:normal, alternate; will-change:transform; }
.vsa-fx__img{ display:block; width:100%!important; height:auto!important; max-width:none; margin:0; opacity:var(--sl-o); filter:blur(var(--sl-b));
  animation-name:vsa-fx-flip; animation-timing-function:steps(1, end); user-select:none; -webkit-user-drag:none; }
@keyframes vsa-fx-x{
  0%      { transform:translate3d(0,0,0); }
  35.294% { transform:translate3d(100%,0,0); }
  50%     { transform:translate3d(100%,0,0); }
  85.294% { transform:translate3d(0,0,0); }
  100%    { transform:translate3d(0,0,0); } }
@keyframes vsa-fx-arc{
  0%,35.294%,50%,85.294%,100%{ transform:translate3d(0,0,0); }
  17.647%,67.647%{ transform:translate3d(0,var(--arc),0); } }
@keyframes vsa-fx-bob{ from{ translate:0 -2.5%; } to{ translate:0 2.5%; } }
@keyframes vsa-fx-flip{ 0%{ transform:none; } 50%{ transform:scaleX(-1); } 100%{ transform:scaleX(-1); } }

/* ---- per hero ---- */
.vsa-fx--holiday{ --sl-o:.36; }
.vsa-fx--summer{ --sl-o:.3; --sl-top:7%; }

/* where it sits: above the photo (and its scrim and bokeh), below the title, the clock and the pill */
.vsa-sh__shard > .vsa-fx{ z-index:2; }            /* Festive hub: halves paint at 0, the title at 3, the clock at 5 */
.vsa-eoy > .vsa-fx{ z-index:1; }                  /* End of Year hub: after the photo, before the two title lines (z 1, later in the source) */
.vsa-camp__band > .vsa-fx,.vsa-hol-band > .vsa-fx{ z-index:1; }   /* campaign bands: the title is at 2, the button at 3, the strip at 4 */

/* OPEN on the hub: the layer fades with the clock and pill, and stops */
.vsa-sh.is-opening .vsa-sh__cover .vsa-fx,.vsa-sh.is-open .vsa-sh__cover .vsa-fx{ opacity:0; transition:opacity .25s ease-in; }
.vsa-sh.is-open .vsa-sh__cover .vsa-fx *,
[data-fx-idle] .vsa-fx *,
.vsa-sh:not(.is-opening):not(.is-open) .vsa-sh__reveal .vsa-fx *{ animation-play-state:paused!important; }   /* the hub's hidden reveal band waits for OPEN */

/* phones and portrait: fewer specks; the hero is short here, so the sleigh is a little smaller in share and its arc stays inside the top edge */
@media (max-width:767px), (orientation:portrait){
  .vsa-fx{ --sl-w:min(46%, 420px); --sl-top:7%; --arc:-14%; }
}
@media (max-width:767px){ .vsa-fx__s--wide{ display:none; } }

/* reduced motion: no sleigh, the specks hold still at a soft glow */
@media (prefers-reduced-motion:reduce){
  .vsa-fx__run{ display:none; }
  .vsa-fx__s,.vsa-fx__s b{ animation:none; }
  .vsa-fx__s b{ opacity:calc(var(--hi) * .7); }
}
