:root {
  --cream: #FAF6EE;
  --cream-2: #F3EDDE;
  --ink: #3D342B;
  --muted: #83786A;
  --terracotta: #B4693F;
  --amber: #D9A441;
  --sage: #75835D;
  --sage-soft: #A9B394;
  --sage-dark: #5C6A47;
  --maple: #C9702E;
  --maple-bright: #D77E33;
  --line: #E4DBC9;
  --radius: 14px;
}

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

html { scroll-behavior: smooth; }

body {
  position: relative; /* якорь для .birds на всю высоту документа */
  font-family: "Manrope", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--cream);
  overflow-x: hidden;
}

h1, h2, .hero-date, .done-title, .footer-names, .card-main {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 500;
  line-height: 1.15;
}

h2 {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  margin-bottom: 0.8em;
}

a { color: var(--sage-dark); }

main > section, .invitation {
  max-width: 880px;
  margin: 0 auto;
  padding: clamp(3rem, 8vw, 5.5rem) clamp(1.25rem, 5vw, 2rem);
}

/* ---------- Обложка ---------- */

.hero {
  min-height: 92svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 1.25rem 3rem;
  position: relative;
  background: radial-gradient(ellipse 70% 45% at 50% 32%, rgba(217, 164, 65, 0.14), transparent 70%);
}

.hero-greeting {
  font-style: italic;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.25rem, 3vw, 1.6rem);
  color: var(--terracotta);
  margin-top: 1.1rem;
  animation: rise 0.9s 0.45s ease both;
}

.hero-names {
  font-size: clamp(3.2rem, 11vw, 6.2rem);
  letter-spacing: 0.02em;
  animation: rise 0.9s ease both;
}

.amp {
  font-style: italic;
  color: var(--sage);
  font-weight: 400;
}

.hero-ornament {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 1.3rem 0 1.1rem;
  animation: rise 0.9s 0.15s ease both;
}

.orn-line {
  width: 52px;
  height: 1px;
  background: var(--terracotta);
  opacity: 0.55;
}

.orn-maple {
  width: 22px;
  color: var(--maple-bright);
  animation: maple-sway 5s ease-in-out infinite;
}

@keyframes maple-sway {
  0%, 100% { transform: rotate(-8deg); }
  50% { transform: rotate(8deg); }
}

.hero-date {
  font-size: clamp(1.4rem, 3.5vw, 1.9rem);
  letter-spacing: 0.14em;
  animation: rise 0.9s 0.3s ease both;
}

.hero-sub {
  color: var(--muted);
  margin-top: 0.3rem;
  animation: rise 0.9s 0.55s ease both;
}

.hero .btn { margin-top: 2.2rem; animation: rise 0.9s 0.65s ease both; }

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Птички ---------- */

/* Привязаны к местам страницы и скроллятся вместе с ней.
   z-index: -1 — прячутся за белыми карточками, видны на кремовом фоне */
.birds { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }

.bird {
  position: absolute;
  opacity: 0;
  animation: fly-ltr linear infinite;
  will-change: transform;
}

/* вертикальное покачивание — полёт по синусоиде */
.bob { display: block; animation: bob ease-in-out infinite alternate; }

.bird svg { display: block; width: 100%; height: auto; }

/* птички, летящие вправо, смотрят вправо (базовый рисунок смотрит влево) */
.bird-1 svg, .bird-2 svg, .bird-4 svg, .bird-5 svg, .bird-6 svg, .bird-7 svg, .bird-9 svg, .bird-10 svg, .bird-11 svg, .bird-13 svg, .bird-14 svg, .bird-16 svg, .bird-17 svg, .bird-20 svg, .bird-21 svg, .bird-22 svg, .bird-24 svg, .bird-25 svg, .bird-26 svg, .bird-28 svg, .bird-30 svg { transform: scaleX(-1); }

