/**
 * LYOR Atmosphere v2.1 — cinematic hotel-grade surface system.
 * Hero: light sweep + grain on imagery (no milky overlay).
 * Card: inset frosted panel with rim light + depth.
 */

.lyor-atmo-v2,
.lyor-atmo-v2-yes,
.lyor-atmosphere.lyor-atmo-v2 {
  --lyor-accent-rgb: 197, 160, 89;
  --lyor-light-x: 50%;
  --lyor-light-y: 40%;
  --lyor-light-x-2: 62%;
  --lyor-light-y-2: 58%;
  --lyor-light-angle: 0deg;
  --lyor-shift-x: 0px;
  --lyor-shift-y: 0px;
  --lyor-scroll-parallax: 0px;
  --lyor-intensity-mul: 1;
  --lyor-glass-blur: 22px;
  --lyor-glass-opacity: 0.07;
  --lyor-glass-inset: clamp(14px, 2.8vw, 36px);
  --lyor-grain-opacity: 0.09;
  --lyor-specular-strength: 0.11;
  --lyor-orbit-duration: 48s;
  --lyor-depth: 5px;
  --lyor-shadow-opacity: 0.16;
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.lyor-atmo-v2.e-con > .e-con-inner,
.lyor-atmo-v2-yes.e-con > .e-con-inner,
.elementor-section.lyor-atmo-v2 > .elementor-container {
  width: 100% !important;
  max-width: 100% !important;
  margin-inline: 0 !important;
  position: relative;
  z-index: 2;
}

/* —— A: Soft ambient glow (no light beam / no conic streak) —— */
.lyor-atmo-v2.e-con::before,
.lyor-atmo-v2-yes.e-con::before,
.elementor-section.lyor-atmo-v2::before {
  content: "";
  position: absolute;
  inset: -15%;
  z-index: 1;
  pointer-events: none;
  mix-blend-mode: soft-light;
  opacity: calc(var(--lyor-specular-strength, 0.11) * var(--lyor-intensity-mul, 1) * 0.55);
  transform: translate3d(
    calc(var(--lyor-shift-x) * 0.35),
    calc((var(--lyor-shift-y) + var(--lyor-scroll-parallax)) * 0.35),
    0
  );
  background:
    radial-gradient(
      95% 75% at var(--lyor-light-x) var(--lyor-light-y),
      rgba(255, 252, 245, 0.09) 0%,
      rgba(var(--lyor-accent-rgb), 0.05) 42%,
      transparent 72%
    ),
    radial-gradient(
      80% 65% at var(--lyor-light-x-2) var(--lyor-light-y-2),
      rgba(255, 255, 255, 0.05) 0%,
      transparent 68%
    ),
    radial-gradient(
      120% 90% at 50% 12%,
      rgba(var(--lyor-accent-rgb), 0.04) 0%,
      transparent 55%
    );
  filter: blur(42px);
  will-change: transform;
}

/* —— B: Film grain (fine, cinematic) —— */
.lyor-atmo-v2[data-lyor-atmo-grain="yes"].e-con::after,
.lyor-atmo-v2-yes[data-lyor-atmo-grain="yes"].e-con::after,
.lyor-atmo-v2[data-lyor-atmo-grain="yes"].elementor-section::after {
  content: "";
  position: absolute;
  inset: -8%;
  z-index: 4;
  pointer-events: none;
  opacity: calc(var(--lyor-grain-opacity, 0.09) * var(--lyor-intensity-mul, 1));
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 600 600' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.05' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)' opacity='0.42'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  animation: lyor-atmo-grain-drift 12s steps(8) infinite;
}

/* —— C: Card — inset glass panel (premium UI, not full-screen frost) —— */
.lyor-atmo-v2[data-lyor-atmo-surface="card"][data-lyor-atmo-glass="yes"].e-con > .e-con-inner::before,
.lyor-atmo-v2-yes[data-lyor-atmo-surface="card"][data-lyor-atmo-glass="yes"].e-con > .e-con-inner::before {
  content: "";
  position: absolute;
  inset: var(--lyor-glass-inset, clamp(14px, 2.8vw, 36px));
  z-index: 0;
  pointer-events: none;
  border-radius: inherit;
  backdrop-filter: blur(var(--lyor-glass-blur, 22px)) saturate(1.28) brightness(1.04);
  -webkit-backdrop-filter: blur(var(--lyor-glass-blur, 22px)) saturate(1.28) brightness(1.04);
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.14) 0%,
    rgba(255, 255, 255, 0.03) 38%,
    rgba(8, 10, 14, calc(var(--lyor-glass-opacity, 0.07) + 0.02)) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow:
    0 28px 90px rgba(0, 0, 0, 0.38),
    0 0 0 1px rgba(var(--lyor-accent-rgb), 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -32px 64px rgba(0, 0, 0, calc(var(--lyor-shadow-opacity, 0.16) * 0.45));
}

