/* =========================================================================
   Приглашение «Илья & Адриана» — оформление
   Палитра, типографика и раскладка перенесены из исходного дизайна.
   Адаптив реализован медиазапросом (десктоп ≥ 760px) вместо JS.
   ========================================================================= */

:root {
  --bg-dark:     #3a2e39;
  --bg-frame:    #241d24;
  --hero-dark:   #2f2630;
  --paper:       #f3efe6;
  --paper-2:     #efe8db;
  --ink:         #4a3f48;
  --ink-soft:    #6a5f66;
  --muted:       #8a7f86;
  --olive:       #7c8a5c;
  --olive-dark:  #5f6c45;
  --olive-btn:   #6f7d52;
  --rose:        #c3a0ad;
  --line:        #ded4c4;
  --line-2:      #e2d8c8;
}

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

body {
  background: var(--bg-dark);
  font-family: 'Playfair Display', serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--olive); color: var(--paper); }

a {
  color: var(--olive);
  text-decoration: none;
  border-bottom: 1px solid rgba(124, 138, 92, .4);
}
a:hover { color: var(--olive-dark); }

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

.serif   { font-family: 'PT Serif', serif; }
.script  { font-family: 'Marck Script', cursive; }

/* --- Каркас страницы ----------------------------------------------------- */
.frame {
  width: 100%;
  background: var(--bg-dark);
}
.frame__bg { display: none; }

.sheet {
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  background: var(--paper);
}

/* На десктопе — «открытка» по центру на размытом фоне */
@media (min-width: 760px) {
  .frame {
    position: relative;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: clamp(28px, 4.5vw, 64px);
    background: var(--bg-frame);
  }
  .frame__bg {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 0;
    background:
      linear-gradient(rgba(47, 38, 48, .5), rgba(36, 29, 36, .66)),
      var(--hero-bg) center / cover;
    filter: blur(18px);
    transform: scale(1.14);
  }
  .sheet {
    z-index: 1;
    max-width: 620px;
    border-radius: 16px;
    box-shadow: 0 34px 90px rgba(0, 0, 0, .6);
  }
}

/* --- Секции -------------------------------------------------------------- */
.section { background: var(--paper); }

