/* ============================================================
   ЕГОР И АЛЕКСАНДРА — свадебное приглашение
   Mobile-first. База пропорций — десктоп-макет 1920px.
   ============================================================ */

/* ---------- ШРИФТЫ ----------
   Все исходные файлы присутствуют в /fonts (полная кириллица),
   поэтому заместители (Playfair / Marck Script / Golos Text)
   нужны только как системный fallback в стеке. */

@font-face {
  /* AGSaturdayC — даты и тайминг, КАПС, трекинг. Fallback: Playfair Display */
  font-family: "AGSaturdayC";
  src: url("../fonts/AGSaturdayC.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  /* Aurora Script — каллиграфия (имена, The Carlton, заголовки-акценты). Fallback: Marck Script */
  font-family: "Aurora Script";
  src: url("../fonts/AuroraScript.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  /* Proto Grotesk Light — основной текст. Fallback: Golos Text */
  font-family: "Proto Grotesk";
  src: url("../fonts/ProtoGrotesk-Light.ttf") format("truetype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  /* Proxima Nova — служебный текст формы. Fallback: Golos Text / system-ui */
  font-family: "Proxima Nova";
  src: url("../fonts/ProximaNova-Light.otf") format("opentype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Proxima Nova";
  src: url("../fonts/ProximaNova-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ---------- ПЕРЕМЕННЫЕ ---------- */
:root {
  /* палитра */
  --paper:        #E7E3E0;  /* бумага-крем (цвет новой фактуры) */
  --paper-warm:   #ECE8E1;
  --bordeaux:     #8F2727;  /* основной акцент / заголовки / линии (по референсу) */
  --bordeaux-2:   #7A2120;  /* темнее — ховеры / глубина */
  --ink:          #2C2C2B;  /* основной текст */
  --ink-soft:     #4a4a48;

  /* единая система отступов между блоками */
  --block-gap:    clamp(2.5rem, 6vw, 4.6rem);   /* между блоками */
  --block-gap-sm: clamp(.9rem, 2.4vw, 1.5rem);  /* заголовок → его подпись/текст */
  --divider-w:    min(92%, 1640px);             /* ЕДИНАЯ ширина ВСЕХ разделителей (= нижняя линия) */
  --divider-gap:  clamp(1rem, 3vw, 1.5rem);     /* зазор линия↔центр (≈24px) — одинаков у всех */

  /* бархат штор (интро + боковые шторы) */
  --velvet:       #872C27;
  --velvet-dark:  #5E1A18;
  --velvet-deep:  #4A1413;
  --velvet-light: #A23A30;

  /* шрифтовые стеки */
  --f-display: "AGSaturdayC", "Playfair Display", Georgia, serif;
  --f-script:  "Aurora Script", "Marck Script", cursive;
  --f-body:    "Proto Grotesk", "Golos Text", system-ui, sans-serif;
  --f-form:    "Proxima Nova", "Golos Text", system-ui, sans-serif;

  /* тайминги интро */
  --intro-delay: 0.4s;
  --intro-dur:   1.6s;
  --intro-ease:  cubic-bezier(.7, 0, .3, 1);
  --curtain-dur:  1.9s;                         /* раскрытие штор */
  --curtain-ease: cubic-bezier(.32, 0, .18, 1); /* трогается раньше, мягко тормозит */

  /* занавес-интро — кремовая плотная ткань (складки тенями внутри ткани) */
  --curtain-fill: #EFE9E1;   /* кремовая ткань, плотная заливка */
  --curtain-fold: #D8C9B6;   /* складки/тени, чуть темнее */
  /* красный вариант: --curtain-fill: #912020; --curtain-fold: #681919; */
}

/* ---------- RESET ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
  /* кастомный курсор — сердечко EA */
  cursor: url("../assets/cursor-heart.png") 30 30, auto;
}
/* на полях анкеты — то же сердечко-курсор (в наш бордовый), а не каретка */
.field, .field__input, textarea, input, select { cursor: url("../assets/cursor-heart.png") 30 30, auto; }

/* ============================================================
   Кастомный DOM-курсор: по умолчанию брендовое сердечко,
   на hover кликабельных элементов — крупнее, со светлым ореолом
   (только для мыши; на тач-устройствах не активируется через JS)
   ============================================================ */
@media (hover: hover) and (pointer: fine) {
  body.has-cursor, body.has-cursor * { cursor: none !important; }

  .cursor {
    position: fixed;
    left: 0; top: 0;
    width: 0; height: 0;
    z-index: 99999;
    pointer-events: none;
    will-change: transform;
  }
  .cursor__shape {
    position: absolute;
    left: 0; top: 0;
    width: 56px; height: 56px;
    transform: translate(-50%, -50%) scale(1);
    background: center / contain no-repeat url("../assets/cursor-heart.png");
    opacity: 0;
    transition: opacity .2s ease, transform .15s ease, width .15s ease, height .15s ease, filter .15s ease;
  }
  .cursor.is-visible .cursor__shape { opacity: 1; }

  /* состояние «сердечко» над кликабельным: крупнее + светлый ореол + лёгкий pop */
  .cursor.is-heart .cursor__shape {
    width: 58px; height: 58px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%238B1E1E' d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z'/%3E%3C/svg%3E");
    transform: translate(-50%, -50%) scale(1.12);
    filter: drop-shadow(0 0 2px rgba(255, 255, 255, .95)) drop-shadow(0 0 4px rgba(255, 255, 255, .55));
  }
}
@media (prefers-reduced-motion: reduce) {
  .cursor__shape { transition: opacity .2s ease; }
}
body {
  margin: 0;
  /* фактура бумаги — фон всего сайта (бесшовный тайл) */
  background-color: var(--paper);
  background-image: url("../assets/paper.jpg");
  background-size: 600px auto;
  background-repeat: repeat;
  color: var(--ink);
  font-family: var(--f-body);
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p { margin: 0; }

/* (фактуру бумаги теперь даёт background-image на body) */

/* блокировка скролла на время интро */
body.intro-active {
  overflow: hidden;
  height: 100vh;
}

/* ============================================================
   ИНТРО «ШТОРЫ»
   ============================================================ */
.intro {
  position: absolute;            /* привязан к верху страницы — уезжает вместе с hero при скролле */
  top: 0;
  left: 0;
  right: 0;
  height: 100svh;
  z-index: 9999;
  overflow: hidden;
  pointer-events: none;          /* не мешаем кликам после ухода */
}

/* ЗАКРЫТЫЕ ШТОРЫ (старт): нарисованные кремовые половины-картинки, заполняют экран.
   На раскрытии разъезжаются к краям и гаснут. */
.intro__closed {
  position: absolute;
  top: 0;
  height: 100%;
  width: 52%;                    /* лёгкий нахлёст по центру — без щели */
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center top;
  will-change: transform, opacity;
  transition:
    transform var(--curtain-dur) var(--curtain-ease) var(--intro-delay),
    opacity 1.1s ease calc(var(--intro-delay) + .75s);
}
.intro__closed--left  { left: 0;  background-image: url("../assets/curtain-closed-left-v2.svg"); }
.intro__closed--right { right: 0; background-image: url("../assets/curtain-closed-right-v2.svg"); }
body.is-revealed .intro__closed--left  { transform: translateX(-96%); opacity: 0; }
body.is-revealed .intro__closed--right { transform: translateX(96%);  opacity: 0; }

/* РАСКРЫТЫЕ ДРАПИРОВКИ: подхваченные шторы у краёв, проявляются по мере раскрытия.
   Слой не удаляем — остаются боковыми шторами и уезжают со скроллом. */
.intro__drape {
  position: absolute;
  top: 0;
  height: 100%;
  width: auto;
  max-width: none;
  opacity: 0;
  transition: opacity 1.2s ease calc(var(--intro-delay) + .6s);
}
.intro__drape--left  { left: 0;  transform: translateX(-1%); }
.intro__drape--right { right: 0; transform: translateX(1%); }
body.is-revealed .intro__drape { opacity: 1; }

/* ---- облака: 4 шт., ровно по одной линии, параллельно, медленный проход ---- */
.skyclouds {
  position: fixed;
  inset: 0;
  z-index: 10000;                /* поверх штор-интро во время загрузки */
  overflow: hidden;
  pointer-events: none;
}
.skycloud {
  position: absolute;
  top: var(--y, 12vh);
  left: 0;
  width: clamp(160px, 24vw, 420px);
  height: auto;
  opacity: 0;
  will-change: transform, opacity;
  animation-name: cloudDrift;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
  animation-iteration-count: 1;
}
/* --dx задаёт направление: + (слева направо) или − (справа налево) */
@keyframes cloudDrift {
  0%   { opacity: 0;  transform: translateX(var(--start)) scale(var(--s, 1)); }
  12%  { opacity: .9; }
  85%  { opacity: .9; }
  100% { opacity: 0;  transform: translateX(calc(var(--start) + var(--dx, 150vw))) scale(var(--s, 1)); }
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  display: flex;
  padding: clamp(.9rem, 2.2vmin, 2rem);
  overflow: hidden;
}

/* задние боковые шторы (hero__curtain) убраны — их роль играют интро-шторы,
   припаркованные по краям после раскрытия */

/* орнаментальная рамка из макета — на ВЕСЬ экран */
.hero__frame {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;    /* имена — по вертикальному центру */
  text-align: center;
  border: clamp(26px, 3.4vmin, 46px) solid transparent;
  border-image: url("../assets/frame-border.png") 80 / clamp(26px, 3.4vmin, 46px) / 0 stretch;
  /* проявление: мягкий fade по мере раскрытия штор */
  opacity: 0;
  transform: scale(.99);
  transition:
    opacity 1.3s ease var(--intro-delay),
    transform 1.6s var(--intro-ease) var(--intro-delay);
}
body.is-revealed .hero__frame { opacity: 1; transform: scale(1); }

/* имена — каллиграфия, тёплый коричневый, одна строка, мягкая тень */
.hero__names {
  font-family: var(--f-script);
  font-weight: 400;
  color: #473529;                /* Fill из макета */
  font-size: clamp(2rem, 11.46vw, 13.75rem);   /* 220px на макете 1920px */
  line-height: 1.04;
  letter-spacing: 0;
  word-spacing: -.16em;          /* слова ближе друг к другу, как на референсе */
  white-space: nowrap;
  max-width: 100%;
  /* тень из макета: X10 Y3, Blur 8.8, #000 19% */
  text-shadow: .045em .013em .04em rgba(0, 0, 0, .19);
}
.hero__amp {
  font-style: normal;
  padding: 0 .04em;
}

/* «whisper» — имена проявляются слово за словом */
.hero__word {
  display: inline-block;
  opacity: 0;
  transform: translateY(.22em);
  transition: opacity .6s ease, transform .7s cubic-bezier(.2, .7, .2, 1);
}
body.is-revealed .hero__word { opacity: 1; transform: none; }
body.is-revealed .hero__word:nth-child(1) { transition-delay: .85s; }
body.is-revealed .hero__word:nth-child(2) { transition-delay: 1.05s; }
body.is-revealed .hero__word:nth-child(3) { transition-delay: 1.25s; }

/* дата — внизу, у нижней границы рамки */
.hero__date {
  position: absolute;
  left: 0; right: 0;
  bottom: clamp(1.4rem, 6vh, 4.5rem);
}
.hero__date-main {
  font-family: var(--f-display);
  color: #562D12;            /* бордово-коричневый из макета */
  text-transform: uppercase;
  letter-spacing: .32em;
  font-size: clamp(.85rem, 2.6vw, 1.3rem);
  text-indent: .32em; /* компенсация трекинга справа */
}
.hero__date-year {
  font-family: var(--f-display);
  color: #562D12;
  letter-spacing: .3em;
  text-indent: .3em;
  font-size: clamp(.7rem, 2vw, 1rem);
  margin-top: .6em;
}

/* индикатор прокрутки */
.hero__scroll {
  position: absolute;
  bottom: clamp(1rem, 3vh, 2.2rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  opacity: 0;
  transition: opacity 1s ease 2s;
}
body.is-revealed .hero__scroll { opacity: .8; }
.hero__scroll-line {
  display: block;
  width: 1px;
  height: 46px;
  margin-inline: auto;
  background: linear-gradient(to bottom, var(--bordeaux), transparent);
  animation: scrollPulse 2.4s ease-in-out infinite;
}
@keyframes scrollPulse {
  0%, 100% { transform: scaleY(.55); opacity: .4; transform-origin: top; }
  50%      { transform: scaleY(1);   opacity: .9; transform-origin: top; }
}

/* ============================================================
   АДАПТИВ
   ============================================================ */
@media (max-width: 720px) {
  /* на мобиле драпировки чуть дальше к краям — больше просвет под имена */
  .intro__drape--left  { transform: translateX(-22%); }
  .intro__drape--right { transform: translateX(22%); }
  body.is-revealed .intro__closed--left  { transform: translateX(-100%); }
  body.is-revealed .intro__closed--right { transform: translateX(100%); }
  /* имена — в три строки: Егор / и / Александра */
  .hero__names { font-size: clamp(2.9rem, 14vw, 6rem); }
  .hero__names .hero__word { display: block; }
}

@media (max-width: 420px) {
  .hero__names { font-size: clamp(2.5rem, 13vw, 4.4rem); }
  .hero__date-main { letter-spacing: .18em; text-indent: .18em; font-size: .76rem; }
  .hero__date-year { letter-spacing: .22em; text-indent: .22em; }
}

/* ============================================================
   ОБЩЕЕ ДЛЯ СЕКЦИЙ
   ============================================================ */
.section {
  position: relative;
  z-index: 1;
  padding: clamp(3.5rem, 9vw, 7rem) 1.25rem;
}
.wrap { width: min(100%, 1080px); margin-inline: auto; }

/* серив-капс заголовок */
.section__title {
  font-family: var(--f-display);
  font-weight: 400;
  text-transform: uppercase;
  color: var(--ink);
  letter-spacing: .17em;
  line-height: 1.5;
  text-align: center;
  font-size: clamp(1.1rem, 3.4vw, 1.9rem);
  text-indent: .17em;
}
.section__title--bordeaux { color: var(--bordeaux); }

/* каллиграфия-акцент */
.section__script {
  font-family: var(--f-script);
  font-weight: 400;            /* Aurora Script — только 400; иначе браузер «жирнит» (faux-bold) */
  color: var(--bordeaux);
  text-align: center;
  line-height: 1.02;
  font-size: clamp(2.6rem, 8vw, 4.4rem);
  margin-top: .12em;
}
.section__script--lg { font-size: clamp(3rem, 10vw, 6rem); }

/* основной текст */
.prose, .prose p {
  font-family: var(--f-body);
  color: var(--ink-soft);
  font-weight: 300;
  font-size: clamp(1.05rem, 1.3vw, 1.5rem);   /* 24px на макете 1920 */
  line-height: 1.55;
}
.prose--center { text-align: center; max-width: 46rem; margin-inline: auto; }
.prose p + p { margin-top: 1.1em; }

/* описание в секции «главные герои» — размер шрифта как у P.S. (2-я картинка) */
.heroes__prose, .heroes__prose p {
  font-size: clamp(1.05rem, 1.3vw, 1.5rem);   /* как базовый .prose / P.S. */
  line-height: 1.55;                          /* единый интервал, как в .prose / Дресс-код */
}
.heroes__prose {
  max-width: 40rem;            /* как у carlton__ps */
  text-wrap: balance;          /* ровные строки в абзацах */
}

/* дудлы */
.doodle { display: block; margin-inline: auto; }
.doodle--key { width: clamp(96px, 15vw, 158px); margin-block: var(--block-gap); }
.doodle--dog { width: clamp(72px, 12vw, 112px); margin-top: 1rem; }

/* ---------- SCROLL-REVEAL ----------
   [data-reveal]  — блок появляется сам (fade + up)
   [data-stagger] — контейнер виден, а его прямые дети появляются каскадом */
[data-reveal],
[data-stagger] > * {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .8s ease, transform .8s cubic-bezier(.2, .6, .2, 1);
  will-change: opacity, transform;
}
[data-reveal].is-visible,
[data-stagger].is-visible > * { opacity: 1; transform: none; }

/* каскад внутри групп */
[data-stagger].is-visible > *:nth-child(1)  { transition-delay: 0s; }
[data-stagger].is-visible > *:nth-child(2)  { transition-delay: .08s; }
[data-stagger].is-visible > *:nth-child(3)  { transition-delay: .16s; }
[data-stagger].is-visible > *:nth-child(4)  { transition-delay: .24s; }
[data-stagger].is-visible > *:nth-child(5)  { transition-delay: .32s; }
[data-stagger].is-visible > *:nth-child(6)  { transition-delay: .40s; }
[data-stagger].is-visible > *:nth-child(7)  { transition-delay: .48s; }
[data-stagger].is-visible > *:nth-child(8)  { transition-delay: .56s; }
[data-stagger].is-visible > *:nth-child(n+9){ transition-delay: .64s; }

/* ============================================================
   2 · ГЛАВНЫЕ ГЕРОИ
   ============================================================ */
.heroes { text-align: center; }
/* заголовок «главные герои» — размеры из макета (1920px): серив 70px, каллиграфия 144px */
.heroes .section__title {
  font-size: clamp(1.5rem, 3.65vw, 4.375rem);   /* 70px на 1920 */
  line-height: 1.12;
  letter-spacing: .04em;
  text-indent: .04em;
}
.heroes .section__script {
  font-size: clamp(2.6rem, 7.5vw, 9rem);         /* 144px на 1920 */
  line-height: 1;
  margin-top: -.45em;                            /* вплотную под верхнюю надпись (как на референсе) */
}
.heroes__photos {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: clamp(.4rem, 1.4vw, 1.1rem);
  margin-top: var(--block-gap);
  perspective: 1200px;
}
/* фото в белой рамке (как bg-white + p-2 в компоненте) */
.photo {
  margin: 0;
  flex: 0 1 clamp(150px, 25vw, 290px);
  background: #fff;
  padding: clamp(5px, .9vw, 10px);
  border-radius: 10px;
  box-shadow: 0 12px 28px -10px rgba(44, 30, 20, .28);
  /* стартовое состояние — до появления (плоско, прозрачно) */
  opacity: 0;
  transform: translateY(34px) rotate(0deg) scale(.92);
  transition:
    transform .85s cubic-bezier(.34, 1.4, .5, 1),  /* пружинный «разлёт» */
    box-shadow .4s ease,
    opacity .7s ease;
  will-change: transform;
}
.photo img {
  display: block;
  width: 100%;
  aspect-ratio: 488 / 604;
  object-fit: cover;
  border-radius: 5px;
  filter: grayscale(1) contrast(1.03);
}

/* появление: фото «разлетаются» в наклон (аналог animate-варианта) */
.heroes__photos.is-visible > .photo { opacity: 1; }
.heroes__photos.is-visible > .photo:nth-child(1) { transform: rotate(-7deg) translateY(10px);  z-index: 1; }
.heroes__photos.is-visible > .photo:nth-child(2) { transform: rotate(5deg)  translateY(-4px);  z-index: 3; }
.heroes__photos.is-visible > .photo:nth-child(3) { transform: rotate(-5deg) translateY(14px);  z-index: 2; }

/* ховер: фото выпрямляется и приподнимается (аналог hover-варианта) */
.heroes__photos > .photo:hover {
  transform: rotate(0deg) translateY(-14px) scale(1.04) !important;
  box-shadow: 0 22px 42px -12px rgba(44, 30, 20, .4);
  z-index: 10;
}

/* ============================================================
   3 · THE CARLTON
   ============================================================ */
.carlton { text-align: center; }
/* The Carlton — 200px на макете 1920px (адаптивно уменьшается) */
.carlton .section__script { font-size: clamp(2.4rem, 9vw, 12.5rem); line-height: 1; white-space: nowrap; }
/* линии по бокам заголовка The Carlton */
.carlton__title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--divider-gap);
  width: var(--divider-w);
  margin-inline: auto;
}
.carlton__line {
  height: 1px;
  background: var(--bordeaux);
  flex: 1 1 0;                           /* линии тянутся до краёв контейнера */
  min-width: 0;
  /* опускаем к визуальному центру крупной каллиграфии */
  transform: translateY(.18em);
  font-size: clamp(2.8rem, 10.42vw, 12.5rem);   /* em = размер заголовка, чтобы сдвиг масштабировался */
}
.carlton__addr {
  font-family: var(--f-body);
  color: var(--ink-soft);
  margin-top: var(--block-gap-sm);
  font-size: clamp(.9rem, 2.3vw, 1.05rem);
  letter-spacing: .02em;
}
.carlton__art {
  width: min(100%, 760px);
  margin: var(--block-gap) auto var(--block-gap);
  /* фон PNG сделан прозрачным — лайн-арт ложится прямо на бумагу */
}
/* P.S. — отдельный заголовок над текстом */
.carlton__ps-label {
  font-family: var(--f-display);
  letter-spacing: .08em;
  text-align: center;
  color: var(--ink);                          /* тёмный, как на референсе */
  font-size: clamp(1.25rem, 1.7vw, 1.7rem);   /* чуть крупнее основного текста */
  margin: clamp(1.4rem, 3vw, 2.2rem) auto .6rem;
}
/* сам абзац — красный, по центру */
.carlton__ps,
.carlton__ps p { color: #8F2727; }
.carlton__ps {
  max-width: clamp(20rem, 52vw, 46rem);   /* шире — текст в 3 строки, как на рефе */
  line-height: 1.55;                       /* единый интервал, как в .prose / Дресс-код */
  margin-top: 0;
}

/* дата-разделитель */
.datebar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--divider-gap);
  width: var(--divider-w);
  margin: var(--block-gap) auto 0;
}
.datebar__line { height: 1px; background: var(--bordeaux); flex: 1 1 0; min-width: 0; }
.datebar__date {
  font-family: var(--f-display);
  text-transform: uppercase;
  letter-spacing: .26em;
  text-indent: .26em;
  color: var(--bordeaux);
  font-size: 4.5rem;   /* 72px */
  white-space: nowrap;
}

/* ============================================================
   МОНОГРАММА-РАЗДЕЛИТЕЛЬ EA
   ============================================================ */
.monogram {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--divider-gap);
  width: var(--divider-w);
  margin: var(--block-gap) auto 0;
}
.monogram__line { height: 1px; background: var(--bordeaux); flex: 1 1 0; min-width: 0; }
.monogram__mark {
  font-family: var(--f-script);
  color: var(--bordeaux);
  font-size: clamp(1.9rem, 5vw, 2.9rem);
  line-height: 1;
  letter-spacing: .04em;
}

/* ============================================================
   4 · ТАЙМИНГ
   ============================================================ */
/* секция-панель: дата сверху, расписание по центру, монограмма снизу */
.timing {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;                /* дата — вверх, ЕА — вниз */
  /* симметричные поля сверху/снизу, чтобы таймлайн центрировался по-честному */
  padding-top: clamp(2.5rem, 6vw, 5rem);
  padding-bottom: clamp(2.5rem, 6vw, 5rem);
}
.timing .datebar { margin: 0 auto; }             /* верхняя зона: дата+линия */
.timing .monogram { margin: 0 auto; }            /* нижняя зона: линия+ЕА */
.timing .timing__list {
  margin-block: auto;                            /* середина: по центру свободной высоты */
  transform: translateY(-0.7rem);               /* лёгкий подъём: компенсирует крупную дату → поля сверху/снизу равны */
  padding-top: 0;                                /* убираем лишний верхний толчок */
}

.timing__list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1.6rem, 4.5vw, 2.6rem);
  text-align: center;
}
.timing__time {
  font-family: var(--f-display);
  color: var(--ink);
  font-size: clamp(1.15rem, 3.6vw, 1.7rem);
  letter-spacing: .04em;
  line-height: 1.05;
}
.timing__label {
  font-family: var(--f-display);   /* AGSaturdayC, как и цифры */
  color: var(--ink-soft);
  font-weight: 300;
  font-size: clamp(1.1rem, 3vw, 1.4rem);   /* крупнее подписи под цифрами */
  line-height: 1.15;
  margin-top: -.05em;            /* минимальное расстояние до времени */
}

/* hover: красный круг «от руки» вокруг времени (рисуется по кругу) */
.timing__time { display: inline-block; position: relative; }
.timing__circle {
  position: absolute;
  left: 50%; top: 50%;
  width: calc(100% + 2.6em);
  height: calc(100% + 1.7em);
  transform: translate(-50%, -50%) rotate(-3deg);   /* небрежный наклон */
  pointer-events: none;
  overflow: visible;
  z-index: 2;
}
.timing__circle path {
  fill: none;
  stroke: #8B1E1E;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke-dashoffset .5s ease-out;
}

/* ============================================================
   Появление описаний: blur-in-up по буквам (по скроллу, один раз)
   ============================================================ */
.anim-word { display: inline-block; white-space: nowrap; }
.anim-char {
  display: inline-block;
  opacity: 0;
  filter: blur(8px);
  transform: translateY(.4em);
  transition: opacity .55s ease, filter .55s ease, transform .55s ease;
  will-change: opacity, filter, transform;
}
.is-blurred-in .anim-char { opacity: 1; filter: blur(0); transform: none; }
@media (prefers-reduced-motion: reduce) {
  .anim-char { opacity: 1; filter: none; transform: none; transition: none; }
}

/* ============================================================
   5 · ДРЕСС-КОД
   ============================================================ */
.dress { text-align: center; padding-top: clamp(1.5rem, 3vw, 2.5rem); padding-bottom: clamp(1.5rem, 3vw, 2.5rem); }   /* «Дресс-код» ближе к ЕА */

/* «Пожелания» ближе к ЕА, «Анкета» ближе к пожеланиям */
.wishes { padding-top: clamp(1.5rem, 3vw, 2.5rem); padding-bottom: clamp(1.5rem, 3vw, 2.5rem); }
.rsvp { padding-top: clamp(1.5rem, 3vw, 2.5rem); padding-bottom: clamp(.6rem, 1.5vw, 1rem); }   /* кнопка ближе к нижней линии «ЕА» */
.contacts { padding-top: 0; padding-bottom: clamp(3.5rem, 7vw, 6rem); }   /* верхний отступ даёт сама монограмма (--block-gap); низ — воздушный финал */
/* Дресс-код — 135px на макете 1920px */
.dress .section__script { font-size: clamp(2.6rem, 7.03vw, 8.4375rem); line-height: 1; }
.dress__intro { max-width: 42rem; margin-top: var(--block-gap-sm); }
.dress__illustration {
  display: block;
  width: 100%;
  max-width: 460px;
  height: auto;
  margin: clamp(2rem, 4vw, 3rem) auto clamp(1.5rem, 3vw, 2.5rem);
}
@media (max-width: 600px) {
  .dress__illustration { max-width: 260px; }
}
.dress__block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.5rem, 5vw, 4rem);
  align-items: end;            /* текст выравниваем по нижнему краю фото */
  margin-top: var(--block-gap);
  text-align: left;
}
/* описание под фото — тот же размер, что и вступительный абзац (базовый .prose) */
.dress__copy .prose { max-width: 30rem; }
.dress__h {
  font-family: var(--f-display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: .17em;
  text-indent: .17em;
  color: var(--ink);
  font-size: clamp(1.1rem, 3.4vw, 1.9rem);     /* единый кегль с .section__title */
  margin-top: clamp(1.3rem, 3vw, 2rem);        /* отступ от точек-индикаторов карусели */
  margin-bottom: .9rem;
}

/* карусель */
.carousel { position: relative; max-width: 540px; margin-inline: auto; width: 100%; }
.carousel__viewport { overflow: hidden; position: relative; }   /* контекст для стрелок = само фото */
.carousel__track { display: flex; transition: transform .55s cubic-bezier(.4, 0, .2, 1); }
.carousel__slide { flex: 0 0 100%; width: 100%; display: block; aspect-ratio: 736 / 957; object-fit: cover; object-position: top center; }
.carousel__btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  transform-origin: center center;    /* масштаб на hover/press — строго от центра, без сдвига */
  margin: 0;                          /* без индивидуальных отступов, сбивающих высоту */
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;   /* шеврон строго по центру кнопки */
  border-radius: 50%;
  border: 1px solid var(--bordeaux);
  background: rgba(232, 228, 221, .72);
  color: var(--bordeaux);
  font-size: 1.5rem;
  line-height: 1;
  cursor: url("../assets/cursor-heart.png") 30 30, pointer;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  transition: background .25s, transform .25s ease;
  overflow: visible;
}
/* hover: фон чуть плотнее (чтобы кольцо/стрелка читались), лёгкий зум */
.carousel__btn:hover { background: rgba(244, 241, 235, .92); transform: translateY(-50%) scale(1.05); }
.carousel__btn:active { transform: translateY(-50%) scale(.96); }
.carousel__btn--prev { left: 10px; right: auto; }
.carousel__btn--next { right: 10px; left: auto; }

