/**
 * Snapmaker Neo-Hero Slider Styles
 * Apple / DJI / Nothing Tech Aesthetic
 */

:root,
.snap-hero-section {
  --snap-orange: #FF5A00;
  --snap-orange-hover: #ff6f1f;
  --snap-orange-glow: rgba(255, 90, 0, 0.35);
  --snap-dark-bg: #0b0f17;
  --snap-white: #ffffff;
  --snap-hero-subtitle-color: #f1f5f9;
  --snap-glass-bg: rgba(17, 24, 39, 0.65);
  --snap-glass-border: rgba(255, 255, 255, 0.15);
  --snap-container-max: 1440px;
}

.snap-hero-section {
  position: relative;
  width: 100%;
  height: 92vh;
  min-height: 640px;
  max-height: 960px;
  background-color: var(--snap-dark-bg);
  overflow: hidden;
}

.snap-hero-swiper {
  width: 100%;
  height: 100%;
  position: relative;
}

/* Слайды */
.snap-slide {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
}

/* Фоновые изображения и градиенты */
.snap-slide-bg-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.snap-slide-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1);
  transition: transform 7s cubic-bezier(0.25, 1, 0.5, 1);
  will-change: transform;
}

.swiper-slide-active .snap-slide-bg-img {
  transform: scale(1.06);
}

.snap-slide-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    rgba(11, 15, 23, 0.88) 0%,
    rgba(11, 15, 23, 0.65) 45%,
    rgba(11, 15, 23, 0.25) 100%
  );
  z-index: 2;
}

/* Контейнер контента */
.snap-slide-container {
  position: relative;
  z-index: 5;
  width: 100%;
  max-width: var(--snap-container-max);
  margin: 0 auto;
  padding: 0 40px;
  padding-top: 40px; /* Компенсация шапки */
  box-sizing: border-box;
}

.snap-slide-content {
  max-width: 680px;
  color: var(--snap-white);
  position: relative;
  z-index: 5;
}

/* ==========================================================================
   Нелинейная кинетическая анимация появления текста (Lens Focus + Spring Physics)
   ========================================================================== */

/* Исходное состояние для неактивных слайдов (быстрый сброс без задержек при переключении) */
.snap-slide-heading,
.snap-slide-subtitle,
.snap-slide-actions {
  opacity: 0;
  will-change: transform, opacity, filter;
  transition: opacity 0.35s ease, transform 0.35s ease, filter 0.35s ease;
  transition-delay: 0s !important;
}

/* 1. Заголовок: кинематографичный выход из расфокуса и микро-наклона (Expo Deceleration) */
.snap-slide-heading {
  transform: translateY(44px) skewY(1.2deg);
  filter: blur(16px);
  transform-origin: left bottom;
}

.swiper-slide-active .snap-slide-heading {
  opacity: 1;
  transform: translateY(0) skewY(0deg);
  filter: blur(0);
  transition: 
    opacity 0.85s cubic-bezier(0.16, 1, 0.3, 1) 0.15s,
    transform 0.95s cubic-bezier(0.16, 1, 0.3, 1) 0.15s,
    filter 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.15s;
}

/* 2. Подзаголовок: мягкое скольжение и кристаллизация текста */
.snap-slide-subtitle {
  transform: translateY(30px);
  filter: blur(10px);
}

.swiper-slide-active .snap-slide-subtitle {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
  transition: 
    opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.30s,
    transform 0.85s cubic-bezier(0.16, 1, 0.3, 1) 0.30s,
    filter 0.75s ease 0.30s;
}

/* 3. Кнопки CTA: упругий тактильный отклик (Spring Overshoot) */
.snap-slide-actions {
  transform: translateY(26px) scale(0.96);
  filter: blur(8px);
  transform-origin: left center;
}

.swiper-slide-active .snap-slide-actions {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
  transition: 
    opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.45s,
    transform 0.8s cubic-bezier(0.34, 1.35, 0.64, 1) 0.45s,
    filter 0.65s ease 0.45s;
}

