/* ============================================================
   Frugal Meals — Luxury Animated Background
   ============================================================ */

/* ── BASE ── */
.luxury-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: #030308;
}

/* ── MESH GRADIENT (layered moving blobs) ── */
.mesh-layer {
  position: absolute;
  inset: -50%;
  width: 200%;
  height: 200%;
}

.mesh-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  mix-blend-mode: screen;
  will-change: transform;
}

/* Primary purple orb */
.mesh-blob-1 {
  width: 60vmax;
  height: 60vmax;
  background: radial-gradient(circle, rgba(124,58,237,0.25) 0%, rgba(124,58,237,0) 70%);
  top: -10%;
  left: -5%;
  animation: meshDrift1 25s ease-in-out infinite;
}

/* Blue accent orb */
.mesh-blob-2 {
  width: 50vmax;
  height: 50vmax;
  background: radial-gradient(circle, rgba(59,130,246,0.18) 0%, rgba(59,130,246,0) 70%);
  bottom: -15%;
  right: -10%;
  animation: meshDrift2 30s ease-in-out infinite;
}

/* Teal subtle orb */
.mesh-blob-3 {
  width: 45vmax;
  height: 45vmax;
  background: radial-gradient(circle, rgba(20,184,166,0.08) 0%, rgba(20,184,166,0) 70%);
  top: 40%;
  left: 30%;
  animation: meshDrift3 35s ease-in-out infinite;
}

/* Rose/warm accent orb (very subtle) */
.mesh-blob-4 {
  width: 40vmax;
  height: 40vmax;
  background: radial-gradient(circle, rgba(244,114,182,0.06) 0%, rgba(244,114,182,0) 70%);
  top: 20%;
  right: 10%;
  animation: meshDrift4 28s ease-in-out infinite;
}

/* Deep purple center glow */
.mesh-blob-5 {
  width: 70vmax;
  height: 70vmax;
  background: radial-gradient(circle, rgba(91,33,182,0.12) 0%, transparent 60%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: meshPulse 20s ease-in-out infinite;
}

@keyframes meshDrift1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(8vw, 5vh) scale(1.1); }
  50% { transform: translate(-3vw, 10vh) scale(0.95); }
  75% { transform: translate(5vw, -5vh) scale(1.05); }
}
@keyframes meshDrift2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(-6vw, -8vh) scale(1.08); }
  50% { transform: translate(4vw, -3vh) scale(0.92); }
  75% { transform: translate(-5vw, 6vh) scale(1.03); }
}
@keyframes meshDrift3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(10vw, -6vh) scale(1.12); }
  66% { transform: translate(-8vw, 8vh) scale(0.9); }
}
@keyframes meshDrift4 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-12vw, 4vh) scale(1.15); }
  66% { transform: translate(6vw, -10vh) scale(0.88); }
}
@keyframes meshPulse {
  0%, 100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 0.6; transform: translate(-50%, -50%) scale(1.15); }
}

/* ── AURORA BANDS ── */
.aurora {
  position: absolute;
  inset: 0;
  overflow: hidden;
  opacity: 0.4;
}

.aurora-band {
  position: absolute;
  width: 200%;
  height: 300px;
  left: -50%;
  filter: blur(80px);
  opacity: 0.5;
  mix-blend-mode: screen;
}

.aurora-band-1 {
  top: 8%;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(124,58,237,0.15) 20%,
    rgba(59,130,246,0.12) 40%,
    rgba(124,58,237,0.08) 60%,
    transparent 80%
  );
  animation: auroraShift1 40s ease-in-out infinite;
  transform: rotate(-3deg);
}

.aurora-band-2 {
  top: 35%;
  background: linear-gradient(90deg,
    transparent 10%,
    rgba(20,184,166,0.06) 30%,
    rgba(124,58,237,0.1) 50%,
    rgba(59,130,246,0.06) 70%,
    transparent 90%
  );
  animation: auroraShift2 50s ease-in-out infinite;
  transform: rotate(2deg);
  height: 200px;
}

