:root {
  --rose: #d9a6a0;
  --rose-light: #e8c5c0;
  --cream: #faf6f0;
  --cream-dark: #f0e7da;
  --sage: #a3b18a;
  --sage-light: #cfd8b8;
  --ink: #5a514a;
  --ink-soft: #837971;
  --serif: "Cormorant Garamond", serif;
  --display: "Playfair Display", serif;
  --script: "Marck Script", cursive;
  --shadow: 0 18px 50px rgba(120, 100, 90, 0.15);

  /* Рваные края бумаги (маски) */
  --tear-a: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%201440%2070'%20preserveAspectRatio='none'%3E%3Cpath%20d='M0,70%20L0,34%20C70,12%20140,40%20210,26%20S330,4%20420,28%20S560,48%20650,22%20S800,2%20900,30%20S1050,50%201140,24%20S1300,6%201380,32%20S1430,34%201440,22%20L1440,70%20Z'%20fill='%23000'/%3E%3C/svg%3E");
  --tear-b: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%201440%2070'%20preserveAspectRatio='none'%3E%3Cpath%20d='M0,70%20L0,20%20L60,38%20L130,16%20L200,40%20L280,18%20L360,44%20L440,22%20L520,46%20L610,20%20L700,42%20L790,18%20L880,44%20L970,22%20L1060,46%20L1150,20%20L1240,42%20L1330,18%20L1410,40%20L1440,24%20L1440,70%20Z'%20fill='%23000'/%3E%3C/svg%3E");
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--serif);
  color: var(--ink);
  background: var(--cream);
  font-size: 18px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}
.container--narrow { max-width: 620px; }

