/* ============================================================
   _hero.css — стартовый экран: фон-картина с overlay, заголовок,
   подзаголовок, две CTA-кнопки, тёмная карточка справа со списком
   фич, бейдж «7 модулей», stats-bar (если используется), все
   animation'ы появления (heroSlideUp / hcReveal / statReveal /
   pulse-dot).

   Зависит от _base.css (палитра, .btn, --radius-*).
   ============================================================ */

/* ── Фон + контейнер ─────────────────────────────────────── */
.hero-wrap {
  position: relative; overflow: hidden;
}
.hero-bg-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: center 35%;
  opacity: 1;
  filter: saturate(0.75) brightness(1.05);
  z-index: 0; pointer-events: none;
}
.hero-bg-overlay {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(
    to right,
    rgba(244,239,230,0.95) 0%,
    rgba(244,239,230,0.82) 35%,
    rgba(244,239,230,0.30) 65%,
    rgba(244,239,230,0.05) 100%
  );
}
.hero {
  position: relative; z-index: 2;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 60px;
  padding: 108px 48px 60px 80px;
  max-width: 1280px; margin: 0 auto;
}
/* Solo-вариант: одна колонка слева, картина видна справа на 95% */
.hero--solo {
  grid-template-columns: 1fr;
}
.hero--solo .hero-left {
  max-width: 720px;
}

