/* Палитра: светлые пудрово-розовые тона */
:root {
  --bg: #fdf7f8;
  --bg-blush: #fbe9ed;
  --surface: rgba(255, 255, 255, 0.78);
  --ink: #5b4249;
  --ink-soft: #7d6269;
  --rose: #d9a5b0;
  --rose-deep: #b97a88;
  --rose-pale: #f6dfe4;
  --petal: #f3cbd4;
  --line: #f1dce1;
  --shadow: 0 18px 40px -22px rgba(185, 122, 136, 0.35);
  --radius: 24px;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Nunito", "Segoe UI", system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(60rem 40rem at 10% -10%, var(--bg-blush), transparent 60%),
    radial-gradient(50rem 35rem at 100% 30%, #fcf0f3, transparent 60%),
    radial-gradient(45rem 30rem at 0% 90%, #fbeef1, transparent 60%);
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Лепестки ---------- */
.petals {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.petals span {
  position: absolute;
  top: -40px;
  left: var(--x);
  width: var(--s);
  height: var(--s);
  border-radius: 100% 0 100% 0;
  background: linear-gradient(135deg, #f8dbe2, var(--rose));
  opacity: 0.5;
  animation: fall var(--d) linear var(--delay) infinite;
}

@keyframes fall {
  0%   { transform: translate3d(0, -5vh, 0) rotate(0deg); }
  50%  { transform: translate3d(36px, 50vh, 0) rotate(160deg); }
  100% { transform: translate3d(-18px, 110vh, 0) rotate(340deg); }
}

/* ---------- Шапка ---------- */
.hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 16px;
  text-align: center;
}

.hero__flower {
  width: clamp(72px, 14vw, 104px);
  height: auto;
  margin-bottom: 28px;
  animation: spin 60s linear infinite;
}

.hero__petals ellipse {
  fill: var(--petal);
  opacity: 0.85;
}

.hero__core {
  fill: var(--rose);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.hero__title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.8rem, 9vw, 6rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.hero__title em {
  font-style: italic;
  color: var(--rose-deep);
}

.hero__lead {
  max-width: 34ch;
  margin: 24px auto 0;
  font-size: clamp(1.05rem, 2.4vw, 1.25rem);
  color: var(--ink-soft);
}

.hero__scroll {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 40px;
  padding: 12px 26px;
  border: 1px solid var(--rose);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background-color 0.25s ease, transform 0.25s ease;
}

.hero__scroll:hover,
.hero__scroll:focus-visible {
  background: var(--rose-pale);
  transform: translateY(2px);
}

.hero__scroll:focus-visible {
  outline: 2px solid var(--rose-deep);
  outline-offset: 3px;
}

/* ---------- Блоки с пожеланиями ---------- */
.wishes {
  position: relative;
  z-index: 1;
  /* Отступ сверху при переходе по якорю #wishes */
  scroll-margin-top: 56px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.card {
  position: relative;
  padding: clamp(28px, 5vw, 44px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  box-shadow: var(--shadow);
}

.card p {
  margin: 0 0 1em;
}

.card p:last-child {
  margin-bottom: 0;
}

.card__num {
  display: block;
  margin-bottom: 6px;
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--rose-deep);
}

.card__title {
  margin: 0 0 14px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.6rem, 3.4vw, 2.1rem);
  line-height: 1.2;
  color: var(--ink);
}

.card__icon {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 18px;
  border-radius: 50%;
  background: var(--rose-pale);
  color: var(--rose-deep);
}

.card__icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card__icon--lg {
  width: 64px;
  height: 64px;
}

.card__icon--lg svg {
  width: 30px;
  height: 30px;
}

/* Блок 1: письмо */
.card--letter {
  text-align: center;
}

.card--letter p {
  max-width: 60ch;
  margin-left: auto;
  margin-right: auto;
}

.card--letter::before,
.card--letter::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 56px;
  height: 2px;
  border-radius: 2px;
  background: var(--rose);
  opacity: 0.5;
  transform: translateX(-50%);
}

.card--letter::before { top: 18px; }
.card--letter::after  { bottom: 18px; }

/* Блок 6: главное пожелание */
.card--final {
  text-align: center;
  background: linear-gradient(160deg, rgba(246, 223, 228, 0.9), rgba(255, 255, 255, 0.85));
}

.card--final p {
  max-width: 56ch;
  margin-left: auto;
  margin-right: auto;
}

/* ---------- Подпись ---------- */
.signature {
  position: relative;
  z-index: 1;
  padding: 72px 16px 88px;
  text-align: center;
}

.signature p {
  margin: 0;
}

.signature__label {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.4rem;
  color: var(--ink-soft);
}

.signature__name {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2rem, 5vw, 2.8rem);
  color: var(--rose-deep);
}

/* ---------- Появление при прокрутке ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Адаптив ---------- */
@media (max-width: 700px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .wishes,
  .grid {
    gap: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .petals {
    display: none;
  }

  .hero__flower {
    animation: none;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
