/* Перший екран головної (js/hero.js). Десктоп: перший екран на всю висоту вікна — великий заголовок на всю ширину,
   під ним текст і кнопка ліворуч і компактний живий приклад праворуч (на рівні підрядка), останнім рядком —
   модулі на всю ширину без підкладки. До 1099px усе по центру: текст, приклад, модулі. */

.hh {
  --hh-ink: #000;
  --hh-mute: #6e6e73;
  --hh-text: #3a3a3c;
  --hh-soft: #f0f0f2;
  --hh-ease: cubic-bezier(.16, 1, .3, 1);
  --hh-spring: cubic-bezier(.34, 1.4, .5, 1);
  --hh-screen: 220px;
  position: relative;
  padding: clamp(96px, 11vh, 132px) 0 56px;
  overflow: hidden;
  color: var(--hh-ink);
}

@media (min-width: 1100px) {
  /* перший екран — рівно висота вікна; знизу трохи більше повітря, ніж зверху (оптично по центру) */
  .hh {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
    min-height: 100svh;
    padding: clamp(96px, 12vh, 132px) 0 clamp(48px, 7vh, 88px);
  }
}

.hh *,
.hh *:before,
.hh *:after {
  box-sizing: border-box;
}

.hh a {
  border: 0 !important;
  text-decoration: none;
}

.hh button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

.hh button:before,
.hh button:hover:before,
.hh button:active:before {
  content: none !important;
}

/* main.css фарбує текст будь-якої кнопки на наведенні в жовтий (button:not(.disabled):hover) —
   на світлих вкладках він зливався з фоном */
.hh button:not(.disabled):hover {
  color: inherit;
}

.hh-wrap {
  display: grid;
  /* кегль заголовка (--hh-t; на високих десктопах його підганяє js/hero.js через --hh-fit), кегль підрядка
     «+ інтеграція…» (--hh-p) і відступ під заголовком (--hh-tmb) — з них рахується, де починається приклад */
  --hh-t: var(--hh-fit, clamp(44px, 6.4vw, 116px));
  --hh-p: max(calc(var(--hh-t) * .32), 22px);
  --hh-tmb: clamp(24px, 3vh, 36px);
  /* текст одразу під підрядком; приклад праворуч піднятий на рівень підрядка */
  grid-template-columns: minmax(0, 1fr) minmax(0, 500px);
  grid-template-areas:
    'title  title'
    'lead   unit'
    'action unit'
    '.      unit'
    'mods   mods';
  grid-template-rows: auto auto auto 1fr auto;
  column-gap: clamp(48px, 6vw, 112px);
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 56px);
}

/* ---------- Заголовок і текст ---------- */

.hh-title {
  grid-area: title;
  margin: 0 0 var(--hh-tmb);
  padding: 0;
  /* на високих десктопах js/hero.js підганяє кегль так, щоб перший рядок займав усю ширину вмісту (--hh-fit) */
  font-size: var(--hh-t);
  font-weight: 800;
  line-height: .96;
  letter-spacing: -.04em;
  text-align: left;
}

.hh-line {
  display: block;
}

