/* ==============================================================
   FX BACKGROUND — аврора + canvas-сцены + SVG-декор
   Лежит между .site-bg (фото) и контентом.
   ============================================================== */
.fx {
  position: fixed; inset: 0; z-index: -1;
  pointer-events: none; overflow: hidden;
  contain: strict;
}

/* --- Аврора: 4 градиентных пятна, цвет меняется по теме секции --- */
.fx-aurora { position: absolute; inset: 0; mix-blend-mode: screen; opacity: .9; }
.fx-blob {
  position: absolute; display: block;
  width: 62vmax; height: 62vmax; border-radius: 50%;
  background: radial-gradient(closest-side, currentColor, transparent 72%);
  opacity: .28;
  transition: color 1.6s ease;
  will-change: transform;
}
.fx-blob--1 { left: -18vmax; top: -22vmax; animation: fxB1 26s ease-in-out infinite alternate; }
.fx-blob--2 { right: -22vmax; top: 8vh; animation: fxB2 32s ease-in-out infinite alternate; opacity: .24; }
.fx-blob--3 { left: 18vw; bottom: -30vmax; animation: fxB3 28s ease-in-out infinite alternate; opacity: .22; }
.fx-blob--4 { right: 10vw; bottom: -10vmax; width: 44vmax; height: 44vmax; animation: fxB4 20s ease-in-out infinite alternate; opacity: .30; }
@keyframes fxB1 { to { transform: translate3d(14vw, 10vh, 0) scale(1.15); } }
@keyframes fxB2 { to { transform: translate3d(-12vw, 18vh, 0) scale(.9); } }
@keyframes fxB3 { to { transform: translate3d(20vw, -12vh, 0) scale(1.1); } }
@keyframes fxB4 { to { transform: translate3d(-18vw, -16vh, 0) scale(1.2); } }

/* --- Canvas-сцены --- */
.fx-scenes { position: absolute; inset: 0; }
.fx-scene {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0;
  mix-blend-mode: screen;
}

/* --- SVG-декор --- */
.fx-decor { position: absolute; inset: 0; }
.fx-d {
  position: absolute; top: 0;
  opacity: .5;
  will-change: transform;
  contain: layout paint;
}
.fx-d svg { display: block; width: 100%; height: auto; overflow: visible; }
/* свечение — только у крупных «героев», один статичный фильтр на слой */
.fx-d--ufo svg, .fx-d--alien svg, .fx-d--planet svg { filter: drop-shadow(0 0 8px currentColor); }
.fx-d--sparkle { opacity: .75; }
.fx-d--comet { opacity: .6; }
.fx-d--ufo, .fx-d--alien { opacity: .62; }

/* микро-анимации внутри SVG */
.fx .a-bob   { animation: aBob 5.5s ease-in-out infinite; animation-delay: var(--dl); transform-box: fill-box; }
.fx .a-bob.slow { animation-duration: 8s; }
.fx .a-spin  { animation: aSpin 18s linear infinite; transform-box: fill-box; transform-origin: center; }
.fx .a-spin.slow { animation-duration: 40s; }
.fx .a-spin.fast { animation-duration: 6s; transform-box: view-box; transform-origin: 50px 50px; }
.fx .a-spin.rev  { animation-duration: 9s; animation-direction: reverse; transform-box: view-box; transform-origin: 50px 50px; }
.fx .a-blink { animation: aBlink 1.8s ease-in-out infinite; }
.fx .d2 { animation-delay: .6s !important; }
.fx .d3 { animation-delay: 1.2s !important; }
.fx .a-beam { animation: aBeam 3.2s ease-in-out infinite; transform-box: fill-box; transform-origin: top center; }
.fx .a-ping  { animation: aPing 3s ease-out infinite; transform-box: fill-box; transform-origin: center; }
.fx .a-ping-s { animation: aPingS 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.fx .a-dash  { animation: aDash 6s linear infinite; }
.fx .a-draw  { stroke-dasharray: 420; animation: aDraw 7s ease-in-out infinite; }
.fx .a-wave  { animation: aWave 2.4s ease-out infinite; }
.fx .a-twinkle { animation: aTwinkle 3.4s ease-in-out infinite; animation-delay: var(--dl); transform-box: fill-box; transform-origin: center; }
.fx .a-glow  { animation: aGlow 2.8s ease-in-out infinite; }
.fx .a-eyes  { animation: aEyes 6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }

@keyframes aBob   { 0%,100% { transform: translate(0,0) rotate(-3deg); } 50% { transform: translate(0,-10px) rotate(3deg); } }
@keyframes aSpin  { to { transform: rotate(360deg); } }
@keyframes aBlink { 0%,100% { opacity: .25; } 50% { opacity: 1; } }
@keyframes aBeam  { 0%,100% { opacity: .15; transform: scaleY(.7); } 50% { opacity: 1; transform: scaleY(1); } }
@keyframes aPing  { 0% { transform: scale(.4); opacity: 1; } 100% { transform: scale(4.2); opacity: 0; } }
@keyframes aPingS { 0%,100% { transform: scale(1); opacity: .6; } 50% { transform: scale(1.5); opacity: 1; } }
@keyframes aDash  { to { stroke-dashoffset: -110; } }
@keyframes aDraw  { 0% { stroke-dashoffset: 420; } 50%,70% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -420; } }
@keyframes aWave  { 0% { opacity: 0; } 30% { opacity: 1; } 100% { opacity: 0; } }
@keyframes aTwinkle { 0%,100% { transform: scale(.5) rotate(0deg); opacity: .3; } 50% { transform: scale(1.1) rotate(45deg); opacity: 1; } }
@keyframes aGlow  { 0%,100% { opacity: .4; } 50% { opacity: 1; } }
@keyframes aEyes  { 0%,44%,52%,100% { transform: scaleY(1); } 48% { transform: scaleY(.1); } }

