/* ============ Палитра и база ============ */
:root {
  --brown: #4A352A;
  --terracotta: #C96E43;
  --cream: #F8F4EF;
  --beige: #D8C3A5;
  --olive: #6E7B58;
  --gold: #C7A36A;

  --font-title: 'Cormorant Garamond', 'Times New Roman', serif;
  --font-script: 'Great Vibes', 'Cormorant Garamond', cursive;
  --font-body: 'Manrope', 'Inter', sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--brown);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.65;
  letter-spacing: .02em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

/* авторские display перебивают браузерный [hidden] — возвращаем ему силу */
[hidden] { display: none !important; }

/* ============ Заставка ============ */
.welcome {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: opacity .9s ease, visibility .9s;
}
.welcome.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.welcome__inner { padding: 30px; animation: welcomeIn 1.4s ease both; }
@keyframes welcomeIn {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}
.welcome__label {
  font-size: 12px;
  letter-spacing: .4em;
  text-transform: uppercase;
  opacity: .6;
}
.welcome__names {
  font-family: var(--font-script);
  font-size: clamp(46px, 10vw, 76px);
  line-height: 1.2;
  margin: 18px 0 6px;
}
.welcome__names span {
  font-family: var(--font-title);
  font-style: italic;
  font-size: .55em;
  color: var(--gold);
}
.welcome__date {
  font-family: var(--font-title);
  font-size: clamp(18px, 3.4vw, 24px);
  letter-spacing: .3em;
  margin-bottom: 38px;
}
.welcome__btn { animation: welcomePulse 2.6s ease-in-out infinite; }
@keyframes welcomePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(201, 110, 67, .35); }
  50% { box-shadow: 0 0 0 12px rgba(201, 110, 67, 0); }
}

/* ============ Шапка ============ */
.header {
  position: fixed;
  inset: 0 0 auto 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 26px;
  z-index: 50;
  transition: background .35s ease, box-shadow .35s ease;
}
.header.is-scrolled {
  background: rgba(248, 244, 239, .92);
  backdrop-filter: blur(8px);
  box-shadow: 0 1px 0 rgba(74, 53, 42, .08);
}
.monogram {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-decoration: none;
  color: var(--cream);
  transition: color .35s ease;
}
.header.is-scrolled .monogram,
.header.is-open .monogram { color: var(--brown); }
.monogram__letters {
  font-family: var(--font-title);
  font-weight: 500;
  font-size: 21px;
  line-height: 1;
  letter-spacing: .14em;
}
.monogram__letters em,
.footer__monogram em {
  font-style: italic;
  font-size: 1.05em;
  color: var(--gold);
  padding: 0 .18em;
}
.monogram__flourish {
  width: 52px;
  height: auto;
  overflow: visible;
}
.monogram__flourish path {
  fill: none;
  stroke: var(--gold);
  stroke-width: 1;
  stroke-linecap: round;
  stroke-dasharray: 90;
  stroke-dashoffset: 90;
  animation: flourishDraw 1.6s ease-out .5s forwards;
}
.monogram:hover .monogram__flourish path {
  animation: flourishDraw 1.2s ease-out forwards;
}
@keyframes flourishDraw {
  from { stroke-dashoffset: 90; }
  to { stroke-dashoffset: 0; }
}

.burger {
  width: 34px; height: 26px;
  background: none; border: none; cursor: pointer;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 4px 0;
}
.burger span {
  height: 1.5px; width: 100%;
  background: var(--cream);
  transition: transform .3s ease, opacity .3s ease, background .35s ease;
}
.header.is-scrolled .burger span,
.header.is-open .burger span { background: var(--brown); }
.header.is-open .burger span:nth-child(1) { transform: translateY(8.2px) rotate(45deg); }
.header.is-open .burger span:nth-child(2) { opacity: 0; }
.header.is-open .burger span:nth-child(3) { transform: translateY(-8.2px) rotate(-45deg); }

/* ============ Меню ============ */
.nav {
  position: fixed;
  inset: 0;
  background: var(--cream);
  z-index: 40;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 26px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s ease;
}
.nav.is-open { opacity: 1; pointer-events: auto; }
.nav__link {
  font-family: var(--font-title);
  font-size: clamp(22px, 4.5vw, 30px);
  color: var(--brown);
  text-decoration: none;
  letter-spacing: .12em;
  text-transform: uppercase;
  transition: color .25s;
}
.nav__link:hover { color: var(--terracotta); }

