/* =====================================================
   Диана · 20 лет
   Нежная, светлая, романтичная тема
   ===================================================== */

:root {
  --bg-1: #ffe7f0;
  --bg-2: #ffd5e5;
  --rose: #f2a4c4;
  --rose-deep: #e37fa8;
  --rose-soft: #fbd7e3;
  --lavender: #d4b7ec;
  --gold: #e6c26a;
  --gold-deep: #c9a24b;
  --text: #6f4c5b;
  --text-dim: #a58a95;
  --cream: #fffdf8;
  --font-script: 'Great Vibes', cursive;
  --font-serif: 'Playfair Display', serif;
  --font-sans: 'Montserrat', sans-serif;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  background: linear-gradient(180deg, #ffe7f0 0%, #ffd5e5 45%, #ffeaf3 78%, #fff7fa 100%);
  color: var(--text);
  font-family: var(--font-sans);
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

/* Скроллбар */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg-1); }
::-webkit-scrollbar-thumb { background: var(--rose-soft); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--rose); }

/* ===== ФОНОВЫЕ CANVAS ===== */
.fx-canvas {
  position: fixed; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 1;
}
#confetti { z-index: 2; }

/* Аппаратное ускорение анимаций (плавно на iPhone) */
.fx-canvas, .balloons { transform: translateZ(0); }

/* ===== УТИЛИТЫ ===== */
.hidden { display: none !important; }
.script { font-family: var(--font-script); }

.btn {
  cursor: pointer; border: none; font-family: var(--font-sans);
  font-weight: 600; letter-spacing: 1px; padding: 16px 38px;
  border-radius: 60px; font-size: 1rem;
  transition: transform .25s ease, box-shadow .25s ease;
  touch-action: manipulation;
}
.btn:hover { transform: translateY(-3px); }
.btn-rose {
  background: linear-gradient(120deg, var(--rose-soft), var(--rose), var(--rose-deep));
  color: #fff;
  box-shadow: 0 12px 30px rgba(227, 127, 168, .35);
}

