/* ============================================================
   BrandPrime — стили
   Концепция: тихая премиальность на тёплом кремовом фоне,
   единственный акцент — матовое золото. Ритм задают две
   тёмные секции. Mobile-first: базовые правила — телефон.
   ============================================================ */


/* ------------------------------------------------------------
   1. ПЕРЕМЕННЫЕ
   Меняете фирменные цвета клиента — меняете только этот блок.
   ------------------------------------------------------------ */
:root {
  /* Цвета */
  --bg:          #FAF8F3;  /* тёплый кремовый фон */
  --bg-tinted:   #F2EEE4;  /* подложка секции «Пакеты» */
  --bg-dark:     #1C1917;  /* тёмные секции */
  --card:        #FFFFFF;  /* карточки */
  --text:        #1C1917;  /* тёплый почти-чёрный */
  --text-muted:  #78716C;  /* вторичный текст */
  --line:        #E5DED0;  /* разделители */

  /* Матовое золото: ровный цвет, без блеска и градиентов */
  --gold:        #A67C2E;  /* графика: линии, иконки, рамки, цифры */
  --gold-deep:   #8A6522;  /* золото в тексте и наведение */
  --gold-text:   var(--gold-deep);   /* на светлом фоне читается тёмное золото */

  /* Тени — нейтральные, тёплые, без цвета */
  --shadow:       0 2px 4px rgba(28, 25, 23, .04), 0 16px 40px rgba(28, 25, 23, .07);
  --shadow-hover: 0 4px 8px rgba(28, 25, 23, .05), 0 28px 60px rgba(28, 25, 23, .12);

  /* Типографика */
  --font-head:   "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body:   "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-accent: "Playfair Display", Georgia, "Times New Roman", serif;

  /* Сетка */
  --container: 1150px;
  --gutter: 24px;          /* поля по бокам на телефоне */
  --section-gap: 88px;     /* расстояние МЕЖДУ блоками (не padding секции) */

  /* Движение */
  --ease: cubic-bezier(.22, .61, .36, 1);
}


/* ------------------------------------------------------------
   2. СБРОС И БАЗОВАЯ ТИПОГРАФИКА
   ------------------------------------------------------------ */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 96px;     /* чтобы шапка не накрывала заголовок секции */
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 {
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--text);
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; }

a { color: inherit; }

ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

:focus-visible {
  outline: 2px solid var(--gold-deep);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Надзаголовок блока: золотой капслок с чертой слева */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  line-height: 1.4;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold-text);
  margin-bottom: 22px;
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--gold);
  flex: none;
}

/* ------------------------------------------------------------
   3. АКЦЕНТНОЕ СЛОВО
   Playfair Italic + золотая линия, которая прочерчивается
   при появлении блока. Максимум одно слово на блок.
   ------------------------------------------------------------ */
.accent-word {
  position: relative;
  font-family: var(--font-accent);
  font-style: italic;
  font-weight: 500;
  color: var(--gold-text);
  white-space: nowrap;
}

.accent-word::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -.06em;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .9s var(--ease) .35s;
}

/* Линия прочерчивается, когда блок проявился */
.js .reveal.is-visible .accent-word::after,
.js .reveal.is-visible.accent-word::after { transform: scaleX(1); }

/* Без JS линия просто на месте */
html:not(.js) .accent-word::after { transform: scaleX(1); }


/* ------------------------------------------------------------
   4. КОНТЕЙНЕР И РИТМ СЕКЦИЙ
   ------------------------------------------------------------ */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Половина сверху + половина снизу = ровно --section-gap между секциями. */
.section { padding-block: calc(var(--section-gap) / 2); }

/* Узкая колонка текста: длина строки не больше ~70 символов */
.prose { max-width: 68ch; }

.section__title {
  font-size: clamp(28px, 6vw, 40px);
  line-height: 1.2;
  letter-spacing: -.02em;
}

.prose p + p { margin-top: 20px; }

.prose .section__title + p { margin-top: 28px; }

.section__head { margin-bottom: 48px; }

/* Абзац-вывод под списком */
.closing {
  margin-top: 44px;
  color: var(--text-muted);
}

/* Тёмная секция: переопределяем переменные — всё внутри перекрашивается */
.section--dark {
  --text: #F5F1E8;
  --text-muted: #A8A096;
  --line: #35302B;
  --card: #262220;
  --gold-text: var(--gold);   /* на тёмном читается светлое золото */
  background: var(--bg-dark);
  color: var(--text);
}