/* ============ Герой ============ */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--cream);
  overflow: hidden;
}
.hero__bg {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center 35%;
  transform: scale(1.06);
  animation: heroZoom 9s ease-out forwards;
}
@keyframes heroZoom { to { transform: scale(1); } }
.hero__overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(40, 26, 18, .35) 0%, rgba(40, 26, 18, .25) 45%, rgba(40, 26, 18, .55) 100%);
}
.hero__content { position: relative; padding: 70px 24px; }
.hero__name {
  font-family: var(--font-script);
  font-weight: 400;
  font-size: clamp(58px, 13vw, 110px);
  letter-spacing: .02em;
  line-height: 1.05;
  text-shadow: 0 3px 26px rgba(40, 26, 18, .35);
}
.hero__amp {
  font-family: var(--font-title);
  font-style: italic;
  font-size: clamp(26px, 4.4vw, 40px);
  color: var(--gold);
  margin: 2px 0;
}
.hero__date {
  margin-top: 22px;
  font-size: clamp(15px, 2.4vw, 19px);
  letter-spacing: .3em;
  text-transform: uppercase;
}
.hero__divider {
  display: flex; align-items: center; gap: 14px;
  margin: 22px auto 18px;
  max-width: 300px;
}
.hero__divider::before, .hero__divider::after {
  content: ''; flex: 1; height: 1px;
  background: currentColor; opacity: .55;
}
.hero__divider span { font-size: 14px; opacity: .9; }
.hero__text {
  font-family: var(--font-title);
  font-style: italic;
  font-size: clamp(18px, 3vw, 22px);
  font-weight: 400;
  letter-spacing: .05em;
  line-height: 1.6;
}

/* каскадное появление героя после заставки */
.hero__content > * { opacity: 0; }
body.is-started .hero__content > * { animation: fadeUp 1.1s cubic-bezier(.22,.7,.3,1) forwards; }
body.is-started .hero__content > :nth-child(1) { animation-delay: .15s; }
body.is-started .hero__content > :nth-child(2) { animation-delay: .4s; }
body.is-started .hero__content > :nth-child(3) { animation-delay: .6s; }
body.is-started .hero__content > :nth-child(4) { animation-delay: 1s; }
body.is-started .hero__content > :nth-child(5) { animation-delay: 1.25s; }
body.is-started .hero__content > :nth-child(6) { animation-delay: 1.5s; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(26px); filter: blur(6px); }
  to { opacity: 1; transform: none; filter: none; }
}

/* ============ Секции — общее ============ */
.section { padding: 58px 24px; }
.section__inner {
  max-width: 620px;
  margin: 0 auto;
  text-align: center;
}
.section-label {
  font-size: 13px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--brown);
  opacity: .75;
}
.section-title {
  font-family: var(--font-title);
  font-weight: 600;
  font-size: clamp(27px, 5vw, 38px);
  letter-spacing: .18em;
  text-transform: uppercase;
  line-height: 1.35;
}
.section-title--light { color: var(--cream); }
.title-divider {
  display: flex; align-items: center; gap: 14px;
  max-width: 220px;
  margin: 14px auto 28px;
  color: var(--gold);
}
.title-divider::before, .title-divider::after {
  content: ''; flex: 1; height: 1px;
  background: currentColor; opacity: .6;
}
.title-divider span { font-size: 13px; }

