/* ============================================================
   Палитра: розовый + бардо + белый + нежно-зелёный.
   Базовые цвета берутся из config.js (theme), остальные
   оттенки заданы здесь.
   ============================================================ */

:root {
  --accent: #8ba86c;        /* из config.js (нежно-зелёный) */
  --bg: #fdf8fa;            /* из config.js (белый с розовым) */
  --text: #2e3a2b;          /* из config.js (тёмный зелёный) */

  --heading: #466235;       /* зелёный — заголовки */
  --leaf: #a7c48a;          /* нежно-зелёный — листики */
  --line: #eccfdc;          /* нежно-розовый — линии-разделители */
  --num: #8aac6e;           /* зелёный — цифры отсчёта */
  --muted-green: #7a9a60;   /* приглушённый зелёный — подписи */
  --pill-bg: #f3d5e0;       /* светло-розовый — кнопки */
  --pill-text: #3a5428;     /* зелёный — текст на кнопках */
  --pill-border: #e5b9ca;   /* розовый — рамки кнопок */
  --card-border: rgba(200, 130, 160, .3);
  --input-line: #e5c3d2;
  --input-focus: #c75b7f;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: "Inter", system-ui, sans-serif;
  font-weight: 300;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  overflow-x: hidden;
}

h1, h2, .serif, .num, .tl-time, .venue-name, .venue-start-value,
.wish-title, .footer-names, .form-success-title {
  font-family: "Playfair Display", Georgia, serif;
}

h2 {
  font-size: clamp(1.9rem, 4.5vw, 2.9rem);
  font-weight: 400;
  letter-spacing: .03em;
  text-align: center;
  color: var(--heading);
}

#welcome-title { color: #5a4a50; margin-bottom: 2.5rem; }
#schedule h2 { color: #5a4a50; }

.italic { font-style: italic; }
.text-center { text-align: center; }
.mb-16 { margin-bottom: 3.5rem; }
.hidden { display: none !important; }

/* --- Анимация появления --- */
.fade-up {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .7s cubic-bezier(.2, .9, .4, 1.1), transform .7s ease;
}
.fade-up.visible { opacity: 1; transform: translateY(0); }

/* --- Разделитель с листиком --- */
.divider-plant {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  width: 12rem;
  margin: 1.2rem auto 1.8rem;
}
.divider-plant::before,
.divider-plant::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line), var(--line), transparent);
}
.divider-leaf {
  display: inline-block;
  width: 28px;
  height: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A7C48A' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2C8 6 6 10 6 14c0 4 2 6 6 6s6-2 6-6c0-4-2-8-6-12z'/%3E%3Cpath d='M12 2v20'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  opacity: .55;
}
.divider-leaf-light {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23DFA8BE' stroke-width='1'%3E%3Cpath d='M12 2C8 6 6 10 6 14c0 4 2 6 6 6s6-2 6-6c0-4-2-8-6-12z'/%3E%3C/svg%3E");
}

/* --- Элегантный разделитель между секциями --- */
.elegant-divider {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  margin: 0 auto;
  width: 100%;
  max-width: 400px;
  padding: 0 1.5rem;
}
.elegant-divider .line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, #5a4a50, #5a4a50, transparent);
}
.elegant-divider .diamond {
  width: 6px;
  height: 6px;
  background: #5a4a50;
  transform: rotate(45deg);
  border-radius: 1px;
}

/* --- Обложка (стиль Romantic Pastel) --- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  /* фото задаётся из main.js; без фото — пастельный градиент */
  background: linear-gradient(160deg, #fdf0f0 0%, #f4ebf8 50%, #e8f0eb 100%);
  background-size: cover;
  background-position: 60% 55%;
  padding: 5rem 1.5rem;
}

.hero-inner { position: relative; z-index: 1; max-width: 1100px; margin-bottom: 12vh; }

