/* Homepage motion + graphic treatments. Scoped to .landing-home. */

.landing-home {
  --landing-indigo: #4f46e5;
  --landing-sky: #0ea5e9;
  overflow: hidden;
}

@keyframes landing-fade-up {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .landing-home [data-reveal] {
    animation: landing-fade-up 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
  }
}

.landing-orb {
  position: absolute;
  border-radius: 9999px;
  filter: blur(64px);
  pointer-events: none;
  animation: landing-orb-drift 18s ease-in-out infinite alternate;
}

.landing-orb--a {
  width: 28rem;
  height: 28rem;
  background: rgba(99, 102, 241, 0.28);
  top: -8rem;
  left: -6rem;
  animation-delay: 0s;
}

.landing-orb--b {
  width: 22rem;
  height: 22rem;
  background: rgba(14, 165, 233, 0.22);
  top: 4rem;
  right: -5rem;
  animation-delay: -6s;
}

.landing-orb--c {
  width: 18rem;
  height: 18rem;
  background: rgba(167, 139, 250, 0.22);
  bottom: -6rem;
  left: 40%;
  animation-delay: -11s;
}

@keyframes landing-orb-drift {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(24px, -18px, 0) scale(1.08);
  }
}

.landing-float {
  animation: landing-float 6.5s ease-in-out infinite;
}

.landing-float-slow {
  animation: landing-float 8.5s ease-in-out infinite;
  animation-delay: -1.6s;
}

.landing-float-delay {
  animation: landing-float 7s ease-in-out infinite;
  animation-delay: -3.2s;
}

@keyframes landing-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.landing-hero-frame,
.landing-hero-frame {
  position: relative;
}

.landing-hero-frame img,
.landing-hero-frame img {
  animation: landing-kenburns 22s ease-in-out infinite alternate;
}

@keyframes landing-kenburns {
  from {
    transform: scale(1) translate3d(0, 0, 0);
  }
  to {
    transform: scale(1.04) translate3d(-6px, -4px, 0);
  }
}

.ats-ring {
  stroke-dasharray: 97.4;
  stroke-dashoffset: 97.4;
  animation: ats-ring-draw 1.6s cubic-bezier(0.22, 1, 0.36, 1) 0.4s forwards;
}

@keyframes ats-ring-draw {
  to {
    stroke-dashoffset: 7.8; /* ~92% of 97.4 */
  }
}

.landing-shimmer {
  position: relative;
  overflow: hidden;
}

.landing-shimmer::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 40%,
    rgba(255, 255, 255, 0.35) 50%,
    transparent 60%
  );
  transform: translateX(-120%);
  animation: landing-shimmer 4.5s ease-in-out infinite;
  pointer-events: none;
}

@keyframes landing-shimmer {
  0%,
  55% {
    transform: translateX(-120%);
  }
  80%,
  100% {
    transform: translateX(120%);
  }
}

.landing-marquee {
  display: flex;
  width: max-content;
  gap: 0.75rem;
  animation: landing-marquee 32s linear infinite;
}

.landing-marquee:hover {
  animation-play-state: paused;
}

@keyframes landing-marquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

.landing-pulse-dot {
  animation: landing-pulse 2s ease-in-out infinite;
}

@keyframes landing-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.35);
    opacity: 0.55;
  }
}

