/* =========================================================
   Цвета и шрифты — меняются здесь
   ========================================================= */
:root {
  --red: #f21430;
  --blue: #6389ea;
  --orange: #fe5901;
  --ink: #444;
  --ink-soft: #7a7572;
  --paper: #f5f2ec;
  --font-hand: "Shantell Sans", "Comic Sans MS", cursive;
  --font-text: "Montserrat Alternates", "Montserrat", Arial, sans-serif;
  --font-label: "Comfortaa", var(--font-hand);

  /* 1 «пиксель макета» (макет рисовался на 1920 px) */
  --s: min(calc(100vw / 1920), 1.25px);
}
@media (max-width: 1100px) { :root { --s: calc(100vw / 1300); } }
@media (max-width: 700px)  { :root { --s: calc(100vw / 1150); } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-text);
  font-weight: 300;
  background: var(--paper) url(../img/paper.jpg) repeat;
  background-size: 600px 600px;
  overflow-x: hidden;
}
body.no-scroll { overflow: hidden; }
img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; cursor: pointer; }

/* =========================================================
   Общие элементы
   ========================================================= */
.sec {
  position: relative;
  overflow: hidden;
  overflow: clip;
  text-align: center;
  padding: calc(70 * var(--s)) 16px calc(110 * var(--s));
}
.h-red, .h-dark, .h-sub {
  font-family: var(--font-hand);
  font-weight: 300;
  line-height: 1.12;
  margin: 0 auto;
}
.h-red {
  color: var(--red);
  text-transform: uppercase;
  font-size: calc(96 * var(--s));
  letter-spacing: .02em;
  max-width: calc(1100 * var(--s));
}
.h-dark { color: var(--ink); font-size: calc(96 * var(--s)); }
.h-sub { color: var(--red); font-size: calc(64 * var(--s)); margin-top: calc(120 * var(--s)); margin-bottom: calc(90 * var(--s)); }

.txt {
  font-size: calc(40 * var(--s));
  line-height: 1.2;
  max-width: calc(860 * var(--s));
  margin: calc(55 * var(--s)) auto 0;
}
.txt--narrow { max-width: calc(720 * var(--s)); }
.txt--soft { color: var(--ink); }