/* кольцо-обводка: рисуется по кругу на hover (старт сверху, от 12 часов) */
.carousel__ring {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  transform: rotate(-90deg);
  pointer-events: none;
}
.carousel__ring circle {
  fill: none;
  stroke: var(--bordeaux);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 125.7;            /* 2·π·r, r=20 */
  stroke-dashoffset: 125.7;           /* по умолчанию кольцо «не нарисовано» */
  transition: stroke-dashoffset .5s ease-in-out;
}
.carousel__btn:hover .carousel__ring circle { stroke-dashoffset: 0; }

/* шеврон поверх кольца — строго по центру кнопки, без смещения */
.carousel__chev {
  position: relative;
  z-index: 1;
  display: inline-block;
}
.carousel__dots {
  position: absolute;          /* вне потока: не добавляет высоту под фото */
  left: 0; right: 0; bottom: -1.75rem;
  display: flex; gap: .5rem; justify-content: center;
}
.carousel__dot {
  width: 8px; height: 8px; padding: 0;
  border-radius: 50%;
  border: 1px solid var(--bordeaux);
  background: transparent;
  cursor: url("../assets/cursor-heart.png") 30 30, pointer;
  transition: background .25s;
}
.carousel__dot.is-active { background: var(--bordeaux); }

/* ============================================================
   7 · RSVP — ФОРМА
   ============================================================ */
