/* Summer Sale hero. Design space is Canva's 1366 x 768 frame; 1 design px = var(--u) = stage width / window width.
   Desktop shows the whole frame. Phone shows a taller window onto the same composition (the pieces simply run on). */
.vsa-sh--summer{
  --win-w:1366; --win-h:768; --ox:0; --oy:0;
  --u:calc(100cqw / var(--win-w));
  --ar-d:calc(1366 / 768); --ar-m:calc(1090 / 1100);
  --ts:239; --tlh:.837; --tls:.108em; --tdy:28;          /* headline: size in design px, line height, tracking (see fit notes in README) */
  --px:calc((655 - var(--ox)) / var(--win-w) * 100); --py:calc((377.5 - var(--oy)) / var(--win-w) * 100); --pw:calc(360 / var(--win-w) * 100);
  --clock-cw:2.35cqw; --clock-ch:3.2cqw; --clock-gap:1.4cqw;
  background:#5db8b3;
}
@media (max-width:767px){
  .vsa-sh--summer{ --win-w:1090; --win-h:1100; --ox:140; --oy:-166; --pw:46;
    --clock-cw:6.1cqw; --clock-ch:8.8cqw; --clock-gap:2.2cqw; }
}

/* the three pieces, the overlays clipped to them, and the capsules all slide with the same vectors */
.vsa-sh--summer .vsa-pc{ position:absolute; inset:0; transform:translate3d(var(--tx,0),var(--ty,0),0); transition:transform 1.25s var(--slide) var(--sd,0s); }
.vsa-sh--summer .vsa-solid{ background:var(--c); }
.vsa-sh--summer [data-piece="teal"]{ --sd:0s; } .vsa-sh--summer [data-piece="amber"]{ --sd:.09s; } .vsa-sh--summer [data-piece="blue"]{ --sd:.18s; }
.vsa-sh--summer.is-opening [data-piece="teal"]{ --tx:-74cqw; --ty:-48cqw; }    /* teal: towards the top left */
.vsa-sh--summer.is-opening [data-piece="amber"]{ --tx:76cqw; --ty:-48cqw; }    /* amber: towards the top right */
.vsa-sh--summer.is-opening [data-piece="blue"]{ --tx:0cqw; --ty:66cqw; }       /* blue: down */
.vsa-sh--summer.is-opening .vsa-pc,.vsa-sh--summer.is-opening .vsa-cap{ will-change:transform; }

/* capsules: one element each. The wrapper places, rotates and slides; the image inside floats. Transform only. */
.vsa-sh--summer .vsa-cap{ position:absolute; left:calc((var(--x) - var(--ox)) * var(--u)); top:calc((var(--y) - var(--oy)) * var(--u)); width:calc(var(--w) * var(--u)); height:calc(var(--h) * var(--u));
  transform:translate3d(var(--tx,0),var(--ty,0),0) rotate(var(--r)); transition:transform 1.25s var(--slide) var(--sd,0s); pointer-events:none; }
.vsa-sh--summer .vsa-cap__i{ display:block; width:100%; height:100%; max-width:none; object-fit:fill; user-select:none; -webkit-user-drag:none;
  animation:vsa-float var(--dur,7s) cubic-bezier(.45,0,.55,1) var(--del,0s) infinite alternate; will-change:transform; }
@keyframes vsa-float{
  from{ transform:translate3d(calc(var(--ax) * var(--u) * -1), calc(var(--ay) * var(--u) * -1), 0) rotate(calc(var(--ar) * -1)); }
  to  { transform:translate3d(calc(var(--ax) * var(--u)),       calc(var(--ay) * var(--u)),       0) rotate(var(--ar)); }
}
.vsa-sh--summer.is-opening .vsa-cap__i,.vsa-sh--summer.is-offscreen .vsa-cap__i{ animation-play-state:paused; }

/* frame, vignette, headline: Canva values */
.vsa-sh--summer .vsa-frame{ position:absolute; box-sizing:border-box; left:calc((413 - var(--ox)) * var(--u)); top:calc((73 - var(--oy)) * var(--u)); width:calc(621 * var(--u)); height:calc(622 * var(--u));
  border:max(2px, calc(5.5 * var(--u))) solid rgba(255,255,255,.93); }