.aurora-band-3 {
  bottom: 15%;
  background: linear-gradient(90deg,
    transparent 5%,
    rgba(59,130,246,0.08) 25%,
    rgba(124,58,237,0.12) 50%,
    rgba(244,114,182,0.04) 75%,
    transparent 95%
  );
  animation: auroraShift3 35s ease-in-out infinite;
  transform: rotate(-1.5deg);
  height: 250px;
}

@keyframes auroraShift1 {
  0%, 100% { transform: rotate(-3deg) translateX(0); opacity: 0.5; }
  50% { transform: rotate(-3deg) translateX(-15%); opacity: 0.7; }
}
@keyframes auroraShift2 {
  0%, 100% { transform: rotate(2deg) translateX(0); opacity: 0.4; }
  50% { transform: rotate(2deg) translateX(10%); opacity: 0.6; }
}
@keyframes auroraShift3 {
  0%, 100% { transform: rotate(-1.5deg) translateX(0); opacity: 0.45; }
  50% { transform: rotate(-1.5deg) translateX(-12%); opacity: 0.65; }
}

/* ── STARFIELD ── */
.starfield {
  position: absolute;
  inset: 0;
}

.star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: #fff;
  border-radius: 50%;
  animation: starTwinkle var(--dur) ease-in-out infinite;
  animation-delay: var(--delay);
  opacity: 0;
}

.star.bright {
  width: 3px;
  height: 3px;
  box-shadow: 0 0 6px rgba(255,255,255,0.3), 0 0 12px rgba(167,139,250,0.15);
}

@keyframes starTwinkle {
  0%, 100% { opacity: 0; }
  50% { opacity: var(--max-opacity, 0.6); }
}

/* ── GRID OVERLAY ── */
.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(124,58,237,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124,58,237,0.02) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: radial-gradient(ellipse 70% 50% at 50% 30%, rgba(0,0,0,0.6) 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 70% 50% at 50% 30%, rgba(0,0,0,0.6) 0%, transparent 70%);
}

/* ── NOISE TEXTURE ── */
.noise-texture {
  position: absolute;
  inset: 0;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* ── VIGNETTE ── */
.vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(3,3,8,0.7) 100%);
}

/* ── SPOTLIGHT (hero area accent) ── */
.spotlight {
  position: absolute;
  width: 100%;
  height: 600px;
  top: 0;
  left: 0;
  background: radial-gradient(ellipse 50% 80% at 50% 0%, rgba(124,58,237,0.08) 0%, transparent 70%);
  pointer-events: none;
}

/* ── REDUCED MOTION ── */
@media (prefers-reduced-motion: reduce) {
  .mesh-blob,
  .aurora-band,
  .star {
    animation: none !important;
  }
  .mesh-blob { opacity: 0.8; }
  .aurora-band { opacity: 0.4; }
  .star { opacity: 0.3; }
}

/* ── MOBILE PERFORMANCE ── */
/* On mobile: replace ALL animated layers with a single static gradient.
   Zero blur, zero animation, zero compositing layers = 60fps scrolling. */
@media (max-width: 768px) {
  .luxury-bg {
    background:
      radial-gradient(ellipse 80% 50% at 50% 0%, rgba(124,58,237,0.18) 0%, transparent 60%),
      radial-gradient(ellipse 60% 40% at 80% 100%, rgba(59,130,246,0.10) 0%, transparent 50%),
      radial-gradient(ellipse 50% 50% at 20% 60%, rgba(91,33,182,0.08) 0%, transparent 50%),
      #030308;
  }
  .mesh-layer,
  .aurora,
  .starfield,
  .noise-texture,
  .grid-overlay,
  .spotlight {
    display: none !important;
  }
  /* Keep vignette — it's a single static gradient, cheap */
}
