/* Одна колонка шириной с телефон: на компьютере она стоит по центру на тёмно-синем фоне. */
:root {
  --snow: #f5f7fa;
  --ink: #0d1e35;
  --steel: #3b546a;
  --muted: #5e7082;
  --ice: #728aa9;
  --ice-light: #a9bdd6;
  --night: #0d1e35;
  --night-2: #1a2f52;

  --f-head: "Forum", "Times New Roman", serif;
  --f-num: "Playfair Display", "Times New Roman", serif;
  --f-names: "Cormorant Garamond", "Times New Roman", serif;
  --f-script: "Great Vibes", "Snell Roundhand", cursive;
  --f-body: "Montserrat", "Helvetica Neue", Arial, sans-serif;
  --f-type: "Anonymous Pro", "Courier New", monospace;

  --col: 480px;
  --gutter: max(24px, env(safe-area-inset-left, 0px));
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: radial-gradient(120% 80% at 50% 0%, var(--night-2), var(--night) 70%) fixed var(--night);
  color: var(--ink);
  font: 300 15px/1.65 var(--f-body);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, p, figure, ol, ul { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ice); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
html.intro-active { overflow: hidden; }

.page {
  position: relative;
  max-width: var(--col);
  margin: 0 auto;
  background: var(--snow);
  box-shadow: 0 0 80px rgba(0, 0, 0, .35);
  overflow: hidden;
}

/* Общие элементы */
.h2 {
  font: 400 clamp(34px, 10.5vw, 46px)/1 var(--f-head);
  text-transform: uppercase;
  letter-spacing: .01em;
  text-align: center;
  text-wrap: balance;
}
.script { font: 400 clamp(30px, 9vw, 38px)/1.2 var(--f-script); color: var(--ice); text-align: center; }
.lead { max-width: 30ch; margin-inline: auto; text-align: center; color: var(--steel); text-wrap: balance; }
/* «&» везде один и тот же: спокойный Cormorant Garamond 400, цвет и регистр от имён рядом. */
.amp { font-family: var(--f-names); font-weight: 400; letter-spacing: 0; text-transform: none; }
.vline { display: block; width: 1px; height: 72px; margin: 28px auto; background: var(--ice-light); }
.vline--light { background: rgba(255, 255, 255, .45); }
.section { padding: 88px var(--gutter); display: grid; justify-items: center; gap: 18px; }
.section > .vline { margin-block: 10px; }

.btn {
  display: inline-block;
  padding: 15px 30px;
  background: var(--night);
  color: #fff;
  font: 500 12px/1 var(--f-body);
  letter-spacing: .18em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid var(--night);
  border-radius: 2px;
  transition: background .2s, color .2s;
}
.btn:hover { background: var(--night-2); }
.btn--ghost { background: transparent; color: var(--night); }
.btn--ghost:hover { background: var(--night); color: #fff; }

/* Снег рисуется в canvas поверх фона секции */
.snow { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* Заставка «Вы получили приглашение» */
.intro {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  color: #fff;
  text-align: center;
  cursor: pointer;
  background:
    linear-gradient(180deg, rgba(13, 30, 53, .55), rgba(13, 30, 53, .9)),
    url(../img/intro-bg.jpg) center / cover var(--night);
  transition: opacity .9s ease, visibility .9s;
}
html:not(.js) .intro, html.intro-done .intro { opacity: 0; visibility: hidden; }
.intro__inner { position: relative; display: grid; justify-items: center; gap: 6px; }
.intro__kicker { font: 400 15px/1 var(--f-body); letter-spacing: .32em; text-transform: uppercase; padding-left: .32em; }
.intro__title { font: 400 clamp(60px, 19vw, 84px)/1.15 var(--f-script); margin-top: 4px; }
.intro__hint { margin-top: 64px; font-size: 13px; opacity: .85; }
.intro__tap { width: 48px; height: 48px; margin-top: 10px; fill: none; stroke: #fff; stroke-width: 1.4; }
.intro__tap .ring { transform-origin: 24px 24px; animation: tap 1.8s ease-out infinite; }
@keyframes tap { from { transform: scale(1); opacity: .9; } to { transform: scale(3.4); opacity: 0; } }

/* Первый экран */
.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 600px;
  max-height: 940px;
  isolation: isolate;
}
.hero picture, .hero__img { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero__img { object-fit: cover; object-position: 38% 50%; z-index: -2; }
/* Имена — готовая надпись пары (SVG) как маска: форма из файла, цвет задаётся здесь. */
.hero__names {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 72px);
  left: 50%;
  width: min(84%, 400px);
  aspect-ratio: 1852 / 810;
  transform: translateX(-50%);
  background: #fff;
  -webkit-mask: url(../img/names.svg) center / contain no-repeat;
  mask: url(../img/names.svg) center / contain no-repeat;
}
.sound {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 26px);
  right: 18px;
  width: 52px; height: 52px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .22);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: #fff;
  cursor: pointer;
}
.sound svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.sound .off, .sound[aria-pressed="false"] .on { display: none; }
.sound[aria-pressed="false"] .off { display: inline; }

/* Приглашение и дата */
.invite { padding-bottom: 104px; }
.days {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: 100%;
  max-width: 400px;
  border-block: 1px solid var(--ink);
}
.day { position: relative; display: grid; justify-items: center; text-align: center; padding-bottom: 22px; }
.day + .day { border-left: 1px solid var(--ink); }
.day__wd {
  width: 100%;
  padding: 9px 0 8px;
  border-bottom: 1px solid var(--ink);
  font: 400 clamp(10px, 3vw, 13px)/1.2 var(--f-head);
  letter-spacing: .02em;
  text-transform: uppercase;
}
.day__mo { margin-top: 16px; font: 700 clamp(13px, 3.8vw, 16px)/1 var(--f-type); }
.day__num { font: 400 clamp(54px, 18vw, 76px)/1 var(--f-num); letter-spacing: -.02em; margin-top: 6px; }
.day--main .day__num { position: relative; z-index: 1; }
.heart {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  width: 150%;
  transform: translate(-50%, -50%) rotate(-4deg);
  overflow: visible;
  pointer-events: none;
}
.heart__stroke { stroke-dasharray: 1; stroke-dashoffset: 0; }
/* Сердце рисуется, когда блок с датой появляется на экране */
.js .days:not(.is-drawn) .heart__stroke { stroke-dashoffset: 1; }
.js .days .heart__stroke { transition: stroke-dashoffset 1.8s cubic-bezier(.6, .1, .3, 1); }
.js .days .heart__stroke--2 { transition-delay: .25s; }

/* Место */
.place { padding: 64px 20px; background: var(--night); }
.place__card {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 56px 24px 52px;
  background: var(--snow);
  text-align: center;
}
.pin { width: 40px; height: 52px; fill: none; stroke: var(--ice); stroke-width: 1.4; margin-bottom: 8px; }
.place__card .script { margin-top: -6px; }
.place__addr { color: var(--steel); margin-bottom: 14px; }

/* Программа */
.timeline { list-style: none; padding: 0; width: 100%; max-width: 360px; display: grid; }
/* Зигзаг: текст занимает 62% строки, иконка стоит в свободной части напротив. */
.timeline li { display: grid; grid-template-columns: 62% 1fr; grid-template-areas: "text icon"; align-items: center; padding-bottom: 46px; position: relative; text-align: center; }
.timeline li:nth-child(even) { grid-template-columns: 1fr 62%; grid-template-areas: "icon text"; }
.timeline li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 31%;
  bottom: 8px;
  width: 1px;
  height: 30px;
  background: var(--ice-light);
}
.timeline li:nth-child(even)::after { left: 69%; }
.timeline__text { grid-area: text; display: grid; gap: 2px; }
/* Иконки — рисунки-маски: цвет берётся из --ice, картинка задаёт только форму. */
.timeline__icon { grid-area: icon; justify-self: center; width: 84px; height: 84px; background: var(--ice); -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }
.timeline__icon--gather { --icon: url(../img/program/gather.png); }
.timeline__icon--ceremony { --icon: url(../img/program/ceremony.png); }
.timeline__icon--banquet { --icon: url(../img/program/banquet.png); }
.timeline__icon--evening { --icon: url(../img/program/evening.png); }
.timeline time { font: 400 30px/1.1 var(--f-num); font-variant-numeric: lining-nums; }
.timeline__text span { font-size: 13.5px; color: var(--steel); text-wrap: balance; }

