/* ============ Токены ============ */
:root {
  --bg: #FFF8F3;
  --bg-soft: #FDF1EB;
  --card: #FFFDFB;
  --ink: #3D3A3A;
  --ink-soft: #8A7B7B;
  --rose: #E8B4B8;
  --rose-deep: #D4A5A5;
  --rose-pale: #F6DCD9;
  --gold: #C9A227;
  --gold-soft: #E7CE8F;
  --line: #F0DFDA;
  --serif: "Cormorant", "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: "Montserrat", "Segoe UI", Arial, sans-serif;
  --shadow-soft: 0 10px 30px rgba(201, 142, 130, 0.14);
  --radius: 16px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

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

/* Тач-поведение */
.btn-gold, .btn-ghost, .lb-btn, .gallery-item { touch-action: manipulation; }

/* ============ Появление при скролле ============ */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.8s ease, transform 0.8s ease;
  transition-delay: var(--d, 0s);
}
.reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ============ HERO ============ */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  background:
    radial-gradient(1100px 600px at 85% -10%, rgba(232, 180, 184, 0.35), transparent 60%),
    radial-gradient(900px 550px at 8% 110%, rgba(231, 206, 143, 0.28), transparent 55%),
    linear-gradient(180deg, #FFF9F5 0%, #FDF1EB 100%);
}

#petals {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  padding: 0 20px;
  max-width: 720px;
}

.hero-name {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(80px, 19vw, 190px);
  line-height: 1.0;
  color: var(--ink);
  margin: 10px 0 2px;
  letter-spacing: 0.01em;
  opacity: 0;
  animation: fadeUp 1.1s ease 0.55s forwards;
}

.hero-title-line {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 600;
  font-size: clamp(30px, 7vw, 60px);
  line-height: 1.15;
  color: var(--gold);
  text-shadow: 0 2px 24px rgba(201, 162, 39, 0.22);
  margin-bottom: 18px;
  opacity: 0;
  animation: fadeUp 1.1s ease 0.8s forwards;
}

.hero-sub {
  font-size: 15px;
  font-weight: 300;
  line-height: 1.65;
  color: var(--ink-soft);
  max-width: 360px;
  margin: 0 auto 10px;
  opacity: 0;
  animation: fadeUp 1s ease 1.0s forwards;
}

.hero-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 6px auto 18px;
  color: var(--gold);
  font-size: 14px;
  opacity: 0;
  animation: fadeUp 1s ease 0.9s forwards;
}
.hero-ornament span {
  display: block;
  width: 74px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-soft), transparent);
}

.btn-gold {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(135deg, var(--rose-deep), var(--rose));
  border: none;
  border-radius: 999px;
  padding: 17px 46px;
  min-height: 52px;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(212, 165, 165, 0.45);
  transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
  opacity: 0;
  animation: fadeUp 1s ease 1.35s forwards;
}
.btn-gold:active { transform: translateY(-1px) scale(0.98); }

.hero-scroll {
  position: absolute;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  font-size: 22px;
  color: var(--rose-deep);
  opacity: 0.75;
  animation: floatDown 2.2s ease-in-out infinite;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}
@keyframes floatDown {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 8px); }
}

/* ============ Секции общие ============ */
section { padding: 96px 24px; }

.section-head {
  text-align: center;
  margin-bottom: 52px;
}
.section-kicker {
  font-size: 12px;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  color: var(--rose-deep);
  font-weight: 500;
  margin-bottom: 12px;
}
.section-head h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1.12;
  color: var(--ink);
}
.section-note {
  margin-top: 14px;
  color: var(--ink-soft);
  font-size: 15px;
  font-weight: 300;
}

/* ============ ГАЛЕРЕЯ ============ */
.gallery { background: var(--bg-soft); }

