/* =====================================================================
   ENVSonic motion kit: reveal, count-up, hero drift, overlay graphics,
   layered media, background-video control, ticker strip.
   The runtime is assets/js/motion.js; markup comes from envs-core
   (inc/motion.php and the envs/marquee block). Everything animated sits
   behind prefers-reduced-motion: no-preference; the default state is still.
   ===================================================================== */

:root {
  --envs-ease-out: cubic-bezier(.2, .7, .2, 1);
}

/* Entrances push content sideways for a moment; never let that scroll the page. */
main { overflow-x: clip; }

/* ---------------------------------------------------------------------
   Reveal on scroll (the runtime only tags elements that start off screen)
   --------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  [data-reveal] {
    transition: opacity .8s var(--envs-ease-out), transform .9s var(--envs-ease-out);
    transition-delay: var(--envs-d, 0ms);
  }
  [data-reveal]:not(.is-in) { opacity: 0; }
  [data-reveal="fade-up"]:not(.is-in) { transform: translate3d(0, 32px, 0); }
  [data-reveal="scale"]:not(.is-in) { transform: scale(.94); }
  [data-reveal="slide-left"]:not(.is-in) { transform: translate3d(56px, 0, 0); }
  [data-reveal="slide-right"]:not(.is-in) { transform: translate3d(-56px, 0, 0); }

  /* Count-up stats wait at their start value; shown after 2.5 s whatever happens. */
  .envs-js [data-envs-count]:not(.is-armed):not(.is-counted) {
    visibility: hidden;
    animation: envs-show 0s 2.5s forwards;
  }

  /* Home hero: the photograph settles in, then drifts with the scroll (runtime). */
  .envs-motion-auto [data-envs-hero] > .wp-block-cover__image-background {
    animation: envs-settle 2.8s var(--envs-ease-out) both;
  }
}
@keyframes envs-show { to { visibility: visible; } }
@keyframes envs-settle { from { scale: 1.08; } to { scale: 1; } }

.is-armed { font-variant-numeric: tabular-nums; }

@media print {
  [data-reveal] { opacity: 1 !important; transform: none !important; }
}

/* ---------------------------------------------------------------------
   Overlay graphics: .envs-fx inside a cover, group or image
   --------------------------------------------------------------------- */
.has-envs-fx { position: relative; isolation: isolate; }
:where(.has-envs-fx:not(.wp-block-cover)) > :where(:not(.envs-fx)) { position: relative; z-index: 1; }
.wp-block-image.has-envs-fx { overflow: hidden; }

.envs-fx {
  --fx-x: 50%;
  --fx-y: 50%;
  --fx-size: min(1100px, 150vw);
  --fx-color: 27, 166, 220;
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}
.wp-block-image > .envs-fx { z-index: 2; }
.envs-fx--left { --fx-x: 24%; }
.envs-fx--right { --fx-x: 76%; }
.envs-hero .envs-fx--rings { --fx-y: 38%; }
.wp-block-image > .envs-fx--rings { --fx-size: 140%; }

/* Sonic rings: an ultrasonic burst spreading from a transducer point. Still
   (four concentric rings) for reduced motion; pulsing outward otherwise. */
.envs-fx--rings i {
  position: absolute;
  left: var(--fx-x);
  top: var(--fx-y);
  width: var(--fx-size);
  aspect-ratio: 1;
  border: 1px solid rgba(var(--fx-color), .55);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(.25);
  opacity: .5;
}
.envs-fx--rings i:nth-child(2) { transform: translate(-50%, -50%) scale(.5); opacity: .35; }
.envs-fx--rings i:nth-child(3) { transform: translate(-50%, -50%) scale(.75); opacity: .22; }
.envs-fx--rings i:nth-child(4) { transform: translate(-50%, -50%) scale(1); opacity: .12; }
.envs-fx--rings b {
  position: absolute;
  left: var(--fx-x);
  top: var(--fx-y);
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: rgb(var(--fx-color));
  box-shadow: 0 0 0 6px rgba(var(--fx-color), .18), 0 0 32px 8px rgba(var(--fx-color), .45);
}

/* Blueprint grid with a scan line sweeping down. */
.envs-fx--grid {
  background-image:
    linear-gradient(rgba(var(--fx-color), .12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--fx-color), .12) 1px, transparent 1px);
  background-size: 40px 40px;
  -webkit-mask-image: radial-gradient(ellipse 70% 80% at var(--fx-x) 50%, #000 15%, transparent 78%);
          mask-image: radial-gradient(ellipse 70% 80% at var(--fx-x) 50%, #000 15%, transparent 78%);
}
.envs-fx--grid i {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0, transparent calc(100% - 160px), rgba(var(--fx-color), .14) calc(100% - 24px), rgba(var(--fx-color), .6) 100%);
  transform: translateY(-100%);
  opacity: 0;
}

