:root {
  --tg-blue: #2AABEE;
  --tg-blue-dark: #229ED9;
  --tg-deep: #0088cc;
  --ink: #1c2733;
  --ink-soft: #5b6b7b;
  --bg: #ffffff;
  --bg-soft: #f4f9fd;
  --line: #e3edf5;
  --accent-bg: #e7f5fd;
  --radius: 14px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  /* Safari на iPhone иначе раздувает шрифт при повороте в ландшафт */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  overflow-wrap: break-word;
}
.wrap { max-width: 960px; margin: 0 auto; padding: 0 20px; }

/* ---------- HERO ---------- */
.hero {
  background: linear-gradient(135deg, #2AABEE 0%, #229ED9 55%, #0088cc 100%);
  color: #fff;
  padding: 64px 0 56px;
  text-align: center;
}
.hero .flag {
  width: 120px;
  margin: 0 auto 22px;
  border-radius: 7px;
  overflow: hidden;
  line-height: 0;
  box-shadow: 0 6px 18px rgba(0,0,0,.22);
  outline: 1px solid rgba(255,255,255,.55);
  outline-offset: -1px;
}
.hero .flag svg { display: block; width: 100%; height: auto; }
.hero h1 {
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 14px;
}
.hero p.sub {
  font-size: clamp(16px, 2.5vw, 19px);
  max-width: 640px;
  margin: 0 auto 28px;
  opacity: .95;
}
.hero-stats {
  display: flex; flex-wrap: wrap; gap: 12px;
  justify-content: center;
  margin-bottom: 32px;
}
.hero-stats span {
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 15px;
  font-weight: 600;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  color: var(--tg-deep);
  font-weight: 700;
  font-size: 17px;
  padding: 14px 30px;
  border-radius: 999px;
  text-decoration: none;
  box-shadow: 0 6px 20px rgba(0,0,0,.15);
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(0,0,0,.2); }
/* Стрелка отличает кнопку-действие от информационных бейджиков-пилюль,
   которые стоят рядом и имеют такое же скругление. */
.btn .btn-arrow { flex: 0 0 auto; transition: transform .15s ease; }
.btn:hover .btn-arrow { transform: translateX(3px); }
.btn.btn-blue {
  background: var(--tg-blue);
  color: #fff;
}

/* ---------- SECTIONS ---------- */
section { padding: 48px 0; }
section.alt { background: var(--bg-soft); }
h2 {
  font-size: clamp(22px, 3.5vw, 30px);
  font-weight: 800;
  letter-spacing: -0.3px;
  margin-bottom: 6px;
}
.h2-note { color: var(--ink-soft); margin-bottom: 24px; font-size: 15px; }
.tag {
  display: inline-block;
  background: var(--accent-bg);
  color: var(--tg-deep);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
}

/* ---------- PRICE TABLE ---------- */
.price-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(34,158,217,.06);
}
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); }
.price-table th {
  background: var(--tg-blue);
  color: #fff;
  text-align: left;
  font-size: 14px;
  font-weight: 700;
  padding: 12px 16px;
  white-space: nowrap;
}
.price-table td {
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  font-size: 15px;
  vertical-align: top;
}
.price-table tr:hover td { background: var(--bg-soft); }
.price-table a { color: var(--tg-deep); font-weight: 600; text-decoration: none; }
.price-table a:hover { text-decoration: underline; }
.res-note { display: block; color: var(--ink-soft); font-size: 13px; margin-top: 2px; }
/* Ссылки внутри примечаний: чуть легче основных, но явно кликабельные */
.price-table .res-note a { font-weight: 500; text-decoration: underline; text-decoration-color: rgba(0,136,204,.35); text-underline-offset: 2px; }
.price-table .res-note a:hover { text-decoration-color: currentColor; }
.aud { white-space: nowrap; color: var(--ink-soft); font-weight: 600; }
.price { white-space: nowrap; font-weight: 800; color: var(--ink); }
.price small { font-weight: 500; color: var(--ink-soft); display: block; }