/* ============ Таймер ============ */
.countdown {
  padding: 46px 24px 8px;
  text-align: center;
}
.countdown__grid {
  display: flex;
  justify-content: center;
  gap: clamp(18px, 6vw, 46px);
  margin-top: 22px;
}
.countdown__cell { display: flex; flex-direction: column; align-items: center; }
.countdown__num {
  font-family: var(--font-title);
  font-size: clamp(34px, 7vw, 52px);
  font-weight: 500;
  color: var(--terracotta);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.countdown__unit {
  font-size: 12px;
  letter-spacing: .22em;
  text-transform: uppercase;
  opacity: .7;
  margin-top: 4px;
}

/* ============ Слайдер ============ */
.slider {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  box-shadow: 0 18px 45px rgba(74, 53, 42, .18);
}
.slider__track {
  display: flex;
  transition: transform .55s cubic-bezier(.33,.9,.35,1);
}
.slider__slide { flex: 0 0 100%; }
.slider__slide img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}
.slider__arrow {
  position: absolute; top: 50%;
  transform: translateY(-50%);
  width: 42px; height: 42px;
  border-radius: 50%;
  border: none;
  background: rgba(248, 244, 239, .85);
  color: var(--brown);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: background .25s;
  display: flex; align-items: center; justify-content: center;
  padding-bottom: 4px;
}
.slider__arrow:hover { background: var(--cream); }
.slider__arrow--prev { left: 14px; }
.slider__arrow--next { right: 14px; }
.slider__dots {
  display: flex; justify-content: center; gap: 10px;
  margin-top: 18px;
}
.slider__dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  border: none;
  background: var(--beige);
  cursor: pointer;
  transition: background .25s, transform .25s;
}
.slider__dot.is-active { background: var(--terracotta); transform: scale(1.25); }
.story__caption {
  margin-top: 24px;
  font-family: var(--font-title);
  font-style: italic;
  font-size: clamp(19px, 3.4vw, 24px);
  letter-spacing: .04em;
  color: var(--terracotta);
}

/* ============ Приглашение ============ */
.invite { position: relative; }
.invite__lead {
  margin-top: 20px;
  font-size: 12px;
  letter-spacing: .28em;
  text-transform: uppercase;
  opacity: .65;
}
.invite__ornament {
  color: var(--olive);
  width: 210px;
  margin: 16px auto 20px;
  opacity: .75;
}
.invite__ornament svg { width: 100%; height: auto; display: block; }
.invite__text {
  font-family: var(--font-title);
  font-size: clamp(20px, 3.6vw, 25px);
  font-weight: 500;
  line-height: 1.7;
  letter-spacing: .05em;
}
.invite__text em {
  font-style: italic;
  color: var(--terracotta);
}
.invite__heart {
  margin-top: 20px;
  color: var(--terracotta);
  font-size: 16px;
}

/* ============ Календарь ============ */
.calendar__card {
  max-width: 320px;
  margin: 0 auto;
}
.calendar__month {
  font-family: var(--font-title);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: .34em;
  text-transform: uppercase;
  opacity: .85;
  margin-bottom: 20px;
}
.calendar__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  row-gap: 14px;
  align-items: center;
  justify-items: center;
}
.calendar__wd {
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  opacity: .4;
  padding-bottom: 8px;
}
.calendar__day {
  font-family: var(--font-title);
  font-size: 17px;
  width: 36px; height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: .82;
}
.calendar__day--wedding {
  position: relative;
  opacity: 1;
}
.calendar__day--wedding svg {
  position: absolute;
  top: 50%; left: 50%;
  width: 44px; height: 41px;
  transform: translate(-50%, -52%);
  fill: none;
  stroke: #D8A091;
  stroke-width: 1.4;
  animation: heartBeat 2.8s ease-in-out infinite;
  transform-origin: center;
}
.calendar__day--wedding b {
  position: relative;
  z-index: 1;
  font-weight: 500;
  color: var(--brown);
  margin-top: -4px;
}
@keyframes heartBeat {
  0%, 100% { transform: translate(-50%, -52%) scale(1); }
  12% { transform: translate(-50%, -52%) scale(1.1); }
  24% { transform: translate(-50%, -52%) scale(1); }
  36% { transform: translate(-50%, -52%) scale(1.08); }
  48% { transform: translate(-50%, -52%) scale(1); }
}
.calendar__note {
  margin-top: 22px;
  font-family: var(--font-title);
  font-style: italic;
  font-size: clamp(18px, 3.2vw, 22px);
  letter-spacing: .06em;
  opacity: .85;
}

/* ============ Место проведения ============ */
.place { display: flex; justify-content: center; }
.place__card {
  background: var(--olive);
  color: var(--cream);
  border-radius: 6px;
  padding: 40px 30px 36px;
  max-width: 460px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 50px rgba(74, 53, 42, .22);
}
.place__pin { color: var(--gold); margin: 20px 0 14px; }
.place__text {
  font-family: var(--font-title);
  font-size: clamp(19px, 3.2vw, 22px);
  font-weight: 500;
  line-height: 1.8;
  letter-spacing: .06em;
}
.place__map {
  margin: 22px auto 24px;
  max-width: 300px;
  color: rgba(248, 244, 239, .55);
  border: 1px solid rgba(199, 163, 106, .5);
  border-radius: 4px;
  padding: 8px;
}
.place__map svg { width: 100%; height: auto; display: block; }

