/* ==========================================================================
   MEDIA BOX — СТРАНИЦА «ВЕДЕНИЕ ПРОЕКТА» (p-promotion.css)
   --------------------------------------------------------------------------
   Подключается на promotion.html ПОСЛЕ pages.css и screens.css
   и ПЕРЕД future.css.
   Общие блоки (.page-hero, .promo-visual, .stages, .benefit, .checklist,
   .note, .split, .cta, .card, .chip) описаны в base.css и pages.css —
   здесь только то, что нужно этой странице дополнительно.

   Содержание:
     1. Этапы: семь шагов (.stages--7)
     2. Organic Traffic Funnel (.prj-funnel, .prj-tags)
     3. Кейсы (.prj-case)
     4. Стоимость (.prj-price)
     5. Что выбрать (.prj-choice)
     6. Reduced motion

   Правила (как во всём проекте):
     • непрерывно анимируются только transform и opacity;
     • hover — только внутри @media (hover: hover) and (pointer: fine);
     • брейкпоинты: телефон < 640px, планшет 640–1023px, ПК ≥ 1024px;
     • цвета — только переменные из base.css.
   ========================================================================== */


/* ==========================================================================
   1. ЭТАПЫ: СЕМЬ ШАГОВ
   В pages.css .stages на ПК — 5 колонок в строку. Здесь этапов семь,
   поэтому на ПК — две строки: 4 + 3. На телефоне и планшете — столбиком
   (как в pages.css).
   ========================================================================== */

@media (min-width: 1024px) {
  .stages--7 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    row-gap: 44px;
  }

  /* Последний этап в строке — без линии вправо */
  .stages--7 .stages__item:nth-child(4n)::before {
    display: none;
  }
}


/* ==========================================================================
   2. ORGANIC TRAFFIC FUNNEL
   Три карточки: рабочие аккаунты → основной источник → заявка.
   Телефон и планшет — столбиком, линия-связка вертикальная.
   ПК — в строку, линия-связка горизонтальная.
   По линии бежит точка (только transform/opacity); вне экрана анимация
   стоит — блок помечен [data-live], паузу ставит promotion.js.
   ========================================================================== */

.prj-funnel {
  --gap: clamp(36px, 4vw, 56px);   /* расстояние между карточками = длина связки */
}

.prj-funnel__list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--gap);
}

@media (min-width: 1024px) {
  .prj-funnel__list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.prj-funnel__stage {
  --pad: clamp(22px, 2.6vw, 30px);

  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: var(--pad);
}

.prj-funnel__stage > * {
  margin: 0;
}

/* Верхняя «картинка» карточки — одной высоты во всех трёх */
.prj-funnel__visual {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 64px;
  margin-bottom: 6px;
}

.prj-funnel__step {
  font-size: .75rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.prj-funnel__title {
  font-size: 1.25rem;
  line-height: 1.3;
}

.prj-funnel__text {
  font-size: .9375rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.prj-funnel__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* --- Шаг 1: ряд телефонов с рабочими аккаунтами --- */
.prj-funnel__phone {
  position: relative;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 30px;
  height: 56px;
  border: 1.5px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface-2);
}

.prj-funnel__phone .icon {
  width: 14px;
  height: 14px;
}

.prj-funnel__phone--ig { color: var(--ig); }
.prj-funnel__phone--tt { color: var(--tt); }
.prj-funnel__phone--yt { color: var(--yt); }

/* Индикатор «в работе» на каждом телефоне, мигают вразнобой */
.prj-funnel__phone::after {
  content: '';
  position: absolute;
  top: 5px;
  left: 50%;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: var(--accent-3);
  animation: prj-blink 2.6s ease-in-out infinite;
}

.prj-funnel__phone:nth-child(2)::after { animation-delay: -.7s; }
.prj-funnel__phone:nth-child(3)::after { animation-delay: -1.5s; }
.prj-funnel__phone:nth-child(4)::after { animation-delay: -.3s; }
.prj-funnel__phone:nth-child(5)::after { animation-delay: -1.9s; }

@keyframes prj-blink {
  0%, 100% { opacity: .3; }
  50%      { opacity: 1; }
}

/* --- Шаг 2: «основной источник» --- */
.prj-funnel__hub {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  color: var(--text-on-accent);
  background: var(--accent-grad);
}

.prj-funnel__hub .icon {
  width: 26px;
  height: 26px;
}

/* --- Шаг 3: заявка --- */
.prj-funnel__goal {
  position: relative;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 1.5px solid var(--accent-3);
  border-radius: 50%;
  color: var(--accent-3);
  background: var(--surface-2);
}

.prj-funnel__goal .icon {
  width: 24px;
  height: 24px;
}

/* Мягкая «волна» вокруг результата */
.prj-funnel__goal::after {
  content: '';
  position: absolute;
  inset: -1.5px;
  border: 1px solid var(--accent-3);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  animation: prj-wave 2.8s var(--ease-out) 1.2s infinite both;
}

@keyframes prj-wave {
  0%   { opacity: .7; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.6); }
}

/* --- Связка между карточками: линия + бегущая точка ---
   Телефон и планшет: вертикально, в промежутке под карточкой. */
.prj-funnel__link {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 100%;
  width: 2px;
  height: var(--gap);
  margin-left: -1px;
  pointer-events: none;
}

.prj-funnel__link::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  opacity: .5;
}