.hh-plus {
  display: block;
  margin-top: .45em;
  font-size: max(.32em, 22px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.01em;
}

.hh-lead {
  grid-area: lead;
  max-width: 30em;
  margin: 0;
  font-size: clamp(18px, 1.5vw, 24px);
  line-height: 1.5;
  color: var(--hh-text);
}

/* ---------- Кнопка ---------- */
/* чорна пілюля + жовтий кружок зі стрілкою; на наведення жовта пляма за кнопкою, кружок котиться вправо,
   кнопка трохи тягнеться до курсора */

.hh-action {
  grid-area: action;
  margin-top: clamp(28px, 3.5vh, 40px);
}

.hh-cta {
  position: relative;
  display: inline-flex;
  isolation: isolate;
  border-radius: 999px;
  color: #fff !important;
  transform: translate(var(--hh-mx, 0), var(--hh-my, 0));
  transition: transform .5s var(--hh-ease);
  -webkit-tap-highlight-color: transparent;
}

.hh-cta:before {
  content: '';
  position: absolute;
  inset: -12px -10px;
  border-radius: 999px;
  background: var(--yellow);
  z-index: -1;
  opacity: 0;
  transform: scale(.6);
  transition: transform .55s var(--hh-ease), opacity .3s ease;
}

.hh-cta-body {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 20px;
  padding: 12px 12px 12px 34px;
  border-radius: inherit;
  background: var(--hh-ink);
  font-size: clamp(18px, 1.4vw, 22px);
  font-weight: 800;
  letter-spacing: -.01em;
  transition: transform .2s var(--hh-ease);
}

.hh-cta-knob {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  flex: none;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--hh-ink);
  transform: rotate(-12deg);
  transition: transform .55s var(--hh-ease);
}

.hh-cta-knob svg {
  width: 22px;
  height: 22px;
}

.hh-cta:hover:before,
.hh-cta:focus-visible:before {
  opacity: 1;
  transform: scale(1);
}

.hh-cta:hover .hh-cta-knob,
.hh-cta:focus-visible .hh-cta-knob {
  transform: translateX(6px) rotate(0deg) scale(1.08);
}

.hh-cta:active .hh-cta-body {
  transform: scale(.97);
}

.hh-cta:focus-visible {
  outline: 3px solid var(--hh-ink);
  outline-offset: 16px;
}

.hh-note {
  margin: 14px 0 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--hh-mute);
}

/* ---------- Переваги = вкладки живого прикладу ---------- */
/* Одна картка без вкладених «коробок»: рядок вкладок — це шапка картки (як вкладки в браузері), під активною
   чорна лінія, що заповнюється, поки йде приклад. Нижче — пояснення активної переваги й екран прикладу.
   Іконки тонкі сірі, як службовий текст. */

.hh-unit {
  grid-area: unit;
  align-self: start;
  width: 100%;
  /* верх прикладу — на рівні рядка «+ інтеграція…» (трохи нижче верху рядка, щоб не зачепити виносні «р» заголовка):
     .75 висоти рядка підрядка плюс відступ під заголовком */
  margin-top: calc(-1 * (var(--hh-p) * .75 + var(--hh-tmb)));
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 36px 70px -42px rgba(0, 0, 0, .35), 0 0 0 1px rgba(0, 0, 0, .04);
  text-align: left;
}

.hh-props {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 0 10px;
  border-bottom: 1px solid #ececf0;
}

.hh .hh-prop {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  align-content: start;
  row-gap: 5px;
  min-height: 0;
  padding: 12px 8px 12px;
  border-radius: 0;
  background: none;
  color: var(--hh-mute);
  text-align: center;
  line-height: 1.2;
  transition: color .3s ease;
  -webkit-tap-highlight-color: transparent;
}

.hh .hh-prop:hover {
  color: var(--hh-text);
}

.hh .hh-prop.is-on {
  color: var(--hh-ink);
}

.hh-prop:focus-visible {
  outline: 2px solid var(--hh-ink);
  outline-offset: -6px;
  border-radius: 14px;
}

.hh-prop-ico {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  color: #8e8e93;
  transition: color .3s ease, transform .5s var(--hh-spring);
}

.hh-prop-ico svg {
  width: 22px;
  height: 22px;
}

.hh-prop:hover .hh-prop-ico,
.hh-prop.is-on .hh-prop-ico {
  color: var(--hh-text);
}

.hh-prop.is-on .hh-prop-ico {
  transform: translateY(-1px);
}

.hh .hh-prop-short {
  display: block;
  font-size: 12.5px;
  white-space: nowrap;
  font-weight: 700;
  line-height: 1.25;
  text-wrap: balance;
}

/* повний опис — у підписі під вкладками (його переносить js/hero.js) */
.hh-prop-desc {
  display: none;
}

