/* =========================================================
   КАРКАС (wireframe). Кольори й шрифти тут тимчасові, нейтральні.
   Дизайн накладаємо пізніше — міняти тільки змінні в :root.
   Mobile-first: база = 375px, далі 768px і 1280px.
   ========================================================= */

:root {
  /* Кольори (тимчасові, сірі) */
  --c-bg: #ffffff;
  --c-bg-alt: #f2f2f2;
  --c-bg-dark: #e4e4e4;
  --c-surface: #ffffff;
  --c-text: #1a1a1a;
  --c-text-muted: #666666;
  --c-accent: #1a1a1a;         /* виділені слова, маркери */
  --c-btn-bg: #1a1a1a;
  --c-btn-text: #ffffff;
  --c-border: #cccccc;
  --c-placeholder: #d6d6d6;
  --c-error: #b00020;

  /* Картки з фото на фоні */
  --c-card-bg: #2b2b2b;                 /* поки немає фото */
  --c-card-text: #ffffff;
  /* Верх картки — фото видно; з того місця, де починається текст, — рівно темно у всіх картках */
  --card-overlay: linear-gradient(180deg, rgba(0, 0, 0, .1) 0%, rgba(0, 0, 0, .28) 22%, rgba(0, 0, 0, .64) 36%, rgba(0, 0, 0, .74) 100%);

  /* Шрифти (тимчасові, системні) */
  --f-heading: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Розміри */
  --radius: 12px;
  --radius-pill: 999px;
  --gutter: 16px;
  --container: 1120px;
  --section-y: 56px;
  --header-h: 60px;
}

/* ---------- База ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }

body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--f-heading); line-height: 1.15; margin: 0; }
p { margin: 0; }

mark {
  background: none;
  color: var(--c-accent);
  font-weight: 700;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section-title {
  font-size: 26px;
  text-align: center;
  margin-bottom: 16px;
}

.section-lead {
  text-align: center;
  color: var(--c-text-muted);
  font-size: 18px;
  margin-bottom: 28px;
}

/* Заглушки під фото / скріни */
.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-placeholder);
  color: var(--c-text-muted);
  border-radius: var(--radius);
  font-size: 14px;
  text-align: center;
  padding: 16px;
}

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 28px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--c-btn-bg);
  color: var(--c-btn-text);
  font: 600 16px/1.2 var(--f-body);
  text-decoration: none;
  cursor: pointer;
  transition: opacity .2s;
}
.btn:hover { opacity: .85; }
.btn:focus-visible { outline: 3px solid var(--c-border); outline-offset: 3px; }
.btn:disabled { opacity: .5; cursor: wait; }
.btn--block { width: 100%; }

/* ---------- Шапка ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--c-bg);
  border-bottom: 1px solid var(--c-border);
}
.header__inner {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--header-h);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
}

.nav {
  display: flex;
  gap: 14px;
  margin-left: auto;
}
.nav__link {
  text-decoration: none;
  font-size: 14px;
  padding: 8px 0;
}
.nav__link:hover { text-decoration: underline; }

/* ---------- 1. Перший екран ---------- */
/* Фото на весь екран (мінус шапка), оффер поверх.
   Телефон: текст знизу, затемнення знизу вгору.
   Планшет/десктоп: текст ліворуч на темній стіні, затемнення зліва. */
.hero {
  --hero-overlay: linear-gradient(180deg, rgba(0, 0, 0, .05) 0%, rgba(0, 0, 0, .35) 40%, rgba(0, 0, 0, .88) 100%);

  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  min-height: calc(100vh - var(--header-h));
  min-height: calc(100svh - var(--header-h));
  padding: 32px 0 40px;
  background: #0c1a1d;
  color: #ffffff;
}
.hero__bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 72% 30%;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--hero-overlay);
}
.hero__text { max-width: 560px; }
.hero__title {
  font-size: 32px;
  margin-bottom: 16px;
}
.hero mark { color: inherit; }
.hero__offer {
  font-size: 20px;
  line-height: 1.45;
  margin-bottom: 24px;
  color: rgba(255, 255, 255, .88);
}
.hero .btn { background: #ffffff; color: #1a1a1a; }

/* ---------- 2. Сеанс Змін ---------- */
.session {
  background: var(--c-bg-dark);
  padding: var(--section-y) 0;
}
/* Усі картки однакові: однакова ширина і висота (grid-auto-rows: 1fr) */
.cards {
  display: grid;
  grid-template-columns: 1fr;
  grid-auto-rows: 1fr;
  gap: 16px;
}
/* Фото — на всю картку, приглушене затемненням; текст білий.
   Текст у всіх картках починається на одній висоті (--card-text-top),
   а заголовок має однакову висоту, тож і пункти стартують на одному рівні. */
.card {
  --card-text-top: 170px;

  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 420px;
  padding: var(--card-text-top) 22px 26px;
  border-radius: 24px;
  background: var(--c-card-bg);
  color: var(--c-card-text);
  text-shadow: 0 1px 3px rgba(0, 0, 0, .55);
}
.card__bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--card-overlay);
}
/* Телефон: великий шрифт, щоб добре читався на фото */
.card__title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -.01em;
  margin-bottom: 16px;
}
.card__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.card__list li {
  position: relative;
  padding-left: 20px;
  font-size: 22px;
  font-weight: 500;
  line-height: 1.4;
}
/* Фраза, яку не можна розривати переносом (напр. «а у вас – ні») */
.nowrap { white-space: nowrap; }
.card__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .6em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.session__result {
  margin: 32px auto 0;
  max-width: 640px;
  text-align: center;
  font-size: 20px;
  line-height: 1.45;
}