.form {
  width: min(100%, 560px);
  margin: clamp(1.2rem, 2.5vw, 1.8rem) auto 0;   /* заголовок анкеты ближе к форме */
  display: flex;
  flex-direction: column;
  gap: clamp(.7rem, 2vw, 1rem);
}
.field { display: block; position: relative; }
.field__input {
  width: 100%;
  min-height: 3.5rem;
  font-family: var(--f-form);
  font-size: 1rem;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--bordeaux);
  border-radius: 999px;
  padding: .95rem 1.4rem;
  text-align: center;
}
/* подпись-вопрос внутри пилюли, переносится по словам, гаснет при вводе */
.field__hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: .4rem 1.2rem;
  font-family: var(--f-form);
  font-size: clamp(.85rem, 2.4vw, 1rem);
  color: var(--bordeaux);
  opacity: .82;
  line-height: 1.25;
  pointer-events: none;
  transition: opacity .2s ease;
}
.field__input:not(:placeholder-shown) ~ .field__hint,
.field__input:focus ~ .field__hint { opacity: 0; }
.field__input:focus {
  outline: none;
  border-color: var(--bordeaux-2);
  box-shadow: 0 0 0 2px rgba(145, 32, 32, .15);
}
.field__input--area { border-radius: 22px; resize: vertical; min-height: 3.6rem; }
.field--area .field__hint { align-items: flex-start; padding-top: 1rem; }
.field__input--select {
  -webkit-appearance: none; appearance: none;
  color: var(--bordeaux);
  text-align-last: center;
  cursor: url("../assets/cursor-heart.png") 30 30, pointer;
}

