/* Feature slides: full-screen slides that crossfade on a timer */
.wwfs {
  /* Settings you might want to tweak */
  --wwfs-fade: 0.9s;                                      /* crossfade between slides */
  --wwfs-head: calc(80px + env(safe-area-inset-top, 0px)); /* fixed site header */
  --wwfs-barb: clamp(20px, 5vh, 44px);                     /* gap under the tabs */
  --wwfs-barh: 88px;                                       /* room kept for the tabs */
  --wwfs-teal: #41908f;
  --wwfs-teal-light: #1ec1cb;
  --wwfs-ink: #1c1c28;
  --wwfs-sb: 0px;                                          /* set by script: scrollbar width */

  position: relative;
  width: calc(100vw - var(--wwfs-sb));
  max-width: none;
  margin: 0 0 0 calc(50% - 50vw + var(--wwfs-sb) / 2);
  padding: 0;
  background: var(--wwfs-ink);
  font-family: var(--ww-font, "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif);
  color: #fff;
}
.wwfs *, .wwfs *::before, .wwfs *::after { box-sizing: border-box; }
.wwfs__stage { position: relative; height: 100vh; height: 100svh; min-height: 560px; overflow: hidden; }

/* Slides */
.wwfs__slide {
  position: absolute; inset: 0;
  opacity: 0; visibility: hidden;
  transition: opacity var(--wwfs-fade) ease, visibility 0s linear var(--wwfs-fade);
}
.wwfs__slide.is-active { opacity: 1; visibility: visible; transition: opacity var(--wwfs-fade) ease, visibility 0s; }
.wwfs__slide picture { display: contents; }
.wwfs__media { display: block; }
/* Scenes and photos fill the screen, with a slow drift so stills feel alive */
.wwfs__slide--cover .wwfs__media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.wwfs__slide--cover.is-active img.wwfs__media { animation: wwfs-drift var(--wwfs-dur, 6s) linear both; }
@keyframes wwfs-drift { from { transform: scale(1.05); } to { transform: scale(1); } }
.wwfs.is-paused .wwfs__media { animation-play-state: paused; }
/* Floating products and close-ups: fitted between the header and the tabs */
.wwfs__slide--float .wwfs__media,
.wwfs__slide--contain .wwfs__media {
  position: absolute;
  left: 50%; top: var(--wwfs-head);
  height: calc(100% - var(--wwfs-head) - var(--wwfs-barb) - var(--wwfs-barh));
  width: auto; max-width: none;
  transform: translateX(-50%);
}
/* Each new product rises gently into place, then floats */
.wwfs__slide--float .wwfs__media { will-change: translate; }
.wwfs__slide--float.is-active .wwfs__media { animation: wwfs-rise 1s cubic-bezier(0.2, 0.7, 0.2, 1) both, wwfs-bob 7s ease-in-out 1s infinite; }
.wwfs__slide--contain.is-active .wwfs__media { animation: wwfs-rise 1s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
@keyframes wwfs-rise { from { translate: 0 14px; } to { translate: 0 0; } }
@keyframes wwfs-bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -10px; } }
/* Close-ups that run off the edge of the frame fade into the backdrop */
.wwfs__slide--contain .wwfs__media {
  position: absolute;
  left: 50%; top: var(--wwfs-head);
  height: calc(100% - var(--wwfs-head) - var(--wwfs-barb) - var(--wwfs-barh));
  width: auto; max-width: none;
  transform: translateX(-50%);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent), linear-gradient(transparent, #000 6%, #000 94%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent), linear-gradient(transparent, #000 6%, #000 94%, transparent);
  mask-composite: intersect;
}

.wwfs__scrim {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(to right, rgba(28, 28, 40, 0.62) 0%, rgba(28, 28, 40, 0) 42%),
    linear-gradient(to top, rgba(28, 28, 40, 0.6) 0%, rgba(28, 28, 40, 0) 20%);
}
.wwfs--cards-right .wwfs__scrim {
  background:
    linear-gradient(to left, rgba(28, 28, 40, 0.62) 0%, rgba(28, 28, 40, 0) 42%),
    linear-gradient(to top, rgba(28, 28, 40, 0.6) 0%, rgba(28, 28, 40, 0) 20%);
}

