/* Battery storage scroll sequence */
.wbpp {
  /* Settings you might want to tweak */
  --wbpp-length: 800vh;        /* total scroll distance; bigger = slower playback */
  --wbpp-offset: 0px;          /* height of a sticky/fixed site header, if the theme has one */
  --wbpp-teal: #41908f;
  --wbpp-teal-light: #1ec1cb;
  --wbpp-ink: #1c1c28;
  --wbpp-white: #ffffff;
  --wbpp-mist: rgba(255, 255, 255, 0.86);
  --wbpp-sb: 0px;              /* set by script: scrollbar width, for true full-bleed */

  position: relative;
  height: var(--wbpp-length);
  width: calc(100vw - var(--wbpp-sb));
  max-width: none;
  margin: 0 0 0 calc(50% - 50vw + var(--wbpp-sb) / 2);
  padding: 0;
  background: var(--wbpp-ink);
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--wbpp-white);
}
.wbpp *, .wbpp *::before, .wbpp *::after { box-sizing: border-box; }

.wbpp__sticky {
  position: sticky;
  top: var(--wbpp-offset);
  height: calc(100vh - var(--wbpp-offset));
  height: calc(100svh - var(--wbpp-offset));
  overflow: hidden;
}
/* First frame as a still: shows while the frames load, in the editor and without script */
.wbpp__poster {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.wbpp__canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
}
.wbpp__scrim {
  position: absolute; inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 60% at 0% 100%, rgba(28, 28, 40, 0.72) 0%, rgba(28, 28, 40, 0) 70%),
    linear-gradient(to left, rgba(28, 28, 40, 0.55) 0%, rgba(28, 28, 40, 0) 22%);
}

/* Copy panels */
.wbpp__panels {
  position: absolute;
  left: clamp(20px, 5vw, 80px);
  bottom: clamp(28px, 8vh, 96px);
  width: min(36rem, calc(100% - 300px));
}
.wbpp__panel {
  position: absolute; left: 0; bottom: 0;
  width: 100%;
  padding: clamp(20px, 2.2vw, 32px);
  border-radius: 14px;
  /* Same dark tinted glass as the hero card, for readable text over bright scenes */
  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);
  opacity: 0;
  visibility: hidden;
}
.wbpp__panel.is-active { visibility: visible; }
.wbpp .wbpp__hl { color: var(--wbpp-teal-light); }
/* Words and lines are animated by the script as you scroll */
.wbpp__w { display: inline-block; }
/* A word and any punctuation touching it stay together on one line */
.wbpp__g { display: inline-block; white-space: nowrap; }
.wbpp .wbpp__title {
  margin: 0;
  font-size: var(--ww-fs-h2);
  line-height: 1.08;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--wbpp-white);
}
.wbpp .wbpp__step {
  margin: 0 0 0.6em;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--wbpp-teal-light);
}
.wbpp .wbpp__text {
  margin: 0;
  font-size: clamp(21px, 2vw, 32px);
  line-height: 1.25;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--wbpp-white);
}
.wbpp .wbpp__hint {
  display: flex; align-items: center; gap: 12px;
  margin: 1.1em 0 0;
  font-size: 15px;
  color: var(--wbpp-mist);
}
.wbpp__hint-line {
  position: relative;
  width: 2px; height: 26px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 2px;
  overflow: hidden;
}
.wbpp__hint-line::after {
  content: ""; position: absolute; left: 0; top: -40%;
  width: 100%; height: 40%;
  background: var(--wbpp-teal-light);
  animation: wbpp-hint 1.8s ease-in-out infinite;
}
@keyframes wbpp-hint { to { top: 100%; } }

.wbpp .wbpp__cta {
  display: inline-block;
  margin-top: 1.2em;
  padding: 0.75em 1.5em;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--wbpp-teal-light), var(--wbpp-teal));
  color: var(--wbpp-white);
  font-size: 15px; font-weight: 600;
  text-decoration: none;
  box-shadow: 0 6px 20px rgba(30, 193, 203, 0.28);
  transition: filter 0.2s ease;
}
.wbpp .wbpp__cta:hover { filter: brightness(1.08); }

