:root {
  --bg: #ffffff;
  --ink: #141414;
  --muted: #6f6a6a;
  --red: #c01d2f;
  --line: #141414;
  --soft: #f6f4f3;
  --danger: #b8302f;
  --ok: #3e6b4f;
}

@font-face {
  font-family: "Playfair Display";
  src: url("fonts/MyPlayfairDisplayFin.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Cormorant";
  src: url("fonts/MyCormorant-Regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Bickham";
  src: url("fonts/Bickham_Script_Pro_3.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Jost";
  src: url("fonts/Jost-300-0.ttf") format("truetype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Jost";
  src: url("fonts/Jost-400-1.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Jost";
  src: url("fonts/Jost-500-2.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Cormorant", Georgia, "Times New Roman", serif;
  font-weight: 400;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

.page { max-width: 820px; margin: 0 auto; padding: 0 18px; }

/* ---------- общие элементы ---------- */
.rule {
  width: 130px;
  height: 1px;
  background: var(--line);
  margin: 0 auto 30px;
}
.rule-red { background: var(--red); }

.section { padding: 52px 6px; text-align: center; }

.big-title {
  margin: 0;
  font-family: "Playfair Display", "Cormorant", Georgia, serif;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: clamp(34px, 7vw, 60px);
  line-height: 1.12;
  color: var(--ink);
}

.script-sub {
  margin: 10px 0 0;
  font-family: "Bickham", "Cormorant", cursive;
  font-size: clamp(32px, 6.2vw, 50px);
  line-height: 1.1;
  color: var(--red);
}

.script-title {
  margin: 0 0 28px;
  font-family: "Bickham", "Cormorant", cursive;
  font-weight: 400;
  font-size: clamp(44px, 9vw, 76px);
  line-height: 1.05;
  color: var(--ink);
}

.caps-text {
  margin: 0 auto 30px;
  max-width: 620px;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  font-size: clamp(15px, 2vw, 19px);
  line-height: 2.05;
  color: var(--ink);
}
.caps-small {
  margin: 0 auto 8px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 14px;
  line-height: 2.15;
  color: var(--ink);
}
.caps-address { margin-bottom: 0; }

/* ---------- HERO ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  text-align: center;
  padding: 90px 22px 15vh;
  color: #fff;
  background:
    linear-gradient(rgba(15, 10, 10, 0.22), rgba(15, 10, 10, 0.52)),
    url("/image/me/1.JPG") center 24% / cover no-repeat;
}
.hero-inner { max-width: 720px; }

.monogram {
  font-family: "Bickham", "Cormorant", cursive;
  font-size: clamp(104px, 21vw, 168px);
  line-height: 0.92;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.32);
}

.hero-names {
  margin: 24px 0 0;
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-size: clamp(21px, 4.4vw, 36px);
  line-height: 1.4;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.4);
}

.hero-date {
  margin: 30px 0 0;
  font-family: "Cormorant", Georgia, serif;
  letter-spacing: 0.34em;
  font-size: clamp(19px, 3.2vw, 28px);
  color: rgba(255, 255, 255, 0.97);
}

.hero-scroll {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  opacity: 0.9;
  animation: bob 2.2s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 8px); }
}

/* ---------- ПРИГЛАШЕНИЕ ---------- */
.script-date {
  margin: 14px 0 0;
  font-family: "Bickham", "Cormorant", cursive;
  font-size: clamp(42px, 8vw, 64px);
  line-height: 1.1;
  color: var(--ink);
}

.venue-title {
  margin: 20px 0 16px;
  font-family: "Playfair Display", Georgia, serif;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: clamp(17px, 2.6vw, 23px);
  line-height: 1.6;
}

/* «Как добраться» — плотнее к разделителю */
.route { padding-top: 26px; }

/* ---------- ФОТО-СЛАЙДЕР ---------- */
.photo-slider {
  position: relative;
  margin: 10px 0 22px;
}
.ps-track { position: relative; }
.ps-slide {
  display: none;
  width: 100%;
  max-height: 500px;
  object-fit: cover;
  border-radius: 4px;
}
.ps-slide.is-active { display: block; }

.ps-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: rgba(20, 20, 20, 0.35);
  color: #fff;
  border-radius: 50%;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(2px);
  transition: background 0.2s;
}
.ps-arrow:hover { background: rgba(20, 20, 20, 0.6); }
.ps-prev { left: 12px; }
.ps-next { right: 12px; }

/* ---------- КАРТА ---------- */
.map-wrap {
  margin: 24px 0 0;
  overflow: hidden;
  border: 1px solid #e6e1e1;
}
.map { display: block; width: 100%; height: 360px; border: 0; }

.btn-map {
  display: inline-block;
  margin-top: 22px;
  padding: 15px 42px;
  border: 1px solid var(--ink);
  color: var(--ink);
  text-decoration: none;
  font-family: "Jost", Arial, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 13px;
  transition: all 0.2s;
}
.btn-map:hover { background: var(--ink); color: #fff; }

/* ---------- ТАЙМИНГ ---------- */
.timing-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 28px 18px;
  margin: 42px 0 0;
}
.timing-item { text-align: center; }

.t-time {
  display: block;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(22px, 3.6vw, 30px);
  letter-spacing: 0.04em;
  line-height: 1.2;
}
.t-title {
  display: block;
  margin-top: 8px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 13px;
  line-height: 1.6;
}
.t-desc {
  display: block;
  margin-top: 7px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--muted);
}

.mic-note {
  margin: 48px auto 0;
  max-width: 560px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 12.5px;
  line-height: 1.9;
  color: var(--muted);
}
.mic-note b { color: var(--ink); font-weight: 500; }

/* ---------- ОБРАТНЫЙ ОТСЧЁТ ---------- */
.timer {
  display: flex;
  justify-content: center;
  gap: clamp(22px, 5vw, 54px);
  margin: 42px 0 0;
}
.timer-cell { text-align: center; min-width: 56px; }
.t-num {
  display: block;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(34px, 6.6vw, 52px);
  line-height: 1.1;
}
.t-label {
  display: block;
  margin-top: 5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 11.5px;
  color: var(--muted);
}

/* ---------- ПОЖЕЛАНИЯ ---------- */
.wish-slider {
  position: relative;
  max-width: 640px;
  margin: 36px auto 0;
  padding: 0 56px;
}
.wish-track {
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wish-slide {
  display: none;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 14px;
  line-height: 2.1;
}
.wish-slide.is-active { display: block; }

.wish-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border: 1px solid #ded8d8;
  background: #fff;
  color: var(--ink);
  border-radius: 50%;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.2s;
}
.wish-arrow:hover { border-color: var(--ink); }
.wish-arrow-left { left: 0; }
.wish-arrow-right { right: 0; }

/* ---------- БЕСЕДА ГОСТЕЙ ---------- */
.qr-wrap {
  display: flex;
  justify-content: center;
  margin: 30px 0 22px;
}
.qr-wrap img {
  width: 200px;
  height: 200px;
  padding: 10px;
  background: #fff;
  border: 1px solid #e6e1e1;
}
.btn-chat {
  display: inline-block;
  padding: 15px 38px;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  font-family: "Jost", Arial, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 13px;
  transition: background 0.2s;
}
.btn-chat:hover { background: #000; }

/* ---------- АНКЕТА ---------- */
.rsvp { padding-bottom: 40px; }
.rsvp-deadline { margin: 28px auto 42px; }

.card {
  text-align: left;
  border: 1px solid #e6e1e1;
  border-radius: 4px;
  padding: 26px 24px;
  margin-bottom: 16px;
}

.field { display: block; margin-bottom: 20px; }
.field-label {
  display: block;
  margin-bottom: 9px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12.5px;
  color: var(--ink);
}
.req { color: var(--danger); }

input[type="text"], textarea {
  width: 100%;
  padding: 12px 2px;
  border: none;
  border-bottom: 1px solid #d8d2d2;
  background: transparent;
  font-family: "Jost", Arial, sans-serif;
  font-size: 16px;
  color: var(--ink);
  border-radius: 0;
  transition: border-color 0.2s;
}
input[type="text"]:focus, textarea:focus {
  outline: none;
  border-bottom-color: var(--ink);
}
textarea { resize: vertical; }

fieldset { border: 0; padding: 0; margin: 0 0 20px; }
legend { padding: 0; margin-bottom: 9px; }

.radio {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  cursor: pointer;
  font-family: "Jost", Arial, sans-serif;
  font-size: 15px;
}
.radio input { accent-color: var(--ink); width: 17px; height: 17px; }

.chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.chip span {
  display: inline-block;
  padding: 9px 16px;
  border: 1px solid #d8d2d2;
  font-family: "Jost", Arial, sans-serif;
  font-size: 14px;
  color: var(--muted);
  transition: all 0.15s;
  user-select: none;
}
.chip input:checked + span {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.guest-card .remove {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-family: "Jost", Arial, sans-serif;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 2px 0;
}
.guest-card .card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.card-title {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 12.5px;
}

.btn-add {
  display: block;
  margin: 0 auto 22px;
  padding: 13px 28px;
  border: 1px dashed #c9c2c2;
  background: transparent;
  color: var(--ink);
  font-family: "Jost", Arial, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-add:hover { border-color: var(--ink); }
.btn-add .plus { font-size: 16px; }

.comment { margin-top: 4px; }

.btn-submit {
  width: 100%;
  padding: 17px;
  border: none;
  background: var(--ink);
  color: #fff;
  font-family: "Jost", Arial, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.btn-submit:hover { background: #000; transform: translateY(-1px); }
.btn-submit:disabled { opacity: 0.6; cursor: wait; transform: none; }

.form-msg { min-height: 22px; text-align: center; font-family: "Jost", Arial, sans-serif; font-size: 14px; margin: 14px 0 0; }
.form-msg.ok { color: var(--ok); }
.form-msg.err { color: var(--danger); }

/* ---------- FOOTER ---------- */
.foot { text-align: center; padding: 10px 6px 70px; }
.foot .rule { margin-bottom: 36px; }
.foot .script-sub { margin-bottom: 14px; }

/* ---------- ДРЕСС-КОД ---------- */
.dc-script-title {
  margin: 0 0 26px;
  font-family: "Bickham", "Cormorant", cursive;
  font-weight: 400;
  font-size: clamp(54px, 12vw, 100px);
  line-height: 1;
  color: var(--ink);
}

.dc-gender { margin: 8px auto 0; max-width: 560px; }
.dc-label {
  margin: 26px 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: 13px;
  color: var(--ink);
}
.dc-value {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 15px;
  line-height: 1.9;
  color: var(--ink);
}

.dc-dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin: 40px 0 0;
}
.dc-dot {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.16), inset 0 0 0 1px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease;
}
.dc-dot:hover { transform: translateY(-4px) scale(1.05); }

.dc-any {
  margin: 34px auto 0;
  max-width: 460px;
  line-height: 2;
}

/* ---------- ЭКРАН ЗАГРУЗКИ ---------- */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: #6d0f19;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
.preloader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.preloader-inner { padding: 0 24px; }
.preloader-ring {
  width: 54px;
  height: 54px;
  margin: 0 auto 20px;
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-top-color: #fff;
  border-radius: 50%;
  animation: preloader-spin 1s linear infinite;
}
@keyframes preloader-spin {
  to { transform: rotate(360deg); }
}
.preloader-text {
  margin: 0;
  font-family: "Jost", Arial, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.92);
}

/* ---------- ОБЛОЖКА ---------- */
body.cover-open { overflow: hidden; }

.cover {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #6d0f19;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
.cover.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.cover-collage { position: absolute; inset: 0; pointer-events: none; }

.polaroid {
  position: absolute;
  margin: 0;
  background: #fdfdfd;
  padding: 5px 5px 20px;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.4);
  filter: grayscale(1) contrast(1.05);
  opacity: 0.92;
}
.polaroid img { width: 100%; display: block; }

.cover-content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: #fff;
  padding: 0 24px;
  max-width: 640px;
}

.cover-script {
  margin: 0;
  font-family: "Bickham", "Cormorant", cursive;
  font-size: clamp(58px, 13vw, 108px);
  line-height: 1;
  color: #fff;
  text-shadow: 0 3px 26px rgba(0, 0, 0, 0.4);
}

.cover-caps {
  margin: 20px 0 0;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: clamp(16px, 3.2vw, 24px);
  line-height: 1.55;
  color: #fff;
}

.cover-swipe {
  position: relative;
  margin: 48px auto 0;
  width: min(320px, 82vw);
  height: 56px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  user-select: none;
  touch-action: none;
  overflow: hidden;
}
.swipe-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 46px;
  color: #fff;
  font-family: "Jost", Arial, sans-serif;
  font-size: 15px;
  letter-spacing: 0.05em;
  pointer-events: none;
}
.swipe-knob {
  position: absolute;
  left: 6px;
  top: 6px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  color: #141414;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  cursor: grab;
  touch-action: none;
  z-index: 2;
  transition: transform 0.25s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}
.swipe-knob.is-dragging { cursor: grabbing; }

/* ---------- МУЗЫКА ---------- */
.music-toggle {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  z-index: 1200;
  width: 46px;
  height: 46px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(20, 20, 20, 0.14);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  cursor: pointer;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  transition: opacity 0.35s ease, transform 0.2s ease, background 0.2s ease,
    visibility 0.35s ease;
}
.music-toggle[hidden] { display: none; }
.music-toggle:hover { background: #fff; transform: scale(1.06); }
.music-toggle:active { transform: scale(0.95); }
.music-toggle:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

/* Пока обложка открыта, кнопка не нужна — музыка ещё не играет */
body.cover-open .music-toggle {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.music-icon { display: none; }
.music-toggle.is-on .music-icon-on { display: block; }
.music-toggle.is-off .music-icon-off { display: block; }

/* ---------- адаптив ---------- */
@media (max-width: 560px) {
  .hero-names { letter-spacing: 0.18em; }
  .hero { padding-bottom: 12vh; }
  .section { padding: 44px 4px; }
  .map { height: 290px; }
  .timer { gap: 18px; }
  .wish-slider { padding: 0 44px; }
  .wish-arrow { width: 34px; height: 34px; font-size: 14px; }
  .caps-text { letter-spacing: 0.09em; }
  .ps-arrow { width: 38px; height: 38px; font-size: 14px; }
  .dc-dot { width: 48px; height: 48px; }
  .music-toggle {
    width: 42px;
    height: 42px;
    top: max(12px, env(safe-area-inset-top));
    right: max(12px, env(safe-area-inset-right));
  }
}
