/* ===== Переменные и базовые стили ===== */
:root {
  --cream: #faf6ef;
  --ivory: #fffdf9;
  --sage: #8a9a7b;
  --sage-dark: #6f7e62;
  --gold: #c2a878;
  --gold-dark: #a98f5f;
  --text: #4a463f;
  --text-soft: #7a756c;
  --rose: #d98b8b;
  --names-rose: #b23a5b; /* тёмно-розовый из лепестков пионов — для имён */
  --shadow: 0 18px 50px rgba(74, 70, 63, 0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Cormorant Garamond', Georgia, serif;
  color: var(--text);
  background: var(--cream);
  font-size: 19px;
  line-height: 1.6;
  scroll-snap-type: y proximity;
  overflow-x: hidden;
}

/* ===== Секции ===== */
.section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 90px 24px;
  position: relative;
  scroll-snap-align: start;
  overflow: hidden;
}
.section--light { background: var(--ivory); }
.section--accent {
  background:
    radial-gradient(circle at 50% 0%, rgba(138,154,123,0.10), transparent 60%),
    var(--cream);
}

.container {
  width: 100%;
  max-width: 760px;
  text-align: center;
}

.section__title {
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  font-weight: 500;
  color: var(--sage-dark);
  margin-bottom: 42px;
  position: relative;
  display: inline-block;
}
.section__title::after {
  content: '';
  display: block;
  width: 70px; height: 1px;
  background: var(--gold);
  margin: 16px auto 0;
}

