/* ============================================================
   ТЕМА — цвета и шрифты меняются здесь
   (для очень старых браузеров без CSS-переменных везде
   продублированы обычные значения — меняя тему, правьте оба)
   ============================================================ */
:root {
  --cream: #FEF7ED;        /* светлый фон */
  --maroon: #500900;       /* тёмно-бордовый фон */
  --maroon-deep: #3F0300;  /* совсем тёмный (градиенты) */
  --brown: #4B1700;        /* фон блока «Дресс-код» */
  --red: #D50100;          /* акцент: кнопки, надписи, волны */
  --ink: #262222;          /* текст на светлом */
  --paper: #FFFFFF;        /* рамки полароидов */

  --font-heading: "Cormorant Infant", Georgia, serif;
  --font-body: "Jost", "Segoe UI", Arial, sans-serif;
  --font-script: "Yellowtail", cursive;
}

/* ============================================================ */

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

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  font-family: "Jost", "Segoe UI", Arial, sans-serif;
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 17px;
  line-height: 1.55;
  color: #262222;
  color: var(--ink);
  background: #FEF7ED;
  background: var(--cream);
  overflow-x: hidden;
}

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

h1, h2, h3 {
  font-family: "Cormorant Infant", Georgia, serif;
  font-family: var(--font-heading);
  font-weight: 400;
}

.container { max-width: 1060px; margin: 0 auto; padding: 0 20px; }
.container--narrow { max-width: 640px; }