/* ВЫБОР «Буду на мероприятии» — список с квадратными чек-боксами в бордо */
.choice {
  border: 1px solid var(--bordeaux);
  border-radius: 22px;
  padding: .4rem .5rem .55rem;
  display: flex;
  flex-direction: column;
  gap: .15rem;
}
.choice__q {
  margin: .45rem 0 .25rem;
  text-align: center;
  font-family: var(--f-form);
  font-size: clamp(.85rem, 2.4vw, 1rem);
  color: var(--bordeaux);
  opacity: .82;
  line-height: 1.25;
}
.choice__option {
  position: relative;
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .7rem 1rem;
  border-radius: 14px;
  font-family: var(--f-form);
  color: var(--ink);
  cursor: url("../assets/cursor-heart.png") 30 30, pointer;
  transition: background .2s ease;
}
.choice__option:hover { background: rgba(143, 39, 39, .06); }
.choice__option:has(.choice__input:checked) { background: rgba(143, 39, 39, .09); }
.choice__input { position: absolute; opacity: 0; width: 0; height: 0; }
.choice__radio {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border: 1.5px solid var(--bordeaux);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color .15s ease;
}
.choice__radio::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bordeaux);
  transform: scale(0);
  transition: transform .15s ease;
}
.choice__input:checked ~ .choice__radio::after { transform: scale(1); }
.choice__input:checked ~ .choice__text { color: var(--bordeaux); }
.choice__input:focus-visible ~ .choice__radio { box-shadow: 0 0 0 2px rgba(143, 39, 39, .25); }
.choice__text { font-size: 1rem; line-height: 1.2; text-align: left; }

