/**
 * Премиум FX: слои частиц, параллакс, 3D-глубина (палитра ЛК).
 */

.site-premium.premium-fx-on [data-fx-theme] {
  position: relative;
  isolation: isolate;
}

.fx-canvas-wrap,
.fx-decor {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.fx-canvas-wrap .fx-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Параллакс-слои (задаётся из JS через transform) */
[data-parallax] {
  will-change: transform;
}

/* 3D-наклон */
[data-tilt-3d] {
  position: relative;
  transform-style: preserve-3d;
  transform: rotateX(var(--tilt-rx, 0deg)) rotateY(var(--tilt-ry, 0deg));
  transition:
    transform var(--dur-mid, 320ms) var(--ease-premium-soft, cubic-bezier(0.22, 1, 0.36, 1)),
    box-shadow var(--dur-mid, 320ms) var(--ease-premium-soft, cubic-bezier(0.22, 1, 0.36, 1));
  will-change: transform;
}

[data-tilt-3d].is-tilt-active {
  transition: transform 90ms ease-out, box-shadow var(--dur-mid, 320ms) var(--ease-premium-soft, cubic-bezier(0.22, 1, 0.36, 1));
}

.tilt-3d-shine {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--dur-mid, 320ms) var(--ease-premium-soft, cubic-bezier(0.22, 1, 0.36, 1));
  background: radial-gradient(
    circle at var(--tilt-gx, 50%) var(--tilt-gy, 50%),
    rgba(255, 255, 255, 0.34) 0%,
    transparent 55%
  );
  z-index: 6;
  mix-blend-mode: soft-light;
}

[data-tilt-3d].is-tilt-active .tilt-3d-shine,
[data-tilt-3d]:hover .tilt-3d-shine {
  opacity: 1;
}

/* Hero — глубина витрины */
.site-premium.premium-fx-on .hero.hero--rich .hero-media--rich {
  perspective: 1400px;
  perspective-origin: 50% 40%;
}

.site-premium.premium-fx-on .hero-showcase--rich[data-tilt-3d] {
  transform: rotateX(var(--tilt-rx, 0deg)) rotateY(var(--tilt-ry, 0deg));
}

.site-premium.premium-fx-on .hero__bg [data-parallax] {
  transition: transform 0.12s linear;
}

/* Карточки с «дорогой» глубиной.
   Фикс: inset-белая «полоска» сверху давала видимую горизонтальную линию-тень
   в верхней части карточек bento — убрана. Осталась только мягкая нижняя тень. */
.site-premium.premium-fx-on .bento-card[data-tilt-3d],
.site-premium.premium-fx-on .price-card--cinematic[data-tilt-3d],
.site-premium.premium-fx-on .ladder-card--stacked[data-tilt-3d],
.site-premium.premium-fx-on .scenarios-detail__card[data-tilt-3d],
.site-premium.premium-fx-on .grafdoc-section__preview[data-tilt-3d],
.site-premium.premium-fx-on .deploy-hub__card[data-tilt-3d] {
  box-shadow: 0 24px 52px rgba(45, 128, 194, calc(0.07 + var(--tilt-glow, 0) * 0.12));
}

.site-premium.premium-fx-on .price-card--featured[data-tilt-3d] {
  box-shadow:
    0 0 0 1px rgba(45, 128, 194, 0.12),
    0 32px 72px rgba(45, 128, 194, calc(0.16 + var(--tilt-glow, 0) * 0.2));
}

/* Плавающие 3D-орбы (CSS, дополняют canvas) */
.fx-depth-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(40px);
  opacity: 0.45;
  animation: fx-orb-float 18s ease-in-out infinite alternate;
}

.fx-depth-orb--a {
  width: min(280px, 40vw);
  height: min(280px, 40vw);
  background: radial-gradient(circle, rgba(45, 128, 194, 0.35), transparent 68%);
}

.fx-depth-orb--b {
  width: min(220px, 32vw);
  height: min(220px, 32vw);
  background: radial-gradient(circle, rgba(15, 136, 147, 0.28), transparent 70%);
  animation-delay: -6s;
}

@keyframes fx-orb-float {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  100% {
    transform: translate3d(12px, -18px, 0) scale(1.08);
  }
}

.site-premium.premium-fx-on .section-scene--pricing .fx-depth-orb--a {
  top: 8%;
  left: -6%;
}

.site-premium.premium-fx-on .section-scene--pricing .fx-depth-orb--b {
  bottom: 6%;
  right: -4%;
}

.site-premium.premium-fx-on .scenarios-section .fx-depth-orb--a {
  top: 12%;
  right: 4%;
  opacity: 0.32;
}

.site-premium.premium-fx-on .grafdoc-section .fx-depth-orb--b {
  bottom: 10%;
  left: 6%;
  background: radial-gradient(circle, rgba(178, 105, 20, 0.22), transparent 70%);
}

@media (max-width: 767px) {
  .site-premium.premium-fx-on [data-tilt-3d] {
    transform: none !important;
  }

  .site-premium.premium-fx-on .tilt-3d-shine {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fx-canvas-wrap,
  .fx-decor {
    display: none !important;
  }
}