.prices {
  list-style: none;
  margin: 24px auto 0;
  padding: 0;
  max-width: 400px;
  display: grid;
  gap: 8px;
}
.prices li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--c-border);
}

/* ---------- 3. Відгуки ---------- */
.reviews {
  background: var(--c-bg-alt);
  padding: var(--section-y) 0;
}
.slider {
  position: relative;
  margin-top: 24px;
}
.slider__track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  padding-bottom: 4px;
}
.slider__track::-webkit-scrollbar { display: none; }
.slider__track:focus-visible { outline: 2px solid var(--c-border); outline-offset: 4px; }

.slide {
  flex: 0 0 85%;
  margin: 0;
  scroll-snap-align: start;
}
/* Скріни відгуків вертикальні (~9:16) — показуємо цілком, без обрізки */
.review {
  display: block;
  border-radius: 24px;   /* як у карток */
  overflow: hidden;
  background: var(--c-bg-dark);
}
.review img {
  width: 100%;
  height: auto;
  aspect-ratio: 9 / 16;
  object-fit: contain;
}
.review:focus-visible { outline: 3px solid var(--c-border); outline-offset: 3px; }

.slider__arrow {
  display: none; /* на мобільному — свайп */
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  width: 44px;
  height: 44px;
  border: 1px solid var(--c-border);
  border-radius: 50%;
  background: var(--c-surface);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}
.slider__arrow--prev { left: -8px; }
.slider__arrow--next { right: -8px; }
.slider__arrow:disabled { opacity: .35; cursor: default; }

.slider__dots {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 16px;
}
.slider__dot {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.slider__dot::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c-border);
}
.slider__dot[aria-current="true"]::before { background: var(--c-accent); }

/* ---------- 4. Форма ---------- */
/* Фіолетовий фон з візерунком + напівпрозорі карти таро по боках */
.contact {
  --contact-bg: #241a48;
  --contact-text: #ffffff;
  --contact-muted: rgba(255, 255, 255, .72);
  --contact-tarot-opacity: .2;

  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: var(--section-y) 0;
  background: var(--contact-bg) url("assets/contact-bg.webp") center / cover;
  color: var(--contact-text);
}
.contact__tarot {
  position: absolute;
  z-index: -1;
  width: 150px;
  height: auto;
  opacity: var(--contact-tarot-opacity);
  pointer-events: none;
  user-select: none;
}
.contact__tarot--left  { left: -60px;  top: 24px;    transform: rotate(-14deg); }
.contact__tarot--right { right: -60px; bottom: 24px; transform: rotate(12deg); }

.contact__inner { position: relative; max-width: 640px; }
/* Заголовок форми — рівно 5 рядків на всіх екранах (переноси <br> в index.html):
   Залиште Ваш номер / телефону, щоб детальніше / дізнатися, як буде проходити / діагностика та чистка / від крадників
   На телефоні розмір = доступна ширина / --k (найдовший рядок ≈ 13,7–14,5 × розмір
   шрифту залежно від системного шрифту телефона; --k узято з запасом під ширші шрифти
   Android). Перенос не заборонено: якщо рядок все ж не влізе — він перенесеться, а не обріжеться. */