/* Подложка под белые карточки пакетов */
.section--tinted { background: var(--bg-tinted); }


/* ------------------------------------------------------------
   5. КНОПКИ
   Золото матовое; при наведении темнеет до --gold-deep.
   ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;                 /* крупная цель для пальца */
  padding: 14px 28px;
  border: 1px solid transparent;
  border-radius: 2px;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .25s var(--ease),
              border-color .25s var(--ease),
              color .25s var(--ease),
              transform .25s var(--ease);
}

/* Тёмный текст на золоте — как гравировка на латуни.
   Заодно это единственный вариант, проходящий контраст AA. */
.btn--primary {
  background: var(--gold);
  color: #1C1917;
}

.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}

.btn--lg {
  min-height: 58px;
  padding: 17px 36px;
  font-size: 17px;
}

@media (hover: hover) {
  .btn--primary:hover {
    background: var(--gold-deep);
    color: #F5F1E8;
    transform: scale(1.02);
  }

  .btn--ghost:hover {
    border-color: var(--gold);
    color: var(--gold-text);
    transform: scale(1.02);
  }
}

.btn:active { transform: scale(.99); }


/* ------------------------------------------------------------
   6. ШАПКА
   ------------------------------------------------------------ */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background-color .3s var(--ease),
              border-color .3s var(--ease);
}

/* Класс добавляет js/main.js после прокрутки */
.header.is-scrolled {
  background: rgba(250, 248, 243, .85);
  border-bottom-color: var(--line);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 72px;
}

.header__logo {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -.01em;
  text-decoration: none;
}

/* Меню прячем на телефоне: остаются логотип и кнопка */
.nav { display: none; }

