/* ===== BLOCK: hero ===== */
.hero {
  --hero-delay: 7000ms;
  --hero-inset: 20px; /* відступ банера-картки від країв екрана */
  position: relative;
  z-index: 1;
  overflow: hidden;
  /* border-radius: 0 0 clamp(32px, 6.25vw, 120px) clamp(32px, 6.25vw, 120px); */
  border-radius: clamp(32px, 6.25vw, 40px);
  background: var(--c-dark);
  color: var(--c-white);
  isolation: isolate;
  /* Зверху банер заходить під шапку, але лишає відступ --hero-inset під верхнім рядком */
  margin: calc(var(--hero-inset) - var(--header-h)) var(--hero-inset) var(--hero-inset);
}

/* Слайди лежать в одній клітинці сітки: висота = найвищий слайд */
.hero__slides { display: grid; }
.hero__slide {
  grid-area: 1 / 1;
  position: relative;
  display: flex;
  align-items: center;
  /* Висота = видима частина екрана: мінус верхній рядок і відступи зверху/знизу */
  min-height: clamp(520px, calc(100svh - var(--topbar-h) - 2 * var(--hero-inset)), 930px);
  padding: calc(var(--header-h) - var(--hero-inset) + clamp(16px, 3vh, 40px)) 0 clamp(72px, 7vh, 110px);
  z-index: 0;                     /* власний контекст: фото (z -2) лежить над фоном слайда */
  background: var(--c-dark);      /* «діафрагма» відкриває щільний шар, навіть якщо фото ще немає */
  visibility: hidden;
}
/* Без JS видно лише перший слайд */
.no-js .hero__slide:first-child { visibility: visible; }
.hero__slide.is-active { z-index: 1; visibility: visible; }
/* Слайд, що відкривається «діафрагмою», лежить над поточним */
.hero__slide.is-entering { z-index: 2; visibility: visible; }

.hero__img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  color: transparent; /* приховує alt-текст, поки файлу немає */
}

/* Тексти піднімаються з-під маски: елемент їде вгору, а clip-path тримає
   нижню межу на місці. Після анімації clip-path знімається (fill: backwards),
   тож тіні й підйом кнопок при наведенні не обрізаються. */
.hero__slide.is-rising .hero__content > * {
  animation: hero-rise .9s cubic-bezier(.2,.8,.2,1) backwards;
  animation-delay: calc(var(--hero-iris, 1100ms) * .3 + var(--i, 0) * 80ms);
}
.hero__content > :nth-child(2) { --i: 1; }
.hero__content > :nth-child(3) { --i: 2; }
.hero__content > :nth-child(4) { --i: 3; }
@keyframes hero-rise {
  from { transform: translateY(100%); clip-path: inset(-40px -60px 100% -60px); }
  to   { transform: none;             clip-path: inset(-40px -60px -40px -60px); }
}

/* Кільце, що біжить краєм кола */
.hero__ring {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
}

/* Курсор-лінза «Далі / Назад» (лише миша) */
.hero.has-lens { cursor: none; }
.hero__lens {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 88px;
  height: 88px;
  margin: -44px 0 0 -44px;
  border: 1px solid rgba(255,255,255,.85);
  border-radius: 50%;
  background: rgba(31,26,23,.18);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: var(--c-white);
  pointer-events: none;
  opacity: 0;
  scale: .6;
  transition: opacity .25s ease, scale .35s var(--ease-out);
}
.hero__lens.is-on { opacity: 1; scale: 1; }
.hero__lens-icon {
  width: 22px;
  height: 22px;
  color: var(--c-orange);
  transition: rotate .35s var(--ease-out);
}
.hero__lens.is-prev .hero__lens-icon { rotate: 180deg; }
.hero__lens-label {
  font-family: var(--ff-head);
  font-size: .75rem;
  font-weight: 600;
  line-height: 1;
}
@media (hover: none), (pointer: coarse) { .hero__lens { display: none; } }

.hero__slide::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 60% 55% at 50% 55%, rgba(31,26,23,.42), rgba(31,26,23,0) 75%),
    linear-gradient(180deg, rgba(31,26,23,.42) 0%, rgba(31,26,23,.22) 40%, rgba(31,26,23,.5) 100%);
}

.hero__content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-inline: clamp(16px, 9vw, 200px);
}
.hero__badge {
  margin-bottom: 22px;
  padding: .45em 1.4em;
  border-radius: var(--r-pill);
  background: rgba(255,255,255,.18);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  font-family: var(--ff-body);
  font-size: clamp(.875rem, .6rem + .3vw, 1.125rem);
  font-weight: 700;
  line-height: 1.3;
}
.hero__title {
  max-width: 1120px;
  color: var(--c-white);
  font-size: var(--fs-h1);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -.02em;
  text-shadow: 0 2px 6px rgba(31,26,23,.4); /* невелика, слабо розсіяна */
}
.hero__text {
  max-width: 760px;
  margin-top: 22px;
  font-size: clamp(1rem, .9rem + .35vw, 1.1875rem);
  line-height: 1.5;
  text-shadow: 0 1px 12px rgba(31,26,23,.5);
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px 36px;
  margin-top: clamp(32px, 3.5vw, 64px);
}
.hero__actions .btn { min-width: 252px; }