.btn {
  display: inline-block;
  margin-top: calc(60 * var(--s));
  padding: .32em 1.1em .38em;
  font-family: var(--font-hand);
  font-weight: 300;
  font-size: max(17px, calc(42 * var(--s)));
  color: var(--red);
  text-decoration: none;
  background: rgba(255, 255, 255, .15);
  border: 1.5px solid rgba(242, 20, 48, .55);
  border-radius: 2px;
  transition: background .25s, color .25s, border-color .25s;
}
.btn:hover, .btn:focus-visible { background: var(--red); color: #fff; border-color: var(--red); outline: none; }

/* Полароид */
.polaroid {
  margin: 0;
  background: #fff;
  container-type: inline-size;
  box-shadow: 0 2px 4px rgba(0,0,0,.08), 0 10px 24px rgba(60,40,30,.18);
  rotate: var(--r, 0deg);
  position: relative;
}
.polaroid__in { padding: 6.4cqw 6.4cqw 24cqw; position: relative; }
.polaroid__img { aspect-ratio: 1 / 1; overflow: hidden; background: #e9e4dc; }
.polaroid__img img { width: 100%; height: 100%; object-fit: cover; }
.polaroid figcaption {
  position: absolute; left: 6%; right: 6%; bottom: 3cqw;
  height: 19cqw;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-hand); font-weight: 300;
  color: var(--red);
  font-size: 5.6cqw;
  line-height: 1.15;
}
.polaroid__img.is-missing, .collage__item.is-missing { background: linear-gradient(135deg, #efe3e3, #dcd3e4); }
.polaroid__img.is-missing img, .collage__item.is-missing img { opacity: 0; }

/* Маленькие сердечки */
.abs-heart {
  position: absolute;
  left: clamp(6px, calc(50% + var(--hx) * var(--s)), calc(100% - 26px));
  top: calc(var(--hy) * var(--s));
  width: max(16px, calc(38 * var(--s)));
  height: max(16px, calc(38 * var(--s)));
  rotate: var(--r, 0deg);
  pointer-events: none;
}

/* Рукописные пометки */
.note {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: var(--font-hand);
  font-weight: 300;
  font-size: max(14px, calc(40 * var(--s)));
  color: var(--ink);
  line-height: 1.1;
  white-space: nowrap;
  pointer-events: none;
}
.note--up { flex-direction: column-reverse; }
.note__text { display: inline-block; rotate: var(--nr, -10deg); }
.note__arrow {
  display: block;
  flex: none;
  width: max(24px, calc(62 * var(--s)));
  height: max(24px, calc(62 * var(--s)));
  margin-top: 2px;
  color: var(--ink);
}
.note--up .note__arrow { margin: 0 0 2px; }

/* Анимации появления */
/* По умолчанию блоки видны. Скрываем только подготовленные к появлению блоки. */
.reveal, .reveal-fade { opacity: 1; }
.reveal.reveal-pending { opacity: 0; translate: 0 40px; }
.reveal-fade.reveal-pending { opacity: 0; }
.reveal.reveal-animate { transition: opacity .9s ease var(--d, 0ms), translate .9s cubic-bezier(.2,.7,.3,1) var(--d, 0ms); }
.reveal-fade.reveal-animate { transition: opacity 1.2s ease .2s; }
.reveal.in { opacity: 1; translate: 0 0; }
.reveal-fade.in { opacity: 1; }
.reveal-animate.in { will-change: opacity, translate; }
.polaroid__img img.image-pending, .collage__item img.image-pending { opacity: 0; transition: opacity .65s ease; }
.polaroid__img img.image-ready, .collage__item img.image-ready { opacity: 1; }
/* Состояние ошибки важнее состояния завершившегося декодирования. */
.polaroid__img.is-missing img.image-ready, .collage__item.is-missing img.image-ready { opacity: 0; }
@media (max-width: 700px) {
  /* На телефоне не двигаем текст и большие SVG во время прокрутки. */
  .reveal.reveal-pending, .reveal.in { translate: none; }
  .reveal.reveal-animate, .reveal-fade.reveal-animate { transition: none; }
  .reveal-animate.in { will-change: auto; }
  .reveal.reveal-running, .reveal-fade.reveal-running {
    animation: wedding-reveal-opacity 1.1s ease-in-out both;
  }
}
@keyframes wedding-reveal-opacity {
  from { opacity: 0; }
  to { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .reveal-fade, .reveal.reveal-pending, .reveal-fade.reveal-pending,
  .polaroid__img img.image-pending, .collage__item img.image-pending { transition: none; opacity: 1; translate: none; will-change: auto; }
  .slider__track, .modal, .modal__card, .rsvp-bar { transition: none !important; }
  .reveal, .reveal-fade { animation: none !important; }
}

/* =========================================================
   1. Обложка
   ========================================================= */
.sec-cover { padding-top: calc(10 * var(--s)); padding-bottom: calc(90 * var(--s)); }
.cover__bunting { width: calc(1180 * var(--s)); margin: 0 auto; }
.bunting { width: 100%; height: auto; overflow: visible; }
.flag__ch { font-family: var(--font-hand); font-weight: 300; font-size: 62px; fill: #333; }

.cover__collage {
  position: relative;
  width: calc(1540 * var(--s));
  aspect-ratio: 1540 / 880;
  margin: calc(20 * var(--s)) auto 0;
  container-type: inline-size;
}
.cover__p, .cover__heart, .cover__label, .cover__arr { position: absolute; }
.cover__p { left: var(--x); top: var(--y); width: 28.6%; }
.cover__p--mirrored .polaroid__img img { transform: scaleX(-1); }
.cover__heart { left: var(--x); top: var(--y); width: 2.4cqw; height: 2.4cqw; rotate: var(--r); z-index: 6; }
.cover__label { font-family: var(--font-hand); font-weight: 300; font-size: 4.7cqw; line-height: 1; z-index: 6; }
.cover__label--groom { color: var(--blue); left: 46%; top: 1%; }
.cover__label--bride { color: var(--orange); left: 33.5%; top: 89%; }
.cover__arr { z-index: 6; }
.cover__arr--groom { color: var(--blue); left: 63%; top: 6%; width: 7.4cqw; height: 7.4cqw; }
.cover__arr--bride { color: var(--orange); left: 28%; top: 78%; width: 6.4cqw; height: 6.4cqw; }

.cover__sum { margin-top: calc(150 * var(--s)); }
.cover__eq {
  font-family: var(--font-hand); font-weight: 300;
  color: var(--red); text-transform: uppercase;
  font-size: calc(96 * var(--s)); line-height: 1.1; letter-spacing: .02em;
}
.cover__eq span { margin: 0 .25em; }
.cover__eq--sign { margin-top: calc(10 * var(--s)); }
.cover__bigheart { display: block; margin: calc(20 * var(--s)) auto 0; width: calc(190 * var(--s)); height: calc(231 * var(--s)); color: var(--red); }

/* =========================================================
   2. История
   ========================================================= */
.sec-history { padding-top: calc(60 * var(--s)); }
.history__photo { position: relative; width: calc(620 * var(--s)); margin: calc(150 * var(--s)) auto 0; }
.history__note { right: 104%; top: 38%; --nr: -8deg; }
.history__note .note__arrow { margin-left: 30%; }

/* =========================================================
   3. Приглашение + календарь
   ========================================================= */
.sec-invite { padding-top: calc(100 * var(--s)); }
.sec-invite .h-red { max-width: calc(980 * var(--s)); }
.date {
  display: flex; align-items: center; justify-content: center;
  gap: calc(60 * var(--s));
  margin-top: calc(90 * var(--s));
  font-family: var(--font-hand); font-weight: 300; line-height: 1;
}
.date__m, .date__y { color: var(--blue); font-size: calc(88 * var(--s)); text-transform: uppercase; }
.date__d { color: var(--orange); font-size: calc(180 * var(--s)); }

.cal {
  display: grid;
  grid-template-columns: repeat(7, calc(106 * var(--s)));
  row-gap: calc(22 * var(--s));
  justify-content: center;
  margin: calc(90 * var(--s)) auto 0;
  font-size: calc(48 * var(--s));
}
.cal__wd { font-family: var(--font-hand); font-weight: 300; color: #666; font-size: calc(42 * var(--s)); margin-bottom: calc(24 * var(--s)); }
.cal__day { position: relative; line-height: 1.1; }
.cal__day--on { color: var(--red); }
.cal__circle {
  position: absolute; left: 50%; top: 50%;
  width: calc(110 * var(--s)); height: calc(92 * var(--s));
  translate: -50% -50%; color: var(--red); pointer-events: none;
}
.cal__note { left: 50%; margin-left: -3.6em; top: 135%; --nr: -7deg; font-size: max(13px, calc(36 * var(--s))); }
.cal__note .note__arrow { margin-left: .8em; width: max(22px, calc(52 * var(--s))); height: max(22px, calc(52 * var(--s))); }
/* место под пометку «Сохраните дату», иначе её обрежет край блока */
.sec-invite .cal { margin-bottom: max(64px, calc(190 * var(--s))); }

/* =========================================================
   4. Место
   ========================================================= */
.title-heart { width: calc(40 * var(--s)); height: calc(40 * var(--s)); vertical-align: top; margin-left: .15em; }
.location__photo { width: calc(560 * var(--s)); margin: calc(110 * var(--s)) auto 0; }
.location__photo .polaroid__in { padding: 5cqw 5cqw 18cqw; }
.location__btn { position: relative; display: inline-block; margin-top: calc(40 * var(--s)); }
.location__note { right: 98%; bottom: 25%; --nr: -12deg; }
.location__note .note__arrow { margin-left: 35%; }

/* =========================================================
   5. Тайминг
   ========================================================= */
.title-wrap { position: relative; display: inline-block; }
.timing__note { left: 100%; top: 62%; --nr: 18deg; }
.timing__note .note__text { white-space: normal; width: 6.5em; text-align: center; }
.timing__note .note__arrow { margin-right: 25%; }
.timeline { list-style: none; margin: calc(80 * var(--s)) 0 0; padding: 0; }
.tl + .tl { margin-top: calc(120 * var(--s)); }
.tl__icon { display: block; width: calc(206 * var(--s)); height: calc(206 * var(--s)); margin: 0 auto calc(20 * var(--s)); }
.tl__row { font-family: var(--font-hand); font-weight: 300; font-size: calc(72 * var(--s)); line-height: 1.1; color: var(--ink); }
.tl__dot { margin: 0 .45em; font-size: .6em; vertical-align: .15em; }

/* =========================================================
   6. Дресс-код
   ========================================================= */
.pal { display: flex; justify-content: center; gap: calc(22 * var(--s)); margin-top: calc(90 * var(--s)); }
.pal__h { width: calc(112 * var(--s)); height: calc(104 * var(--s)); }
.collage { position: relative; width: min(calc(900 * var(--s)), 92vw); margin: 0 auto; }
.collage__item { position: absolute; overflow: hidden; background: #e9e4dc; box-shadow: 0 6px 18px rgba(60,40,30,.08); }
.collage__item img { width: 100%; height: 100%; object-fit: cover; }

/* =========================================================
   7. Пожелания
   ========================================================= */
.sec-wishes { padding-top: calc(120 * var(--s)); }
.wishes__note { right: 103%; top: 5%; --nr: -16deg; }
.wishes__note .note__text { white-space: normal; width: 4.8em; text-align: left; }
.wishes__note .note__arrow { margin-left: 45%; }
.slider {
  display: grid;
  grid-template-columns: auto calc(700 * var(--s)) auto;
  align-items: center; justify-content: center;
  gap: calc(40 * var(--s));
  margin-top: calc(90 * var(--s));
  touch-action: pan-y;
}
.slider__view { overflow: hidden; }
.slider__track { display: flex; transition: transform .6s cubic-bezier(.3,.7,.2,1); }
.slider__slide { flex: 0 0 100%; padding: 0 4px; }
.slider__slide p { margin: 0; font-size: max(15px, calc(31 * var(--s))); line-height: 1.35; }
.slider__btn { background: none; border: 0; padding: 8px; color: var(--red); }
.slider__btn svg { display: block; width: max(28px, calc(48 * var(--s))); height: max(14px, calc(24 * var(--s))); }
.slider__btn--next svg { rotate: 180deg; }
.slider__btn:hover { opacity: .7; }

/* =========================================================
   8. Контакты
   ========================================================= */
.contact__name { margin-top: calc(90 * var(--s)); font-family: var(--font-hand); font-weight: 300; font-size: calc(64 * var(--s)); color: var(--red); }
.contact__phone { display: inline-block; margin-top: calc(24 * var(--s)); font-family: var(--font-hand); font-weight: 300; font-size: calc(56 * var(--s)); text-decoration: none; }
.contact__tg { display: block; width: max(28px, calc(52 * var(--s))); margin: calc(40 * var(--s)) auto 0; color: #5a8ef0; }
.contact__tg svg { width: 100%; aspect-ratio: 1; display: block; }
.contact__tg + .btn { margin-top: calc(40 * var(--s)); }

/* =========================================================
   9. Анкета (блок на странице)
   ========================================================= */
.rsvp__date {
  position: relative; display: inline-block;
  margin-top: calc(40 * var(--s));
  font-family: var(--font-hand); font-weight: 300;
  font-size: calc(64 * var(--s)); color: var(--red);
}
.rsvp__note { left: 100%; top: 108%; --nr: 14deg; font-size: max(13px, calc(34 * var(--s))); }
.rsvp__note .note__arrow { margin-right: 45%; width: max(22px, calc(52 * var(--s))); height: max(22px, calc(52 * var(--s))); }
.sec-rsvp .btn { display: block; width: fit-content; margin-left: auto; margin-right: auto; }

/* =========================================================
   10. Финал
   ========================================================= */
.footer__heart { display: block; width: calc(190 * var(--s)); height: calc(231 * var(--s)); margin: calc(40 * var(--s)) auto 0; color: var(--red); }
.sec-footer .txt { margin-top: calc(150 * var(--s)); }
.footer__photo { width: calc(750 * var(--s)); margin: calc(130 * var(--s)) auto 0; }
.footer__names {
  margin-top: calc(200 * var(--s));
  font-family: var(--font-hand); font-weight: 300;
  color: var(--red); font-size: calc(96 * var(--s));
}

/* =========================================================
   Модальные окна (анкета)
   ========================================================= */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; opacity: 0; transition: opacity .25s; }
.modal.open { opacity: 1; }
.modal[hidden] { display: none; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(50, 36, 36, .38); backdrop-filter: blur(3px); }
.modal__card {
  position: relative;
  width: min(640px, 100%);
  max-height: calc(100dvh - 32px);
  overflow: auto;
  padding: 44px clamp(20px, 5vw, 56px) 40px;
  background: var(--paper) url(../img/paper.jpg);
  background-size: 600px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  translate: 0 20px;
  transition: translate .3s ease;
  text-align: left;
}
.modal.open .modal__card { translate: 0 0; }
.modal__close { position: absolute; top: 8px; right: 12px; background: none; border: 0; font-size: 34px; line-height: 1; color: var(--ink); padding: 6px; }
.modal__title { margin: 0 0 24px; text-align: center; font-family: var(--font-hand); font-weight: 300; text-transform: uppercase; color: var(--red); font-size: clamp(30px, 5vw, 44px); }
.modal__text { text-align: center; font-size: 18px; line-height: 1.4; margin: 0; }
.modal__card--thanks { text-align: center; width: min(460px, 100%); }
.thanks-heart { width: 70px; height: 85px; color: var(--red); display: block; margin: 0 auto 10px; }

.field { display: block; border: 0; margin: 0 0 26px; padding: 0; min-width: 0; transition: opacity .25s; }
.field.is-hidden { display: none; }
.field__title { display: block; padding: 0; margin-bottom: 12px; font-family: var(--font-hand); font-weight: 300; font-size: 21px; color: var(--ink); line-height: 1.25; }
.field input[type="text"] {
  width: 100%; padding: 10px 2px;
  font-family: var(--font-text); font-weight: 400; font-size: 16px; color: var(--ink);
  background: transparent; border: 0; border-bottom: 1.5px solid #cfc7bd; border-radius: 0;
  outline: none; transition: border-color .2s;
}
.field input[type="text"]:focus { border-bottom-color: var(--red); }
.field input::placeholder { color: #aaa39b; }

.choice { display: flex; align-items: center; gap: 12px; margin: 10px 0; font-size: 16px; font-weight: 400; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice__mark { flex: 0 0 22px; width: 22px; height: 22px; border: 1.5px solid #bdb4aa; border-radius: 50%; position: relative; transition: border-color .2s; background: rgba(255,255,255,.5); }
.choice--check .choice__mark { border-radius: 4px; }
.choice input:checked + .choice__mark { border-color: var(--red); }
.choice input:checked + .choice__mark::after { content: ""; position: absolute; inset: 4px; border-radius: inherit; background: var(--red); }
.choice input:focus-visible + .choice__mark { outline: 2px solid var(--blue); outline-offset: 2px; }
.drinks { display: grid; grid-template-columns: 1fr 1fr; column-gap: 16px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form-error { color: var(--red); font-size: 15px; margin: 0 0 14px; }
.btn--form { display: block; margin: 8px auto 0; font-size: 22px; cursor: pointer; }
.btn--form:disabled { opacity: .6; cursor: default; }

/* =========================================================
   Мобильная версия
   ========================================================= */
/* Липкая кнопка «подтвердить присутствие» — только на телефоне */
.rsvp-bar { display: none; }

@media (max-width: 700px) {
  /* Телефон: та же вёрстка, что на компьютере, пропорционально уменьшенная (как в оригинале),
     плюс несколько поправок под узкий экран */
  body.has-rsvp-bar { padding-bottom: 52px; }
  .rsvp-bar {
    display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    height: calc(52px + env(safe-area-inset-bottom)); padding: 0 16px env(safe-area-inset-bottom);
    background: var(--red); color: #fff; border: 0;
    font-family: var(--font-hand); font-weight: 300; font-size: 17px; letter-spacing: .02em;
    box-shadow: 0 -4px 16px rgba(0,0,0,.12);
    transition: translate .3s ease;
  }
  .rsvp-bar.is-hidden { translate: 0 110%; }

  .sec { padding-left: 12px; padding-right: 12px; }
  .txt { font-size: 14px; line-height: 1.3; max-width: calc(760 * var(--s)); }
  .txt--narrow { max-width: calc(720 * var(--s)); }
  .abs-heart { width: 12px; height: 12px; }

  /* обложка: гирлянда во всю ширину, 4 полароида в ряд с обрезкой по краям */
  .cover__bunting { width: 96vw; margin: 8px auto 0; }
  .cover__collage { width: 118vw; margin-left: 50%; translate: -50% 0; margin-top: 6px; }
  .cover__heart { width: 3cqw; height: 3cqw; }
  .cover__sum { margin-top: calc(170 * var(--s)); }

  .history__photo { width: calc(640 * var(--s)); }

  .date { gap: calc(70 * var(--s)); }
  .date__d { font-size: calc(160 * var(--s)); }
  .cal { row-gap: calc(40 * var(--s)); }

  .h-dark { font-size: 28px; }
  .timing__note .note__text { width: 6em; }
  .tl__row { font-size: calc(56 * var(--s)); }
  .tl__icon { width: calc(160 * var(--s)); height: calc(160 * var(--s)); }

  .collage { width: 86vw; }
  .h-sub { font-size: 22px; }

  .wishes__note { right: 101%; top: 22%; }
  .slider { grid-template-columns: auto calc(760 * var(--s)) auto; gap: 6px; }
  .slider__slide p { font-size: 14px; }

  .contact__name { font-size: 21px; }
  .contact__phone { font-size: 21px; }

  .rsvp__date { font-size: 22px; }

  .footer__names { font-size: 28px; }
  .modal__card { padding-top: 36px; }
}

.txt-link { text-decoration: none; border-bottom: 1px solid rgba(68,68,68,.35); }
.txt-link:hover { color: var(--red); border-color: var(--red); }