.nav__list {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav__link {
  font-size: 15px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color .2s var(--ease);
}

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

.nav__link.is-active { color: var(--gold-text); }

.header__cta {
  min-height: 44px;
  padding: 11px 20px;
  font-size: 15px;
}


/* ------------------------------------------------------------
   7. ПЕРВЫЙ ЭКРАН
   ------------------------------------------------------------ */
.hero {
  padding-top: 148px;
  padding-bottom: calc(var(--section-gap) / 2);
}

.hero__title {
  max-width: 17ch;                  /* заголовок ломается в 3–4 строки */
  font-size: clamp(36px, 9vw, 72px);
  line-height: 1.1;
  letter-spacing: -.035em;
}

/* Слова проявляются по очереди слева направо */
.hero__title .word { display: inline-block; }

.hero__subtitle {
  max-width: 46ch;
  margin: 28px 0 44px;
  font-size: clamp(17px, 2.2vw, 20px);
  line-height: 1.6;
  color: var(--text-muted);
}


/* ------------------------------------------------------------
   8. ПУНКТЫ С ИКОНКАМИ («Для кого», «Подход»)
   ------------------------------------------------------------ */
.features {
  margin-top: 52px;
  display: grid;
  gap: 28px;
}

.feature {
  display: flex;
  align-items: center;
  gap: 16px;
}

.feature__icon,
.factor__icon,
.step__icon {
  color: var(--gold);
  flex: none;
  display: inline-flex;
}

.feature__icon svg { width: 26px; height: 26px; }

.feature__text {
  font-size: 17px;
  line-height: 1.5;
}


/* ------------------------------------------------------------
   9. ПУНКТЫ С ЗОЛОТЫМ МАРКЕРОМ («Проблема»)
   ------------------------------------------------------------ */
.statement {
  font-size: clamp(38px, 10vw, 76px);
  line-height: 1.08;
  letter-spacing: -.035em;
  max-width: 14ch;
}

.points {
  margin-top: 52px;
  display: grid;
  gap: 22px;
  max-width: 62ch;
}

.point {
  position: relative;
  padding-left: 30px;
  font-size: 17px;
  line-height: 1.6;
}

/* Короткая золотая черта вместо маркера */
.point::before {
  content: "";
  position: absolute;
  left: 0;
  top: .72em;
  width: 14px;
  height: 1px;
  background: var(--gold);
}


/* ------------------------------------------------------------
   10. ЦИТАТА-РАЗДЕЛИТЕЛЬ
   ------------------------------------------------------------ */
.quote {
  padding-block: calc(var(--section-gap) / 2);
  text-align: center;
}

.quote__text {
  max-width: 20ch;
  margin: 0 auto;
  font-family: var(--font-accent);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(30px, 7vw, 54px);
  line-height: 1.25;
  letter-spacing: -.01em;
  color: var(--text);
}


/* ------------------------------------------------------------
   11. ПАКЕТЫ
   ------------------------------------------------------------ */
.packages {
  display: grid;
  gap: 20px;
}

.package {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 2px;
  box-shadow: var(--shadow);
  padding: 40px 28px;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}

/* Выделенная карточка: тонкая золотая рамка и плашка сверху */
.package--featured {
  border-color: var(--gold);
  padding-top: 52px;
}

.package__badge {
  position: absolute;
  top: 0;
  left: 28px;
  transform: translateY(-50%);
  padding: 6px 14px;
  background: var(--gold);
  color: #1C1917;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: .12em;
  text-transform: uppercase;
  border-radius: 2px;
}

/* Обводка по контуру: прочерчивается при наведении.
   Размер viewBox и периметр проставляет js/main.js — иначе
   штрих растягивается вместе с карточкой. Значение по умолчанию
   заведомо больше любого периметра, поэтому без JS рамки нет. */
.package__trace {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.package__trace rect {
  fill: none;
  stroke: var(--gold);
  stroke-width: 1;
  stroke-dasharray: var(--perimeter, 4000);
  stroke-dashoffset: var(--perimeter, 4000);
  transition: stroke-dashoffset .8s var(--ease);
}

@media (hover: hover) {
  .package:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
  }

  .package:hover .package__trace rect { stroke-dashoffset: 0; }
}

.package__name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Цена — самый крупный текст в блоке после заголовков */
.package__price {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(32px, 7vw, 42px);
  line-height: 1.15;
  letter-spacing: -.03em;
  margin-top: 16px;
  font-variant-numeric: tabular-nums;   /* цифры не «прыгают» при счётчике */
}

.package__desc {
  margin-top: 18px;
  color: var(--text-muted);
}

.package__list {
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 14px;
  margin-bottom: 40px;
}

/* Тонкая галочка — SVG в фоне, без иконочных шрифтов */
.package__list li {
  position: relative;
  padding-left: 30px;
  font-size: 16px;
  line-height: 1.6;
}

.package__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .28em;
  width: 16px;
  height: 16px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23A67C2E' stroke-width='1.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 8.5 6 12 13.5 4'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* Кнопка прижата к низу карточки, чтобы карточки были ровными */
.package__btn {
  margin-top: auto;
  align-self: stretch;
}

.packages__footer {
  margin-top: 48px;
  text-align: center;
}


/* ------------------------------------------------------------
   12. ФАКТОРЫ ЦЕНЫ — сетка карточек
   ------------------------------------------------------------ */
.factors {
  display: grid;
  gap: 16px;
}

.factor {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 28px 24px;
  transition: border-color .3s var(--ease), transform .3s var(--ease);
}

@media (hover: hover) {
  .factor:hover {
    border-color: var(--gold);
    transform: translateY(-3px);
  }
}

.factor__icon svg { width: 28px; height: 28px; }

.factor__title {
  margin-top: 20px;
  font-size: 18px;
  line-height: 1.3;
  letter-spacing: -.01em;
}

.factor__text {
  margin-top: 8px;
  font-size: 16px;
  line-height: 1.55;
  color: var(--text-muted);
}


/* ------------------------------------------------------------
   13. ЭТАПЫ РАБОТЫ
   Гигантские золотые номера за текстом + линия с точками
   ------------------------------------------------------------ */
.steps {
  position: relative;
  padding-left: 52px;
}

.step {
  position: relative;
  padding-bottom: 44px;
}

/* Отрезок линии от точки шага до следующей точки.
   Так линия заканчивается ровно на последней точке. */
.step::after {
  content: "";
  position: absolute;
  left: -37px;
  top: 18px;
  bottom: -9px;
  width: 1px;
  background: var(--line);
}

.step:last-child::after { display: none; }

/* У последнего шага отступ нужен, чтобы крупная цифра не вылезала */
.step:last-child { padding-bottom: 36px; }

/* Точка на линии: гаснет по умолчанию, загорается по очереди (JS) */
.step::before {
  content: "";
  position: absolute;
  left: -41px;
  top: 9px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--line);
  transition: background-color .5s var(--ease), transform .5s var(--ease);
  z-index: 1;
}