/* --- HERO ---------------------------------------------------------------- */
.hero {
  position: relative;
  height: clamp(500px, 82vh, 760px);
  background: var(--hero-dark);
  overflow: hidden;
}
.hero__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Кадрируем ближе к верху снимка: лица опускаются ниже строки со стихом. */
  object-position: center 12%;
}
.hero__shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg,
    rgba(47, 38, 48, .48) 0%,
    rgba(47, 38, 48, .12) 18%,
    rgba(47, 38, 48, 0) 32%,
    rgba(47, 38, 48, 0) 55%,
    rgba(47, 38, 48, .7) 100%);
}
/* Стих прижат к самому верху и набран компактно, чтобы не наезжать на лица. */
.hero__verse {
  position: absolute;
  top: clamp(16px, 2.2vh, 26px);
  left: 0; right: 0;
  padding: 0 clamp(28px, 8vw, 76px);
  text-align: center;
  text-wrap: balance;
  font-style: italic;
  font-size: clamp(15px, 3.6vw, 19px);
  line-height: 1.4;
  letter-spacing: .3px;
  color: var(--paper);
  text-shadow: 0 1px 10px rgba(47, 38, 48, .6);
  pointer-events: none;
}
/* Имена в три строки: «Илья» выше, «&» — отдельной строкой по центру. */
.hero__names {
  position: absolute;
  bottom: clamp(88px, 11vh, 132px);
  left: 0; right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: #f6f2ea;
  font-size: clamp(52px, 13vw, 78px);
  line-height: 1;
  font-weight: 500;
  letter-spacing: 1px;
  text-shadow: 0 2px 18px rgba(47, 38, 48, .45);
  pointer-events: none;
}
.hero__amp {
  font-size: .56em;
  line-height: 1;
  margin: .08em 0 .06em;
  letter-spacing: 0;
  opacity: .92;
}
.hero__lace {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 34px;
  background: var(--paper);
  -webkit-mask: repeating-linear-gradient(-45deg, #000 0 9px, transparent 9px 18px);
          mask: repeating-linear-gradient(-45deg, #000 0 9px, transparent 9px 18px);
  -webkit-mask-size: 26px 34px;
          mask-size: 26px 34px;
}
.hero__lace-base {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 14px;
  background: var(--paper);
}

/* --- Приглашение --------------------------------------------------------- */
.invite { padding: 44px 30px 40px; text-align: center; }
.invite__card {
  background: var(--paper-2);
  border-radius: 6px;
  padding: 40px 26px 44px;
}
.invite__title {
  font-size: 25px;
  letter-spacing: 3px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
}
.invite__lead { font-size: 16px; margin-top: 22px; color: var(--ink-soft); }
.invite__body {
  font-size: 23px;
  letter-spacing: 1.5px;
  line-height: 1.55;
  margin-top: 26px;
  color: var(--ink);
  font-weight: 500;
}
.invite__family { font-size: 46px; color: var(--olive); margin-top: 24px; }

.lace-divider {
  height: 26px;
  margin: 14px 0 8px;
  background: var(--paper-2);
  -webkit-mask: repeating-linear-gradient(-45deg, #000 0 8px, transparent 8px 16px);
          mask: repeating-linear-gradient(-45deg, #000 0 8px, transparent 8px 16px);
  -webkit-mask-size: 22px 26px;
          mask-size: 22px 26px;
}

/* --- Обратный отсчёт ----------------------------------------------------- */
.count__label {
  font-size: 14px;
  letter-spacing: 3px;
  color: var(--muted);
  margin-top: 22px;
}
.count__grid {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
}
.count__cell {
  width: 82px; height: 82px;
  border-radius: 50%;
  background: var(--paper-2);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.count__num {
  font-size: 30px;
  font-weight: 600;
  color: var(--olive);
  line-height: 1;
}
.count__unit {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--muted);
  margin-top: 5px;
}
.invite__date {
  font-size: 31px;
  font-weight: 600;
  letter-spacing: 1px;
  margin-top: 34px;
  color: var(--ink);
  line-height: 1.3;
}
.invite__ourday {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 24px;
}
.invite__ourday .heart { color: #c9a9b4; font-size: 22px; }
.invite__ourday .script { font-size: 40px; color: var(--olive); }

/* --- Таймлайн ------------------------------------------------------------ */
.timeline { padding: 24px 30px 48px; }
.timeline__month {
  text-align: center;
  font-family: 'Marck Script', cursive;
  color: #a58f96;
  font-size: 19px;
  line-height: 1.15;
}
.timeline__badge {
  position: relative;
  width: 74px; height: 66px;
  margin: 14px auto 6px;
}
.timeline__badge .petal {
  position: absolute;
  top: 0;
  width: 38px; height: 58px;
  background: var(--rose);
  border-radius: 38px 38px 0 0;
}
.timeline__badge .petal--r { left: 37px; transform: rotate(-45deg); transform-origin: 0 100%; }
.timeline__badge .petal--l { left: 0;   transform: rotate(45deg);  transform-origin: 100% 100%; }
.timeline__badge .day {
  position: absolute;
  top: 2px; bottom: 14px; left: 0; right: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 26px; font-weight: 600; z-index: 1;
}
.timeline__track {
  position: relative;
  margin-top: 2px;
  padding: 8px 0 4px;
}
.timeline__track::before {
  content: "";
  position: absolute;
  left: 50%; top: 0; bottom: 24px;
  width: 2px;
  background: #d8c6b8;
  transform: translateX(-50%);
}
.timeline__row {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 36px 1fr;
  align-items: center;
  padding: 24px 0;
}
.timeline__node {
  display: flex;
  justify-content: center;
}
.timeline__node .heart {
  color: var(--rose);
  font-size: 20px;
  line-height: 1;
  background: var(--paper);
  padding: 8px 0;
}
.timeline__time {
  font-family: 'PT Serif', serif;
  font-size: 14px;
  letter-spacing: 2px;
  color: var(--muted);
}
.timeline__event {
  font-family: 'Marck Script', cursive;
  font-size: 38px;
  color: #5a4f56;
  line-height: 1.05;
  margin-top: 2px;
}
.timeline__cell--right { text-align: right; padding-right: 12px; }
.timeline__cell--left  { text-align: left;  padding-left: 12px; }
.timeline__hearts {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
}
.timeline__hearts .sm { color: #d9c1cb; font-size: 26px; line-height: 1; }
.timeline__hearts .lg { color: #e3d0d7; font-size: 44px; line-height: 1; }

/* --- Фотосетка ----------------------------------------------------------- */
.gallery { padding: 8px 20px 34px; }
.gallery__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.gallery__item {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border-radius: 4px;
  aspect-ratio: 3 / 4;
}
.gallery__item--wide {
  grid-column: 1 / 3;
  aspect-ratio: 4 / 3;
}
.gallery__item img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}

/* --- Дресс-код / палитра -------------------------------------------------- */
.dress { padding: 32px 30px 40px; text-align: center; }
.dress__kicker { font-size: 14px; letter-spacing: 3px; color: var(--muted); }
.dress__title {
  font-size: 38px; font-weight: 600; color: var(--ink);
  margin-top: 8px; letter-spacing: .5px;
}
.dress__text {
  font-family: 'PT Serif', serif;
  font-size: 16px; line-height: 1.6;
  color: var(--ink-soft); margin-top: 18px;
}
.dress__swatches {
  display: flex; justify-content: center; flex-wrap: wrap;
  gap: 14px; margin-top: 28px;
}
.swatch {
  width: 54px; height: 54px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
}
.dress__palette {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 30px;
}
.palette-tile {
  aspect-ratio: 3 / 2;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding: 12px 14px;
  background-size: cover;
  background-position: center;
}
.palette-tile span {
  font-family: 'PT Serif', serif;
  font-size: 14px;
  letter-spacing: 2px;
}
/* Плиток нечётное число — последняя занимает всю ширину строки. */
.palette-tile:last-child:nth-child(odd) {
  grid-column: 1 / 3;
  aspect-ratio: 16 / 7;
}
.palette-tile--light span { color: #fff;    text-shadow: 0 1px 4px rgba(0, 0, 0, .45); }
.palette-tile--dark  span { color: #5a5a4e; text-shadow: 0 1px 3px rgba(255, 255, 255, .5); }

/* --- Карточки-заметки ----------------------------------------------------- */
.notes {
  padding: 20px 26px 30px;
  display: flex; flex-direction: column; gap: 22px;
}
.note {
  border: 1px solid var(--line-2);
  border-radius: 6px;
  padding: 34px 26px 30px;
  text-align: center;
}
.note__icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto;
  font-size: 28px; color: var(--rose);
}
.note__title {
  font-size: 32px; font-weight: 600; color: var(--ink);
  margin-top: 16px; line-height: 1.25;
}
.note__text {
  font-family: 'PT Serif', serif; font-style: italic;
  font-size: 16px; line-height: 1.6; color: var(--ink-soft);
  margin-top: 12px;
}
.note__baby .dot   { width: 14px; height: 14px; border-radius: 50%; background: var(--rose); margin: 0 auto; }
.note__baby .body  { width: 28px; height: 15px; border-radius: 14px 14px 0 0; background: var(--rose); margin: 2px auto 0; }
.note__baby-wrap   { width: 30px; height: 27px; }

/* --- RSVP ---------------------------------------------------------------- */
.rsvp { padding: 14px 26px 40px; }
.rsvp__kicker { text-align: center; font-size: 14px; letter-spacing: 3px; color: var(--muted); }
.rsvp__title {
  text-align: center;
  font-family: 'Marck Script', cursive;
  font-size: 44px; color: var(--olive);
  line-height: 1.15; margin-top: 8px;
}
.rsvp__thanks {
  margin-top: 26px;
  background: var(--paper-2);
  border-radius: 6px;
  padding: 40px 26px;
  text-align: center;
}
.rsvp__thanks .heart { font-size: 40px; color: var(--olive); }
.rsvp__thanks p {
  font-family: 'PT Serif', serif;
  font-size: 18px; color: var(--ink);
  margin-top: 14px; line-height: 1.5;
}
.rsvp__form {
  margin-top: 22px;
  display: flex; flex-direction: column; gap: 18px;
}
.rsvp__label {
  font-family: 'PT Serif', serif;
  font-size: 15px; color: var(--ink-soft);
  display: block;
}
.rsvp__optional { color: var(--muted); font-size: 13px; }
.field {
  width: 100%;
  margin-top: 8px;
  padding: 16px 18px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 15px;
  color: var(--ink);
  outline: none;
  font-family: 'PT Serif', serif;
}
.field::placeholder { color: #b3a99f; }
textarea.field { resize: vertical; }
.field--error { border-color: #c0715f; background: #f6e7e1; }
.field-error {
  font-family: 'PT Serif', serif;
  font-size: 13px; color: #b5583f; margin-top: 6px;
}

.lodging-group { display: flex; gap: 10px; margin-top: 8px; }
.lodging-btn {
  flex: 1;
  padding: 14px;
  border-radius: 999px;
  font-family: 'Playfair Display', serif;
  font-size: 16px;
  cursor: pointer;
  transition: all .15s;
  background: var(--paper-2);
  color: var(--ink-soft);
  border: 1px solid var(--line);
}
.lodging-btn.is-active {
  background: var(--olive-btn);
  color: var(--paper);
  border-color: var(--olive-btn);
}

.rsvp__submit {
  margin-top: 6px;
  padding: 20px;
  background: var(--olive-btn);
  color: #f6f2ea;
  border: none;
  border-radius: 999px;
  font-family: 'Playfair Display', serif;
  font-size: 19px;
  letter-spacing: .5px;
  cursor: pointer;
  transition: background .15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.rsvp__submit:hover { background: var(--olive-dark); }

/* Пока ответ уходит на сервер — крутим колечко, чтобы не казалось, что зависло. */
.rsvp__submit.is-sending {
  background: var(--olive-dark);
  cursor: progress;
}
.rsvp__submit.is-sending::before {
  content: "";
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(246, 242, 234, .35);
  border-top-color: #f6f2ea;
  animation: rsvp-spin .8s linear infinite;
}
.rsvp__submit:disabled { opacity: .9; }

@keyframes rsvp-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .rsvp__submit.is-sending::before { animation-duration: 2.4s; }
}

.rsvp__note {
  margin-top: 26px;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  padding: 26px 24px;
  text-align: center;
}
.rsvp__note p {
  font-family: 'PT Serif', serif;
  font-size: 16px; line-height: 1.6; color: var(--ink-soft);
}
.rsvp__note p + p { margin-top: 18px; }

/* --- Ведущий / чат ------------------------------------------------------- */
.contacts {
  padding: 0 26px 30px;
  display: flex; flex-direction: column; gap: 22px;
}
.contact-card {
  border: 1px solid var(--line-2);
  border-radius: 6px;
  padding: 26px 24px;
  text-align: center;
}
.contact-card__kicker { font-size: 13px; letter-spacing: 2px; color: var(--muted); }
.contact-card__text {
  font-family: 'PT Serif', serif;
  font-size: 16px; line-height: 1.6; color: var(--ink-soft);
  margin-top: 14px;
}
.contact-card__host { font-size: 24px; font-weight: 600; color: var(--olive); margin-top: 18px; }
.contact-card__host a { color: inherit; border-bottom: none; white-space: nowrap; }
.contact-card__btn {
  display: inline-block;
  margin-top: 22px;
  padding: 16px 44px;
  background: var(--olive-btn);
  color: #f6f2ea;
  border-radius: 999px;
  font-size: 18px;
  border: none;
}
.contact-card__btn:hover { color: #f6f2ea; }

/* --- Место проведения ---------------------------------------------------- */
.venue { padding: 10px 26px 30px; text-align: center; }
.venue__kicker { font-size: 13px; letter-spacing: 2px; color: var(--muted); }
.venue__title {
  font-size: 34px; font-weight: 600; color: var(--ink);
  margin-top: 12px; line-height: 1.25;
}
.venue__map {
  margin-top: 22px;
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}
.venue__map iframe { width: 100%; height: 100%; border: 0; }

/* --- Подвал -------------------------------------------------------------- */
.footer { background: var(--hero-dark); padding: 30px; text-align: center; }
.footer__names { font-family: 'Marck Script', cursive; font-size: 30px; color: var(--rose); }
.footer__date  { font-family: 'PT Serif', serif; font-size: 14px; color: #9a8f94; margin-top: 8px; }