/* выпадающее меню «Буду на мероприятии» (вид как у поля-пилюли) */
.select { position: relative; }
.select__summary {
  width: 100%;
  position: relative;
  min-height: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--bordeaux);
  border-radius: 999px;
  padding: .95rem 2.6rem;
  font-family: var(--f-form);
  font-size: clamp(.85rem, 2.4vw, 1rem);   /* как у плейсхолдеров полей */
  font-weight: 400;                        /* не жирнее остальных */
  color: var(--bordeaux);
  background: transparent;
  text-align: center;
  -webkit-appearance: none;
  appearance: none;
  user-select: none;
  cursor: url("../assets/cursor-heart.png") 30 30, pointer;
}
/* текст селекта в состоянии «плейсхолдер» — такой же приглушённый, как .field__hint */
.select__value { font-weight: 400; opacity: .82; }
.select__summary:focus-visible {
  outline: none;
  border-color: var(--bordeaux-2);
  box-shadow: 0 0 0 2px rgba(143, 39, 39, .18);
}
.select.is-filled .select__value { color: var(--ink); opacity: 1; }
.select__chevron {
  position: absolute;
  right: 1.3rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1rem;
  height: 1rem;
  display: inline-flex;
  color: var(--bordeaux);
  transition: transform .3s ease;
}
.select__chevron svg { width: 100%; height: 100%; }
.select.is-open .select__chevron { transform: translateY(-50%) rotate(180deg); }
.select__panel {
  /* В ПОТОКЕ — раскрытие раздвигает форму вниз, без наложения */
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  margin-top: 0;
  padding: 0 .45rem;
  background: var(--paper);              /* непрозрачный крем-фон */
  border: 1px solid transparent;
  border-radius: 22px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .06);
  display: flex;
  flex-direction: column;
  gap: .15rem;
  transition: max-height .35s ease, opacity .25s ease, margin-top .35s ease,
              padding .35s ease, border-color .35s ease, visibility 0s linear .35s;
}
.select.is-open .select__panel {
  max-height: 220px;
  opacity: 1;
  visibility: visible;
  margin-top: .55rem;
  padding: .45rem;
  border-color: var(--bordeaux);
  transition: max-height .35s ease, opacity .25s ease, margin-top .35s ease,
              padding .35s ease, border-color .35s ease, visibility 0s;
}
.form__submit {
  position: relative;
  overflow: hidden;            /* текст уезжает, ключик въезжает */
  align-self: center;
  margin-top: .9rem;
  min-width: 12rem;
  font-family: var(--f-display);   /* AGSaturdayC */
  font-size: 1.1rem;
  letter-spacing: .08em;
  color: var(--paper);
  background: var(--bordeaux);
  border: 1px solid var(--bordeaux);
  border-radius: 999px;
  padding: .85rem 3rem;
  cursor: url("../assets/cursor-heart.png") 30 30, pointer;
  transition: background .25s, transform .15s;
}
.form__submit:hover { background: var(--bordeaux-2); }
.form__submit:active { transform: translateY(1px); }
.form__submit[disabled] { opacity: .6; cursor: url("../assets/cursor-heart.png") 30 30, default; }