/* ── Левая колонка: тэг, заголовок, sub, кнопки ─────────── */
.hero-tag {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: 99px;
  background: linear-gradient(135deg, #3A0A12 0%, #6B1520 100%);
  border: 1px solid rgba(180, 60, 80, 0.5);
  box-shadow: 0 0 0 1px rgba(180,60,80,0.12), 0 4px 20px rgba(139,26,44,0.28);
  font-size: 14px; font-weight: 600; color: #FFE0E4;
  letter-spacing: 0.01em;
  margin-bottom: 28px;
}
.hero-tag-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px #22c55e;
  flex-shrink: 0;
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 4px #22c55e; }
  50%      { box-shadow: 0 0 10px #22c55e, 0 0 20px rgba(34,197,94,0.4); }
}

.hero-headline {
  font-family: var(--font-serif);
  font-size: clamp(38px, 4.2vw, 62px);
  font-weight: 700; line-height: 1.08;
  letter-spacing: -0.015em; color: var(--dark);
  margin-bottom: 20px;
}
.hero-headline em {
  font-style: italic;
  color: var(--accent-1);
  font-weight: 700;
}

.hero-sub {
  font-size: 17px; line-height: 1.65;
  color: #2A1C10; max-width: 420px;
  margin-bottom: 36px; font-weight: 450;
}

.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.hero-actions .btn-ghost { padding: 12px 22px; font-size: 14px; }

/* ── Правая карточка с «Что получает каждый ученик» ─────── */
.hero-card {
  background: var(--dark);
  border-radius: var(--radius-xl);
  padding: 36px;
  position: relative; overflow: hidden;
}
.hero-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(194,125,42,0.6), transparent);
}
.hc-label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: #B0A89A; margin-bottom: 24px;
}
.hc-items { display: flex; flex-direction: column; gap: 12px; }
.hc-item {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 16px 18px; border-radius: var(--radius-md);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  transition: background 0.2s, transform 0.2s;
}
.hc-item:hover { background: rgba(255,255,255,0.07); transform: translateX(3px); }
.hc-icon {
  width: 36px; height: 36px; border-radius: var(--radius-sm); flex-shrink: 0;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(194,125,42,0.18);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  line-height: 1;
}
.hc-title { font-size: 14px; font-weight: 600; color: #F4EFE6; margin-bottom: 4px; }
.hc-desc { font-size: 12.5px; color: #B0A89A; line-height: 1.55; }

.hero-badge {
  position: absolute; bottom: -16px; right: 24px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 12px 16px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}
.hero-badge-icon {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #fff;
}
.hero-badge-title { font-size: 13px; font-weight: 600; color: var(--dark); }
.hero-badge-sub { font-size: 11px; color: var(--faint); }

/* ── Stats bar (опционально) ─────────────────────────────── */
.stats-bar {
  border-top: 1px solid var(--border);
  padding: 48px 48px;
  display: flex; gap: 64px;
  max-width: 1200px; margin: 0 auto;
}
.stat-val { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; }
.stat-label { font-size: 13px; color: var(--faint); margin-top: 4px; }

/* ── Animations ──────────────────────────────────────────── */
@keyframes heroSlideUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hero-left > * {
  animation: heroSlideUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.hero-left > *:nth-child(1) { animation-delay: 0.05s; }
.hero-left > *:nth-child(2) { animation-delay: 0.18s; }
.hero-left > *:nth-child(3) { animation-delay: 0.30s; }
.hero-left > *:nth-child(4) { animation-delay: 0.42s; }

.hero-right {
  animation: heroSlideUp 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.25s both;
}

@keyframes hcReveal {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
/* hero-card и stats-bar nth-child stagger удалены —
   эти элементы убраны из главной 15.05.2026 (hero перешёл на --solo).
   Базовые .hero-card / .hc-item / .stats-bar стили оставлены на случай
   возврата, но dead anim-delays вычищены (см. session_2026_05_17). */
.stats-bar [data-count]:nth-child(4) { animation-delay: 0.85s; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding: 80px 24px 48px; gap: 32px; min-height: auto; }
  .hero-sub { max-width: 100%; }
  .hero-right { max-width: 480px; }
  .hero-actions .btn { padding: 14px 24px; font-size: 15px; }

  .stats-bar { padding: 24px 20px; gap: 24px; flex-wrap: wrap; }
}

@media (max-width: 640px) {
  /* ──────────────────────────────────────────────────────────
     Mobile hero — «входная дверь»
     Картина-фон с Ken Burns, радиальный overlay, координированная
     хореография появления элементов, нарисованный underline,
     shimmer на CTA, badge pop, золотые уголки, бумажная текстура.
     ────────────────────────────────────────────────────────── */

  /* Бумажная текстура — едва заметные тёмные точки по всему hero,
     добавляют академическую фактуру (как у дорогих изданий).
     z-index 2 = на уровне контента, но pseudo-element выше overlay (z=1)
     и ниже контента в DOM-порядке → не перекрывает текст и CTA. */
  .hero-wrap::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background-image:
      radial-gradient(circle, rgba(28,18,10,0.04) 0.5px, transparent 0.6px);
    background-size: 14px 14px;
    opacity: 0;
    animation: heroTextureFade 1.2s ease 1.6s both;
  }

  /* Картина — журнальная обложка сверху, 40vh, в полной красе.
     Без blur. Ken Burns даёт «дыхание». */
  .hero-bg-img {
    top: 0; left: 0; right: 0; bottom: auto;
    width: 100%; height: 40vh;
    filter: saturate(0.92) brightness(1.02);
    animation: heroKenBurns 22s ease-in-out infinite alternate;
    transform-origin: center 30%;
    object-position: center 25%;
    will-change: transform;
  }

  /* Overlay — fade картины в bg около 35-40vh, дальше чистый бежевый */
  .hero-bg-overlay {
    background: linear-gradient(
      to bottom,
      transparent 0%,
      transparent 28vh,
      rgba(244,239,230,0.55) 35vh,
      rgba(244,239,230,0.95) 40vh,
      var(--bg) 42vh,
      var(--bg) 100%
    );
  }

  /* Декоративные золотые уголки в верхних углах картины —
     как у фотографий в винтажных альбомах */
  .hero-bg-overlay::before,
  .hero-bg-overlay::after {
    content: '';
    position: absolute;
    top: 14px;
    width: 22px; height: 22px;
    pointer-events: none;
    opacity: 0;
    animation: cornerDraw 0.7s cubic-bezier(0.22, 1, 0.36, 1) 1.4s both;
  }
  .hero-bg-overlay::before {
    left: 14px;
    border-top: 1.5px solid var(--accent-2);
    border-left: 1.5px solid var(--accent-2);
  }
  .hero-bg-overlay::after {
    right: 14px;
    border-top: 1.5px solid var(--accent-2);
    border-right: 1.5px solid var(--accent-2);
    animation-delay: 1.55s;
  }

  /* Heading НЕ двигается после появления — статичный, читаемый.
     Дрожание текста раздражает; работают только Ken Burns на картине,
     shimmer/glow на CTA и pulse-dot на eyebrow (всё функциональное). */

  /* Hero контент сдвигается под картину */
  .hero {
    padding: 45vh 20px 60px;
    min-height: 100vh;
    position: relative;
  }

  /* Divider убран — его роль теперь выполняет picture-credit с
     декоративными линиями по бокам. Композиция «картина → подпись → текст».

     Pseudo-элементы .hero освобождены и переиспользуются под золотые
     искры-sparkle, которые редко вспыхивают на картине (через большую
     паузу в keyframes — каждые ~8 секунд один tick). */
  .hero::before,
  .hero::after {
    content: '';
    position: absolute;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(194,125,42,0.9) 0%, rgba(194,125,42,0) 70%);
    pointer-events: none;
    opacity: 0;
    animation: sparkleTwinkle 8s ease-in-out infinite;
  }
  .hero::before { top: 8vh; left: 14%; animation-delay: 3s; }
  .hero::after  { top: 22vh; right: 18%; animation-delay: 6.5s; }

  /* Третья искра — через .hero-wrap::after */
  .hero-wrap::after {
    content: '';
    position: absolute;
    top: 31vh; left: 70%;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(194,125,42,0.9) 0%, rgba(194,125,42,0) 70%);
    pointer-events: none;
    z-index: 2;
    opacity: 0;
    animation: sparkleTwinkle 8s ease-in-out 10s infinite;
  }

  /* Тэг — компактнее, дышащая точка остаётся.
     На мобильном «впечатывается как штамп» — overshoot + rotate */
  .hero-tag {
    font-size: 13px;
    padding: 8px 16px;
    margin-bottom: 22px;
  }
  .hero-left > *:nth-child(1) {
    animation: heroSlideUpStamp 0.75s cubic-bezier(0.45, 1.8, 0.55, 1) 0.05s both;
  }

  /* Headline + мягкое золотое свечение (тёплая текстовая аура) */
  .hero-headline {
    font-size: clamp(30px, 7.8vw, 40px);
    line-height: 1.20;
    margin-bottom: 20px;
    text-shadow: 0 2px 24px rgba(194, 125, 42, 0.08);
  }

  /* Underline под «система» — рисуется один раз + статичная золотая аура.
     Glow не моргает — просто статичная тень делает линию «весомой». */
  .hero-headline .underline-accent::after {
    bottom: -1px;
    height: 2.5px;
    transform-origin: left center;
    box-shadow: 0 0 12px rgba(194, 125, 42, 0.45);
    animation: underlineDraw 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.95s both;
  }

  /* Sub — плотнее, легче читается */
  .hero-sub {
    font-size: 16px;
    line-height: 1.55;
    margin-bottom: 32px;
    max-width: 100%;
  }

  .hero-right { display: none; }

  /* Только одна главная CTA на мобиле — Telegram-кнопка убрана,
     она в шапке-бургере и в FAB после прокрутки. */
  .hero-actions { flex-direction: column; gap: 12px; }
  .hero-actions .btn-ghost { display: none; }
  .trial-btn-wrap { width: 100%; position: relative; }
  .trial-btn-wrap .btn {
    width: 100%;
    justify-content: center;
    padding: 16px 20px;
    font-size: 15px;
    position: relative;
    overflow: hidden;
    /* Карминовый gradient с lacquer-shift через --cta-angle */
    background: linear-gradient(
      var(--cta-angle, 135deg),
      var(--accent-1) 0%,
      #6B1520 60%,
      var(--accent-1) 100%
    );
    box-shadow:
      0 6px 20px rgba(139, 26, 44, 0.25),
      0 0 0 0 rgba(194, 125, 42, 0);
    animation:
      heroCtaGlow 3.2s ease-in-out 2.5s infinite,
      ctaGradientShift 5s ease-in-out 1s infinite;
    transition: transform 0.12s cubic-bezier(0.22, 1, 0.36, 1);
  }
  /* Tap-feedback — кнопка слегка «утопает» при нажатии */
  .trial-btn-wrap .btn:active {
    transform: scale(0.96);
  }

  /* Shimmer — золотая полоса проходит по кнопке каждые 3.5с */
  .trial-btn-wrap .btn::after {
    content: '';
    position: absolute;
    top: 0; bottom: 0;
    left: -100%; width: 55%;
    background: linear-gradient(
      90deg,
      transparent 0%,
      rgba(255,255,255,0.28) 50%,
      transparent 100%
    );
    transform: skewX(-22deg);
    animation: heroShimmer 3.5s cubic-bezier(0.22, 1, 0.36, 1) 2s infinite;
    pointer-events: none;
  }

  /* Бейдж «бесплатно» — pop-in один раз, после остаётся статичным.
     Дыхание убрано: badge маленький и его дёргание заметно периферийным зрением. */
  .trial-badge {
    animation: badgePop 0.65s cubic-bezier(0.34, 1.56, 0.64, 1) 1.2s both;
  }

  .stats-bar { flex-direction: column; gap: 16px; align-items: flex-start; padding: 24px 20px; }
  .stat-val { font-size: 22px; }
}

