/* ============================================================
   Приглашение Данила & Полина
   Mobile-first, с акцентом на Safari/iOS.
   ============================================================ */

:root{
  --wine:#6e1526;
  --wine-deep:#5a1020;
  --cream:#f4eee2;
  --cream-soft:#efe7d7;
  --ink:#3d2b2b;
  --ink-soft:#6b5450;
  --script:#7a1a2a;
  --dark:#1b1918;
  --line:rgba(122,26,42,.22);
  --line-light:rgba(244,238,226,.28);

  --font-hand:'Marck Script', cursive;
  --font-body:'Montserrat', system-ui, sans-serif;

  --maxw:500px;

  /* красное сердце (заливка) для блоков на кремовом */
  --heart-wine:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21s-7-4.4-9.6-8.5C.9 9.6 2.6 6 6.2 6 8.6 6 10.4 7.6 12 9.6 13.6 7.6 15.4 6 17.8 6c3.6 0 5.3 3.6 3.8 6.5C19 16.6 12 21 12 21z' fill='%237a1a2a'/%3E%3C/svg%3E");
  /* кремовое сердце для блоков на бордовом */
  --heart-cream:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21s-7-4.4-9.6-8.5C.9 9.6 2.6 6 6.2 6 8.6 6 10.4 7.6 12 9.6 13.6 7.6 15.4 6 17.8 6c3.6 0 5.3 3.6 3.8 6.5C19 16.6 12 21 12 21z' fill='%23f4eee2'/%3E%3C/svg%3E");
  /* контур сердца для подсветки даты */
  --heart-outline:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21s-7-4.4-9.6-8.5C.9 9.6 2.6 6 6.2 6 8.6 6 10.4 7.6 12 9.6 13.6 7.6 15.4 6 17.8 6c3.6 0 5.3 3.6 3.8 6.5C19 16.6 12 21 12 21z' fill='none' stroke='%23f4eee2' stroke-width='1.4'/%3E%3C/svg%3E");
}

*,*::before,*::after{box-sizing:border-box}

html{
  -webkit-text-size-adjust:100%;   /* iOS: не раздувать шрифт при повороте */
  text-size-adjust:100%;
  scroll-behavior:smooth;
}

