/* ==========================================================================
   CSS VARIABLES
   ========================================================================== */
:root {
  --bg-base: #05030a;
  --bg-black: #000000;
  --bg-overlay: rgba(5, 3, 10, 0.42);
  --border-subtle: rgba(255, 255, 255, 0.14);

  /* Neon Accents */
  --neon-violet: #9d4edd;
  --neon-magenta: #ff2e93;
  --neon-blue: #38bdf8;
  --neon-lime: #a3e635;

  /* Tunable FX */
  --glow-opacity: 0.78;
  --glow-scale: 1.72;
  --glow-blur: 20px;
  --prism-opacity: 0.36;

  /* Motion */
  --ease-cinematic: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 0.6s;

  /* Layout */
  --radius-card: 24px;
  --card-size: min(86vw, 460px);
}

/* ==========================================================================
   RESET & BASE
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  background-color: var(--bg-base);
  overflow-x: clip;
}

body {
  min-height: 100svh;
  background-color: var(--bg-base);
  overflow-x: clip;
}

video {
  display: block;
  background-color: var(--bg-black);
  pointer-events: none;
}

/* ==========================================================================
   0) GLOBAL FIXED BACKGROUND
   ========================================================================== */
.global-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-color: var(--bg-base);
  overflow: hidden;
  pointer-events: none;
}

.global-bg__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.global-bg__overlay {
  position: absolute;
  inset: 0;
  background: var(--bg-overlay);
}

.global-bg__vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    transparent 35%,
    rgba(0, 0, 0, 0.65) 100%
  );
}

/* ==========================================================================
   1) HERO SECTION (Mobile-First: Full Frame / Desktop: Cover)
   ========================================================================== */
.hero {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding-bottom: calc(2.25rem + env(safe-area-inset-bottom));
  overflow: hidden;
}

.hero__media {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 75%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 75%, transparent 100%);
}

.hero__video {
  width: 100%;
  height: 100%;
  /* در موبایل کل عرض ویدیو و متن‌ها بدون برش نمایش داده می‌شود */
  object-fit: contain;
  object-position: center;
  mix-blend-mode: screen;
  background-color: transparent;
}

/* در دسکتاپ و نمایشگرهای افقی تمام‌صفحه شود */
@media (min-width: 768px) and (orientation: landscape) {
  .hero__video {
    object-fit: cover;
  }

  .hero__media {
    -webkit-mask-image: linear-gradient(to bottom, #000 65%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 65%, transparent 100%);
  }
}

.hero__feather {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 30%;
  z-index: 2;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(5, 3, 10, 0.55) 60%,
    rgba(5, 3, 10, 0.96) 100%
  );
  pointer-events: none;
}

/* Text-free Scroll Indicator */
.scroll-indicator {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.scroll-indicator__mouse {
  width: 24px;
  height: 38px;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  display: flex;
  justify-content: center;
  padding-top: 6px;
}

.scroll-indicator__dot {
  width: 4px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(to bottom, var(--neon-blue), var(--neon-magenta));
  animation: scrollDot 1.8s var(--ease-cinematic) infinite;
}

@keyframes scrollDot {
  0% {
    opacity: 0;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
  }
  80% {
    opacity: 0;
    transform: translateY(14px);
  }
  100% {
    opacity: 0;
    transform: translateY(14px);
  }
}

/* ==========================================================================
   2) PRISM ACCENTS (Bridge & End)
   ========================================================================== */
.prism-bridge {
  position: relative;
  height: 28svh;
  margin-top: -8svh;
  overflow: hidden;
  pointer-events: none;
}

.prism-layer {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.prism-video {
  height: 125%;
  width: auto;
  max-width: 100%;
  object-fit: cover;
  mix-blend-mode: screen;
  opacity: var(--prism-opacity);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 35%, transparent 78%);
  mask-image: radial-gradient(ellipse at center, #000 35%, transparent 78%);
}

.is-low-power .prism-layer {
  display: none;
}

/* ==========================================================================
   3) SLIDESHOW SECTION (6 Square Videos)
   ========================================================================== */
.slides-section {
  position: relative;
  height: 560svh;
  margin-top: -4svh;
}

.slides-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.75rem;
  padding: 1rem 1rem calc(1.5rem + env(safe-area-inset-bottom));
  overflow: hidden;
}

.slides-stage {
  position: relative;
  width: var(--card-size);
  height: var(--card-size);
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: pan-y;
}

/* Glow behind active card */
.slides-glow {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transform: scale(var(--glow-scale));
  opacity: var(--glow-opacity);
  will-change: transform, opacity;
}

.slides-glow__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  mix-blend-mode: screen;
  filter: blur(var(--glow-blur)) saturate(1.3);
  border-radius: 32px;
}

