/* ambient.css — QI alive atmosphere
 * Ported from QIAmbientBackground (QIDesignSystem.swift)
 * Floating orbs + radial glow gradients that breathe
 * ADR 0002: Port QI design system from iOS SwiftUI to CSS
 */

/* ── Ambient container ─────────────────────────────── */
.qi-ambient {
  position: fixed;
  inset: 0;
  z-index: var(--qi-z-ambient);
  overflow: hidden;
  background: var(--qi-bg);
  pointer-events: none;
}

/* ── Radial glow gradients (breathing) ─────────────── */
.qi-ambient::before,
.qi-ambient::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  animation: qi-breathe 8s ease-in-out infinite;
}

.qi-ambient::before {
  width: 600px;
  height: 600px;
  top: -10%;
  left: -5%;
  background: radial-gradient(circle, var(--qi-glow), transparent 70%);
  animation-delay: 0s;
}

.qi-ambient::after {
  width: 500px;
  height: 500px;
  bottom: -10%;
  right: -5%;
  background: radial-gradient(circle, color-mix(in srgb, var(--qi-trust) 30%, transparent), transparent 70%);
  animation-delay: 4s;
  opacity: 0.2;
}

@keyframes qi-breathe {
  0%, 100% { opacity: 0.25; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.08); }
}

/* ── Floating orbs ─────────────────────────────────── */
/* Each orb follows a unique circular path — GPU accelerated */
.qi-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.25;
  will-change: transform;
}

.qi-orb--energy {
  width: 220px;
  height: 220px;
  background: var(--qi-energy);
  top: 15%;
  left: 10%;
  animation: qi-drift-1 20s ease-in-out infinite;
}

.qi-orb--trust {
  width: 280px;
  height: 280px;
  background: var(--qi-trust);
  top: 60%;
  left: 70%;
  animation: qi-drift-2 25s ease-in-out infinite;
}

.qi-orb--accent {
  width: 180px;
  height: 180px;
  background: color-mix(in srgb, var(--qi-accent) 50%, transparent);
  top: 70%;
  left: 15%;
  animation: qi-drift-3 18s ease-in-out infinite;
}

.qi-orb--white {
  width: 140px;
  height: 140px;
  background: rgba(255, 255, 255, 0.1);
  top: 5%;
  left: 60%;
  animation: qi-drift-4 22s ease-in-out infinite;
}

@keyframes qi-drift-1 {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(120px, 80px); }
  50% { transform: translate(60px, 160px); }
  75% { transform: translate(-40px, 100px); }
}

@keyframes qi-drift-2 {
  0%, 100% { transform: translate(0, 0); }
  33% { transform: translate(-100px, -60px); }
  66% { transform: translate(80px, -120px); }
}

@keyframes qi-drift-3 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(140px, -100px); }
}

@keyframes qi-drift-4 {
  0%, 100% { transform: translate(0, 0); }
  40% { transform: translate(-90px, 60px); }
  80% { transform: translate(50px, 120px); }
}

/* ── Reduced motion ────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .qi-ambient::before,
  .qi-ambient::after,
  .qi-orb {
    animation: none;
    opacity: 0.15;
  }
}
