/* =============================================
   Manolo, effects
   Vanilla adaptations inspired by React Bits:
   split text, title reveal and glare hover.
   ============================================= */

.hero__copy {
  position: relative;
  z-index: 1;
}

.fx-split-ready .hero__title-line {
  opacity: 1;
  transform: none;
  animation: none;
}

.fx-word {
  display: inline-block;
  opacity: 0;
  transform: translate3d(0, 0.34em, 0);
  filter: blur(2px);
  transform-origin: left bottom;
  animation: fxWordReveal 820ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: var(--fx-word-delay, 0ms);
  will-change: transform, opacity, filter;
}

@keyframes fxWordReveal {
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
    filter: blur(0);
  }
}

.fx-title-word {
  display: inline-block;
  opacity: 0;
  transform: translate3d(0, 0.42em, 0);
  clip-path: inset(0 0 100% 0);
  transform-origin: left bottom;
}

html[data-motion="ready"] .section-header.is-visible .fx-title-word,
html[data-motion="ready"] [data-reveal].is-visible .fx-title-word {
  animation: fxTitleReveal 720ms var(--ease-out) forwards;
  animation-delay: calc(var(--reveal-delay, 0ms) + var(--fx-title-delay, 0ms));
  will-change: transform, opacity, clip-path;
}

@keyframes fxTitleReveal {
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
    clip-path: inset(0 0 0 0);
  }
}

.fx-glare {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.fx-glare::before {
  content: "";
  position: absolute;
  inset: -45%;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(
    115deg,
    transparent 42%,
    rgba(255, 255, 255, 0.54) 50%,
    transparent 58%
  );
  opacity: 0;
  transform: translate3d(-62%, 0, 0);
  transition:
    transform 920ms cubic-bezier(0.16, 1, 0.3, 1),
    opacity 260ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .fx-glare:hover::before,
  .fx-glare:focus-visible::before {
    opacity: 0.24;
    transform: translate3d(62%, 0, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .fx-word,
  .fx-title-word,
  .fx-glare::before {
    animation: none;
    transition: none;
  }

  .fx-word,
  .fx-title-word {
    opacity: 1;
    transform: none;
    filter: none;
    clip-path: none;
  }

  .fx-glare::before {
    display: none;
  }
}