/* лінія під активною вкладкою: заповнюється, поки йде приклад */
.hh-prop-bar {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  opacity: 0;
  transition: opacity .3s ease;
}

.hh-prop-bar:after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--hh-ink);
  transform: scaleX(var(--p, 0));
  transform-origin: 0 50%;
}

.hh-prop.is-on .hh-prop-bar {
  opacity: 1;
}

/* ---------- Живий приклад ---------- */

.hh-demo {
  border-radius: 0 0 24px 24px;
}

.hh-caption {
  margin: 0;
  padding: 10px 20px 0;
  font-size: 12.5px;
  line-height: 1.45;
  text-align: center;
  color: var(--hh-mute);
  text-wrap: balance;
  transition: opacity .25s ease;
}

.hh-caption.is-swap {
  opacity: 0;
}

.hh-screen {
  position: relative;
  height: var(--hh-screen);
  overflow: hidden;
  border-radius: inherit;
}

.hh-scene {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 12px 18px 16px;
  font-size: 13px;
  line-height: 1.4;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity .35s ease, transform .5s var(--hh-ease), visibility 0s .5s;
}

.hh-scene.is-on {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity .45s ease .12s, transform .6s var(--hh-ease) .12s, visibility 0s;
}

.hh-scene.is-out {
  transform: translateY(-12px);
}

/* скидання сцени перед новим показом — миттєво */
.hh-scene.is-reset,
.hh-scene.is-reset * {
  transition: none !important;
}

/* поява кроку: рядок розкривається по висоті (сусіди плавно зсуваються), а сам елемент проявляється з розмиття */
.sc-i {
  display: grid;
  grid-template-rows: 0fr;
  margin-top: 0;
  opacity: 0;
  transform: translateY(10px) scale(.97);
  transition:
    grid-template-rows .5s var(--hh-ease),
    margin-top .5s var(--hh-ease),
    opacity .35s ease,
    transform .55s var(--hh-spring);
}

.sc-i > * {
  min-height: 0;
  overflow: hidden;
}

.sc-i.on {
  grid-template-rows: 1fr;
  margin-top: 6px;
  opacity: 1;
  transform: none;
}

.sc-i.gone {
  transform: translateY(-10px) scale(.94);
  transition:
    grid-template-rows .45s var(--hh-ease) .1s,
    margin-top .45s var(--hh-ease) .1s,
    opacity .3s ease,
    transform .45s var(--hh-ease);
}

/* шапка чату */
.sc-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #ededf0;
}

.sc-ava {
  position: relative;
  flex: none;
  width: 36px;
  height: 36px;
  perspective: 300px;
}

.sc-ava-bot,
.sc-ava-me {
  position: absolute;
  inset: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transition: transform .7s var(--hh-spring), opacity .3s ease;
}

.sc-ava-bot {
  display: grid;
  place-items: center;
  background: #ececf0;
  color: #8e8e93;
}

.sc-ava-bot svg {
  width: 24px;
  height: 24px;
}

.sc-ava-me {
  object-fit: cover;
  transform: rotateY(-180deg);
}

.sc-ava-badge {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px #fff;
  background: #fff;
  transform: scale(0);
  transition: transform .5s var(--hh-spring) .35s;
}

.sc-personal.is-swapped .sc-ava-bot {
  transform: rotateY(180deg);
}

.sc-personal.is-swapped .sc-ava-me {
  transform: none;
}

.sc-personal.is-swapped .sc-ava-badge {
  transform: none;
}

.sc-who {
  display: grid;
  min-width: 0;
}

.sc-who b {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.3;
}

.sc-who small {
  font-size: 12px;
  line-height: 1.4;
  color: var(--hh-mute);
}

/* «Бот магазину» перекреслюється і з'їжджає вгору, знизу виїжджає «Вікторія» */
.sc-swap {
  display: grid;
  overflow: hidden;
}

