/* ====== ПЕРЕМЕННЫЕ ====== */
:root {
  --beige: #fdfaf4;
  --beige-dark: #e3d8c2;
  --red: #e63946;
  --red-dark: #c1121f;
  --pink: #ffb3c1;
  --blue: #3a7bd5;
  --orange: #ff8c42;
  --ink: #3a3a3a;
  --ink-light: #666;
  --paper: #fdfaf4;
  --shadow: rgba(0, 0, 0, 0.12);
  --font-body: 'Montserrat', sans-serif;
  --font-script: 'Caveat', cursive;
  --font-script-alt: 'Marck Script', cursive;
}

/* ====== БАЗОВЫЕ СТИЛИ ====== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background-color: #fdfaf4;
  line-height: 1.6;
  overflow-x: hidden;
}

/* SVG-фон: мятая бумага */
.paper-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  background-color: #fdfaf4;
  filter: url(#paper-texture);
}

img {
  max-width: 100%;
  display: block;
}

.rsvp-form,
.rsvp strong {
  white-space: nowrap;
}

/* ====== ГИРЛЯНДА ====== */
.garland {
  position: relative;
  width: 100%;
  padding: 0 10px;
  z-index: 10;
  pointer-events: none;
  overflow: hidden; /* Добавлено */
}

.garland-string {
  width: 100%;
  height: 50px;
  display: block;
}

.garland-flags {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: -38px;
  flex-wrap: nowrap;
  overflow: hidden;
}

.flag {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border: 2.5px solid #555;
  border-radius: 3px 3px 6px 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  transform-origin: top center;
  animation: flagSwing 3s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.18s);
  position: relative;
}

