/* Демо-ниши, шаги, тарифы, вопросы, форма заявки. */

/* Демо-ниши */
.demo-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px;
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

/* Подсветка кромки при наведении вместо тени: на тёмном тень не видна. */
.demo-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: var(--gradient);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

/* Постоянная подсветка в углу — та же, что у плиток возможностей. */
.demo-card::after {
  content: "";
  position: absolute;
  top: -90px;
  right: -70px;
  width: 240px;
  height: 200px;
  z-index: 0;
  background: radial-gradient(
    ellipse at center,
    rgba(107, 43, 255, 0.42) 0%,
    rgba(58, 137, 251, 0.14) 45%,
    transparent 72%
  );
  pointer-events: none;
}

/* Содержимое поднимаем над свечением: оба слоя позиционированы, и без
   z-index свечение легло бы поверх текста — оно идёт следом по порядку. */
.demo-card > * {
  position: relative;
  z-index: 1;
}

.demo-card:hover {
  transform: translateY(-4px);
  background: var(--surface-2);
}

.demo-card:hover::before {
  opacity: 1;
}

.demo-card__emoji {
  font-size: 36px;
  line-height: 1;
  margin-bottom: 16px;
}

.demo-card h3 {
  margin-bottom: 8px;
}

.demo-card p {
  color: var(--ink-soft);
  font-size: 15px;
  flex: 1;
  margin-bottom: 22px;
}

/* Как это работает */
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  counter-reset: step;
}

/* Шаги подсвечиваются по очереди: линия сверху заполняется слева направо,
   как индикатор загрузки, и на это время плитка чуть увеличивается. Дойдя до
   конца, очередь переходит к следующему шагу — так читается направление
   процесса, а не просто четыре карточки рядом.

   Один цикл на все четыре шага; каждый следующий стартует с задержкой в
   четверть цикла. Задержка задаётся переменной, потому что её нужно применить
   и к плитке, и к её линии — переменные наследуются в псевдоэлемент.

   Ключевые кадры считаны от четверти цикла (25%): к этому моменту и линия, и
   увеличение обязаны вернуться в исходное — иначе плитка остаётся крупной,
   когда загрузка уже ушла к соседней. */
.steps {
  --cycle: 10.4s;
}

.step {
  position: relative;
  padding-top: 24px;
  border-top: 2px solid var(--line-strong);
  animation: step-grow var(--cycle) ease-in-out infinite;
  animation-delay: var(--delay);
}

.step::before {
  content: "";
  position: absolute;
  top: -2px;
  left: 0;
  height: 2px;
  width: 0;
  background: var(--gradient);
  animation: step-fill var(--cycle) linear infinite;
  animation-delay: var(--delay);
}

.step:nth-child(1) {
  --delay: 0s;
}

.step:nth-child(2) {
  --delay: 2.6s;
}

.step:nth-child(3) {
  --delay: 5.2s;
}

.step:nth-child(4) {
  --delay: 7.8s;
}

@keyframes step-fill {
  0% {
    width: 0;
    opacity: 1;
  }
  18% {
    width: 100%;
    opacity: 1;
  }
  23% {
    width: 100%;
    opacity: 1;
  }
  25% {
    width: 100%;
    opacity: 0;
  }
  25.01%,
  100% {
    width: 0;
    opacity: 0;
  }
}

/* Плитка крупная ровно столько, сколько идёт заполнение: поднимается вместе с
   началом линии и садится к 25% — моменту, когда стартует следующий шаг. */
@keyframes step-grow {
  0% {
    transform: scale(1);
  }
  4%,
  22% {
    transform: scale(1.035);
  }
  25%,
  100% {
    transform: scale(1);
  }
}

.step__num {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.step h3 {
  font-size: 19px;
  margin-bottom: 8px;
}

.step p {
  color: var(--ink-soft);
  font-size: 15px;
  margin: 0;
}

/* Тарифы */
.plans {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  align-items: start;
}

.plan {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 36px 30px;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.plan--top {
  position: relative;
  background: linear-gradient(var(--surface-2), var(--surface-2)) padding-box,
    var(--gradient) border-box;
  border: 1px solid transparent;
  box-shadow: var(--glow);
}

.plan__badge {
  position: absolute;
  top: -14px;
  left: 30px;
  background: var(--gradient);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
}

.plan h3 {
  font-size: 20px;
  margin-bottom: 6px;
}

.plan__note {
  color: var(--ink-muted);
  font-size: 14px;
  min-height: 42px;
  margin-bottom: 20px;
}

.plan__price {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-bottom: 24px;
}

.plan__price b {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--ink-strong);
}

.plan__price span {
  color: var(--ink-muted);
  font-size: 14px;
}

.plan ul {
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
  display: grid;
  gap: 12px;
  flex: 1;
}

.plan li {
  position: relative;
  padding-left: 28px;
  font-size: 15px;
  color: var(--ink-soft);
}

.plan li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: -1px;
  color: var(--accent);
  font-weight: 700;
}