/* Card depth vignette inside panel */
.lyor-atmo-v2[data-lyor-atmo-surface="card"][data-lyor-atmo-glass="yes"].e-con > .e-con-inner::after,
.lyor-atmo-v2-yes[data-lyor-atmo-surface="card"][data-lyor-atmo-glass="yes"].e-con > .e-con-inner::after {
  content: "";
  position: absolute;
  inset: var(--lyor-glass-inset, clamp(14px, 2.8vw, 36px));
  z-index: 0;
  pointer-events: none;
  border-radius: inherit;
  mix-blend-mode: multiply;
  opacity: calc(var(--lyor-shadow-opacity, 0.16) * var(--lyor-intensity-mul, 1));
  background:
    radial-gradient(120% 90% at 50% 108%, rgba(0, 0, 0, 0.42), transparent 55%),
    radial-gradient(70% 50% at 0% 0%, rgba(0, 0, 0, 0.08), transparent 50%),
    radial-gradient(70% 50% at 100% 0%, rgba(0, 0, 0, 0.08), transparent 50%);
}

/* Hero — no glass panel; cinematic edge + letterbox depth only */
.lyor-atmo-v2[data-lyor-atmo-surface="hero"].e-con > .e-con-inner::before,
.lyor-atmo-v2-yes[data-lyor-atmo-surface="hero"].e-con > .e-con-inner::before {
  content: none !important;
  display: none !important;
}

.lyor-atmo-v2[data-lyor-atmo-surface="hero"].e-con > .e-con-inner::after,
.lyor-atmo-v2-yes[data-lyor-atmo-surface="hero"].e-con > .e-con-inner::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  border-radius: inherit;
  mix-blend-mode: multiply;
  opacity: calc(var(--lyor-shadow-opacity, 0.16) * var(--lyor-intensity-mul, 1) * 1.1);
  background:
    radial-gradient(140% 95% at 50% 100%, rgba(0, 0, 0, 0.48), transparent 62%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.18) 0%, transparent 22%, transparent 78%, rgba(0, 0, 0, 0.22) 100%),
    radial-gradient(90% 60% at 50% 0%, rgba(var(--lyor-accent-rgb), 0.06), transparent 50%);
}

.lyor-atmo-v2 > .e-con-inner > *,
.lyor-atmo-v2-yes > .e-con-inner > * {
  position: relative;
  z-index: 1;
}

.lyor-atmo-v2[data-lyor-atmo-active="1"].e-con::before {
  opacity: calc(var(--lyor-specular-strength, 0.11) * var(--lyor-intensity-mul, 1) * 0.72);
}

.elementor-editor-active .lyor-atmo-v2-yes.e-con::before {
  opacity: calc(var(--lyor-specular-strength, 0.11) * var(--lyor-intensity-mul, 1) * 0.58);
}

@keyframes lyor-atmo-grain-drift {
  0% { transform: translate3d(0, 0, 0); }
  20% { transform: translate3d(-1.5%, 0.8%, 0); }
  40% { transform: translate3d(1%, -1.2%, 0); }
  60% { transform: translate3d(1.8%, 1%, 0); }
  80% { transform: translate3d(-0.8%, -0.6%, 0); }
  100% { transform: translate3d(0, 0, 0); }
}

@media (max-width: 767px) {
  .lyor-atmo-v2 {
    --lyor-glass-blur: calc(var(--lyor-glass-blur, 22px) * 0.82);
    --lyor-glass-inset: clamp(10px, 4vw, 22px);
  }

  .lyor-atmo-v2.e-con::before,
  .lyor-atmo-v2-yes.e-con::before {
    opacity: calc(var(--lyor-specular-strength, 0.11) * var(--lyor-intensity-mul, 1) * 0.5);
    filter: blur(32px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .lyor-atmo-v2[data-lyor-atmo-grain="yes"].e-con::after {
    animation: none;
  }
}
