/* Базовые стили: body, типографика, общие классы секций, утилиты, reveal. */

body {
  background-color: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: 400;
  overflow-x: hidden;
}

/* Пока конверт не открыт — основной контент спрятан, скролл заблокирован.
   Класс снимается в JS после анимации открытия. */
body.is-locked {
  overflow: hidden;
  height: 100vh;
  height: 100svh;
}

/* Lenis */
html.lenis,
html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

/* Контейнер */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding-inline: clamp(20px, 4vw, 48px);
}
.container--narrow { max-width: 760px; }

/* === Утилитарная типографика === */
.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: var(--fs-eyebrow);
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.italic { font-style: italic; }
.accent { color: var(--color-gold); }
.muted  { color: var(--color-muted); }
.center { text-align: center; }

.hand {
  font-family: var(--font-hand);
  font-weight: 500;
  letter-spacing: 0.005em;
  line-height: 1.15;
  color: var(--color-ink);
}

/* === Секции === */
.section {
  position: relative;
  padding: clamp(72px, 12vw, 140px) 0;
  background: var(--color-bg);
}
.section--deep {
  background: var(--color-bg-deep);
}

.section__head {
  text-align: center;
  max-width: 720px;
  margin: 0 auto clamp(40px, 6vw, 72px);
}

.section__eyebrow {
  font-family: var(--font-body);
  font-size: var(--fs-eyebrow);
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--color-muted);
  display: inline-block;
}

.section__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--fs-display);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin-top: 16px;
  color: var(--color-ink);
}

.section__lead {
  font-family: var(--font-body);
  color: var(--color-muted);
  font-size: var(--fs-body);
  line-height: 1.7;
  margin-top: 18px;
}

/* === Универсальный reveal для [data-animate] === */
[data-animate] {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 1.1s var(--ease-out-expo),
    transform 1.1s var(--ease-out-expo);
  transition-delay: calc(var(--i, 0) * 90ms);
}
[data-animate].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* === Универсальный reveal для [data-reveal] (внутри Hero) === */
[data-reveal] {
  opacity: 0;
  transform: translateY(40px);
}
[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 1.2s var(--ease-out-expo),
    transform 1.2s var(--ease-out-expo);
}

@media (prefers-reduced-motion: reduce) {
  [data-animate], [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* Когда активен GSAP — он сам управляет from-состоянием.
   Выключаем CSS-переходы и стартовые сдвиги, чтобы не конфликтовать. */
.has-gsap [data-animate],
.has-gsap [data-reveal] {
  transition: none !important;
}

/* === Scroll hint (стрелка вниз в Hero) ===
   Базовое состояние — видим. Класс .is-hidden ставится JS'ом (scroll-hint.js)
   как только пользователь чуть прокрутил вниз. */
.scroll-hint {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-top: clamp(40px, 5vw, 64px);
  font-size: var(--fs-eyebrow);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--color-muted);
  cursor: pointer;
  opacity: 1;
  transition: opacity 400ms var(--ease-out-expo),
              transform 400ms var(--ease-out-expo);
}
.scroll-hint.is-hidden {
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
}
.scroll-hint__line {
  display: block;
  width: 1px;
  height: 36px;
  background: var(--color-ink-soft);
  animation: scroll-hint-pulse 2.2s var(--ease-in-out) infinite;
  transform-origin: top;
}
@keyframes scroll-hint-pulse {
  0%, 100% { transform: scaleY(1);   opacity: 1; }
  50%      { transform: scaleY(1.4); opacity: 0.55; }
}

/* === Подвал === */
.invite-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: clamp(56px, 8vw, 96px) 24px clamp(40px, 6vw, 64px);
  background: var(--color-bg);
  border-top: 1px solid var(--color-line);
}
.invite-footer__monogram {
  /* НЕ italic Cormorant — italic-Л сливался с & и читался как «лес».
     Берём прямой Cormorant Medium с большим letter-spacing — чисто и читаемо. */
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 500;
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  color: var(--color-gold);
  letter-spacing: 0.2em;
}
.invite-footer__line {
  width: 64px;
  height: 1px;
  background: var(--color-line);
}
.invite-footer__date {
  font-size: var(--fs-small);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-muted);
  text-align: center;
}

/* === Marker-обводки через SVG-filter === */
.marker-box {
  position: relative;
  isolation: isolate;
}
.marker-box::before {
  content: "";
  position: absolute;
  inset: -6px;
  border: var(--stroke-mid) solid var(--color-ink);
  border-radius: 6px;
  filter: url(#marker-rough);
  pointer-events: none;
  z-index: -1;
}

/* Wavy underline через градиент — для подчёркиваний в hand-стиле */
.underline-marker {
  background-image:
    linear-gradient(transparent 65%,
                    color-mix(in oklab, var(--color-gold) 45%, transparent) 65%,
                    color-mix(in oklab, var(--color-gold) 45%, transparent) 90%,
                    transparent 90%);
  background-repeat: no-repeat;
  padding: 0 4px 2px;
}

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