/* Cards */
.wwfs__cards { position: absolute; top: 0; bottom: 0; left: clamp(20px, 5vw, 80px); width: min(32rem, 38%); }
.wwfs--cards-right .wwfs__cards { left: auto; right: clamp(20px, 5vw, 80px); }
.wwfs__card {
  position: absolute; left: 0; right: 0; top: 50%;
  transform: translateY(-50%);
  padding: clamp(20px, 2.2vw, 32px);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0) 45%), rgba(28, 28, 40, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.18);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  backdrop-filter: blur(14px) saturate(1.1);
}
.wwfs__card[hidden] { display: none; }
.wwfs__card.is-active { animation: wwfs-in 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
@keyframes wwfs-in { from { opacity: 0; transform: translateY(calc(-50% + 16px)); } to { opacity: 1; transform: translateY(-50%); } }
.wwfs .wwfs__num { margin: 0 0 0.6em; font-size: 14px; font-weight: 500; letter-spacing: 0.02em; color: var(--wwfs-teal-light); }
.wwfs .wwfs__text { margin: 0; font-size: clamp(21px, 2vw, 32px); line-height: 1.25; font-weight: 500; letter-spacing: -0.01em; color: #fff; }
.wwfs .wwfs__hl { color: var(--wwfs-teal-light); }
.wwfs .wwfs__cta { margin-top: 1.2em; }

/* Tabs along the bottom, on glass */
.wwfs__bar {
  position: absolute; left: 50%; bottom: var(--wwfs-barb);
  transform: translateX(-50%);
  width: min(960px, calc(100% - 48px));
  display: flex; align-items: center; gap: 16px;
  padding: 12px 12px 8px 20px;
  border-radius: 14px;
  background: rgba(28, 28, 40, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.12);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.wwfs__tabs { flex: 1; min-width: 0; display: flex; gap: 12px; }
.wwfs .wwfs__tab {
  flex: 1 1 0; min-width: 0;
  display: flex; flex-direction: column; gap: 10px;
  min-height: 44px; margin: 0; padding: 6px 0 0;
  border: 0; background: none; cursor: pointer; text-align: left;
  font: 500 13px/1.3 var(--ww-font, "Poppins", system-ui, sans-serif);
  color: rgba(255, 255, 255, 0.72);
  transition: color 0.25s ease;
}
.wwfs .wwfs__tab:hover, .wwfs .wwfs__tab[aria-selected="true"] { color: #fff; }
.wwfs__line { display: block; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.22); overflow: hidden; }
.wwfs__line span { display: block; width: 100%; height: 100%; background: var(--wwfs-teal-light); transform-origin: left center; transform: scaleX(0); }
.wwfs__tab.is-done .wwfs__line span { transform: scaleX(1); }
/* The current tab's line is the slide timer */
.wwfs__tab[aria-selected="true"] .wwfs__line span { animation: wwfs-fill var(--wwfs-dur, 6s) linear forwards; }
.wwfs.is-paused .wwfs__tab[aria-selected="true"] .wwfs__line span { animation-play-state: paused; }
.wwfs.is-still .wwfs__tab[aria-selected="true"] .wwfs__line span { animation: none; transform: scaleX(1); }
@keyframes wwfs-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.wwfs__n { color: var(--wwfs-teal-light); }
.wwfs .wwfs__tab:focus-visible, .wwfs .wwfs__cta:focus-visible { outline: 2px solid var(--wwfs-teal-light); outline-offset: 4px; border-radius: 6px; }

/* Mobile: image on top, tabs under it, card below */
@media (max-width: 900px) {
  .wwfs { --wwfs-head: calc(68px + env(safe-area-inset-top, 0px)); --wwfs-stage: calc(100% - 310px); }
  .wwfs__slide--cover .wwfs__media { inset: 0 0 auto 0; height: var(--wwfs-stage); }
  .wwfs__slide--float .wwfs__media, .wwfs__slide--contain .wwfs__media { height: calc(var(--wwfs-stage) - var(--wwfs-head)); }
  .wwfs__scrim, .wwfs--cards-right .wwfs__scrim { inset: 0 0 auto 0; height: var(--wwfs-stage); background: linear-gradient(to top, var(--wwfs-ink) 0%, rgba(28, 28, 40, 0) 30%); }
  .wwfs__bar {
    top: calc(var(--wwfs-stage) + 6px); bottom: auto;
    width: calc(100% - 40px); padding: 0; gap: 12px;
    background: none; border: 0; border-radius: 0;
    -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  .wwfs__tabs { gap: 8px; }
  .wwfs .wwfs__tab { font-size: 0; gap: 0; padding: 0; justify-content: center; }
  .wwfs__cards, .wwfs--cards-right .wwfs__cards { top: calc(var(--wwfs-stage) + 92px); bottom: 16px; left: 20px; right: 20px; width: auto; }
  .wwfs__card { top: 0; transform: none; background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0) 45%), rgba(28, 28, 40, 0.72); }
  .wwfs__card.is-active { animation-name: wwfs-in-m; }
  @keyframes wwfs-in-m { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) {
  .wwfs { --wwfs-fade: 0.01s; }
  .wwfs__slide.is-active .wwfs__media, .wwfs__card.is-active, .wwfs__backdrop::before { animation: none !important; }
}
/* Backdrop behind every slide */
.wwfs__backdrop { position: absolute; inset: 0; background: var(--wwfs-ink); }
.wwfs__backdrop img, .wwfs__backdrop video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
/* Studio glow: soft teal light behind the product and a faint floor, fading to the page colour at every edge */
.wwfs--bd-studio .wwfs__backdrop {
  background:
    radial-gradient(ellipse 46% 9% at 50% 80%, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0) 70%),
    linear-gradient(180deg, var(--wwfs-ink) 0%, #20212f 55%, #1f2030 75%, var(--wwfs-ink) 100%);
}
.wwfs--bd-studio .wwfs__backdrop::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse 26% 40% at 50% 50%, rgba(30, 193, 203, 0.34), rgba(30, 193, 203, 0) 72%);
}

/* Mobile: the current slide's title, under the tabs */
.wwfs__current { display: none; }
@media (max-width: 900px) {
  .wwfs .wwfs__current {
    display: block;
    position: absolute; left: 20px; right: 20px; top: calc(var(--wwfs-stage) + 54px);
    margin: 0; font-size: 16px; font-weight: 500; line-height: 1.3; color: #fff;
  }
  .wwfs--bd-studio .wwfs__backdrop::before { background: radial-gradient(ellipse 60% 26% at 50% 34%, rgba(30, 193, 203, 0.34), rgba(30, 193, 203, 0) 72%); }
  .wwfs--bd-studio .wwfs__backdrop { background: radial-gradient(ellipse 70% 6% at 50% 58%, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0) 70%), var(--wwfs-ink); }
}
/* Leave sideways swipes to the slides, upright swipes still scroll the page */
.wwfs__stage { touch-action: pan-y; }
.wwfs { overscroll-behavior-x: none; }