.sc-swap > span {
  grid-area: 1 / 1;
  position: relative;
  justify-self: start;
  white-space: nowrap;
  transition: transform .55s var(--hh-ease), opacity .35s ease;
}

.sc-now {
  transform: translateY(100%);
  opacity: 0;
}

b.sc-swap .sc-was:after {
  content: '';
  position: absolute;
  left: -2px;
  right: -2px;
  top: 55%;
  height: 2px;
  border-radius: 2px;
  background: var(--darkorange);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform .4s var(--hh-ease);
}

.sc-personal.is-strike b.sc-swap .sc-was:after {
  transform: scaleX(1);
}

.sc-personal.is-swapped .sc-was {
  transform: translateY(-100%);
  opacity: 0;
}

.sc-personal.is-swapped .sc-now {
  transform: none;
  opacity: 1;
}

.sc-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin: 0 5px 1px 0;
  border-radius: 50%;
  background: #22c55e;
}

.sc-flag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  margin-left: auto;
  padding: 5px 10px 5px 5px;
  border-radius: 999px;
  background: #eaf6fc;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.sc-flag img {
  width: 18px;
  height: 18px;
}

.sc-personal .sc-flag {
  opacity: 0;
  transform: scale(.6);
  transition: opacity .3s ease .25s, transform .55s var(--hh-spring) .25s;
}

.sc-personal.is-swapped .sc-flag {
  opacity: 1;
  transform: none;
}

/* стрічка чату: нові повідомлення знизу, старі йдуть угору під м'який край */
.sc-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 28px);
  mask-image: linear-gradient(to bottom, transparent, #000 28px);
}

.sc-msg {
  display: flex;
  flex-direction: column;
  max-width: 84%;
}

.sc-msg.is-in {
  justify-self: start;
  align-items: flex-start;
}

.sc-msg.is-out {
  justify-self: end;
  align-items: flex-end;
}

.sc-msg p {
  margin: 0;
  padding: 7px 12px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.4;
}

.sc-msg.is-in p {
  background: var(--hh-soft);
  border-bottom-left-radius: 6px;
}

.sc-msg.is-out p {
  background: var(--hh-ink);
  color: #fff;
  border-bottom-right-radius: 6px;
}

.sc-msg small {
  margin-top: 3px;
  font-size: 12px;
  color: var(--hh-mute);
}

.sc-ticks {
  color: #2aa3df;
  letter-spacing: -.2em;
}

.sc-from {
  margin: 0 0 3px 6px;
  font-size: 12px;
  font-weight: 800;
  color: #2a8bc4;
}

.sc-typing {
  display: inline-flex;
  gap: 4px;
  padding: 13px 14px;
  border-radius: 18px 18px 6px 18px;
  background: var(--hh-ink);
}

.sc-typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .7);
  animation: sc-type 1s ease-in-out infinite;
}

.sc-typing i:nth-child(2) { animation-delay: .15s; }
.sc-typing i:nth-child(3) { animation-delay: .3s; }