body{
  margin:0;
  background:var(--dark);
  color:var(--ink);
  font-family:var(--font-body);
  font-size:16px;
  line-height:1.6;
  -webkit-font-smoothing:antialiased;
  -webkit-tap-highlight-color:transparent;  /* iOS: убрать вспышку по тапу */
  /* безопасные зоны iPhone */
  padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

img{max-width:100%;height:auto;display:block}
a{color:inherit}

/* ---------- Колонка-«телефон» ---------- */
.page{
  max-width:var(--maxw);
  margin:0 auto;
  background:var(--cream);
  overflow:hidden;
}
@media (min-width:540px){
  .page{
    margin:24px auto;
    border-radius:18px;
    box-shadow:0 30px 70px rgba(0,0,0,.45);
  }
}

/* ---------- Блоки ---------- */
.block{
  position:relative;
  padding:46px 24px;
}
.block--cream{background:var(--cream);color:var(--ink)}
.block--wine{background:var(--wine);color:var(--cream)}
.block + .block{margin-top:0}

/* «рваный» край бумаги сверху блока */
.tear{
  position:absolute;
  top:0;left:0;right:0;
  height:18px;
  transform:translateY(-17px);
  background-size:100% 100%;
  background-repeat:no-repeat;
  pointer-events:none;
}
.tear--cream{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 500 24' preserveAspectRatio='none'%3E%3Cpath d='M0 24 L0 11 L20 7 L42 12 L66 6 L92 11 L120 5 L150 12 L182 7 L214 13 L248 6 L284 12 L320 7 L356 13 L392 6 L430 12 L466 7 L500 11 L500 24 Z' fill='%23f4eee2'/%3E%3C/svg%3E")}
.tear--wine{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 500 24' preserveAspectRatio='none'%3E%3Cpath d='M0 24 L0 11 L20 7 L42 12 L66 6 L92 11 L120 5 L150 12 L182 7 L214 13 L248 6 L284 12 L320 7 L356 13 L392 6 L430 12 L466 7 L500 11 L500 24 Z' fill='%236e1526'/%3E%3C/svg%3E")}

/* ---------- Типографика ---------- */
.hand{font-family:var(--font-hand);font-weight:400;line-height:1.05}
.center{text-align:center}
.small{font-size:.86rem;color:var(--ink-soft)}
.block--wine .small{color:rgba(244,238,226,.8)}
.muted{opacity:.7;font-size:.86em}
p{margin:0 0 14px}
.block > p:last-child{margin-bottom:0}

.head{
  text-align:center;
  font-size:2.1rem;
  color:var(--script);
  margin:0 0 22px;
  position:relative;
}
.block--wine .head{color:var(--cream)}
.head::after{   /* рукописное подчёркивание-волна */
  content:"";
  display:block;
  width:120px;height:9px;
  margin:6px auto 0;
  background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 9'%3E%3Cpath d='M2 5 C20 1 30 8 48 5 S86 1 118 6' fill='none' stroke='%237a1a2a' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center/contain no-repeat;
}
.block--wine .head::after{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 9'%3E%3Cpath d='M2 5 C20 1 30 8 48 5 S86 1 118 6' fill='none' stroke='%23f4eee2' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E")}

.lead{font-size:1.12rem}

/* ---------- Сердечки ---------- */
.heart{
  display:inline-block;
  background:var(--heart-wine) center/contain no-repeat;
  position:absolute;
}
.block--wine .heart{background-image:var(--heart-cream)}
.heart--xs{width:20px;height:20px}
.heart--sm{width:32px;height:32px}
.center-heart{position:static;display:block;margin:18px auto 0}

/* ---------- ШАПКА ---------- */
.hero{padding-top:42px;text-align:center;background:#f8ede1} /* под цвет фона композита hero.png */
.hero__title{
  font-size:3.4rem;
  color:var(--script);
  margin:0 0 6px;
}
/* композит-арт шапки во всю ширину колонки (отменяем боковые паддинги блока) */
.hero__art{
  display:block;
  width:calc(100% + 48px);
  max-width:none;
  margin:10px -24px 6px;
}
.kids{
  position:relative;
  display:flex;
  justify-content:center;
  align-items:flex-end;
  gap:6px;
  margin:18px auto 6px;
  max-width:400px;
}
.kid{margin:0;flex:1;min-width:0;display:flex;flex-direction:column;align-items:center}
.kid__img{
  display:block;width:100%;height:auto;
  filter:drop-shadow(0 7px 12px rgba(0,0,0,.22));
}
.kid__label{
  font-size:1.5rem;
  color:var(--script);
  margin-bottom:6px;
}
.banner{
  display:inline-block;
  margin:14px auto 0;
  padding:8px 26px;
  background:var(--wine);
  color:var(--cream);
  border-radius:40% 60% 55% 45%/60% 50% 55% 45%;
  transform:rotate(-2deg);
  box-shadow:0 6px 16px rgba(110,21,38,.3);
}
.banner .hand{font-size:1.7rem}
.hero__names{
  margin-top:20px;
  font-weight:600;
  letter-spacing:.04em;
  color:var(--ink-soft);
}

/* ---------- Плейсхолдеры фото ---------- */
.ph{
  display:flex;align-items:center;justify-content:center;
  text-align:center;
  background:repeating-linear-gradient(45deg,var(--cream-soft),var(--cream-soft) 12px,#e9dfcc 12px,#e9dfcc 24px);
  color:var(--ink-soft);
  border:2px dashed var(--line);
  border-radius:8px;
  font-size:.8rem;line-height:1.3;
  padding:6px;
}
.ph small{font-size:.72rem;opacity:.7}
.ph--kid{aspect-ratio:3/4}
.ph--venue{aspect-ratio:4/3}
.ph--couple{aspect-ratio:1/1}

/* ---------- Полароиды ---------- */
.polaroid{
  background:#fff;
  padding:10px 10px 30px;
  box-shadow:0 10px 24px rgba(0,0,0,.22);
  border-radius:3px;
  position:relative;
}
.polaroid--rot{transform:rotate(-2deg);max-width:300px;margin:8px auto 18px}
.polaroid--rot-l{transform:rotate(-4deg)}
.polaroid--rot-r{transform:rotate(4deg)}
.polaroid__cap{
  position:absolute;left:0;right:0;bottom:6px;
  text-align:center;color:#7a1a2a;font-size:1.1rem;
}

/* ---------- Календарь ---------- */
.cal{
  max-width:340px;margin:0 auto;
  border:1.5px solid var(--line-light);
  border-radius:6px;
  overflow:hidden;
}
.cal__top{
  display:flex;justify-content:space-between;
  padding:10px 18px;
  font-size:1.7rem;
  border-bottom:1.5px solid var(--line-light);
}
.cal__grid{display:grid;grid-template-columns:repeat(3,1fr)}
.cal__dow{
  text-align:center;padding:8px 4px;font-size:1.2rem;
  border-bottom:1.5px solid var(--line-light);
}
.cal__dow:not(:last-child),.cal__num:not(:last-child){border-right:1.5px solid var(--line-light)}
.cal__num{
  text-align:center;padding:20px 0;font-size:1.8rem;font-weight:500;
  position:relative;
}
.cal__num--hl{color:var(--cream);font-weight:700}
.cal__num--hl::before{
  content:"";position:absolute;left:50%;top:50%;
  width:62px;height:62px;
  transform:translate(-50%,-52%);
  background:var(--heart-outline) center/contain no-repeat;
}

/* ---------- Локации ---------- */
.loc{
  text-align:center;
  padding:18px 0;
}
.loc + .loc{border-top:1px dashed var(--line);margin-top:6px}
.loc__title{font-size:1.8rem;color:var(--script);margin-bottom:2px}
.loc__time{font-size:1.5rem;font-weight:700;color:var(--ink);margin:0 0 8px}
.loc__addr{font-weight:600;margin:12px 0 14px}

/* ---------- Кнопки ---------- */
.btn{
  display:inline-block;
  min-height:44px;line-height:24px;   /* комфортная зона тапа iOS */
  padding:10px 30px;
  background:var(--wine);color:var(--cream);
  text-decoration:none;font-weight:600;font-size:.95rem;
  border-radius:6px;
  border:2px solid var(--wine);
  transition:transform .15s ease, background .15s ease;
}
.block--wine .btn{background:var(--cream);color:var(--wine);border-color:var(--cream)}
.btn:active{transform:scale(.97)}
.btn-row{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;margin-top:18px}
.btn--map{padding:10px 16px;font-size:.9rem}
/* акцентная надпись-CTA в блоке подтверждения */
.rsvp-cta{
  display:flex;align-items:center;justify-content:center;gap:10px;flex-wrap:wrap;
  text-align:center;font-family:var(--font-hand);font-size:2rem;line-height:1.1;
  color:var(--script);margin:26px 0 4px;
}
.rsvp-cta .heart{position:static;width:26px;height:26px}

/* ---------- Пара ---------- */
.couple{text-align:center}
.polaroids{
  display:flex;justify-content:center;gap:10px;
  margin:6px auto 22px;max-width:360px;
}
.polaroids .polaroid{flex:1}
.couple__names{font-size:2rem;display:flex;align-items:center;justify-content:center;gap:10px;flex-wrap:wrap}
.couple__names span{font-size:1.5rem;opacity:.8}
.couple__names .heart{position:static}
.polaroids-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px;max-width:360px;margin:8px auto 24px}
.polaroid--photo{padding:7px 7px 9px;margin:0}
/* ч/б запечён в сами файлы (Pillow), без CSS-фильтра - чтобы не ловить баг Safari с filter+transform */
.couple .polaroid--photo img{display:block;width:100%;height:auto;aspect-ratio:3/4;object-fit:cover;object-position:center}

/* ---------- Тайминг ---------- */
.tl{list-style:none;margin:0 auto;padding:0;max-width:360px;position:relative}
.tl::before{
  content:"";position:absolute;left:23px;top:8px;bottom:8px;
  border-left:2px dashed var(--line);
}
.tl__item{
  position:relative;
  display:grid;
  grid-template-columns:48px 1fr;
  grid-template-areas:"ic time" "ic text";
  column-gap:14px;
  padding:10px 0 18px;
}
.tl__ic{grid-area:ic;display:flex;align-items:center;justify-content:center;
  width:48px;height:48px;background:var(--cream);border-radius:50%;z-index:1}
.ic{width:30px;height:30px;fill:none;stroke:var(--wine);stroke-width:1.6;stroke-linejoin:round}
.tl__time{grid-area:time;font-size:1.5rem;color:var(--script);line-height:1}
.tl__text{grid-area:text;margin:2px 0 0}

/* ---------- Списки-«фишки» ---------- */
.chips{list-style:none;padding:0;margin:14px auto 14px;max-width:360px;
  display:flex;flex-wrap:wrap;justify-content:center;gap:8px}
.chips li{
  background:rgba(244,238,226,.14);
  border:1px solid var(--line-light);
  border-radius:30px;padding:7px 16px;font-size:.9rem;
}
.ticks{list-style:none;padding:0;margin:14px auto;max-width:360px}
.ticks li{position:relative;padding:6px 0 6px 30px}
.ticks li::before{
  content:"";position:absolute;left:0;top:9px;width:18px;height:18px;
  background:var(--heart-wine) center/contain no-repeat;
}

/* ---------- Контакты ---------- */
.contacts{display:flex;flex-direction:column;gap:12px;max-width:340px;margin:18px auto 0}
.contact{
  display:flex;justify-content:space-between;align-items:baseline;gap:12px;
  border-bottom:1px dashed var(--line-light);padding-bottom:10px;
}
.contact__name{font-size:1.4rem}
.contact__val{font-weight:600}

/* ---------- Подпись ---------- */
.sign{text-align:center;padding-bottom:54px}
.sign__names{font-size:2.2rem;color:var(--script);margin:4px 0 0}
.block--wine .sign__names{color:var(--cream)}
.sign__hearts{position:relative;height:34px;margin-top:10px}
.sign__hearts .heart{position:static;margin:0 5px;vertical-align:middle}
/* подпись разработчика - ненавязчиво, снизу (блок sign на бордовом фоне -> светлые цвета) */
.credit{margin:30px auto 0;padding-top:16px;max-width:320px;border-top:1px solid var(--line-light);font-size:.9rem;color:rgba(244,238,226,.88);letter-spacing:.02em}
.credit a{color:var(--cream);font-weight:700;text-decoration:none;white-space:nowrap;border-bottom:1px solid rgba(244,238,226,.7)}

/* ---------- Появление при скролле ---------- */
.js .reveal{opacity:0;transform:translateY(16px);transition:opacity .6s ease,transform .6s ease}
.js .reveal.is-visible{opacity:1;transform:none}
@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  .js .reveal{opacity:1;transform:none;transition:none}
}
