/* Second motion layer for the WashNgo website mock-up: scroll-linked, pointer-linked and state-change
   animation. Elements this layer creates (ticker, segment thumb, ripples, split words)
   are only added by micro-motion.js when reduced motion is off. */

/* Ticker band under the hero benefits */
.ticker {
  overflow: hidden;
  background: #073f39;
  color: #fff;
  padding-block: 14px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.ticker-track {
  display: flex;
  width: max-content;
  animation: ticker-run 32s linear infinite;
}
.ticker:hover .ticker-track {
  animation-play-state: paused;
}
.ticker-track span {
  display: inline-flex;
  align-items: center;
  gap: 28px;
  padding-right: 28px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.ticker-track span::after {
  content: "✦";
  color: #ddf48a;
}

/* Sliding thumb behind the active frequency option */
.segmented.has-thumb {
  position: relative;
}
.segmented.has-thumb button {
  position: relative;
  z-index: 1;
  transition: color 0.36s var(--ease-out-quint);
}
.segmented.has-thumb button.active {
  background: transparent;
}
.segment-thumb {
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 0;
  border-radius: 12px;
  background: var(--primary);
  box-shadow: 0 6px 16px #00685f33;
  transition:
    transform 0.55s var(--ease-out-soft),
    width 0.55s var(--ease-out-soft);
}

/* Split headings: each word rises out of its own mask */
.w {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  padding: 0.06em 0.04em 0.14em;
  margin: -0.06em -0.04em -0.14em;
}
.w > span {
  display: inline-block;
  transform: translate3d(0, 110%, 0);
  transition: transform 0.9s var(--ease-out-soft) calc(var(--i, 0) * 45ms);
}
.words-in .w > span {
  transform: none;
}

/* Click ripple and hover sheen on buttons */
.button {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.ripple {
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  background: #00685f2e;
  transform: scale(0);
  pointer-events: none;
  animation: ripple-out 0.65s var(--ease-out-quint) forwards;
}
.button-primary .ripple,
.hero-download .ripple,
.download-now .ripple {
  background: #ffffff59;
}

@media (prefers-reduced-motion: no-preference) {
  .button-primary::before {
    content: "";
    position: absolute;
    z-index: -1;
    top: 0;
    bottom: 0;
    left: 0;
    width: 45%;
    background: linear-gradient(100deg, transparent, #ffffff40, transparent);
    transform: translateX(-140%) skewX(-12deg);
    transition: transform 0.85s var(--ease-out-soft);
    pointer-events: none;
  }
  .button-primary:hover::before {
    transform: translateX(300%) skewX(-12deg);
  }

  .hero-download {
    animation: cta-halo 2.8s var(--ease-out-quint) infinite;
  }

  .js-motion .bike-photo > img,
  .js-motion .comparison-photo img,
  .js-motion .detail-photo img {
    transition: clip-path 1.2s var(--ease-out-soft) 0.1s, transform 1.4s var(--ease-out-soft) 0.1s;
  }
  .js-motion .bike-photo:not(.is-revealed) > img,
  .js-motion .care-story-grid:not(.is-revealed) .comparison-photo img,
  .js-motion .care-story-grid:not(.is-revealed) .detail-photo img {
    clip-path: inset(100% 0 0 0);
    transform: scale(1.12);
  }

  .js-motion .benefit-row > div.is-revealed > svg path,
  .js-motion .why-grid > article.is-revealed .icon-tile svg path {
    stroke-dasharray: 1;
    animation: draw-path 1.3s var(--ease-out-soft) 0.25s both;
  }

  .js-motion .mobile-action {
    transform: translateY(120%);
    transition: transform 0.55s var(--ease-out-soft);
  }
  .js-motion .mobile-action.is-docked {
    transform: none;
  }
}

/* Mouse and trackpad only, at any window width: a green border segment and glow follow the cursor around
   the hovered service card, and a spotlight follows it over the benefit cards. Touch screens get neither. */
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .service-choice,
  .why-grid > article {
    position: relative;
  }
  .service-choice::before,
  .service-choice::after,
  .why-grid > article::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 3;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.35s var(--ease-out-quint);
    pointer-events: none;
  }
  /* Border ring: a radial highlight masked down to a 2px edge. */
  .service-choice::after {
    padding: 3px;
    background: radial-gradient(
      320px circle at var(--gx, 50%) var(--gy, 50%),
      var(--primary) 0 35%,
      #00685fcc 55%,
      #00685f33 85%
    );
    -webkit-mask:
      linear-gradient(#000 0 0) content-box,
      linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask:
      linear-gradient(#000 0 0) content-box,
      linear-gradient(#000 0 0);
    mask-composite: exclude;
  }
  /* Soft inner glow under the cursor. */
  .service-choice::before {
    background: radial-gradient(240px circle at var(--gx, 50%) var(--gy, 50%), #00685f1f, transparent 65%);
  }
  .why-grid > article::after {
    background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), #00685f1a, transparent 55%);
  }
  /* Green-tinted shadow around the whole hovered card. */
  .service-choice:hover {
    box-shadow:
      0 18px 40px #00685f2e,
      0 4px 12px #00685f1f;
  }
  .service-choice:hover::before,
  .service-choice:hover::after,
  .why-grid > article:hover::after {
    opacity: 1;
  }
}

/* No static green border on the selected service card at any width; it keeps its tick badge. */
.service-choice.active {
  border: 1px solid var(--border);
  margin: 0;
}

@keyframes ticker-run {
  to {
    transform: translateX(-50%);
  }
}
@keyframes ripple-out {
  to {
    transform: scale(1);
    opacity: 0;
  }
}
@keyframes cta-halo {
  0% {
    box-shadow: 0 0 0 0 #ddf48a8c;
  }
  70%,
  100% {
    box-shadow: 0 0 0 18px #ddf48a00;
  }
}
@keyframes draw-path {
  from {
    stroke-dashoffset: 1;
  }
  to {
    stroke-dashoffset: 0;
  }
}
