/* ============================================================
   OPSITE — Shared Animation Layer
   Layers on top of styles.css. Uses existing CSS variables.
   ============================================================ */

/* --- Loader --- */
.os-loader {
  position: fixed; inset: 0; z-index: 99999;
  background: var(--bg-primary, #090909);
  display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 24px;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
.os-loader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.os-loader-logo {
  font-size: 42px; font-weight: 800; letter-spacing: -2px;
  color: var(--text-primary, #ededed); opacity: 0;
  transition: opacity 0.5s ease;
}
.os-loader-logo span { color: var(--brand, #00E87B); }
.os-loader-bar {
  width: 180px; height: 3px;
  background: var(--border-default, rgba(255,255,255,0.06));
  border-radius: 3px; overflow: hidden;
}
.os-loader-fill {
  width: 0; height: 100%;
  background: var(--brand, #00E87B);
  border-radius: 3px;
  transition: width 1s cubic-bezier(.4,0,.2,1);
}

/* --- Scroll progress bar --- */
.os-scroll-progress {
  position: fixed; top: 0; left: 0; height: 2px; z-index: 100000;
  background: linear-gradient(90deg, var(--brand, #00E87B), #4ade80);
  width: 0; transition: width 0.05s linear; pointer-events: none;
}

/* --- Reveal animations --- */
.os-reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s cubic-bezier(.16,1,.3,1), transform 0.7s cubic-bezier(.16,1,.3,1);
}
.os-reveal.os-visible {
  opacity: 1;
  transform: translateY(0);
}

.os-reveal-scale {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.7s cubic-bezier(.16,1,.3,1), transform 0.7s cubic-bezier(.16,1,.3,1);
}
.os-reveal-scale.os-visible {
  opacity: 1;
  transform: scale(1);
}

/* --- Stagger children --- */
.os-stagger > * {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s cubic-bezier(.16,1,.3,1), transform 0.6s cubic-bezier(.16,1,.3,1);
}
.os-stagger.os-visible > * {
  opacity: 1;
  transform: translateY(0);
}
.os-stagger.os-visible > *:nth-child(1)  { transition-delay: 0.04s; }
.os-stagger.os-visible > *:nth-child(2)  { transition-delay: 0.08s; }
.os-stagger.os-visible > *:nth-child(3)  { transition-delay: 0.12s; }
.os-stagger.os-visible > *:nth-child(4)  { transition-delay: 0.16s; }
.os-stagger.os-visible > *:nth-child(5)  { transition-delay: 0.20s; }
.os-stagger.os-visible > *:nth-child(6)  { transition-delay: 0.24s; }
.os-stagger.os-visible > *:nth-child(7)  { transition-delay: 0.28s; }
.os-stagger.os-visible > *:nth-child(8)  { transition-delay: 0.32s; }
.os-stagger.os-visible > *:nth-child(9)  { transition-delay: 0.36s; }
.os-stagger.os-visible > *:nth-child(10) { transition-delay: 0.40s; }
.os-stagger.os-visible > *:nth-child(11) { transition-delay: 0.44s; }
.os-stagger.os-visible > *:nth-child(12) { transition-delay: 0.48s; }

/* --- Card 3D tilt (applied via JS) --- */
.os-tilt {
  transition: transform 0.4s cubic-bezier(.4,0,.2,1), box-shadow 0.4s ease, border-color 0.4s ease;
  will-change: transform;
}
.os-tilt:hover {
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}

/* --- Magnetic buttons (transform handled by JS) --- */
.os-magnetic {
  transition: transform 0.3s cubic-bezier(.4,0,.2,1);
  will-change: transform;
}

/* --- Floating ambient particles --- */
.os-particle {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
}

/* --- Hero entrance (JS sets initial state, CSS only defines transitions) --- */
/* No opacity:0 in CSS — JS handles it so content is always visible as fallback */

/* --- Timeline item animations --- */
.os-tl-animate {
  opacity: 0;
  transform: translateX(-24px);
  transition: opacity 0.6s cubic-bezier(.16,1,.3,1), transform 0.6s cubic-bezier(.16,1,.3,1);
}
.os-tl-animate.os-visible {
  opacity: 1;
  transform: translateX(0);
}

/* --- Flow step animations --- */
.os-flow-animate {
  opacity: 0;
  transform: translateX(-20px);
  transition: opacity 0.5s cubic-bezier(.16,1,.3,1), transform 0.5s cubic-bezier(.16,1,.3,1);
}
.os-flow-animate.os-visible {
  opacity: 1;
  transform: translateX(0);
}

/* --- Glow orbs (ambient background) --- */
.os-glow-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  animation: os-float 10s ease-in-out infinite;
}
.os-glow-orb-1 {
  width: 350px; height: 350px;
  background: rgba(0, 232, 123, 0.07);
  top: 15%; left: 5%;
  animation-delay: 0s;
}
.os-glow-orb-2 {
  width: 280px; height: 280px;
  background: rgba(77, 162, 255, 0.04);
  top: 55%; right: 8%;
  animation-delay: 4s;
}
@keyframes os-float {
  0%, 100% { transform: translate(0, 0); }
  25%  { transform: translate(25px, -15px); }
  50%  { transform: translate(-15px, 25px); }
  75%  { transform: translate(15px, 10px); }
}

/* --- Counter blink --- */
.os-counter-done {
  animation: os-counter-pop 0.3s ease;
}
@keyframes os-counter-pop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* --- Pricing card pop on toggle --- */
.os-price-change {
  animation: os-price-flip 0.35s ease;
}
@keyframes os-price-flip {
  0%   { opacity: 1; transform: translateY(0); }
  40%  { opacity: 0; transform: translateY(-8px); }
  60%  { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* --- Intake form step transitions --- */
.os-step-enter {
  animation: os-step-in 0.4s cubic-bezier(.16,1,.3,1);
}
@keyframes os-step-in {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}
