/* =========================================================================
   Денис Олещук — персональний онлайн-тренер
   Токени → база → типографіка → компоненти → блоки
   ========================================================================= */

/* --- Шрифт (самохостинг, лише потрібні сабсети) ------------------------- */
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/onest-400-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/onest-400-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/onest-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../fonts/onest-800-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../fonts/onest-800-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../fonts/onest-800-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --- Токени ------------------------------------------------------------- */
:root {
  --bg: #0c0c0c;
  --bg-raised: #141417;
  --line: rgba(215, 226, 234, 0.14);
  --line-strong: rgba(215, 226, 234, 0.3);
  --text: #d7e2ea;
  --text-dim: #98a2ab;
  --paper: #ffffff;
  --ink: #0c0c0c;
  --ink-dim: #55595e;
  --ink-line: rgba(12, 12, 12, 0.14);

  --display-grad: linear-gradient(180deg, #7d848e 0%, #d7e2ea 100%);
  --silver: linear-gradient(135deg, #8b949d 0%, #cfdae3 24%, #ffffff 46%, #c0cbd5 64%, #868f98 100%);

  /* Кислотний акцент із референсу. Контраст на #0C0C0C — 15:1, чорний текст
     на самій заливці — теж 15:1, тож обидва напрямки проходять AAA.
     На білому блоці цим кольором НЕ пишемо: там контраст падає до 1.6. */
  --acid: #c9f227;
  --acid-bright: #dbff57;
  --acid-press: #a5c71c;

  --container: 1120px;
  --pad-x: clamp(20px, 5vw, 48px);
  /* Стеля навмисно низька: 11vw без неї доростає до 132px, і на широкому
     екрані між блоками зяє 264px порожнечі. Нижче 800px формула та сама,
     тож на телефоні й планшеті ритм не змінився. */
  --section-y: clamp(64px, 11vw, 88px);
  --radius-media: 24px;

  --fs-display-xl: clamp(2.35rem, 9.2vw, 5.25rem);
  --fs-display-l: clamp(1.85rem, 6.6vw, 3.5rem);
  --fs-display-m: clamp(1.35rem, 4.4vw, 2.15rem);
  --fs-num: clamp(2.25rem, 9vw, 4.25rem);
  --fs-lead: clamp(1.02rem, 3.2vw, 1.3rem);
  --fs-body: 1rem;
  --fs-small: 0.875rem;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Фон переїхав сюди з body навмисно: інакше шар із сіткою (body::before,
     z-index -1) провалився б за власний фон body і став би невидимим. */
  background: var(--bg);
}

body {
  background: transparent;
  color: var(--text);
  font-family: 'Onest', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: var(--fs-body);
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Вертикальні напрямні на всю сторінку — тихе відлуння сітки з першого
   екрана. Крок 112px і центрування дають рівно 10 колонок на контейнері
   1120px, тобто лінії збігаються з реальною сіткою макета.

   Шар прибитий до в'юпорта, а не до документа: він не перемальовується під
   час скролу, і контент їде поверх нерухомої решітки.

   Горизонталей тут свідомо немає: повна сітка на одинадцяти блоках
   перетворюється на шум і з'їдає перевагу першого екрана. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    90deg,
    rgba(215, 226, 234, 0.035) 0 1px,
    transparent 1px 112px
  );
  background-position: 50% 0;
}

img,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

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

:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 3px;
  border-radius: 2px;
}

.section--paper :focus-visible {
  outline-color: var(--ink);
}

::selection {
  background: var(--text);
  color: var(--bg);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 12px 20px;
  background: var(--text);
  color: var(--bg);
}

.skip-link:focus {
  left: 0;
}

/* --- Сітка -------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--pad-x);
}

.section {
  padding-block: var(--section-y);
}

.section--paper {
  background: var(--paper);
  color: var(--ink);
  /* стрічки в цьому блоці роз'їжджаються вбік під час скролу — щоб зсув
     не породжував горизонтальний скрол сторінки, ріжемо його тут */
  overflow-x: clip;
}

