/* ============================================================
   Crane Animations — Keyframes, Scroll Reveals, Ambient Motion
   ============================================================ */

/* ---- Ambient orb motion ---- */
@keyframes orb-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@keyframes orb-drift {
  0%, 100% { transform: translate(0, 0); }
  33% { transform: translate(6px, -8px); }
  66% { transform: translate(-5px, -12px); }
}
@keyframes orb-breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

.float-orb {
  position: absolute; border-radius: 50%;
  pointer-events: none; z-index: 0;
}
.float-orb.anim-float { animation: orb-float 16s ease-in-out infinite; }
.float-orb.anim-drift { animation: orb-drift 20s ease-in-out infinite; }
.float-orb.anim-breathe { animation: orb-breathe 14s ease-in-out infinite; }

/* ---- Scroll-linked reveals (JS-driven) ---- */
.reveal { opacity: 0; will-change: transform, opacity; }
.reveal-stagger > * { opacity: 0; will-change: transform, opacity; }

/* Lightweight CSS-only reveal (IntersectionObserver) */
.reveal-css {
  opacity: 0; transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal-css.visible { opacity: 1; transform: translateY(0); }

/* ---- Scroll-down bounce arrow ---- */
@keyframes bounce-down {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}
.scroll-cue {
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; cursor: pointer;
  color: var(--slate-400); font-size: 0.85rem; font-style: italic;
  transition: color 0.2s;
}
.scroll-cue:hover { color: var(--blue-400); }
.scroll-cue .arrow-down {
  width: 24px; height: 24px;
  animation: bounce-down 2s ease-in-out infinite;
}

/* ---- Counter animation (for stat numbers) ---- */
.counter-value {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}

/* ---- Typewriter cursor ---- */
.quote-typed { overflow: hidden; white-space: normal; }
.typewriter-cursor {
  display: inline-block; width: 2px; height: 1em;
  background: var(--blue-400); margin-left: 2px;
  vertical-align: text-bottom;
  animation: blink-cursor 0.6s step-end infinite;
}
@keyframes blink-cursor {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ---- Feature card flip-in ---- */
.feature-card {
  backface-visibility: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.feature-card:hover {
  transform: translateY(-6px) !important;
  box-shadow: 0 12px 36px rgba(59, 130, 246, 0.15);
}
[data-theme="night"] .feature-card:hover {
  box-shadow: 0 12px 36px rgba(59, 130, 246, 0.25);
}

/* ---- Pricing subtitle underline glow ---- */
.pricing-sub-line { position: relative; display: inline-block; }
.pricing-sub-line::after {
  content: ''; position: absolute; bottom: -3px; left: 0;
  width: 100%; height: 2px;
  background: linear-gradient(90deg, var(--blue-500), var(--blue-300), transparent);
  transform: scaleX(0); transform-origin: left;
}
.pricing-sub-line.glow-active::after {
  animation: underline-glow 1.2s ease-out forwards;
}
@keyframes underline-glow {
  0%   { transform: scaleX(0); transform-origin: left; opacity: 1; }
  45%  { transform: scaleX(1); transform-origin: left; opacity: 1; }
  55%  { transform: scaleX(1); transform-origin: right; opacity: 1; }
  100% { transform: scaleX(0); transform-origin: right; opacity: 1; }
}

/* ---- Reduced motion: show everything, disable all animation ---- */
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-stagger > *, .reveal-css { opacity: 1 !important; transform: none !important; }
  .float-orb { animation: none !important; }
  .scroll-cue .arrow-down { animation: none !important; }
  .typewriter-cursor { animation: none !important; }
}