/* ── Анимации mobile hero ───────────────────────────────── */
@keyframes heroKenBurns {
  /* translate Y дополняется через --parallax-y (управляется site_hero_parallax.js).
     При отсутствии переменной (desktop, или нет JS) — fallback 0px, эффекта parallax нет. */
  0%   { transform: scale(1.00) translate(0,     calc(0%   + var(--parallax-y, 0px))); }
  50%  { transform: scale(1.05) translate(-1.5%, calc(-1%  + var(--parallax-y, 0px))); }
  100% { transform: scale(1.03) translate(1%,    calc(0.5% + var(--parallax-y, 0px))); }
}

@keyframes heroCreditFade {
  from { opacity: 0; transform: translateX(-50%) translateY(4px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Sparkle — золотая искра вспыхивает 1 раз за 8с, основное время скрыта */
@keyframes sparkleTwinkle {
  0%, 88%, 100% { opacity: 0; transform: scale(0.6); }
  92%           { opacity: 1; transform: scale(1.3); }
  96%           { opacity: 0.6; transform: scale(1.0); }
}

/* CTA gradient shift — карминовый «лак» переливается. Требует @property
   для плавной интерполяции угла (Chrome 85+, Safari 16.4+). Без @property —
   fallback на статичный угол 135deg. */
@property --cta-angle {
  syntax: '<angle>';
  initial-value: 135deg;
  inherits: false;
}
@keyframes ctaGradientShift {
  0%, 100% { --cta-angle: 130deg; }
  50%      { --cta-angle: 165deg; }
}

@keyframes heroCtaGlow {
  0%, 100% {
    box-shadow:
      0 6px 20px rgba(139, 26, 44, 0.25),
      0 0 0 0 rgba(194, 125, 42, 0);
  }
  50% {
    box-shadow:
      0 8px 28px rgba(139, 26, 44, 0.35),
      0 0 0 10px rgba(194, 125, 42, 0.12);
  }
}

@keyframes cornerDraw {
  from { opacity: 0; transform: scale(0.55); }
  to   { opacity: 0.75; transform: scale(1); }
}

@keyframes heroHeadingFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-3px); }
}