.gallery-grid {
  columns: 3;
  column-gap: 18px;
  max-width: 1140px;
  margin: 0 auto;
}
.gallery-item {
  break-inside: avoid;
  margin-bottom: 18px;
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  box-shadow: 0 6px 18px rgba(201, 142, 130, 0.12);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.gallery-item img {
  width: 100%;
  height: auto;
  transition: transform 0.6s ease;
}
.gallery-item::after {
  content: "⤢";
  position: absolute;
  right: 12px;
  bottom: 10px;
  font-size: 17px;
  color: #fff;
  opacity: 0;
  text-shadow: 0 1px 6px rgba(0,0,0,0.45);
  transition: opacity 0.3s ease;
}

/* ============ ПИСЬМО ============ */
.letter {
  background:
    radial-gradient(800px 420px at 90% 0%, rgba(232, 180, 184, 0.25), transparent 60%),
    var(--bg-soft);
}

.letter-card {
  max-width: 720px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 56px 60px;
  text-align: center;
  box-shadow: var(--shadow-soft);
  position: relative;
}
.letter-card::before {
  content: "❝";
  position: absolute;
  top: 14px;
  left: 30px;
  font-family: var(--serif);
  font-size: 64px;
  color: var(--rose-pale);
  line-height: 1;
}
.letter-body {
  text-align: left;
  font-weight: 300;
  font-size: 16.5px;
  line-height: 1.85;
  color: #4A4141;
}
.letter-body p { margin-bottom: 16px; }
.letter-body p::first-letter {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.9em;
  color: var(--gold);
  line-height: 1;
}
.letter-sign {
  margin-top: 26px;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 600;
  font-size: 26px;
  color: var(--rose-deep);
}

/* ============ ФИНАЛ ============ */
.final {
  text-align: center;
  padding: 110px 24px 70px;
  background:
    radial-gradient(700px 380px at 50% 120%, rgba(231, 206, 143, 0.3), transparent 65%),
    var(--bg);
}
.final h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(44px, 7vw, 72px);
  line-height: 1.1;
  margin-bottom: 12px;
}
.final-sub {
  font-family: var(--serif);
  font-style: italic;
  font-size: 19px;
  color: var(--ink-soft);
  margin-bottom: 30px;
}
.final .hero-ornament { animation: none; opacity: 1; }

.btn-ghost {
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--rose-deep);
  background: transparent;
  border: 1.5px solid var(--rose);
  border-radius: 999px;
  padding: 14px 36px;
  min-height: 48px;
  cursor: pointer;
  transition: all 0.3s ease;
}
.btn-ghost:active { background: var(--rose); color: #fff; }

/* ============ МУЗЫКА ============ */
.music-btn {
  position: fixed;
  right: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  z-index: 95;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, var(--rose-deep), var(--rose));
  box-shadow: 0 10px 24px rgba(212, 165, 165, 0.5);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  touch-action: manipulation;
}
.music-btn:active { transform: scale(0.94); }
.music-btn svg { transition: transform 0.3s ease; }

.music-btn.playing {
  box-shadow: 0 10px 28px rgba(212, 165, 165, 0.65);
  animation: musicPulse 1.6s ease-in-out infinite;
}
.music-btn.playing svg { transform: rotate(-12deg) scale(1.08); animation: musicWiggle 0.9s ease-in-out infinite; }

@keyframes musicPulse {
  0%, 100% { box-shadow: 0 10px 24px rgba(212, 165, 165, 0.5), 0 0 0 0 rgba(212, 165, 165, 0.45); }
  50% { box-shadow: 0 10px 24px rgba(212, 165, 165, 0.5), 0 0 0 14px rgba(212, 165, 165, 0); }
}
@keyframes musicWiggle {
  0%, 100% { transform: rotate(-12deg) scale(1.08); }
  50% { transform: rotate(8deg) scale(1.1); }
}

@media (max-width: 640px) {
  .music-btn { width: 54px; height: 54px; right: 14px; }
}

/* ============ ЛАЙТБОКС ============ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(38, 28, 28, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: lbFade 0.25s ease;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
@keyframes lbFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.lb-img {
  max-width: min(92vw, 900px);
  max-height: 84vh;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: lbZoom 0.3s ease;
}
@keyframes lbZoom {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.lb-btn {
  position: absolute;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s ease, transform 0.25s ease;
}

.lb-close { top: 22px; right: 24px; font-size: 30px; }
.lb-prev { left: 22px; top: 50%; transform: translateY(-50%); font-size: 30px; padding-bottom: 4px; }
.lb-next { right: 22px; top: 50%; transform: translateY(-50%); font-size: 30px; padding-bottom: 4px; }

.lb-counter {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.85);
  font-size: 13.5px;
  letter-spacing: 0.2em;
  font-weight: 400;
}

/* Hover — только там, где есть мышь */
@media (hover: hover) {
  .btn-gold:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 34px rgba(212, 165, 165, 0.55);
    filter: brightness(1.04);
  }
  .reason-card:hover {
    transform: translateY(-4px);
    border-color: var(--gold-soft);
    box-shadow: var(--shadow-soft);
  }
  .gallery-item:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(201, 142, 130, 0.22); }
  .gallery-item:hover img { transform: scale(1.045); }
  .gallery-item:hover::after { opacity: 0.9; }
  .lb-btn:hover { background: rgba(255, 255, 255, 0.28); transform: scale(1.06); }
  .lb-prev:hover, .lb-next:hover { transform: translateY(-50%) scale(1.06); }
  .btn-ghost:hover {
    background: var(--rose);
    color: #fff;
    box-shadow: 0 10px 22px rgba(212, 165, 165, 0.35);
  }
}

/* ============ АДАПТИВ ============ */
@media (max-width: 900px) {
  .gallery-grid { columns: 2; }
}