/* ---------- VIDEO OFFER ---------- */
.video-card {
  background: linear-gradient(135deg, #2AABEE 0%, #0088cc 100%);
  color: #fff;
  border-radius: 20px;
  padding: 40px 36px;
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 12px 34px rgba(0,136,204,.28);
}
.video-card .vc-text { flex: 1 1 380px; }
.video-card h3 { font-size: clamp(21px, 3vw, 27px); font-weight: 800; margin-bottom: 10px; }
.video-card p { opacity: .95; margin-bottom: 14px; }
.video-card ul { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.video-card ul li {
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 600;
}
.vc-price { text-align: center; flex: 0 0 auto; }
.vc-price .num { font-size: 44px; font-weight: 800; line-height: 1.1; }
.vc-price .per { font-size: 14px; opacity: .9; margin-bottom: 14px; }

/* ---------- DISCOUNTS ---------- */
.discounts { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.disc-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(34,158,217,.06);
}
.disc-card .pct { font-size: 38px; font-weight: 800; color: var(--tg-blue); }
.disc-card p { color: var(--ink-soft); font-size: 15px; margin-top: 4px; }
.disc-note { text-align: center; color: var(--ink-soft); font-size: 13px; margin-top: 16px; }

/* ---------- HOW ---------- */
/* Жёстко 3 или 1 колонка, без auto-fit: на промежуточной ширине он давал
   раскладку 2 + 1, и третий шаг оставался сиротой на второй строке. */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 767px) {
  .steps { grid-template-columns: 1fr; }
}
.step {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}
.step .n {
  width: 34px; height: 34px;
  background: var(--tg-blue);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  margin-bottom: 12px;
}
.step b { display: block; margin-bottom: 4px; }
.step span { color: var(--ink-soft); font-size: 14px; }

/* ---------- CONTACT ---------- */
.contact {
  background: linear-gradient(135deg, #2AABEE 0%, #0088cc 100%);
  color: #fff;
  text-align: center;
  padding: 56px 0;
}
.contact h2 { color: #fff; }
.contact p { opacity: .95; max-width: 520px; margin: 8px auto 26px; }
.contact-links {
  display: flex; flex-wrap: wrap; gap: 14px;
  justify-content: center;
  margin-bottom: 22px;
}
.contact-links a {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.35);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: 999px;
  transition: background .15s ease;
}
.contact-links a:hover { background: rgba(255,255,255,.26); }
.contact .manager { font-size: 14px; opacity: .85; }

footer {
  text-align: center;
  color: var(--ink-soft);
  font-size: 13px;
  padding: 22px 0;
  background: var(--bg-soft);
}

/* ---------- REVEAL ON SCROLL (used by script.js) ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .5s ease, transform .5s ease;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ---------- MOBILE ----------
   На узких экранах таблицы из 3 колонок не помещаются: первая колонка
   сжимается до ленты в 2–3 слова, а цена с примечанием уезжает за край.
   Поэтому ниже 640px каждая строка превращается в карточку:
   название сверху, «Аудитория» слева и «Цена» справа. */
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .hero { padding: 44px 0 40px; }
  .hero .flag { width: 96px; margin-bottom: 18px; }
  section { padding: 36px 0; }

  .table-scroll { overflow-x: visible; }

  .price-table {
    display: block;
    border-collapse: separate;
  }
  .price-table thead { display: none; }
  .price-table tbody { display: block; }

  .price-table tr {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 12px;
    padding: 14px 16px;
    border-top: 1px solid var(--line);
  }
  .price-table tbody tr:first-child { border-top: none; }
  .price-table tr:hover td { background: none; }

  .price-table td {
    display: block;
    padding: 0;
    border-top: none;
  }
  /* Название ресурса — на всю ширину карточки */
  .price-table td:first-child { flex: 1 1 100%; font-size: 16px; }
  .res-note { line-height: 1.7; margin-top: 4px; }

  .aud, .price { white-space: normal; font-size: 15px; }
  .aud { flex: 0 1 auto; margin-right: auto; }
  .price { flex: 0 1 auto; text-align: right; }
  .price small { text-align: right; font-size: 12px; margin-top: 2px; }

  /* Цена с длинным примечанием рядом с «Аудиторией» не помещается и переносится
     рваной строкой — отдаём ей отдельную строку целиком. */
  .price:has(small) { flex: 1 1 100%; text-align: left; }
  .price:has(small) small { text-align: left; }

  /* Заголовки колонок скрыты — подписываем значения внутри карточки */
  .aud::before,
  .price::before {
    color: var(--ink-soft);
    font-weight: 500;
    font-size: 13px;
  }
  .aud::before { content: "Аудитория: "; }
  .price::before { content: "Цена: "; }

  .video-card { padding: 28px 22px; }
  .vc-price { flex: 1 1 100%; }
  .discounts { grid-template-columns: 1fr; }
  .contact-links { flex-direction: column; align-items: stretch; }
  .contact-links a { justify-content: center; }
}

/* Пальцем в мелкую ссылку не попасть — на сенсорных экранах увеличиваем
   область нажатия у ссылок внутри примечаний. */
@media (hover: none) and (pointer: coarse) {
  .price-table a { padding: 3px 0; }
  .price-table td:first-child > a { display: inline-block; padding: 4px 0; }
}

/* Уважаем системную настройку «уменьшить движение»: показываем всё сразу. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .reveal.visible {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .btn, .btn .btn-arrow { transition: none; }
  .btn:hover { transform: none; }
  .btn:hover .btn-arrow { transform: none; }
}
