/* ============================================
   FAHM Effects — Phase 1 CSS Animations
   Loaded in GrapeJS canvas + published pages
   ============================================ */

/* ── Blur Text (scroll-triggered fade from blur to sharp) ── */
.fahm-blur-text {
  filter: blur(8px);
  opacity: 0;
  transition: filter 1s ease-out, opacity 1s ease-out;
}
.fahm-blur-text.fahm-fx-active {
  filter: blur(0);
  opacity: 1;
}

/* ── Shiny Text (shimmer sweep across text) ── */
.fahm-shiny-text {
  background: linear-gradient(
    120deg,
    var(--fahm-shiny-color, #15803d) 0%,
    var(--fahm-shiny-color, #15803d) 40%,
    var(--fahm-shiny-highlight, #bbf7d0) 50%,
    var(--fahm-shiny-color, #15803d) 60%,
    var(--fahm-shiny-color, #15803d) 100%
  );
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: fahm-shine-sweep var(--fahm-shiny-speed, 3s) ease-in-out infinite;
}

@keyframes fahm-shine-sweep {
  0%   { background-position: 200% center; }
  100% { background-position: -200% center; }
}

/* ── Gradient Text (animated moving gradient) ── */
.fahm-gradient-text {
  background: linear-gradient(
    90deg,
    var(--fahm-grad-1, #15803d),
    var(--fahm-grad-2, #0891b2),
    var(--fahm-grad-3, #7c3aed),
    var(--fahm-grad-1, #15803d)
  );
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: fahm-gradient-shift var(--fahm-grad-speed, 4s) ease infinite;
}

@keyframes fahm-gradient-shift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ── Aurora Background (flowing blurred color blobs) ── */
.fahm-aurora {
  position: relative;
  overflow: hidden;
}
.fahm-aurora-blob {
  position: absolute;
  border-radius: 50%;
  opacity: 0.5;
  will-change: transform;
  pointer-events: none;
}
.fahm-aurora-blob:nth-child(1) {
  width: 45%;
  padding-bottom: 45%;
  background: var(--fahm-aurora-1, #22c55e);
  filter: blur(80px);
  top: -10%;
  left: -5%;
  animation: fahm-aurora-drift-1 8s ease-in-out infinite alternate;
}
.fahm-aurora-blob:nth-child(2) {
  width: 40%;
  padding-bottom: 40%;
  background: var(--fahm-aurora-2, #3b82f6);
  filter: blur(80px);
  top: 10%;
  right: -10%;
  animation: fahm-aurora-drift-2 10s ease-in-out infinite alternate;
}
.fahm-aurora-blob:nth-child(3) {
  width: 35%;
  padding-bottom: 35%;
  background: var(--fahm-aurora-3, #a855f7);
  filter: blur(80px);
  bottom: -10%;
  left: 30%;
  animation: fahm-aurora-drift-3 12s ease-in-out infinite alternate;
}

@keyframes fahm-aurora-drift-1 {
  0%   { transform: translate(-10%, -10%) scale(1); }
  100% { transform: translate(15%, 25%) scale(1.1); }
}
@keyframes fahm-aurora-drift-2 {
  0%   { transform: translate(10%, -5%) scale(1.05); }
  100% { transform: translate(-15%, 20%) scale(0.95); }
}
@keyframes fahm-aurora-drift-3 {
  0%   { transform: translate(-5%, 10%) scale(0.95); }
  100% { transform: translate(20%, -15%) scale(1.1); }
}

/* ── Wave Divider (animated SVG waves) ── */
.fahm-wave-divider {
  position: relative;
  width: 100%;
  overflow: hidden;
  line-height: 0;
}
.fahm-wave-divider svg {
  display: block;
  width: 200%;
  height: var(--fahm-wave-height, 80px);
}
.fahm-wave-path-1 {
  opacity: 0.7;
  animation: fahm-wave-move 7s linear infinite;
}
.fahm-wave-path-2 {
  opacity: 0.4;
  animation: fahm-wave-move 9s linear infinite reverse;
}

@keyframes fahm-wave-move {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ── Harvest Marquee (infinite horizontal scroll) ── */
.fahm-marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}
.fahm-marquee-track {
  display: flex;
  width: max-content;
  animation: fahm-marquee-scroll var(--fahm-marquee-speed, 25s) linear infinite;
}
.fahm-marquee:hover .fahm-marquee-track {
  animation-play-state: paused;
}
.fahm-marquee-content {
  display: flex;
  gap: 3rem;
  align-items: center;
  padding-right: 3rem;
  flex-shrink: 0;
}

@keyframes fahm-marquee-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ── Count Up (display styling only, JS handles animation) ── */
.fahm-countup-value {
  font-variant-numeric: tabular-nums;
  display: inline-block;
}

/* ============================================
   Phase 2: TypeWriter, SplitText, SpotlightCard
   ============================================ */

/* ── TypeWriter ── */
.fahm-typewriter-cursor {
  display: inline-block;
  width: 3px;
  margin-left: 2px;
  background: currentColor;
  animation: fahm-blink 0.7s step-end infinite;
}
@keyframes fahm-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ── SplitText (individual chars animated via JS) ── */
.fahm-split-text span {
  display: inline-block;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.fahm-split-text.fahm-fx-active span {
  opacity: 1;
  transform: translateY(0);
}

/* ── SpotlightCard ── */
.fahm-spotlight-card {
  position: relative;
  overflow: hidden;
}
.fahm-spotlight-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    600px circle at var(--fahm-spot-x, 50%) var(--fahm-spot-y, 50%),
    var(--fahm-spot-color, rgba(34, 197, 94, 0.12)),
    transparent 40%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 1;
}
.fahm-spotlight-card:hover::before {
  opacity: 1;
}

/* ============================================
   Phase 3: TiltedScroll, StackedCards
   ============================================ */

/* ── TiltedScroll ── */
.fahm-tilt-card {
  transition: transform 0.15s ease-out;
  will-change: transform;
}

/* ── StackedCards ── */
.fahm-stacked-cards {
  position: relative;
}
.fahm-stacked-card {
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.5s ease;
  will-change: transform, opacity;
}

/* ============================================
   Phase 4: Particles Background
   ============================================ */

.fahm-particles-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* ── Accessibility: Respect prefers-reduced-motion ── */
@media (prefers-reduced-motion: reduce) {
  .fahm-blur-text {
    filter: none !important;
    opacity: 1 !important;
    transition: none !important;
  }
  .fahm-shiny-text,
  .fahm-gradient-text {
    animation: none !important;
    -webkit-text-fill-color: initial !important;
    background: none !important;
    background-clip: initial !important;
    -webkit-background-clip: initial !important;
  }
  .fahm-aurora-blob {
    animation: none !important;
  }
  .fahm-wave-path-1,
  .fahm-wave-path-2 {
    animation: none !important;
  }
  .fahm-marquee-track {
    animation: none !important;
  }
  .fahm-typewriter-cursor {
    animation: none !important;
  }
  .fahm-split-text span {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .fahm-tilt-card {
    transform: none !important;
    transition: none !important;
  }
  .fahm-stacked-card {
    transform: none !important;
    transition: none !important;
  }
  .fahm-particles-canvas {
    display: none !important;
  }
}