/* ---- Лічильник слайдів «01/04» у лівому нижньому куті ---- */
.hero__pager {
  position: absolute;
  z-index: 3;
  left: clamp(16px, 3.1vw, 60px);
  bottom: clamp(20px, 3vw, 48px);
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 10px 12px;
}
.hero__counter {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px clamp(22px, 1.8vw, 34px);
  border-radius: var(--r-pill);
  background: rgba(255,255,255,.16);
  box-shadow: inset 0 -1px 0 rgba(255,127,0,.75), inset 0 1px 0 rgba(255,255,255,.18);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.hero__count {
  display: flex;
  align-items: flex-start;
  color: var(--c-white);
  font-family: var(--ff-head);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.hero__count-current {
  display: block;
  font-size: clamp(2rem, 1.4rem + 1.4vw, 3.25rem);
  font-weight: 300;
  letter-spacing: -.02em;
}
.hero__count-current.is-tick { animation: hero-tick .6s var(--ease-out) both; }
@keyframes hero-tick {
  from { opacity: 0; transform: translateY(40%); }
  to   { opacity: 1; transform: none; }
}
/* Скісна риска: тонка, довша за цифри, як у макеті */
.hero__count-slash {
  align-self: center;
  width: 2px;
  height: clamp(2.5rem, 1.8rem + 1.7vw, 4rem);
  margin: 0 clamp(6px, .6vw, 10px) 0 clamp(4px, .4vw, 8px);
  border-radius: 2px;
  background: currentColor;
  transform: rotate(18deg);
}
.hero__count-total {
  font-size: clamp(.875rem, .7rem + .4vw, 1.25rem);
  font-weight: 500;
  margin-top: -.1em;
}

/* Стрілки: з'являються в пігулці лише при фокусі з клавіатури */
.hero__step {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  color: var(--c-white);
}
.hero__step:focus-visible {
  position: static;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  overflow: visible;
  clip-path: none;
  border-radius: 50%;
}
.hero__step svg { width: 24px; height: 24px; }

/* Пауза: прихована візуально (мишею — пауза при наведенні),
   з'являється при фокусі з клавіатури */
.hero__pause {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  color: var(--c-white);
}
.hero__pause:focus-visible,
.hero.is-paused .hero__pause {
  position: static;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  overflow: visible;
  clip-path: none;
  border-radius: 50%;
  background: rgba(255,255,255,.16);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.hero__pause svg { width: 16px; height: 16px; }
.hero__play-icon { display: none; }
.hero.is-paused .hero__pause-icon { display: none; }
.hero.is-paused .hero__play-icon { display: block; }

/* Смужка: скільки лишилося до перелистування */
.hero__progress {
  grid-column: 1;
  display: block;
  height: 2px;
  margin-inline: 14px;
  border-radius: 2px;
  background: rgba(255,255,255,.3);
  overflow: hidden;
}
.hero__progress-fill {
  display: block;
  height: 100%;
  background: var(--c-orange);
  transform: scaleX(0);
  transform-origin: left;
}
.hero__progress-fill.is-running {
  animation: hero-progress var(--hero-delay) linear var(--hero-lead, 0ms) forwards;
}
.hero.is-paused .hero__progress-fill,
.hero.is-hover .hero__progress-fill { animation-play-state: paused; }
@keyframes hero-progress { to { transform: scaleX(1); } }

/* Без JS лічильник не потрібен */
.no-js .hero__pager { display: none; }

/* ---- Соцмережі (вертикально праворуч) ---- */
.hero__social {
  position: absolute;
  z-index: 3;
  right: clamp(16px, 3vw, 58px);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px;
  border-radius: var(--r-pill);
  /* Скло, як у лічильника слайдів, + м'яка розсіяна тінь */
  background: rgba(255,255,255,.16);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.18),
    0 18px 44px rgba(31,26,23,.28);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.hero__social a {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  color: var(--c-white);
  transition: color .25s ease, background-color .25s ease;
}
.hero__social svg {
  width: 22px;
  height: 22px;
  filter: drop-shadow(0 1px 2px rgba(31,26,23,.45)); /* коротка, щільна тінь */
}
.hero__social a:hover { color: var(--c-white); background: var(--c-orange); }

/* Фокус на темному фоні — світліший контур */
.hero :focus-visible { outline-color: var(--c-apricot-200); }
.hero .btn--primary:focus-visible { outline-color: var(--c-white); }

/* ---- Адаптив ---- */
@media (max-width: 1440px) {
  .hero__content { padding-inline: 140px; }
}
@media (max-width: 992px) {
  .hero__content { padding-inline: var(--gutter); }
  .hero__social { display: none; }
}
@media (max-width: 576px) {
  .hero { --hero-inset: 10px; }
  .hero__slide { min-height: 0; padding-top: calc(var(--header-h) + 32px); padding-bottom: 120px; }
  .hero__badge { margin-bottom: 16px; }
  .hero__actions { flex-direction: column; align-items: stretch; width: 100%; gap: 12px; }
  .hero__actions .btn { min-width: 0; width: 100%; }
}
@media (max-width: 390px) {
  .hero__counter { padding: 8px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero__slide.is-rising .hero__content > * { animation: none; }
  .hero__lens, .hero__lens-icon { transition: none; }
  .hero__count-current.is-tick { animation: none; }
  .hero__progress { display: none; }
}
/* ===== /BLOCK: hero ===== */
