:root {
  --wine: #7c1f3d;
  --wine-soft: #a34e6b;
  --pink: #e9a7bd;
  --pink-pale: #f6d9e2;
  --bg: #fdf1f3;
  --bg-2: #fbe6ea;
  --card: #fffafb;
  --gold: #c9962f;
  --ink: #5e2338;
  --shadow: 0 18px 44px rgba(124, 31, 61, .10);
}

* { box-sizing: border-box; }

body.locked { overflow: hidden; }

body {
  margin: 0;
  background: radial-gradient(120% 90% at 15% 10%, #fff7f8 0%, var(--bg) 45%, var(--bg-2) 100%);
  color: var(--ink);
  font-family: "PT Serif", Georgia, serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.script { font-family: "Caveat", cursive; }

/* --- конверт-заставка --- */
.intro {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(120% 90% at 50% 40%, #fff7f8 0%, var(--bg) 50%, var(--bg-2) 100%);
  transition: opacity .9s ease, visibility .9s;
  cursor: pointer;
}
.intro.is-gone { opacity: 0; visibility: hidden; }
.intro__inner { text-align: center; }
.intro__hint { font-size: 26px; color: var(--pink); margin: 0 0 28px; }
.intro__title {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(24px, 4vw, 38px);
  color: var(--wine);
  margin: 40px 0 6px;
}
.intro__cta {
  font-size: 24px;
  color: var(--wine-soft);
  margin: 0;
  animation: bob 2.2s ease-in-out infinite;
}

.envelope {
  position: relative;
  width: min(340px, 78vw);
  aspect-ratio: 3 / 2;
  margin: 0 auto;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  perspective: 900px;
  transition: transform .5s cubic-bezier(.2, .8, .2, 1);
  filter: drop-shadow(0 22px 40px rgba(124, 31, 61, .18));
}
.envelope:hover { transform: translateY(-6px) scale(1.02); }
.envelope span { position: absolute; }

.envelope__back {
  inset: 0;
  background: linear-gradient(160deg, #f3c3d2, #e9a7bd);
  border-radius: 10px;
}
.envelope__front {
  inset: 0;
  border-radius: 10px;
  background: linear-gradient(160deg, #f7cfdb, #edb2c5);
  clip-path: polygon(0 8%, 50% 58%, 100% 8%, 100% 100%, 0 100%);
  z-index: 3;
}
.envelope__flap {
  left: 0; right: 0; top: 0;
  height: 62%;
  background: linear-gradient(180deg, #f0bacb, #e79fb7);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top center;
  transition: transform .7s cubic-bezier(.6, -.3, .3, 1.3), z-index 0s .35s;
  z-index: 4;
  border-radius: 10px 10px 0 0;
}
.envelope__letter {
  left: 8%; right: 8%;
  top: 12%;
  height: 78%;
  background: var(--card);
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(124, 31, 61, .12);
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  padding: 0 18%;
  transition: transform .8s cubic-bezier(.2, .8, .2, 1) .25s;
}
.envelope__letter-line {
  position: static;
  height: 6px;
  border-radius: 4px;
  background: var(--pink-pale);
}
.envelope__letter-line.short { width: 55%; }
.envelope__seal {
  position: static;
  align-self: center;
  margin-top: 8px;
  color: var(--wine);
  font-size: 22px;
}

.envelope.is-open .envelope__flap {
  transform: rotateX(180deg);
  z-index: 1;
}
.envelope.is-open .envelope__letter { transform: translateY(-46%) scale(1.04); }

.confetti {
  position: fixed;
  inset: 0;
  z-index: 25;
  pointer-events: none;
}

/* --- переключатель языка --- */
.lang {
  position: fixed;
  top: 22px; right: 26px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .75);
  backdrop-filter: blur(6px);
  box-shadow: 0 8px 20px rgba(124, 31, 61, .10);
}
.lang__btn {
  border: none;
  background: none;
  cursor: pointer;
  font-family: "PT Serif", serif;
  font-size: 14px;
  letter-spacing: .04em;
  color: var(--wine-soft);
  opacity: .55;
  padding: 2px 2px;
  transition: opacity .2s, color .2s;
}
.lang__btn:hover { opacity: .85; }
.lang__btn.is-active { opacity: 1; color: var(--wine); font-weight: 700; }
.lang__sep { color: var(--pink); font-size: 13px; }

/* --- фоновые сердечки --- */
.hearts { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.hearts span {
  position: absolute;
  color: var(--pink);
  opacity: .35;
  animation: float linear infinite;
}
@keyframes float {
  from { transform: translateY(8vh) rotate(0deg); }
  to   { transform: translateY(-105vh) rotate(20deg); }
}

/* --- обложка --- */
.hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 24px;
}
.hero__from {
  font-size: 28px;
  color: var(--wine-soft);
  margin: 0 0 8px;
}
.hero__name {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(48px, 9vw, 104px);
  color: var(--wine);
  line-height: 1.05;
  margin: 6px 0;
  font-weight: 700;
}
.hero__mid {
  font-size: 30px;
  color: var(--pink);
  margin: 10px 0;
}
.hero__sub {
  max-width: 460px;
  margin: 28px auto 0;
  font-size: 19px;
  line-height: 1.6;
  color: var(--wine-soft);
  font-style: italic;
}
.hero__scroll {
  margin-top: 56px;
  font-family: "Caveat", cursive;
  font-size: 22px;
  color: var(--wine-soft);
  text-decoration: none;
  opacity: .8;
  animation: bob 2.2s ease-in-out infinite;
}
.hero__scroll::after { content: " ↓"; }
@keyframes bob { 50% { transform: translateY(8px); } }
.heart-outline { color: var(--wine); }

/* --- секции --- */
.section {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: 90px 24px 60px;
  text-align: center;
}
.section__title {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(32px, 5vw, 56px);
  color: var(--wine);
  margin: 0;
}
.section__sub {
  font-size: 24px;
  color: var(--wine-soft);
  margin: 12px 0 0;
}
.divider {
  width: 96px;
  height: 2px;
  margin: 24px auto 48px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

/* --- плеер --- */
.player {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(160deg, #eab5c6, #e3a0b6);
  border: 10px solid #fff;
  box-shadow: var(--shadow);
}
.player__video { width: 100%; height: 100%; object-fit: cover; display: block; background: #000; }
.player__empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
}
.play {
  width: 84px; height: 84px;
  border: none;
  border-radius: 50%;
  background: #fff;
  color: var(--wine);
  font-size: 26px;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(124, 31, 61, .18);
  transition: transform .25s;
}
.play:hover { transform: scale(1.08); }
.player__hint { font-size: 24px; color: #fff; margin: 0; }
.player__replace {
  position: absolute;
  right: 14px; bottom: 14px;
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, .9);
  color: var(--wine);
  font-family: "Caveat", cursive;
  font-size: 18px;
  cursor: pointer;
}

.upload { display: inline-block; margin-top: 28px; }

/* --- кнопки --- */
.btn {
  display: inline-block;
  padding: 14px 34px;
  border: none;
  border-radius: 999px;
  background: var(--wine);
  color: #fff;
  font-family: "PT Serif", serif;
  font-size: 17px;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(124, 31, 61, .22);
  transition: transform .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(124, 31, 61, .28); }
.btn--ghost {
  background: #fff;
  color: var(--wine);
  border: 1px solid var(--pink-pale);
  box-shadow: 0 8px 20px rgba(124, 31, 61, .10);
}

/* --- стена пожеланий --- */
.wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  text-align: left;
}
.wall__empty {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 26px;
  color: var(--pink);
  margin: 20px 0 0;
}
.wish {
  position: relative;
  background: var(--card);
  border-radius: 16px;
  padding: 22px 24px 22px 26px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 16px;
  animation: pop .45s ease both;
}
.wish::before {
  content: "";
  position: absolute;
  left: 0; top: 12px; bottom: 12px;
  width: 4px;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--gold), #e7c887);
}
@keyframes pop {
  from { opacity: 0; transform: translateY(14px) scale(.98); }
}
.wish__avatar {
  flex: 0 0 44px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--pink-pale);
  color: var(--wine);
  display: grid;
  place-items: center;
  font-family: "Playfair Display", serif;
  font-size: 18px;
}
.wish__name {
  font-family: "Caveat", cursive;
  font-size: 24px;
  color: var(--wine);
  margin: 0 0 4px;
}
.wish__text {
  margin: 0;
  font-style: italic;
  line-height: 1.55;
  color: var(--ink);
}
.wish__del {
  position: absolute;
  top: 10px; right: 12px;
  border: none;
  background: none;
  color: var(--pink);
  font-size: 18px;
  cursor: pointer;
  opacity: 0;
  transition: opacity .2s;
}
.wish:hover .wish__del { opacity: 1; }

/* на телефоне навести курсор нечем — показываем крестик сразу, но тихо */
@media (hover: none) {
  .wish__del { opacity: .5; }
}

/* --- форма --- */
.form-card {
  margin: 56px auto 0;
  max-width: 560px;
  background: var(--card);
  border-radius: 22px;
  padding: 36px 32px;
  box-shadow: var(--shadow);
  border: 1px solid #fbe4ea;
  text-align: left;
}
.form-card__title {
  font-family: "Playfair Display", serif;
  font-size: 28px;
  color: var(--wine);
  margin: 0;
  text-align: center;
}
.form-card__sub {
  font-size: 22px;
  color: var(--wine-soft);
  margin: 6px 0 26px;
  text-align: center;
}
.field { display: block; position: relative; margin-bottom: 20px; }
.field__label {
  display: block;
  font-size: 14px;
  color: var(--wine-soft);
  margin-bottom: 8px;
}
.field input, .field textarea {
  width: 100%;
  padding: 13px 16px;
  border: 1px solid var(--pink-pale);
  border-radius: 12px;
  background: #fff;
  font-family: "PT Serif", serif;
  font-size: 16px;
  color: var(--ink);
  resize: vertical;
  transition: border-color .2s, box-shadow .2s;
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--pink);
  box-shadow: 0 0 0 4px rgba(233, 167, 189, .18);
}
.field__counter {
  position: absolute;
  right: 4px; bottom: -18px;
  font-size: 12px;
  color: var(--wine-soft);
  opacity: .7;
}
.form-card .btn { width: 100%; margin-top: 12px; }

.signature { font-size: 42px; color: var(--wine); margin: 72px 0 0; }
.footnote { font-size: 15px; color: var(--wine-soft); opacity: .8; margin: 8px 0 20px; }

/* --- тост --- */
.toast {
  position: fixed;
  left: 50%; bottom: 32px;
  transform: translate(-50%, 140%);
  background: var(--wine);
  color: #fff;
  padding: 13px 26px;
  border-radius: 999px;
  font-size: 15px;
  box-shadow: 0 14px 30px rgba(124, 31, 61, .3);
  transition: transform .4s cubic-bezier(.2, .8, .2, 1);
  z-index: 5;
}
.toast--on { transform: translate(-50%, 0); }

@media (max-width: 600px) {
  .section { padding: 64px 18px 40px; }
  .form-card { padding: 28px 20px; }
  .signature { font-size: 32px; }
}
