/* ===========================================================
   «Є привід» · стиль «Скетч»
   Кремовий папір, червоні малюнки від руки, рукописні заголовки.
   Кольори:
     --paper  тло-папір        --red   основний червоний
     --ink    темний текст     --soft  світла червона заливка
   =========================================================== */
:root {
  --paper: #FBF4EA;
  --red: #B3122E;
  --ink: #4A1A20;
  --muted: #8A6A6E;
  --soft: #F6E3DF;
  --hand: 'Caveat', 'Comic Sans MS', cursive;
  --body: 'Manrope', system-ui, sans-serif;
}

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

/* Аркуш паперу посередині: на телефоні на всю ширину, на комп'ютері як листівка */
.sheet {
  max-width: 520px;
  margin: 0 auto;
  background: var(--paper);
  overflow: hidden;
  position: relative;
}
@media (min-width: 560px) {
  .sheet { margin: 28px auto; border-radius: 26px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
}

.blk { padding: 54px 26px; text-align: center; position: relative; }
.blk p { margin: 0 0 12px; font-size: 15px; }

/* Рукописний заголовок із підкресленням-скрайбом */
.h {
  font-family: var(--hand);
  color: var(--red);
  font-weight: 700;
  font-size: 40px;
  line-height: 1.05;
  margin: 0 0 18px;
  display: inline-block;
  position: relative;
}
.h::after {
  content: "";
  position: absolute;
  left: -6px; right: -6px; bottom: -6px;
  height: 10px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 10' preserveAspectRatio='none'%3E%3Cpath d='M2 6 C 40 2, 80 9, 120 5 S 180 3, 198 6' fill='none' stroke='%23B3122E' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}

/* Усі малюнки трохи «тремтять», ніби намальовані ручкою */
.doodle { filter: url(#rough); }
.doodle * { vector-effect: non-scaling-stroke; }

/* Кнопка-штамп */
.btn {
  display: inline-block;
  margin-top: 10px;
  padding: 13px 28px;
  border: 2px solid var(--red);
  border-radius: 999px 900px 999px 850px;
  color: var(--red);
  font-family: var(--hand);
  font-size: 24px;
  font-weight: 700;
  text-decoration: none;
  background: #fff;
  transform: rotate(-1.5deg);
  transition: transform .15s, background .15s, color .15s;
}
.btn:hover { background: var(--red); color: #fff; transform: rotate(0); }

/* ---------- Обкладинка ---------- */
.hero { padding-top: 44px; padding-bottom: 40px; }
.to {
  font-family: var(--hand);
  font-size: 24px;
  color: var(--muted);
  margin-bottom: 8px;
}
.title {
  font-family: var(--hand);
  color: var(--red);
  font-weight: 700;
  font-size: clamp(44px, 12.5vw, 60px);
  line-height: .95;
  margin: 0;
}
.title .eq { display: block; font-size: .8em; margin-top: 6px; }
.title .eq u { text-decoration: none; position: relative; }
.title .eq u::after {
  content: "";
  position: absolute; left: -4px; right: -4px; bottom: -4px; height: 9px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 10' preserveAspectRatio='none'%3E%3Cpath d='M2 5 C 50 9, 100 1, 198 6' fill='none' stroke='%23B3122E' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}

/* Фото-«наліпка» з червоним контуром */
.cutout {
  position: relative;
  width: min(60%, 260px);
  margin: 34px auto 0;
}
.cutout .ph {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 46% 54% 44% 56% / 40% 42% 58% 60%;
  border: 7px solid #fff;
  outline: 3px solid var(--red);
  transform: rotate(-2deg);
}
/* Рукописні підписи збоку від фото */
.tag {
  position: absolute;
  font-family: var(--hand);
  font-size: 23px;
  font-weight: 700;
  color: var(--red);
  line-height: 1;
}
.tag.l { right: calc(100% - 18px); bottom: 20%; transform: rotate(-12deg); white-space: nowrap; background: var(--paper); padding: 2px 6px; border-radius: 8px; }
.tag.r { left: calc(100% - 18px); top: 10%; transform: rotate(12deg); white-space: nowrap; background: var(--paper); padding: 2px 6px; border-radius: 8px; }

/* Розкидані сердечка */
.hearts { position: absolute; inset: 0; pointer-events: none; }
.hearts svg { position: absolute; }

/* Червона стрічка з датою */
.ribbon {
  position: relative;
  display: inline-block;
  margin-top: -26px;
  padding: 12px 30px 14px;
  font-family: var(--hand);
  font-size: 30px;
  font-weight: 700;
  color: #fff;
  background: var(--red);
  border-radius: 40% 60% 46% 54% / 60% 50% 50% 40%;
  transform: rotate(-2deg);
  z-index: 2;
}
.hero .when { margin-top: 18px; font-size: 14px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

/* ---------- Колаж ч/б фото ---------- */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 8px;
  border: 3px solid var(--red);
  margin: 26px 0 0;
  position: relative;
}
.grid img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  filter: grayscale(1) contrast(1.05);
}
.grid .over { position: absolute; inset: 0; pointer-events: none; }
.grid .over svg { position: absolute; }

/* ---------- Календар ---------- */
.calcard {
  text-align: center;
  width: min(100%, 320px);
  margin: 26px auto 0;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 10px 26px rgba(74,26,32,.12);
  overflow: hidden;
  --r: -1.5deg;
  transform: rotate(var(--r));
}
.calcard .mh {
  background: var(--red);
  color: #fff;
  font-family: var(--hand);
  font-size: 26px;
  font-weight: 700;
  padding: 6px 0 8px;
}
.cal {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px 0;
  padding: 12px 10px 16px;
  font-size: 13px;
  color: var(--muted);
}
.cal-h { font-weight: 600; font-size: 11px; text-transform: uppercase; color: var(--ink); opacity: .55; }
.cal-d, .cal-e { height: 30px; line-height: 30px; position: relative; }
.cal-on em { position: relative; z-index: 1; color: #fff; font-style: normal; font-weight: 700; }
.cal-on svg { position: absolute; left: 50%; top: 50%; width: 38px; height: 38px; transform: translate(-50%, -52%); }
.calwrap { position: relative; }
.calwrap .candle { position: absolute; right: -8px; top: -58px; width: 54px; transform: rotate(8deg); }

/* ---------- Локація ---------- */
.pin { width: 44px; height: 44px; display: block; margin: 0 auto 6px; }
.blk .venue { font-family: var(--hand); font-size: 32px; font-weight: 700; color: var(--ink); margin: 0 0 4px; }

/* ---------- Програма дня з хвилястою ниткою ---------- */
.timeline { position: relative; margin-top: 16px; }
.timeline .thread { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; }
.step {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  min-height: 150px;
}
.step .txt { padding: 0 6px; }
.step .pic { display: flex; justify-content: center; }
.step .pic svg { width: 76px; height: 76px; }
.step:nth-child(odd) .txt { order: 2; text-align: left; padding-left: 18px; }
.step:nth-child(odd) .pic { order: 1; }
.step:nth-child(even) .txt { text-align: right; padding-right: 18px; }
.step .t { font-family: var(--hand); font-size: 34px; font-weight: 700; color: var(--ink); line-height: 1; }
.step .n { font-size: 14px; color: var(--muted); margin-top: 4px; }
.step .n b { display: block; color: var(--ink); font-weight: 600; }
.timeline .end { display: block; margin: 0 auto; width: 34px; height: 34px; position: relative; }

/* ---------- Дрес-код: кружечки, обведені від руки ---------- */
.dots { display: flex; justify-content: center; gap: 14px; margin-top: 16px; flex-wrap: wrap; }
.dots span { width: 50px; height: 50px; position: relative; }
.dots span i { position: absolute; inset: 6px; border-radius: 50%; }
.dots span svg { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ---------- Нотатки-деталі на скотчі ---------- */
.notes { display: grid; gap: 22px; margin-top: 18px; }
.note {
  background: #fff;
  padding: 26px 20px 18px;
  position: relative;
  box-shadow: 0 6px 16px rgba(74,26,32,.1);
  text-align: left;
}
.note:nth-child(odd) { transform: rotate(-1.2deg); }
.note:nth-child(even) { transform: rotate(1.4deg); }
.note::before {
  content: "";
  position: absolute;
  top: -10px; left: 50%;
  width: 80px; height: 22px;
  transform: translateX(-50%) rotate(-3deg);
  background: rgba(179,18,46,.18);
}
.note b { font-family: var(--hand); font-size: 26px; color: var(--red); display: block; line-height: 1.1; margin-bottom: 4px; }
.note p { margin: 0; font-size: 14px; color: var(--muted); }

/* ---------- Таймер в овалі ---------- */
.timer { position: relative; margin: 22px auto 0; width: min(100%, 360px); padding: 30px 26px; }
.timer > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.timer .row { position: relative; display: flex; justify-content: center; align-items: flex-start; gap: 2px; }
.timer .u { min-width: 52px; }
.timer .u b { display: block; font-family: var(--hand); font-size: 40px; line-height: 1; color: var(--ink); }
.timer .u small { font-size: 11px; color: var(--red); }
.timer .sep { font-family: var(--hand); font-size: 36px; color: var(--red); line-height: 1.1; }

/* ---------- Анкета ---------- */
.formcard {
  background: #fff;
  border-radius: 10px;
  padding: 22px 18px;
  margin-top: 18px;
  text-align: left;
  box-shadow: 0 10px 26px rgba(74,26,32,.1);
}

/* ---------- Фінал: фотобудка ---------- */
.final { padding-bottom: 70px; }
.final .big { font-family: var(--hand); font-size: 34px; font-weight: 700; color: var(--red); line-height: 1.2; margin: 0 0 12px; }
.final a { color: var(--red); }
.final .sign { font-family: var(--hand); font-size: 24px; color: var(--ink); }
.booth {
  position: relative;
  width: 168px;
  margin: 34px auto 0;
  background: var(--red);
  padding: 9px 9px 0;
  transform: rotate(3deg);
  box-shadow: 0 14px 30px rgba(74,26,32,.25);
}
.booth img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; margin-bottom: 9px; }
.booth-wrap { position: relative; }
.booth-wrap .hearts svg { width: 34px; }

.foot { text-align: center; padding: 22px; font-size: 12px; color: var(--muted); letter-spacing: .08em; }

/* ---------- Комп'ютер: широкий аркуш і дві колонки ---------- */
/* На телефоні обгортки тексту «прозорі» й не змінюють порядок блоків */
.hero .copy { display: contents; }

@media (min-width: 900px) {
  .sheet { max-width: 1040px; margin: 40px auto; }
  .blk { padding: 84px 80px; }
  .blk p { font-size: 16px; }
  .h { font-size: 48px; }

  /* Обкладинка: текст ліворуч, фото праворуч */
  .hero { display: grid; grid-template-columns: 1fr 1fr; column-gap: 40px; align-items: center; padding-top: 80px; padding-bottom: 80px; }
  .hero .copy { display: block; grid-column: 1; }
  .hero .c1 { align-self: end; }
  .hero .c2 { align-self: start; padding-top: 34px; }
  .hero .cutout { grid-column: 2; grid-row: 1 / span 2; width: min(80%, 360px); margin: 0 auto; }
  .title { font-size: 76px; }
  .ribbon { margin-top: 0; font-size: 34px; }

  /* Секції з двома колонками */
  .blk.two { display: grid; grid-template-columns: 1fr 1fr; column-gap: 70px; align-items: center; text-align: left; }
  .blk.two .copy { grid-column: 1; grid-row: 1; }
  .blk.two > .grid { grid-column: 2; grid-row: 1; margin: 0; }
  .blk.two.rev .copy { grid-column: 2; }
  .blk.two > .calwrap { grid-column: 1; grid-row: 1; }
  .blk.two .calcard { margin: 0 auto; }

  /* Програма, анкета й таймер не розтягуємо на всю ширину */
  .timeline { max-width: 640px; margin-left: auto; margin-right: auto; }
  .step .pic svg { width: 90px; height: 90px; }
  .formcard { max-width: 540px; margin-left: auto; margin-right: auto; }
  .timer { width: 440px; }

  /* Записки в три колонки */
  .notes { grid-template-columns: repeat(3, 1fr); gap: 26px; }

  .dots span { width: 62px; height: 62px; }
  .final .big { font-size: 42px; max-width: 640px; margin-left: auto; margin-right: auto; }
  .booth { width: 200px; }
}

/* Плавна поява блоків при прокрутці */
.rise { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.rise.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .rise { opacity: 1; transform: none; transition: none; } }