@media (max-width: 640px) {
  section { padding: 72px 18px; }
  .letter-card { padding: 40px 26px; }
  .letter-card::before { left: 18px; font-size: 46px; }
  .section-head { margin-bottom: 38px; }
  .btn-gold { padding: 16px 38px; font-size: 14px; width: 100%; max-width: 300px; }
  .gallery-grid { column-gap: 12px; }
  .gallery-item { margin-bottom: 12px; border-radius: 12px; }
  .lb-btn { width: 52px; height: 52px; }
  .lb-close { top: 16px; right: 16px; }
  .lb-prev { left: 12px; }
  .lb-next { right: 12px; }
  .lb-img { max-width: 94vw; }
}

@media (max-width: 400px) {
  .hero-name { font-size: 76px; }
}

/* ============ ПОЖЕЛАНИЯ ============ */
.wishes { background: var(--bg); }

.wishes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  max-width: 1080px;
  margin: 0 auto;
}

.wish-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 24px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  box-shadow: 0 6px 18px rgba(201, 142, 130, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.wish-emoji {
  font-size: 27px;
  line-height: 1.3;
  flex: none;
  filter: drop-shadow(0 3px 6px rgba(201, 142, 130, 0.3));
}

.wish-card h3 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 19px;
  margin-bottom: 4px;
  color: var(--rose-deep);
}

.wish-card p {
  font-size: 14.5px;
  font-weight: 300;
  color: #4A4141;
  line-height: 1.6;
}

/* ============ ПЕЧЕНЬЕ С ПРЕДСКАЗАНИЕМ ============ */
.fortune { background: var(--bg); }

.fortune-box {
  text-align: center;
  max-width: 620px;
  margin: 0 auto;
  padding: 30px 22px 10px;
}