/* Сайты.
   Карточка тяжелее демо-ниши и легче тарифа: услуг всего две, и колонка вдвое
   шире тарифной — цену держим меньше, иначе она перевешивает список работ. */
.site {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 36px 30px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

/* Та же подсветка в углу, что у демо-ниш: секции идут подряд и должны
   читаться как один набор карточек, а не два разных. */
.site::after {
  content: "";
  position: absolute;
  top: -90px;
  right: -70px;
  width: 240px;
  height: 200px;
  background: radial-gradient(
    ellipse at center,
    rgba(107, 43, 255, 0.42) 0%,
    rgba(58, 137, 251, 0.14) 45%,
    transparent 72%
  );
  pointer-events: none;
}

.site > * {
  position: relative;
  z-index: 1;
}

.site__icon {
  font-size: 34px;
  line-height: 1;
  margin-bottom: 16px;
}

.site__note {
  color: var(--ink-soft);
  font-size: 15px;
  margin-bottom: 22px;
}

.site__meta {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 14px;
  padding-bottom: 22px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.site__price {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--ink-strong);
}

.site__term {
  font-size: 14px;
  color: var(--ink-muted);
}

.site__list {
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
  display: grid;
  gap: 12px;
  flex: 1;
}

.site__list li {
  position: relative;
  padding-left: 28px;
  font-size: 15px;
  color: var(--ink-soft);
}

.site__list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: -1px;
  color: var(--accent);
  font-weight: 700;
}

.site__hint {
  margin: 26px 0 0;
  max-width: 720px;
  color: var(--ink-muted);
  font-size: 15px;
}

/* Вопросы */
.faq {
  max-width: 860px;
}

.faq details {
  border-bottom: 1px solid var(--line);
  padding: 22px 0;
}

.faq summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 18px;
  color: var(--ink-strong);
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  color: var(--ink-muted);
  font-size: 24px;
  line-height: 1;
  flex: none;
  transition: color 0.15s ease;
}

.faq summary:hover::after {
  color: var(--ink-strong);
}

.faq details[open] summary::after {
  content: "–";
}

.faq details p {
  margin: 14px 0 0;
  color: var(--ink-soft);
  font-size: 16px;
  max-width: 96%;
}

/* Заявка */
.lead {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 52px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 52px;
  overflow: hidden;
}

/* Отголосок свечения из первого экрана — форма перекликается с началом. */
.lead::before {
  content: "";
  position: absolute;
  top: -160px;
  right: -120px;
  width: 520px;
  height: 460px;
  background: radial-gradient(
    ellipse at center,
    rgba(107, 43, 255, 0.28) 0%,
    transparent 68%
  );
  pointer-events: none;
}

.lead > * {
  position: relative;
  z-index: 1;
}

.lead__art {
  text-align: center;
}

/* Только прямой потомок — это маскот. Без `>` правило накрывало и знаки
   мессенджеров внутри кнопок: они разъезжались по ширине и тянули кнопку
   вниз своим нижним отступом. */
.lead__art > img {
  width: min(320px, 82%);
  margin: 0 auto 20px;
  filter: drop-shadow(0 22px 44px rgba(107, 43, 255, 0.36));
}

.lead__art p {
  color: var(--ink-soft);
  font-size: 15px;
  margin: 0 auto;
  max-width: 320px;
}

.lead h2 {
  font-size: clamp(26px, 3.2vw, 38px);
}

.lead__sub {
  color: var(--ink-soft);
  margin-bottom: 28px;
}

/* С отключённой анимацией показывать нечего: линия никуда не бежит. Раньше
   здесь оставался градиент на первом шаге — он читался как «загрузка застряла»,
   потому что подсветка есть, а движения нет. Гасим и линию, и увеличение:
   четыре одинаковые черты честнее подсвеченной без причины первой. */
@media (prefers-reduced-motion: reduce) {
  .step {
    animation: none;
    transform: none;
  }

  .step::before {
    display: none;
  }
}

@media (max-width: 940px) {
  .steps,
  .plans {
    grid-template-columns: repeat(2, 1fr);
  }

  .lead {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 34px;
  }

  .lead__art {
    order: -1;
  }

  .lead__art > img {
    width: min(200px, 60%);
  }
}

@media (max-width: 720px) {
  .steps,
  .plans {
    grid-template-columns: 1fr;
  }

  .lead {
    padding: 26px;
  }
}

/* Колонка с маскотом выровнена по центру — кнопки мессенджеров тоже,
   иначе они прижимаются к левому краю посреди центрированного блока. */
.lead__art .messengers {
  align-items: center;
  margin-top: 18px;
}

.lead__art .messengers__row {
  justify-content: center;
}