/* надпись «отправить» — уезжает вправо на ховер */
.form__submit-text {
  display: inline-block;
  transition: transform .5s cubic-bezier(.4, 0, .2, 1);
}
.form__submit:hover .form__submit-text,
.form__submit:focus-visible .form__submit-text { transform: translateX(220%); }

/* ключик — въезжает слева на ховер (как иконка в ModalTrigger) */
.form__submit-icon {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  transform: translateX(-160%);
  transition: transform .5s cubic-bezier(.4, 0, .2, 1);
}
.form__submit:hover .form__submit-icon,
.form__submit:focus-visible .form__submit-icon { transform: translateX(0); }
.form__submit-icon img {
  width: 34px;
  height: auto;
  filter: brightness(0) invert(1);   /* чёрный лайн-арт ключа → белый под бордо */
}
.form__status {
  text-align: center;
  min-height: 1.2em;
  margin-top: .4rem;
  font-family: var(--f-form);
  font-size: .95rem;
  color: var(--bordeaux);
}

/* ============================================================
   8 · КОНТАКТЫ + ФИНАЛ
   ============================================================ */
.contacts { text-align: center; }

/* монограмма EA «в разрыве» линии — gap ~24px, центрирование по линии (scoped, чтобы не задеть дресс-код) */
/* монограмма в контактах использует единый --divider-gap (как все разделители) */