.prj-funnel__link i {
  position: absolute;
  inset: 0;
  display: block;
  opacity: 0;
  animation: prj-dot-y 2.4s var(--ease-in-out) infinite both;
}

.prj-funnel__link i::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: var(--text);
  box-shadow: 0 0 10px 2px var(--accent);
}

/* Вторая связка стартует со сдвигом — точки не идут синхронно */
.prj-funnel__stage:nth-child(2) .prj-funnel__link i {
  animation-delay: 1.2s;
}

@keyframes prj-dot-y {
  0%   { opacity: 0; transform: translateY(0); }
  15%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(100%); }
}

@keyframes prj-dot-x {
  0%   { opacity: 0; transform: translateX(0); }
  15%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { opacity: 0; transform: translateX(100%); }
}

/* ПК: связка горизонтальная, на уровне «картинок» карточек */
@media (min-width: 1024px) {
  .prj-funnel__link {
    left: 100%;
    top: calc(var(--pad) + 32px);
    width: var(--gap);
    height: 2px;
    margin: -1px 0 0;
  }

  .prj-funnel__link::before {
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
  }

  .prj-funnel__link i {
    animation-name: prj-dot-x;
  }

  .prj-funnel__link i::after {
    left: 0;
    top: 50%;
  }
}

/* --- Инструменты перелива --- */
.prj-funnel__tools {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: clamp(28px, 3.4vw, 40px);
  padding: clamp(20px, 2.6vw, 28px);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
}

.prj-funnel__tools-title {
  font-size: 1.0625rem;
  line-height: 1.35;
}

.prj-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Длинные подписи («Упоминания основного источника») переносятся,
   а не вылезают за край на узком телефоне */
.prj-tags .chip,
.prj-funnel__chips .chip,
.prj-case__tags .chip,
.prj-price__factors .chip {
  white-space: normal;
}


/* ==========================================================================
   3. КЕЙСЫ
   ========================================================================== */

.prj-case {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.prj-case > * {
  margin: 0;
}

.prj-case__head {
  display: flex;
  align-items: center;
  gap: 16px;
}

.prj-case__head .card__icon {
  flex-shrink: 0;
}

.prj-case__name {
  font-size: 1.375rem;
  line-height: 1.2;
}

.prj-case__type {
  margin-top: 4px;
  font-size: .875rem;
  line-height: 1.4;
  color: var(--text-muted);
}

.prj-case__text {
  font-size: .9375rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.prj-case__label {
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: .75rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.prj-case__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: -6px;
}


/* ==========================================================================
   4. СТОИМОСТЬ
   ========================================================================== */

.prj-price__why {
  max-width: 56ch;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text-muted);
}

.prj-price {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: clamp(24px, 3.4vw, 40px);
}

.prj-price > * {
  margin: 0;
}

/* «Оплата за проект + оплата за лида» */
.prj-price__formula {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: stretch;
  gap: 12px;
}

.prj-price__part {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 88px;
  padding: 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  font-size: 1.0625rem;
  font-weight: 800;
  line-height: 1.3;
  text-align: center;
  color: var(--text);
}

.prj-price__plus {
  display: grid;
  place-items: center;
  align-self: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text-on-accent);
  background: var(--accent-grad);
}

@media (max-width: 639.98px) {
  .prj-price__formula {
    grid-template-columns: minmax(0, 1fr);
  }

  .prj-price__plus {
    justify-self: center;
  }

  .prj-price__part {
    min-height: 64px;
  }
}

.prj-price__sub {
  font-size: .9375rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text);
}

.prj-price__factors {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: -8px;
}

.prj-price__note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: .9375rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.prj-price__note .icon {
  width: 20px;
  height: 20px;
  margin-top: 1px;
  color: var(--accent);
}


/* ==========================================================================
   5. ЧТО ВЫБРАТЬ: «Ведение проекта» и «Под ключ» + сопровождение
   ========================================================================== */

.prj-choice__card {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.prj-choice__card > * {
  margin: 0;
}

.prj-choice__badge {
  align-self: flex-start;
}

.prj-choice__title {
  font-size: clamp(1.375rem, 1.2rem + .6vw, 1.625rem);
  line-height: 1.25;
}

.prj-choice__lead {
  margin-top: -8px;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-muted);
}

/* Список растягивается — цены и кнопки в обеих карточках на одной высоте */
.prj-choice__card .checklist {
  flex: 1 1 auto;
}

.prj-choice__price {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-block: 16px;
  border-block: 1px solid var(--border);
}

.prj-choice__price > div {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
}

.prj-choice__price dt {
  font-size: .875rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-muted);
}

.prj-choice__price dd {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
  text-align: right;
  color: var(--text);
}

.prj-choice__price .price__usd {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* Сумма в гривнах (текст пишет layout.js) */
.prj-choice__price .price__uah {
  font-size: .8125rem;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.prj-choice__price .price__uah:empty {
  display: none;
}


/* ==========================================================================
   6. REDUCED MOTION — декоративное движение выключено, схема статична
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  .prj-funnel__phone::after,
  .prj-funnel__goal::after,
  .prj-funnel__link i {
    animation: none !important;
  }

  /* Бегущие точки и «волна» без движения не нужны; индикаторы горят ровно */
  .prj-funnel__link i,
  .prj-funnel__goal::after {
    display: none;
  }

  .prj-funnel__phone::after {
    opacity: 1;
  }
}