.landing-skeleton-line {
  height: 0.45rem;
  border-radius: 9999px;
  background: linear-gradient(90deg, #e5e7eb 0%, #f3f4f6 40%, #e5e7eb 80%);
  background-size: 200% 100%;
  animation: landing-skeleton 1.8s ease-in-out infinite;
}

@keyframes landing-skeleton {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

.landing-card {
  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.35s ease,
    border-color 0.35s ease;
}

.landing-card:hover {
  transform: translateY(-6px);
  box-shadow:
    0 18px 40px -18px rgba(79, 70, 229, 0.35),
    0 8px 16px -8px rgba(15, 23, 42, 0.12);
  border-color: rgb(199 210 254);
}

.landing-card img {
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.landing-card:hover img {
  transform: scale(1.05);
}

.feature-media-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3; /* height when both layers are absolute */
}

.feature-media-wrap .feature-img {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;
  transition:
    opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.feature-media-wrap .feature-video {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Video fades in over the poster; poster fades out so a stuck layer never covers motion */
.feature-media-wrap.is-video-loaded .feature-video,
.feature-media-wrap.has-video-playing .feature-video,
.feature-media-wrap .feature-video.is-video-playing {
  opacity: 1;
}

.feature-media-wrap.is-video-loaded .feature-img,
.feature-media-wrap.has-video-playing .feature-img {
  opacity: 0;
}

/* Keep hover zoom on both stacked layers */
.landing-card:hover .feature-media-wrap .feature-img,
.landing-card:hover .feature-media-wrap .feature-video {
  transform: scale(1.05);
}

.landing-step-line,
.landing-step-line {
  background: linear-gradient(90deg, #c7d2fe, #7dd3fc, #c4b5fd);
  background-size: 200% 100%;
  animation: landing-step-flow 4s linear infinite;
}

@keyframes landing-step-flow {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 200% 0;
  }
}

/* Production fallbacks: hero gradient text + bottom CTA stay styled if app.css is stale. */
.landing-hero-gradient-text {
  background-image: linear-gradient(90deg, #4338ca, #0284c7, #7c3aed);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.landing-cta-banner {
  position: relative;
  overflow: hidden;
  border-radius: 1.5rem;
  border: 1px solid rgba(129, 140, 248, 0.2);
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 45%, #0c4a6e 100%);
  padding: 2rem;
  box-shadow: 0 20px 40px -20px rgba(30, 27, 75, 0.55);
}

@media (min-width: 768px) {
  .landing-cta-banner {
    padding: 3rem;
  }
}

.landing-cta-banner__title {
  color: #ffffff;
}

.landing-cta-banner__copy {
  color: #e0e7ff;
}

.landing-cta-banner__login {
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.landing-cta-pixels {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.landing-cta-pixels::before {
  content: "";
  position: absolute;
  inset: -24px;
  background-image:
    linear-gradient(rgba(165, 180, 252, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(165, 180, 252, 0.12) 1px, transparent 1px),
    radial-gradient(rgba(199, 210, 254, 0.18) 0.7px, transparent 1.1px);
  background-size: 22px 22px, 22px 22px, 22px 22px;
  background-position: 0 0, 0 0, 11px 11px;
  opacity: 0.22;
  -webkit-mask-image: linear-gradient(
    105deg,
    transparent 0%,
    rgba(0, 0, 0, 0.15) 28%,
    rgba(0, 0, 0, 0.55) 62%,
    rgba(0, 0, 0, 0.75) 100%
  );
  mask-image: linear-gradient(
    105deg,
    transparent 0%,
    rgba(0, 0, 0, 0.15) 28%,
    rgba(0, 0, 0, 0.55) 62%,
    rgba(0, 0, 0, 0.75) 100%
  );
  animation: landing-cta-pixels-drift 22s linear infinite;
}

.landing-cta-pixels::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    rgba(15, 23, 42, 0.42) 0%,
    rgba(15, 23, 42, 0.22) 42%,
    rgba(15, 23, 42, 0.08) 100%
  );
}

@keyframes landing-cta-pixels-drift {
  0% {
    transform: translate3d(0, 0, 0);
    opacity: 0.14;
  }
  50% {
    opacity: 0.26;
  }
  100% {
    transform: translate3d(22px, 22px, 0);
    opacity: 0.14;
  }
}

@media (prefers-reduced-motion: reduce) {
  .landing-home .landing-orb,
  .landing-home .landing-float,
  .landing-home .landing-float-slow,
  .landing-home .landing-float-delay,
  .landing-home .landing-hero-frame img,
  .landing-home .landing-hero-frame img,
  .landing-home .ats-ring,
  .landing-home .landing-shimmer::after,
  .landing-home .landing-marquee,
  .landing-home .landing-pulse-dot,
  .landing-home .landing-skeleton-line,
  .landing-home .landing-step-line,
  .landing-home .landing-step-line,
  .landing-home .landing-card img,
  .landing-home .landing-cta-pixels::before {
    animation: none !important;
  }

  .landing-home [data-reveal] {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .landing-home .ats-ring {
    stroke-dashoffset: 7.8;
  }

  .landing-home .landing-card:hover {
    transform: none;
  }

  .landing-home .landing-card:hover img,
  .landing-home .landing-card:hover .feature-media-wrap .feature-img,
  .landing-home .landing-card:hover .feature-media-wrap .feature-video {
    transform: none;
  }

  /* Static posters only — never reveal feature videos */
  .landing-home .feature-media-wrap .feature-video {
    display: none !important;
    opacity: 0 !important;
  }

  .landing-home .feature-media-wrap .feature-img {
    opacity: 1 !important;
  }
}
