/* ==========================================================================
   ОГЛАВЛЕНИЕ (block-04.css) — Блок 4: Бесплатные материалы
   1. Фон: космос → небо — один плавный градиент на ВСЮ высоту блока
   2. Кометы — верхняя зона, block-04.js
   3. Сетка 2×2 — крупные inline-видео
   4. Кнопка-якорь «Хочу больше…» → Напишите Максиму
   ========================================================================== */

.block-04 {
  background: #eef8fb;
  color: var(--color-text);
  position: relative;
  overflow-x: hidden;
  overflow-y: visible;
  margin-top: -160px;
  padding-top: calc(var(--gap-xl) + 160px);
  padding-bottom: calc(var(--gap-xl) * 2);
  min-height: 100vh;
}

/* Градиент на всю высоту блока — без скачков и без затемнения снизу */
.block-04__atmosphere {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.block-04__atmosphere-gradient {
  position: absolute;
  inset: 0;
  /* Верх (0–20%): чёрный — стык с блоком 3. Далее равномерно до светло-голубого внизу */
  background: linear-gradient(
    180deg,
    #0a0a0f 0%,
    #0a0a0f 20%,
    #0a0a10 23%,
    #0a0b12 26%,
    #0a0c15 29%,
    #0b0e19 32%,
    #0b101c 35%,
    #0c121f 38%,
    #0d1423 41%,
    #0e1627 44%,
    #0f182b 47%,
    #101a2f 50%,
    #111d34 53%,
    #132038 56%,
    #15233d 59%,
    #172742 62%,
    #1a2b48 65%,
    #1d304e 68%,
    #213655 71%,
    #253c5d 74%,
    #2a4366 77%,
    #304b6f 80%,
    #375478 83%,
    #3f5e82 86%,
    #48698c 89%,
    #527696 91%,
    #5d839f 93%,
    #6a91a8 95%,
    #78a0b2 96.5%,
    #86acc0 97.5%,
    #94b8ca 98.3%,
    #a2c4d4 98.8%,
    #b0d0de 99.2%,
    #bddce8 99.5%,
    #c9e5ef 99.7%,
    #d4edf4 99.85%,
    #dff3f8 99.92%,
    #e8f6fa 99.97%,
    #eef8fb 100%
  );
}

/* Кометы — только верхняя половина (космос / атмосфера) */
.block-04__comets-zone {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 52%;
  overflow: hidden;
}

.block-04__comets {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 2;
}

.block-04__content {
  position: relative;
  z-index: var(--z-content);
}

.block-04 .section-title {
  color: #fff;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.45);
}
.block-04 .section-title span {
  background: linear-gradient(120deg, #ffb347, #ff6b1a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
}
.block-04 .section-lead {
  color: rgba(255, 255, 255, 0.88);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
  max-width: none;
}

.block-04__samples-intro {
  text-align: center;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  margin: calc(var(--gap-lg) * -0.25) auto var(--gap-lg);
  max-width: 52ch;
}

/* 2×2 — две большие карточки в ряд, inline-видео */
.block-04__samples {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem 2.25rem;
  margin-bottom: var(--gap-xl);
}

.block-04__sample-card {
  animation: block04SampleSway 8s ease-in-out infinite;
  transition: transform 0.45s var(--ease-smooth);
}
.block-04__sample-card:nth-child(2) {
  animation-duration: 9s;
  animation-delay: -2s;
}
.block-04__sample-card:nth-child(3) {
  animation-duration: 8.5s;
  animation-delay: -4s;
  animation-direction: reverse;
}
.block-04__sample-card:nth-child(4) {
  animation-duration: 9.5s;
  animation-delay: -1s;
  animation-direction: reverse;
}

@keyframes block04SampleSway {
  0%, 100% { transform: translateX(-4px); }
  50% { transform: translateX(4px); }
}

.block-04__sample-card:hover {
  animation-play-state: paused;
  transform: scale(1.02) translateX(0);
  z-index: 2;
}

.block-04__sample-media {
  position: relative;
  aspect-ratio: 16 / 9;
  min-height: clamp(200px, 28vw, 320px);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #0a0a12;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  transition: border-color 0.45s, box-shadow 0.45s;
}
.block-04__sample-card:hover .block-04__sample-media {
  border-color: rgba(255, 159, 61, 0.4);
  box-shadow: 0 20px 56px rgba(255, 107, 26, 0.15), 0 12px 32px rgba(0, 0, 0, 0.5);
}

.block-04__sample-video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #0a0a0f;
  vertical-align: top;
}

.block-04__sample-caption {
  padding: 0.85rem 0.25rem 0;
}

.block-04__sample-title {
  font-size: var(--text-base);
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.25rem;
  line-height: 1.3;
}
.block-04__sample-desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.45;
  margin: 0;
}

.block-04__more-wrap {
  text-align: center;
  margin: calc(var(--gap-xl) * 1.25) auto 0;
}
.block-04__more-btn {
  font-size: var(--text-base);
  padding: 1rem 2rem;
  box-shadow: 0 8px 32px rgba(255, 107, 26, 0.35);
}
.block-04__more-btn:hover,
.block-04__more-btn:focus-visible {
  color: #0a0a0f;
}

.block-04__deco-scissors {
  position: absolute;
  right: 5%;
  top: 12%;
  width: 48px;
  opacity: 0.1;
  color: rgba(255, 255, 255, 0.6);
  z-index: 1;
  animation: spinSlow 20s linear infinite;
  pointer-events: none;
}
@keyframes spinSlow {
  to { transform: rotate(360deg); }
}

@media (max-width: 768px) {
  .block-04__samples {
    grid-template-columns: 1fr;
    gap: 1.75rem;
    max-width: 520px;
    margin-inline: auto;
  }
  .block-04__sample-media {
    min-height: 200px;
  }
}