.place__addr {
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid rgba(199, 163, 106, .45);
  border-radius: 5px;
  padding: 20px 18px 16px;
  margin: 22px auto 0;
  max-width: 340px;
  transition: border-color .25s ease, background .25s ease, transform .25s ease;
}
.place__addr:hover,
.place__addr:focus-visible {
  border-color: var(--gold);
  background: rgba(199, 163, 106, .12);
  transform: translateY(-2px);
}
.place__pin { display: block; color: var(--gold); margin-bottom: 8px; }
.place__pin svg { margin: 0 auto; }
.place__venue {
  display: block;
  font-family: var(--font-title);
  font-size: clamp(19px, 3.2vw, 22px);
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: .06em;
}
.place__street {
  display: block;
  margin-top: 4px;
  font-family: var(--font-title);
  font-size: clamp(16px, 2.8vw, 19px);
  line-height: 1.55;
  letter-spacing: .05em;
  opacity: .9;
}
.place__hint {
  display: block;
  margin-top: 12px;
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold);
}

/* ============ Кнопки ============ */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 13px;
  letter-spacing: .18em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 15px 26px;
  cursor: pointer;
  transition: all .25s ease;
  border-radius: 3px;
}
.btn--outline-gold {
  border: 1px solid var(--gold);
  color: var(--gold);
  background: transparent;
}
.btn--outline-gold:hover { background: var(--gold); color: var(--brown); }
.btn--fill {
  background: var(--terracotta);
  border: 1px solid var(--terracotta);
  color: var(--cream);
}
.btn--fill:hover { background: #b55e36; border-color: #b55e36; }
.btn--outline {
  background: transparent;
  border: 1px solid var(--beige);
  color: var(--brown);
}
.btn--outline:hover { border-color: var(--brown); }

/* ============ RSVP ============ */
.rsvp { background: #F3EDE4; }
.rsvp__form {
  display: flex;
  flex-direction: column;
  gap: 22px;
  max-width: 440px;
  margin: 0 auto;
  text-align: left;
}
.rsvp__field { display: flex; flex-direction: column; gap: 8px; }
.rsvp__label {
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  opacity: .8;
}
.rsvp__label em { font-style: normal; text-transform: none; letter-spacing: .04em; opacity: .7; }
.rsvp__form input[type="text"],
.rsvp__form textarea {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--brown);
  background: var(--cream);
  border: 1px solid var(--beige);
  border-radius: 3px;
  padding: 14px 16px;
  outline: none;
  transition: border-color .25s;
  resize: vertical;
}
.rsvp__form input:focus, .rsvp__form textarea:focus { border-color: var(--terracotta); }
.rsvp__form input::placeholder, .rsvp__form textarea::placeholder { color: rgba(74, 53, 42, .4); }

.rsvp__choice { display: flex; flex-direction: column; gap: 10px; }
.rsvp__choice-label { opacity: .8; }
.rsvp__choice-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.choice-btn { text-align: center; padding: 16px 10px; }
.choice-btn:disabled { opacity: .55; cursor: default; }
.choice-btn.is-sending { opacity: .75; }

.rsvp__guests { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.rsvp__guests.is-hidden { display: none; }
.stepper {
  display: flex;
  align-items: center;
  gap: 8px;
}
.stepper__btn {
  width: 44px; height: 44px;
  border-radius: 3px;
  border: 1px solid var(--beige);
  background: var(--cream);
  color: var(--brown);
  font-size: 22px;
  cursor: pointer;
  transition: border-color .25s;
}
.stepper__btn:hover { border-color: var(--terracotta); }
.stepper__value {
  min-width: 56px;
  text-align: center;
  font-family: var(--font-title);
  font-size: 26px;
}
.rsvp__submit { margin-top: 6px; }
.rsvp__submit:disabled { opacity: .6; cursor: default; }
.rsvp__status {
  min-height: 24px;
  text-align: center;
  font-size: 14px;
}
.rsvp__status.is-ok { color: var(--olive); }
.rsvp__status.is-err { color: #a63c22; }

/* ============ Спасибо ============ */
.thanks {
  position: relative;
  min-height: 68svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--cream);
  overflow: hidden;
}
.thanks__bg {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center 30%;
}
.thanks__video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.thanks__overlay {
  position: absolute; inset: 0;
  background: rgba(40, 26, 18, .42);
}
.thanks__content { position: relative; padding: 62px 24px; }
.thanks__title {
  font-family: var(--font-title);
  font-weight: 500;
  font-size: clamp(26px, 5.4vw, 40px);
  letter-spacing: .14em;
  text-transform: uppercase;
  line-height: 1.4;
}
.thanks__date {
  font-family: var(--font-title);
  font-style: italic;
  font-size: clamp(18px, 3vw, 22px);
  letter-spacing: .14em;
}

/* ============ Кнопка музыки ============ */
.music-btn {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 45;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid var(--beige);
  background: rgba(248, 244, 239, .95);
  color: var(--terracotta);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(74, 53, 42, .22);
  transition: transform .25s ease, color .25s ease;
}
.music-btn:hover { transform: scale(1.07); }
.music-btn svg { width: 24px; height: 24px; }
.music-btn::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  border: 1px solid var(--terracotta);
  opacity: 0;
}
.music-btn.is-playing { color: var(--olive); }
.music-btn.is-playing::after { animation: musicPulse 2.2s ease-out infinite; }
@keyframes musicPulse {
  0% { transform: scale(1); opacity: .7; }
  100% { transform: scale(1.55); opacity: 0; }
}

/* ============ Подвал ============ */
.footer {
  text-align: center;
  padding: 34px 20px;
}
.footer__monogram {
  font-family: var(--font-title);
  font-weight: 500;
  font-size: 26px;
  line-height: 1;
  letter-spacing: .16em;
  color: var(--brown);
}
.footer__text {
  margin-top: 8px;
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  opacity: .55;
}

/* ============ Появление при скролле ============ */
.reveal {
  opacity: 0;
  transform: translateY(34px);
  filter: blur(5px);
  transition: opacity .8s cubic-bezier(.22,.7,.3,1), transform .8s cubic-bezier(.22,.7,.3,1), filter .8s ease;
}
.reveal.is-visible { opacity: 1; transform: none; filter: none; }

/* поочерёдное появление элементов внутри секции */
.stagger > * {
  opacity: 0;
  transform: translateY(26px);
  filter: blur(4px);
  transition: opacity .85s cubic-bezier(.22,.7,.3,1),
              transform .85s cubic-bezier(.22,.7,.3,1),
              filter .85s ease;
}
.reveal.is-visible .stagger > *,
.stagger.is-visible > * { opacity: 1; transform: none; filter: none; }

.stagger.is-visible > :nth-child(1),
.reveal.is-visible .stagger > :nth-child(1) { transition-delay: .05s; }
.stagger.is-visible > :nth-child(2),
.reveal.is-visible .stagger > :nth-child(2) { transition-delay: .16s; }
.stagger.is-visible > :nth-child(3),
.reveal.is-visible .stagger > :nth-child(3) { transition-delay: .27s; }
.stagger.is-visible > :nth-child(4),
.reveal.is-visible .stagger > :nth-child(4) { transition-delay: .38s; }
.stagger.is-visible > :nth-child(5),
.reveal.is-visible .stagger > :nth-child(5) { transition-delay: .49s; }
.stagger.is-visible > :nth-child(6),
.reveal.is-visible .stagger > :nth-child(6) { transition-delay: .6s; }
.stagger.is-visible > :nth-child(7),
.reveal.is-visible .stagger > :nth-child(7) { transition-delay: .71s; }
.stagger.is-visible > :nth-child(n+8),
.reveal.is-visible .stagger > :nth-child(n+8) { transition-delay: .82s; }

/* ============ Адаптив ============ */
@media (max-width: 480px) {
  .section { padding: 44px 20px; }
  .countdown__grid { gap: 20px; }
  .rsvp__choice-row { grid-template-columns: 1fr; }
  .slider__arrow { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero__bg { animation: none; transform: none; }
  .reveal, .stagger > *, .hero__content > * { opacity: 1; transform: none; filter: none; transition: none; animation: none; }
  .place__addr:hover { transform: none; }
  .welcome__btn, .music-btn.is-playing::after, .calendar__day--wedding svg { animation: none; }
  .monogram__flourish path { animation: none; stroke-dashoffset: 0; }
}
