:root {
  --cream: #f5ebe0;
  --sand: #e8ddca;
  --sage: #a3b18a;
  --olive: #6b705c;
  --rose: #c9ada7;
  --ink: #3f3a34;
  --muted: #8a8178;
  --white: #fffdf9;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Montserrat", system-ui, sans-serif;
  --maxw: 1100px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  font-weight: 300;
  color: var(--ink);
  background: var(--cream);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}
.narrow { max-width: 720px; }

.section {
  padding: clamp(64px, 12vw, 130px) 0;
  text-align: center;
}
.section--soft { background: var(--white); }

.script {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2rem, 6vw, 3.4rem);
  letter-spacing: 0.5px;
  margin-bottom: 0.5em;
  color: var(--olive);
}

.lead {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--ink);
  max-width: 36ch;
  margin: 0 auto;
}

/* ---------------- HERO ---------------- */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(24px, 4vw, 44px);
  padding: 64px 24px 72px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(130% 90% at 50% -10%, var(--white), var(--cream) 60%),
    repeating-linear-gradient(135deg, rgba(255,255,255,0.4) 0 2px, transparent 2px 6px);
}
/* декоративные веточки в углах для праздничного настроения */
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  width: clamp(120px, 22vw, 260px);
  height: clamp(120px, 22vw, 260px);
  background-repeat: no-repeat;
  background-size: contain;
  opacity: 0.5;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><g fill='none' stroke='%23a3b18a' stroke-width='1.4' stroke-linecap='round'><path d='M50 95 C50 70 45 50 30 30'/><path d='M44 70 C30 66 22 56 20 44'/><path d='M46 56 C34 54 26 46 24 36'/><path d='M48 44 C40 42 34 36 32 28'/><path d='M50 95 C50 70 55 50 70 30'/><path d='M56 70 C70 66 78 56 80 44'/><path d='M54 56 C66 54 74 46 76 36'/><path d='M52 44 C60 42 66 36 68 28'/></g><g fill='%23c9ada7'><circle cx='30' cy='30' r='3'/><circle cx='70' cy='30' r='3'/><circle cx='50' cy='22' r='3.4'/></g></svg>");
}
.hero::before { top: 10px; left: 12px; transform: rotate(8deg); }
.hero::after  { top: 10px; right: 12px; transform: scaleX(-1) rotate(8deg); }

.hero__eyebrow {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.1rem, 3.5vw, 1.7rem);
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--rose);
  position: relative;
  z-index: 1;
}
.hero__stage {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 3vw, 40px);
  position: relative;
  z-index: 1;
}
.polaroid {
  width: clamp(150px, 32vw, 270px);
  background: var(--white);
  padding: 12px 12px 16px;
  border-radius: 4px;
  box-shadow: 0 20px 45px -20px rgba(63, 58, 52, 0.55);
}
.polaroid img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}
.polaroid__caption {
  font-family: "Caveat", cursive;
  font-size: clamp(1rem, 2.4vw, 1.45rem);
  line-height: 1.2;
  color: var(--olive);
  margin-top: 10px;
  min-height: 2.2em;
}
.polaroid--left  { transform: rotate(-4deg); }
.polaroid--right { transform: rotate(4deg); margin-top: 28px; }

.hero__date {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-family: var(--serif);
  color: var(--ink);
  align-self: center;
}
.hero__date-num {
  font-size: clamp(2rem, 6vw, 3.6rem);
  line-height: 1;
  font-weight: 500;
}
.hero__date-num:not(:last-child)::after {
  content: "";
  display: block;
  width: 30px;
  height: 1px;
  margin: 8px auto;
  background: var(--rose);
}

.hero__names {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.7rem, 7vw, 4.2rem);
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--olive);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 3vw, 30px);
  max-width: 100%;
  padding: 0 12px;
  position: relative;
  z-index: 1;
}
.hero__amp {
  color: var(--rose);
  font-size: 0.6em;
}
.hero__scroll {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
}
.hero__scroll span {
  display: block;
  width: 22px;
  height: 36px;
  border: 2px solid var(--muted);
  border-radius: 12px;
  position: relative;
}
.hero__scroll span::after {
  content: "";
  position: absolute;
  top: 7px; left: 50%;
  width: 4px; height: 7px;
  margin-left: -2px;
  background: var(--muted);
  border-radius: 2px;
  animation: scrolldot 1.6s ease-in-out infinite;
}
@keyframes scrolldot {
  0% { opacity: 0; transform: translateY(0); }
  40% { opacity: 1; }
  80% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 0; }
}