/* Canva: white-to-grey vignette at 0.47 over the blocks and capsules. Measured from the export instead of guessed: it is a multiply, centre untouched, corners about 0.69.
   summer-vignette.png is that measured map (x 0..1366, y -176..960 in design px, edge rows carried outward for the phone window). */
.vsa-sh--summer .vsa-clone--vig{ mix-blend-mode:multiply; }   /* the blend sits on the transformed clone, not inside it, so it multiplies the pieces and capsules beneath */
.vsa-sh--summer .vsa-vig{ position:absolute; left:calc((0 - var(--ox)) * var(--u)); top:calc((-176 - var(--oy)) * var(--u)); width:calc(1366 * var(--u)); height:calc(1136 * var(--u)); pointer-events:none;
  background:url("summer-vignette.png") 0 0 / 100% 100% no-repeat; }
.vsa-sh--summer .vsa-headline{ position:absolute; left:calc((209.838 - var(--ox)) * var(--u)); top:calc((113.593 + var(--tdy) - var(--oy)) * var(--u)); width:calc(936.995 * var(--u)); height:calc(467.191 * var(--u));
  display:flex; flex-direction:column; align-items:center; margin:0; color:#fff; font:400 calc(var(--ts) * var(--u))/var(--tlh) "Caveat Brush","Permanent Marker","Segoe Print",cursive; letter-spacing:var(--tls); text-indent:calc(16 * var(--u)); text-transform:uppercase; white-space:nowrap;
  text-shadow:0 calc(5 * var(--u)) calc(16 * var(--u)) rgba(0,0,0,.2); }
.vsa-sh--summer .vsa-headline span{ display:block; }

/* the clock sits on the hero's own bottom edge even when the artwork is cropped top and bottom */
.vsa-sh--summer .vsa-sh__clock{ position:absolute; left:50%; transform:translateX(-50%); z-index:5; bottom:calc(((100cqw / var(--ar)) - var(--h)) / 2 + 10px); }
.vsa-sh--summer .vsa-sh__clock .vsa-clock__l{ text-shadow:0 1px 2px rgba(0,0,0,.45); color:rgba(255,255,255,.92); }
@media (max-width:767px){ .vsa-sh--summer .vsa-sh__clock{ bottom:12px; } }