.section--tight {
  padding-block: clamp(48px, 8vw, 96px);
}

/* --- Типографіка -------------------------------------------------------- */
h1,
h2,
h3 {
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

/* Інтерліньяж і міжлітерний відступ тут обов'язкові: класи вішаються не лише
   на заголовки, а й на <p> (.about__claim, .reasons__outro), а туди правило
   для h1–h3 не дістає — абзац успадковував би 1.6 від body і нульову щільність,
   через що однакові за кеглем рядки виглядали б по-різному. */
.display-xl {
  font-size: var(--fs-display-xl);
  line-height: 0.98;
  letter-spacing: -0.02em;
}

.display-l {
  font-size: var(--fs-display-l);
  line-height: 0.98;
  letter-spacing: -0.02em;
}

.display-m {
  font-size: var(--fs-display-m);
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.gradient-type {
  background: var(--display-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.lead {
  font-size: var(--fs-lead);
  line-height: 1.5;
  color: var(--text);
  max-width: 34ch;
}

.dim {
  color: var(--text-dim);
}

.section--paper .dim {
  color: var(--ink-dim);
}

.small {
  font-size: var(--fs-small);
}

/* --- Іконки ------------------------------------------------------------- */
/* Стрілки й хрестик малюються SVG, а не гліфами «‹ › ×». Гліф сидить на
   базовій лінії, а вона не збігається з візуальним центром кола — символ
   помітно з'їжджав униз. Тут центр заданий явно: усі шляхи симетричні
   відносно точки 12,12 у viewBox 24×24. */
.icon {
  display: block;
  width: 45%;
  height: 45%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* --- Кнопки ------------------------------------------------------------- */
.btn {
  /* Підйом кнопки під курсором і втискання при натиску. Окрема змінна, а
     не прямий transform, — щоб стани не затирали один одного. */
  --btn-lift: 0px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding: 16px 30px;
  border-radius: 14px;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  transform: translate3d(0, var(--btn-lift), 0);
  transition: transform 0.16s ease-out, background-color 0.16s ease,
    border-color 0.16s ease, box-shadow 0.16s ease, color 0.16s ease;
}

.btn--primary {
  background-color: var(--acid);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0) 62%);
  color: var(--ink);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.42), inset 0 -1px 0 rgba(12, 12, 12, 0.14);
}

@media (hover: hover) and (pointer: fine) {
  .btn--primary:hover {
    --btn-lift: -3px;
    background-color: var(--acid-bright);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.5), inset 0 -1px 0 rgba(12, 12, 12, 0.14);
  }
}

.btn--primary:active {
  --btn-lift: 1px;
  background-color: var(--acid-press);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35), inset 0 2px 5px rgba(12, 12, 12, 0.26);
}

/* На світлому блоці тінь під кнопкою мусить бути слабшою, інакше вона
   читається як брудна пляма на білому. */
.section--paper .btn--primary {
  box-shadow: 0 6px 18px rgba(12, 12, 12, 0.16), inset 0 -1px 0 rgba(12, 12, 12, 0.14);
}

.btn--ghost {
  border: 1px solid var(--line-strong);
  color: var(--text);
}

.btn--ghost:hover {
  --btn-lift: -3px;
  border-color: var(--text);
  background-color: rgba(215, 226, 234, 0.1);
}

.btn--ghost:active {
  --btn-lift: 1px;
  background-color: rgba(215, 226, 234, 0.16);
}

.section--paper .btn--ghost {
  border-color: var(--ink-line);
  color: var(--ink);
}

.section--paper .btn--ghost:hover {
  border-color: var(--ink);
  background: rgba(12, 12, 12, 0.04);
}

/* Кнопка-закривач у блоці 11. Заливка та сама срібна — кольору не додаємо,
   росте лише розмір: поряд із заголовком у 84px звичайна кнопка на 56px
   читається як другорядна. */
.btn--lead {
  min-height: 64px;
  padding: 18px 32px;
  font-size: 1.05rem;
}

