/* ==========================================================================
   LUXURY COSMIC ATMOSPHERE — decorative layer only (public pages)
   pointer-events: none; does not affect layout or interactions
   ========================================================================== */

.lux-atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  min-height: 100dvh;
  min-height: 100vh;
  isolation: isolate;
}

.lux-atmosphere__stack {
  position: absolute;
  inset: 0;
  min-height: 100dvh;
  min-height: 100vh;
}

/* 1) Base image + slow zoom */
.lux-atmosphere__zoom {
  position: absolute;
  inset: -3%;
  will-change: transform;
  animation: lux-bg-zoom 25s ease-in-out infinite alternate;
}

@keyframes lux-bg-zoom {
  0%   { transform: scale(1); }
  100% { transform: scale(1.05); }
}

.lux-atmosphere__image {
  position: absolute;
  inset: 0;
  background: url("/images/cosmic-crystal-bg.png") center center / cover no-repeat #050816;
}

/* 2) Edge-only cinematic blur (center stays readable) */
.lux-atmosphere__edgeblur {
  position: absolute;
  inset: -4%;
  background: url("/images/cosmic-crystal-bg.png") center center / cover no-repeat;
  filter: blur(32px);
  opacity: 0.42;
  -webkit-mask-image: radial-gradient(
    ellipse 58% 52% at 50% 45%,
    transparent 0%,
    transparent 38%,
    rgba(0, 0, 0, 0.85) 100%
  );
  mask-image: radial-gradient(
    ellipse 58% 52% at 50% 45%,
    transparent 0%,
    transparent 38%,
    rgba(0, 0, 0, 0.85) 100%
  );
  mix-blend-mode: soft-light;
}

/* 3) Depth: navy, indigo, soft purple */
.lux-atmosphere__tint {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 90% 70% at 50% 100%, rgba(5, 8, 22, 0.92) 0%, transparent 55%),
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(11, 16, 32, 0.75) 0%, transparent 50%),
    radial-gradient(ellipse 100% 80% at 50% 50%, rgba(5, 8, 22, 0.35) 0%, rgba(11, 16, 32, 0.5) 100%),
    linear-gradient(160deg, rgba(124, 77, 255, 0.14) 0%, transparent 40%, rgba(99, 102, 241, 0.08) 100%);
  mix-blend-mode: multiply;
}

/* 4) Center vignette for text readability */
.lux-atmosphere__vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 65% 55% at 50% 48%,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.18) 55%,
    rgba(0, 0, 0, 0.55) 100%
  );
  mix-blend-mode: multiply;
  pointer-events: none;
}

/* 5) Crystal corner glow — violet / blue / pink */
.lux-atmosphere__glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 45% 40% at 0% 0%, rgba(124, 77, 255, 0.22) 0%, transparent 70%),
    radial-gradient(ellipse 45% 40% at 100% 0%, rgba(168, 85, 247, 0.12) 0%, transparent 68%),
    radial-gradient(ellipse 50% 45% at 100% 100%, rgba(99, 102, 241, 0.15) 0%, transparent 72%),
    radial-gradient(ellipse 50% 45% at 0% 100%, rgba(236, 72, 153, 0.1) 0%, transparent 70%);
  mix-blend-mode: screen;
  opacity: 0.85;
}

/* 6) Twinkle layer */
.lux-atmosphere__twinkle {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 8% 12%, rgba(255, 255, 255, 0.95), transparent),
    radial-gradient(1px 1px at 22% 8%, rgba(255, 255, 255, 0.7), transparent),
    radial-gradient(1.2px 1.2px at 78% 18%, rgba(243, 207, 122, 0.9), transparent),
    radial-gradient(1px 1px at 92% 40%, rgba(255, 255, 255, 0.65), transparent),
    radial-gradient(1.5px 1.5px at 15% 55%, rgba(194, 140, 255, 0.85), transparent),
    radial-gradient(1px 1px at 45% 72%, rgba(255, 255, 255, 0.8), transparent),
    radial-gradient(1.2px 1.2px at 88% 78%, rgba(255, 255, 255, 0.75), transparent),
    radial-gradient(1px 1px at 35% 88%, rgba(243, 207, 122, 0.6), transparent),
    radial-gradient(1.3px 1.3px at 62% 6%, rgba(255, 255, 255, 0.55), transparent);
  background-size: 100% 100%;
  background-repeat: no-repeat;
  opacity: 0.5;
  animation: lux-twinkle 7s ease-in-out infinite;
}

