/* ============================================================
   ATMOSPHERE
   Reusable sky/cloud/floating-balloon backdrop layer. Apply to
   any page that wants a cinematic sky behind its content by
   wrapping in <div class="atmosphere atmosphere--{variant}">.
   ============================================================ */

.atmosphere {
  position: relative;
  min-height: calc(100vh - 64px);
  overflow: hidden;
  isolation: isolate;
}

.atmosphere--form {
  background: var(--gradient-form);
}

.atmosphere--dusk {
  background: var(--gradient-hero);
}

.atmosphere--night {
  background: var(--gradient-night);
}

/* Content sits on top of the sky */
.atmosphere > * {
  position: relative;
  z-index: 3;
}

/* ---- Star field ---- */
.atmosphere__stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.atmosphere__stars .star {
  background: rgba(255, 255, 255, 0.82);
}

/* ---- Aurora glow (top-of-page wash) ---- */
.atmosphere__aurora {
  position: absolute;
  top: -25%;
  left: -10%;
  right: -10%;
  height: 70%;
  background:
    radial-gradient(ellipse at 20% 35%, rgba(78, 205, 196, 0.22) 0%, transparent 55%),
    radial-gradient(ellipse at 78% 25%, rgba(255, 107, 53, 0.18) 0%, transparent 60%),
    radial-gradient(ellipse at 50% 0%,  rgba(255, 217, 61, 0.15) 0%, transparent 60%);
  filter: blur(8px);
  pointer-events: none;
  z-index: 1;
  opacity: 0.9;
}

/* ---- Drifting clouds ---- */
.atmosphere__cloud {
  position: absolute;
  background: rgba(255, 255, 255, 0.78);
  border-radius: 50px;
  pointer-events: none;
  z-index: 2;
}

.atmosphere__cloud::before,
.atmosphere__cloud::after {
  content: '';
  position: absolute;
  background: inherit;
  border-radius: 50%;
}

.atmosphere__cloud--a {
  width: 110px; height: 38px;
  top: 14%; left: 4%;
  opacity: 0.55;
  animation: atmosphere-drift-right 42s ease-in-out infinite;
}
.atmosphere__cloud--a::before { width: 55px; height: 55px; top: -30px; left: 10px; }
.atmosphere__cloud--a::after  { width: 38px; height: 38px; top: -18px; left: 50px; }

.atmosphere__cloud--b {
  width: 84px; height: 30px;
  top: 28%; right: 8%;
  opacity: 0.4;
  animation: atmosphere-drift-left 58s ease-in-out infinite;
}
.atmosphere__cloud--b::before { width: 44px; height: 44px; top: -24px; left: 8px; }
.atmosphere__cloud--b::after  { width: 30px; height: 30px; top: -14px; left: 38px; }

.atmosphere__cloud--c {
  width: 150px; height: 48px;
  top: 70%; left: 58%;
  opacity: 0.32;
  animation: atmosphere-drift-right 76s ease-in-out infinite reverse;
}
.atmosphere__cloud--c::before { width: 76px; height: 76px; top: -42px; left: 16px; }
.atmosphere__cloud--c::after  { width: 52px; height: 52px; top: -28px; left: 70px; }

@keyframes atmosphere-drift-right {
  0%   { transform: translateX(0); }
  50%  { transform: translateX(34px); }
  100% { transform: translateX(0); }
}

@keyframes atmosphere-drift-left {
  0%   { transform: translateX(0); }
  50%  { transform: translateX(-26px); }
  100% { transform: translateX(0); }
}

/* ---- Floating balloon decoration ---- */
.atmosphere__balloon {
  position: absolute;
  right: -3%;
  top: 8%;
  width: clamp(120px, 14vw, 200px);
  pointer-events: none;
  z-index: 2;
  opacity: 0.85;
  filter: drop-shadow(0 18px 36px rgba(0, 0, 0, 0.35));
  animation: atmosphere-balloon-float 9s ease-in-out infinite;
}

.atmosphere__balloon--low {
  top: auto;
  bottom: 6%;
  right: 4%;
  width: clamp(90px, 10vw, 150px);
  opacity: 0.7;
  animation-duration: 11s;
  animation-delay: -3s;
}

@keyframes atmosphere-balloon-float {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50%       { transform: translateY(-14px) rotate(2deg); }
}

/* ---- Sun/moon glow accent ---- */
.atmosphere__sun {
  position: absolute;
  top: 6%;
  left: -6%;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, rgba(255, 217, 61, 0.35) 0%, rgba(255, 217, 61, 0) 65%);
  filter: blur(4px);
  pointer-events: none;
  z-index: 1;
}

/* ---- Reduced-motion: kill animation, keep visuals static ---- */
@media (prefers-reduced-motion: reduce) {
  .atmosphere__cloud,
  .atmosphere__balloon,
  .atmosphere__stars .star {
    animation: none !important;
  }
}

/* ---- Mobile: hide heavy decorations ---- */
@media (max-width: 768px) {
  .atmosphere__balloon { display: none; }
  .atmosphere__cloud--c { display: none; }
  .atmosphere__aurora { opacity: 0.7; }
}
