/* ========================================
   Hero Animation — Entrance + Background
   ======================================== */

/* --- Background treatment --- */
.f-section-large.hero-animated {
  background: linear-gradient(160deg, #ffffff 0%, #f4f1fa 45%, #ece7f6 100%);
  overflow-x: clip;
  overflow-y: visible;
  position: relative;
}

/* Override Webflow's overflow:clip on the grid and ensure
   no parent clips the offset-path arc or glow bloom */
.f-section-large.hero-animated .f-container-regular,
.f-section-large.hero-animated .f-header-grid {
  overflow: visible;
}

/* --- Animation container (replaces static .image-3) --- */
.hero-visual {
  position: relative;
  width: 100%;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Radial glow spotlight */
.hero-visual::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 55%;
  transform: translate(-50%, -50%);
  width: 500px;
  height: 420px;
  background: radial-gradient(
    ellipse at center,
    rgba(100, 46, 255, 0.07) 0%,
    rgba(100, 46, 255, 0.03) 40%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 0;
}

/* --- Cluster group (wraps all animated elements) --- */
.hero-cluster {
  position: relative;
  z-index: 2;
  width: 280px;
  height: 200px;
  opacity: 0;
  /* SVG bezier curve: pronounced arc from far-left to pause position, then settle */
  offset-path: path("M -1040,60 C -700,-140 -300,-100 -120,0 C 0,30 120,80 220,115");
  offset-rotate: 0deg;
  offset-distance: 0%;
}

/* When animation triggers */
.hero-visual.hero-animate-start .hero-cluster {
  animation: heroClusterMotion 3200ms ease 300ms both;
}

/* offset-distance drives the element along the SVG path —
   the browser interpolates the curve natively, no choppy segments. */
@keyframes heroClusterMotion {
  0% {
    offset-distance: 0%;
    opacity: 0;
  }
  3% {
    opacity: 1;
  }
  32% {
    offset-distance: 73%;
    opacity: 1;
  }
  58% {
    offset-distance: 73%;
  }
  100% {
    offset-distance: 100%;
    opacity: 1;
  }
}

/* --- Cursor --- */
.hero-cursor {
  position: absolute;
  top: 24px;
  left: 30px;
  z-index: 4;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
  transition: filter 0.4s ease;
}

.hero-cursor svg {
  width: 36px;
  height: 56px;
}

/* Glow on activation */
.hero-visual.hero-animate-start .hero-cursor {
  animation: heroCursorGlow 600ms ease-out 1300ms both;
}

@keyframes heroCursorGlow {
  0% {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
  }
  40% {
    filter: drop-shadow(0 0 16px rgba(100, 46, 255, 0.5)) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
  }
  100% {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
  }
}

/* --- Activation glow bloom (ambient, behind entire cluster) --- */
.hero-activation-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  border: none;
  background: radial-gradient(
    circle at center,
    rgba(100, 46, 255, 0.18) 0%,
    rgba(100, 46, 255, 0.08) 35%,
    rgba(100, 46, 255, 0.02) 60%,
    transparent 80%
  );
  opacity: 0;
  pointer-events: none;
  z-index: 1;
  transform: translate(-50%, -50%) scale(0);
}

.hero-visual.hero-animate-start .hero-activation-ring {
  animation: heroActivationBloom 1200ms ease-out 1300ms both;
}

@keyframes heroActivationBloom {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  50% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.8;
  }
  100% {
    transform: translate(-50%, -50%) scale(1.3);
    opacity: 0;
  }
}

/* --- Clock display --- */
.hero-clock {
  position: absolute;
  top: 94px;
  left: 80px;
  z-index: 3;
  font-family: "SF Pro Display", -apple-system, system-ui, sans-serif;
  font-size: 3.6rem;
  font-weight: 700;
  color: #000;
  text-shadow:
    -2px -1px 0 #fff,
    2px -1px 0 #fff,
    -2px 1px 0 #fff,
    2px 1px 0 #fff,
    0 0 8px rgba(255, 255, 255, 0.8);
  line-height: 1;
  white-space: nowrap;
  opacity: 0;
  transform: scale(0.7);
}

.hero-visual.hero-animate-start .hero-clock {
  animation: heroClockReveal 500ms cubic-bezier(0.34, 1.56, 0.64, 1) 1600ms both;
}