.section { position: relative; padding: 90px 0; overflow: hidden; }
.section--cream { background: #FEF7ED; background: var(--cream); color: #262222; color: var(--ink); }
.section--maroon {
  background: #500900;
  background: radial-gradient(120% 120% at 50% 0%, #500900 0%, #3F0300 100%);
  color: #FEF7ED;
  color: var(--cream);
}
.section--brown { background: #4B1700; background: var(--brown); color: #FEF7ED; color: var(--cream); }

.section__title {
  font-size: 40px;
  font-size: clamp(34px, 5vw, 48px);
  text-align: center;
  margin-bottom: 34px;
}

/* --- Появление при прокрутке --- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s ease, transform .9s ease; }
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* --- Волнистая красная линия на стыках секций --- */
.wave { position: absolute; left: 0; right: 0; height: 160px; pointer-events: none; z-index: 2; }
.wave--bottom { bottom: -80px; }
.wave--top { top: -80px; }
.wave svg { width: 100%; height: 100%; }
.wave path { stroke: #D50100; stroke: var(--red); stroke-width: 2; }

/* --- Полароид --- */
.polaroid {
  background: #FFFFFF;
  background: var(--paper);
  padding: 12px 12px 46px;
  box-shadow: 0 14px 34px rgba(0,0,0,.28);
  display: inline-block;
}
.polaroid img { width: 100%; height: 100%; object-fit: cover; }
.polaroid--tilt { -webkit-transform: rotate(3deg); transform: rotate(3deg); }
.polaroid--tilt-l { -webkit-transform: rotate(-4deg); transform: rotate(-4deg); }

/* --- Узор из рукописных надписей --- */
.photo-stage { position: relative; display: flex; justify-content: center; padding: 30px 0; }
.photo-stage .polaroid { position: relative; z-index: 1; width: 240px; max-width: 62vw; }
.script-pattern {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  display: flex; flex-direction: column; justify-content: center;
  overflow: hidden;
  font-family: "Yellowtail", cursive;
  font-family: var(--font-script);
  font-size: 32px;
  font-size: clamp(26px, 4vw, 40px);
  color: #D50100;
  color: var(--red);
  white-space: nowrap; text-align: center;
  -webkit-transform: rotate(-4deg); transform: rotate(-4deg);
  -webkit-user-select: none; user-select: none;
  pointer-events: none;
}
.script-pattern > div { margin: 3px 0; }
.script-pattern--static { position: relative; top: auto; right: auto; bottom: auto; left: auto; margin-top: -30px; z-index: 0; }

.script-line {
  font-family: "Yellowtail", cursive;
  font-family: var(--font-script);
  color: #D50100;
  color: var(--red);
  font-size: 32px;
  font-size: clamp(26px, 4vw, 38px);
  -webkit-transform: rotate(-4deg); transform: rotate(-4deg);
  margin-top: 26px;
  white-space: nowrap;
}
.script-line--center { text-align: center; margin-top: 40px; }

/* ============================================================
   Стартовый экран
   ============================================================ */
.splash {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 100;
  background: #FEF7ED;
  background: var(--cream);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px; cursor: pointer;
  transition: opacity .8s ease, visibility .8s;
}
.splash > * + * { margin-top: 26px; }
.splash.hidden { opacity: 0; visibility: hidden; }
.splash__top {
  font-family: "Cormorant Infant", Georgia, serif;
  font-family: var(--font-heading);
  font-size: 24px;
  font-size: clamp(20px, 3vw, 28px);
  letter-spacing: .35em;
  text-transform: uppercase;
  text-align: center;
}
.splash__stage { width: 100%; }
.splash__hint { font-size: 15px; }
.splash__hand { width: 44px; height: 44px; animation: tap 1.6s ease-in-out infinite; }
@keyframes tap {
  0%, 100% { -webkit-transform: translateY(0); transform: translateY(0); }
  50% { -webkit-transform: translateY(-10px); transform: translateY(-10px); }
}

/* --- Кнопка музыки --- */
.music-toggle {
  position: fixed; top: 18px; right: 18px; z-index: 90;
  width: 44px; height: 44px; border-radius: 50%;
  border: none; cursor: pointer;
  background: rgba(120,120,120,.35);
  background: rgba(255,255,255,.22); color: #FEF7ED; color: var(--cream);
  display: flex; align-items: center; justify-content: center;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.music-toggle svg { width: 22px; height: 22px; }

/* ============================================================
   Шапка
   ============================================================ */
.hero { padding: 46px 0 130px; text-align: center; }
.hero__date { font-size: 19px; font-size: clamp(17px, 2.4vw, 21px); letter-spacing: .06em; }
.hero__date:after { content: " |"; }
.names {
  font-size: 96px;
  font-size: clamp(64px, 12vw, 140px);
  line-height: 1.02;
  font-weight: 400;
  margin: 40px 0 30px;
}
.names .amp { font-style: italic; }

/* ============================================================
   Приглашение + календарь
   ============================================================ */
.invite {
  display: grid; grid-template-columns: 1fr 1fr;
  grid-gap: 60px; gap: 60px;
  align-items: center; padding-top: 30px;
}
.invite__text { text-align: center; }
.invite__text h2 { font-size: 36px; font-size: clamp(30px, 4vw, 42px); margin-bottom: 18px; }
.invite__date {
  font-family: "Cormorant Infant", Georgia, serif;
  font-family: var(--font-heading);
  font-size: 28px;
  font-size: clamp(24px, 3vw, 32px);
  margin-top: 22px;
}
.invite__date:after { content: " |"; }

.calendar {
  justify-self: center;
  background: #FEF7ED;
  background: var(--cream);
  border: 1.5px solid #262222;
  border: 1.5px solid var(--ink);
  box-shadow: 3px 3px 0 rgba(38,34,34,.55);
  padding: 26px 30px 30px;
  width: 360px; max-width: 100%;
}
.calendar__month {
  font-family: "Cormorant Infant", Georgia, serif;
  font-family: var(--font-heading);
  font-size: 30px; text-align: center; margin-bottom: 14px;
}
.calendar__grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  grid-gap: 8px 4px; gap: 8px 4px;
  text-align: center; font-size: 15px;
}
.calendar__grid .dow { font-size: 11px; letter-spacing: .08em; opacity: .65; }
.calendar__grid .day { position: relative; padding: 4px 0; }
.calendar__grid .day--wedding { color: #fff; font-weight: 500; z-index: 0; }
/* сердечко: SVG в data-URI — работает во всех браузерах;
   цвет зашит в самом SVG (%23D50100 = #D50100) */
.calendar__grid .day--wedding:before {
  content: "";
  position: absolute; top: 50%; left: 50%;
  width: 30px; height: 28px;
  margin: -14px 0 0 -15px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 29'%3E%3Cpath fill='%23D50100' d='M16 29C9 22 0 16.6 0 8.5A8.5 8.5 0 0 1 16 4.6 8.5 8.5 0 0 1 32 8.5C32 16.6 23 22 16 29Z'/%3E%3C/svg%3E") center no-repeat;
  background-size: contain;
  z-index: -1;
}

/* ============================================================
   Место проведения
   ============================================================ */
.venue {
  display: grid; grid-template-columns: 1fr 1fr;
  grid-gap: 60px; gap: 60px;
  align-items: center;
}
.venue__info { text-align: center; }
.venue__info h2 { font-size: 40px; font-size: clamp(34px, 5vw, 48px); margin-bottom: 20px; }
.venue__lines { font-style: italic; white-space: pre-line; margin-bottom: 26px; }

.btn {
  display: inline-block;
  background: #D50100; background: var(--red);
  color: #fff;
  font-family: "Jost", "Segoe UI", Arial, sans-serif;
  font-family: var(--font-body);
  font-size: 15px;
  text-decoration: none; border: none; cursor: pointer;
  padding: 13px 34px; border-radius: 999px;
  box-shadow: 0 8px 20px rgba(213,1,0,.35);
  transition: transform .2s ease, box-shadow .2s ease;
}
.btn:hover { -webkit-transform: translateY(-2px); transform: translateY(-2px); box-shadow: 0 12px 24px rgba(213,1,0,.45); }
.btn--wide { width: 100%; font-size: 16px; }

/* конверт с фотографией (в браузерах без clip-path — просто прямоугольники) */
.envelope { position: relative; width: 340px; max-width: 80vw; margin: 0 auto; }
.envelope__flap {
  position: absolute; top: -70px; left: 6%; right: 6%;
  height: 120px; z-index: 0;
  background: #7a1005;
  -webkit-clip-path: polygon(0 100%, 50% 0, 100% 100%);
  clip-path: polygon(0 100%, 50% 0, 100% 100%);
}
.envelope__photo { width: 82%; margin: 0 auto; position: relative; z-index: 1; }
.envelope__pocket {
  position: absolute; left: 0; right: 0; bottom: -26px;
  height: 150px; z-index: 2;
  background: #a01f12;
  background: linear-gradient(160deg, #b3261a, #8f150a);
  -webkit-clip-path: polygon(0 18%, 50% 55%, 100% 18%, 100% 100%, 0 100%);
  clip-path: polygon(0 18%, 50% 55%, 100% 18%, 100% 100%, 0 100%);
  box-shadow: 0 16px 30px rgba(0,0,0,.35);
}

/* ============================================================
   Тайминг
   ============================================================ */
.timeline {
  display: flex;
  border-bottom: 2px solid #3F0300;
  border-bottom: 2px solid var(--maroon-deep);
  max-width: 860px; margin: 0 auto;
}
.timeline__item { flex: 1; padding-bottom: 14px; }
.timeline__item + .timeline__item { margin-left: 12px; }
.timeline__time {
  font-family: "Cormorant Infant", Georgia, serif;
  font-family: var(--font-heading);
  font-size: 30px;
  font-size: clamp(24px, 3.4vw, 34px);
}
.timeline__labels { display: flex; max-width: 860px; margin: 12px auto 0; }
.timeline__labels .timeline__label { flex: 1; }
.timeline__labels .timeline__label + .timeline__label { margin-left: 12px; }
.timeline__label { font-size: 14px; }

/* ============================================================
   Дресс-код
   ============================================================ */
.dress__text { max-width: 460px; margin: 0 auto 30px; text-align: center; font-size: 15px; }
.dress__colors { display: flex; justify-content: center; flex-wrap: wrap; margin-bottom: 32px; }
.dress__swatch {
  width: 58px; height: 58px; border-radius: 50%;
  margin: 0 7px 14px;
  border: 1px solid rgba(255,255,255,.35);
  box-shadow: inset 0 2px 6px rgba(0,0,0,.25);
}
.dress__cols {
  display: grid; grid-template-columns: 1fr 1fr;
  grid-gap: 40px; gap: 40px;
  max-width: 760px; margin: 0 auto;
  text-align: center;
}
.dress__col h3 { font-size: 30px; font-size: clamp(26px, 3.4vw, 34px); margin-bottom: 20px; }
.dress__photo {
  width: 220px; max-width: 70vw; height: 293px; object-fit: cover;
  margin: 0 auto; box-shadow: 0 12px 26px rgba(0,0,0,.35);
}

/* ============================================================
   Обратный отсчёт
   ============================================================ */
.polaroid--big {
  display: block;
  width: 500px; max-width: 88vw;
  margin: 0 auto;
  padding: 16px 16px 60px;
}
.countdown { position: relative; }
/* пропорции держит padding-bottom — работает во всех браузерах */
.countdown__bg {
  position: relative;
  height: 0; padding-bottom: 105%;
  background-size: cover; background-position: center;
}
.countdown__bg:after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: rgba(20,8,4,.55); }
.countdown__content {
  position: absolute; top: 16px; right: 16px; bottom: 60px; left: 16px;
  z-index: 1; color: #FEF7ED; color: var(--cream);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  padding-top: 12%;
}
.countdown__content h2 {
  font-size: 34px;
  font-size: clamp(28px, 5vw, 40px);
  max-width: 8em; text-align: center; line-height: 1.25;
}
.countdown__grid { display: flex; margin-top: 28px; }
.countdown__cell { display: flex; flex-direction: column; align-items: center; }
.countdown__cell + .countdown__cell { margin-left: 28px; margin-left: clamp(18px, 5vw, 40px); }
.countdown__num {
  font-family: "Cormorant Infant", Georgia, serif;
  font-family: var(--font-heading);
  font-size: 34px;
  font-size: clamp(28px, 5vw, 40px);
}
.countdown__label { font-size: 13px; margin-top: 2px; }

/* ============================================================
   Пожелания
   ============================================================ */
.wishes { text-align: center; }
.wishes__text { min-height: 7.5em; font-size: 15.5px; max-width: 480px; margin: 0 auto; transition: opacity .35s ease; }
.wishes__text.fading { opacity: 0; }
.wishes__nav { display: flex; align-items: center; justify-content: center; margin-top: 18px; }
.wishes__arrow {
  background: none; border: none; cursor: pointer;
  color: #FEF7ED; color: var(--cream);
  font-size: 24px; line-height: 1;
  opacity: .8; transition: opacity .2s;
  padding: 4px 8px;
}
.wishes__arrow:hover { opacity: 1; }
.wishes__counter {
  font-family: "Cormorant Infant", Georgia, serif;
  font-family: var(--font-heading);
  font-size: 20px;
  margin: 0 22px;
}

/* ============================================================
   Анкета гостя
   ============================================================ */
.rsvp__subtitle { text-align: center; font-size: 15px; }
.rsvp__deadline {
  text-align: center;
  font-family: "Cormorant Infant", Georgia, serif;
  font-family: var(--font-heading);
  font-size: 28px;
  font-size: clamp(24px, 3vw, 30px);
  letter-spacing: .12em;
  margin: 8px 0 40px;
}
.rsvp { display: flex; flex-direction: column; }
.rsvp__label { font-size: 18px; font-weight: 400; margin: 26px 0 10px; }
.rsvp__input {
  font-family: "Jost", "Segoe UI", Arial, sans-serif;
  font-family: var(--font-body);
  font-size: 15px; color: #262222; color: var(--ink);
  background: transparent;
  border: 1px solid rgba(38,34,34,.4); border-radius: 4px;
  padding: 12px 14px; outline: none;
  transition: border-color .2s;
}
.rsvp__input:focus { border-color: #D50100; border-color: var(--red); }
.rsvp__group { display: flex; flex-direction: column; }
.rsvp__option { display: flex; align-items: center; cursor: pointer; font-size: 16px; }
.rsvp__option + .rsvp__option { margin-top: 9px; }
.rsvp__option input { width: 17px; height: 17px; margin-right: 10px; accent-color: #D50100; accent-color: var(--red); cursor: pointer; }
.rsvp .btn--wide { margin-top: 36px; }
.rsvp__status { text-align: center; margin-top: 16px; min-height: 1.5em; font-size: 15px; }
.rsvp__status.error { color: #D50100; color: var(--red); }

/* ============================================================
   Финал
   ============================================================ */
.footer { text-align: center; padding-top: 130px; }
.footer__line { font-size: 19px; font-size: clamp(17px, 2.4vw, 21px); }
.names--footer { font-size: 72px; font-size: clamp(52px, 9vw, 96px); margin: 26px 0 10px; }
.footer__photos {
  display: flex; justify-content: center;
  position: relative; z-index: 1; margin-top: 20px;
}
.footer__photos .polaroid { width: 200px; max-width: 40vw; }
.footer__photos .polaroid:last-child { margin-left: -24px; margin-top: 18px; }

/* ============================================================
   Мобильная версия
   ============================================================ */
@media (max-width: 760px) {
  .section { padding: 64px 0; }
  .invite, .venue, .dress__cols { grid-template-columns: 1fr; grid-gap: 44px; gap: 44px; }
  .envelope { margin-top: 50px; }
  .timeline { display: block; border-bottom: none; max-width: 320px; }
  .timeline__item { border-bottom: 2px solid #3F0300; border-bottom: 2px solid var(--maroon-deep); padding: 14px 0 6px; }
  .timeline__item + .timeline__item { margin-left: 0; }
  .timeline__labels { display: none; }
  .timeline__item .timeline__label { display: block; font-size: 14px; margin-top: 2px; }
  .wave { height: 90px; }
  .wave--bottom { bottom: -45px; }
  .wave--top { top: -45px; }
}
@media (min-width: 761px) {
  .timeline__item .timeline__label { display: none; }
}