.lux-atmosphere__twinkle::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 55% 22%, rgba(255, 255, 255, 0.9), transparent),
    radial-gradient(1.2px 1.2px at 30% 38%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1px 1px at 70% 55%, rgba(194, 140, 255, 0.8), transparent),
    radial-gradient(1.5px 1.5px at 12% 68%, rgba(255, 255, 255, 0.7), transparent),
    radial-gradient(1px 1px at 95% 12%, rgba(255, 255, 255, 0.65), transparent);
  background-size: 100% 100%;
  opacity: 0.4;
  animation: lux-twinkle 5.5s ease-in-out infinite reverse;
}

@keyframes lux-twinkle {
  0%,
  100% { opacity: 0.35; }
  50%    { opacity: 0.75; }
}

/* 7) Subtle film grain (single source — pair with reduced body::after) */
.lux-atmosphere__noise {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.045;
  mix-blend-mode: overlay;
}

/* 8) Glass veil */
.lux-atmosphere__glass {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: rgba(255, 255, 255, 0.03);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

/* Zodiac + floating crystals (ornamental) */
.lux-atmosphere__zodiac {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.19;
  mix-blend-mode: soft-light;
}

.lux-atmosphere__zodiac svg {
  width: min(88vw, 640px);
  height: auto;
  max-height: 55vh;
  filter: drop-shadow(0 0 20px rgba(243, 207, 122, 0.15));
}

.lux-atmosphere__floaters {
  position: absolute;
  inset: 0;
  z-index: 4;
}

.lux-atmosphere__crystal {
  position: absolute;
  width: 12px;
  height: 18px;
  background: linear-gradient(135deg, rgba(194, 140, 255, 0.5), rgba(99, 102, 241, 0.25), rgba(236, 72, 153, 0.2));
  clip-path: polygon(50% 0%, 100% 35%, 82% 100%, 18% 100%, 0% 35%);
  opacity: 0.35;
  filter: blur(0.3px);
  box-shadow: 0 0 18px rgba(124, 77, 255, 0.35);
  animation: lux-float 18s ease-in-out infinite;
}

.lux-atmosphere__crystal:nth-child(1) { top: 12%; left: 8%; animation-delay: 0s; }
.lux-atmosphere__crystal:nth-child(2) { top: 22%; right: 10%; width: 10px; height: 15px; animation-delay: -3s; }
.lux-atmosphere__crystal:nth-child(3) { bottom: 18%; left: 15%; width: 9px; height: 14px; animation-delay: -6s; }
.lux-atmosphere__crystal:nth-child(4) { bottom: 25%; right: 12%; animation-delay: -9s; }
.lux-atmosphere__crystal:nth-child(5) { top: 45%; left: 4%; width: 8px; height: 12px; animation-delay: -2s; }
.lux-atmosphere__crystal:nth-child(6) { top: 38%; right: 5%; animation-delay: -12s; }

@keyframes lux-float {
  0%,
  100% { transform: translateY(0) rotate(0deg); }
  50%    { transform: translateY(-12px) rotate(6deg); }
}

/* Public pages: let atmosphere show; keep dark fallback */
body:has(.lux-atmosphere) {
  background: #050816;
  background-image: none;
}

/* Header / preloader keep existing stacking; DOM order paints above z-index:0 atmosphere */
body:has(.lux-atmosphere) .site-header {
  z-index: 100;
}

body:has(.lux-atmosphere) .site-preloader {
  z-index: 1000;
}

/* Mobile: keep crystal corners in frame */
@media (max-width: 768px) {
  .lux-atmosphere__image,
  .lux-atmosphere__edgeblur {
    background-position: center center;
  }

  .lux-atmosphere__vignette {
    background: radial-gradient(
      ellipse 70% 60% at 50% 50%,
      rgba(0, 0, 0, 0) 0%,
      rgba(0, 0, 0, 0.22) 50%,
      rgba(0, 0, 0, 0.5) 100%
    );
  }

  .lux-atmosphere__zodiac {
    opacity: 0.12;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lux-atmosphere__zoom,
  .lux-atmosphere__twinkle,
  .lux-atmosphere__twinkle::after,
  .lux-atmosphere__crystal {
    animation: none;
  }
}
