:root {
  --bg: #16121f;
  --bg-2: #241a33;
  --text: #f6eee6;
  --muted: #b9a9c4;
  --accent: #f3b562;
  --accent-2: #f07f7f;
  --card: rgba(255, 255, 255, 0.05);
  --card-border: rgba(255, 255, 255, 0.1);
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Manrope", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: radial-gradient(ellipse at top, var(--bg-2), var(--bg) 60%) fixed, var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.5;
  overflow-x: hidden;
}

/* ---------- искорки на фоне ---------- */
.sparkles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.sparkles span {
  position: absolute;
  bottom: -20px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  animation: float linear infinite;
}
@keyframes float {
  0%   { transform: translateY(0) scale(1); opacity: 0; }
  10%  { opacity: 0.7; }
  100% { transform: translateY(-110vh) scale(0.4); opacity: 0; }
}

/* ---------- заставка ---------- */
.intro {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px 16px;
}
.intro > * {
  opacity: 0;
  animation: rise 1.2s cubic-bezier(.2, .7, .2, 1) forwards;
}
.intro__pre   { animation-delay: .2s; }
.intro__title { animation-delay: .6s; }
.intro__sub   { animation-delay: 1.2s; }
.intro__start { animation-delay: 1.8s; }

.intro__pre {
  margin: 0 0 12px;
  font-size: 14px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--muted);
}
.intro__title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(44px, 10vw, 110px);
  line-height: 1.05;
}
.intro__title span {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.intro__sub {
  margin: 24px 0 40px;
  font-size: 18px;
  color: var(--muted);
}
.intro__start {
  font: 600 16px var(--sans);
  color: var(--bg);
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border: 0;
  border-radius: 999px;
  padding: 14px 28px;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
}
.intro__start:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(243, 181, 98, .3);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- поздравления ---------- */
.wishes {
  position: relative;
  z-index: 1;
  max-width: 1040px;
  margin: 0 auto;
  padding: 40px 16px;
  display: flex;
  flex-direction: column;
  gap: clamp(64px, 12vh, 140px);
}

.wish {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  align-items: center;
  gap: clamp(24px, 5vw, 64px);
}
.wish:nth-child(even) .wish__photo { order: 2; }

.wish__photo {
  margin: 0;
  aspect-ratio: 4 / 5;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 30px 60px rgba(0, 0, 0, .45);
  transform: rotate(-2deg);
}
.wish:nth-child(even) .wish__photo { transform: rotate(2deg); }
.wish__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.wish__body {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: clamp(24px, 4vw, 40px);
  backdrop-filter: blur(6px);
}
.wish__text {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(22px, 2.6vw, 30px);
  line-height: 1.35;
  white-space: pre-line;
}
.wish__text::before {
  content: "“";
  display: block;
  font-size: 80px;
  line-height: .6;
  color: var(--accent);
  font-style: normal;
}
.wish__author {
  margin: 20px 0 0;
  font-weight: 600;
  color: var(--accent);
}
.wish__author::before { content: "— "; }

/* ---------- плавное появление ---------- */
.reveal {
  opacity: 0;
  transform: translateY(60px) scale(.97);
  transition: opacity 1.1s ease, transform 1.1s cubic-bezier(.2, .7, .2, 1);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
.reveal .wish__body {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1s ease .35s, transform 1s cubic-bezier(.2, .7, .2, 1) .35s;
}
.reveal.is-visible .wish__body {
  opacity: 1;
  transform: none;
}

/* ---------- финал ---------- */
.outro {
  position: relative;
  z-index: 1;
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px 16px;
}
.outro__text {
  font-family: var(--serif);
  font-size: clamp(36px, 7vw, 72px);
  line-height: 1.1;
  margin: 0;
}

/* ---------- кнопка музыки ---------- */
.music {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 10;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid var(--card-border);
  background: rgba(36, 26, 51, .8);
  color: var(--accent);
  font-size: 22px;
  cursor: pointer;
  backdrop-filter: blur(6px);
}
.music.is-playing { animation: pulse 2s ease-in-out infinite; }
.music.is-muted { color: var(--muted); text-decoration: line-through; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(243, 181, 98, .4); }
  50%      { box-shadow: 0 0 0 10px rgba(243, 181, 98, 0); }
}

/* ---------- телефон ---------- */
@media (max-width: 720px) {
  .wish { grid-template-columns: 1fr; }
  .wish:nth-child(even) .wish__photo { order: 0; }
  .wish__photo { max-width: 420px; width: 100%; margin: 0 auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .intro > *, .reveal, .reveal .wish__body { animation: none; opacity: 1; transform: none; transition: none; }
  .sparkles { display: none; }
}
