/* ============================================================
   screensaver.css — видео-скринсейвер с CTA-оверлеем
   Видео крутится непрерывно (loop). Поверх — затемнение и кнопка.
   Если видео не подгрузилось — fallback с фоном и логотипом.
   ============================================================ */

.screensaver {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
  background: #000;
  opacity: 1;
  transition: opacity var(--dur-slow) var(--ease-out);
}

.screensaver.is-leaving {
  opacity: 0;
  pointer-events: none;
}
.screensaver.is-entering {
  animation: screensaverFadeIn var(--dur-slow) var(--ease-out);
}

@keyframes screensaverFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ---------- Видео-фон ---------- */
.screensaver__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  background: #000;
  z-index: 1;
  pointer-events: none;
}

/* ---------- Fallback (если видео не загрузилось) ---------- */
.screensaver__fallback {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: none;
}
.screensaver.no-video .screensaver__video { display: none; }
.screensaver.no-video .screensaver__fallback { display: block; }

.screensaver__bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 30%,
      rgba(239, 49, 36, 0.35) 0%,
      rgba(239, 49, 36, 0.10) 35%,
      transparent 70%),
    radial-gradient(ellipse 60% 50% at 20% 90%,
      rgba(239, 49, 36, 0.18) 0%,
      transparent 60%),
    linear-gradient(180deg, #110505 0%, #0A0303 50%, #050101 100%);
  animation: bgPulse 12s ease-in-out infinite;
}
@keyframes bgPulse {
  0%, 100% { transform: scale(1);    opacity: 1; }
  50%      { transform: scale(1.05); opacity: 0.92; }
}

.screensaver__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, black 30%, transparent 80%);
}

.screensaver__fallback-content {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.screensaver__logo {
  width: 540px;
  filter: drop-shadow(0 8px 40px rgba(239, 49, 36, 0.4));
}
.screensaver__logo img { width: 100%; height: auto; }

/* ---------- Затемнение под CTA ---------- */
.screensaver__scrim {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(180deg,
    rgba(0, 0, 0, 0.0)  0%,
    rgba(0, 0, 0, 0.0) 45%,
    rgba(0, 0, 0, 0.55) 80%,
    rgba(0, 0, 0, 0.85) 100%);
}

/* ---------- CTA-оверлей ---------- */
.screensaver__overlay {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  padding-bottom: 96px;
  text-align: center;
  animation: overlayRise 1100ms var(--ease-out) both;
}

@keyframes overlayRise {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

.screensaver__tagline {
  margin: 0;
  font-size: 30px;
  font-weight: 300;
  letter-spacing: 0.06em;
  color: var(--alfa-white);
  text-transform: uppercase;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.8);
}

.screensaver__cta {
  position: relative;
  padding: 28px 80px;
  border: 2px solid var(--alfa-red);
  border-radius: 100px;
  background: rgba(239, 49, 36, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--alfa-white);
  font-size: 26px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  overflow: visible;
  transition: transform var(--dur-base) var(--ease-out),
              background var(--dur-base) var(--ease-out);
  box-shadow: 0 0 80px rgba(239, 49, 36, 0.45),
              0 12px 40px rgba(0, 0, 0, 0.6),
              inset 0 0 30px rgba(239, 49, 36, 0.1);
}

.screensaver__cta:active {
  transform: scale(0.97);
  background: rgba(239, 49, 36, 0.3);
}

.screensaver__cta-pulse {
  position: absolute;
  inset: -2px;
  border-radius: 100px;
  border: 2px solid var(--alfa-red);
  pointer-events: none;
  animation: ctaPulse 2.4s ease-out infinite;
}

@keyframes ctaPulse {
  0%   { transform: scale(1);    opacity: 0.9; }
  70%  { transform: scale(1.18); opacity: 0;   }
  100% { transform: scale(1.18); opacity: 0;   }
}

.screensaver__cta-label { position: relative; z-index: 1; }