/* Заголовок */
.snap-slide-heading {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: clamp(2.4rem, 5.2vw, 4.2rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--snap-white);
  margin: 0 0 18px 0;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}

/* Подзаголовок */
.snap-slide-subtitle {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: clamp(1.1rem, 1.7vw, 1.35rem);
  font-weight: 450;
  line-height: 1.6;
  color: #f1f5f9 !important;
  margin: 0 0 32px 0;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.85), 0 1px 4px rgba(0, 0, 0, 0.95);
  max-width: 620px;
}

/* Кнопки */
.snap-slide-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.snap-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: 12px;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.snap-btn-primary {
  background: var(--snap-orange);
  color: var(--snap-white) !important;
  border: 1px solid transparent;
  box-shadow: 0 8px 24px var(--snap-orange-glow);
}

.snap-btn-primary:hover {
  background: var(--snap-orange-hover);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(255, 90, 0, 0.5);
  color: var(--snap-white) !important;
}

.snap-btn-primary svg {
  transition: transform 0.2s ease;
}

.snap-btn-primary:hover svg {
  transform: translateX(3px);
}

.snap-btn-ghost {
  background: rgba(255, 255, 255, 0.1);
  color: var(--snap-white) !important;
  border: 1px solid var(--snap-glass-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.snap-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  color: var(--snap-white) !important;
}

/* ==========================================================================
   Сегментированный таймлайн-прогресс бар (Apple / DJI Style)
   ========================================================================== */
.snap-hero-timeline-container {
  position: absolute;
  bottom: 35px;
  left: 0;
  width: 100%;
  z-index: 10;
  pointer-events: none;
}

.snap-hero-timeline {
  max-width: var(--snap-container-max);
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  gap: 16px;
  pointer-events: auto;
}

.snap-timeline-segment {
  flex: 1;
  background: transparent;
  border: none;
  padding: 8px 0;
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: opacity 0.2s ease;
  opacity: 0.65;
}

.snap-timeline-segment:hover {
  opacity: 1;
}

.snap-timeline-segment.is-active {
  opacity: 1;
}

.snap-timeline-track {
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.22);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.snap-timeline-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: var(--snap-orange);
  border-radius: 4px;
}

.snap-timeline-segment.is-active .snap-timeline-fill {
  /* Заполнение анимируется через JavaScript requestAnimationFrame для точности */
}

.snap-timeline-segment.is-passed .snap-timeline-fill {
  width: 100%;
}

.snap-timeline-title {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--snap-white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
  display: block;
}

/* ==========================================================================
   Адаптивность для мобильных и планшетов
   ========================================================================== */
@media (max-width: 1024px) {
  .snap-hero-section {
    height: 85vh;
    min-height: 560px;
  }
  .snap-slide-container {
    padding: 0 24px;
    padding-top: 30px;
  }
  .snap-hero-timeline {
    padding: 0 24px;
    gap: 10px;
  }
  .snap-timeline-title {
    font-size: 11px;
  }
}

@media (max-width: 768px) {
  .snap-hero-section {
    height: 90vh;
    min-height: 520px;
    max-height: none;
  }
  .snap-slide-container {
    padding: 0 20px;
    padding-top: 40px;
  }
  .snap-slide-overlay {
    background: linear-gradient(
      180deg,
      rgba(11, 15, 23, 0.6) 0%,
      rgba(11, 15, 23, 0.4) 40%,
      rgba(11, 15, 23, 0.9) 100%
    );
  }
  .snap-slide-heading {
    font-size: 2.2rem;
    margin-bottom: 12px;
  }
  .snap-slide-subtitle {
    font-size: 1rem;
    margin-bottom: 24px;
  }
  .snap-btn {
    padding: 12px 22px;
    font-size: 14px;
  }
  .snap-hero-timeline-container {
    bottom: 20px;
  }
  .snap-hero-timeline {
    padding: 0 20px;
    gap: 8px;
  }
  .snap-timeline-title {
    display: none; /* На экранах смартфонов скрываем подписи, оставляя аккуратный таймлайн */
  }
  .snap-timeline-track {
    height: 3px;
  }
}