/* Timeline rail */
.wbpp__rail {
  position: absolute;
  right: clamp(20px, 3.5vw, 56px);
  top: 50%;
  transform: translateY(-50%);
  height: min(52vh, 420px);
  padding: 18px 18px 18px 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);
}
.wbpp__track {
  position: absolute; right: 23px; top: 24px; bottom: 24px;
  width: 2px;
  background: rgba(255, 255, 255, 0.22);
  border-radius: 2px;
}
.wbpp__fill {
  width: 100%; height: 0%;
  background: var(--wbpp-teal-light);
  border-radius: 2px;
}
.wbpp .wbpp__stops {
  position: relative;
  height: 100%;
  margin: 0; padding: 0;
  list-style: none;
  display: flex; flex-direction: column; justify-content: space-between;
}
.wbpp .wbpp__stops li { margin: 0; padding: 0; line-height: 1; }
.wbpp .wbpp__stops button {
  display: flex; align-items: center; justify-content: flex-end; gap: 14px;
  width: 100%;
  margin: 0; padding: 0; border: 0;
  background: none;
  font: 500 14px/1 "Poppins", system-ui, sans-serif;
  color: rgba(255, 255, 255, 0.62);
  cursor: pointer;
  text-align: right;
  transition: color 0.25s ease;
}
.wbpp .wbpp__label { display: block; line-height: 1.3; white-space: nowrap; }
.wbpp .wbpp__stops button::after {
  content: "";
  flex: none;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--wbpp-ink);
  border: 2px solid rgba(255, 255, 255, 0.55);
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}
.wbpp .wbpp__stops button:hover { color: var(--wbpp-white); }
.wbpp .wbpp__stops button.is-passed::after { border-color: var(--wbpp-teal-light); background: var(--wbpp-teal); }
.wbpp .wbpp__stops button[aria-current="step"] { color: var(--wbpp-white); }
.wbpp .wbpp__stops button[aria-current="step"]::after {
  background: var(--wbpp-teal-light);
  border-color: var(--wbpp-teal-light);
  transform: scale(1.25);
  box-shadow: 0 0 0 5px rgba(30, 193, 203, 0.22), 0 0 16px rgba(30, 193, 203, 0.9);
}
.wbpp .wbpp__stops button:focus-visible,
.wbpp .wbpp__cta:focus-visible {
  outline: 2px solid var(--wbpp-teal-light);
  outline-offset: 4px;
  border-radius: 6px;
}

/* Loading bar */
.wbpp__loader {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  transition: opacity 0.6s ease;
}
.wbpp__loader-bar { height: 100%; width: 0%; background: var(--wbpp-teal-light); transition: width 0.2s linear; }
.wbpp__loader.is-done { opacity: 0; }

@media (max-width: 900px) {
  .wbpp__panels { width: calc(100% - 40px); }
  .wbpp__panel { background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0) 45%), rgba(28, 28, 40, 0.72); }
  .wbpp .wbpp__stops button { font-size: 0; gap: 0; }
  .wbpp__rail { right: 14px; height: min(40vh, 300px); padding: 14px 10px; }
  .wbpp__track { right: 15px; top: 20px; bottom: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .wbpp__hint-line::after { animation: none; top: 30%; }
}

/* ==========================================================
   Bottom bar layout (block setting "Timeline layout": Bottom bar)
   Everything below only applies with .wbpp--bar, so the original
   side rail layout is unchanged.
   ========================================================== */
.wbpp--bar .wbpp__scrim {
  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%);
}
.wbpp--bar .wbpp__panels {
  left: clamp(20px, 5vw, 80px);
  right: auto;
  top: 0; bottom: 0;
  width: min(32rem, 38%);
}
.wbpp--bar .wbpp__panel { top: 50%; bottom: auto; transform: translateY(-50%); }

/* The bar sits on the same dark glass as the cards */
.wbpp--bar .wbpp__rail {
  top: auto; right: auto;
  left: 50%;
  bottom: clamp(20px, 5vh, 44px);
  transform: translateX(-50%);
  width: min(960px, calc(100% - 48px));
  height: auto;
  padding: 12px 20px 8px;
  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);
}
.wbpp--bar .wbpp__track { display: none; }
.wbpp--bar .wbpp__stops { flex-direction: row; gap: 12px; height: auto; counter-reset: wbpp; }
.wbpp--bar .wbpp__stops li { flex: 1 1 0; min-width: 0; }
.wbpp--bar .wbpp__stops button {
  flex-direction: column; align-items: stretch; justify-content: flex-start;
  gap: 10px;
  min-height: 44px;
  padding-top: 6px;
  text-align: left;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.72);
  counter-increment: wbpp;
}
.wbpp--bar .wbpp__stops button::after { display: none; }
.wbpp--bar .wbpp__stops button::before {
  content: "";
  display: block;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--wbpp-teal-light) 0 calc(var(--seg, 0) * 100%), rgba(255, 255, 255, 0.22) calc(var(--seg, 0) * 100%) 100%);
}
.wbpp--bar .wbpp__label { white-space: normal; }
.wbpp--bar .wbpp__label::before { content: counter(wbpp) " "; color: var(--wbpp-teal-light); }
.wbpp--bar .wbpp__stops button[aria-current="step"],
.wbpp--bar .wbpp__stops button:hover { color: var(--wbpp-white); }