/* ===== ИНТРО (подарок) ===== */
.intro {
  position: fixed; inset: 0; z-index: 50;
  background: radial-gradient(900px 600px at 50% 30%, #ffdcec 0%, var(--bg-1) 70%);
  display: flex; align-items: center; justify-content: center; text-align: center;
  transition: opacity .9s ease;
}
.intro.fade { opacity: 0; pointer-events: none; }
.intro-inner { position: relative; z-index: 2; }
.intro-kicker { color: var(--text-dim); letter-spacing: 3px; font-size: .82rem; text-transform: uppercase; margin-bottom: 26px; }

.gift { position: relative; width: 160px; height: 160px; margin: 0 auto 26px; cursor: pointer; animation: float 3s ease-in-out infinite; touch-action: manipulation; }
.gift-box {
  position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 120px; height: 96px;
  background: linear-gradient(180deg, #fff, var(--rose-soft));
  border: 2px solid var(--rose);
  border-radius: 8px;
}
.gift-lid {
  position: absolute; bottom: 90px; left: 50%; transform: translateX(-50%);
  width: 140px; height: 30px;
  background: linear-gradient(180deg, var(--rose), var(--rose-deep));
  border-radius: 8px;
  transition: transform .5s ease;
}
.gift-ribbon {
  position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 16px; height: 120px;
  background: linear-gradient(180deg, var(--gold), var(--gold-deep));
}
.gift-bow { position: absolute; bottom: 92px; left: 50%; transform: translateX(-50%); font-size: 2rem; z-index: 2; }
.gift.opened .gift-lid { transform: translateX(-50%) translateY(-46px) rotate(-10deg); }
.gift.opened .gift-bow { opacity: 0; transition: opacity .4s; }
.intro-hint { color: var(--text-dim); font-size: .9rem; margin-bottom: 22px; }

@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }

/* ===== ОСНОВНОЙ БЛОК ===== */
.main { position: relative; z-index: 5; }

/* ===== ШАРИКИ И СЕРДЕЧКИ ===== */
.balloons { position: fixed; inset: 0; pointer-events: none; z-index: 3; overflow: hidden; }
.balloon {
  position: absolute; bottom: -180px;
  width: 56px; height: 74px;
  border-radius: 50% 50% 50% 50% / 55% 55% 45% 45%;
  animation: rise linear infinite;
  opacity: .75;
}
.balloon::after {
  content: ""; position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%);
  width: 2px; height: 58px; background: rgba(170,130,145,.35);
}
.b1 { left: 5%;  background: radial-gradient(circle at 35% 30%, #fff, var(--rose-soft)); animation-duration: 19s; }
.b2 { left: 20%; background: radial-gradient(circle at 35% 30%, #fff, #e9d3f5); animation-duration: 23s; animation-delay: 3s; }
.b3 { left: 38%; background: radial-gradient(circle at 35% 30%, #fff, var(--gold)); animation-duration: 21s; animation-delay: 1.5s; }
.b4 { left: 55%; background: radial-gradient(circle at 35% 30%, #fff, #f7c8da); animation-duration: 17s; animation-delay: 5s; }
.b5 { left: 72%; background: radial-gradient(circle at 35% 30%, #fff, var(--lavender)); animation-duration: 25s; animation-delay: 2s; }
.b6 { left: 88%; background: radial-gradient(circle at 35% 30%, #fff, var(--rose)); animation-duration: 20s; animation-delay: 4s; }
.b7 { left: 10%; background: radial-gradient(circle at 35% 30%, #fff, #f7c8da); animation-duration: 22s; animation-delay: 6s; }
.b8 { left: 48%; background: radial-gradient(circle at 35% 30%, #fff, var(--gold)); animation-duration: 24s; animation-delay: 3.5s; }
.b9 { left: 78%; background: radial-gradient(circle at 35% 30%, #fff, #e9d3f5); animation-duration: 18s; animation-delay: 7s; }
.b10 { left: 95%; background: radial-gradient(circle at 35% 30%, #fff, var(--rose-soft)); animation-duration: 21s; animation-delay: 5s; }
.heart { position: absolute; bottom: -70px; font-size: 1.7rem; opacity: .8; animation: rise linear infinite; }
.h1 { left: 12%; animation-duration: 16s; }
.h2 { left: 45%; animation-duration: 19s; animation-delay: 2s; }
.h3 { left: 68%; animation-duration: 15s; animation-delay: 4s; }
.h4 { left: 85%; animation-duration: 21s; animation-delay: 1s; }
.h5 { left: 30%; animation-duration: 17s; animation-delay: 5s; }
.h6 { left: 58%; animation-duration: 20s; animation-delay: 3s; }
@keyframes rise {
  0%   { transform: translateY(0) translateX(0); }
  50%  { transform: translateY(-50vh) translateX(26px); }
  100% { transform: translateY(-115vh) translateX(-18px); }
}

/* ===== HERO ===== */
.hero {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  padding: 20px; position: relative;
}
.hero-kicker {
  font-size: 2.1rem; color: var(--rose-deep); letter-spacing: 3px; margin-bottom: 6px;
}
.hero-title {
  font-size: clamp(4rem, 14vw, 8.5rem);
  line-height: 1.35;
  margin: 8px 0;
  padding: 0.08em 0.25em 0.12em;
  overflow: visible;
  background: linear-gradient(120deg, var(--rose-deep), var(--rose) 40%, var(--gold) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: titleGlow 3.5s ease-in-out infinite;
}
@keyframes titleGlow {
  0%,100% { filter: drop-shadow(0 0 10px rgba(242,164,196,.35)); }
  50%     { filter: drop-shadow(0 0 26px rgba(230,194,106,.5)); }
}
.hero-age { margin: 14px 0 4px; }
.hero-age-num {
  font-family: var(--font-serif); font-weight: 700; font-size: 6rem; line-height: 1;
  color: var(--rose);
  text-shadow: 0 6px 24px rgba(242,164,196,.5);
}
.hero-age-caption {
  color: var(--text-dim); font-size: 1.15rem; letter-spacing: 2.5px;
  font-family: var(--font-serif); font-style: italic; margin-bottom: 12px;
}
.hero-sub { max-width: 600px; color: var(--text-dim); font-size: 1.12rem; line-height: 1.7; margin-top: 8px; }
.scroll-hint { margin-top: 40px; color: var(--rose); font-size: 2rem; text-decoration: none; animation: bounce 2s infinite; }
@keyframes bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(10px); } }

/* ===== СЕКЦИИ ===== */
.section { max-width: 980px; margin: 0 auto; padding: 90px 20px; text-align: center; }
.section-title { font-family: var(--font-serif); font-weight: 600; font-size: clamp(1.8rem, 5vw, 2.9rem); margin-bottom: 8px; color: var(--text); }
.section-sub { color: var(--text-dim); font-size: 1rem; margin-bottom: 50px; }

/* ===== КАРТОЧКИ КАЧЕСТВ ===== */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.card {
  background: #fff;
  border: 1px solid var(--rose-soft);
  border-radius: 20px;
  padding: 34px 22px;
  box-shadow: 0 14px 40px rgba(242,164,196,.18);
  transition: transform .35s ease, box-shadow .35s ease;
}
.card:hover { transform: translateY(-6px); box-shadow: 0 22px 50px rgba(242,164,196,.3); }
.card-emoji { font-size: 2.4rem; display: block; margin-bottom: 14px; }
.card h3 { font-family: var(--font-serif); font-size: 1.35rem; color: var(--rose-deep); margin-bottom: 8px; }
.card p { color: var(--text-dim); font-size: .93rem; line-height: 1.6; }
.cards-note { margin-top: 36px; color: var(--text-dim); font-size: 1.05rem; line-height: 1.7; font-style: italic; }

/* ===== ГАЛЕРЕЯ ===== */
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 26px; max-width: 760px; margin: 0 auto; }
.photo {
  position: relative;
  width: 100%;
  aspect-ratio: 3/4;
  border-radius: 22px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 12px 34px rgba(242,164,196,.28);
  transition: transform .4s ease, box-shadow .4s ease;
}
.photo:hover { transform: translateY(-6px); box-shadow: 0 20px 46px rgba(242,164,196,.42); }
.photo-frame {
  display: block;
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 22px;
  transition: transform .5s ease;
}
.photo:hover .photo-frame { transform: scale(1.06); }
.photo figcaption {
  position: absolute; bottom: 0; left: 0; right: 0; padding: 30px 12px 14px;
  text-align: center; font-family: var(--font-script); font-size: 1.6rem; color: #fff;
  background: linear-gradient(180deg, transparent, rgba(150,70,100,.55));
  text-shadow: 0 1px 8px rgba(0,0,0,.3);
}

/* ===== ВИДЕО ===== */
.video-wrap {
  max-width: 440px; margin: 0 auto; position: relative;
  border-radius: 24px; overflow: hidden;
  box-shadow: 0 24px 60px rgba(227,127,168,.3);
}
.video-player {
  display: block; width: 100%; aspect-ratio: 9/16;
  object-fit: cover; background: #000;
}
.video-caption {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 34px 16px 16px; text-align: center;
  font-size: 2rem; color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,.4);
  background: linear-gradient(180deg, transparent, rgba(150,70,100,.5));
}

/* ===== ПИСЬМО ===== */
.letter { max-width: 720px; margin: 0 auto; }
.letter-paper {
  background: linear-gradient(180deg, #fffefb, #fff4f7);
  border: 1px solid var(--rose-soft);
  border-radius: 22px; padding: 50px 42px; text-align: left;
  box-shadow: 0 30px 70px rgba(227,127,168,.22);
  position: relative;
}
.letter-greeting { font-size: 3rem; color: var(--rose-deep); margin-bottom: 22px; }
.letter-body { font-family: var(--font-serif); font-size: 1.08rem; line-height: 1.9; color: #7a5564; min-height: 300px; }
.letter-body p { margin-bottom: 18px; }
.letter-sign { font-size: 1.9rem; color: var(--rose-deep); text-align: right; margin-top: 28px; }

/* ===== ФИНАЛ ===== */
.finale { min-height: 60vh; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.secret { margin-top: 40px; animation: fadeUp .8s ease; }
.secret-big { font-size: 3.2rem; color: var(--rose-deep); margin-bottom: 18px; }
.secret-text { max-width: 620px; color: var(--text-dim); line-height: 1.8; font-size: 1.05rem; }
.secret-heart { font-size: 3.6rem; margin-top: 22px; animation: heartBeat 1.6s ease-in-out infinite; }
@keyframes heartBeat { 0%,100% { transform: scale(1); } 25% { transform: scale(1.2); } 40% { transform: scale(.95); } 60% { transform: scale(1.15); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.footer { text-align: center; padding: 40px 20px; color: var(--text-dim); font-size: .85rem; }

/* ===== REVEAL ===== */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity .8s ease, transform .8s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ===== СПАРКЛЫ ЗА МЫШКОЙ ===== */
.spark { position: fixed; pointer-events: none; z-index: 30; font-size: 1rem; animation: sparkFade 1s ease forwards; }
@keyframes sparkFade { to { opacity: 0; transform: translateY(-30px) scale(.4); } }

/* ===== ВСПЛЫВАЮЩИЕ СООБЩЕНИЯ ===== */
.popup-msg {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 60;
  font-family: var(--font-script);
  font-size: clamp(2.4rem, 7vw, 4.2rem);
  color: var(--rose-deep);
  text-shadow: 0 4px 28px rgba(227,127,168,.45);
  pointer-events: none;
  text-align: center;
  max-width: 92vw;
  padding: 0 12px;
  opacity: 0;
  animation: popLeft 2.6s cubic-bezier(.22, 1, .36, 1) forwards;
}
.popup-msg.from-left   { animation-name: popLeft; }
.popup-msg.from-right  { animation-name: popRight; }
.popup-msg.from-top    { animation-name: popTop; }
.popup-msg.from-bottom { animation-name: popBottom; }

@keyframes popLeft {
  0%   { opacity: 0; transform: translate(calc(-50% - 65vw), -50%); }
  22%  { opacity: 1; transform: translate(-50%, -50%); }
  78%  { opacity: 1; transform: translate(-50%, -50%); }
  100% { opacity: 0; transform: translate(calc(-50% + 45vw), -50%); }
}
@keyframes popRight {
  0%   { opacity: 0; transform: translate(calc(-50% + 65vw), -50%); }
  22%  { opacity: 1; transform: translate(-50%, -50%); }
  78%  { opacity: 1; transform: translate(-50%, -50%); }
  100% { opacity: 0; transform: translate(calc(-50% - 45vw), -50%); }
}
@keyframes popTop {
  0%   { opacity: 0; transform: translate(-50%, calc(-50% - 65vh)); }
  22%  { opacity: 1; transform: translate(-50%, -50%); }
  78%  { opacity: 1; transform: translate(-50%, -50%); }
  100% { opacity: 0; transform: translate(-50%, calc(-50% - 40vh)); }
}
@keyframes popBottom {
  0%   { opacity: 0; transform: translate(-50%, calc(-50% + 65vh)); }
  22%  { opacity: 1; transform: translate(-50%, -50%); }
  78%  { opacity: 1; transform: translate(-50%, -50%); }
  100% { opacity: 0; transform: translate(-50%, calc(-50% + 40vh)); }
}

/* ===== ДЕКОР НА ЭКРАНЕ ПОДАРКА ===== */
.intro-decor {
  position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 1;
}
.sparkle { position: absolute; bottom: -40px; font-size: 1.5rem; opacity: .85; animation: rise linear infinite; }
.s1 { left: 8%;  animation-duration: 14s; }
.s2 { left: 35%; animation-duration: 18s; animation-delay: 2s; }
.s3 { left: 62%; animation-duration: 16s; animation-delay: 4s; }
.s4 { left: 82%; animation-duration: 20s; animation-delay: 1s; }

/* ===== АДАПТИВ ===== */
@media (max-width: 720px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .gallery { gap: 16px; }
  .letter-paper { padding: 34px 22px; }
}