/* заголовок — разреженные капсы, дороже и воздушнее */
.contacts__title {
  max-width: 50vw;              /* самая длинная строка ~половина экрана */
  margin: clamp(1.6rem, 3vw, 2.4rem) auto 0;
  letter-spacing: 0.16em;
  text-indent: 0.16em;          /* компенсация трекинга для центрирования */
  line-height: 1.55;            /* единый интервал, как во всех описаниях */
  font-size: clamp(1rem, 1.9vw, 1.55rem);      /* помещается с полями по бокам */
}
.contacts__list {
  list-style: none;
  padding: 0;
  margin: 2rem auto 0;                          /* ~32px между заголовком и контактами */
  width: max-content;                           /* блок по ширине самой длинной строки… */
  max-width: 100%;                              /* …и центрируется под заголовком */
  display: flex;
  flex-direction: column;
  gap: 12px;                                    /* плотный шаг между строками */
}
.contacts__item {
  display: grid;
  grid-template-columns: 24px 1fr;              /* фикс-колонка под иконку — общий left-edge */
  align-items: center;
  column-gap: 10px;
  line-height: 1.2;
  text-align: left;
}
.contacts__ic {                                  /* контейнер фикс-размера: оптически равные иконки */
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
}
.contacts__icon { width: 24px; height: 24px; object-fit: contain; display: block; }
.contacts__item a {
  font-family: var(--f-body);
  color: var(--ink);
  text-decoration: none;
  font-size: clamp(1rem, 2.6vw, 1.2rem);
  border-bottom: 1px solid transparent;
  transition: color .25s, border-color .25s;
}
.contacts__item a:hover { color: var(--bordeaux); border-color: var(--bordeaux); }

/* тонкая линия-разделитель между контактами и финалом (как в макете) */
.contacts__rule {
  display: block;
  width: var(--divider-w);
  height: 1px;
  margin: clamp(3rem, 6vw, 4.5rem) auto 0;   /* больше воздуха над нижней линией */
  background: var(--bordeaux);
}
.finale { text-align: center; margin-top: var(--block-gap); }
.finale__pre {
  font-family: var(--f-display);   /* AGSaturdayC */
  font-weight: 400;
  color: var(--bordeaux);          /* #8F2727 */
  font-size: clamp(1.3rem, 4vw, 1.9rem);
  letter-spacing: .04em;
}
.finale__names {
  font-family: var(--f-script);
  font-weight: 400;
  color: var(--bordeaux);
  font-size: clamp(2.4rem, 8vw, 4rem);
  line-height: 1.05;
  margin-top: -.18em;          /* подтянуть имена ближе к «С любовью,» */
}

/* ============================================================
   АДАПТИВ СЕКЦИЙ
   ============================================================ */
@media (max-width: 720px) {
  .heroes__photos { gap: .5rem; }
  .dress__block { grid-template-columns: 1fr; gap: 1.6rem; text-align: center; }
  .dress__copy { text-align: center; }
  .dress__copy .prose { margin-inline: auto; }
  /* фото всегда выше текста на мобиле */
  .dress__block .carousel { order: 1; }
  .dress__block .dress__copy { order: 2; }
  .carousel { max-width: 340px; }
  .datebar__date { font-size: clamp(1.6rem, 9vw, 4rem); }   /* дата не вылезает на мобиле */

  /* контакты на мобиле: меньше трекинг, чтобы длинные слова не ломались/не вылезали */
  .contacts { padding-top: 0; padding-bottom: clamp(2.5rem, 9vw, 3.5rem); }
  .contacts__title { max-width: 92vw; letter-spacing: 0.1em; text-indent: 0.1em; line-height: 1.55; word-break: keep-all; overflow-wrap: normal; }
  .contacts__list { margin-top: 2rem; gap: 10px; }
}

/* таймлайн на мобиле: больше воздуха между пунктами + строгое центрирование между датой и «ЕА» */
@media (max-width: 480px) {
  .timing {
    min-height: 78svh;                           /* панель: дата вверху, ЕА внизу, есть что центрировать */
    justify-content: space-between;              /* header дата / footer ЕА по краям */
    padding-top: clamp(1.6rem, 6vw, 2.6rem);
    padding-bottom: clamp(1.6rem, 6vw, 2.6rem);
  }
  .timing .datebar { margin: 0 auto; }           /* верхняя зона */
  .timing .monogram { margin: 0 auto; }          /* нижняя зона */
  .timing .timing__list {
    margin-block: auto;                          /* middle по центру свободной высоты */
    transform: translateY(-1vw);                 /* лёгкий подъём: компенсирует крупную дату → поля сверху/снизу равны */
    padding-top: 0;
    gap: clamp(2.2rem, 8vw, 3.2rem);             /* БОЛЬШЕ воздуха между пунктами */
  }
}

/* ============================================================
   «УЛЕТАЮЩИЙ КОНВЕРТ» — после успешной отправки анкеты
   ============================================================ */
.fly-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  overflow: hidden;
}
.fly-envelope {
  position: absolute;
  top: 0;
  left: 0;
  width: 220px;
  height: auto;
  opacity: 0;
  offset-distance: 0%;       /* offset-path задаётся из JS по размерам окна */
  offset-rotate: auto;       /* конверт наклоняется по направлению полёта */
  will-change: offset-distance, transform, opacity;
  filter: drop-shadow(0 12px 26px rgba(0, 0, 0, .35));
  animation: fly 1.8s ease-in-out forwards;
}
@media (max-width: 600px) {
  .fly-envelope { width: 150px; }
}
@keyframes fly {
  0%   { offset-distance: 0%;   opacity: 0; transform: rotate(-6deg) scale(1); }
  6%   { opacity: 1; }
  50%  { transform: rotate(6deg) scale(1.12); }
  94%  { opacity: 1; }
  100% { offset-distance: 100%; opacity: 0; transform: rotate(-6deg) scale(1); }
}

/* ============================================================
   PREFERS-REDUCED-MOTION — интро пропускается, всё видно сразу
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .skyclouds { display: none !important; }
  .fly-overlay { display: none !important; }
  /* без движения: сразу финал — закрытые скрыты, драпировки у краёв */
  .intro__closed { opacity: 0 !important; transition: none !important; }
  .intro__drape  { opacity: 1 !important; transition: none !important; }
  .hero__frame,
  .hero__scroll,
  .hero__word { opacity: 1 !important; transform: none !important; transition: none !important; }
  .hero__scroll-line { animation: none; }
  body.intro-active { overflow: auto !important; height: auto !important; }
  [data-reveal],
  [data-stagger] > * { opacity: 1 !important; transform: none !important; transition: none !important; }
  .carousel__track { transition: none !important; }
  .select__panel, .select__chevron, .choice__radio::after { transition: none !important; }
}