@media (max-width: 600px) {
  .hero__names { flex-direction: column; gap: 4px; }
  .hero__stage { flex-direction: column; gap: 8px; }
  .polaroid { width: min(72vw, 280px); }
  .polaroid--right { margin-top: 0; }
  .hero__date { flex-direction: row; align-items: baseline; gap: 6px; margin: 8px 0; }
  .hero__date-num:not(:last-child)::after { display: none; }
  .hero__date-num:not(:last-child) { position: relative; padding-right: 6px; }
  .hero__date-num:not(:last-child)::before {
    content: "·"; position: absolute; right: -4px; color: var(--rose);
  }
}

/* ---------------- STORY ART ---------------- */
.story__art {
  display: block;
  width: clamp(180px, 40vw, 280px);
  height: auto;
  margin: 38px auto 0;
}
/* танцующие человечки — оживают, когда блок появляется при прокрутке */
.dancer { transform-box: fill-box; transform-origin: bottom center; }
.story-heart {
  transform-box: fill-box;
  transform-origin: center;
  opacity: 0;
}
.is-visible .dancer--boy  { animation: danceBoy 1.7s ease-in-out infinite; }
.is-visible .dancer--girl { animation: danceGirl 1.7s ease-in-out infinite; }
.is-visible .story-heart--1 { animation: floatHeart 2.8s ease-in-out 0.2s infinite; }
.is-visible .story-heart--2 { animation: floatHeart 3.2s ease-in-out 0.9s infinite; }
.is-visible .story-heart--3 { animation: floatHeart 2.6s ease-in-out 1.5s infinite; }

@keyframes danceBoy {
  0%, 100% { transform: rotate(-5deg) translateY(0); }
  50% { transform: rotate(5deg) translateY(-3px); }
}
@keyframes danceGirl {
  0%, 100% { transform: rotate(5deg) translateY(-3px); }
  50% { transform: rotate(-5deg) translateY(0); }
}
@keyframes floatHeart {
  0% { opacity: 0; transform: translateY(4px) scale(0.7); }
  25% { opacity: 1; }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-8px) scale(1.05); }
}

/* ---------------- CALENDAR ---------------- */
.calendar {
  margin: 40px auto 0;
  max-width: 360px;
  background: var(--white);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 20px 50px -28px rgba(63, 58, 52, 0.5);
}
.calendar__head {
  font-family: var(--serif);
  font-size: 1.5rem;
  color: var(--olive);
  margin-bottom: 16px;
  letter-spacing: 1px;
}
.calendar__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.calendar__dow {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  padding-bottom: 6px;
}
.calendar__day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  border-radius: 50%;
  color: var(--ink);
}
.calendar__day--muted { color: #cabfae; }
.calendar__day--target {
  color: var(--ink);
  font-weight: 500;
  box-shadow: inset 0 0 0 1.5px var(--olive);
}

.invite__note {
  margin: 30px auto 0;
  max-width: 34ch;
  color: var(--muted);
  font-size: clamp(0.95rem, 2.4vw, 1.1rem);
}
.invite__date {
  margin-top: 18px;
  font-family: var(--serif);
  font-size: clamp(1.4rem, 4vw, 2rem);
  letter-spacing: 4px;
  color: var(--ink);
}

/* ---------------- LOCATION ---------------- */
.location__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: clamp(24px, 6vw, 70px);
  text-align: center;
  margin-top: clamp(28px, 5vw, 50px);
}
.location__name {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  color: var(--ink);
}
.location__address { color: var(--muted); margin-top: 6px; max-width: 34ch; margin-left: auto; margin-right: auto; }
.location__time {
  margin-top: 22px;
  font-style: italic;
  color: var(--olive);
  letter-spacing: 0.5px;
}
.location__time::before { content: "* "; }

.location__media {
  position: relative;
  width: 100%;
  max-width: 440px;
  justify-self: center;
}
.location__photo img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 24px 60px -30px rgba(63, 58, 52, 0.55);
}
.location__badge {
  position: absolute;
  z-index: 2;
  left: clamp(-34px, -4vw, -20px);
  top: 50%;
  transform: translateY(-50%);
  width: clamp(96px, 14vw, 130px);
  height: clamp(96px, 14vw, 130px);
  border-radius: 50%;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 14px;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.68rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  line-height: 1.4;
  box-shadow: 0 14px 30px -14px rgba(63, 58, 52, 0.5);
  transition: background 0.3s, color 0.3s;
}
.location__badge:hover { background: var(--olive); color: var(--white); }

@media (max-width: 720px) {
  .location__grid { grid-template-columns: 1fr; text-align: center; gap: 28px; }
  .location__title { text-align: center; }
  .location__address { margin-left: auto; margin-right: auto; }
  .location__media { max-width: 420px; margin: 0 auto; }
  .location__badge {
    left: 50%; top: auto; bottom: -22px;
    transform: translateX(-50%);
  }
}

