/**
 * Model Section — видео-фон с overlay (стиль как SHOWREEL)
 */

.modelSection {
  position: relative;
  min-height: clamp(400px, 100vh, 600px);
  padding: 0;
  background: #000;
  overflow: hidden;
  isolation: isolate;
  /* Переменные для плавного перехода */
  --sep-color-top: var(--color-bg);
  --sep-color-bottom: var(--color-bg);
  --sep-strength: 0.9;
}

/* Переопределяем псевдоэлементы для более мягкого перехода */
.modelSection[data-sep-top="true"]::before {
  height: clamp(80px, 12vh, 140px);
  background: linear-gradient(
    to bottom,
    var(--sep-color-top) 0%,
    rgba(0, 0, 0, 0.6) 35%,
    rgba(0, 0, 0, 0.3) 60%,
    transparent 100%
  );
  z-index: 3;
}

.modelSection[data-sep-bottom="true"]::after {
  height: clamp(80px, 12vh, 140px);
  background: linear-gradient(
    to top,
    var(--sep-color-bottom) 0%,
    rgba(0, 0, 0, 0.6) 35%,
    rgba(0, 0, 0, 0.3) 60%,
    transparent 100%
  );
  z-index: 3;
}

.modelSection-wrapper {
  position: relative;
  width: 100%;
  min-height: clamp(400px, 100vh, 1000px);
  overflow: hidden;
}

/* Video background (как в SHOWREEL) */
.modelSection-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  filter: saturate(1.05) contrast(1.05);
  z-index: 0;
}

/* Overlay (как в SHOWREEL) */
.modelSection-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(
      900px 520px at 20% 15%,
      rgba(255, 255, 255, 0.14),
      rgba(0, 0, 0, 0) 55%
    ),
    radial-gradient(
      760px 520px at 85% 70%,
      rgba(255, 255, 255, 0.1),
      rgba(0, 0, 0, 0) 60%
    ),
    linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0.78),
      rgba(0, 0, 0, 0.35) 40%,
      rgba(0, 0, 0, 0.82)
    );
  z-index: 1;
  pointer-events: none;
}

/* Content поверх видео (как showreelInner) */
.modelSection-content {
  position: relative;
  z-index: 2;
  min-height: clamp(400px, 50vh, 600px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(76px, 9vw, 120px) 0;
  max-width: 980px;
  margin: 0 auto;
  color: var(--color-text);
}

.modelSection-content .serviceHead {
  margin-bottom: var(--space-4);
}

.modelSection-content .textBox {
  width: min(980px, 100%);
  border-radius: 34px;
  padding: clamp(22px, 3vw, 34px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.36);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  color: var(--color-text);
}

.modelSection-content .textBox p {
  color: var(--color-text);
  opacity: 0.92;
  font-weight: 600;
  line-height: 1.6;
}

/* Reveal animation */
.modelSection .reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--animation-duration-slow) var(--animation-easing),
    transform var(--animation-duration-slow) var(--animation-easing);
}

.modelSection .reveal.in {
  opacity: 1;
  transform: translateY(0);
}

/* Mobile optimizations */
@media (max-width: 720px) {
  .modelSection {
    min-height: clamp(350px, 45vh, 500px);
  }

  .modelSection-wrapper {
    min-height: clamp(350px, 45vh, 500px);
  }

  .modelSection-content {
    min-height: clamp(350px, 45vh, 500px);
    padding: clamp(40px, 6vw, 60px) 0;
    max-width: 100%;
  }

  .modelSection-content .textBox {
    padding: clamp(18px, 2.5vw, 28px);
    border-radius: 24px;
  }

  /* Переходы на мобилке компактнее */
  .modelSection[data-sep-top="true"]::before,
  .modelSection[data-sep-bottom="true"]::after {
    height: clamp(50px, 8vh, 90px);
  }
}

@media (max-width: 430px) {
  .modelSection {
    min-height: clamp(300px, 40vh, 400px);
    max-height: 55vh;
  }

  .modelSection-wrapper {
    min-height: clamp(300px, 40vh, 400px);
    max-height: 55vh;
  }

  .modelSection-content {
    min-height: clamp(300px, 40vh, 400px);
    max-height: 55vh;
    padding: clamp(32px, 5vw, 48px) 0;
  }

  .modelSection-content .textBox {
    padding: clamp(16px, 2vw, 24px);
    border-radius: 20px;
  }

  /* Переходы на маленьких экранах ещё компактнее */
  .modelSection[data-sep-top="true"]::before,
  .modelSection[data-sep-bottom="true"]::after {
    height: clamp(40px, 6vh, 70px);
  }
}

/* Reduced motion: останавливаем видео, показываем poster */
@media (prefers-reduced-motion: reduce) {
  .modelSection-video {
    animation: none;
  }

  .modelSection-video[autoplay] {
    /* Останавливаем автоплей через JS, но CSS тоже помогает */
    display: block;
  }

  .modelSection .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