@media (prefers-reduced-motion: no-preference) {
  body:not(.envs-motion-off) .envs-fx--rings i {
    animation: envs-ring 7.2s cubic-bezier(.15, .6, .35, 1) infinite;
  }
  body:not(.envs-motion-off) .envs-fx--rings i:nth-child(2) { animation-delay: -1.8s; }
  body:not(.envs-motion-off) .envs-fx--rings i:nth-child(3) { animation-delay: -3.6s; }
  body:not(.envs-motion-off) .envs-fx--rings i:nth-child(4) { animation-delay: -5.4s; }
  body:not(.envs-motion-off) .envs-fx--rings b { animation: envs-beat 1.8s ease-in-out infinite; }
  body:not(.envs-motion-off) .envs-fx--grid i { animation: envs-scan 6.5s cubic-bezier(.45, 0, .55, 1) infinite; }
}
@keyframes envs-ring {
  0% { transform: translate(-50%, -50%) scale(.04); opacity: 0; }
  8% { opacity: .85; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}
@keyframes envs-beat { 50% { transform: scale(1.4); opacity: .65; } }
@keyframes envs-scan {
  0% { transform: translateY(-100%); opacity: 0; }
  10% { opacity: 1; }
  80% { opacity: 1; }
  100% { transform: translateY(0); opacity: 0; }
}

/* ---------------------------------------------------------------------
   Layered media: a photo, a product render floating over its edge, and a
   caption chip. Pattern "Layered media split" (envsonic/media-layered).
   --------------------------------------------------------------------- */
.envs-layers { position: relative; margin-bottom: 56px; }
.envs-layers > .envs-layer-base { margin: 0; }
.envs-layers > .envs-layer-base img { display: block; width: 100%; height: 560px; object-fit: cover; }
.envs-layers > .envs-layer-float {
  position: absolute;
  right: -5%;
  bottom: -56px;
  width: 50%;
  margin: 0;
  z-index: 3;
  filter: drop-shadow(0 28px 40px rgba(2, 10, 18, .55));
}
.envs-layers > .envs-layer-float img { display: block; width: 100%; height: auto; }
.envs-layers > .envs-layer-chip {
  position: absolute;
  left: 24px;
  top: 24px;
  z-index: 4;
  max-width: 300px;
  margin: 0;
  padding: 16px 20px;
  background: rgba(6, 19, 31, .86);
  -webkit-backdrop-filter: blur(6px);
          backdrop-filter: blur(6px);
  border-left: 3px solid var(--envs-blue, #1ba6dc);
  color: var(--envs-dark-text, #e8eef3);
}
.envs-layers > .envs-layer-chip > * { margin: 0; }
.envs-layers > .envs-layer-chip > * + * { margin-top: 6px; }
.envs-layer-chip .envs-eyebrow { color: var(--envs-blue, #1ba6dc); }
.envs-layer-chip__text { font-size: 15px; line-height: 1.45; color: var(--envs-dark-text-2, #b7c6d3); }

@media (max-width: 781px) {
  .envs-layers { margin-bottom: 40px; }
  .envs-layers > .envs-layer-base img { height: 360px; }
  .envs-layers > .envs-layer-float { width: 56%; right: -2%; bottom: -40px; }
  .envs-layers > .envs-layer-chip { left: 12px; top: 12px; max-width: 220px; padding: 12px 14px; }
}

/* ---------------------------------------------------------------------
   Background video: pause control (WCAG 2.2.2)
   --------------------------------------------------------------------- */
.envs-video-toggle {
  position: absolute;
  right: 20px;
  bottom: 20px;
  z-index: 3;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, .45);
  border-radius: 50%;
  background: rgba(6, 19, 31, .55);
  color: #fff;
  cursor: pointer;
}
.envs-video-toggle::before,
.envs-video-toggle::after {
  content: "";
  position: absolute;
  top: 14px;
  width: 4px;
  height: 14px;
  background: currentColor;
}
.envs-video-toggle::before { left: 15px; }
.envs-video-toggle::after { left: 23px; }
.envs-video-toggle.is-paused::before {
  left: 17px;
  width: 0;
  height: 0;
  background: none;
  border-style: solid;
  border-width: 7px 0 7px 12px;
  border-color: transparent transparent transparent currentColor;
}
.envs-video-toggle.is-paused::after { display: none; }
.envs-video-toggle:focus-visible { outline: 2px solid var(--envs-blue, #1ba6dc); outline-offset: 3px; }
.envs-video-toggle__label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------------------------------------------------------------------
   Ticker strip (envs/marquee). Still and wrapped by default; scrolling only
   when motion is allowed. Pauses on hover, focus and when off screen.
   --------------------------------------------------------------------- */
.envs-marquee {
  --envs-marquee-gap: 64px;
  padding: 26px 0;
  background: var(--envs-navy, #06131f);
  color: var(--envs-dark-muted, #8fa6b8);
  border-top: 1px solid var(--envs-line-darker, #16293a);
  border-bottom: 1px solid var(--envs-line-darker, #16293a);
  overflow: hidden;
}
.envs-marquee--light {
  background: var(--envs-white, #fff);
  color: var(--envs-text-muted, #5b6c7c);
  border-color: var(--envs-line, #d7dde3);
}
.envs-marquee .envs-marquee__eyebrow {
  margin: 0 0 14px;
  padding-inline: var(--envs-gutter, 56px);
  text-align: center;
  font: 600 13px/1 var(--envs-cond, sans-serif);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--envs-blue, #1ba6dc);
}
.envs-marquee__viewport { display: flex; justify-content: center; }
.envs-marquee__track {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 14px 0;
  margin: 0;
  padding: 0 var(--envs-gutter, 56px);
  list-style: none;
}
.envs-marquee__track[aria-hidden="true"], .envs-marquee__item.is-repeat { display: none; }
.envs-marquee__item {
  display: flex;
  align-items: center;
  flex: none;
  font: 600 22px/1 var(--envs-cond, sans-serif);
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.envs-marquee__item::after {
  content: "";
  width: 6px;
  height: 6px;
  margin: 0 calc(var(--envs-marquee-gap) / 2 - 3px);
  background: var(--envs-blue, #1ba6dc);
  transform: rotate(45deg);
}
.envs-marquee__item.is-last::after { display: none; }
.envs-marquee__item a { color: inherit; text-decoration: none; transition: color .2s; }
.envs-marquee__item a:hover, .envs-marquee__item a:focus-visible { color: var(--envs-white, #fff); }
.envs-marquee--light .envs-marquee__item a:hover, .envs-marquee--light .envs-marquee__item a:focus-visible { color: var(--envs-ink, #0b1d2e); }
.envs-marquee__item img { display: block; height: 36px; width: auto; opacity: .8; }
.envs-marquee--dark .envs-marquee__item img { filter: brightness(0) invert(1); opacity: .7; }

@media (prefers-reduced-motion: no-preference) {
  body:not(.envs-motion-off) .envs-marquee__viewport {
    justify-content: flex-start;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
            mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
  }
  body:not(.envs-motion-off) .envs-marquee__track {
    flex-wrap: nowrap;
    flex: none;
    padding: 0;
    animation: envs-marquee var(--envs-marquee-dur, 45s) linear infinite;
  }
  body:not(.envs-motion-off) .envs-marquee__track[aria-hidden="true"],
  body:not(.envs-motion-off) .envs-marquee__item.is-repeat { display: flex; }
  body:not(.envs-motion-off) .envs-marquee__item.is-last::after { display: block; }
  .envs-marquee:hover .envs-marquee__track,
  .envs-marquee:focus-within .envs-marquee__track,
  .envs-marquee.is-offscreen .envs-marquee__track { animation-play-state: paused; }
}
@keyframes envs-marquee { to { transform: translate3d(-100%, 0, 0); } }

/* The editor shows the strip still. */
.editor-styles-wrapper .envs-marquee__track { animation: none !important; }

@media (max-width: 781px) {
  .envs-marquee { padding: 20px 0; --envs-marquee-gap: 44px; }
  .envs-marquee__item { font-size: 18px; }
}

/* ---------------------------------------------------------------------
   Pattern support: graphic stage (layered media) and photo band
   --------------------------------------------------------------------- */
.envs-layers > .envs-layer-stage {
  position: relative;
  min-height: 560px;
  margin: 0;
  background: radial-gradient(120% 90% at 24% 34%, #15344f 0%, #0b2236 46%, #06131f 100%);
  border: 1px solid var(--envs-line-dark, #244058);
  overflow: hidden;
}
.envs-layers > .envs-layer-stage > .envs-layer-stage__rings { position: absolute; inset: 0; margin: 0; }
.envs-layer-stage__rings > .envs-fx--rings { --fx-y: 44%; --fx-size: 960px; }
.envs-layers > .envs-layer-stage + .envs-layer-float { width: 60%; right: -4%; bottom: -64px; }

.envs-cover-band { padding: var(--envs-pad, 96px) var(--envs-gutter, 56px); }
.envs-cover-band .wp-block-cover__inner-container { max-width: 900px; margin-inline: auto; text-align: center; }
.envs-cover-band .envs-btns { justify-content: center; }
.envs-cover-band .envs-lede { color: var(--envs-dark-text-2, #b7c6d3); }
.envs-cover-band .envs-eyebrow { color: var(--envs-blue, #1ba6dc); }
.envs-cover-band .envs-fx--rings b { display: none; }

/* A Cover set to drift: its photo is oversized a little so the drift never shows an edge. */
.has-parallax-bg > .wp-block-cover__image-background,
.has-parallax-bg > .wp-block-cover__video-background { scale: 1.18; }

@media (max-width: 781px) {
  .envs-layers > .envs-layer-stage { min-height: 380px; }
  .envs-layer-stage__rings > .envs-fx--rings { --fx-size: 640px; }
  .envs-layers > .envs-layer-stage + .envs-layer-float { width: 66%; bottom: -44px; }
  .envs-cover-band { padding: 72px 20px; }
}