/* ---------- Навигация ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(250, 246, 240, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(163, 177, 138, 0.2);
}
.nav__inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav__logo {
  font-family: var(--display);
  font-size: 22px;
  letter-spacing: 2px;
  color: var(--ink);
  text-decoration: none;
}
.nav__links { display: flex; gap: 28px; }
.nav__links a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 17px;
  letter-spacing: 0.5px;
  transition: color 0.25s;
}
.nav__links a:hover { color: var(--rose); }

.nav__burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav__burger span {
  width: 26px; height: 2px;
  background: var(--ink);
  transition: 0.3s;
}

/* ---------- HERO ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}
.hero__bg {
  position: absolute;
  inset: 0;
  background: url("assets/hero.webp") top center / cover no-repeat;
  filter: blur(2.5px) brightness(1.04);
  transform: scale(1.06);
}
.hero__overlay {
  position: absolute; inset: 0;
  background:
    radial-gradient(115% 75% at 50% 44%, rgba(50, 38, 32, 0.46) 0%, rgba(50, 38, 32, 0.22) 40%, rgba(50, 38, 32, 0) 66%),
    linear-gradient(
      180deg,
      rgba(50, 38, 32, 0.28) 0%,
      rgba(50, 38, 32, 0.10) 30%,
      rgba(232, 197, 192, 0.40) 76%,
      rgba(217, 166, 160, 0.85) 92%,
      var(--rose-light) 100%
    );
}
.hero__content {
  position: relative;
  z-index: 2;
  padding: 24px;
  text-shadow: 0 2px 16px rgba(30, 22, 18, 0.55);
}
.hero__pre {
  font-size: 20px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
}
.hero__title {
  font-family: var(--display);
  font-size: clamp(56px, 13vw, 130px);
  font-weight: 500;
  line-height: 1;
  color: #fff;
  margin: 8px 0;
}
.hero__names {
  font-family: var(--script);
  font-size: clamp(34px, 8vw, 64px);
  color: #f6d7d2;
  margin: 10px 0;
}
.hero__date {
  font-size: 22px;
  letter-spacing: 4px;
  color: rgba(255, 255, 255, 0.92);
  margin-bottom: 32px;
}
.hero__scroll {
  position: absolute;
  bottom: 26px; left: 50%;
  transform: translateX(-50%);
  font-size: 26px;
  color: var(--ink-soft);
  animation: bounce 2s infinite;
  z-index: 2;
}
@keyframes bounce {
  0%,100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 10px); }
}

/* ---------- Кнопки ---------- */
.btn {
  display: inline-block;
  background: var(--rose);
  color: #fff;
  border: none;
  padding: 15px 42px;
  font-family: var(--serif);
  font-size: 18px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.3s, transform 0.2s;
}
.btn:hover { background: #c8918a; transform: translateY(-2px); }
.btn--outline {
  background: transparent;
  color: var(--sage);
  border: 1px solid var(--sage);
}
.btn--outline:hover { background: var(--sage); color: #fff; }

/* ---------- Общие секции ---------- */
section { padding: 90px 0; position: relative; }

/* ---------- Рваные переходы между блоками ---------- */
.torn-top::before {
  content: "";
  position: absolute;
  left: 0; right: 0;
  bottom: 100%;
  height: 54px;
  background-color: var(--torn-color, var(--cream));
  -webkit-mask: var(--tear-a) center / 100% 100% no-repeat;
  mask: var(--tear-a) center / 100% 100% no-repeat;
  z-index: 2;
  pointer-events: none;
}
.torn-top--cream::before { --torn-color: var(--cream); }
.torn-top--dark::before  { --torn-color: var(--cream-dark); -webkit-mask-image: var(--tear-b); mask-image: var(--tear-b); }
.torn-top--sage::before  { --torn-color: var(--sage); }
.footer { position: relative; }
.section-title {
  font-family: var(--display);
  font-size: clamp(30px, 5vw, 46px);
  font-weight: 500;
  text-align: center;
  letter-spacing: 1px;
}
.script {
  font-family: var(--script);
  font-size: 34px;
  text-align: center;
  color: var(--rose);
}
.ornament {
  text-align: center;
  color: var(--sage);
  font-size: 24px;
  margin: 14px 0 36px;
}

/* ---------- Приглашение ---------- */
.invite { background: var(--cream); text-align: center; }
.invite__text {
  max-width: 680px;
  margin: 0 auto 22px;
  font-size: 20px;
  color: var(--ink-soft);
}
.invite__sign {
  font-family: var(--script);
  font-size: 28px;
  color: var(--rose);
  margin-top: 20px;
}

/* ---------- История ---------- */
.story { background: var(--cream-dark); }

/* Редакционный коллаж (журнальная раскладка) */
.editorial {
  max-width: 940px;
  margin: 0 auto;
}

/* 1. Широкое фото со словами-ключами */
.ed-wide {
  position: relative;
  margin: 0 0 22px;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.ed-wide img {
  width: 100%;
  height: 360px;
  object-fit: cover;
  object-position: center 22%;
  display: block;
}
.ed-wide::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(40,32,28,0.10), rgba(40,32,28,0.34));
}
.ed-wide__words {
  position: absolute;
  left: 0; right: 0; bottom: 26px;
  z-index: 2;
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 0 18px;
}
.ed-wide__words span {
  color: #fff;
  font-family: var(--serif);
  font-size: clamp(15px, 2vw, 21px);
  letter-spacing: 3px;
  text-transform: uppercase;
  text-shadow: 0 2px 10px rgba(0,0,0,0.45);
}

/* 2. Письмо + портрет */
.ed-letter {
  display: flex;
  align-items: center;
  gap: 40px;
  margin-bottom: 22px;
}
.ed-letter__text {
  flex: 1;
  font-family: var(--serif);
  font-style: italic;
  font-size: 21px;
  line-height: 1.8;
  color: var(--ink);
  text-align: center;
}
.ed-portrait {
  width: 320px;
  flex-shrink: 0;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.ed-portrait img {
  width: 100%;
  height: 440px;
  object-fit: cover;
  object-position: center top;
  display: block;
  filter: grayscale(1) contrast(1.03);
  transition: filter 0.6s ease;
}
.ed-portrait img:hover { filter: grayscale(0) contrast(1); }

/* 3. Крупное фото с большим заголовком */
.ed-feature {
  position: relative;
  margin: 0;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.ed-feature img {
  width: 100%;
  height: 520px;
  object-fit: cover;
  object-position: center 20%;
  display: block;
  filter: grayscale(1) contrast(1.04);
}
.ed-feature__title {
  position: absolute;
  left: 0; right: 0; bottom: 30px;
  z-index: 2;
  text-align: center;
  line-height: 0.82;
}
.ed-feature__big {
  display: block;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(46px, 9vw, 104px);
  letter-spacing: 6px;
  text-transform: uppercase;
  color: #e7ecdf;
  text-shadow: 0 3px 18px rgba(0,0,0,0.4);
}
.ed-feature__script {
  display: inline-block;
  font-family: var(--script);
  font-size: clamp(28px, 5vw, 52px);
  color: var(--rose-light);
  margin: -8px 0;
  position: relative;
  z-index: 3;
  text-shadow: 0 2px 14px rgba(0,0,0,0.45);
}

/* Подпись и слоган под коллажем */
.ed-credit {
  text-align: center;
  margin-top: 26px;
}
.ed-credit__name {
  font-size: 16px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--sage);
}
.ed-credit__tagline {
  font-family: var(--serif);
  font-style: italic;
  font-size: 19px;
  color: var(--ink-soft);
  margin-top: 10px;
}

/* ---------- Программа ---------- */
.program { background: var(--cream); }
.program__sub {
  text-align: center;
  color: var(--ink-soft);
  letter-spacing: 2px;
  margin-bottom: 40px;
}
.timeline {
  max-width: 620px;
  margin: 0 auto;
  position: relative;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 92px; top: 6px; bottom: 6px;
  width: 2px;
  background: var(--sage-light);
}
.timeline__item {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 30px;
  position: relative;
}
.timeline__time {
  width: 70px;
  text-align: right;
  font-family: var(--display);
  font-size: 22px;
  color: var(--rose);
  flex-shrink: 0;
  padding-top: 2px;
}
.timeline__dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--rose);
  border: 3px solid var(--cream);
  box-shadow: 0 0 0 2px var(--sage-light);
  flex-shrink: 0;
  margin-top: 6px;
  z-index: 1;
}
.timeline__body h4 {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 500;
}
.timeline__body p { color: var(--ink-soft); font-size: 17px; }