/* Floating products: scaled up into the space between the header and the tabs, centred on it.
   Their transparent margins let them grow without the product itself running into either. */
.wwfs { --wwfs-zoom: 1.2; --wwfs-avail: calc(100% - var(--wwfs-head) - var(--wwfs-barb) - var(--wwfs-barh)); }
.wwfs .wwfs__slide--float .wwfs__media {
  height: calc(var(--wwfs-avail) * var(--wwfs-zoom));
  top: calc(var(--wwfs-head) + var(--wwfs-avail) * (1 - var(--wwfs-zoom)) / 2);
}
@media (max-width: 900px) {
  .wwfs { --wwfs-avail: calc(var(--wwfs-stage) - var(--wwfs-head)); }
  .wwfs .wwfs__slide--float .wwfs__media {
    height: calc(var(--wwfs-avail) * var(--wwfs-zoom));
    top: calc(var(--wwfs-head) + var(--wwfs-avail) * (1 - var(--wwfs-zoom)) / 2);
  }
}
/* Logged in: the WordPress toolbar pushes the page down, so the slides are made that much shorter to keep the tabs on screen */
.admin-bar .wwfs__stage { height: calc(100vh - 32px); height: calc(100svh - 32px); }
@media (max-width: 782px) {
  .admin-bar .wwfs__stage { height: calc(100vh - 46px); height: calc(100svh - 46px); }
}
/* Centre the product itself (not the whole image) in the open space, so the gap above it matches the gap below.
   --wwfs-pc is where the product's middle sits in the transparent images: 0.517 = just below halfway. */