.bird-1 { top: 2.2%; width: 30px; animation-duration: 27.1s; animation-delay: -1.3s; --amp: 115px; }
.bird-1 .bob { animation-duration: 2.9s; }
.bird-2 { top: 5.0%; width: 34px; animation-duration: 17.5s; animation-delay: -9.8s; --amp: 105px; }
.bird-2 .bob { animation-duration: 3.0s; }
.bird-3 { top: 8.7%; width: 38px; animation-name: fly-rtl; animation-duration: 23.5s; animation-delay: -2.3s; --amp: 105px; }
.bird-3 .bob { animation-duration: 2.6s; }
.bird-4 { top: 10.3%; width: 42px; animation-duration: 31.9s; animation-delay: -24.8s; --amp: 85px; }
.bird-4 .bob { animation-duration: 4.4s; }
.bird-5 { top: 14.7%; width: 28px; animation-duration: 18.7s; animation-delay: -13.1s; --amp: 65px; }
.bird-5 .bob { animation-duration: 2.7s; }
.bird-6 { top: 17.4%; width: 38px; animation-duration: 31.3s; animation-delay: -22.8s; --amp: 75px; }
.bird-6 .bob { animation-duration: 4.5s; }
.bird-7 { top: 20.0%; width: 28px; animation-duration: 19.9s; animation-delay: -15.1s; --amp: 65px; }
.bird-7 .bob { animation-duration: 5.6s; }
.bird-8 { top: 24.2%; width: 26px; animation-name: fly-rtl; animation-duration: 14.5s; animation-delay: -11.1s; --amp: 95px; }
.bird-8 .bob { animation-duration: 5.1s; }
.bird-9 { top: 28.6%; width: 38px; animation-duration: 22.3s; animation-delay: -13.3s; --amp: 95px; }
.bird-9 .bob { animation-duration: 5.1s; }
.bird-10 { top: 29.6%; width: 34px; animation-duration: 19.3s; animation-delay: -9.2s; --amp: 105px; }
.bird-10 .bob { animation-duration: 2.6s; }
.bird-11 { top: 34.8%; width: 46px; animation-duration: 30.7s; animation-delay: -8.7s; --amp: 85px; }
.bird-11 .bob { animation-duration: 5.4s; }
.bird-12 { top: 36.8%; width: 38px; animation-name: fly-rtl; animation-duration: 27.7s; animation-delay: -4.7s; --amp: 55px; }
.bird-12 .bob { animation-duration: 4.1s; }
.bird-13 { top: 39.6%; width: 30px; animation-duration: 30.1s; animation-delay: -12.0s; --amp: 115px; }
.bird-13 .bob { animation-duration: 4.1s; }
.bird-14 { top: 42.7%; width: 34px; animation-duration: 22.9s; animation-delay: -20.2s; --amp: 115px; }
.bird-14 .bob { animation-duration: 3.9s; }
.bird-15 { top: 47.0%; width: 38px; animation-name: fly-rtl; animation-duration: 28.3s; animation-delay: -19.3s; --amp: 85px; }
.bird-15 .bob { animation-duration: 5.7s; }
.bird-16 { top: 49.1%; width: 30px; animation-duration: 28.9s; animation-delay: -19.0s; --amp: 55px; }
.bird-16 .bob { animation-duration: 4.0s; }
.bird-17 { top: 53.6%; width: 22px; animation-duration: 25.9s; animation-delay: -3.8s; --amp: 95px; }
.bird-17 .bob { animation-duration: 3.7s; }
.bird-18 { top: 56.7%; width: 22px; animation-name: fly-rtl; animation-duration: 18.1s; animation-delay: -8.3s; --amp: 115px; }
.bird-18 .bob { animation-duration: 5.1s; }
.bird-19 { top: 60.8%; width: 42px; animation-name: fly-rtl; animation-duration: 24.1s; animation-delay: -9.6s; --amp: 85px; }
.bird-19 .bob { animation-duration: 2.8s; }
.bird-20 { top: 63.3%; width: 26px; animation-duration: 29.5s; animation-delay: -29.0s; --amp: 85px; }
.bird-20 .bob { animation-duration: 3.0s; }
.bird-21 { top: 65.7%; width: 22px; animation-duration: 25.3s; animation-delay: -14.3s; --amp: 95px; }
.bird-21 .bob { animation-duration: 2.7s; }
.bird-22 { top: 68.9%; width: 30px; animation-duration: 21.1s; animation-delay: -13.0s; --amp: 65px; }
.bird-22 .bob { animation-duration: 4.6s; }
.bird-23 { top: 73.9%; width: 46px; animation-name: fly-rtl; animation-duration: 16.3s; animation-delay: -2.0s; --amp: 115px; }
.bird-23 .bob { animation-duration: 4.1s; }
.bird-24 { top: 77.2%; width: 34px; animation-duration: 24.7s; animation-delay: -2.1s; --amp: 55px; }
.bird-24 .bob { animation-duration: 4.9s; }
.bird-25 { top: 79.7%; width: 28px; animation-duration: 15.7s; animation-delay: -8.1s; --amp: 65px; }
.bird-25 .bob { animation-duration: 5.6s; }
.bird-26 { top: 82.3%; width: 22px; animation-duration: 15.1s; animation-delay: -11.4s; --amp: 75px; }
.bird-26 .bob { animation-duration: 5.7s; }
.bird-27 { top: 86.5%; width: 34px; animation-name: fly-rtl; animation-duration: 26.5s; animation-delay: -13.7s; --amp: 65px; }
.bird-27 .bob { animation-duration: 3.6s; }
.bird-28 { top: 87.8%; width: 38px; animation-duration: 21.7s; animation-delay: -13.8s; --amp: 95px; }
.bird-28 .bob { animation-duration: 5.2s; }
.bird-29 { top: 93.2%; width: 30px; animation-name: fly-rtl; animation-duration: 16.9s; animation-delay: -13.8s; --amp: 105px; }
.bird-29 .bob { animation-duration: 5.1s; }
.bird-30 { top: 94.1%; width: 22px; animation-duration: 20.5s; animation-delay: -20.3s; --amp: 115px; }
.bird-30 .bob { animation-duration: 3.4s; }