.contact .section-title {
  --k: 16;
  margin: 0 -8px 24px;
  font-size: min(28px, calc((100vw - 16px) / var(--k)));
  line-height: 1.2;
  letter-spacing: -0.015em;
}
.contact .form__label { color: var(--contact-muted); }
.contact .form__error { color: #ffb3b3; }
.contact .btn { background: var(--contact-text); color: var(--contact-bg); }
/* Кнопка форми вужча за поле: ≈12% ширини зменшено з кожного боку, по центру */
.contact .btn--block { width: 76%; justify-self: center; }
.contact .form__success { color: var(--c-text); }

.form {
  max-width: 420px;
  margin: 0 auto;
  display: grid;
  gap: 10px;
}
.form__label { font-size: 14px; color: var(--c-text-muted); }
.form__phone {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 0 14px;
}
.form__phone:focus-within { border-color: var(--c-text); }
.form__phone.is-invalid { border-color: var(--c-error); }
.form__flag { font-size: 18px; }
.form__input {
  flex: 1;
  min-width: 0;
  height: 50px;
  border: 0;
  background: none;
  font: 16px var(--f-body); /* 16px — щоб iOS не зумив */
  color: var(--c-text);
  outline: none;
}
.form__error { color: var(--c-error); font-size: 14px; }
.form__hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.form__success {
  max-width: 420px;
  margin: 0 auto;
  padding: 24px;
  background: var(--c-surface);
  border-radius: var(--radius);
  text-align: center;
}
.form__success-title { font-size: 22px; font-weight: 700; margin-bottom: 6px; }

/* =========================================================
   Планшет — 768px
   ========================================================= */
@media (min-width: 768px) {
  :root {
    --gutter: 32px;
    --section-y: 80px;
    --header-h: 68px;
  }

  .logo { font-size: 17px; }
  .nav { gap: 24px; }
  .nav__link { font-size: 15px; }

  .section-title { font-size: 34px; }

  .hero { padding: 48px 0 56px; }
  .hero__text { max-width: 520px; }
  .hero__title { font-size: 40px; }
  .hero__offer { font-size: 22px; }

  .section-lead { font-size: 20px; }
  .session__result { font-size: 22px; }

  /* 2 картки в ряд; 5-та такого ж розміру, по центру */
  .cards { grid-template-columns: repeat(4, 1fr); gap: 20px; }
  .card { grid-column: span 2; --card-text-top: 150px; }
  .card:last-child:nth-child(odd) { grid-column: 2 / span 2; }
  /* Заголовок завжди висотою у 2 рядки — пункти починаються на одному рівні */
  .card__title { min-height: 2.3em; font-size: 24px; margin-bottom: 14px; }
  .card__list { gap: 10px; }
  .card__list li { font-size: 19px; padding-left: 18px; }

  .slide { flex-basis: calc((100% - 16px) / 2); }
  .slider__arrow { display: block; }

  .contact .section-title { font-size: 32px; margin: 0 auto 24px; }
  .contact__tarot { width: 220px; }
  .contact__tarot--left  { left: -40px;  top: 40px; }
  .contact__tarot--right { right: -40px; bottom: 40px; }
}

/* Перший екран на широких горизонтальних екранах:
   текст ліворуч на темній стіні, Людмила праворуч */
@media (min-width: 768px) and (orientation: landscape) {
  .hero {
    --hero-overlay: linear-gradient(90deg, rgba(0, 0, 0, .78) 0%, rgba(0, 0, 0, .5) 45%, rgba(0, 0, 0, .05) 80%);
    align-items: center;
    padding: 64px 0;
  }
  /* Тримаємо верх фото, щоб на широких екранах не обрізало голову */
  .hero__bg { object-position: 60% 12%; }
  .hero__text { max-width: 480px; }
}

/* =========================================================
   Десктоп — 1280px
   ========================================================= */
@media (min-width: 1280px) {
  :root { --section-y: 100px; }

  .section-title { font-size: 40px; }

  .hero__text { max-width: 560px; }
  .hero__title { font-size: 54px; }
  .hero__offer { font-size: 24px; }

  .section-lead { font-size: 22px; }
  .session__result { font-size: 24px; max-width: 720px; }

  /* 5 карток: 3 зверху, 2 по центру знизу */
  .cards {
    grid-template-columns: repeat(6, 1fr);
    margin: 0 auto;
    gap: 24px;
  }
  .card:nth-child(4) { grid-column: 2 / span 2; }
  .card:nth-child(5):last-child { grid-column: 4 / span 2; }
  .card { --card-text-top: 150px; padding: var(--card-text-top) 28px 28px; }
  .card__title { font-size: 26px; }
  .card__list li { font-size: 20px; }
  .contact__inner { max-width: 760px; }
  .contact .section-title { font-size: 36px; }

  .contact__tarot { width: 280px; }
  .contact__tarot--left  { left: 6%;  top: 50%; transform: translateY(-50%) rotate(-14deg); }
  .contact__tarot--right { right: 6%; top: 50%; bottom: auto; transform: translateY(-50%) rotate(12deg); }

  .slide { flex-basis: calc((100% - 32px) / 3); }
  .slider__arrow--prev { left: -56px; }
  .slider__arrow--next { right: -56px; }
}

@media (prefers-reduced-motion: reduce) {
  html, .slider__track { scroll-behavior: auto; }
}