@media (min-width: 900px) {
  .btn--lead {
    min-height: 72px;
    padding: 22px 42px;
    border-radius: 16px;
    font-size: 1.2rem;
  }
}

.btn--wide {
  width: 100%;
}

@media (min-width: 640px) {
  .btn--wide {
    width: auto;
  }
}

/* --- 1. Перший екран ---------------------------------------------------- */
.hero {
  position: relative;
  /* Власний контекст накладання: без нього ::before із z-index -1 провалиться
     за фон body і сітки не буде видно взагалі. */
  isolation: isolate;
  padding-block: clamp(32px, 7vw, 72px) var(--section-y);
}

/* Технічна сітка з референсу. Чисто CSS, жодного запиту, тане донизу,
   щоб не лізти в текст і не заважати LCP. */
.hero::before {
  content: '';
  position: absolute;
  z-index: -1;
  top: 0;
  bottom: 0;
  left: 50%;
  margin-left: -50vw;
  width: 100vw;
  pointer-events: none;
  background-image: repeating-linear-gradient(
      90deg,
      rgba(215, 226, 234, 0.05) 0 1px,
      transparent 1px 88px
    ),
    repeating-linear-gradient(0deg, rgba(215, 226, 234, 0.05) 0 1px, transparent 1px 88px);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 84%);
  mask-image: linear-gradient(180deg, #000 0%, transparent 84%);
}

/* Кислотна стрічка під героєм. Живе всередині першого блоку, новим блоком
   не стає: за ТЗ їх рівно одинадцять. */
.ticker {
  position: relative;
  left: 50%;
  margin-left: -50vw;
  width: 100vw;
  margin-top: clamp(36px, 6vw, 60px);
  overflow: hidden;
  background: var(--acid);
  color: var(--ink);
}

.ticker__row {
  display: flex;
  width: max-content;
  padding-block: 13px;
  font-size: clamp(0.82rem, 2.4vw, 0.95rem);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  animation: ticker-run 30s linear infinite;
}

.ticker__row span {
  padding-inline: 22px;
}

.ticker__row span::after {
  content: '—';
  margin-left: 22px;
  opacity: 0.45;
}

@keyframes ticker-run {
  to {
    transform: translate3d(-50%, 0, 0);
  }
}

.hero__grid {
  display: grid;
  gap: clamp(28px, 6vw, 56px);
}

.hero__photo {
  border-radius: var(--radius-media);
  overflow: hidden;
  background: var(--bg-raised);
  /* 2:3 — рідна пропорція знімків, тож кадрування немає взагалі */
  aspect-ratio: 2 / 3;
}

.hero__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__lead {
  margin-top: 20px;
  max-width: 46ch;
}

.hero__cta {
  margin-top: 28px;
}

.facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(12px, 3vw, 28px);
  margin-top: clamp(36px, 7vw, 64px);
}

.fact {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  /* Цифра й підпис стоять по центру своєї колонки: при вирівнюванні ліворуч
     права половина кожної колонки лишалася порожньою і ряд «розвалювався». */
  text-align: center;
}