/* пастельные «лепестки» по углам */
.hero-petal {
  position: absolute;
  border-radius: 50% 0;
  opacity: .18;
  pointer-events: none;
}
.hero-petal-1 { width: 320px; height: 320px; background: #f2c4c4; top: -60px; left: -80px; transform: rotate(25deg); }
.hero-petal-2 { width: 240px; height: 240px; background: #d4c5e8; bottom: -40px; right: -60px; transform: rotate(-15deg); }
.hero-petal-3 { width: 180px; height: 180px; background: #b8d8c8; top: 30%; left: -40px; transform: rotate(45deg); opacity: .1; }

/* мелкий лейбл с ✦ по бокам */
.hero-label {
  font-size: .68rem;
  font-weight: 400;
  letter-spacing: .45em;
  text-transform: uppercase;
  color: #5a4a50;
  margin-bottom: 2.5rem;
}

/* имена — каллиграфия */
.hero-names {
  font-family: "Marck Script", "Cormorant Garamond", cursive;
  font-size: clamp(4rem, 14vw, 9rem);
  font-weight: 400;
  line-height: 1;
  color: #5a4a50;
}

/* линии с амперсандом между именами */
.petal-rule {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 16rem;
  margin: 1rem auto;
}
.petal-rule::before,
.petal-rule::after {
  content: "";
  flex: 1;
  max-width: 100px;
  height: 1px;
  background: linear-gradient(to right, transparent, #5a4a50);
}
.petal-rule::after { background: linear-gradient(to left, transparent, #5a4a50); }
.hero-amp {
  font-family: "Marck Script", cursive;
  font-size: 1.9rem;
  color: #5a4a50;
}

/* дата в пилюле с рамкой */
.hero-date-pill {
  display: inline-block;
  margin-top: 2.5rem;
  padding: .8rem 2.5rem;
  border: 1px solid #5a4a50;
  border-radius: 999px;
}
.hero-date-pill p {
  letter-spacing: .25em;
  font-size: 1rem;
  font-weight: 400;
  color: #5a4a50;
}

/* плавный переход внизу к фону страницы */
.hero-bottom-fade {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 8rem;
  background: linear-gradient(to top, var(--bg), transparent);
  pointer-events: none;
}

/* --- Секции --- */
.section {
  max-width: 860px;
  margin: 0 auto;
  padding: 5.5rem 1.5rem;
  text-align: center;
}

.section-wide {
  max-width: 1180px;
  margin: 0 auto;
  padding: 5.5rem 1.5rem;
}

.lead {
  font-size: 1.08rem;
  color: #5a4a50;
  max-width: 640px;
  margin: 0 auto;
}

/* --- Мягкая карточка --- */
.soft-card {
  background: rgba(255, 255, 255, .8);
  backdrop-filter: blur(1px);
  border-radius: 2rem;
  box-shadow: 0 12px 28px -10px rgba(107, 21, 38, .06);
  border: 1px solid var(--card-border);
  transition: all .35s ease;
}
.soft-card:hover {
  box-shadow: 0 22px 35px -14px rgba(107, 21, 38, .12);
  border-color: rgba(199, 91, 127, .4);
  transform: translateY(-3px);
}

/* --- Место проведения --- */
.venue-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: center;
}
@media (min-width: 820px) {
  .venue-grid { grid-template-columns: 1fr 1fr; gap: 3.5rem; }
  .venue-info h2 { text-align: left; }
}

.venue-photo { overflow: hidden; padding: 0; }
.venue-photo img {
  width: 100%;
  height: 460px;
  object-fit: cover;
  display: block;
  border-radius: 2rem;
  transition: transform .7s;
}
.venue-photo:hover img { transform: scale(1.05); }

.venue-info h2 { font-weight: 500; color: #5a4a50; }

.venue-name {
  font-size: clamp(1.5rem, 3.5vw, 1.9rem);
  font-weight: 300;
  letter-spacing: .03em;
  color: #5a4a50;
  margin-top: .8rem;
}

.venue-rule { width: 48px; height: 1px; background: #8b3a4a; margin: 1rem auto; }
@media (min-width: 820px) { .venue-rule { margin: 1rem 0; } }

.venue-address {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  font-style: italic;
  color: #5a4a50;
}
@media (min-width: 820px) { .venue-address { justify-content: flex-start; } }

.venue-text { color: #5a4a50; font-size: 1.05rem; margin-top: .8rem; }

.venue-start {
  background: rgba(255, 255, 255, .6);
  backdrop-filter: blur(1px);
  padding: 1.4rem 1.6rem;
  border-radius: 1.2rem;
  border: 1px solid #8b3a4a;
  box-shadow: 0 4px 14px -8px rgba(107, 21, 38, .12);
  margin-top: 1.6rem;
}
.venue-start-label {
  color: #5a4a50;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .72rem;
}
.venue-start-value {
  font-size: clamp(1.5rem, 3.5vw, 1.9rem);
  color: #5a4a50;
}

/* --- Карта --- */
.map-section { width: 100%; height: 500px; position: relative; }
@media (min-width: 820px) { .map-section { height: 600px; } }

.map-route { padding: 2rem 1.5rem; text-align: center; }
#map { width: 100%; height: 100%; }

/* --- Тайминг дня --- */
.tl-day { position: relative; margin-bottom: 4rem; }
.tl-day:last-child { margin-bottom: 0; }

.tl-day-label {
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .3em;
  color: #5a4a50;
  font-weight: 600;
  margin-bottom: 2rem;
  padding-left: 1.5rem;
}
@media (min-width: 820px) { .tl-day-label { padding-left: 0; } }

@media (min-width: 820px) {
  .tl-day::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 4.5rem;
    bottom: 0;
    width: 1px;
  background: linear-gradient(to bottom, #5a4a50, #5a4a50, transparent);
  }
}

.tl-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: .4rem;
  margin-bottom: 2.5rem;
  position: relative;
}
.tl-item:last-child { margin-bottom: 0; }

.tl-time {
  font-size: 1.5rem;
  font-weight: 600;
  color: #5a4a50;
  background: rgba(255, 255, 255, .6);
  border-radius: 60px;
  box-shadow: 0 2px 8px -2px rgba(107, 21, 38, .08);
  padding: .15rem 1.3rem;
}

.tl-dot {
  display: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #5a4a50;
  border: 1px solid #fff;
  box-shadow: 0 2px 6px rgba(107, 21, 38, .2);
  position: relative;
  z-index: 1;
}

.tl-title { font-size: 1.2rem; font-weight: 500; color: #5a4a50; }

@media (min-width: 820px) {
  .tl-item {
    flex-direction: row;
    text-align: left;
    gap: 0;
  }
  .tl-time-wrap {
    width: 50%;
    text-align: right;
    padding-right: 3rem;
  }
  .tl-dot { display: block; flex-shrink: 0; }
  .tl-title-wrap { width: 50%; padding-left: 3rem; }
}

/* --- Обратный отсчёт --- */
.countdown { padding: 5.5rem 1.5rem; text-align: center; }

.countdown-title { text-transform: uppercase; letter-spacing: .08em; }

.countdown-grid {
  display: flex;
  justify-content: center;
  gap: clamp(.9rem, 4vw, 2.5rem);
  flex-wrap: wrap;
  margin-top: 2rem;
}

.cd-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255, 255, 255, .6);
  backdrop-filter: blur(1px);
  border-radius: 1.2rem;
  border: 1px solid #f0d3de;
  box-shadow: 0 4px 14px -6px rgba(107, 21, 38, .07);
  padding: 1.1rem 1.4rem;
  min-width: 100px;
}

.cd-card .num { font-size: clamp(2.6rem, 8vw, 4rem); line-height: 1.1; color: var(--num); }

.cd-card .lbl {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .2em;
  color: var(--muted-green);
  margin-top: .4rem;
}

/* --- Пожелания --- */
.wishes-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2.5rem;
  margin-top: 3rem;
}

.wish-card {
  width: 100%;
  text-align: center;
  padding: 1.8rem;
  border: 1px solid rgba(199, 91, 127, .22);
  border-radius: 1.5rem;
  background: #fff;
  box-shadow: 0 12px 28px -14px rgba(107, 21, 38, .14);
  transition: all .3s ease;
}
.wish-card:hover { transform: translateY(-3px); }
@media (min-width: 820px) { .wish-card { width: calc(33.333% - 2.5rem); } }

.wish-title {
  font-size: 1.8rem;
  font-style: italic;
  color: #2c3e2b;
  margin-bottom: 1rem;
}

.wish-text { color: rgba(44, 43, 40, .7); line-height: 1.65; }

.wish-colors {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.4rem;
}
.wish-color {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .5);
  box-shadow: 0 4px 10px rgba(0, 0, 0, .12);
}

/* --- RSVP форма --- */
.rsvp-card { padding: 2.5rem 1.6rem; border-color: #f0d3de; }
@media (min-width: 768px) { .rsvp-card { padding: 3.2rem 3rem; } }

.rsvp-note {
  text-align: center;
  font-style: italic;
  color: #88a36b;
  margin-bottom: 2.2rem;
}

.rsvp-form { max-width: 560px; margin: 0 auto; text-align: left; }

.rsvp-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
@media (min-width: 700px) { .rsvp-row { grid-template-columns: 1fr 1fr; } }

.field { position: relative; margin-bottom: 1.5rem; }

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 1rem;
  border: none;
  border-bottom: 1px solid var(--input-line);
  border-radius: 0;
  font: inherit;
  background: transparent;
  color: #486236;
  transition: border-color .2s;
}
.field textarea { min-height: 120px; resize: none; display: block; }

.field input:focus,
.field textarea:focus,
.field select:focus { outline: none; border-bottom-color: var(--input-focus); }

.field label {
  position: absolute;
  left: 1rem;
  top: 1rem;
  color: #8aa66c;
  font-size: .95rem;
  pointer-events: none;
  transition: all .2s;
}
.field input:focus ~ label,
.field input:not(:placeholder-shown) ~ label,
.field textarea:focus ~ label,
.field textarea:not(:placeholder-shown) ~ label {
  top: -1rem;
  font-size: .72rem;
  color: #7c9f60;
}

.rsvp-submit {
  width: 100%;
  padding: 1.05rem;
  letter-spacing: .2em;
  box-shadow: 0 6px 16px -8px rgba(107, 21, 38, .3);
  font-size: .82rem;
  margin-top: .5rem;
}

.form-success {
  text-align: center;
  padding: 2.5rem;
  background: #f9e4ec;
  border-radius: 1.2rem;
  margin-top: 1.5rem;
  animation: fadeIn .5s ease;
}
.form-success-title { font-size: 1.8rem; color: #8bae6a; margin-bottom: .4rem; }
.form-success p:last-child { color: #5c7846; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Плейлист --- */
.alt-width {
  max-width: none;
  background: #fdf1f5;
}
.alt-width > * { max-width: 720px; margin-left: auto; margin-right: auto; }

.playlist-text { color: #86a269; font-size: 1.08rem; margin-bottom: 2rem; }

.playlist-field {
  position: relative;
  max-width: 440px;
  margin: 0 auto;
}
.playlist-field input {
  width: 100%;
  padding: 1rem 7.5rem 1rem 1.2rem;
  border-radius: 60px;
  border: 1px solid #ecc3d3;
  font: inherit;
  background: rgba(255, 255, 255, .8);
  box-shadow: inset 0 2px 6px rgba(107, 21, 38, .05);
  color: var(--text);
}
.playlist-field input:focus { outline: none; border-color: #d98ba7; }
.playlist-field button {
  position: absolute;
  right: 8px;
  top: 8px;
  bottom: 8px;
  padding: 0 1.3rem;
  background: #f3d5e0;
  color: #4c6b38;
  border: none;
  border-radius: 60px;
  font: inherit;
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .25s;
}
.playlist-field button:hover { background: #e5b9ca; }

/* --- Кнопки --- */
.btn {
  display: inline-block;
  margin-top: 1.8rem;
  padding: .85rem 2.2rem;
  background: #faf0f4;
  color: #4a5c3e;
  border: 1px solid #eccfda;
  border-radius: 60px;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .78rem;
  font-weight: 500;
  transition: all .25s;
  cursor: pointer;
}
.btn:hover { background: #f3dde6; color: #3a4a2e; border-color: #dfa8be; transform: scale(1.01); }

.btn-primary {
  background: var(--pill-bg);
  color: var(--pill-text);
  border: 1px solid var(--pill-border);
}
.btn-primary:hover { background: #e5b9ca; border-color: #d99ab2; transform: translateY(-2px); }

/* --- Подвал --- */
.footer {
  position: relative;
  text-align: center;
  padding: 4rem 1.5rem;
  background: rgba(255, 255, 255, .8);
}
.footer-topline {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, #ecc3d3, transparent);
}
.footer-leaf { display: flex; justify-content: center; margin-bottom: 1.2rem; }
.footer-names { font-size: clamp(1.9rem, 5vw, 2.5rem); color: #51723e; }
.footer-tagline {
  margin-top: .5rem;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .3em;
  color: #96b47a;
}

/* --- Скроллбар --- */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: #f9ecf2; }
::-webkit-scrollbar-thumb { background: #e0b3c6; border-radius: 10px; }

@media (max-width: 520px) {
  .section, .section-wide { padding: 4rem 1.2rem; }
  .venue-photo img { height: 300px; }
}

/* --- Стартовый экран (приглашение-«конверт») --- */
body.intro-open { overflow: hidden; }

.intro {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: opacity .7s ease, transform .7s ease, visibility 0s linear .7s;
}
.intro.closing {
  opacity: 0;
  transform: translateY(-30px) scale(1.02);
  pointer-events: none;
  visibility: hidden;
}

.intro-bg {
  position: absolute;
  inset: 0;
  /* contain — коллаж виден целиком; полосы по краям сливаются
     с подложкой в цвет фона коллажа (бардо) */
  background-color: #6b1526;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
}
/* затемнение для читаемости текста */
.intro-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(43, 10, 20, .42), rgba(43, 10, 20, .22) 40%, rgba(43, 10, 20, .52));
}

.intro-content {
  position: relative;
  z-index: 1;
  padding: 2rem 1.5rem;
  color: #fff;
  animation: introFadeUp 1.2s ease .2s both;
}
@keyframes introFadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.intro-title {
  font-family: "Playfair Display", Georgia, serif;
  font-style: italic;
  font-weight: 500;
  font-size: clamp(2.2rem, 7vw, 4rem);
  text-shadow: 0 2px 24px rgba(0, 0, 0, .45);
}
.intro-text {
  margin-top: 1rem;
  font-size: clamp(.85rem, 2.5vw, 1.05rem);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: .28em;
  text-shadow: 0 1px 12px rgba(0, 0, 0, .5);
}

/* Слайдер «протяни, чтобы открыть» (как разблокировка телефона) */
.intro-slider {
  position: relative;
  margin: 2.6rem auto 0;
  width: min(340px, 82vw);
  height: 58px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .75);
  background: rgba(255, 255, 255, .14);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.intro-slider-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 34px; /* отступ от ручки */
  font-size: .78rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .2em;
  pointer-events: none;
  /* бегущий блик */
  background: linear-gradient(90deg, rgba(255, 255, 255, .45) 20%, #fff 50%, rgba(255, 255, 255, .45) 80%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: introShimmer 2.4s linear infinite;
}
@keyframes introShimmer {
  from { background-position: 160% 0; }
  to   { background-position: -160% 0; }
}
.intro-knob {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 50px;
  height: 50px;
  border: none;
  border-radius: 50%;
  background: #fff;
  color: #8a2440;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .35);
  will-change: transform;
}
.intro-knob:active { cursor: grabbing; }
