/* Базовые стили: сброс, типографика, кнопки, фокус, служебные классы. */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 96px; /* якоря не прячутся под шапкой */
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip; /* живой фон первого экрана не даёт горизонтальной прокрутки */
  --focus: var(--accent);
}

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

h1, h2, h3, p, figure, blockquote, ul, ol { margin: 0; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }

h1, h2, h3 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.03em;
  color: var(--brand);
  text-wrap: balance;
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); line-height: 1.25; letter-spacing: -0.02em; }
p { text-wrap: pretty; }

/* акцентная фраза заголовка: одна на заголовок */
.accent {
  font-family: var(--font-accent);
  font-style: italic;
  font-weight: 600;
  font-size: 1.08em;
  letter-spacing: -0.01em;
  color: var(--lilac-ink);
}
.on-dark .accent { color: var(--lilac); }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--lilac-ink); }
button { font: inherit; color: inherit; }

/* фокус виден всегда; на тёмных блоках — белый */
.on-dark { --focus: #FFFFFF; }
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}
:focus:not(:focus-visible) { outline: none; }

/* ---------- кнопки ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 24px;
  border: 0;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.25s, box-shadow 0.25s, transform 0.25s var(--ease-out), color 0.25s;
}
.btn svg { flex: none; width: 20px; height: 20px; }
.btn--lg { min-height: 60px; padding: 0 28px; font-size: 1.0625rem; }

/* основная — лиловая на любом фоне */
.btn-main { background: var(--lilac); color: var(--on-accent); }
.btn-main:hover {
  background: var(--lilac-hover);
  color: var(--on-accent);
  box-shadow: 0 0 0 6px rgba(201, 184, 255, 0.16), 0 10px 30px -6px rgba(201, 184, 255, 0.55);
  transform: translateY(-2px);
}

/* вторичная на светлом — контур шоколадом */
.btn-line { background: transparent; color: var(--brand); box-shadow: inset 0 0 0 1.5px var(--brand); }
.btn-line:hover { background: var(--brand); color: #FFFFFF; transform: translateY(-2px); }

/* вторичная на тёмном — белый контур 60 % */
.btn-line-d { background: transparent; color: #FFFFFF; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.6); }
.btn-line-d:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #FFFFFF;
  box-shadow: inset 0 0 0 1.5px #FFFFFF;
  transform: translateY(-2px);
}

/* мягкая кнопка на белой карточке */
.btn-chip {
  min-height: 40px;
  padding: 0 16px;
  background: var(--chip-bg);
  color: var(--text);
  font-size: var(--fs-small);
  transition: background-color 0.2s;
}
.btn-chip:hover { background: var(--chip-bg-hover); color: var(--text); }

/* ---------- раскладка ---------- */

.container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- служебное ---------- */

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px; top: -100px;
  z-index: 100;
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  background: var(--lilac);
  color: var(--on-accent);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 16px; }

/* общие появления */
@keyframes rise { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes word { from { opacity: 0; transform: translateY(40%); filter: blur(6px); } to { opacity: 1; transform: none; filter: blur(0); } }

/* все анимации и переходы выключаются по настройке системы */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