.wwfs {
  --wwfs-pc: 0.517;
  --wwfs-barcard: 56px;  /* height of the glass tab bar */
  --wwfs-mid: calc((100% + var(--wwfs-head) - var(--wwfs-barb) - var(--wwfs-barcard)) / 2);
}
.wwfs .wwfs__slide--float .wwfs__media { top: calc(var(--wwfs-mid) - var(--wwfs-pc) * var(--wwfs-avail) * var(--wwfs-zoom)); }
/* The glow sits behind the product's middle */
.wwfs--bd-studio .wwfs__backdrop::before { background: radial-gradient(ellipse 26% 40% at 50% var(--wwfs-mid), rgba(30, 193, 203, 0.34), rgba(30, 193, 203, 0) 72%); }
@media (max-width: 900px) {
  .wwfs { --wwfs-mid: calc((var(--wwfs-head) + var(--wwfs-stage)) / 2); }
  .wwfs .wwfs__slide--float .wwfs__media { top: calc(var(--wwfs-mid) - var(--wwfs-pc) * var(--wwfs-avail) * var(--wwfs-zoom)); }
  .wwfs--bd-studio .wwfs__backdrop::before { background: radial-gradient(ellipse 60% 26% at 50% var(--wwfs-mid), rgba(30, 193, 203, 0.34), rgba(30, 193, 203, 0) 72%); }
}
/* Desktop: the shading behind the card fades across when a slide puts its card on the other side */
@media (min-width: 901px) {
  .wwfs .wwfs__scrim, .wwfs.wwfs--cards-right .wwfs__scrim { background: linear-gradient(to top, rgba(28, 28, 40, 0.6) 0%, rgba(28, 28, 40, 0) 20%); }
  .wwfs__scrim::before, .wwfs__scrim::after { content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity var(--wwfs-fade) ease; }
  .wwfs__scrim::before { background: linear-gradient(to right, rgba(28, 28, 40, 0.62) 0%, rgba(28, 28, 40, 0) 42%); }
  .wwfs__scrim::after { background: linear-gradient(to left, rgba(28, 28, 40, 0.62) 0%, rgba(28, 28, 40, 0) 42%); }
  .wwfs--cards-left .wwfs__scrim::before, .wwfs--cards-right .wwfs__scrim::after { opacity: 1; }
}
/* Card text animation, matching the homepage explainer: the old card's words lift away and blur out,
   then the new card fades in and its words rise into place one after another */
.wwfs__w { display: inline-block; }
.wwfs__card.is-active { animation-duration: 0.5s; animation-delay: 0.3s; }
.wwfs__card.is-active .wwfs__tok { animation: wwfs-tok-in 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) both; animation-delay: calc(0.38s + var(--i, 0) * 45ms); }
.wwfs__card.is-leaving { animation: wwfs-card-out 0.18s ease 0.1s both; }
.wwfs__card.is-leaving .wwfs__tok { animation: wwfs-tok-out 0.2s ease both; animation-delay: calc(var(--r, 0) * 4ms); }
@keyframes wwfs-tok-in { from { opacity: 0; transform: translateY(0.6em); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes wwfs-tok-out { to { opacity: 0; transform: translateY(-0.45em); filter: blur(4px); } }
@keyframes wwfs-card-out { to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .wwfs__card.is-active .wwfs__tok, .wwfs__card.is-leaving, .wwfs__card.is-leaving .wwfs__tok { animation: none !important; }
  .wwfs__card.is-leaving { display: none; }
}
.wwfs__g { display: inline-block; white-space: nowrap; }
@media (max-width: 900px) {
  .wwfs--bd-studio .wwfs__backdrop { background: var(--wwfs-ink); }
}

/* Until the script has prepared the card text, keep the first card hidden. If the script never runs, it fades in after a moment anyway. */
.wwfs:not(.is-ready) .wwfs__card { animation: wwfs-nojs 0.4s ease 2.5s both !important; }
@keyframes wwfs-nojs { from { opacity: 0; } to { opacity: 1; } }
/* Desktop: each card keeps to its own side, so a card that is leaving stays where it was
   instead of jumping across when the next slide puts its card on the other side */
@media (min-width: 901px) {
  .wwfs .wwfs__cards, .wwfs.wwfs--cards-right .wwfs__cards { left: 0; right: 0; width: auto; pointer-events: none; }
  .wwfs .wwfs__card { pointer-events: auto; width: min(32rem, 38%); }
  .wwfs .wwfs__card[data-side="left"] { left: clamp(20px, 5vw, 80px); right: auto; }
  .wwfs .wwfs__card[data-side="right"] { left: auto; right: clamp(20px, 5vw, 80px); }
}
/* Desktop: the tab bar runs the width of the page content, with larger titles */
@media (min-width: 901px) {
  .wwfs .wwfs__bar { width: min(var(--ww-max, 1245px), 100% - var(--ww-gutter, 24px) * 2); }
  .wwfs .wwfs__tabs { gap: 16px; }
  .wwfs .wwfs__tab { font-size: 15px; }
  .wwfs { --wwfs-barcard: 60px; --wwfs-barb: clamp(36px, 6vh, 64px); }
}
/* Page heading: read by search engines and screen readers, not shown on screen */
.wwfs .wwfs__h1 { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

/* Wide products (heat pump, light switch): the image box is never wider than the open space,
   and the image is fitted inside it, so landscape products sit beside the card instead of under it */
.wwfs .wwfs__slide--float .wwfs__media { max-width: min(46vw, 100% - 48px); object-fit: contain; }
@media (max-width: 900px) {
  .wwfs .wwfs__slide--float .wwfs__media { max-width: calc(100% - 40px); }
}