@keyframes fly-ltr {
  0%   { transform: translateX(-8vw); opacity: 0; }
  5%   { opacity: 0.9; }
  95%  { opacity: 0.9; }
  100% { transform: translateX(108vw); opacity: 0; }
}

@keyframes fly-rtl {
  0%   { transform: translateX(106vw); opacity: 0; }
  5%   { opacity: 0.85; }
  95%  { opacity: 0.85; }
  100% { transform: translateX(-10vw); opacity: 0; }
}

@keyframes bob {
  from { transform: translateY(calc(-1 * var(--amp, 60px))) rotate(4deg); }
  to   { transform: translateY(var(--amp, 60px)) rotate(-4deg); }
}

/* ---------- Приглашение ---------- */

.invitation {
  display: grid;
  grid-template-columns: minmax(240px, 340px) 1fr;
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: center;
}

.photo-frame {
  border-radius: 170px 170px var(--radius) var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--cream-2);
  box-shadow: 0 18px 45px -22px rgba(61, 52, 43, 0.35);
}

.photo-frame img { display: block; width: 100%; height: 100%; object-fit: cover; aspect-ratio: 3 / 4; }

.photo-missing { display: none; }

.invitation:has(.photo-missing) { grid-template-columns: 1fr; text-align: center; }

.invitation-text p { margin-bottom: 1em; }

.signature {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-style: italic;
  font-size: 1.35rem;
  color: var(--terracotta);
}

/* ---------- Детали ---------- */

.details { text-align: center; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.1rem;
  margin-top: 1rem;
}

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.8rem 1.4rem;
  position: relative;
  overflow: hidden;
}

/* Праздничная цветная кромка у карточек */
.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.card:nth-child(1)::before { background: var(--amber); }
.card:nth-child(2)::before { background: var(--maple-bright); }
.card:nth-child(3)::before { background: var(--sage); }

.card-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--sage-dark);
  margin-bottom: 0.5rem;
}

.card-main { font-size: 1.7rem; }

.card-note { color: var(--muted); font-size: 0.95rem; margin-top: 0.35rem; }

.details-note {
  color: var(--muted);
  max-width: 520px;
  margin: 1.8rem auto 0;
  font-size: 0.95rem;
}

/* ---------- Дресс-код ---------- */

.dresscode { text-align: center; max-width: 640px; }

/* ---------- Сюрпризы через ведущего ---------- */

.host { text-align: center; max-width: 640px; }

.host-btn { margin-top: 1.4rem; }

/* ---------- Опросник ---------- */

.rsvp {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) * 1.6);
  padding: clamp(2.2rem, 6vw, 3.5rem) !important;
  margin-bottom: 4rem !important;
}

.rsvp h2 { text-align: center; }

.rsvp-intro { text-align: center; color: var(--muted); max-width: 480px; margin: -0.5rem auto 2.2rem; }

.field { margin-bottom: 1.7rem; border: none; }

.field > label, .field legend {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.6rem;
}