/* --- Лёгкое зерно, чтобы градиенты не «бандились» --- */
.fx-grain {
  position: absolute; inset: -50%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
  opacity: .06; mix-blend-mode: overlay;
}

/* фото-фон приглушаем — теперь атмосферу делает fx-слой */
.site-bg__layer.is-active { opacity: .32 !important; }

/* стеклянные панели чуть прозрачнее + градиентный отлив, чтобы фон «дышал» за текстом */
.content-col section:not(#next-step) > .container {
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(139,108,255,0.10), transparent 55%),
    radial-gradient(120% 80% at 100% 100%, rgba(47,224,168,0.10), transparent 55%),
    linear-gradient(180deg, rgba(8,12,16,0.66) 0%, rgba(5,8,10,0.76) 100%) !important;
}

/* заголовки секций — Unbounded + градиент */
:root { --font-head: 'Unbounded', var(--font-display); }
.content-col h2, #next-step h2 {
  font-family: var(--font-head);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.04;
  background: linear-gradient(100deg, #F2FFFA 0%, #A8FFE2 40%, #7CF5FF 70%, #C7A8FF 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-wrap: balance;
}
.content-col h3 { font-family: var(--font-head); font-weight: 500; letter-spacing: -0.03em; }
.brand { font-family: var(--font-head); font-weight: 600; letter-spacing: -0.02em; }

.content-col h2 { overflow-wrap: anywhere; hyphens: auto; }

/* ==============================================================
   SECRET WORD — гигантские буквы-градиенты за текстом блоков
   ============================================================== */
.sw-host { position: relative; isolation: isolate; }
.sw {
  position: absolute; inset: 0; z-index: -1;
  pointer-events: none; user-select: none;
  border-radius: inherit;
  overflow: clip;                 /* clip, не hidden — иначе ломается sticky */
}
.sw-seg { position: absolute; left: 0; right: 0; }
.sw-seg > span {
  position: sticky; top: 7vh;
  display: flex; justify-content: center; align-items: center;
  height: 86vh; max-height: 100%;
  font-family: 'Unbounded', var(--font-display);
  font-weight: 900;
  line-height: .76;
  letter-spacing: -0.04em;
  white-space: nowrap;
}
.sw-seg > span::before {
  content: attr(data-l);
  background: linear-gradient(115deg,
    #ff2bd6 0%, #ffe600 14%, #00f0ff 28%, #7a5cff 42%,
    #39ff88 56%, #ff6a00 70%, #ff2bd6 84%, #ffe600 100%);
  background-size: 300% 300%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  opacity: .24;
  animation: swFlow 14s linear infinite;
  animation-delay: calc(var(--sw-k, 0) * -0.5s);   /* соседние блоки продолжают перелив друг друга */
}
@keyframes swFlow {
  0%   { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}
/* сама панель — лёгкий «кислотный» отлив, чтобы градиент читался как фон блока */
.content-col section > .container.sw-host {
  background-image:
    linear-gradient(115deg,
      color-mix(in srgb, #ff2bd6 9%, transparent),
      color-mix(in srgb, #00f0ff 7%, transparent) 40%,
      color-mix(in srgb, #ffe600 6%, transparent) 70%,
      color-mix(in srgb, #7a5cff 9%, transparent)),
    linear-gradient(180deg, rgba(8,12,16,0.70) 0%, rgba(5,8,10,0.80) 100%) !important;
}
@media (max-width: 767px) {
  .sw-seg > span { top: 10vh; height: 78vh; }
  .sw-seg > span::before { opacity: .2; }
}
@media (prefers-reduced-motion: reduce) {
  .sw-seg > span::before { animation: none; }
}

/* --- Мобила: размеры под широкий Unbounded, чтобы ничего не обрезалось --- */
@media (max-width: 900px) {
  .content-col h2, #next-step h2 { font-size: clamp(24px, 7.4vw, 34px) !important; }
  .stats strong { font-size: clamp(24px, 7.6vw, 34px) !important; letter-spacing: -0.04em; }
  .company .place { font-size: 46px !important; }
  .company--1 .place { font-size: 54px !important; }
  .company h3 { overflow-wrap: anywhere; }
}
@media (max-width: 480px) {
  .company .place { font-size: 38px !important; }
  .company--1 .place { font-size: 44px !important; }
  .company h3 { font-size: 18px !important; }
}

/* --- Мобила: меньше объектов, без blend на части слоёв --- */
@media (max-width: 767px) {
  .fx-d:nth-child(2n+1) { display: none; }
  .fx-d { opacity: .38; transform-origin: 0 0; }
  .fx-d svg { transform: scale(.7); transform-origin: 0 0; }
  .fx-grain { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .fx *, .fx *::before { animation: none !important; }
}