/* ===== 1. Главный экран ===== */
.section--hero {
  background:
    radial-gradient(circle at 50% 30%, rgba(255,255,255,0.55), transparent 55%),
    linear-gradient(160deg, #e9eee2 0%, #f6efe4 55%, #f3e7e0 100%);
  text-align: center;
  flex-direction: column;
}
/* Главный экран: контент опускаем ниже гирлянды (отступ = высота гирлянды + запас) */
#hero { justify-content: flex-start; padding-top: 0; }
#hero .hero__inner { padding-top: min(calc(40vw + 22px), 543px); padding-bottom: 60px; }
.hero__inner { max-width: 760px; }
.hero__eyebrow {
  text-transform: uppercase;
  letter-spacing: 7px;
  font-size: clamp(1.19rem, 2.8vw, 1.47rem);  /* +40% */
  font-weight: 500;
  color: var(--sage-dark);
  margin-bottom: 20px;
}
.names {
  font-family: 'Great Vibes', cursive;
  font-weight: 400;
  font-size: clamp(5.04rem, 18.2vw, 9.8rem);  /* +40% */
  line-height: 1.05;
  color: var(--names-rose);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.names .amp {
  font-size: 0.6em;
  color: var(--gold);
  line-height: 0.6;
  animation: ampPop 0.7s ease-out 0.9s both;
}
/* Имена выплывают навстречу друг другу: «Елена» слева, «Павел» справа */
.names span:first-child { animation: nameFromLeft 1.2s cubic-bezier(.22,.9,.3,1) both; }
.names span:last-child  { animation: nameFromRight 1.2s cubic-bezier(.22,.9,.3,1) both; }
@keyframes nameFromLeft {
  from { opacity: 0; transform: translateX(-120%); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes nameFromRight {
  from { opacity: 0; transform: translateX(120%); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes ampPop {
  from { opacity: 0; transform: scale(0.4); }
  to   { opacity: 1; transform: scale(1); }
}
.hero__date {
  letter-spacing: 5px;
  text-transform: uppercase;
  font-size: clamp(1.61rem, 3.92vw, 2.1rem);  /* +40% */
  font-weight: 600;
  color: var(--sage-dark);
  margin: 28px 0 54px;
}

/* ===== Таймер ===== */
.countdown__title {
  font-size: 1.3rem;
  color: var(--text-soft);
  letter-spacing: 1px;
  margin-bottom: 18px;
}
.countdown {
  display: flex;
  justify-content: center;
  gap: clamp(10px, 3vw, 26px);
  flex-wrap: wrap;
}
.countdown__cell {
  background: rgba(255,255,255,0.65);
  border: 1px solid rgba(194,168,120,0.4);
  border-radius: 14px;
  padding: 18px clamp(12px, 4vw, 26px);
  min-width: 78px;
  box-shadow: 0 8px 24px rgba(74,70,63,0.08);
}
.countdown__num {
  display: block;
  font-size: clamp(2rem, 7vw, 3rem);
  font-weight: 600;
  color: var(--sage-dark);
  line-height: 1;
}
.countdown__lbl {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-soft);
  margin-top: 8px;
}

/* Подсказка скролла */
.scroll-hint {
  position: absolute;
  bottom: 34px;
  left: 50%;
  transform: translateX(-50%);
  width: 26px; height: 44px;
  border: 2px solid var(--gold-dark);
  border-radius: 14px;
}
.scroll-hint span {
  position: absolute;
  top: 8px; left: 50%;
  width: 4px; height: 8px;
  margin-left: -2px;
  background: var(--gold-dark);
  border-radius: 2px;
  animation: scrollDot 1.6s infinite;
}
@keyframes scrollDot {
  0% { opacity: 0; transform: translateY(0); }
  40% { opacity: 1; }
  100% { opacity: 0; transform: translateY(16px); }
}

/* ===== 2. Приглашение ===== */
.ornament {
  font-size: 2.4rem;
  color: var(--rose);
  margin-bottom: 26px;
}
.ornament--light { color: var(--gold); }
.invite__text {
  font-size: clamp(1.25rem, 3.4vw, 1.7rem);
  line-height: 1.7;
  color: var(--text);
  max-width: 620px;
  margin: 0 auto;
}
.invite__date {
  font-family: 'Great Vibes', cursive;
  font-size: clamp(2.4rem, 7vw, 3.4rem);
  color: var(--sage-dark);
  margin: 34px 0 40px;
}

/* ===== Календарь ===== */
.calendar {
  max-width: 380px;
  margin: 0 auto;
  background: #ffffff;
  border: 1px solid rgba(194,168,120,0.35);
  border-radius: 18px;
  padding: 24px 22px 28px;
  box-shadow: var(--shadow);
}
.calendar__month {
  font-size: 1.5rem;
  color: var(--gold-dark);
  letter-spacing: 2px;
  margin-bottom: 18px;
}
.calendar__weekdays,
.calendar__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.calendar__weekdays span {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-soft);
  padding-bottom: 8px;
}
.calendar__grid { margin-top: 4px; }
.calendar__day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  color: var(--text);
  border-radius: 50%;
}
.calendar__day--empty { visibility: hidden; }
.calendar__day--target {
  position: relative;
  color: #fff;
  font-weight: 600;
}
.calendar__day--target::before {
  content: '\2665'; /* сердце */
  position: absolute;
  inset: -2px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.7rem;
  color: var(--rose);
  z-index: 0;
  animation: heartBeat 1.8s ease-in-out infinite;
}
.calendar__day--target span {
  position: relative;
  z-index: 1;
}
@keyframes heartBeat {
  0%, 100% { transform: scale(1); }
  45% { transform: scale(1.12); }
}

/* ===== 3. Таймлайн ===== */
.timeline {
  text-align: left;
  max-width: 600px;
  margin: 0 auto;
  position: relative;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 70px; top: 8px; bottom: 8px;
  width: 1px;
  background: rgba(194,168,120,0.5);
}
.timeline__item {
  display: flex;
  gap: 26px;
  padding: 16px 0;
  position: relative;
}
.timeline__time {
  flex: 0 0 56px;
  text-align: right;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--sage-dark);
}
.timeline__item::after {
  content: '';
  position: absolute;
  left: 65px; top: 26px;
  width: 11px; height: 11px;
  background: var(--gold);
  border: 3px solid var(--cream);
  border-radius: 50%;
}
.section--accent .timeline__item::after { border-color: var(--cream); }
.timeline__body { padding-left: 14px; }
.timeline__body h3 {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.timeline__body p {
  color: var(--text-soft);
  font-size: 1.1rem;
}

/* ===== 4. Место ===== */
.place__text {
  font-size: 1.3rem;
  max-width: 600px;
  margin: 0 auto 14px;
}
.place__text strong { color: var(--sage-dark); }
.place__address {
  color: var(--text-soft);
  font-size: 1.15rem;
  max-width: 560px;
  margin: 0 auto 32px;
  font-style: italic;
}
.map {
  width: 100%;
  height: 420px;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid rgba(194,168,120,0.35);
}
.map iframe { display: block; border: 0; }

/* ===== 5. Детали ===== */
.details__cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px;
  max-width: 720px;
  margin: 0 auto;
}
.detail-card {
  background: var(--ivory);
  border: 1px solid rgba(194,168,120,0.3);
  border-radius: 18px;
  padding: 34px 28px;
  box-shadow: var(--shadow);
}
.detail-card__icon {
  font-size: 2.2rem;
  color: var(--rose);
  margin-bottom: 14px;
}
.detail-card p {
  font-size: 1.2rem;
  color: var(--text);
  line-height: 1.65;
}

/* ===== 6. Анкета ===== */
.rsvp__lead {
  font-size: 1.25rem;
  color: var(--text-soft);
  margin-bottom: 40px;
}
.rsvp-form {
  text-align: left;
  max-width: 600px;
  margin: 0 auto;
  background: var(--ivory);
  border: 1px solid rgba(194,168,120,0.3);
  border-radius: 20px;
  padding: 38px clamp(20px, 5vw, 44px);
  box-shadow: var(--shadow);
}
.field { margin-bottom: 30px; border: 0; }
.field__label {
  display: block;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--sage-dark);
  margin-bottom: 14px;
}
.muted { color: var(--text-soft); font-weight: 400; font-size: 0.95rem; }

textarea {
  width: 100%;
  font-family: inherit;
  font-size: 1.1rem;
  color: var(--text);
  padding: 14px 16px;
  border: 1px solid rgba(122,117,108,0.3);
  border-radius: 12px;
  background: #fff;
  resize: vertical;
}
textarea:focus {
  outline: none;
  border-color: var(--sage);
  box-shadow: 0 0 0 3px rgba(138,154,123,0.18);
}

.opts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 22px;
}
.opt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--text);
}
.opt input {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 22px;
  width: 22px; height: 22px;
  border: 1.5px solid var(--gold-dark);
  background: #fff;
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
}
.opt input[type="radio"] { border-radius: 50%; }
.opt input[type="checkbox"] { border-radius: 6px; }
.opt input:checked {
  background: var(--sage);
  border-color: var(--sage);
}
.opt input:checked::after {
  content: '';
  position: absolute;
  left: 7px; top: 3px;
  width: 5px; height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.opt input[type="radio"]:checked::after {
  left: 6px; top: 6px;
  width: 8px; height: 8px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  transform: none;
}

.btn {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 16px;
  font-family: inherit;
  font-size: 1.2rem;
  letter-spacing: 1px;
  color: #fff;
  background: var(--sage);
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}
.btn:hover { background: var(--sage-dark); }
.btn:active { transform: scale(0.99); }
.form-note {
  margin-top: 16px;
  text-align: center;
  font-size: 1rem;
  color: var(--sage-dark);
  min-height: 1.2em;
}

/* ===== 7. Финал ===== */
.section--final {
  background:
    radial-gradient(circle at 50% 40%, rgba(255,255,255,0.5), transparent 55%),
    linear-gradient(160deg, #f3e7e0 0%, #f6efe4 50%, #e9eee2 100%);
}
.final__title {
  font-family: 'Great Vibes', cursive;
  font-weight: 400;
  font-size: clamp(2.8rem, 9vw, 5rem);
  color: var(--sage-dark);
  line-height: 1.1;
}
.final__sign {
  font-family: 'Great Vibes', cursive;
  font-weight: 400;
  font-size: clamp(2.2rem, 6vw, 3.2rem);
  letter-spacing: 0;
  text-transform: none;
  color: var(--names-rose);
  margin-top: 16px;
  line-height: 1.1;
}
.final__date {
  letter-spacing: 4px;
  color: var(--text-soft);
  margin-top: 10px;
}

/* ===== Навигация-точки ===== */
.dots {
  position: fixed;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 14px;
  z-index: 50;
}
.dot {
  width: 11px; height: 11px;
  border-radius: 50%;
  border: 1.5px solid var(--gold-dark);
  background: transparent;
  transition: all 0.25s ease;
  position: relative;
}
.dot.is-active { background: var(--gold-dark); transform: scale(1.3); }
.dot::after {
  content: attr(data-label);
  position: absolute;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--sage-dark);
  color: #fff;
  font-size: 0.8rem;
  padding: 3px 10px;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.dot:hover::after { opacity: 1; }

/* ===== Декор: акварельные цветы и бабочки ===== */
/* Контент всегда поверх декора */
.container, .hero__inner { position: relative; z-index: 2; }

.deco {
  position: absolute;
  pointer-events: none;
  user-select: none;
  z-index: 1;
}
/* Картинки с белым фоном: умножение прячет белое на светлом фоне */
.deco--blend { mix-blend-mode: multiply; }

/* Экран «Приглашение»: фон как у картинки (белый), бабочка статична по центру */
#invite { background: #ffffff; }
.invite__butterfly {
  display: block;
  width: clamp(46px, 12vw, 60px);
  height: auto;
  margin: 0 auto 22px;
}

/* Гирлянда, свисающая сверху (главный экран и финал) */
.deco--garland {
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 130%;          /* +30% к размеру цветов */
  max-width: 1690px;
  height: auto;
}

/* Пион в нижнем-левом углу (приглашение) */
.deco--peony-bl {
  bottom: 0; left: 0;
  width: clamp(520px, 140vw, 1880px);  /* ещё в 2 раза крупнее — 140% ширины */
  transform: translate(-26%, 28%);     /* выезжает из нижнего-левого угла и закрывает его */
  height: auto;
}
/* Пион с бабочкой в нижнем-правом углу (детали) */
.deco--peony-br {
  bottom: 0; right: -30px;
  width: clamp(300px, 52vw, 575px);  /* жёлтые цветы, +15% */
  transform: translateY(10%);        /* опущены на 10% ниже */
  height: auto;
}

/* Голубая бабочка, сидящая на краешке буквы «я» в «празднования» */
.title-perch { position: relative; white-space: nowrap; }
.butterfly-on-letter {
  position: absolute;
  top: -1.46em;     /* лапки касаются верхнего края буквы */
  right: -0.4em;    /* у правого края буквы «я» */
  width: clamp(61px, 12vw, 94px);  /* ещё +30% */
  height: auto;
  pointer-events: none;
}
/* Веточка в верхнем-левом углу (место) */
.deco--leaf-tl {
  top: -20px; left: 6px;
  width: clamp(58px, 9vw, 96px);
  height: auto;
}
/* Бабочки: внешний слой ЛЕТИТ по траектории, внутренний МАШЕТ крыльями */
.butterfly { will-change: transform; }
.butterfly__img {
  display: block;
  width: 100%;
  height: auto;
  transform-origin: 50% 50%;
  /* взмах крыльев — лёгкое сжатие по горизонтали */
  animation: wing-flap 0.32s ease-in-out infinite alternate;
}
.deco--butterfly-tr {
  top: 12%; right: 10%;
  width: clamp(46px, 8vw, 66px);
  animation: fly-tr 15s ease-in-out infinite;
}
.deco--butterfly-bl {
  bottom: 18%; left: 10%;
  width: clamp(50px, 8vw, 72px);
  animation: fly-bl 19s ease-in-out infinite;
}
/* Полёт по дуге с возвратом — бабочка кружит, не улетая с экрана */
@keyframes fly-tr {
  0%   { transform: translate(0, 0) rotate(-10deg); }
  18%  { transform: translate(-46px, 34px) rotate(8deg); }
  38%  { transform: translate(-104px, 6px) rotate(-6deg); }
  58%  { transform: translate(-72px, -42px) rotate(12deg); }
  78%  { transform: translate(-18px, -22px) rotate(-8deg); }
  100% { transform: translate(0, 0) rotate(-10deg); }
}
@keyframes fly-bl {
  0%   { transform: translate(0, 0) rotate(8deg); }
  20%  { transform: translate(64px, -30px) rotate(-9deg); }
  42%  { transform: translate(128px, 8px) rotate(6deg); }
  64%  { transform: translate(86px, 52px) rotate(-7deg); }
  84%  { transform: translate(28px, 26px) rotate(9deg); }
  100% { transform: translate(0, 0) rotate(8deg); }
}
@keyframes wing-flap {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0.5); }
}