.hint { font-weight: 400; color: var(--muted); font-size: 0.85rem; }

input[type="text"], input[type="time"], textarea {
  width: 100%;
  max-width: 420px;
  font: inherit;
  color: inherit;
  padding: 0.7rem 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--cream);
  outline: none;
  transition: border-color 0.2s;
}

textarea { resize: vertical; min-height: 88px; }

.companion-input { display: block; margin-bottom: 0.6rem; }

input[type="text"]:focus, input[type="time"]:focus, textarea:focus { border-color: var(--sage); }

input[type="time"] { max-width: 180px; }

.pills { display: flex; flex-wrap: wrap; gap: 0.6rem; }

.pill { cursor: pointer; }

.pill input { position: absolute; opacity: 0; pointer-events: none; }

.pill span {
  display: inline-block;
  padding: 0.55rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: var(--cream);
  font-size: 0.95rem;
  transition: all 0.2s;
  user-select: none;
}

.pill:hover span { border-color: var(--sage-soft); }

.pill input:checked + span {
  background: var(--sage-dark);
  border-color: var(--sage-dark);
  color: #fff;
}

/* Чекбоксы отличаются от радио квадратиком с галочкой — виден множественный выбор */
.pill input[type="checkbox"] + span::before {
  content: "";
  display: inline-block;
  width: 15px;
  height: 15px;
  margin-right: 9px;
  vertical-align: -2px;
  border: 1.5px solid var(--sage-soft);
  border-radius: 4px;
  background: #fff;
  font-size: 11px;
  line-height: 15px;
  text-align: center;
  transition: all 0.2s;
}

.pill input[type="checkbox"]:checked + span::before {
  content: "✓";
  color: var(--sage-dark);
  border-color: #fff;
  font-weight: 700;
}

.pill input:focus-visible + span { outline: 2px solid var(--amber); outline-offset: 2px; }

.indent {
  padding-left: 1.1rem;
  border-left: 2px solid var(--cream-2);
}

.branch { animation: rise 0.45s ease both; }

.video-invite {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.7rem;
}

.video-all { margin: 2.2rem 0 0; }

.video-links { display: flex; gap: 0.8rem; margin-top: 1.1rem; flex-wrap: wrap; }

.field-error { color: #A5432C; font-size: 0.88rem; margin-top: 0.5rem; }

.submit-row { margin-top: 2.2rem; }

.rsvp-done { text-align: center; padding: 1.5rem 0; animation: rise 0.5s ease both; }

.done-title { font-size: 2.2rem; color: var(--sage-dark); margin-bottom: 0.3rem; }

/* ---------- Кнопки ---------- */

.btn {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  font-size: 0.98rem;
  text-decoration: none;
  border-radius: 100px;
  padding: 0.85rem 2rem;
  cursor: pointer;
  transition: all 0.22s;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--sage-dark);
  color: #fff;
}

.btn-primary:hover { background: var(--sage); transform: translateY(-1px); }

.btn-primary:disabled { opacity: 0.6; cursor: default; transform: none; }

.btn-secondary {
  background: transparent;
  border-color: var(--sage-dark);
  color: var(--sage-dark);
  padding: 0.65rem 1.5rem;
}

.btn-secondary:hover { background: var(--sage-dark); color: #fff; }

/* ---------- Футер ---------- */

.footer {
  text-align: center;
  padding: 3.5rem 1.25rem 4rem;
  background: rgba(243, 237, 222, 0.72);
  border-top: 1px solid var(--line);
}

.footer-names { font-size: 2rem; }

.footer-date { letter-spacing: 0.3em; color: var(--muted); margin: 0.4rem 0 1.4rem; }

.footer-contacts { color: var(--muted); font-size: 0.92rem; }

/* ---------- Появление при скролле ---------- */

.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s ease, transform 0.7s ease; }

.reveal.visible { opacity: 1; transform: none; }

/* ---------- Адаптив ---------- */

@media (max-width: 720px) {
  .invitation { grid-template-columns: 1fr; }
  .photo-frame { max-width: 300px; margin: 0 auto; }
  .invitation-text { text-align: center; }
  .cards { grid-template-columns: 1fr; }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .bird { display: none; }
  .orn-maple { animation: none; }
  .hero-greeting, .hero-names, .hero-ornament, .hero-date, .hero-sub, .hero .btn, .branch { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