/* ============================================================
   SCRATCH-TO-REVEAL — дата 08·08·2026 (эффект стирания «облатки»)
   Цвет фольги меняется одной строкой ниже: бордо (по умолч.) ↔ беж.
   ============================================================ */
.scratch {
  /* === ПАЛИТРА ФОЛЬГИ ===
     бордо (наш акцент) — активна.
     Чтобы сделать бежевую: закомментируй три строки бордо и раскомментируй беж. */
  --foil-a:  #9A2C2C;   /* бордо: центр  */
  --foil-b:  #6E1C1C;   /* бордо: края   */
  --foil-hi: #D98A7A;   /* бордо: блик   */
  /* --foil-a:  #E7D8C2;   беж: центр */
  /* --foil-b:  #C9B79B;   беж: края  */
  /* --foil-hi: #FBF4E8;   беж: блик  */

  display: inline-flex;
  align-items: center;
  gap: .12em;
}
.scratch__dot { color: var(--bordeaux); }

.scratch__cell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 .12em;            /* «облатка» чуть шире цифр */
  border-radius: .14em;
}
.scratch__value {
  display: block;
  color: var(--bordeaux);      /* цифра — нашим бордо, как и было */
  line-height: 1;
}
/* холст-фольга поверх цифры */
.scratch__foil {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  cursor: url("../assets/cursor-heart.png") 30 30, pointer;
  touch-action: none;          /* стирание пальцем не скроллит страницу */
  transition: opacity .12s linear;
}
.scratch__cell.is-revealed .scratch__foil {
  opacity: 0;
  pointer-events: none;
}

/* подсказка под датой */
.scratch__hint {
  margin: .7em auto 0;
  text-align: center;
  font-family: var(--f-script);
  color: var(--bordeaux);
  font-size: clamp(1.7rem, 6.4vw, 2.9rem);
  letter-spacing: .02em;
  opacity: 1;
  transition: opacity .6s ease, transform .6s ease;
}
.scratch__hint.is-hidden {
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
}

/* доступность: реальная дата для скринридеров */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* нет JS / reduced-motion — дата видна сразу, фольги нет */
.no-js .scratch__foil { display: none; }
.no-js .scratch__hint { display: none; }
@media (prefers-reduced-motion: reduce) {
  .scratch__foil { display: none; }
  .scratch__hint { display: none; }
}

/* ============================================================
   ФИНАЛ «ШТОРЫ ЗАКРЫВАЮТСЯ» (интро наоборот)
   При доскролле до собачки половинки штор съезжаются к центру и
   закрывают экран, затем проявляется сердце ЕА.
   ============================================================ */
.outro {
  position: fixed;
  inset: 0;
  height: 100svh;
  z-index: 9998;
  overflow: hidden;
  pointer-events: none;          /* не мешаем скроллу/кликам */
  visibility: hidden;            /* пока не закрываем — слой не участвует */
}
body.is-closing .outro { visibility: visible; }

/* половинки штор — те же закрытые ткани, что и в интро.
   Стартуют уехавшими за края (открыто), при закрытии едут к центру. */
.outro__closed {
  position: absolute;
  top: 0;
  height: 100%;
  width: 52%;                    /* лёгкий нахлёст по центру — без щели */
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center top;
  will-change: transform;
  transition: transform var(--curtain-dur) var(--curtain-ease);
}
.outro__closed--left  { left: 0;  background-image: url("../assets/curtain-closed-left-v2.svg");  transform: translateX(-101%); }
.outro__closed--right { right: 0; background-image: url("../assets/curtain-closed-right-v2.svg"); transform: translateX(101%); }
body.is-closing .outro__closed--left,
body.is-closing .outro__closed--right { transform: translateX(0); }

/* сердце ЕА — проявляется после того, как шторы сомкнулись */
.outro__heart {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(74vw, 46vh);
  height: auto;
  transform: translate(-50%, -50%) scale(.82);
  opacity: 0;
  filter: drop-shadow(0 18px 40px rgba(60, 12, 12, .45));
  transition:
    opacity .9s ease,
    transform 1.1s cubic-bezier(.2, .9, .25, 1);
}
body.is-closing .outro__heart {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  /* старт после смыкания штор (≈ длительность хода) */
  transition-delay: 1.45s;
}

@media (prefers-reduced-motion: reduce) {
  .outro__closed,
  .outro__heart { transition: none !important; }
}

/* ============================================================
   IN-APP БРАУЗЕРЫ (Telegram и т.п.): фиксируем финал интро жёстко.
   rAF/CSS-transition там троттлятся — без этого драпировки могут
   «зависнуть» полупрозрачными, а облака замереть в углах.
   intro-done ставится в конце интро по таймеру в любом случае.
   ============================================================ */
body.intro-done .intro__drape  { opacity: 1 !important; transition: none !important; }
body.intro-done .intro__closed { opacity: 0 !important; }
body.intro-done .skyclouds     { opacity: 0 !important; pointer-events: none !important; }

/* ============================================================
   СТРАХОВКА БЕЗ JS — раскрытие штор работает, даже если скрипт
   заморожен/не догрузился (Telegram и другие in-app браузеры).
   Анимации стартуют декларативно. Их финал = финалу интро, поэтому
   при нормальной работе JS никакого лишнего движения не происходит
   (анимация идёт «из финала в финал»). delay 2.8s — позже обычного
   раскрытия (~2.3s), так что красивую анимацию JS не перебивает.
   ============================================================ */
@keyframes introOpenL   { to { transform: translateX(-96%); opacity: 0; } }
@keyframes introOpenR   { to { transform: translateX(96%);  opacity: 0; } }
@keyframes introDrapeIn { to { opacity: 1; } }
@keyframes introCloudsOut { to { opacity: 0; } }

@media (prefers-reduced-motion: no-preference) {
  .intro__closed--left  { animation: introOpenL   .9s var(--curtain-ease) 2.8s forwards; }
  .intro__closed--right { animation: introOpenR   .9s var(--curtain-ease) 2.8s forwards; }
  .intro__drape         { animation: introDrapeIn  .9s ease 2.8s forwards; }
  .skyclouds            { animation: introCloudsOut .6s ease 3.2s forwards; }
}