/* Дресс-код */
/* Кружки ткани: по 4 в ряд, размер тянется от ширины экрана, последний ряд по центру. */
.swatches { --gap: 12px; list-style: none; padding: 0; width: 100%; max-width: 336px; display: flex; flex-wrap: wrap; justify-content: center; gap: var(--gap); }
.swatches li { width: calc((100% - 3 * var(--gap)) / 4); }
.swatches img { width: 100%; filter: drop-shadow(0 4px 8px rgba(13, 30, 53, .18)); }

/* Обратный отсчёт */
.countdown { padding: 0 20px; }
.countdown__card {
  position: relative;
  overflow: hidden;
  padding: 64px 16px 60px;
  background: linear-gradient(180deg, var(--night-2), var(--night));
  color: #fff;
  text-align: center;
}
.countdown__card .h2 { position: relative; }
.timer { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.timer b { display: block; font: 400 clamp(34px, 11vw, 46px)/1 var(--f-num); font-variant-numeric: tabular-nums lining-nums; }
.timer span { display: block; margin-top: 8px; font-size: 12px; letter-spacing: .06em; opacity: .8; }

/* Пожелания */
.gift { width: 44px; height: 44px; fill: none; stroke: var(--ice); stroke-width: 1.3; stroke-linejoin: round; margin-bottom: 6px; }

/* Финал */
.final { padding: 88px var(--gutter) 140px; display: grid; justify-items: center; gap: 10px; text-align: center; }
.final .script { font-size: clamp(38px, 11vw, 48px); color: var(--ink); }
.final__with { font-size: 13px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); padding-left: .2em; }
.final__names { margin-top: 14px; font: 400 clamp(40px, 12vw, 54px)/1 var(--f-head); text-transform: uppercase; }
.final__photo { width: min(84%, 400px); margin-top: 34px; padding: 10px; background: #fff; box-shadow: 0 14px 40px -18px rgba(13, 30, 53, .45); }
.final__photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 60%; }
.final__date { margin-top: 26px; font: 400 14px/1 var(--f-body); letter-spacing: .3em; color: var(--muted); padding-left: .3em; }

/* Кнопка анкеты внизу экрана */
.cta {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: 0;
  width: min(100%, var(--col));
  transform: translate(-50%, 0);
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px));
  background: var(--night);
  color: #fff;
  text-align: center;
  font: 500 13px/1 var(--f-body);
  letter-spacing: .16em;
  text-transform: uppercase;
  text-decoration: none;
  transition: transform .35s ease;
}
.cta.is-hidden, .intro-active .cta { transform: translate(-50%, 110%); }

/* Появление блоков при прокрутке: без JS всё видно сразу */
.js [data-reveal] { opacity: 0; transform: translateY(14px); transition: opacity .9s ease, transform .9s ease; }
.js [data-reveal].is-visible { opacity: 1; transform: none; }

@media (min-width: 520px) {
  .hero { height: min(100vh, 900px); }
  :root { --gutter: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
  .js .days:not(.is-drawn) .heart__stroke { stroke-dashoffset: 0; }
}
