/* ==========================================================================
   Основа: сброс, типографика и мелкие общие элементы
   (контейнер, подпись над заголовком, кнопки, ссылки, иконки, появление блоков).
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 20px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--color-page);
  color: var(--color-text);
  font: 400 clamp(16px, 0.3vw + 15px, 18px) / 1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

/* Меню на телефоне открыто — страница под ним не прокручивается */
body.menu-open {
  overflow: hidden;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 500;
  letter-spacing: -0.03em;
  overflow-wrap: break-word;
  text-wrap: balance;
}

h1 {
  font-size: clamp(30px, 2vw + 16px, 48px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

h2 {
  font-size: clamp(26px, 1.4vw + 16px, 40px);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

h3 {
  font-size: clamp(19px, 0.5vw + 16px, 23px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

p {
  margin: 0 0 1em;
  text-wrap: pretty;
}

p:last-child {
  margin-bottom: 0;
}

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

dl,
dd,
figure {
  margin: 0;
}

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

a {
  color: inherit;
  text-underline-offset: 0.22em;
  text-decoration-thickness: 1px;
  transition: color 0.25s;
}

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

/* --- Контейнер: ограничивает ширину содержимого и задаёт поля по бокам --- */
.wrap {
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin: 0 auto;
  padding-inline: max(var(--gutter), env(safe-area-inset-left));
}

/* --- Подпись над заголовком --- */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 22px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--color-text-soft);
}

.eyebrow::before {
  content: '';
  width: 28px;
  height: 1px;
  background: currentColor;
}

/* --- Вводный абзац --- */
.lead {
  font-size: clamp(17px, 0.4vw + 15.5px, 20px);
  line-height: 1.55;
  color: var(--color-text-soft);
}

/* --- Кнопки ---
   .btn         — с рамкой, при наведении заливается тёмным
   .btn--solid  — тёмная, главное действие */
.btn {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0 28px;
  border: 1px solid var(--color-text);
  background: transparent;
  color: var(--color-text);
  font: 500 16px/1 var(--font);
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  overflow: hidden;
  transition: color 0.35s var(--ease);
}

/* Заливка, которая «поднимается» снизу при наведении */
.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--color-text);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.45s var(--ease);
}

.btn:hover {
  color: var(--color-page);
}

.btn:hover::before {
  transform: scaleY(1);
}

.btn--solid {
  background: var(--color-text);
  color: var(--color-page);
}

.btn--solid::before {
  background: var(--color-button-hover);
}

/* Ряд кнопок */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* --- Текстовая ссылка с подчёркиванием --- */
.link {
  display: inline-block;
  padding-bottom: 4px;
  border-bottom: 1px solid currentColor;
  font-weight: 500;
  text-decoration: none;
}

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

/* --- Линейные иконки (inline SVG) --- */
.icon {
  fill: none;
  stroke: var(--color-text);
  stroke-width: 1.3;
  stroke-linecap: square;
  stroke-linejoin: miter;
}

/* --- Появление блоков при прокрутке ---
   Класс .js на <html> ставит скрипт в <head>; без JavaScript всё видно сразу.
   Класс .is-in добавляет js/main.js, когда блок попадает в окно. */
.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 0.8s var(--ease),
    transform 1s var(--ease);
}

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

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
}

/* --- Пользователь просил меньше движения --- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

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

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

/* --- Телефон --- */
@media (max-width: 600px) {
  .actions .btn {
    flex: 1 1 100%;
  }
}