.fact__value {
  font-size: clamp(1.6rem, 6vw, 2.75rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
}

.fact__label {
  margin-top: 8px;
  /* Нижню межу піднято з 0.72rem: на телефоні це давало 11.5px, а це вже
     за межею читабельності для вторинного тексту. */
  font-size: clamp(0.8rem, 2.6vw, 0.875rem);
  color: var(--text-dim);
  line-height: 1.35;
}

@media (min-width: 900px) {
  .hero__grid {
    grid-template-columns: 1fr 0.78fr;
    align-items: end;
  }

  .hero__photo {
    aspect-ratio: 2 / 3;
  }
}

/* --- Спільні заголовки блоків ------------------------------------------- */
.block-head {
  max-width: 24ch;
}

.block-head--wide {
  max-width: 34ch;
}

.block-intro {
  margin-top: 18px;
  max-width: 52ch;
  color: var(--text-dim);
}

/* --- 2. Чому зал не дає результату -------------------------------------- */
.reasons {
  display: grid;
  gap: 0;
  margin-top: clamp(32px, 6vw, 56px);
}

.reason {
  border-top: 1px solid var(--line);
  padding-block: clamp(22px, 4vw, 32px);
}

.reason__title {
  font-size: clamp(1.1rem, 3.6vw, 1.5rem);
  font-weight: 800;
  line-height: 1.2;
}

.reason__text {
  margin-top: 10px;
  color: var(--text-dim);
  max-width: 48ch;
}

.reasons__outro {
  border-top: 1px solid var(--line-strong);
  margin-top: clamp(24px, 5vw, 40px);
  padding-top: clamp(24px, 5vw, 40px);
  max-width: 24ch;
}

@media (min-width: 860px) {
  .reasons {
    grid-template-columns: 1fr 1fr;
    column-gap: clamp(32px, 5vw, 72px);
  }
}

/* --- 3. Хто я ----------------------------------------------------------- */
.about__grid {
  display: grid;
  gap: clamp(28px, 6vw, 64px);
  align-items: start;
}

.about__photo {
  border-radius: var(--radius-media);
  overflow: hidden;
  background: var(--bg-raised);
  aspect-ratio: 2 / 3;
}

.about__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about__claim {
  max-width: 20ch;
}

.about__text {
  margin-top: 24px;
  color: var(--text-dim);
  max-width: 46ch;
}

.credits {
  margin-top: 28px;
  display: grid;
  gap: 0;
}

/* Посилання назовні: свідомо стримане, щоб не конкурувати з головною дією. */
.about__social {
  margin-top: 20px;
}

.about__social a {
  color: var(--text-dim);
  font-size: var(--fs-small);
  text-decoration: underline;
  text-underline-offset: 4px;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.about__social a:hover {
  color: var(--text);
}

.credit {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
  padding-block: 14px;
  font-size: var(--fs-small);
}

.credit__value {
  font-weight: 800;
  text-align: right;
}

@media (min-width: 860px) {
  .about__grid {
    grid-template-columns: 0.85fr 1fr;
  }

  /* Тільки у дві колонки: в одній фото перекривало б текст, що йде під ним. */
  .about__photo {
    position: sticky;
    top: 32px;
  }
}

/* --- 4. Як проходить робота --------------------------------------------- */
.steps {
  margin-top: clamp(32px, 6vw, 56px);
  counter-reset: step;
}

.step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(16px, 4vw, 40px);
  align-items: baseline;
  border-top: 1px solid var(--line);
  padding-block: clamp(22px, 4vw, 34px);
}

.step__num {
  font-size: clamp(1.75rem, 7vw, 3.5rem);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.04em;
  color: var(--acid);
  min-width: 2ch;
}

.step__title {
  font-size: clamp(1.05rem, 3.4vw, 1.4rem);
  font-weight: 800;
  line-height: 1.25;
}

.step__text {
  margin-top: 8px;
  color: var(--text-dim);
  max-width: 46ch;
}

.steps__note {
  border-top: 1px solid var(--line-strong);
  margin-top: clamp(20px, 4vw, 32px);
  padding-top: clamp(20px, 4vw, 32px);
  font-size: var(--fs-lead);
  font-weight: 800;
}

.flow {
  display: grid;
  gap: clamp(24px, 5vw, 56px);
}

.flow__photo {
  border-radius: var(--radius-media);
  overflow: hidden;
  background: var(--bg-raised);
  aspect-ratio: 2 / 3;
}

.flow__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.flow .steps {
  margin-top: 0;
}

@media (min-width: 900px) {
  .flow {
    grid-template-columns: 0.72fr 1fr;
    align-items: start;
  }

  /* фото тримається поруч зі списком, поки читаєш кроки */
  .flow__photo {
    position: sticky;
    top: 32px;
  }
}

/* --- 5. Кому підходить / кому ні ---------------------------------------- */
.fit {
  display: grid;
  gap: clamp(28px, 5vw, 48px);
  margin-top: clamp(32px, 6vw, 56px);
}

.fit__col h3 {
  font-size: clamp(1.05rem, 3.4vw, 1.35rem);
}

.fit__list {
  list-style: none;
  margin-top: 18px;
}

.fit__list li {
  border-top: 1px solid var(--line);
  padding-block: 14px;
  color: var(--text-dim);
}

/* Підсвічена колонка — «Підходить», а не «Не підходить». Раніше найбільшу
   вагу на сторінці мав список відмов: око вело до нього, хоча вся сторінка
   будується на знятті невпевненості. Тепер картка тримає те, у чому людина
   має себе впізнати, а відмови стоять спокійним текстом поруч. */
.fit__col--yes {
  background: var(--bg-raised);
  border-left: 2px solid var(--acid);
  padding: clamp(24px, 5vw, 36px);
  border-radius: 0 18px 18px 0;
}

.fit__col--yes .fit__list li {
  color: var(--text);
  font-size: clamp(1rem, 3.2vw, 1.15rem);
  border-top-color: var(--line-strong);
}

@media (min-width: 860px) {
  .fit {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

/* --- 6. Квіз ------------------------------------------------------------ */
.quiz {
  margin-top: clamp(28px, 5vw, 48px);
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: clamp(20px, 5vw, 40px);
}

.quiz__bar {
  height: 3px;
  background: rgba(215, 226, 234, 0.14);
  border-radius: 999px;
  overflow: hidden;
}

.quiz__bar-fill {
  height: 100%;
  width: 0;
  background: var(--acid);
  transition: width 0.35s ease;
}

.quiz__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 14px;
  font-size: var(--fs-small);
  color: var(--text-dim);
}

.quiz__question {
  margin-top: clamp(20px, 4vw, 32px);
  font-size: clamp(1.25rem, 4.6vw, 2rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.quiz__options {
  display: grid;
  gap: 10px;
  margin-top: clamp(20px, 4vw, 28px);
}

.quiz__option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-height: 60px;
  padding: 16px 20px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

.quiz__option:hover {
  border-color: var(--line-strong);
  background: rgba(215, 226, 234, 0.04);
}

.quiz__option[aria-pressed='true'] {
  border-color: var(--text);
  background: rgba(215, 226, 234, 0.08);
}

.quiz__back {
  margin-top: 20px;
  font-size: var(--fs-small);
  color: var(--text-dim);
  text-decoration: underline;
  text-underline-offset: 4px;
}

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

.quiz__result[hidden] {
  display: none;
}

.quiz__verdict {
  margin-top: 6px;
}

.quiz__reason,
.quiz__action {
  margin-top: 16px;
  color: var(--text-dim);
  max-width: 52ch;
}

.quiz__action strong {
  color: var(--text);
  font-weight: 800;
}

.summary {
  margin-top: clamp(24px, 4vw, 32px);
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

.summary__list {
  list-style: none;
  font-size: var(--fs-small);
  color: var(--text-dim);
}

.summary__list li {
  padding-block: 6px;
}

.summary__list b {
  color: var(--text);
  font-weight: 500;
}

.quiz__actions {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

@media (min-width: 560px) {
  .quiz__actions {
    grid-auto-flow: column;
    justify-content: start;
  }
}

.quiz-fallback {
  margin-top: 20px;
}

/* --- 7. Результати (світлий блок) --------------------------------------- */
.rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 88%;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-block: 4px;
  margin-inline: calc(var(--pad-x) * -1);
  padding-inline: var(--pad-x);
  scrollbar-width: thin;
  overscroll-behavior-x: contain;
}

.rail > * {
  scroll-snap-align: start;
}

.rail::-webkit-scrollbar {
  height: 6px;
}

.rail::-webkit-scrollbar-thumb {
  background: var(--ink-line);
  border-radius: 999px;
}

/* Рамка: фото вписується в неї цілком, нічого не обрізається.
   Однаковий розмір карток тримає рамка, а не кадрування файлу. */
.result__media,
.review__media {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--ink-line);
  border-radius: 18px;
  overflow: hidden;
  background: #ffffff;
  cursor: zoom-in;
}


.zoom:hover img {
  opacity: 0.94;
}

/* Фото до/після — рамка 1:1: колажі майже квадратні, тож полів майже немає */
.result__media {
  aspect-ratio: 1 / 1;
}

/* Скріншоти — вища рамка під пропорції телефона */
.review__media {
  aspect-ratio: 2 / 3;
}

/* Випускники живуть на темному тлі, тому без білої підкладки, як у «Результатах».
   Кадри знято на різні камери й у різних пропорціях — рівну рамку тримає cover,
   а object-position трохи вище центру, щоб не зрізало голови. */
.graduate__media {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: var(--bg-raised);
  cursor: zoom-in;
  aspect-ratio: 3 / 4;
}

.graduate__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 26%;
}

.result__media img,
.review__media img {
  width: 100%;
  height: 100%;
  /* contain, а не cover: фото має бути видно цілком, без кадрування */
  object-fit: contain;
}

.result__caption {
  margin-top: 12px;
  font-size: var(--fs-small);
  line-height: 1.45;
}

.result__caption b {
  display: block;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.rail-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-top: clamp(36px, 6vw, 56px);
  margin-bottom: 16px;
}

.rail-head h3 {
  font-size: clamp(1.05rem, 3.4vw, 1.4rem);
}

.rail-nav {
  display: none;
  gap: 8px;
}

.rail-nav button {
  width: 44px;
  height: 44px;
  border: 1px solid var(--ink-line);
  border-radius: 12px;
  display: grid;
  place-items: center;
}

.rail-nav button:hover {
  border-color: var(--ink);
}

@media (min-width: 560px) {
  .rail {
    grid-auto-columns: 60%;
  }
}

@media (min-width: 720px) {
  .rail {
    grid-auto-columns: 44%;
  }

  .rail-nav {
    display: flex;
  }
}

@media (min-width: 1000px) {
  .rail {
    grid-auto-columns: 31%;
  }
}

/* --- 8. Тарифи ---------------------------------------------------------- */
.plans {
  display: grid;
  gap: 14px;
  margin-top: clamp(32px, 6vw, 56px);
}

.plan {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: clamp(22px, 5vw, 34px);
  display: flex;
  flex-direction: column;
}

.plan--featured {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--paper);
}

.plan__term {
  font-size: clamp(1.15rem, 3.8vw, 1.5rem);
  font-weight: 800;
}

.plan__price {
  margin-top: 10px;
  font-size: var(--fs-num);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.03em;
}

.plan__note {
  margin-top: 10px;
  font-size: var(--fs-small);
  color: var(--text-dim);
}

.plan--featured .plan__note {
  color: var(--ink-dim);
}

.plan__list {
  list-style: none;
  margin-top: 22px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.plan--featured .plan__list {
  border-top-color: var(--ink-line);
}

.plan__list li {
  padding-block: 8px;
  font-size: var(--fs-small);
  color: var(--text-dim);
}

.plan--featured .plan__list li {
  color: var(--ink-dim);
}

/* Картки в сітці однакової висоти, а кнопку притискаємо до низу — інакше
   вона їде за довжиною опису і два CTA стоять на різних рівнях. */
.plan__list {
  margin-bottom: 24px;
}

.plan .btn {
  margin-top: auto;
}

.plan--featured .btn--ghost {
  border-color: var(--ink);
  color: var(--ink);
}

.why-three {
  margin-top: clamp(28px, 5vw, 44px);
  max-width: 52ch;
  color: var(--text-dim);
}

.payment {
  margin-top: clamp(24px, 4vw, 36px);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  padding: clamp(20px, 4vw, 28px);
  font-size: var(--fs-lead);
  font-weight: 800;
  line-height: 1.35;
}

.payment span {
  display: block;
  margin-top: 8px;
  font-size: var(--fs-small);
  font-weight: 400;
  color: var(--text-dim);
}

@media (min-width: 800px) {
  .plans {
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
  }
}

/* --- 9. Консультація ---------------------------------------------------- */
.consult {
  display: grid;
  gap: clamp(24px, 5vw, 56px);
  align-items: start;
}

.consult__photo {
  border-radius: var(--radius-media);
  overflow: hidden;
  background: var(--bg-raised);
  aspect-ratio: 2 / 3;
}

.consult__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.consult__more {
  margin-top: clamp(32px, 6vw, 48px);
}

.consult__list {
  list-style: none;
}

.consult__list li {
  border-top: 1px solid var(--line);
  padding-block: 14px;
  color: var(--text-dim);
}

.consult__decision {
  margin-top: 24px;
  font-size: var(--fs-lead);
  font-weight: 800;
  max-width: 28ch;
}

@media (min-width: 860px) {
  .consult {
    grid-template-columns: 1fr 0.72fr;
  }

  /* на мобільному фото йде першим, на широкому екрані — праворуч від тексту:
     решта блоків із фото вибудувані ліворуч, тут дзеркалимо заради ритму */
  .consult__photo {
    grid-column: 2;
    grid-row: 1;
  }

  .consult__body {
    grid-column: 1;
    grid-row: 1;
  }
}

/* --- 10. FAQ ------------------------------------------------------------ */
.faq {
  margin-top: clamp(28px, 5vw, 48px);
}

.faq details {
  border-top: 1px solid var(--line);
}

.faq details:last-of-type {
  border-bottom: 1px solid var(--line);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-block: clamp(18px, 3.5vw, 26px);
  font-size: clamp(1rem, 3.3vw, 1.25rem);
  font-weight: 800;
  line-height: 1.25;
  cursor: pointer;
  list-style: none;
}

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

.faq summary::after {
  content: '';
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  background: currentColor;
  transition: transform 0.25s ease;
  clip-path: polygon(45% 0, 55% 0, 55% 45%, 100% 45%, 100% 55%, 55% 55%, 55% 100%, 45% 100%, 45% 55%, 0 55%, 0 45%, 45% 45%);
}

.faq details[open] summary::after {
  transform: rotate(135deg);
}

.faq__answer {
  padding-bottom: clamp(18px, 3.5vw, 26px);
  color: var(--text-dim);
  max-width: 58ch;
}

/* --- 11. Фінал + футер --------------------------------------------------- */
.final {
  display: grid;
  gap: clamp(28px, 5vw, 56px);
  align-items: center;
}

.final__photo {
  border-radius: var(--radius-media);
  overflow: hidden;
  background: var(--bg-raised);
  /* 3:5 — рідна пропорція цього знімка, тож кадрування немає */
  aspect-ratio: 3 / 5;
}

.final__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.final__note {
  margin-top: 20px;
  color: var(--text-dim);
  max-width: 40ch;
}

@media (min-width: 860px) {
  /* фото вужче за текст: у пропорції 3:5 воно інакше виростає під 850 px
     і лишає півколонки порожнечі поруч із заголовком */
  .final {
    grid-template-columns: 0.62fr 1fr;
  }
}

.footer {
  border-top: 1px solid var(--line);
  padding-block: 32px clamp(32px, 6vw, 48px);
}

.footer__row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 28px;
  align-items: center;
  justify-content: space-between;
}

.footer a {
  text-decoration: none;
  color: var(--text-dim);
  font-size: var(--fs-small);
  /* Сам рядок тексту має висоту 22px — цього замало навіть для мінімуму
     WCAG 2.2 (24×24). Падінгом добираємо до 44px, як радить HIG. */
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.footer a:hover {
  color: var(--text);
}

.footer__name {
  font-weight: 800;
  color: var(--text);
  font-size: var(--fs-small);
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  /* Вертикальний проміжок нульовий навмисно: висоту 44px уже дає сам
     елемент, а зайвий відступ розтягнув би футер удвічі. */
  gap: 0 20px;
}

/* --- Перегляд фото на весь екран ---------------------------------------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: clamp(12px, 4vw, 40px);
  background: #08080a;
}

.lightbox[hidden] {
  display: none;
}

/* Обмеження у відсотках тут не працює: висота рядка сітки залежить від
   самого зображення, відсоток нема від чого рахувати, і браузер його
   ігнорує — через це високі скріншоти вилазили за екран. Тому в'юпортні
   одиниці. dvh, бо на телефоні панелі браузера з'їдають частину висоти. */
.lightbox img {
  max-width: 88vw;
  max-height: 84vh;
  max-height: 84dvh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
}

.lightbox__nav {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: rgba(12, 12, 12, 0.66);
  color: var(--text);
}

.lightbox__nav:hover {
  border-color: var(--text);
  background: rgba(12, 12, 12, 0.9);
}

.lightbox__nav[hidden] {
  display: none;
}

.lightbox__nav--prev {
  left: max(10px, env(safe-area-inset-left));
}

.lightbox__nav--next {
  right: max(10px, env(safe-area-inset-right));
}

.lightbox__close {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  right: 12px;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  color: var(--text);
  background: rgba(20, 20, 23, 0.9);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.lightbox__close:hover {
  background: rgba(40, 40, 45, 0.9);
}

/* Скрол фону блокуємо через position: fixed — overflow:hidden на body
   скидає позицію прокрутки, і сторінка стрибає вгору. */
body.is-locked {
  position: fixed;
  width: 100%;
  overflow-y: scroll;
}

/* --- Єдиний анімаційний момент: поява першого екрана --------------------- */
/* Рух без зміни прозорості: текст першого екрана малюється одразу на повну,
   інакше Chrome не бере його в кандидати LCP і метрика псується. */
.reveal > * {
  transform: translateY(16px);
  animation: reveal-up 0.75s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

.reveal > *:nth-child(1) { animation-delay: 0.05s; }
.reveal > *:nth-child(2) { animation-delay: 0.16s; }
.reveal > *:nth-child(3) { animation-delay: 0.27s; }
.reveal > *:nth-child(4) { animation-delay: 0.38s; }

@keyframes reveal-up {
  to {
    transform: none;
  }
}

/* --- Рух при скролі ------------------------------------------------------
   Три шари: поява блоків, показ фрази по літерах у «Хто я» і розходження
   двох стрічок у «Результатах». Тільки transform і opacity, тож верстка не
   перераховується і CLS лишається нульовим. Перший екран не чіпаємо — там
   свій момент і там LCP.

   Усе вмикається лише тоді, коли JS повісив .js-motion на <html>. Без
   скрипта або з увімкненим prefers-reduced-motion клас не з'являється,
   і жоден елемент не ховається. */
.js-motion [data-reveal] {
  opacity: 0;
  transform: translate3d(var(--reveal-x, 0), var(--reveal-y, 24px), 0);
  transition: opacity 0.7s cubic-bezier(0.25, 0.1, 0.25, 1),
    transform 0.7s cubic-bezier(0.25, 0.1, 0.25, 1);
  transition-delay: var(--reveal-delay, 0s);
}

.js-motion [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

.js-motion [data-reveal='left'] {
  --reveal-x: -44px;
  --reveal-y: 0px;
}

.js-motion [data-reveal='right'] {
  --reveal-x: 44px;
  --reveal-y: 0px;
}

/* Одна фраза на сторінку проявляється по літерах: літера переходить від
   --text-dim до --text. Літери лишаються звичайними inline-спанами, тож
   перенос рядків і читання екранним диктором не змінюються, а обидва
   кольори проходять по контрасту — прозорість тут не використовується. */
.js-motion .type-in span {
  transition: color 0.2s linear;
}

/* Обгортка стрічки. Рухається саме вона, а не сам скролер, — тому
   гортання пальцем, стрілки й scroll-snap працюють як працювали. */
.rail-drift {
  will-change: transform;
}

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

  .reveal > * {
    transform: none;
    animation: none;
  }

  .js-motion [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .js-motion .type-in span {
    color: inherit !important;
  }

  .rail-drift {
    transform: none !important;
    will-change: auto;
  }

  /* Колір і тінь на наведення лишаються — це не рух, а зворотний зв'язок.
     Зникає тільки підйом. */
  .btn {
    --btn-lift: 0px !important;
  }

  .ticker__row {
    animation: none;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