@keyframes sc-type {
  0%, 60%, 100% { transform: none; opacity: .5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.sc-sys {
  justify-self: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--hh-soft);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  color: var(--hh-text);
}

.sc-sys.is-date {
  padding: 4px 10px;
  background: none;
  font-weight: 600;
  color: var(--hh-mute);
}

.sc-sys.is-green {
  background: color-mix(in srgb, var(--light-green) 40%, #fff);
  color: var(--hh-ink);
}

/* група */
.sc-ava-group {
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #45b9ee, #1f8fd0);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .02em;
}

.sc-msg.is-post {
  padding: 9px 13px 10px;
  border-radius: 18px 18px 6px 18px;
  background: var(--hh-ink);
  color: #fff;
}

.sc-msg.is-post p {
  padding: 0;
  background: none;
}

.sc-post-meta {
  margin: 0 0 2px !important;
  color: rgba(255, 255, 255, .62) !important;
}

.sc-msg.is-spam p {
  transition: background-color .3s ease, box-shadow .3s ease;
}

.sc-spam-tag {
  margin: 3px 0 0 6px;
  font-size: 12px;
  font-weight: 800;
  color: #c2410c;
  opacity: 0;
  transition: opacity .3s ease;
}

.sc-groups.is-flag .is-spam p {
  background: #fde8df;
  box-shadow: inset 0 0 0 1.5px var(--darkorange);
  animation: sc-shake .45s ease;
}

.sc-groups.is-flag .sc-spam-tag {
  opacity: 1;
}

@keyframes sc-shake {
  20% { transform: translateX(-3px); }
  40% { transform: translateX(3px); }
  60% { transform: translateX(-2px); }
  80% { transform: translateX(1px); }
}

/* CRM */
/* CRM-сцена щільніша за чати: увесь сюжет (звернення, картка з трьома рядками й дубль) влазить в екран прикладу */
.sc-crm {
  padding-top: 10px;
  padding-bottom: 12px;
}

.sc-crm .sc-from {
  margin-bottom: 2px;
}

.sc-crm .sc-msg p {
  padding: 6px 11px;
}

.sc-incoming {
  flex-direction: row;
  align-items: flex-end;
  gap: 8px;
}

.sc-incoming > img {
  width: 24px;
  height: 24px;
  flex: none;
}

.sc-incoming > span {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.sc-card {
  padding: 8px 12px 4px;
  border-radius: 20px;
  border: 1px solid #ececf0;
  background: #fff;
  transition: box-shadow .5s ease, border-color .5s ease;
}

.sc-crm.is-merge .sc-card {
  border-color: var(--light-green);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--light-green) 35%, transparent);
}

.sc-card-head,
.sc-dup {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sc-ini {
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--yellow);
  font-size: 12px;
  font-weight: 800;
}

.sc-ini.is-gray {
  background: #e7e7ec;
}

.sc-ini {
  position: relative;
}

.sc-ini-src {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 2px #fff;
}

.sc-tag {
  flex: none;
  margin-left: auto;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--light-green);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
  white-space: nowrap;
}

.sc-tag.is-warn {
  background: #fde8df;
  color: #9a3412;
}

.sc-rows {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

.sc-rows li {
  margin: 0;
  padding: 0;
}

.sc-rows li:before {
  content: none !important;
}

.sc-rows .sc-i.on {
  margin-top: 2px;
}

.sc-rows li > div {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 1px 0;
  font-size: 13px;
  line-height: 1.35;
}

.sc-ok {
  flex: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--light-green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M5 9.2l2.6 2.6L13 6.4' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 18px no-repeat;
}

.sc-merged > div {
  font-weight: 800;
}

.sc-dup {
  padding: 7px 10px;
  border-radius: 18px;
  border: 1.5px dashed var(--darkorange);
  background: #fff8f4;
}

.sc-dup-i.on {
  margin-top: 8px;
}

/* дубль «в'їжджає» в картку вище */
.sc-dup-i.gone {
  transform: translateY(-40px) scale(.88);
}

/* ---------- Модулі під першим екраном ---------- */

/* модулі — останній рядок першого екрана на всю ширину, без підкладки; тонка лінія над ними.
   Кожен модуль — посилання до свого розділу нижче, і це видно одразу: стрілка «вниз» у кружку стоїть завжди,
   на наведенні (і фокусі) плитка підсвічується кольором модуля, кружок заливається ним, стрілка «киває» вниз.
   Після переходу заголовок розділу коротко підкреслюється тим самим кольором (js/hero.js) — видно, куди привело. */
.hh-modules {
  position: relative;
  grid-area: mods;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  /* плитки виступають за край тексту на свої поля, щоб текст у них стояв на одній лінії з текстом вище */
  margin: clamp(26px, 4.5vh, 50px) -16px 0;
  padding: 12px 0 0;
  text-align: left;
}

.hh-modules:before {
  content: '';
  position: absolute;
  top: 0;
  left: 16px;
  right: 16px;
  height: 1px;
  background: rgba(0, 0, 0, .08);
}

.hh-mod {
  position: relative;
  display: block;
  padding: 14px 54px 16px 16px;
  border-radius: 20px;
  color: var(--hh-ink) !important;
  transition: background-color .3s ease, transform .3s var(--hh-ease);
  -webkit-tap-highlight-color: transparent;
}

.hh-mod:hover,
.hh-mod:focus-visible {
  background: color-mix(in srgb, var(--c) 20%, transparent);
}

.hh-mod:active {
  transform: scale(.98);
}

.hh-mod:focus-visible {
  outline: 2px solid var(--hh-ink);
  outline-offset: 2px;
}

/* стрілка «до розділу» (селектор з .hh-mod — сильніший за «.hh-mod span» нижче) */
.hh-mod .hh-mod-go {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, .14);
  color: var(--hh-mute);
  transition: background-color .3s ease, box-shadow .3s ease, color .3s ease;
}