/* Mobile: video on top, bar over the bottom of the video, card below */
@media (max-width: 900px) {
  /* Video takes up to 62% of the screen, but always leaves at least 340px for the card */
  .wbpp--bar { --wbpp-stage: min(62%, calc(100% - 340px)); }
  .wbpp--bar .wbpp__poster,
  .wbpp--bar .wbpp__canvas { bottom: auto; height: var(--wbpp-stage); }
  .wbpp--bar .wbpp__scrim {
    inset: 0 0 auto 0;
    height: var(--wbpp-stage);
    background: linear-gradient(to top, var(--wbpp-ink) 0%, rgba(28, 28, 40, 0) 30%);
  }
  .wbpp--bar .wbpp__rail {
    top: calc(var(--wbpp-stage) - 46px); bottom: auto;
    right: auto;
    width: calc(100% - 40px);
    height: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .wbpp--bar .wbpp__stops { gap: 8px; }
  .wbpp--bar .wbpp__stops button { font-size: 0; gap: 0; padding-top: 0; justify-content: center; }
  .wbpp--bar .wbpp__panels {
    top: calc(var(--wbpp-stage) + 32px); bottom: 16px;
    left: 20px; right: 20px;
    width: auto;
  }
  .wbpp--bar .wbpp__panel { top: 0; transform: none; }
  /* The loading line along the bottom edge isn't needed here */
  .wbpp--bar .wbpp__loader { display: none; }
}
/* Product animations: frames fitted to the height, centred on the page colour */
.wbpp--contain .wbpp__poster { object-fit: contain; background: var(--wbpp-ink); }

/* Product animations: below the fixed site header and clear of the bottom bar, so the product is never hidden */
.wbpp--contain { --wbpp-head: calc(80px + env(safe-area-inset-top, 0px)); }
.wbpp--contain .wbpp__poster,
.wbpp--contain .wbpp__canvas { top: var(--wbpp-head); bottom: auto; height: calc(100% - var(--wbpp-head)); }
.wbpp--bar.wbpp--contain .wbpp__poster,
.wbpp--bar.wbpp--contain .wbpp__canvas { height: calc(100% - var(--wbpp-head) - clamp(20px, 5vh, 44px) - 88px); }
@media (max-width: 900px) {
  .wbpp--contain { --wbpp-head: calc(68px + env(safe-area-inset-top, 0px)); }
  .wbpp--bar.wbpp--contain { --wbpp-stage: calc(100% - 280px); }
  .wbpp--bar.wbpp--contain .wbpp__poster,
  .wbpp--bar.wbpp--contain .wbpp__canvas { height: calc(var(--wbpp-stage) - var(--wbpp-head)); }
  .wbpp--bar.wbpp--contain .wbpp__scrim { display: none; }
  .wbpp--bar.wbpp--contain .wbpp__rail { top: calc(var(--wbpp-stage) + 6px); }
  .wbpp--bar.wbpp--contain .wbpp__panels { top: calc(var(--wbpp-stage) + 44px); }
}

/* Mobile, bottom bar: the current step's title, full width under the bar (as on the product page slides) */
@media (max-width: 900px) {
  .wbpp--bar { --wbpp-stage: min(62%, calc(100% - 368px)); }
  .wbpp--bar .wbpp__stops button[aria-current="step"] .wbpp__label {
    position: absolute; left: 0; right: 0; top: calc(100% + 8px);
    font-size: 16px; font-weight: 500; line-height: 1.3;
    color: var(--wbpp-white); text-align: left; white-space: normal;
    pointer-events: none;
  }
  .wbpp--bar .wbpp__label br { display: none; }
  .wbpp--bar .wbpp__panels { top: calc(var(--wbpp-stage) + 60px); }
}
/* Mobile, bottom bar: pin the animation under the header rather than at the very top of the screen */
@media (max-width: 900px) {
  .wbpp--bar { --wbpp-offset: calc(68px + env(safe-area-inset-top, 0px)); }
}

/* ==========================================================
   Performance: .wbpp--fix is on by default, .wbpp--lite is added
   by view.js when the browser can't keep up (see view.js).
   ========================================================== */
.wbpp--fix .wbpp__hint-line::after {
  top: -40%;
  animation-name: wbpp-hint-t;
  will-change: transform;
}
@keyframes wbpp-hint-t { from { transform: translateY(0); } to { transform: translateY(350%); } }
@media (prefers-reduced-motion: reduce) {
  .wbpp--fix .wbpp__hint-line::after { animation: none; top: 30%; }
}
@media (min-width: 901px) {
  .wbpp--lite .wbpp__panel,
  .wbpp--lite .wbpp__rail { -webkit-backdrop-filter: none; backdrop-filter: none; }
  .wbpp--lite .wbpp__panel {
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0) 45%),
      rgba(28, 28, 40, 0.8);
  }
  .wbpp--lite .wbpp__rail { background: rgba(28, 28, 40, 0.74); }
}