/* ===== Появление при скролле ===== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* План мероприятий: пункты появляются каскадом при прокрутке */
#plan .timeline__item.reveal { transform: translateY(26px); }
#plan .timeline__item:nth-child(2) { transition-delay: .10s; }
#plan .timeline__item:nth-child(3) { transition-delay: .20s; }
#plan .timeline__item:nth-child(4) { transition-delay: .30s; }
#plan .timeline__item:nth-child(5) { transition-delay: .40s; }
#plan .timeline__item:nth-child(6) { transition-delay: .50s; }

/* ===== Адаптив ===== */
@media (max-width: 640px) {
  html { font-size: 18px; }   /* база 16px → 18px: весь текст крупнее на ~2pt */
  body { font-size: 20px; }
  .dots { display: none; }
  .details__cards { grid-template-columns: 1fr; }
  .opts-grid { grid-template-columns: 1fr; }
  .map { height: 340px; }
  .timeline::before { left: 58px; }
  .timeline__item::after { left: 53px; }
  .timeline__time { flex-basis: 48px; font-size: 1.3rem; }
  .section { padding: 70px 18px; }
  /* Главный экран на телефоне: компактнее, малый зазор под гирляндой */
  #hero .hero__inner { padding-top: calc(40vw + 18px); padding-bottom: 20px; }
  .hero__date { margin: 18px 0 30px; }
  .section--hero .scroll-hint { display: none; }
  /* Счётчик — в одну строку, блоки шире, подписи мельче */
  .countdown { flex-wrap: nowrap; gap: 6px; width: 100%; }
  .countdown__cell { min-width: 72px; flex: 1 1 0; padding: 13px 3px; border-radius: 10px; }
  .countdown__num { font-size: 1.6rem; }
  .countdown__lbl { font-size: 0.46rem; letter-spacing: 0; white-space: nowrap; margin-top: 6px; }
  /* Декор не перекрывает текст */
  .deco--peony-br { opacity: 0.9; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