/* Разноцветные контуры */
.flag:nth-child(1)  { border-color: #e63946; }
.flag:nth-child(2)  { border-color: transparent; }
.flag:nth-child(3)  { border-color: #3a7bd5; }
.flag:nth-child(4)  { border-color: #ff8c42; }
.flag:nth-child(5)  { border-color: #06a77d; }
.flag:nth-child(6)  { border-color: transparent; }
.flag:nth-child(7)  { border-color: #e63946; }
.flag:nth-child(8)  { border-color: #3a7bd5; }
.flag:nth-child(9)  { border-color: #ff8c42; }
.flag:nth-child(10) { border-color: #06a77d; }
.flag:nth-child(11) { border-color: #8b5cf6; }
.flag:nth-child(12) { border-color: #e63946; }
.flag:nth-child(13) { border-color: #ff8c42; }

/* Пробелы — без рамки */
.flag:nth-child(2),
.flag:nth-child(6) {
  border: none;
  width: 20px;
}

.flag::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  border: 1.5px solid #8b7355;
  border-radius: 50%;
  background: transparent;
}

.flag span {
  font-family: var(--font-script-alt);
  font-size: 1.3rem;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1;
}

@keyframes flagSwing {
  0%, 100% { transform: rotate(-6deg); }
  50%      { transform: rotate(6deg); }
}

/* ====== ОБЩИЕ КЛАССЫ ====== */
.block {
  max-width: 680px;
  margin: 0 auto;
  padding: 60px 20px;
  text-align: center;
}

.block-title {
  font-family: var(--font-script);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 16px;
}

.block-text {
  font-size: 1rem;
  color: var(--ink-light);
  line-height: 1.8;
  max-width: 520px;
  margin: 0 auto;
}

.script-title {
  font-family: var(--font-script-alt);
  color: var(--red) !important;
  font-size: 2.6rem;
}

/* ====== ПОЛАРОИДЫ ====== */
.polaroid {
  background: #fff;
  padding: 12px 12px 40px;
  box-shadow: 0 4px 12px var(--shadow);
  display: inline-block;
  position: relative;
  transition: transform 0.3s ease;
}

.polaroid img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.polaroid-caption {
  position: absolute;
  bottom: 8px;
  left: 0;
  right: 0;
  text-align: center;
  font-family: var(--font-script);
  font-size: 1.1rem;
  color: var(--ink-light);
}




/* ====== СЕРДЕЧКИ НА ДАЛЬНЕМ ФОНЕ (глобальный слой) ====== */
.hearts-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1; /* Позади всего контента, но поверх фона бумаги */
  pointer-events: none;
  overflow: hidden;
}

.hb {
  position: absolute;
  fill: #ffb3c1;
  stroke: #e63946;
  stroke-width: 2.2;
  opacity: 0.7; /* как на обложке */
}

/* Раскидываем сердечки по всей странице */
.hb-1 { top: 8%; left: 6%; width: 60px; height: 60px; transform: rotate(-15deg); }
.hb-2 { top: 25%; right: 8%; width: 45px; height: 45px; transform: rotate(20deg); }
.hb-3 { top: 45%; left: 4%; width: 50px; height: 50px; transform: rotate(10deg); }
.hb-4 { top: 60%; right: 5%; width: 55px; height: 55px; transform: rotate(-25deg); }
.hb-5 { top: 75%; left: 7%; width: 40px; height: 40px; transform: rotate(15deg); }
.hb-6 { top: 90%; right: 10%; width: 48px; height: 48px; transform: rotate(-10deg); }
.hb-7 { top: 110%; left: 5%; width: 52px; height: 52px; transform: rotate(25deg); }
.hb-8 { top: 130%; right: 6%; width: 46px; height: 46px; transform: rotate(-15deg); }

/* ====== 1. ОБЛОЖКА ====== */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  position: relative;
  overflow: hidden;
}

.heart-deco {
  position: absolute;
  width: 36px;
  height: 36px;
  opacity: 0.7;
  z-index: 0;
}

.heart-1 { top: 12%; left: 8%; transform: rotate(-15deg); }
.heart-2 { top: 8%; right: 10%; transform: rotate(20deg); width: 28px; height: 28px; }
.heart-3 { bottom: 18%; left: 5%; transform: rotate(10deg); width: 24px; height: 24px; }

.polaroids-row {
  position: relative;
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: flex-start; /* чтобы не вытягивались по высоте */
  gap: 15px;
  margin-bottom: 30px;
  max-width: 1100px;
  width: 100%;
  z-index: 1;
}

.groom-polaroid,
.bride-polaroid {
  flex: 0 0 24%;          /*hjdyj 24% yt hfcnzubdf.ncz*/
  max-width: 220px;       /* максимум на десктопе */
  min-width: 0;           
}

.groom-polaroid { transform: rotate(-4deg); }
.bride-polaroid { transform: rotate(3deg); }
.groom-polaroid.p2 { transform: rotate(2deg) translateY(10px); }
.bride-polaroid.p4 { transform: rotate(-3deg) translateY(8px); }

.arrow {
  position: absolute;
  z-index: 2;
  pointer-events: none;
}

.groom-arrow-top {
  top: -30px;
  left: 5%;
  width: 110px;
}

/* Оранжевая стрелка: справа налево, снизу вверх */
.bride-arrow-bottom {
  bottom: -65px;
  right: 5%;
  width: 110px;
}
.hero-names {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  z-index: 1;
  margin-top: 60px; /* отпустили имена вниз на 30px */
}

.hero-name {
  font-family: var(--font-script-alt);
  font-size: 2rem;
  color: var(--red);
}

.hero-plus,
.hero-equals {
  font-family: var(--font-script-alt);
  font-size: 1.6rem;
  color: var(--ink);
}

.hero-heart {
  width: 40px;
  height: 40px;
  animation: heartbeat 1.2s ease-in-out infinite;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.15); }
}

.hero-scroll-hint {
  margin-top: 40px;
  font-family: var(--font-script);
  font-size: 1.2rem;
  color: var(--ink-light);
  animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(8px); }
}

/* ====== 2. ИСТОРИЯ ЛЮБВИ ====== */
.story-polaroid-wrap {
  position: relative;
  display: inline-block;
  margin-top: 30px;
}

.story-polaroid { width: 260px; }

.story-arrow {
  position: absolute;
  top: -40px;
  left: -70px;
  width: 90px;
  z-index: 2;
}

/* ====== 3. КАЛЕНДАРЬ ====== */
.calendar-wrap {
  margin-top: 36px;
  display: flex;
  justify-content: center;
}

.calendar-svg {
  width: 290px;
  height: auto;
  transform: rotate(-1.5deg);
  transition: transform 0.4s ease;
}

.calendar-svg:hover {
  transform: rotate(0deg);
}

/* ====== 4. ПЛОЩАДКА ====== */
.venue-polaroid {
  width: 320px;
  margin: 20px auto;
  display: block;
}

/* ====== КНОПКА ====== */
.btn-primary {
  display: inline-block;
  background: var(--red);
  color: #fff;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  padding: 12px 32px;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  text-decoration: none;
  margin-top: 16px;
  transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
  box-shadow: 0 3px 8px rgba(230, 57, 70, 0.3);
}

.btn-primary:hover {
  background: var(--red-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(230, 57, 70, 0.4);
}

.btn-primary:active { transform: translateY(0); }

/* ====== 5. ТАЙМИНГ ====== */
.timing-header {
  position: relative;
  display: inline-block;
  margin: 60px auto 30px; /* отступ сверху, чтобы стрелка поместилась */
}

.timing-arrow {
  position: absolute;
  bottom: 60%;          /* расположили над заголовком */
  right: 100%;           /* правый край SVG у левого края слова "Тайминг" */
  margin-right: -15px;   /* сдвигаем вправо, чтобы кончик коснулся буквы */
  width: 140px;
  pointer-events: none;
}

.timeline-list {
  list-style: none;
  max-width: 420px;
  margin: 0 auto;
  position: relative;
}

.timeline-list::before {
  content: '';
  position: absolute;
  left: 80px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: var(--beige-dark);
}

.timeline-item {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px 0;
  position: relative;
}

.timeline-time {
  font-family: var(--font-script);
  font-size: 1.3rem;
  color: var(--red);
  width: 60px;
  text-align: right;
  flex-shrink: 0;
}

.timeline-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--red);
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--red);
  flex-shrink: 0;
  margin-left: 18px;
  z-index: 1;
}

.timeline-event {
  font-size: 0.95rem;
  color: var(--ink);
}

/* ====== 6. ДРЕСС КОД ====== */
.dresscode .block-text { font-size: 1.05rem; }

/* ====== 7. ПОЖЕЛАНИЯ ====== */
.wishes-scroll-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 30px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.wishes-viewport {
  overflow: hidden;
  flex: 1;
}

.wishes-track {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.wish-card {
  flex: 0 0 100%;
  background: #fff;
  padding: 30px 24px;
  border-radius: 12px;
  box-shadow: 0 4px 12px var(--shadow);
  box-sizing: border-box;
}

.wish-card p {
  font-size: 1.05rem;
  color: var(--ink);
  line-height: 1.8;
}

.wish-nav {
  background: var(--red);
  color: #fff;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease, transform 0.2s ease;
}

.wish-nav:hover {
  background: var(--red-dark);
  transform: scale(1.1);
}

.wish-nav:active {
  transform: scale(0.95);
}

/* ====== 8. КОНТАКТЫ ====== */
.contacts-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-size: 1.05rem;
  padding: 10px 24px;
  background: #fff;
  border-radius: 30px;
  box-shadow: 0 2px 8px var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.contact-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.contact-item svg { color: var(--red); flex-shrink: 0; }

.contacts-note {
  margin-top: 16px;
  font-size: 0.9rem;
  opacity: 0.8;
}

/* ====== 9. АНКЕТА / ФОРМА ====== */
.rsvp-form {
  max-width: 480px;
  margin: 30px auto 0;
  text-align: left;
  background: #fff;
  padding: 30px;
  border-radius: 16px;
  box-shadow: 0 4px 16px var(--shadow);
}

.form-group { margin-bottom: 20px; }

.form-group label,
.form-group legend {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--beige-dark);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 1rem;
  background: var(--paper);
  transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--red);
}

.form-group textarea { resize: vertical; }

.radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  font-weight: 400;
}

.radio-label input { width: auto; accent-color: var(--red); }

.form-success {
  margin-top: 16px;
  text-align: center;
  font-family: var(--font-script);
  font-size: 1.3rem;
  color: var(--red);
}

/* ====== 10. ФУТЕР ====== */
.footer {
  text-align: center;
  padding: 50px 20px 40px;
}

.footer-title {
  font-family: var(--font-script-alt);
  font-size: 2rem;
  color: var(--red);
  margin-bottom: 20px;
}

.footer-polaroid {
  width: 240px;
  margin: 0 auto 20px;
  transform: rotate(-2deg);
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--ink-light);
}

