/* ==========================================================================
   Сброс, типографика, доступность
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  /* Плавный якорный скролл не должен уводить заголовок под фиксированную навигацию */
  scroll-padding-top: 96px;
  /* Записки и подписи намеренно вылезают за край секций. В макете их обрезал
     внешний контейнер; здесь обрезаем на уровне страницы. Правило нужно и на
     html: иначе overflow с body всплывает на вьюпорт, и body перестаёт
     обрезать собственных детей. */
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, h4, p, figure, blockquote { margin: 0; }

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

a:hover { color: var(--coral); }

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

input,
textarea,
button {
  font-family: inherit;
  color: inherit;
}

button { cursor: pointer; }

::selection {
  background: var(--pink);
  color: var(--ink);
}

/* --- Фокус ----------------------------------------------------------------
   В макете стоял голый `outline: none`, из-за чего форма была недоступна
   с клавиатуры. Мышиный фокус гасим, клавиатурный делаем заметным. */

:focus:not(:focus-visible) { outline: none; }

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

/* --- Утилиты --------------------------------------------------------------- */

.container {
  max-width: var(--maxw);
  margin: 0 auto;
}

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

/* Фото, растянутое по контейнеру-обёртке */
.cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --- Анимации -------------------------------------------------------------- */

@keyframes stickerFloat {
  0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); }
  50%      { transform: translateY(-12px) rotate(var(--r, 0deg)); }
}

/* --- Уважение к настройке «меньше движения» --------------------------------
   Гасим покачивание стикеров, плавный скролл и hover-сдвиги. GSAP
   отключается отдельно в js/animations.js. */

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

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