.cookie-btn {
  position: relative;
  display: block;
  margin: 0 auto;
  width: 148px;
  height: 148px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: radial-gradient(circle at 34% 28%, #F2D9A4, #E3B26B 62%, #D19A52);
  box-shadow:
    inset 0 -10px 16px rgba(158, 96, 32, 0.35),
    inset 0 6px 10px rgba(255, 244, 214, 0.55),
    0 16px 32px rgba(201, 142, 130, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  touch-action: manipulation;
}
.cookie-btn:active { transform: scale(0.96); }

.cookie-chip {
  position: absolute;
  left: calc(50% + var(--x));
  top: calc(50% + var(--y));
  width: 16px;
  height: 12px;
  border-radius: 45%;
  background: #7A4A26;
  opacity: 0.85;
  transform: rotate(18deg);
}

.cookie-crack {
  position: absolute;
  left: 14%;
  right: 14%;
  top: 50%;
  height: 4px;
  margin-top: -2px;
  background: repeating-linear-gradient(90deg, #8A5A2B 0 3px, transparent 3px 7px);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.cookie-btn.cracking { animation: cookieShake 0.62s ease; }
.cookie-btn.opened .cookie-crack { opacity: 1; }
.cookie-btn.opened {
  transform: scale(0.97);
  box-shadow:
    inset 0 -10px 16px rgba(158, 96, 32, 0.35),
    inset 0 6px 10px rgba(255, 244, 214, 0.55),
    0 10px 22px rgba(201, 142, 130, 0.35);
}

@keyframes cookieShake {
  0%, 100% { transform: rotate(0) scale(1); }
  15% { transform: rotate(-9deg) scale(1.04); }
  35% { transform: rotate(8deg) scale(1.06); }
  55% { transform: rotate(-6deg) scale(1.04); }
  75% { transform: rotate(4deg) scale(1.02); }
}

.fortune-slip {
  max-width: 440px;
  margin: 30px auto 0;
  min-height: 66px;
  background: linear-gradient(180deg, #FFFDF6, #FBF3E3);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 24px;
  box-shadow: 0 12px 28px rgba(201, 142, 130, 0.2);
  opacity: 0;
  transform: translateY(26px) scale(0.92);
  transform-origin: 50% 0;
  transition: opacity 0.45s ease, transform 0.45s ease;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 600;
  font-size: 19.5px;
  line-height: 1.5;
  color: var(--ink);
}
.fortune-slip.show { opacity: 1; transform: none; }
.fortune-slip.show::before {
  content: "✦ ";
  color: var(--gold);
}

.fortune-hint {
  margin-top: 18px;
  font-size: 13.5px;
  font-weight: 300;
  color: var(--ink-soft);
}

/* ============ ПЛАВАЮЩИЕ СЛОВА ============ */
.words {
  background:
    radial-gradient(800px 400px at 12% 0%, rgba(232, 180, 184, 0.22), transparent 60%),
    radial-gradient(700px 380px at 88% 100%, rgba(231, 206, 143, 0.25), transparent 55%),
    var(--bg-soft);
}

.words-sky {
  position: relative;
  height: 460px;
  max-width: 1140px;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 253, 251, 0.6);
  box-shadow: inset 0 0 70px rgba(232, 180, 184, 0.14);
}

.word {
  position: absolute;
  left: var(--x);
  top: var(--y);
  font-family: var(--serif);
  font-style: italic;
  font-weight: 600;
  font-size: clamp(20px, 4vw, 32px);
  color: var(--rose-deep);
  opacity: 0.55;
  white-space: nowrap;
  user-select: none;
  pointer-events: none;
  will-change: transform;
  animation: var(--anim, driftA) var(--dur, 12s) ease-in-out var(--del, 0s) infinite alternate;
}
.word:nth-child(4n+1) { --anim: driftA; }
.word:nth-child(4n+2) { --anim: driftB; color: var(--gold); opacity: 0.6; }
.word:nth-child(4n+3) { --anim: driftC; color: var(--ink-soft); opacity: 0.6; }
.word:nth-child(4n+4) { --anim: driftD; color: #C98E82; opacity: 0.65; }

@keyframes driftA {
  from { transform: translate(0, 0) rotate(-2deg); }
  to { transform: translate(28px, -36px) rotate(3deg); }
}
@keyframes driftB {
  from { transform: translate(0, 0) rotate(2deg); }
  to { transform: translate(-32px, 24px) rotate(-4deg); }
}
@keyframes driftC {
  from { transform: translate(0, 0) rotate(-1deg); }
  to { transform: translate(20px, 32px) rotate(2deg); }
}
@keyframes driftD {
  from { transform: translate(0, 0) rotate(3deg); }
  to { transform: translate(-24px, -28px) rotate(-3deg); }
}

/* ============ ПАСХАЛКА: конфетти и сообщение ============ */
.confetti-zone {
  position: fixed;
  inset: 0;
  z-index: 130;
  pointer-events: none;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  width: var(--size);
  height: var(--size2);
  background: var(--c);
  border-radius: var(--round);
  opacity: 0;
  animation: confettiFall var(--fall) cubic-bezier(0.25, 0.46, 0.45, 0.94) var(--del) forwards;
}

@keyframes confettiFall {
  0% { opacity: 1; transform: translate3d(0, 0, 0) rotate(0deg); }
  100% { opacity: 0.9; transform: translate3d(var(--dx), var(--dy), 0) rotate(var(--rot)); }
}

.easter-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(38, 28, 28, 0.55);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: lbFade 0.3s ease;
}

.easter-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 38px 32px 30px;
  text-align: center;
  max-width: 380px;
  width: 100%;
  box-shadow: 0 24px 60px rgba(38, 28, 28, 0.35);
  animation: lbZoom 0.35s ease;
}

.easter-crown {
  font-size: 46px;
  line-height: 1;
  margin-bottom: 10px;
  animation: crownBob 2.4s ease-in-out infinite;
}

@keyframes crownBob {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-7px) rotate(5deg); }
}

.easter-card h3 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 30px;
  line-height: 1.15;
  margin-bottom: 10px;
}

.easter-card p {
  font-size: 15.5px;
  font-weight: 300;
  color: var(--ink-soft);
  line-height: 1.65;
}

.easter-card .easter-ps {
  margin-top: 12px;
  font-size: 13px;
  font-style: italic;
  color: var(--gold);
}

.easter-card .btn-ghost { margin-top: 24px; }

/* Hover для новых блоков */
@media (hover: hover) {
  .wish-card:hover {
    transform: translateY(-4px);
    border-color: var(--gold-soft);
    box-shadow: var(--shadow-soft);
  }
  .cookie-btn:hover {
    transform: scale(1.04);
    box-shadow:
      inset 0 -10px 16px rgba(158, 96, 32, 0.35),
      inset 0 6px 10px rgba(255, 244, 214, 0.55),
      0 20px 40px rgba(201, 142, 130, 0.45);
  }
  .cookie-btn.opened:hover { transform: scale(0.97); }
}

/* Адаптив новых блоков */
@media (max-width: 640px) {
  .wishes-grid { gap: 14px; }
  .wish-card { padding: 22px 18px; gap: 13px; }
  .wish-emoji { font-size: 24px; }
  .wish-card h3 { font-size: 18px; }
  .wish-card p { font-size: 14px; }
  .words-sky { height: 340px; border-radius: 18px; }
  .word { font-size: clamp(19px, 5.2vw, 26px); }
  .cookie-btn { width: 132px; height: 132px; }
  .fortune-slip { font-size: 18px; padding: 16px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .word { animation: none; }
  .cookie-btn.cracking { animation: none; }
  .easter-crown { animation: none; }
  .confetti-piece { animation-duration: 0.01s; }
}