/* ====== АДАПТИВНОСТЬ: МОБИЛЬНЫЕ (≤600px) ====== */
@media (max-width: 600px) {
  .block { padding: 40px 8px; }
  .block-title { font-size: 1.8rem; }
  .hero-name { font-size: 1.5rem; }

  .groom-polaroid,
  .bride-polaroid {
    flex: 0 0 calc(25%-5px);       
  }

  .polaroids-row {
    gap: 6px;
  }

  /* Гирлянда */
  .flag { width: 30px; height: 30px; }
  .flag:nth-child(2),
  .flag:nth-child(6) { width: 12px; }
  .flag span { font-size: 1rem; }
  .garland-flags { gap: 3px; }

  /* Сердечки */
  .hb-1 { width: 40px; height: 40px; }
  .hb-2 { width: 35px; height: 35px; }
  .hb-3 { width: 38px; height: 38px; }
  .hb-4 { width: 42px; height: 42px; }
  .hb-5 { display: none; }
  .hb-6 { width: 36px; height: 36px; }
  .hb-7 { display: none; }
  .hb-8 { width: 34px; height: 34px; }

  /* Стрелки */
  .story-arrow { left: -10px; top: -30px; width: 70px; }

  /* Площадка */
  .venue-polaroid { width: 100%; max-width: 300px; }

  /* Тайминг */
  .timing-arrow {
    margin-right: -10px;
    width: 120px;
  }
  /* .timing-header { display: block; } <-- УДАЛЕНО */

  /* Календарь */
  .calendar-svg { transform: rotate(-1deg); width: 260px; }

  /* Форма */
  .rsvp-form { padding: 20px 16px; }

  /* Футер */
  .footer-polaroid { width: 200px; }
}

