/* Tee-Luxe Finder hero tile rain — CSS-only, no animation JavaScript */

#tlf-gty-hero {
  --tlf-rain-fall-distance: 760px;
}

#tlf-gty-hero .tlf-hero-rain {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  contain: strict;
  pointer-events: none;
  perspective: 1100px;
}

#tlf-gty-hero .tlf-hero-rain--deferred .tlf-hero-rain__piece {
  opacity: 0;
  animation-play-state: paused;
}

#tlf-gty-hero .tlf-hero-rain--deferred .tlf-hero-rain__sway,
#tlf-gty-hero .tlf-hero-rain--deferred .tlf-hero-rain__card {
  animation-play-state: paused;
}

#tlf-gty-hero .tlf-hero-rain--deferred.is-ready .tlf-hero-rain__piece {
  opacity: var(--tlf-rain-opacity);
  animation-play-state: running;
  transition: opacity 260ms ease;
}

#tlf-gty-hero .tlf-hero-rain--deferred.is-ready .tlf-hero-rain__sway,
#tlf-gty-hero .tlf-hero-rain--deferred.is-ready .tlf-hero-rain__card {
  animation-play-state: running;
}

#tlf-gty-hero .tlf-hero-rain__piece {
  position: absolute;
  top: calc((var(--tlf-rain-size) + 24px) * -1);
  left: var(--tlf-rain-x);
  width: var(--tlf-rain-size);
  opacity: var(--tlf-rain-opacity);
  filter: drop-shadow(0 13px 18px rgba(16, 13, 9, 0.26));
  animation: tlf-hero-rain-fall 14.4s linear var(--tlf-rain-delay) infinite both;
  will-change: transform;
}

#tlf-gty-hero .tlf-hero-rain__sway {
  display: block;
  animation: tlf-hero-rain-sway var(--tlf-rain-sway-duration) ease-in-out var(--tlf-rain-delay) infinite alternate;
  will-change: transform;
}

#tlf-gty-hero .tlf-hero-rain__card {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1.62;
  transform-style: preserve-3d;
  animation: tlf-hero-rain-spin var(--tlf-rain-spin-duration) cubic-bezier(0.42, 0.08, 0.58, 0.92) var(--tlf-rain-delay) infinite;
  will-change: transform;
}

#tlf-gty-hero .tlf-hero-rain__face {
  position: absolute;
  inset: 0;
  display: block;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: clamp(8px, 1.2vw, 14px);
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 255, 255, 0.74), transparent 56%),
    var(--tlf-rain-tile-bg);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

#tlf-gty-hero .tlf-hero-rain__face--back {
  transform: rotateY(180deg);
}

#tlf-gty-hero .tlf-hero-rain__meta {
  position: absolute;
  top: 12%;
  left: 8%;
  z-index: 2;
  display: block;
  max-width: 65%;
}

#tlf-gty-hero .tlf-hero-rain__kind {
  display: block;
  margin-bottom: 4%;
  color: rgba(33, 31, 28, 0.52);
  font-family: "Open Sans", Arial, sans-serif;
  font-size: clamp(5px, calc(var(--tlf-rain-size) * 0.055), 8px);
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1.1;
  text-transform: uppercase;
}

#tlf-gty-hero .tlf-hero-rain__name {
  display: block;
  color: #282521;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(9px, calc(var(--tlf-rain-size) * 0.11), 16px);
  font-weight: 500;
  line-height: 1.04;
}

#tlf-gty-hero .tlf-hero-rain__art {
  position: absolute;
  right: -2%;
  bottom: -5%;
  display: block;
  width: 56%;
  height: auto;
  max-width: none;
  border: 0;
  box-shadow: none;
}

@keyframes tlf-hero-rain-fall {
  0% {
    transform: translate3d(0, 0, 0);
  }

  45% {
    transform: translate3d(
      calc(var(--tlf-rain-drift) * 0.62),
      calc(var(--tlf-rain-fall-distance) * 0.45),
      0
    );
  }

  100% {
    transform: translate3d(var(--tlf-rain-drift), var(--tlf-rain-fall-distance), 0);
  }
}

@keyframes tlf-hero-rain-sway {
  from {
    transform: translateX(calc(var(--tlf-rain-sway) * -0.45));
  }

  to {
    transform: translateX(var(--tlf-rain-sway));
  }
}

@keyframes tlf-hero-rain-spin {
  0% {
    transform: rotateX(0turn) rotateY(0turn) rotateZ(var(--tlf-rain-start-tilt));
  }

  100% {
    transform:
      rotateX(var(--tlf-rain-rotate-x))
      rotateY(var(--tlf-rain-rotate-y))
      rotateZ(var(--tlf-rain-rotate-z));
  }
}

@media (max-width: 820px) {
  #tlf-gty-hero {
    --tlf-rain-fall-distance: 690px;
  }

  #tlf-gty-hero .tlf-hero-rain__piece {
    top: calc((var(--tlf-rain-size-mobile) + 24px) * -1);
    left: var(--tlf-rain-x-mobile);
    width: var(--tlf-rain-size-mobile);
    opacity: var(--tlf-rain-opacity-mobile);
    animation-duration: 13.2s;
    animation-delay: var(--tlf-rain-delay-mobile);
  }

  #tlf-gty-hero .tlf-hero-rain--deferred.is-ready .tlf-hero-rain__piece {
    opacity: var(--tlf-rain-opacity-mobile);
  }

  #tlf-gty-hero .tlf-hero-rain__sway,
  #tlf-gty-hero .tlf-hero-rain__card {
    animation-delay: var(--tlf-rain-delay-mobile);
  }

  #tlf-gty-hero .tlf-hero-rain__kind {
    font-size: 5px;
  }

  #tlf-gty-hero .tlf-hero-rain__name {
    font-size: 9px;
  }

  #tlf-gty-hero .tlf-hero-rain[data-mobile-count="3"] .tlf-hero-rain__piece:nth-child(n + 4),
  #tlf-gty-hero .tlf-hero-rain[data-mobile-count="5"] .tlf-hero-rain__piece:nth-child(n + 6),
  #tlf-gty-hero .tlf-hero-rain[data-mobile-count="7"] .tlf-hero-rain__piece:nth-child(n + 8) {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  #tlf-gty-hero .tlf-hero-rain {
    display: none;
  }
}
