/* ===========================================================
   «Є привід» · стиль «Love letter»
   Ч/б фото, червоний рукопис, конверт, відривний календар,
   записки зі скріпкою. Друкарський шрифт для тексту.
   =========================================================== */
:root {
  --paper: #F3EEE7;
  --red: #C8102E;
  --ink: #232022;
  --muted: #7A7275;
  --script: 'Bad Script', cursive;
  --mono: 'PT Mono', ui-monospace, monospace;
  --caps: 'Manrope', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--mono); font-size: 13px; line-height: 1.6; -webkit-font-smoothing: antialiased; }

.backdrop { display: none; }
.sheet { max-width: 560px; margin: 0 auto; background: var(--paper); position: relative; overflow: hidden; }
.blk { padding: 50px 24px; position: relative; text-align: center; }
.blk p { margin: 0 0 12px; }

/* Тонкі великі літери для заголовків */
.caps { font-family: var(--caps); font-weight: 300; text-transform: uppercase; letter-spacing: .04em; font-size: 22px; margin: 0; }
/* Червоний рукопис */
.red { font-family: var(--script); color: var(--red); font-weight: 400; }
.title { font-family: var(--script); color: var(--red); font-size: 30px; margin: 0 0 14px; }

/* Ч/б фото з білою рамкою */
.bw { display: block; background: #fff; padding: 7px; box-shadow: 0 12px 28px rgba(0,0,0,.16); }
.bw img { display: block; width: 100%; object-fit: cover; filter: grayscale(1) contrast(1.06); }

.btn {
  display: inline-block;
  margin-top: 12px;
  padding: 9px 26px;
  border: 1.5px solid var(--red);
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
  color: var(--red);
  font-family: var(--script);
  font-size: 19px;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.btn:hover { background: var(--red); color: #fff; }

/* ---------- 1. «Любов — це...» з рукописним візерунком ---------- */
.hero { padding-top: 46px; padding-bottom: 30px; }
.hero .caps { text-align: left; }
.pattern { position: absolute; left: -10%; right: -10%; top: 92px; height: 330px; overflow: hidden; pointer-events: none; transform: rotate(-8deg); }
.pattern div { font-family: var(--script); color: var(--red); font-size: 38px; line-height: 1.6; white-space: nowrap; opacity: .9; }
.pattern div:nth-child(even) { margin-left: -120px; }
.hero .bw { position: relative; width: 64%; margin: 30px auto 0; --r: -3deg; transform: rotate(var(--r)); }
.hero .bw img { aspect-ratio: 4 / 5; }
.to { font-family: var(--script); color: var(--red); font-size: 20px; margin-top: 18px; }

/* ---------- 2. Конверт ---------- */
.dreams .caps { text-align: right; }
.envelope { position: relative; width: min(84%, 340px); margin: 84px auto 10px; aspect-ratio: 1.45; }
.envelope .back { position: absolute; inset: 0; background: #B70E28; border-radius: 4px; }
/* Лист, що визирає з конверта */
.envelope .note {
  position: absolute;
  left: 7%;
  right: 7%;
  top: -38%;
  bottom: 14%;
  background: #FDFBF8;
  padding: 16px 16px;
  font-size: 11px;
  line-height: 1.45;
  overflow: hidden;
  text-align: left;
  transform: rotate(-4deg);
  box-shadow: 0 4px 14px rgba(0,0,0,.15);
  z-index: 1;
}
.envelope .note .sig { font-family: var(--script); color: var(--red); font-size: 16px; display: block; text-align: right; margin-top: 4px; }
/* Передня частина конверта з трикутниками */
.envelope .front {
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(to top right, #D11733 50%, transparent 50.3%) left bottom / 51% 100% no-repeat,
    linear-gradient(to top left, #C8102E 50%, transparent 50.3%) right bottom / 51% 100% no-repeat;
  border-radius: 4px;
  pointer-events: none;
}
.envelope .front::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 52%; background: linear-gradient(to bottom, transparent, rgba(0,0,0,.08)); }

/* ---------- 3. Відривний календар ---------- */
.tear { display: grid; grid-template-columns: 1fr 1.2fr 1fr; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); margin: 26px -24px 0; }
.tear div { border-left: 1px solid var(--ink); padding: 6px 0 10px; position: relative; }
.tear div:first-child { border-left: 0; }
.tear .w { font-family: var(--caps); text-transform: uppercase; font-size: 12px; letter-spacing: .06em; border-bottom: 1px solid var(--ink); padding-bottom: 6px; margin: 0 -1px 6px; }
.tear .m { font-size: 10px; color: var(--muted); }
.tear b { display: block; position: relative; font-family: var(--caps); font-weight: 300; font-size: 60px; line-height: 1; }
.tear .on b svg { position: absolute; left: 50%; top: 50%; width: 112px; height: 100px; transform: translate(-50%, -50%); pointer-events: none; }
.save { font-family: var(--script); font-size: 22px; margin-top: 14px; }

/* Хвиляста червона лінія */
.squiggle { display: block; width: 100%; height: 40px; }
.squiggle path { fill: none; stroke: var(--red); stroke-width: 1.4; vector-effect: non-scaling-stroke; }

/* ---------- 4. Церемонія і фото ---------- */
.cer p { max-width: 300px; margin-left: auto; margin-right: auto; }
.duo { position: relative; width: 62%; margin: 24px auto 0; --r: 2deg; transform: rotate(var(--r)); }
.duo img { aspect-ratio: 3 / 4; }

/* ---------- 5. Програма ---------- */
.prog { list-style: none; padding: 0; margin: 10px auto 0; max-width: 340px; text-align: left; }
.prog li { display: flex; gap: 16px; padding: 12px 0; border-bottom: 1px dashed rgba(200,16,46,.5); }
.prog li:last-child { border-bottom: 0; }
.prog .t { font-family: var(--script); color: var(--red); font-size: 22px; min-width: 64px; line-height: 1.1; }
.prog b { display: block; font-weight: 400; text-transform: uppercase; letter-spacing: .04em; }
.prog small { color: var(--muted); }

/* ---------- 6. Побажання у бульбашках ---------- */
.bubbles { display: grid; gap: 22px; margin-top: 16px; }
.bubble { position: relative; border: 1.4px solid var(--red); border-radius: 255px 25px 225px 25px / 25px 225px 25px 255px; padding: 18px 22px; text-align: center; font-size: 12.5px; max-width: 300px; }
.bubble:nth-child(odd) { margin-right: auto; }
.bubble:nth-child(even) { margin-left: auto; }
.bubble .num { position: absolute; top: -18px; font-family: var(--script); color: var(--red); font-size: 22px; background: var(--paper); padding: 0 6px; }
.bubble:nth-child(odd) .num { left: 14px; }
.bubble:nth-child(even) .num { right: 14px; }

/* ---------- 7. Записка зі скріпкою ---------- */
.clip { position: relative; background: #fff; max-width: 330px; margin: 16px auto 0; padding: 28px 22px 22px; box-shadow: 0 8px 20px rgba(0,0,0,.08); }
.clip .pin { position: absolute; left: 22px; top: -18px; width: 22px; height: 52px; }
.clip .title { font-size: 26px; margin-bottom: 8px; }
.icons { display: flex; justify-content: center; gap: 14px; margin-top: 10px; }
.icons a { width: 34px; height: 34px; border-radius: 50%; background: var(--red); color: #fff; display: flex; align-items: center; justify-content: center; }
.icons svg { width: 16px; height: 16px; }

/* ---------- 8. «Будьмо!» і таймер ---------- */
.cheers { position: relative; padding: 70px 0 60px; overflow: hidden; }
.cheers .pattern { top: 40px; height: 210px; transform: rotate(-6deg); }
.cheers .pattern div { font-size: 44px; }
.cheers .bw { position: relative; width: 56%; margin: 0 auto; --r: -2deg; transform: rotate(var(--r)); }
.cheers .bw img { aspect-ratio: 4 / 3; }
.count { display: flex; justify-content: center; gap: 18px; margin-top: 18px; }
.count b { display: block; font-family: var(--caps); font-weight: 300; font-size: 34px; line-height: 1; }
.count small { font-size: 11px; color: var(--muted); }

/* ---------- 9. Анкета ---------- */
.formcard { margin-top: 16px; text-align: left; background: #fff; padding: 22px 18px; box-shadow: 0 8px 20px rgba(0,0,0,.06); }

/* ---------- 10. Фінал ---------- */
.final { padding-bottom: 40px; }
.final .bw { width: 58%; margin: 0 0 0 4%; --r: -2deg; transform: rotate(var(--r)); }
.final .bw img { aspect-ratio: 3 / 4; }
.withlove { position: absolute; right: 24px; bottom: 96px; text-align: right; }
.withlove .w { display: block; font-family: var(--caps); font-weight: 300; font-size: 38px; line-height: 1; letter-spacing: .02em; }
.withlove .l { font-family: var(--script); color: var(--red); font-size: 36px; line-height: .8; display: block; margin-top: -6px; }
.final .names { font-family: var(--caps); text-transform: uppercase; letter-spacing: .12em; font-size: 12px; margin-top: 26px; text-align: right; }
.foot { font-size: 11px; color: var(--muted); text-align: center; padding: 10px 0 30px; }

/* Плавна поява */
.rise { opacity: 0; transform: translateY(18px); transition: opacity .8s ease, transform .8s ease; }
.rise.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .rise { opacity: 1; transform: none; transition: none; } }

/* ---------- Комп'ютер ---------- */
@media (min-width: 900px) {
  body { font-size: 14px; background: #2b2829; }
  .backdrop { display: block; position: fixed; inset: -40px; background: var(--bg) center / cover no-repeat; filter: grayscale(1) blur(12px) brightness(.5); z-index: -1; }
  .sheet { max-width: 1080px; margin: 50px auto; box-shadow: 0 30px 80px rgba(0,0,0,.45); }
  .blk { padding: 70px 80px; }
  .caps { font-size: 30px; }
  .title { font-size: 40px; }

  .two { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
  .two > div { min-width: 0; }

  .hero { min-height: 640px; }
  .pattern { top: 120px; height: 460px; }
  .pattern div { font-size: 54px; }
  .hero .bw { width: 340px; }

  .envelope { margin-top: 120px; }
  .tear { margin: 26px 0 0; }
  .tear b { font-size: 84px; }

  .bubbles { grid-template-columns: 1fr 1fr; gap: 34px 40px; }
  .bubble { max-width: none; margin: 0 !important; }

  .cheers .pattern div { font-size: 64px; }
  .cheers .bw { width: 380px; }
  .count b { font-size: 50px; }
  .formcard { max-width: 560px; margin-left: auto; margin-right: auto; }

  .final .bw { width: 360px; margin-left: 12%; }
  .withlove { right: 14%; bottom: 140px; }
  .withlove .w { font-size: 64px; }
  .withlove .l { font-size: 60px; }
}

/* Лист виїжджає з конверта, коли той з'являється */
.envelope .note { transition: transform 1.3s cubic-bezier(.2,.8,.2,1) .5s; }
.envelope:not(.in) .note { transform: translateY(62%) rotate(0); }
@media (prefers-reduced-motion: reduce) { .envelope .note { transform: rotate(-4deg) !important; } }