.hh-mod .hh-mod-go svg {
  width: 15px;
  height: 15px;
}

.hh-mod:hover .hh-mod-go,
.hh-mod:focus-visible .hh-mod-go {
  background: var(--c);
  box-shadow: none;
  color: var(--hh-ink);
}

.hh-mod:hover .hh-mod-go svg,
.hh-mod:focus-visible .hh-mod-go svg {
  animation: hh-go .9s var(--hh-ease) infinite;
}

@keyframes hh-go {
  0%, 100% { transform: none; }
  45% { transform: translateY(3px); }
}

.hh-mod b {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
  font-size: 16px;
}

.hh-mod b:before {
  content: '';
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: var(--c);
  transition: transform .45s var(--hh-ease);
}

.hh-mod:hover b:before {
  transform: rotate(45deg) scale(1.2);
}

.hh-mod span {
  display: block;
  font-size: 13px;
  line-height: 1.45;
  color: var(--hh-mute);
}

/* ---------- Поява першого екрана: одна послідовність ---------- */

.hh .hh-line,
.hh .hh-plus,
.hh .hh-lead,
.hh .hh-action,
.hh .hh-unit,
.hh .hh-modules {
  animation: hh-in 1s var(--hh-ease) both;
}

.hh .hh-line:nth-child(2) { animation-delay: .08s; }
.hh .hh-plus { animation-delay: .16s; }
.hh .hh-lead { animation-delay: .26s; }
.hh .hh-action { animation-delay: .36s; }
.hh .hh-unit { animation-delay: .46s; }
.hh .hh-modules { animation-delay: .62s; }

/* перехід з іншої сторінки сайту (клас m-inside ставить сніпет у <head>): перший екран без появи, одразу */
.m-inside .hh .hh-line,
.m-inside .hh .hh-plus,
.m-inside .hh .hh-lead,
.m-inside .hh .hh-action,
.m-inside .hh .hh-unit,
.m-inside .hh .hh-modules {
  animation: none;
}

@keyframes hh-in {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
}

/* ---------- Планшет і телефон: усе по центру, картка прикладу під кнопкою ---------- */