@media (max-width: 430px) {

  .polaroids-row {
    gap: 4px;
  }
  .groom-polaroid,
  .bride-polaroid {
    flex: 0 0 calc(25%-3px);       
  }
  .polaroid {
    padding:  5px 5px 22px;
  }
  .polaroid-caption {
    font-size: 0.7rem;
    bottom: 4px;
  }

    /* Гирлянда */
  .flag { width: 24px; height: 24px; }
  .flag:nth-child(2),
  .flag:nth-child(6) { width: 8px; }
  .flag span { font-size: 0.8rem; }

  .hero-name { font-size: 1.3rem; }

  .flag { width: 26px; height: 26px; }
  .flag:nth-child(2),
  .flag:nth-child(6) { width: 10px; }
  .flag span { font-size: 0.85rem; }

  .timing-arrow {
    margin-right: -8px;
    width: 100px;
  }

}


/* ====== АДАПТИВНОСТЬ: ОЧЕНЬ МАЛЕНЬКИЕ (≤380px) ====== */
@media (max-width: 380px) {
  /*.groom-polaroid,
  .bride-polaroid {
    min-width: 60px;       
    max-width: none;
  }*/

    .polaroids-row {
    gap: 4px;
  }

  .polaroid-caption {
    font-size: 0.7rem;
    bottom: 4px;
  }

  .polaroid {
    padding:  5px 5px 22px;
  }

    /* Гирлянда */
  .flag { width: 24px; height: 24px; }
  .flag:nth-child(2),
  .flag:nth-child(6) { width: 8px; }
  .flag span { font-size: 0.8rem; }

  .hero-name { font-size: 1.3rem; }

  .flag { width: 26px; height: 26px; }
  .flag:nth-child(2),
  .flag:nth-child(6) { width: 10px; }
  .flag span { font-size: 0.85rem; }

  .timing-arrow {
    margin-right: -8px;
    width: 100px;
  }
}



/* ====== АДАПТИВНОСТЬ: ДЕСКТОП (≥900px) ====== */
@media (min-width: 900px) {

  /* — Обложка — */
  .hero { padding: 60px 20px; }

  .groom-polaroid,
  .bride-polaroid { 
    max-width: 220px;
  }

  .groom-arrow-top {
    top: -40px;
    left: 8%;
    width: 150px;
  }
  .bride-arrow-bottom {
    bottom: -75px;
    right: 8%;
    width: 150px;
  }



  .heart-deco { width: 50px; height: 50px; }
  .heart-2 { width: 38px; height: 38px; }
  .heart-3 { width: 34px; height: 34px; }

  .hero-name { font-size: 2.8rem; }
  .hero-plus,
  .hero-equals { font-size: 2.2rem; }
  .hero-heart { width: 56px; height: 56px; }

  /* — История любви — */
  .story-polaroid { width: 340px; }
  .story-arrow {
    left: -90px;
    top: -50px;
    width: 110px;
  }

  /* — Календарь — */
  .calendar-svg { width: 380px; }

  /* — Площадка: кнопка строго под фото — */
  .venue-polaroid {
    width: 340px;
    margin: 20px auto;
    display: block;
  }

  /* — Тайминг — */
  .timing-arrow {
    margin-right: -20px;
    width: 160px;
  }
  .timeline-time { font-size: 1.5rem; }
  .timeline-event { font-size: 1.05rem; }

  /* — Форма — */
  .rsvp-form {
    max-width: 560px;
    padding: 36px;
  }

  /* — Футер — */
  .footer-polaroid { width: 280px; }
  .footer-title { font-size: 2.4rem; }

  /* — Заголовки и текст — */
  .block-title { font-size: 2.6rem; }
  .script-title { font-size: 3rem; }
  .block-text { font-size: 1.1rem; }

  /* — Контакты в ряд — */
  .contacts-list {
    flex-direction: row;
    justify-content: center;
  }

  /* — Гирлянда — */
  .flag { width: 50px; height: 50px; }
  .flag:nth-child(2),
  .flag:nth-child(6) { width: 26px; }
  .flag span { font-size: 1.6rem; }
  .garland-flags { gap: 6px; }
}

/* ====== АДАПТИВНОСТЬ: ШИРОКИЙ ДЕСКТОП (≥1200px) ====== */
@media (min-width: 1200px) {

  .groom-polaroid,
  .bride-polaroid { 
    max-width: 250px;
  }


  .hero-name { font-size: 3.2rem; }
  .hero-heart { width: 64px; height: 64px; }

  .calendar-svg { width: 420px; }

  .block { max-width: 800px; }
  .venue-polaroid {
    width: 380px;
    display: block;
  }
  .story-polaroid { width: 380px; }

}