.step.is-lit::before {
  background: var(--gold);
  transform: scale(1.15);
}

/* Номер — крупный, полупрозрачный, за текстом.
   Привязан к верху шага, а не к центру: иначе цифра съезжает
   вниз и налезает на следующий шаг. */
.step__num {
  position: absolute;
  left: -14px;
  top: -16px;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 72px;
  line-height: 1;
  letter-spacing: -.05em;
  color: var(--gold);
  opacity: .13;
  pointer-events: none;
  user-select: none;
}

.step__body { position: relative; }

.step__title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  line-height: 1.3;
  letter-spacing: -.01em;
}

.step__icon svg { width: 20px; height: 20px; }

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


/* ------------------------------------------------------------
   14. КОНТАКТЫ
   Сюда ведут все кнопки «Обсудить проект»
   ------------------------------------------------------------ */
.contact { max-width: 56ch; }

.contact__note {
  font-size: clamp(18px, 2.4vw, 21px);
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 34ch;
}

.contact__links {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

/* На узком экране кнопки во всю ширину — так в них проще попасть */
.contact__links .btn { flex: 1 1 100%; }

.contact__phone {
  margin-top: 32px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -.01em;
}


/* ------------------------------------------------------------
   15. ФУТЕР
   ------------------------------------------------------------ */
.footer {
  border-top: 1px solid var(--line);
  padding: 56px 0 48px;
}

.footer__text {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-muted);
}

.footer__text a {
  text-decoration: none;
  transition: color .2s var(--ease);
}

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


/* ------------------------------------------------------------
   16. АНИМАЦИИ ПОЯВЛЕНИЯ
   Класс .js ставит инлайновый скрипт в <head>: без JS контент
   виден сразу и ничего не прячется.
   ------------------------------------------------------------ */
.js .reveal {
  opacity: 0;
  transform: translateY(25px);
  transition: opacity .6s ease-out, transform .6s ease-out;
  transition-delay: var(--reveal-delay, 0s);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Слова заголовка сдвигаются меньше — иначе строка «дёргается» */
.js .hero__title .reveal { transform: translateY(14px); }


/* ------------------------------------------------------------
   17. АДАПТИВ
   ------------------------------------------------------------ */

/* Планшет */
@media (min-width: 600px) {
  :root {
    --gutter: 32px;
    --section-gap: 104px;
  }

  body { font-size: 18px; }

  .features {
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
  }

  .feature {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
  }

  .factors { grid-template-columns: repeat(2, 1fr); }

  .packages { gap: 24px; }

  .package { padding: 48px 40px; }

  .package--featured { padding-top: 56px; }

  .package__badge { left: 40px; }

  /* С планшета кнопки встают в ряд по своей ширине */
  .contact__links .btn { flex: 0 0 auto; }

  .steps { padding-left: 88px; }

  .step::before { left: -59px; }

  .step::after { left: -55px; }

  .step__num { left: -24px; top: -22px; font-size: 96px; }

  .footer { padding: 72px 0 56px; }
}

/* Десктоп: появляется меню, карточки встают в два столбца */
@media (min-width: 900px) {
  :root {
    --gutter: 40px;
    --section-gap: 140px;   /* ключевой ритм макета */
  }

  .header__inner { height: 84px; }

  .nav { display: block; }

  .hero {
    padding-top: 210px;
    padding-bottom: calc(var(--section-gap) / 2);
  }

  .features { gap: 40px; }

  .factors {
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
  }

  .factor { padding: 32px 28px; }

  .packages {
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
  }

  .package { padding: 56px 48px; }

  .package--featured { padding-top: 64px; }

  .package__badge { left: 48px; }

  .steps { padding-left: 132px; }

  .step::before { left: -75px; }

  .step::after { left: -71px; }

  .step__num { left: -36px; top: -28px; font-size: 116px; }

  .step { padding-bottom: 64px; }

  .step:last-child { padding-bottom: 44px; }

  .section__head { margin-bottom: 64px; }
}


/* ------------------------------------------------------------
   18. УВАЖЕНИЕ К НАСТРОЙКАМ ПОЛЬЗОВАТЕЛЯ
   Если в системе выключены анимации — выключаем и у себя.
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }

  .accent-word::after { transform: scaleX(1); }
}