@keyframes heroTextureFade {
  from { opacity: 0; }
  to   { opacity: 0.65; }
}

@keyframes heroSlideUpStamp {
  0%   { opacity: 0; transform: translateY(28px) scale(0.85) rotate(-2deg); }
  60%  { opacity: 1; transform: translateY(-2px) scale(1.05) rotate(1deg); }
  100% { opacity: 1; transform: translateY(0) scale(1) rotate(0deg); }
}

@keyframes underlinePulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.65; }
}

@keyframes badgeBreathe {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50%      { transform: scale(1.04) rotate(0deg); }
}

@keyframes underlineDraw {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

@keyframes heroShimmer {
  0%   { left: -100%; }
  60%  { left: 200%; }
  100% { left: 200%; }
}

@keyframes badgePop {
  0%   { opacity: 0; transform: scale(0.5) rotate(-12deg); }
  60%  { opacity: 1; transform: scale(1.12) rotate(3deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

/* Hero на мобильном получает мягкую тень в основании — ощущение
   «лист бумаги на столе». Это разделяет hero и следующую секцию
   без визуальных плямбок (line-разделители канон запрещает). */
@media (max-width: 640px) {
  .hero-wrap {
    box-shadow: 0 14px 32px -18px rgba(28, 18, 10, 0.18);
  }
}

/* На главной мобильной credit становится центрированной подписью
   под картиной с тонкими декоративными линиями по бокам.
   Заменяет собой divider — академический ритм «картина → подпись → текст». */
@media (max-width: 640px) {
  .hero-wrap .page-hero-credit {
    top: 41.5vh; bottom: auto;
    right: auto; left: 50%;
    transform: translateX(-50%);
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    color: var(--faint);
    font-size: 10.5px;
    letter-spacing: 0.12em;
    padding: 0 36px;
    border-radius: 0;
    white-space: nowrap;
    opacity: 0;
    animation: heroCreditFade 0.9s ease 0.6s both;
  }
  /* Декоративные линии слева и справа от текста credit'а —
     тонкие, золотые, с fade на внешних концах */
  .hero-wrap .page-hero-credit::before,
  .hero-wrap .page-hero-credit::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 28px;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--accent-2), transparent);
  }
  .hero-wrap .page-hero-credit::before {
    right: 100%;
    margin-right: 4px;
    background: linear-gradient(to right, transparent, var(--accent-2));
  }
  .hero-wrap .page-hero-credit::after {
    left: 100%;
    margin-left: 4px;
    background: linear-gradient(to right, var(--accent-2), transparent);
  }
}

/* Accessibility — отключить всю хореографию для prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .hero-bg-img { animation: none; }
  .hero-wrap::before { animation: none; opacity: 0.65; }
  .hero-wrap::after { animation: none; opacity: 0; }
  .hero::before,
  .hero::after { animation: none; opacity: 0; }
  .hero-headline .underline-accent::after { animation: none; transform: scaleX(1); }
  .hero-wrap .page-hero-credit { animation: none; opacity: 1; }
  .hero-bg-overlay::before,
  .hero-bg-overlay::after { animation: none; opacity: 0.75; }
  .hero-left > *:nth-child(1) {
    animation: heroSlideUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.05s both;
  }
  .hero-left > *:nth-child(2) {
    animation: heroSlideUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.18s both;
  }
  .trial-btn-wrap .btn::after { animation: none; }
  .trial-btn-wrap .btn { animation: none; }
  .trial-badge { animation: badgePop 0.65s cubic-bezier(0.34, 1.56, 0.64, 1) 1.2s both; }
}
