/* Homeguard - Wonderful Winter Sale animated badge (transparent background, CSS only, no JavaScript).
   Size it with --wb-width on the .wb element, e.g. style="--wb-width:420px". Everything inside scales with it.
   Two versions: .wb--diamond (desktop) and .wb--wide (mobile). Show one per breakpoint (see index.html). */
.wb{ --wb-width:min(440px,90vw); position:relative; display:block; width:var(--wb-width); aspect-ratio:var(--w)/var(--h); container-type:inline-size; background:transparent; }
.wb__link{ position:absolute; inset:0; display:block; outline-offset:4px; -webkit-tap-highlight-color:transparent; }
/* the whole badge turns once around its vertical axis every 4 seconds (spins for a second, then rests) */
.wb__link{ animation:wb-spin 4s linear infinite; }
@keyframes wb-spin{ 0.00%{transform:scaleX(1.0000)} 1.04%{transform:scaleX(0.9995)} 2.08%{transform:scaleX(0.9924)} 3.13%{transform:scaleX(0.9638)} 4.17%{transform:scaleX(0.8936)} 5.21%{transform:scaleX(0.7619)} 6.25%{transform:scaleX(0.5556)} 7.29%{transform:scaleX(0.2755)} 8.33%{transform:scaleX(-0.0581)} 9.38%{transform:scaleX(-0.4052)} 10.42%{transform:scaleX(-0.7122)} 11.46%{transform:scaleX(-0.9242)} 12.50%{transform:scaleX(-1.0000)} 13.54%{transform:scaleX(-0.9242)} 14.58%{transform:scaleX(-0.7122)} 15.63%{transform:scaleX(-0.4052)} 16.67%{transform:scaleX(-0.0581)} 17.71%{transform:scaleX(0.2755)} 18.75%{transform:scaleX(0.5556)} 19.79%{transform:scaleX(0.7619)} 20.83%{transform:scaleX(0.8936)} 21.88%{transform:scaleX(0.9638)} 22.92%{transform:scaleX(0.9924)} 23.96%{transform:scaleX(0.9995)} 25.00%{transform:scaleX(1.0000)} 100%{transform:scaleX(1)} }
.wb__bgc{ position:absolute; inset:0; background:#0b2e8b; }   /* the blue backdrop of the mobile badge stays still; only the badge inside turns */
.wb__img{ position:absolute; inset:0; width:100%; height:100%; display:block; user-select:none; -webkit-user-drag:none; }
.wb__fx{ position:absolute; inset:0; isolation:isolate; pointer-events:none; }
/* the badge shapes are clipped so no light spills past the edge */
.wb--diamond .wb__fx{ clip-path:polygon(50% 2.6%,97.3% 50%,50% 97.4%,2.7% 50%); }

/* twinkling blue-white lights (bokeh) */
.wb__g{ position:absolute; left:calc(var(--x)*1%); top:calc(var(--y)*1%); width:7.5%; aspect-ratio:1; transform:translate(-50%,-50%); border-radius:50%;
  background:radial-gradient(circle,rgba(255,255,255,.95) 0%,rgba(150,225,255,.75) 22%,rgba(60,170,255,.3) 50%,rgba(60,170,255,0) 72%);
  mix-blend-mode:screen; opacity:0; animation:wb-glow var(--p) ease-in-out var(--d) infinite; }
.wb--wide .wb__g{ width:4.6%; }
@keyframes wb-glow{ 0%,100%{opacity:0;transform:translate(-50%,-50%) scale(.6)} 35%{opacity:.95;transform:translate(-50%,-50%) scale(1.1)} 62%{opacity:.25;transform:translate(-50%,-50%) scale(.8)} 80%{opacity:.8;transform:translate(-50%,-50%) scale(1.05)} }

/* each snowflake fades in and out on its own timing: dims into the blue, then brightens to white (opacity only, so it stays smooth) */
.wb__f{ position:absolute; }
.wb__f img{ position:absolute; inset:0; width:100%; height:100%; display:block; opacity:0; }
.wb__fd{ animation:wb-fd var(--p) ease-in-out var(--d) infinite; }
.wb__fw{ animation:wb-fw var(--p) ease-in-out var(--d) infinite; }
@keyframes wb-fd{ 0%,100%{opacity:.5} 45%{opacity:0} 70%{opacity:0} }
@keyframes wb-fw{ 0%,100%{opacity:0} 45%{opacity:.85} 70%{opacity:.3} }
/* some flakes also swell a little bigger and settle back to their true size; others fade almost out and back */
.wb__f--grow{ animation:wb-grow var(--p) ease-in-out var(--d) infinite; }
@keyframes wb-grow{ 0%,100%{transform:scale(1)} 45%{transform:scale(1.09)} }
.wb__f--fade .wb__fd{ animation-name:wb-fd2 } .wb__f--fade .wb__fw{ animation-name:wb-fw2 }
@keyframes wb-fd2{ 0%,100%{opacity:.85} 50%{opacity:0} }
@keyframes wb-fw2{ 0%,100%{opacity:0} 50%{opacity:.6} }

/* four-point sparkles on the snowflakes */
.wb__s{ position:absolute; left:calc(var(--x)*1%); top:calc(var(--y)*1%); width:calc(var(--z,7)*1%); aspect-ratio:1; transform:translate(-50%,-50%) scale(0); opacity:0; background:#fff;
  clip-path:polygon(50% 0,58% 42%,100% 50%,58% 58%,50% 100%,42% 58%,0 50%,42% 42%); filter:drop-shadow(0 0 5px #bfeaff); animation:wb-spark var(--q,6s) ease-in-out var(--d) infinite; }
@keyframes wb-spark{ 0%,55%,100%{opacity:0;transform:translate(-50%,-50%) scale(0) rotate(0)} 70%{opacity:1;transform:translate(-50%,-50%) scale(1) rotate(30deg)} 86%{opacity:0;transform:translate(-50%,-50%) scale(.3) rotate(60deg)} }

/* 25% OFF: small pulse with a soft glow */
.wb__offer{ position:absolute; transform-origin:50% 55%; animation:wb-pulse 6s ease-in-out infinite; }
@keyframes wb-pulse{ 0%,34%,100%{transform:scale(1);filter:none} 12%{transform:scale(1.07);filter:drop-shadow(0 0 1cqw rgba(170,230,255,.9))} 22%{transform:scale(1);filter:none} 28%{transform:scale(1.03);filter:drop-shadow(0 0 .5cqw rgba(170,230,255,.5))} }

/* GET A FREE QUOTE: pulse, glow and a shine across */
.wb__cta{ position:absolute; transform-origin:50% 50%; animation:wb-cta 6s ease-in-out -3s infinite; }
.wb__cta img{ position:absolute; inset:0; width:100%; height:100%; display:block; }
@keyframes wb-cta{ 0%,40%,100%{transform:scale(1);filter:none} 14%{transform:scale(1.07);filter:drop-shadow(0 0 1.4cqw rgba(255,255,255,.95))} 26%{transform:scale(1)} }
.wb__shine{ position:absolute; inset:0; overflow:hidden; }
.wb__shine::after{ content:""; position:absolute; top:-20%; bottom:-20%; left:0; width:30%; background:linear-gradient(100deg,rgba(255,255,255,0),rgba(120,200,255,.65),rgba(255,255,255,0)); transform:translateX(-140%) skewX(-18deg); animation:wb-shine 6s ease-in-out -3s infinite; }
@keyframes wb-shine{ 0%,12%{transform:translateX(-140%) skewX(-18deg)} 34%,100%{transform:translateX(440%) skewX(-18deg)} }

@media (prefers-reduced-motion:reduce){ .wb__link{ animation:none } .wb__fd,.wb__fw,.wb__f,.wb__g,.wb__s,.wb__offer,.wb__cta,.wb__shine::after{ animation:none } .wb__g,.wb__s{ display:none } }