/* Stacked 1:1 Cards */
.slides-stack {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 5;
}

.slide-card {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-card);
  overflow: hidden;
  background-color: var(--bg-black);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.72);
  will-change: transform, opacity;
  transform-origin: center center;
}

.slide-card.is-active {
  border-color: rgba(255, 255, 255, 0.28);
}

.slide-card__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Desktop Prev / Next Arrows */
.slide-nav {
  display: none;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: rgba(10, 6, 20, 0.65);
  color: #f7f5ff;
  backdrop-filter: blur(10px);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: transform var(--dur-fast) var(--ease-cinematic),
              opacity var(--dur-fast) var(--ease-cinematic),
              border-color 0.3s ease;
}

.slide-nav:hover:not(:disabled) {
  border-color: var(--neon-magenta);
  transform: translateY(-50%) scale(1.06);
}

.slide-nav:disabled {
  opacity: 0.28;
  cursor: not-allowed;
}

.slide-nav--prev {
  right: -72px;
}

.slide-nav--next {
  left: -72px;
}

/* Dot Indicators */
.slides-dots {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}

.slide-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.24);
  cursor: pointer;
  padding: 0;
  transition: transform 0.45s var(--ease-cinematic),
              opacity 0.45s var(--ease-cinematic),
              background-color 0.35s ease;
}

.slide-dot.is-active {
  background: linear-gradient(90deg, var(--neon-violet), var(--neon-magenta));
  transform: scale(1.45);
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS
   ========================================================================== */
@media (min-width: 768px) {
  :root {
    --card-size: min(62vh, 500px);
  }

  .slide-nav {
    display: inline-flex;
  }
}

@media (min-width: 1024px) {
  :root {
    --card-size: min(66vh, 540px);
  }

  .slide-nav--prev {
    right: -88px;
  }

  .slide-nav--next {
    left: -88px;
  }
}

/* ==========================================================================
   PREFERS-REDUCED-MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .scroll-indicator__dot {
    animation: none;
  }

  .prism-layer {
    display: none;
  }

  .slides-section {
    height: auto;
    padding: 3rem 0;
  }

  .slides-sticky {
    position: relative;
    height: auto;
  }
}
/* ==========================================================================
   4) TELEGRAM REGISTRATION CTA
   ========================================================================== */
.telegram-cta {
  position: relative;
  min-height: 45svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 1.25rem calc(4.5rem + env(safe-area-inset-bottom));
  overflow: hidden;
}

.telegram-btn {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.05rem 2rem;
  max-width: 92vw;
  font-family: system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  font-size: clamp(0.95rem, 3.6vw, 1.12rem);
  font-weight: 700;
  color: #f7f5ff;
  text-decoration: none;
  border-radius: 999px;
  border: 1.5px solid transparent;
  background-image:
    linear-gradient(rgba(10, 6, 20, 0.88), rgba(10, 6, 20, 0.88)),
    linear-gradient(120deg, var(--neon-blue), var(--neon-violet), var(--neon-magenta));
  background-origin: border-box;
  background-clip: padding-box, border-box;
  backdrop-filter: blur(12px);
  box-shadow:
    0 0 26px rgba(56, 189, 248, 0.35),
    0 12px 32px rgba(0, 0, 0, 0.6);
  transition: transform var(--dur-fast) var(--ease-cinematic),
              box-shadow var(--dur-fast) var(--ease-cinematic);
}

.telegram-btn__icon {
  color: var(--neon-blue);
  flex-shrink: 0;
  filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.65));
}

.telegram-btn:hover,
.telegram-btn:focus-visible {
  transform: translateY(-3px) scale(1.03);
  box-shadow:
    0 0 32px rgba(56, 189, 248, 0.55),
    0 0 54px rgba(255, 46, 147, 0.35);
  outline: none;
}

.telegram-btn:active {
  transform: translateY(0) scale(0.98);
}