/* QA only (localhost): ?vsa_sh_puzzle=1 pulls the three pieces slightly apart so the fit can be checked */
.vsa-sh--summer.is-puzzle{ background:#1b1b1b; }
.vsa-sh--summer.is-puzzle [data-piece="teal"]{ --tx:-2.4cqw; --ty:-1.8cqw; } .vsa-sh--summer.is-puzzle [data-piece="amber"]{ --tx:2.4cqw; --ty:-1.8cqw; } .vsa-sh--summer.is-puzzle [data-piece="blue"]{ --ty:2.6cqw; }
.vsa-sh--summer.is-puzzle .vsa-cap,.vsa-sh--summer.is-puzzle .vsa-clone,.vsa-sh--summer.is-puzzle .vsa-sh__clock{ visibility:hidden; }

/* reduced motion: no float, no slide. The pieces, capsules and overlays just fade. */
@media (prefers-reduced-motion:reduce){
  .vsa-sh--summer .vsa-cap__i{ animation:none; will-change:auto; }
  .vsa-sh--summer .vsa-pc,.vsa-sh--summer .vsa-cap{ transition:opacity .5s ease-out; }
  .vsa-sh--summer.is-opening [data-piece]{ --tx:0; --ty:0; opacity:0; }
}

/* ---- link mode: the 1920 Canva frame (same geometry as the 1366 one). Everything lives in .vsa-world, one 1366 design box contained in the stage; the svg colour pieces, the vignette and the
   capsules run past it to the stage edges. --ox and --oy are zero inside the world: the world itself carries the window offset. OPEN slides the pieces with what they carry, as on 3 Nov. ---- */
.vsa-sh--summer.vsa-sh--link{ --open-ink:#111; --u:calc(var(--f) * 1920 / 1366); --wx:var(--cx); --wy:var(--cy);
  background:linear-gradient(90deg,#5db8b3 50%,#ffbe40 50%);
  --clk-l:calc(486.74 * var(--f)); --clk-t:calc(396.41 * var(--f)); --clk-w:calc(946.53 * var(--f));
  --pill-x:calc(955.8 * var(--f)); --pill-y:calc(952 * var(--f)); --pill-w:calc(330 * var(--f)); }
.vsa-world{ --ox:0; --oy:0; position:absolute; left:var(--wx); top:var(--wy); width:calc(1366 * var(--u)); height:calc(768.375 * var(--u)); }
/* at rest nothing here is transformed, so a still piece costs no compositor layer */
.vsa-sh--summer.vsa-sh--link .vsa-pc{ transform:none; }
.vsa-world__bg{ position:absolute; left:0; top:0; width:100%; height:100%; overflow:visible; transition:transform 1.25s var(--slide) var(--sd,0s); }
.vsa-summer__tag{ transition:transform 1.25s var(--slide) var(--sd,0s); }
.vsa-sh--summer.vsa-sh--link.is-opening .vsa-pc,.vsa-sh--summer.vsa-sh--link.is-opening .vsa-world__bg,.vsa-sh--summer.vsa-sh--link.is-opening .vsa-summer__tag{ transform:translate3d(var(--tx,0px),var(--ty,0px),0); will-change:transform; }
.vsa-sh--summer.vsa-sh--link .vsa-cap{ transform:translate3d(calc(var(--tx,0px) + var(--sx,0px)),var(--ty,0px),0) rotate(var(--r)); }
.vsa-sh--summer.vsa-sh--link.is-opening [data-piece="blue"]{ --tx:0px; }
.vsa-sh--summer.vsa-sh--link.is-opening .vsa-clone--vig{ opacity:0; transition:opacity .5s ease-out; transform:none; }
/* capsules: x on the wrapper (slow), y and rotation on the image. Transform only. Off screen, opening and reduced motion all stop both. */
.vsa-cap__d{ display:block; width:100%; height:100%; animation:vsa-drift var(--ddur,6s) cubic-bezier(.45,0,.55,1) var(--ddel,0s) infinite alternate; }
@keyframes vsa-drift{ from{ transform:translate3d(calc(var(--dx) * var(--u) * -1),calc(var(--dy) * var(--u)),0); } to{ transform:translate3d(calc(var(--dx) * var(--u)),calc(var(--dy) * var(--u) * -1),0); } }
.vsa-sh--summer.is-opening .vsa-cap__d,.vsa-sh--summer.is-offscreen .vsa-cap__d{ animation-play-state:paused; }
.vsa-sh--summer.vsa-sh--link.is-offscreen .vsa-cap__i{ will-change:auto; }
.vsa-sh--summer.vsa-sh--link .vsa-vig{ left:calc(-1400 * var(--u)); width:calc(4166 * var(--u)); background-image:url("summer-vignette-wide.png"); }
.vsa-cap--x{ display:none; }
@container (min-aspect-ratio:21 / 10){ .vsa-sh--summer.vsa-sh--link .vsa-cap--x{ display:block; } }
/* the 1920 design has a smaller frame than the 1366 one (measured from the reference: x 588 to 1327, y 103 to 843) */
.vsa-sh--summer.vsa-sh--link .vsa-frame{ left:calc(418.3 * var(--u)); top:calc(73.3 * var(--u)); width:calc(526.4 * var(--u)); height:calc(526.4 * var(--u)); border-width:max(2px, calc(4.3 * var(--u))); }
/* headline and tag sit in the world like the capsules */
.vsa-summer__word{ position:absolute; left:0; top:0; width:100%; height:100%; max-width:none; margin:0; pointer-events:none; }
.vsa-summer__tag{ position:absolute; left:calc(var(--tag-x,441.8) * var(--u)); top:calc(var(--tag-y,583) * var(--u)); width:calc(72.3 * var(--u)); height:auto; max-width:none; margin:0; pointer-events:none; z-index:4; }
@media (max-width:767px), (orientation:portrait){
  /* window 1130 x 900 onto the frame, centred on the lettering (design x 135 to 1231) so no letter is cut. The clock must keep covering design y 282 to 391:
     the lettering behind the Canva clock is unknown, it was cut from the flat reference. The tag moves left of the larger pill. */
  .vsa-sh--summer.vsa-sh--link{ --ar-h:79.646; --u:calc(100 * var(--v) / 1130); --wx:calc(var(--cx) - 118 * var(--u)); --wy:calc(50 * var(--u)); --tag-x:238; --tag-y:596;
    --clk-l:calc(10 * var(--v)); --clk-t:calc(27.8 * var(--v)); --clk-w:calc(80 * var(--v));
    --pill-x:calc(49.8 * var(--v)); --pill-y:calc(65 * var(--v)); --pill-w:calc(46 * var(--v)); }
}
@media (prefers-reduced-motion:reduce){
  .vsa-cap__d{ animation:none; }
  .vsa-world__bg,.vsa-summer__tag{ transition:opacity .4s ease-out; }
  .vsa-sh--summer.vsa-sh--link.is-opening [data-piece]{ --tx:0px; --ty:0px; opacity:0; }
  .vsa-sh--summer.vsa-sh--link.is-opening .vsa-pc,.vsa-sh--summer.vsa-sh--link.is-opening .vsa-world__bg,.vsa-sh--summer.vsa-sh--link.is-opening .vsa-summer__tag{ transform:none; }
}

/* ---- 10 Nov (Seb likes the End of Year page): the hub tile matches it. Table Mountain at dusk fills the stage (both split halves carry it),
   a dusk scrim, the title in Caveat Brush, white: "END OF YEAR" above the clock, "SALE" below it, the pill under that. The clock never
   sits on a word: desktop in design px (--f), phone in --v. ---- */
.vsa-sh--eoy.vsa-sh--link{ background:#0f2e3d; --open-ink:#111; }
.vsa-eoy{ position:absolute; inset:0; overflow:hidden; }
.vsa-eoy::after{ content:""; position:absolute; inset:0; pointer-events:none;
  background:linear-gradient(180deg, rgba(8,28,40,.5) 0%, rgba(8,28,40,.25) 40%, rgba(8,28,40,.1) 60%, rgba(8,28,40,.4) 100%); }
.vsa-sh .vsa-eoy__photo{ position:absolute; inset:0; display:block; width:100%!important; height:100%!important; max-width:none; margin:0; object-fit:cover; object-position:50% 62%; }
.vsa-eoy__t{ position:absolute; z-index:1; left:var(--cx); width:calc(1920 * var(--f)); margin:0!important; padding:0!important; text-align:center; pointer-events:none;
  font:400 calc(220 * var(--f))/1 "Caveat Brush","Permanent Marker",cursive; letter-spacing:.08em; text-transform:uppercase; color:#fff; text-shadow:0 2px 28px rgba(4,20,30,.5); }
.vsa-eoy__t--1{ top:calc(var(--cy) + 140 * var(--f)); }
.vsa-eoy__t--2{ top:calc(var(--cy) + 585 * var(--f)); font-size:calc(250 * var(--f)); }
@media (max-width:767px), (orientation:portrait){
  .vsa-sh .vsa-eoy__photo{ object-position:46% 60%; }
  .vsa-eoy__t{ left:0; width:100%; font-size:calc(14.5 * var(--v)); letter-spacing:.06em; }
  .vsa-eoy__t--1{ top:calc(8 * var(--v)); }
  .vsa-eoy__t--2{ top:calc(42 * var(--v)); font-size:calc(17 * var(--v)); }
}
.vsa-sh--eoy.vsa-sh--split .vsa-sh__reveal{ background:#0f2e3d; }   /* behind the parting halves: the band's dusk, not the old teal and amber */
.vsa-sh--eoy.vsa-sh--split.is-open .vsa-sh__reveal{ background:#fbf8f3; }