/* ---------- Место ---------- */
.place { background: var(--cream-dark); }
.place__card {
  max-width: 600px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid rgba(163,177,138,0.25);
  border-radius: 6px;
  padding: 50px 40px;
  text-align: center;
  box-shadow: var(--shadow);
}
.place__name {
  font-family: var(--display);
  font-size: 34px;
  font-weight: 500;
  color: var(--rose);
}
.place__addr { font-size: 21px; margin-top: 10px; }
.place__time {
  letter-spacing: 3px;
  color: var(--sage);
  margin: 8px 0 18px;
}
.place__desc { color: var(--ink-soft); margin-bottom: 28px; }

/* ---------- Дресс-код ---------- */
.dresscode { background: var(--cream); text-align: center; }
.dresscode__text {
  max-width: 620px;
  margin: 0 auto 30px;
  color: var(--ink-soft);
  font-size: 20px;
}
.palette {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-bottom: 40px;
}
.palette__dot {
  width: 56px; height: 56px;
  border-radius: 50%;
  box-shadow: var(--shadow);
}
.dresscode__cols {
  display: flex;
  justify-content: center;
  gap: 60px;
  flex-wrap: wrap;
}
.dresscode__cols h4 {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 500;
  color: var(--rose);
  margin-bottom: 6px;
}
.dresscode__cols p { color: var(--ink-soft); max-width: 240px; }

/* ---------- Анкета ---------- */
.rsvp {
  background: var(--cream-dark);
  text-align: center;
}
.rsvp__sub { color: var(--ink-soft); margin-bottom: 36px; }
.form { text-align: left; }
.field { display: block; margin-bottom: 22px; }
.field span {
  display: block;
  margin-bottom: 8px;
  font-size: 17px;
  letter-spacing: 1px;
  color: var(--ink);
}
.field input,
.field textarea {
  width: 100%;
  font-family: var(--serif);
  font-size: 18px;
  color: var(--ink);
  background: #fff;
  border: 1px solid rgba(163,177,138,0.4);
  border-radius: 4px;
  padding: 13px 16px;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(217,166,160,0.18);
}
.field textarea { resize: vertical; }
.form__btn { width: 100%; margin-top: 8px; }
.form__btn:disabled { opacity: 0.6; cursor: default; transform: none; }

.form__success {
  display: none;
  background: #fff;
  border-radius: 6px;
  padding: 50px 30px;
  box-shadow: var(--shadow);
  animation: fadeIn 0.6s ease;
}
.form__success.show { display: block; }
.form__success-icon { font-size: 40px; color: var(--sage); }
.form__success h3 {
  font-family: var(--display);
  font-size: 30px;
  font-weight: 500;
  margin: 10px 0;
  color: var(--rose);
}
.form__success p { color: var(--ink-soft); }

/* ---------- Подвал ---------- */
.footer {
  background: var(--sage);
  color: #fff;
  text-align: center;
  padding: 60px 20px;
}
.footer__names {
  font-family: var(--script);
  font-size: 42px;
}
.footer__date { letter-spacing: 6px; margin: 6px 0 14px; font-size: 20px; }
.footer__note { opacity: 0.9; }

/* ---------- Анимация появления ---------- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal.visible { opacity: 1; transform: none; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Адаптив ---------- */
@media (max-width: 760px) {
  body { font-size: 17px; }
  section { padding: 60px 0; }

  .nav__burger { display: flex; }
  .nav__links {
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--cream);
    border-bottom: 1px solid rgba(163,177,138,0.25);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
  }
  .nav__links.open { max-height: 320px; }
  .nav__links a {
    padding: 16px 24px;
    border-top: 1px solid rgba(163,177,138,0.15);
  }

  .torn-top::before { height: 34px; }

  .ed-wide img { height: 260px; }
  .ed-wide__words { justify-content: center; gap: 6px 14px; bottom: 18px; }
  .ed-letter { flex-direction: column; gap: 26px; }
  .ed-letter__text { font-size: 19px; }
  .ed-portrait { width: 100%; }
  .ed-portrait img { height: 400px; }
  .ed-feature img { height: 380px; }

  .timeline::before { left: 70px; }
  .timeline__time { width: 56px; font-size: 19px; }

  .dresscode__cols { gap: 30px; }
  .palette__dot { width: 44px; height: 44px; }
}