@keyframes heroClockReveal {
  0% {
    opacity: 0;
    transform: scale(0.7);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* --- App icons --- */
.hero-app-icons {
  position: absolute;
  top: 158px;
  left: 80px;
  display: flex;
  gap: 6px;
  z-index: 3;
}

.hero-app-icon {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  overflow: hidden;
  opacity: 0;
  transform: scale(0.5) translateY(8px);
}

.hero-app-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.hero-visual.hero-animate-start .hero-app-icon:nth-child(1) {
  animation: heroIconReveal 400ms cubic-bezier(0.34, 1.56, 0.64, 1) 1800ms both;
}

.hero-visual.hero-animate-start .hero-app-icon:nth-child(2) {
  animation: heroIconReveal 400ms cubic-bezier(0.34, 1.56, 0.64, 1) 2000ms both;
}

@keyframes heroIconReveal {
  0% {
    opacity: 0;
    transform: scale(0.5) translateY(8px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  .hero-cluster {
    animation: none !important;
    opacity: 1 !important;
    offset-distance: 100% !important;
  }

  .hero-cursor,
  .hero-clock,
  .hero-app-icon {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .hero-activation-ring {
    display: none;
  }
}

/* --- Single-column layout (≤991px): centered, new arc, scaled down --- */
@media screen and (max-width: 991px) {
  .hero-visual::after {
    width: 320px;
    height: 260px;
    left: 50%;
  }

  .hero-cluster {
    width: 240px;
    height: 170px;
    /* Clockwise swoop: start left, arc up-right over content, curve down-right, settle */
    offset-path: path("M -300,-200 C -200,-400 300,-350 300,-100 C 300,100 100,50 0,0");
    offset-anchor: 0% 0%;
    offset-rotate: 0deg;
    offset-distance: 0%;
  }

  .hero-visual.hero-animate-start .hero-cluster {
    animation: heroClusterMotionMobile 1600ms ease 200ms both;
  }

  .hero-activation-ring {
    width: 240px;
    height: 240px;
  }

  /* Bloom + reveals start after cluster arrives (1600ms + 200ms delay = 1800ms) */
  .hero-visual.hero-animate-start .hero-activation-ring {
    animation: heroActivationBloom 1000ms ease-out 1800ms both;
  }

  /* Center elements within cluster using left:50% + margin-left */
  .hero-cursor {
    top: 18px;
    left: 50%;
    margin-left: -90px;
  }

  .hero-cursor svg {
    width: 28px;
    height: 44px;
  }

  .hero-visual.hero-animate-start .hero-cursor {
    animation: heroCursorGlow 600ms ease-out 1800ms both;
  }

  .hero-clock {
    top: 68px;
    left: 50%;
    margin-left: -80px;
    font-size: 2.4rem;
  }

  .hero-visual.hero-animate-start .hero-clock {
    animation: heroClockReveal 500ms cubic-bezier(0.34, 1.56, 0.64, 1) 1900ms both;
  }

  .hero-app-icons {
    top: 112px;
    left: 50%;
    margin-left: -80px;
    gap: 5px;
  }

  .hero-app-icon {
    width: 46px;
    height: 46px;
  }

  .hero-visual.hero-animate-start .hero-app-icon:nth-child(1) {
    animation: heroIconReveal 400ms cubic-bezier(0.34, 1.56, 0.64, 1) 2100ms both;
  }

  .hero-visual.hero-animate-start .hero-app-icon:nth-child(2) {
    animation: heroIconReveal 400ms cubic-bezier(0.34, 1.56, 0.64, 1) 2300ms both;
  }
}

@keyframes heroClusterMotionMobile {
  0% {
    offset-distance: 0%;
    opacity: 0;
  }
  5% {
    opacity: 1;
  }
  100% {
    offset-distance: 100%;
    opacity: 1;
  }
}

/* --- Small phone (≤479px): tighter sizes for narrow screens --- */
@media screen and (max-width: 479px) {
  .hero-visual::after {
    width: 240px;
    height: 200px;
    left: 50%;
  }

  .hero-cluster {
    width: 220px;
    height: 155px;
    /* Tighter clockwise swoop for narrow screen */
    offset-path: path("M -220,-150 C -150,-300 220,-260 220,-75 C 220,75 75,40 0,0");
  }

  .hero-activation-ring {
    width: 200px;
    height: 200px;
  }

  .hero-cursor {
    top: 14px;
    left: 50%;
    margin-left: -82px;
  }

  .hero-cursor svg {
    width: 24px;
    height: 38px;
  }

  .hero-clock {
    top: 58px;
    left: 50%;
    margin-left: -72px;
    font-size: 2.2rem;
  }

  .hero-app-icons {
    top: 98px;
    left: 50%;
    margin-left: -72px;
    gap: 4px;
  }

  .hero-app-icon {
    width: 42px;
    height: 42px;
  }
}