@media (max-width: 1099px) {
  .hh {
    --hh-screen: 260px;
    padding-top: clamp(112px, 14vh, 140px);
  }

  .hh-wrap {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: 'title' 'lead' 'action' 'unit' 'mods';
    grid-template-rows: none;
    justify-items: center;
    text-align: center;
  }

  .hh-title {
    max-width: 15em;
    font-size: clamp(36px, 9vw, 76px);
    text-align: center;
    text-wrap: balance;
  }

  .hh-line {
    display: inline;
  }

  .hh-plus {
    margin-top: .5em;
  }

  .hh-lead {
    max-width: 32em;
    font-size: clamp(16px, 2.3vw, 19px);
    text-wrap: pretty;
  }

  .hh-action {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .hh-note {
    max-width: 22em;
  }

  .hh .hh-prop-short {
    white-space: normal;
  }

  .hh-unit {
    max-width: 560px;
    margin-top: clamp(36px, 6vw, 56px);
  }

  .hh-modules {
    width: calc(100% + 24px);
    max-width: 584px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: clamp(32px, 6vw, 48px) -12px 0;
  }

  .hh-modules:before {
    left: 12px;
    right: 12px;
  }

  .hh-mod {
    padding: 12px 46px 14px 12px;
  }

  .hh-mod .hh-mod-go {
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
  }
}

@media (max-width: 600px) {
  .hh {
    --hh-screen: 250px;
    padding-top: 104px;
  }

  .hh-title {
    margin-bottom: 20px;
  }

  .hh-plus {
    font-size: max(.5em, 18px);
  }

  .hh-action {
    margin-top: 24px;
  }

  .hh-cta-body {
    gap: 14px;
    padding: 8px 8px 8px 26px;
    font-size: 17px;
  }

  .hh-cta-knob {
    width: 46px;
    height: 46px;
  }

  .hh-unit {
    padding: 5px;
    border-radius: 28px;
  }

  .hh-props {
    padding: 0 4px;
  }

  .hh .hh-prop {
    row-gap: 6px;
    padding: 14px 6px 13px;
  }

  .hh .hh-prop-short {
    font-size: 12.5px;
  }

  .hh-prop-bar {
    left: 10px;
    right: 10px;
  }

  .hh-scene {
    padding: 14px 14px 16px;
  }

  .sc-msg {
    max-width: 90%;
  }

  .sc-msg p,
  .sc-rows li > div {
    font-size: 13.5px;
  }

  .sc-head {
    gap: 10px;
    padding-bottom: 12px;
  }

  .sc-flag {
    padding-right: 8px;
  }

}

/* дуже вузькі телефони: прапорець без тексту, лише значок месенджера */
@media (max-width: 359px) {
  .sc-flag {
    padding: 5px;
    font-size: 0;
    gap: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hh *,
  .hh *:before,
  .hh *:after {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------- «Як це працює»: іконка особистого Telegram і Viber ---------- */
/* такого ж розміру, як логотипи каналів поруч (раніше була ширша й сідала на кольорові «плечі») */
.social-people-box .user-item-circle .icon-private {
  width: 1em;
}

/* телефон біля вуха ледь «дзвонить», коли на іконку наводять */
.pv-icon .pv-phone {
  transform-box: fill-box;
  transform-origin: 50% 100%;
}

.user-private:hover .pv-phone {
  animation: pv-ring .5s ease-in-out 2;
}

@keyframes pv-ring {
  25% { translate: 0 -1px; rotate: -6deg; }
  75% { translate: 0 -1px; rotate: 6deg; }
}

@media (prefers-reduced-motion: reduce) {
  .user-private:hover .pv-phone {
    animation: none;
  }
}

/* ---------- Позначка розділу після переходу з модуля ---------- */
/* js/hero.js ставить .hh-arrived на заголовок розділу, коли прокрутка доїхала: підкреслення кольором модуля
   проявляється й гасне */
.hh-arrived {
  text-decoration-line: underline;
  text-decoration-thickness: .12em;
  text-underline-offset: .14em;
  text-decoration-skip-ink: none;
  animation: hh-arrive 2.2s ease forwards;
}

@keyframes hh-arrive {
  0% { text-decoration-color: transparent; }
  18%, 70% { text-decoration-color: var(--hh-arrive, #000); }
  100% { text-decoration-color: transparent; }
}

@media (prefers-reduced-motion: reduce) {
  .hh-mod:hover .hh-mod-go svg,
  .hh-mod:focus-visible .hh-mod-go svg {
    animation: none;
  }

  .hh-arrived {
    animation-duration: .01s;
  }
}