/* ---------------- TIMELINE ---------------- */
.timeline {
  list-style: none;
  margin: 44px auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(28px, 5vw, 46px);
}
.timeline li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.timeline__icon svg {
  width: clamp(40px, 9vw, 52px);
  height: auto;
  display: block;
}
.timeline__label {
  font-size: clamp(0.9rem, 2.6vw, 1.1rem);
  letter-spacing: 1px;
  color: var(--ink);
}
.timeline__time { font-weight: 500; }
.timeline__dot { color: var(--rose); margin: 0 8px; }
.timeline__title { text-transform: uppercase; }

/* ---------------- DRESS CODE ---------------- */
.palette {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: clamp(8px, 1.6vw, 18px);
  margin-top: 40px;
}
.palette__swatch { text-align: center; flex: 0 1 auto; }
.palette__circle {
  width: clamp(40px, 9vw, 72px);
  height: clamp(40px, 9vw, 72px);
  border-radius: 50%;
  box-shadow: 0 10px 22px -12px rgba(63, 58, 52, 0.55);
  border: 4px solid var(--white);
  margin: 0 auto;
}
.palette__name {
  margin-top: 10px;
  font-size: clamp(0.6rem, 1.4vw, 0.78rem);
  color: var(--muted);
  letter-spacing: 0.3px;
}

/* ---------------- COUNTDOWN ---------------- */
.cd__card {
  background: var(--white);
  max-width: 780px;
  margin: 0 auto;
  border-radius: 20px;
  padding: clamp(34px, 5vw, 56px) clamp(20px, 4vw, 48px);
  box-shadow: 0 30px 70px -35px rgba(63, 58, 52, 0.5);
}
.cd__title {
  font-size: clamp(1.3rem, 4vw, 2.3rem);
  color: var(--olive);
  margin-bottom: 0.7em;
}
.cd__grid {
  display: flex;
  justify-content: center;
  gap: clamp(8px, 3vw, 34px);
}
.cd__unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.cd__boxes { display: flex; gap: 6px; }
.cd__boxes span {
  width: clamp(32px, 8vw, 56px);
  height: clamp(44px, 11vw, 74px);
  border: 1px solid var(--sand);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: clamp(1.5rem, 5vw, 2.7rem);
  color: var(--ink);
}
.cd__lbl {
  font-size: clamp(0.7rem, 2vw, 0.85rem);
  letter-spacing: 1px;
  color: var(--muted);
}

/* ---------------- WISHES (слайдер) ---------------- */
.wishes { margin-top: 30px; }
.wishes__row {
  display: flex;
  align-items: center;
  gap: clamp(6px, 2vw, 18px);
}
.wishes__viewport { flex: 1; overflow: hidden; }
.wishes__track {
  display: flex;
  transition: transform 0.6s ease;
}
.wishes__slide {
  flex: 0 0 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 4px;
}
.wishes__slide p {
  font-family: var(--serif);
  font-size: clamp(1.05rem, 2.6vw, 1.4rem);
  color: var(--ink);
  line-height: 1.65;
  position: relative;
  padding-top: 34px;
  min-height: 9em;
}
.wishes__slide p::before {
  content: "\2661";
  display: block;
  color: var(--rose);
  font-size: 1.4rem;
  margin-bottom: 10px;
}
.wishes__nav {
  flex: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--sand);
  background: var(--white);
  border-radius: 50%;
  color: var(--olive);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.3s, color 0.3s;
}
.wishes__nav:hover { background: var(--olive); color: var(--white); }
.wishes__dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
}
.wishes__dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--sand);
  cursor: pointer;
  transition: background 0.3s, transform 0.3s;
}
.wishes__dot.is-active { background: var(--olive); transform: scale(1.25); }

.wishes__banner {
  margin: clamp(46px, 7vw, 80px) 0 0;
  width: 100%;
}
.wishes__banner img {
  display: block;
  width: 100%;
  height: clamp(280px, 42vw, 520px);
  object-fit: cover;
  object-position: center 62%;
}

/* ---------------- FOOTER ---------------- */
.footer {
  background: var(--olive);
  color: var(--cream);
  text-align: center;
  padding: clamp(32px, 5vw, 52px) 0;
}
.footer__see {
  font-family: var(--serif);
  font-size: clamp(1.3rem, 3.5vw, 1.8rem);
  margin-bottom: 22px;
}
.footer__contacts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(28px, 6vw, 48px);
  margin-bottom: 22px;
}
.footer__contact-role {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  opacity: 0.75;
}
.footer__contact-name {
  font-family: var(--serif);
  font-size: 1.3rem;
  margin: 3px 0;
}
.footer__contact a { color: var(--cream); text-decoration: none; opacity: 0.9; }
.footer__contact a:hover { text-decoration: underline; }
.footer__names {
  font-family: var(--serif);
  font-size: 1.4rem;
  letter-spacing: 2px;
  opacity: 0.85;
  margin-top: 6px;
}

