/* ============================================================
   ГЛАВНАЯ
   ============================================================ */

.home-main {
  position: relative;
  z-index: 1;
}

/* ---------- HERO ---------- */
.cover {
  max-width: var(--max-w);
  margin: 0 auto;
  min-height: min(100vh, 920px);
  display: flex;
  align-items: center;
  padding: calc(var(--nav-h) + 40px) 24px 64px;
}
.cover-inner {
  width: 100%;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 64px;
}

.cover-text > * {
  opacity: 0;
  transform: translateY(16px);
  animation: riseIn 0.8s var(--ease) forwards;
}

.cover-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 100px;
  border: 1px solid var(--border-strong);
  background: var(--accent-softer);
  font-size: 13px;
  font-weight: 500;
  color: var(--purple-bright);
  animation-delay: 0.1s;
}
.cover-kicker .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #6fd49a;
  box-shadow: 0 0 0 3px rgba(111, 212, 154, 0.15);
}

.cover-title {
  margin: 24px 0 20px;
  animation-delay: 0.2s;
}
.cover-title-small {
  display: block;
  font-family: var(--font);
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0;
  margin-bottom: 4px;
}
.cover-title-name {
  display: block;
  font-size: clamp(44px, 7vw, 88px);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.05;
  padding-bottom: 0.08em;
  /* Статичный мягкий градиент, без переливания */
  background: linear-gradient(120deg, #f4f1fa 35%, #c4b5fd 75%, #d9b8f0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.cover-lead {
  font-size: 17px;
  line-height: 1.7;
  color: var(--muted);
  max-width: 500px;
  margin-bottom: 32px;
  animation-delay: 0.3s;
}

.cover-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  animation-delay: 0.4s;
}

/* ---------- Статистика ---------- */
.cover-stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 40px;
  animation-delay: 0.5s;
}
.cover-stats:empty {
  display: none;
}
.cover-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 112px;
  padding: 14px 18px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.cover-stat-value {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-strong);
}
.cover-stat-label {
  font-size: 12px;
  color: var(--muted);
}

/* ---------- Видео ---------- */
.cover-visual {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transform: translateY(16px);
  animation: riseIn 0.9s var(--ease) 0.3s forwards;
}
.cover-frame {
  position: relative;
  width: 100%;
  max-width: 400px;
  aspect-ratio: 4 / 5;
  border-radius: 28px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.8);
  transition: transform 0.6s var(--ease);
}
.cover-frame::after {
  /* Лёгкое затемнение снизу, чтобы видео не било по глазам */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(13, 11, 20, 0.45));
  pointer-events: none;
}
.cover-frame:hover {
  transform: translateY(-4px);
}
.cover-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cover-glow {
  position: absolute;
  inset: 10% 5%;
  background: radial-gradient(circle, rgba(116, 87, 224, 0.28) 0%, transparent 65%);
  filter: blur(60px);
  z-index: -1;
}

/* ---------- Секции ---------- */
.home-section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 56px 24px;
}
.section-head {
  margin-bottom: 28px;
}
.section-head-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.section-kicker {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--purple-bright);
  margin-bottom: 8px;
}
.section-head h2 {
  font-size: clamp(26px, 3.4vw, 38px);
  font-weight: 800;
  line-height: 1.15;
}
.link-more {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 100px;
  border: 1px solid var(--border);
  transition:
    color 0.2s ease,
    border-color 0.2s ease;
}
.link-more:hover {
  color: var(--text-strong);
  border-color: var(--border-strong);
}

/* ---------- Карточки разделов и постов ---------- */
.feature-grid,
.home-posts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.feature-card,
.home-post {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  text-decoration: none;
  overflow: hidden;
  transition:
    transform 0.3s var(--ease),
    border-color 0.3s ease,
    background 0.3s ease;
}
.feature-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 120px;
  background: radial-gradient(
    ellipse 70% 100% at 20% 0%,
    color-mix(in srgb, var(--accent) 14%, transparent),
    transparent 70%
  );
  pointer-events: none;
}
.feature-card:hover,
.home-post:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  background: var(--surface-2);
}
.feature-icon {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  margin-bottom: 6px;
}
.feature-card h3 {
  font-size: 19px;
  font-weight: 700;
}
.feature-card p,
.home-post p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  flex: 1;
}
.feature-link {
  margin-top: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}

.home-post-cat {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.home-post h3 {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
}
.home-post p {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.home-post-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--muted-2);
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.home-posts-empty {
  grid-column: 1 / -1;
  padding: 40px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}

/* ---------- CTA ---------- */
.home-cta {
  max-width: var(--max-w);
  margin: 40px auto 0;
  padding: 0 24px;
}
.home-cta-inner {
  padding: 56px 40px;
  border-radius: 28px;
  text-align: center;
  background:
    radial-gradient(ellipse 60% 120% at 50% 0%, rgba(116, 87, 224, 0.18), transparent 70%),
    var(--surface);
  border: 1px solid var(--border-strong);
}
.home-cta-inner h2 {
  font-size: clamp(26px, 3.4vw, 36px);
  font-weight: 800;
  margin-bottom: 12px;
}
.home-cta-inner p {
  max-width: 480px;
  margin: 0 auto 28px;
  color: var(--muted);
}
.home-cta-inner .cover-actions {
  justify-content: center;
}

/* ---------- Адаптив ---------- */
@media (max-width: 960px) {
  .cover-inner {
    grid-template-columns: 1fr;
    gap: 48px;
    text-align: center;
  }
  .cover-text {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .cover-lead {
    margin-left: auto;
    margin-right: auto;
  }
  .cover-actions,
  .cover-stats {
    justify-content: center;
  }
  .cover-frame {
    max-width: 320px;
  }
  .feature-grid,
  .home-posts {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 620px) {
  .cover {
    padding: calc(var(--nav-h) + 24px) 20px 40px;
    min-height: auto;
  }
  .cover-frame {
    max-width: 260px;
  }
  .cover-stat {
    min-width: 0;
    flex: 1;
    padding: 12px;
  }
  .cover-stat-value {
    font-size: 20px;
  }
  .home-section {
    padding: 40px 20px;
  }
  .feature-grid,
  .home-posts {
    grid-template-columns: 1fr;
  }
  .home-cta {
    padding: 0 20px;
  }
  .home-cta-inner {
    padding: 40px 22px;
  }
  .cover-actions .btn {
    flex: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cover-frame,
  .cover-frame:hover {
    transition: none;
    transform: none;
  }
}