/* ---------------- MOBILE TWEAKS ---------------- */
@media (max-width: 480px) {
  .container { padding: 0 18px; }

  /* палитра: 7 кружков в одну строку на узком экране */
  .palette { gap: 5px; }
  .palette__swatch { width: clamp(28px, 10.5vw, 44px); }
  .palette__circle {
    width: 100%;
    height: clamp(28px, 10.5vw, 44px);
    border-width: 3px;
  }
  .palette__name {
    font-size: 0.52rem;
    line-height: 1.25;
    margin-top: 6px;
    word-break: break-word;
    hyphens: auto;
  }

  /* обратный отсчёт: 8 ячеек должны помещаться */
  .cd__card { padding: 30px 16px; }
  .cd__grid { gap: 10px; }
  .cd__unit { gap: 8px; }
  .cd__boxes { gap: 4px; }
  .cd__boxes span {
    width: clamp(26px, 9vw, 34px);
    height: clamp(38px, 13vw, 48px);
    font-size: clamp(1.3rem, 6vw, 1.8rem);
  }
  .cd__lbl { font-size: 0.62rem; letter-spacing: 0.5px; }
}

/* ---------------- SCROLL REVEAL ---------------- */
.reveal {
  opacity: 0;
  transform: translateY(36px) scale(0.98);
  transition: opacity 0.9s cubic-bezier(0.22, 0.7, 0.24, 1),
              transform 0.9s cubic-bezier(0.22, 0.7, 0.24, 1);
}
.reveal.is-visible { opacity: 1; transform: none; }

/* --- каскадное появление дочерних элементов --- */
.timeline li,
.palette__swatch,
.cd__unit,
.footer__contact {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.is-visible .timeline li,
.is-visible .palette__swatch,
.is-visible .cd__unit,
.is-visible .footer__contact {
  opacity: 1;
  transform: none;
}
.is-visible .timeline li:nth-child(2),
.is-visible .palette__swatch:nth-child(2),
.is-visible .cd__unit:nth-child(2),
.is-visible .footer__contact:nth-child(2) { transition-delay: 0.12s; }
.is-visible .timeline li:nth-child(3),
.is-visible .palette__swatch:nth-child(3),
.is-visible .cd__unit:nth-child(3) { transition-delay: 0.24s; }
.is-visible .timeline li:nth-child(4),
.is-visible .palette__swatch:nth-child(4),
.is-visible .cd__unit:nth-child(4) { transition-delay: 0.36s; }
.is-visible .palette__swatch:nth-child(5) { transition-delay: 0.48s; }
.is-visible .palette__swatch:nth-child(6) { transition-delay: 0.60s; }
.is-visible .palette__swatch:nth-child(7) { transition-delay: 0.72s; }

/* --- лёгкие наведения --- */
.polaroid,
.location__photo img,
.calendar,
.cd__card,
.palette__circle,
.timeline__icon svg {
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}
.polaroid--left:hover  { transform: rotate(-1deg) translateY(-6px); }
.polaroid--right:hover { transform: rotate(1deg) translateY(-6px); }
.location__photo:hover img { transform: scale(1.03); }
.calendar:hover,
.cd__card:hover { transform: translateY(-4px); }
.palette__swatch:hover .palette__circle { transform: scale(1.12) translateY(-3px); }
.timeline li:hover .timeline__icon svg { transform: translateY(-4px) scale(1.08); }

/* --- пульс сердечка между именами --- */
.hero__amp { display: inline-block; animation: heartbeat 2.4s ease-in-out infinite; }
@keyframes heartbeat {
  0%, 70%, 100% { transform: scale(1); }
  10%, 30% { transform: scale(1.18); }
  20% { transform: scale(1.05); }
}

/* --- мягкое сияние выбранного дня в календаре --- */
.calendar__day--target { animation: daypulse 2.6s ease-in-out infinite; }
@keyframes daypulse {
  0%, 100% { box-shadow: inset 0 0 0 1.5px var(--olive); }
  50% { box-shadow: inset 0 0 0 1.5px var(--olive), 0 0 0 5px rgba(107, 112, 92, 0.12); }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .timeline li, .palette__swatch, .cd__unit, .footer__contact {
    opacity: 1; transform: none; transition: none;
  }
  .hero__scroll span::after,
  .hero__amp,
  .calendar__day--target,
  .dancer, .story-heart { animation: none; }
  .story-heart { opacity: 1; }
  html { scroll-behavior: auto; }
}
