/* ==========================================================================
   Свадебное приглашение — стили публичной страницы.
   Рукописный CSS без сборщика: файл отдаётся браузеру как есть.

   Порядок разделов:
     1. Шрифты
     2. Токены оформления
     3. База и типографика
     4. Каркас страницы
     5. Анимации появления
     6. Декор (росчерки, лепестки, подсказка прокрутки)
     7. Первый экран
     8. Обратный отсчёт и праздничный экран
     9. Разделы приглашения
    10. Форма RSVP
    11. Подвал
    12. Плеер
    13. Уважение к prefers-reduced-motion
   ========================================================================== */

/* ==========================================================================
   1. Шрифты
   Свои файлы, без обращения к fonts.googleapis.com: из России этот домен
   доступен не всегда, а сайт должен открываться одинаково у всех гостей.

   Разбиение по unicode-range повторяет сабсеты Google: браузер скачивает
   кириллический файл для текста и латинский — только если на странице
   реально встретились латинские буквы. Объединять эти правила нельзя:
   без unicode-range браузер возьмёт один сабсет на всё и молча потеряет
   часть символов.
   ========================================================================== */

/* Cormorant Garamond — переменный, 300..700, курсив */
@font-face {
  font-family: "Cormorant Garamond";
  font-style: italic;
  font-weight: 300 700;
  font-display: swap;
  src: url("../fonts/cormorant-garamond-cyrillic-ext-italic.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

@font-face {
  font-family: "Cormorant Garamond";
  font-style: italic;
  font-weight: 300 700;
  font-display: swap;
  src: url("../fonts/cormorant-garamond-cyrillic-italic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Cormorant Garamond";
  font-style: italic;
  font-weight: 300 700;
  font-display: swap;
  src: url("../fonts/cormorant-garamond-latin-ext-italic.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Cormorant Garamond";
  font-style: italic;
  font-weight: 300 700;
  font-display: swap;
  src: url("../fonts/cormorant-garamond-latin-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Cormorant Garamond — переменный, 300..700, прямое начертание */
@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("../fonts/cormorant-garamond-cyrillic-ext.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("../fonts/cormorant-garamond-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("../fonts/cormorant-garamond-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("../fonts/cormorant-garamond-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Manrope — переменный, 200..800 */
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("../fonts/manrope-cyrillic-ext.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("../fonts/manrope-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("../fonts/manrope-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("../fonts/manrope-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/*
 * Метрически подогнанные подменные шрифты. Они не дают вёрстке дёрнуться,
 * когда `font-display: swap` подменит системный шрифт на настоящий.
 * Если меняете шрифты — пересчитайте и эти значения.
 */
@font-face {
  font-family: "Cormorant Garamond Fallback";
  src: local("Times New Roman");
  ascent-override: 95.27%;
  descent-override: 29.59%;
  line-gap-override: 0%;
  size-adjust: 96.98%;
}

@font-face {
  font-family: "Manrope Fallback";
  src: local("Arial");
  ascent-override: 103.31%;
  descent-override: 29.07%;
  line-gap-override: 0%;
  size-adjust: 103.19%;
}

/* ==========================================================================
   2. Токены оформления
   Слоновая кость / фарфор / античное золото / глубокие чернила.
   У золота два оттенка: `--gold` для декоративных штрихов и крупного текста,
   `--gold-deep` там, где важен контраст по WCAG (капитель, подписи).
   `--porcelain` — тёплый белый для карточек и паспарту фотографий.
   ========================================================================== */

:root {
  --ivory: #FBF9F3;
  --ivory-deep: #F4EEE1;
  --champagne: #EADFC8;
  --champagne-soft: #F3EBDA;
  --porcelain: #FFFEFB;
  --gold: #B3925C;
  /* Достаточно тёмное, чтобы капитель проходила WCAG AA (4.5:1) даже на
     самом тёмном фоне разделов — шампани. */
  --gold-deep: #7D6136;
  --ink: #26232E;
  --ink-soft: rgba(38, 35, 46, 0.74);
  --ink-faint: rgba(38, 35, 46, 0.52);
  --white: #FFFFFF;

  /*
   * Те же цвета покомпонентно — для полупрозрачных вариантов:
   * rgb(var(--gold-rgb) / 0.3).
   *
   * Раньше здесь был color-mix(), но он требует iOS 16.4 (март 2023). На
   * iPhone постарше все такие объявления просто отбрасывались: карточки и
   * поля становились прозрачными, золотые линии исчезали, а инициалы на
   * первом экране теряли цвет и превращались в огромные почти чёрные буквы.
   * Синтаксис rgb(R G B / A) понимают все браузеры с 2019 года.
   * Меняете цвет — поправьте и пару рядом.
   */
  --ivory-rgb: 251 249 243;
  --ivory-deep-rgb: 244 238 225;
  --champagne-rgb: 234 223 200;
  --champagne-soft-rgb: 243 235 218;
  --porcelain-rgb: 255 254 251;
  --gold-rgb: 179 146 92;
  --gold-deep-rgb: 125 97 54;
  --ink-rgb: 38 35 46;
  --white-rgb: 255 255 255;

  --background: var(--ivory);
  --foreground: var(--ink);

  /* Тени тёплые, с золотисто-коричневым подтоном — холодный серый на
     слоновой кости выглядит грязно. */
  --shadow-soft: 0 24px 80px rgba(56, 45, 26, 0.09);
  --shadow-lift: 0 30px 90px rgba(56, 45, 26, 0.15);
  --shadow-card: 0 16px 50px rgba(56, 45, 26, 0.07);

  --radius-card: 1.25rem;

  /* Скругление интерфейсных элементов: поля, варианты ответа, кнопки счётчика. */
  --radius-ui: 0.75rem;

  /* Единое скругление для всех фотографий — и на сайте, и в админке. */
  --radius-photo: 1rem;

  --font-display: "Cormorant Garamond", "Cormorant Garamond Fallback", Georgia, "Times New Roman", serif;
  --font-sans: "Manrope", "Manrope Fallback", "Segoe UI", system-ui, sans-serif;

  /* Фирменная кривая замедления — длинная мягкая посадка. */
  --ease-luxury: cubic-bezier(0.22, 1, 0.36, 1);

  /*
   * Высота дорожки подсказки «Листайте». Из неё считается нижний отступ
   * первого экрана, поэтому менять её надо здесь, а не в двух местах:
   * подсказка лежит абсолютно у нижнего края и налезет на кнопки, если
   * место под неё не зарезервировать.
   */
  --cue-track: 4rem;
  --cue-gap: 1.5rem;
}

/* ==========================================================================
   3. База и типографика
   ========================================================================== */

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

html {
  overflow-x: hidden;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  /* Тонкая золотистая полоса прокрутки — тяжёлый серый ползунок Windows
     выбивается из оформления. Где свойство не поддерживается, браузер
     просто оставит свою полосу. */
  scrollbar-width: thin;
  scrollbar-color: rgb(179 146 92 / 0.55) transparent;
}

body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-feature-settings: "kern" 1, "liga" 1;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img,
video,
canvas,
svg {
  max-width: 100%;
}

img {
  display: block;
}

a,
button,
input,
select,
textarea,
label {
  touch-action: manipulation;
  /* Серо-синяя вспышка при касании на мобильных выглядит дешёво и не в тон
     остальному оформлению — гасим её, состояние нажатия отдаём :active. */
  -webkit-tap-highlight-color: transparent;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

p {
  margin: 0;
}

h1, h2, h3 {
  margin: 0;
  font-weight: 500;
}

ol, ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

legend {
  padding: 0;
}

:focus-visible {
  outline: 2px solid var(--gold-deep);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection {
  background: var(--gold);
  color: var(--white);
}

/* Крупный серифный набор: плотный интерлиньяж, лёгкий отрицательный трекинг */
.font-serif {
  font-family: var(--font-display);
}

/* Лёгкое начертание на крупных кеглях — то, что на визитке выглядит
   тонко, на плакате выглядит благородно. */
.heading-display {
  font-family: var(--font-display);
  font-weight: 430;
  line-height: 0.94;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.overline-label {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

.prose-body {
  color: var(--ink-soft);
  line-height: 1.9;
  text-wrap: pretty;
}

/* Размеры заголовков — те же clamp(), что были в оригинале */
.h-hero { font-size: clamp(3.4rem, 13vw, 9.5rem); }
.h-lg   { font-size: clamp(2.8rem, 8vw, 5.6rem); }
.h-md   { font-size: clamp(2.6rem, 7.5vw, 5.2rem); }
.h-sm   { font-size: clamp(2.6rem, 7vw, 4.8rem); }
.h-xs   { font-size: clamp(2.4rem, 6.5vw, 4.2rem); }

/* Тонкая золотая линия с растворяющимися краями */
.rule-gold {
  display: block;
  height: 1px;
  width: 7rem;
  background: linear-gradient(
    90deg,
    transparent,
    rgb(var(--gold-rgb) / 0.55) 18%,
    rgb(var(--gold-rgb) / 0.55) 82%,
    transparent
  );
}

/* Карточка «тёплый фарфор»: почти непрозрачная, с золотой волосяной
   обводкой — раньше было матовое стекло на белой рамке, но тонкая золотая
   линия на фарфоре выглядит дороже. */
.glass-card {
  background: rgb(var(--porcelain-rgb) / 0.84);
  border: 1px solid rgb(var(--gold-rgb) / 0.24);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-card);
}

/* --- Кнопки --- */

/* Кнопки набраны капителью с широкой разрядкой — как строка на плотном
   пригласительном картоне. */
.btn-primary {
  position: relative;
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  overflow: hidden;
  border-radius: 999px;
  background: var(--ink);
  color: rgb(var(--ivory-rgb) / 0.96);
  padding: 0.9rem 2.4rem;
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  box-shadow: 0 16px 44px rgba(38, 35, 46, 0.24);
  transition: transform 0.45s var(--ease-luxury), box-shadow 0.45s var(--ease-luxury);
}

.btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgb(var(--gold-rgb) / 0.28) 50%, transparent 60%);
  transform: translateX(-120%);
  transition: transform 0.9s var(--ease-luxury);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 60px rgba(38, 35, 46, 0.3);
}

.btn-primary:hover::after {
  transform: translateX(120%);
}

.btn-primary:active {
  transform: translateY(0) scale(0.985);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: default;
}

.btn-secondary {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  border: 1px solid rgb(var(--gold-rgb) / 0.55);
  border-radius: 999px;
  background: rgb(var(--porcelain-rgb) / 0.6);
  color: var(--ink);
  padding: 0.85rem 2rem;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: border-color 0.4s ease, background 0.4s ease,
              transform 0.45s var(--ease-luxury), box-shadow 0.45s var(--ease-luxury);
}

.btn-secondary:hover {
  border-color: var(--gold-deep);
  background: var(--porcelain);
  transform: translateY(-2px);
  box-shadow: 0 18px 44px rgba(56, 45, 26, 0.12);
}

.btn-secondary:active {
  transform: translateY(0) scale(0.985);
}

/*
 * Совсем узкие экраны (iPhone SE 1-го поколения, обложка Galaxy Fold):
 * капитель с полной разрядкой не помещается в пилюлю и переносится на две
 * строки — слегка сжимаем набор. На массовых 375–430 px переносов нет.
 */
@media (max-width: 374px) {
  .btn-primary,
  .btn-secondary {
    padding-inline: 1.4rem;
    letter-spacing: 0.1em;
    font-size: 0.76rem;
  }
}

/* Кинематографичная подача фотографий: мягкая виньетка и тёплая вуаль */
.cinematic-media {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.cinematic-media::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgb(var(--ink-rgb) / 0) 55%, rgb(var(--ink-rgb) / 0.16) 100%),
    radial-gradient(120% 90% at 50% 20%, rgb(var(--ivory-rgb) / 0) 60%, rgb(var(--ink-rgb) / 0.09) 100%);
}

/* Зерно плёнки — еле заметная фактура, чтобы плоская слоновая кость
   не выглядела цифровой */
.film-grain {
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='linear' slope='0.028'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Элементы, которые имеют смысл только со скриптами */
html:not(.js) .js-only {
  display: none !important;
}

/* ==========================================================================
   4. Каркас страницы
   ========================================================================== */

.site {
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--ivory);
  color: var(--ink);
}

.section {
  position: relative;
  overflow: hidden;
  padding: 6rem 1.25rem;
}

.section--ivory      { background: var(--ivory); }
.section--ivory-deep { background: var(--ivory-deep); }
.section--champagne  { background: var(--champagne-soft); }
.section--ink        { background: var(--ink); color: var(--ivory); }

.wrap {
  position: relative;
  margin-inline: auto;
  width: 100%;
}

.wrap--narrow { max-width: 48rem; }
.wrap--mid    { max-width: 56rem; }
.wrap--wide   { max-width: 72rem; }

.center {
  text-align: center;
}

@media (min-width: 640px) {
  .section { padding: 9rem 2rem; }
  .section--tight { padding-block: 7rem; }
  .overline-label { font-size: 0.72rem; }
}

@media (min-width: 1024px) {
  .section { padding-block: 11rem; }
  .section--tight { padding-block: 7.5rem; }
}

/* ==========================================================================
   5. Анимации появления
   Замена framer-motion: класс .is-visible ставит скрипт, когда блок
   попадает в зону видимости. Анимируются только transform и opacity —
   их браузер считает на видеокарте, без перекладки макета.
   ========================================================================== */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.9s var(--ease-luxury) var(--reveal-delay, 0s),
    transform 0.9s var(--ease-luxury) var(--reveal-delay, 0s);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Заголовок, у которого слова «выезжают» из-под маски по очереди */
.reveal-heading .word {
  display: inline-block;
  overflow: hidden;
  padding-bottom: 0.08em;
  vertical-align: bottom;
}

.reveal-heading .word i {
  display: inline-block;
  font-style: normal;
  transform: translateY(110%);
  transition: transform 0.85s var(--ease-luxury);
  transition-delay: calc(var(--i, 0) * 0.09s);
  will-change: transform;
}

.reveal-heading.is-visible .word i {
  transform: translateY(0);
}

/* ==========================================================================
   6. Декор
   ========================================================================== */

.ornament {
  color: var(--gold);
  width: 180px;
  height: 24px;
}

.ornament--center {
  margin-inline: auto;
}

.branch {
  color: currentColor;
  width: 100%;
  height: auto;
}

/* --- Лепестки --- */

.petals {
  pointer-events: none;
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
}

.petal {
  position: absolute;
  top: 0;
  left: var(--left);
  display: block;
  width: var(--size);
  height: calc(var(--size) * 1.35);
  border-radius: 100% 4% 100% 4%;
  background: rgb(var(--gold-rgb) / 0.26);
  opacity: 0;
  will-change: transform, opacity;
  animation: petal-fall var(--dur) linear var(--delay) infinite;
}

@keyframes petal-fall {
  0%   { transform: translate3d(0, -8vh, 0) rotate(0deg); opacity: 0; }
  12%  { transform: translate3d(var(--drift), 6vh, 0) rotate(calc(var(--spin) * 0.2)); opacity: 0.9; }
  85%  { transform: translate3d(calc(var(--drift) * -0.6), 88vh, 0) rotate(var(--spin)); opacity: 0.9; }
  100% { transform: translate3d(calc(var(--drift) * 0.4), 108vh, 0) rotate(calc(var(--spin) * 1.6)); opacity: 0; }
}

.petals--soft .petal {
  opacity: 0.6;
}

/* --- Подсказка прокрутки --- */

.scroll-cue {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.scroll-cue__label {
  letter-spacing: 0.4em;
}

.scroll-cue__track {
  position: relative;
  display: block;
  height: var(--cue-track);
  width: 1px;
  overflow: hidden;
  background: rgb(var(--ink-rgb) / 0.15);
}

.scroll-cue__dot {
  position: absolute;
  left: 0;
  top: 0;
  height: 1.5rem;
  width: 1px;
  background: var(--gold-deep);
  animation: scroll-cue-run 2.8s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

@keyframes scroll-cue-run {
  0%, 21%  { transform: translateY(-100%); }
  79%,100% { transform: translateY(280%); }
}

/* --- Монограмма --- */

.monogram {
  display: inline-flex;
  align-items: baseline;
  gap: 0.12em;
  line-height: 1;
}

.monogram__amp {
  font-style: italic;
  opacity: 0.7;
}

/* Монограмма-медальон: инициалы в тонком золотом овале, как оттиск печати. */
.monogram--large {
  font-size: 3.25rem;
  color: var(--gold);
  border: 1px solid rgb(var(--gold-rgb) / 0.45);
  border-radius: 999px;
  padding: 1.3rem 1.9rem;
}

/* --- Фотография с параллаксом --- */

/*
 * Все фотографии на сайте — квадрат с небольшим скруглением. Раньше форм было
 * три (арка, «капля», скруглённый прямоугольник); от них отказались в пользу
 * одной, поэтому классы-модификаторы больше не нужны.
 */
/*
 * Паспарту: фарфоровая рамка вокруг снимка, как у оформленной печати.
 * Матовое поле сделано толстой рамкой (border), а не padding: overflow
 * обрезает содержимое по краю padding-бокса, поэтому параллакс-картинка,
 * увеличенная внутри маски, никогда не наезжает на поле. Волосяная золотая
 * линия по внешнему краю — кольцом в box-shadow.
 */
.pimg {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 0.625rem solid var(--porcelain);
  border-radius: var(--radius-photo);
  background: var(--porcelain);
  box-shadow: 0 0 0 1px rgb(var(--gold-rgb) / 0.3), var(--shadow-lift);
}

.pimg__img {
  height: 100%;
  width: 100%;
  object-fit: cover;
  transform: scale(1.12);
  will-change: transform;
}

/* ==========================================================================
   7. Первый экран
   ========================================================================== */

.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  /*
   * svh, а не dvh: на iOS адресная строка сворачивается при прокрутке, и с dvh
   * первый экран менялся бы в высоту прямо под пальцем — вёрстка дёргается.
   * svh считает по свёрнутому состоянию, поэтому высота постоянна, а край
   * следующего блока чуть выглядывает снизу и подсказывает, что надо листать.
   */
  min-height: 100vh;
  min-height: 100svh;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--ivory);
  padding-inline: 1.25rem;
  padding-top: max(4rem, env(safe-area-inset-top));
  /*
   * Нижний отступ = дорожка подсказки + подпись + просвет. Содержимое
   * центрируется внутри этого отступа, поэтому кнопки к подсказке уже
   * не подойдут — раньше отступ был фиксированным и на экранах ниже 800 px
   * подсказка налезала на кнопку «Смотреть приглашение».
   */
  padding-bottom: max(calc(var(--cue-track) + var(--cue-gap) + 3.25rem), env(safe-area-inset-bottom));
  text-align: center;
}

/*
 * Двойная волосяная рамка по краю экрана — как тиснение на пригласительном
 * картоне. Внутренняя (яркая) линия — border; слабое эхо — outline,
 * вынесенный НАРУЖУ на outline-offset, ближе к краю экрана. Элемент не
 * фокусируемый, поэтому с обводкой :focus-visible это не конфликтует.
 * max(..., env(safe-area-inset-*)) отодвигает рамку от чёлки и скруглённых
 * углов iPhone.
 */
.hero::after {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: max(clamp(0.875rem, 2vw, 1.25rem), env(safe-area-inset-top))
         max(clamp(0.875rem, 2vw, 1.25rem), env(safe-area-inset-right))
         max(clamp(0.875rem, 2vw, 1.25rem), env(safe-area-inset-bottom))
         max(clamp(0.875rem, 2vw, 1.25rem), env(safe-area-inset-left));
  z-index: 3;
  border: 1px solid rgb(var(--gold-rgb) / 0.4);
  outline: 1px solid rgb(var(--gold-rgb) / 0.16);
  outline-offset: 5px;
}

.hero__media {
  position: absolute;
  inset: 0;
  z-index: -10;
}

.hero__img {
  height: 100%;
  width: 100%;
  object-fit: cover;
  object-position: 50% 32%;
  transform: scale(1.14);
  animation: hero-zoom 2.6s var(--ease-luxury) both;
  will-change: transform;
}

@keyframes hero-zoom {
  from { transform: scale(1.26); }
  to   { transform: scale(1.14); }
}

.hero__veil {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(
    180deg,
    rgb(var(--ivory-rgb) / 0.18),
    rgb(var(--ivory-rgb) / 0.44) 55%,
    rgb(var(--ivory-rgb) / 0.95)
  );
}

.hero__fallback {
  position: absolute;
  inset: 0;
  z-index: -10;
  background: radial-gradient(
    120% 90% at 50% 8%,
    var(--champagne-soft) 0%,
    var(--ivory) 58%,
    var(--ivory-deep) 100%
  );
}

.hero__initials {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  user-select: none;
  white-space: nowrap;
  font-size: clamp(18rem, 52vw, 44rem);
  line-height: 1;
  color: rgb(var(--gold-rgb) / 0.1);
}

.hero__branch {
  pointer-events: none;
  position: absolute;
  z-index: -5;
  width: 8rem;
}

/* --parallax-y задаёт скрипт при прокрутке; без него веточки просто стоят */
.hero__branch--left {
  left: -2rem;
  top: 3.5rem;
  color: rgb(var(--gold-rgb) / 0.3);
  transform: translateY(var(--parallax-y, 0)) rotate(-24deg);
}

.hero__branch--right {
  right: -2rem;
  bottom: 6rem;
  width: 7rem;
  color: rgb(var(--gold-rgb) / 0.25);
  transform: translateY(var(--parallax-y, 0)) rotate(152deg);
}

.hero__content {
  position: relative;
  z-index: 4;
  display: flex;
  width: 100%;
  max-width: 56rem;
  flex-direction: column;
  align-items: center;
}

.hero__glow {
  position: absolute;
  left: -5rem;
  right: -5rem;
  top: -3rem;
  bottom: -3rem;
  z-index: -10;
  border-radius: 50%;
  background: rgb(var(--ivory-rgb) / 0.6);
  filter: blur(64px);
}

.hero__names {
  margin-top: 2rem;
  max-width: 100%;
  word-break: break-word;
  color: var(--ink);
}

.hero__name {
  display: block;
  overflow: hidden;
  padding-bottom: 0.1em;
}

.hero__name i {
  display: block;
  font-style: normal;
  transform: translateY(110%);
  animation: mask-rise 0.85s var(--ease-luxury) 0.35s both;
  will-change: transform;
}

.hero__name:last-of-type i {
  animation-delay: 0.49s;
}

@keyframes mask-rise {
  from { transform: translateY(110%); }
  to   { transform: translateY(0); }
}

.hero__amp {
  margin-block: 0.1em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  font-size: 0.32em;
  font-style: italic;
  color: var(--gold-deep);
}

.hero__amp .rule-gold {
  width: 3.5rem;
}

.hero__label,
.hero__meta,
.hero__actions {
  animation: fade-soft 0.9s var(--ease-luxury) both;
}

.hero__label   { animation-delay: 0.35s; }
.hero__meta    { animation-delay: 0.63s; }
.hero__actions { animation-delay: 0.77s; }

@keyframes fade-soft {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}

/*
 * «Табличка с датой»: серифная капитель с широкой разрядкой между двумя
 * волосяными линиями — классическая типографика пригласительных.
 * До 640 px — столбиком: в строку ряд «дата ◆ время ◆ город» на телефоне
 * не влезает, а перенос flex-wrap бросал ромб-разделитель в конце строки.
 * В столбике ромбы сами становятся разделителями между строками.
 */
.hero__meta {
  margin-top: 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  /* border-top/bottom, а не border-block: логические свойства появились
     в iOS только с 14.1, а рамку даты должны увидеть все гости. */
  border-top: 1px solid rgb(var(--gold-rgb) / 0.35);
  border-bottom: 1px solid rgb(var(--gold-rgb) / 0.35);
  padding: 0.9rem 1.5rem;
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 550;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: rgb(var(--ink-rgb) / 0.82);
}

.hero__diamond {
  color: var(--gold);
  flex: none;
}

.hero__actions {
  margin-top: 2.75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  max-width: 100%;
}

.hero__cue {
  position: absolute;
  /* Не ниже 2rem — иначе подсказка ляжет на золотую рамку (.hero::after). */
  bottom: max(2rem, env(safe-area-inset-bottom));
  left: 50%;
  z-index: 4;
  transform: translateX(-50%);
  animation: fade-in 1.2s ease 2s both;
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@media (min-width: 640px) {
  .hero__branch--left  { left: 1rem; width: 11rem; }
  .hero__branch--right { right: 1.5rem; width: 10rem; }
  .hero__amp .rule-gold { width: 6rem; }

  .hero__meta {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem 1.1rem;
    font-size: 1.2rem;
  }
}

/*
 * Невысокие экраны ноутбуков (1366×768 и подобные — после панелей браузера
 * остаётся около 700 px). Дорожка подсказки короче, отступ снизу считается
 * от неё же, поэтому кнопки и подсказка расходятся автоматически.
 */
@media (max-height: 820px) {
  :root {
    --cue-track: 2.5rem;
    --cue-gap: 1rem;
  }

  /* 1.75rem, не меньше: подсказка не должна лечь на золотую рамку. */
  .hero__cue { bottom: max(1.75rem, env(safe-area-inset-bottom)); }
}

/*
 * Совсем низкие окна: подсказка теряет смысл — край следующего блока и так
 * виден, а место она занимает заметное. Убираем.
 */
@media (max-height: 660px) {
  .hero__cue { display: none; }
  .hero { padding-bottom: max(3rem, env(safe-area-inset-bottom)); }
}

/*
 * Телефон в горизонтальной ориентации: высоты около 400 px, и первый экран
 * с полноразмерными именами, датой, кнопкой и подсказкой прокрутки в неё уже
 * не влезает. Поджимаем набор и убираем подсказку — листать и так очевидно.
 */
@media (max-height: 520px) and (orientation: landscape) {
  .hero {
    padding-top: max(2rem, env(safe-area-inset-top));
    padding-bottom: 3rem;
  }

  .hero__names { margin-top: 1rem; font-size: clamp(2.4rem, 9vh, 4rem); }
  .hero__meta { margin-top: 1rem; }
  .hero__actions { margin-top: 1.25rem; }
  .hero__cue { display: none; }
  .hero__branch { display: none; }
}

/* ==========================================================================
   8. Обратный отсчёт и праздничный экран
   ========================================================================== */

.countdown {
  position: relative;
  overflow: hidden;
  background: var(--champagne-soft);
  padding: 5rem 1.25rem;
}

.countdown::before,
.countdown::after {
  content: "";
  pointer-events: none;
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: rgb(var(--gold-rgb) / 0.2);
}

.countdown::before { top: 0; }
.countdown::after  { bottom: 0; }

.countdown__grid {
  margin-top: 2.5rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  align-items: start;
  justify-items: center;
  row-gap: 2.5rem;
}

.time-unit {
  display: flex;
  min-width: 5.5rem;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.time-unit__digits {
  position: relative;
  height: 1.05em;
  overflow: hidden;
  font-size: clamp(3.6rem, 9.5vw, 6rem);
  font-weight: 430;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

/* Смена цифры: старая уезжает вверх, новая приходит снизу */
.time-unit__digits.is-ticking {
  animation: digit-rise 0.55s var(--ease-luxury);
}

@keyframes digit-rise {
  from { transform: translateY(72%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.time-unit__label {
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  /* 0.7 ради WCAG AA на шампани — фоне отсчёта. */
  color: rgb(var(--ink-rgb) / 0.7);
}

.time-sep {
  display: none;
}

@media (min-width: 640px) {
  .countdown { padding-block: 6rem; }

  .countdown__grid {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
  }

  .time-unit { min-width: 6.5rem; }

  .time-sep {
    display: block;
    margin-top: 0.25rem;
    height: 3.5rem;
    width: 1px;
    align-self: flex-start;
    background: rgb(var(--gold-rgb) / 0.3);
  }
}

@media (min-width: 1024px) {
  .countdown__grid { gap: 2.5rem; }
}

/* --- Праздничный экран --- */

.celebration {
  position: relative;
  overflow: hidden;
  background: var(--champagne-soft);
  padding: 6rem 1.25rem;
}

.celebration__particles {
  pointer-events: none;
  position: absolute;
  inset: 0;
}

.particle {
  position: absolute;
  top: 0;
  left: var(--left);
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--color);
  opacity: 0.5;
  will-change: transform;
  animation: particle-fall var(--dur) linear var(--delay) infinite;
}

.particle--petal {
  width: 9px;
  height: 13px;
  border-radius: 100% 4% 100% 4%;
}

@keyframes particle-fall {
  0%   { transform: translate3d(0, -6vh, 0) scale(var(--scale)) rotate(0deg); }
  50%  { transform: translate3d(var(--drift), 53vh, 0) scale(var(--scale)) rotate(var(--spin)); }
  100% { transform: translate3d(calc(var(--drift) * -0.5), 112vh, 0) scale(var(--scale)) rotate(calc(var(--spin) * 2)); }
}

.celebration__body {
  position: relative;
}

.celebration__title {
  margin-top: 1.5rem;
  color: var(--ink);
}

.celebration__ornament {
  margin-top: 1.75rem;
  display: flex;
  justify-content: center;
}

.celebration__msg {
  margin-top: 1.75rem;
  font-size: 1.5rem;
  font-style: italic;
  color: var(--gold-deep);
}

.celebration__note {
  margin: 1.25rem auto 0;
  max-width: 36rem;
  font-size: 1rem;
}

@media (min-width: 640px) {
  .celebration { padding-block: 8rem; }
  .celebration__msg { font-size: 1.875rem; }
  .celebration__note { font-size: 1.125rem; }
}

.site--passed {
  min-height: 100vh;
}

.celebration--solo {
  box-sizing: border-box;
  display: flex;
  min-height: 100vh;
  min-height: 100svh;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 1.25rem;
}

.celebration--solo .celebration__music {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}

/* ==========================================================================
   9. Разделы приглашения
   ========================================================================== */

/* --- Обращение к гостям --- */

.greeting__branch {
  pointer-events: none;
  position: absolute;
  right: -2.5rem;
  top: 4rem;
  width: 10rem;
  color: rgb(var(--gold-rgb) / 0.15);
  transform: rotate(24deg);
}

.greeting__overline { margin-top: 2rem; }

.greeting__title {
  margin-top: 1.5rem;
  color: var(--ink);
}

.greeting__body {
  margin: 2.25rem auto 0;
  max-width: 42rem;
  font-size: 1.125rem;
}

.greeting__media { margin-top: 3.5rem; }

/* Квадрат во всю ширину блока был бы во весь экран — ограничиваем и центрируем */
.greeting__photo {
  margin-inline: auto;
  max-width: 28rem;
}

@media (min-width: 640px) {
  .greeting__branch { right: 0.5rem; width: 13rem; }
  .greeting__body { font-size: 1.25rem; line-height: 2.25rem; }
}

/* --- Редакционный разворот --- */

.editorial__title {
  margin-top: 1.5rem;
  color: var(--ink);
}

.editorial__rule {
  margin-top: 1.75rem;
  display: flex;
  justify-content: center;
}

.editorial__body {
  margin: 2rem auto 0;
  max-width: 42rem;
  font-size: 1.125rem;
}

.editorial__grid {
  display: grid;
  align-items: center;
  gap: 3rem;
}

.editorial__media {
  position: relative;
}

.editorial__ring {
  display: none;
  position: absolute;
  bottom: -1.5rem;
  right: -2.5rem;
  height: 10rem;
  width: 10rem;
  border-radius: 999px;
  border: 1px solid rgb(var(--gold-rgb) / 0.3);
}

.editorial__photo {
  margin-inline: auto;
  width: 100%;
  max-width: 26rem;
}

.editorial__text {
  text-align: center;
}

@media (min-width: 640px) {
  .editorial__body { line-height: 2.25rem; }
}

@media (min-width: 1024px) {
  .editorial__grid {
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
    gap: 5rem;
  }

  .editorial__ring { display: block; }
  .editorial__photo { max-width: 30rem; }

  .editorial__text { text-align: left; }
  .editorial__rule { justify-content: flex-start; }
  .editorial__body { margin-inline: 0; max-width: 36rem; }

  /* Развороты чередуются: у чётного фото слева, у нечётного — справа */
  .editorial--flip .editorial__media { order: 2; }
  .editorial--flip .editorial__text  { order: 1; }
  .editorial--flip .editorial__ring  { right: auto; left: -2.5rem; }
}

/* --- Программа дня --- */

.timeline__title {
  margin-top: 1.25rem;
  color: var(--ink);
}

.timeline__list {
  position: relative;
  margin: 4rem auto 0;
  max-width: 56rem;
}

.timeline__rail,
.timeline__progress {
  position: absolute;
  left: 11px;
  top: 0;
  height: 100%;
  width: 1px;
}

.timeline__rail {
  background: rgb(var(--gold-rgb) / 0.25);
}

.timeline__progress {
  background: var(--gold-deep);
  transform-origin: top;
  transform: scaleY(0);
}

.timeline__items {
  display: grid;
  gap: 3.5rem;
}

.timeline__item {
  position: relative;
  padding-left: 3rem;
}

/* Узлы оси — золотые ромбы: перекликаются с ромбами в дате на первом
   экране и с росчерком-разделителем. */
.timeline__dot {
  position: absolute;
  left: 11px;
  top: 0.5rem;
  display: grid;
  height: 1.3rem;
  width: 1.3rem;
  transform: translateX(-50%) rotate(45deg);
  place-items: center;
  border-radius: 2px;
  border: 1px solid rgb(var(--gold-rgb) / 0.55);
  background: var(--ivory);
  box-shadow: 0 0 0 4px var(--ivory-deep);
}

.timeline__dot span {
  height: 0.4rem;
  width: 0.4rem;
  border-radius: 1px;
  background: var(--gold-deep);
}

.timeline__body { text-align: left; }

.timeline__time {
  display: block;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 2.6rem;
  font-weight: 450;
  line-height: 1;
  color: var(--gold-deep);
}

/* Названия событий — капителью, как рубрики в журнале. */
.timeline__heading {
  margin-top: 0.85rem;
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
}

.timeline__desc {
  margin-top: 0.5rem;
  max-width: 28rem;
  font-size: 1rem;
}

@media (min-width: 640px) {
  .timeline__list { margin-top: 6rem; }
  .timeline__items { gap: 4rem; }
  .timeline__time { font-size: 3.2rem; }
  .timeline__heading { font-size: 1.05rem; }
}

@media (min-width: 1024px) {
  .timeline__rail,
  .timeline__progress,
  .timeline__dot {
    left: 50%;
  }

  .timeline__rail,
  .timeline__progress {
    transform: translateX(-50%);
  }

  .timeline__progress {
    transform: translateX(-50%) scaleY(0);
  }

  .timeline__item {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    column-gap: 5rem;
    padding-left: 0;
  }

  .timeline__body--left {
    grid-column-start: 1;
    padding-right: 1rem;
    text-align: right;
  }

  .timeline__body--left .timeline__desc {
    margin-left: auto;
  }

  .timeline__body--right {
    grid-column-start: 2;
    padding-left: 1rem;
  }
}

/* --- Место проведения --- */

.venue__title {
  margin-top: 1.25rem;
  color: var(--ink);
}

.venue__body {
  margin: 2rem auto 0;
  max-width: 42rem;
  font-size: 1.125rem;
}

.venue__stage {
  position: relative;
  margin-top: 3.5rem;
}

.venue__photo {
  margin-inline: auto;
  width: 100%;
  max-width: 28rem;
}

.venue__card-slot {
  margin-inline: auto;
  width: 100%;
  max-width: 36rem;
}

.venue__card-slot--floating {
  position: relative;
  z-index: 10;
  margin-top: -4rem;
  width: min(92%, 34rem);
}

.venue__card {
  border-radius: var(--radius-card);
  padding: 1.75rem;
  text-align: center;
}

.venue__name {
  font-size: 1.875rem;
  color: var(--ink);
}

.venue__addr {
  margin-top: 0.75rem;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0.5rem;
  font-size: 1rem;
}

.venue__pin {
  margin-top: 0.25rem;
  flex: none;
  color: var(--gold-deep);
}

.venue__map { margin-top: 1.5rem; }

@media (min-width: 640px) {
  .venue__stage { margin-top: 5rem; }
  .venue__photo { max-width: 32rem; }
  .venue__card-slot--floating { margin-top: -5rem; }
  .venue__card { padding: 2.25rem; }
  .venue__name { font-size: 2.25rem; }
}

/*
 * На широком экране фотография места и карточка с адресом становятся рядом,
 * а не друг на друге: карточка, наложенная на квадрат, закрывала бы половину
 * снимка — с прежней широкой фотографией это работало, с квадратной нет.
 */
@media (min-width: 1024px) {
  .venue__stage {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: 3.5rem;
  }

  .venue__photo { margin-inline: 0; max-width: 30rem; }

  .venue__card-slot--floating {
    position: static;
    margin: 0;
    width: 100%;
    max-width: 26rem;
  }

  .venue__card { text-align: left; }
  .venue__addr { justify-content: flex-start; }
}

/* --- Дресс-код --- */

.dresscode__title {
  margin-top: 1.25rem;
  color: var(--ink);
}

.dresscode__body {
  margin: 2rem auto 0;
  max-width: 42rem;
  font-size: 1.125rem;
}

.palette {
  margin-top: 3rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

/* Цвет в фарфоровом ободке с золотым кольцом — как эмалевые пуговицы. */
.palette__swatch {
  height: 3.25rem;
  width: 3.25rem;
  border-radius: 999px;
  border: 3px solid var(--porcelain);
  background: var(--swatch);
  box-shadow: 0 0 0 1px rgb(var(--gold-rgb) / 0.4), 0 10px 28px rgba(56, 45, 26, 0.16);
  opacity: 0;
  transform: scale(0.4) translateY(14px);
  transition: opacity 0.7s var(--ease-luxury), transform 0.7s var(--ease-luxury);
  transition-delay: calc(0.1s + var(--i, 0) * 0.09s);
}

.palette.is-visible .palette__swatch {
  opacity: 1;
  transform: none;
}

.palette__swatch:hover {
  transform: scale(1.12) translateY(-4px);
}

.palette__caption {
  margin-top: 1.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  /* 0.7, не ниже: единственная подпись, объясняющая кружки палитры,
     должна проходить WCAG AA на фоне ivory-deep. */
  color: rgb(var(--ink-rgb) / 0.7);
}

.dresscode__ornament {
  margin-top: 3rem;
  display: flex;
  justify-content: center;
}

@media (min-width: 640px) {
  .palette { gap: 1.4rem; }
  .palette__swatch { height: 3.75rem; width: 3.75rem; }
}

/* --- Пожелания --- */

.gifts .wrap { max-width: 42rem; }

.gifts__title {
  margin-top: 1.25rem;
  color: var(--ink);
}

.gifts__text {
  margin-top: 2.25rem;
  font-size: 1.5rem;
  font-style: italic;
  line-height: 1.625;
  color: rgb(var(--ink-rgb) / 0.8);
}

.gifts__ornament {
  margin-top: 2.5rem;
  display: flex;
  justify-content: center;
}

@media (min-width: 640px) {
  .gifts__text { font-size: 1.7rem; line-height: 1.6; }
}

/* --- Галерея --- */

.gallery__title {
  margin-top: 1.25rem;
  color: var(--ink);
}

/*
 * Сетка квадратов, а не кладка разной высоты: фотографии у гостей приходят
 * в самых разных пропорциях, и ровный ряд смотрится опрятнее. Кадрирование
 * берёт на себя object-fit.
 */
.gallery__grid {
  margin-top: 3.5rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

/* Те же фарфоровые паспарту, что у больших фотографий (см. .pimg). */
.gallery__item {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 0.5rem solid var(--porcelain);
  border-radius: var(--radius-photo);
  background: var(--porcelain);
  box-shadow: 0 0 0 1px rgb(var(--gold-rgb) / 0.26), var(--shadow-card);
}

html.js .gallery__item {
  cursor: zoom-in;
}

.gallery__item img {
  height: 100%;
  width: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--ease-luxury);
  will-change: transform;
}

.gallery__item:hover img {
  transform: scale(1.045);
}

.gallery__veil {
  pointer-events: none;
  position: absolute;
  inset: 0;
  background: transparent;
  transition: background 0.5s ease;
}

.gallery__item:hover .gallery__veil {
  background: rgb(var(--ink-rgb) / 0.1);
}

@media (min-width: 640px) {
  .gallery__grid { margin-top: 5rem; gap: 1.5rem; }
}

@media (min-width: 1024px) {
  .gallery__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* --- Лайтбокс --- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  cursor: zoom-out;
  background: rgb(var(--ink-rgb) / 0.85);
  padding: 1.25rem;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  opacity: 0;
  transition: opacity 0.35s ease;
  /* Чтобы «резиновая» прокрутка iOS не тянула страницу под лайтбоксом */
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.lightbox[hidden] { display: none; }

.lightbox--open { opacity: 1; }

.lightbox__img {
  max-height: 85vh;
  max-height: 85dvh;
  width: auto;
  max-width: 100%;
  border: 6px solid var(--porcelain);
  border-radius: 0.625rem;
  background: var(--porcelain);
  box-shadow: var(--shadow-lift);
  cursor: default;
  transform: scale(0.92) translateY(16px);
  transition: transform 0.5s var(--ease-luxury);
}

.lightbox--open .lightbox__img {
  transform: none;
}

.lightbox__close,
.lightbox__nav {
  position: absolute;
  display: grid;
  height: 3rem;
  width: 3rem;
  place-items: center;
  border-radius: 999px;
  background: rgb(var(--ivory-rgb) / 0.12);
  color: var(--ivory);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: background 0.3s ease;
}

.lightbox__close:hover,
.lightbox__nav:hover {
  background: rgb(var(--ivory-rgb) / 0.25);
}

.lightbox__close {
  right: 1.25rem;
  top: max(1.25rem, env(safe-area-inset-top));
}

/*
 * На телефоне фотография занимает почти всю ширину, поэтому стрелки по бокам
 * лежали бы прямо на ней. Уводим их в нижние углы — под большой палец,
 * и фотографию видно целиком. Листать можно и свайпом.
 */
.lightbox__nav {
  bottom: max(1.25rem, env(safe-area-inset-bottom));
  transform: rotate(-90deg);
}

.lightbox__nav--prev { left: 1.25rem; }
.lightbox__nav--next { right: 1.25rem; }

@media (min-width: 640px) {
  .lightbox { padding: 2.5rem; }

  .lightbox__nav {
    bottom: auto;
    top: 50%;
    transform: translateY(-50%) rotate(-90deg);
  }
}

/* --- Контакты --- */

.contacts__title {
  margin-top: 1.25rem;
  color: var(--ink);
}

.contacts__lead {
  margin: 1.5rem auto 0;
  max-width: 36rem;
  font-size: 1rem;
}

.contacts__grid {
  margin: 3rem auto 0;
  display: grid;
  max-width: 48rem;
  gap: 1.25rem;
}

.contact-card {
  display: flex;
  height: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  border-radius: var(--radius-card);
  padding: 1.75rem;
}

.contact-card__text {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.75rem;
  color: var(--ink);
}

.contact-card__call {
  font-size: 0.875rem;
}

.contact-card__icon {
  color: var(--gold-deep);
}

@media (min-width: 640px) {
  .contacts__grid--pair { grid-template-columns: repeat(2, 1fr); }
}

/* ==========================================================================
   10. Форма RSVP
   ========================================================================== */

.rsvp__inner {
  position: relative;
  z-index: 1;
}

.rsvp__title {
  margin-top: 1.25rem;
  color: var(--ink);
  font-size: clamp(2.6rem, 7vw, 4.6rem);
}

.rsvp__lead {
  margin: 1.5rem auto 0;
  max-width: 36rem;
  font-size: 1rem;
}

.rsvp__slot { margin-top: 3rem; }

.rsvp__card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-card);
  padding: 1.75rem;
  text-align: left;
}

/* Внутренняя волосяная рамка — карточка читается как пригласительный бланк. */
.rsvp__card::before {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0.625rem;
  z-index: 0;
  border: 1px solid rgb(var(--gold-rgb) / 0.26);
  border-radius: calc(var(--radius-card) - 0.5rem);
}

.rsvp__form {
  display: grid;
  gap: 1.5rem;
}

/* display: grid сильнее браузерного правила для [hidden] — без этой строки
   после отправки форма оставалась бы видимой под благодарностью. */
.rsvp__form[hidden] { display: none; }

.field {
  display: grid;
  gap: 0.625rem;
}

.field--choices { gap: 0.625rem; }

.field__label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  /* Не светлее 0.7: мелкая капитель должна проходить WCAG AA на фарфоре. */
  color: rgb(var(--ink-rgb) / 0.7);
}

.field--choices .field__label { margin-bottom: 0.625rem; }

.field__hint {
  text-transform: none;
  letter-spacing: normal;
  color: var(--ink-soft);
}

.input,
.textarea {
  width: 100%;
  border-radius: var(--radius-ui);
  border: 1px solid rgb(var(--gold-rgb) / 0.35);
  background: var(--porcelain);
  padding: 0.75rem 1rem;
  color: var(--ink);
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.input { min-height: 3.25rem; }
.textarea { min-height: 3.25rem; resize: vertical; }

.input::placeholder,
.textarea::placeholder {
  color: rgb(var(--ink-rgb) / 0.38);
}

.input:focus,
.textarea:focus {
  border-color: var(--gold-deep);
  box-shadow: 0 0 0 3px rgb(var(--gold-rgb) / 0.16);
}

.choices {
  display: grid;
  gap: 0.75rem;
}

.choice {
  position: relative;
  display: flex;
  min-height: 3.25rem;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  border-radius: var(--radius-ui);
  border: 1px solid rgb(var(--gold-rgb) / 0.35);
  background: rgb(var(--porcelain-rgb) / 0.75);
  padding: 0.875rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.3s ease, background 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

.choice:hover {
  border-color: var(--gold);
}

/* Радиокнопку прячем, но оставляем доступной с клавиатуры */
.choice input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.choice__mark {
  display: grid;
  height: 1.25rem;
  width: 1.25rem;
  flex: none;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgb(var(--gold-rgb) / 0.5);
  transition: border-color 0.3s ease, background 0.3s ease;
}

.choice__mark svg { opacity: 0; }

/*
 * Выбранное состояние продублировано тремя путями, и объединять правила
 * через запятую НЕЛЬЗЯ: браузер без :has() (iOS до 15.4, Chrome до 105)
 * отбрасывает весь селекторный список целиком — вместе с фолбэком.
 * Отдельными правилами старый браузер теряет только вариант с :has().
 */
.choice:has(input:checked) {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--ivory);
  box-shadow: 0 14px 36px rgba(38, 35, 46, 0.22);
}

/* Фолбэк: класс ставит site.js (см. syncChoices) */
.choice--active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--ivory);
  box-shadow: 0 14px 36px rgba(38, 35, 46, 0.22);
}

/* Страховка без :has() и без JS: input лежит прямо перед .choice__mark.
   :where() обнуляет специфичность левой части, поэтому это правило всегда
   проигрывает основным (тёмная заливка через :has() или .choice--active)
   и срабатывает только там, где их нет. */
:where(.choice input:checked) + .choice__mark {
  border-color: var(--gold-deep);
  background: rgb(var(--gold-rgb) / 0.22);
}

:where(.choice input:checked) + .choice__mark svg { opacity: 1; }

.choice:has(input:checked) .choice__mark {
  border-color: rgb(var(--ivory-rgb) / 0.7);
  background: rgb(var(--ivory-rgb) / 0.15);
}

.choice--active .choice__mark {
  border-color: rgb(var(--ivory-rgb) / 0.7);
  background: rgb(var(--ivory-rgb) / 0.15);
}

.choice:has(input:checked) .choice__mark svg { opacity: 1; }

.choice--active .choice__mark svg { opacity: 1; }

.choice:has(input:focus-visible) {
  outline: 2px solid var(--gold-deep);
  outline-offset: 3px;
}

/* Фолбэк: класс ставит site.js по focus/blur */
.choice--focus {
  outline: 2px solid var(--gold-deep);
  outline-offset: 3px;
}

.guests {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-radius: var(--radius-ui);
  border: 1px solid rgb(var(--gold-rgb) / 0.3);
  background: rgb(var(--porcelain-rgb) / 0.65);
  padding: 1rem 1.25rem;
}

.guests[hidden] { display: none; }

.guests__label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
}

.guests__control {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.guests__value {
  width: 4rem;
  border: 1px solid rgb(var(--gold-rgb) / 0.35);
  border-radius: 0.625rem;
  background: var(--porcelain);
  padding: 0.35rem;
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.875rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

/* Со скриптами число меняют кнопками — стрелки браузера только мешают */
html.js .guests__value {
  width: 2rem;
  border: 0;
  background: none;
  padding: 0;
  -moz-appearance: textfield;
}

html.js .guests__value::-webkit-outer-spin-button,
html.js .guests__value::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.step-btn {
  display: grid;
  height: 2.5rem;
  width: 2.5rem;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgb(var(--gold-rgb) / 0.5);
  background: var(--porcelain);
  color: var(--ink);
  transition: border-color 0.3s ease, background 0.3s ease, opacity 0.3s ease;
}

.step-btn:hover:not(:disabled) {
  border-color: var(--gold-deep);
  background: var(--ivory);
}

.step-btn:disabled { opacity: 0.3; cursor: default; }

/* Ловушка для ботов: поле уводим за экран, но не через display:none —
   так его заполняют охотнее */
.honeypot {
  position: absolute;
  left: -9999px;
  top: 0;
  height: 1px;
  width: 1px;
  opacity: 0;
}

.form-error {
  border-radius: 1rem;
  background: #fef2f2;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: #b91c1c;
}

.form-error[hidden] { display: none; }

.rsvp__submit { width: 100%; }

.rsvp__success {
  padding-block: 2rem;
  text-align: center;
}

.rsvp__success[hidden] { display: none; }

.rsvp__check {
  margin-inline: auto;
  display: grid;
  height: 4rem;
  width: 4rem;
  place-items: center;
  border-radius: 999px;
  background: var(--ink);
  color: var(--ivory);
  box-shadow: 0 0 0 5px var(--porcelain), 0 0 0 6px rgb(var(--gold-rgb) / 0.4);
  animation: check-pop 0.5s var(--ease-luxury) 0.15s both;
}

@keyframes check-pop {
  from { transform: scale(0); }
  to   { transform: scale(1); }
}

.rsvp__thanks {
  margin-top: 1.75rem;
  font-size: 2.25rem;
  color: var(--ink);
}

.rsvp__thanks-note {
  margin: 1rem auto 0;
  max-width: 28rem;
}

@media (min-width: 640px) {
  .rsvp__card { padding: 2.5rem; }
  .rsvp__lead { font-size: 1.125rem; }
  .choices { grid-template-columns: repeat(2, 1fr); }
}

/* ==========================================================================
   11. Подвал
   ========================================================================== */

.site-footer {
  position: relative;
  overflow: hidden;
  background: var(--ink);
  /* 2rem по бокам: внутри лежит золотая рамка, текст не должен её касаться. */
  padding: 6.5rem 2rem max(4.5rem, env(safe-area-inset-bottom));
  text-align: center;
  color: var(--ivory);
}

/* Та же двойная волосяная рамка, что на первом экране (border — внутренняя
   яркая линия, outline — внешнее эхо), — тёмный финал закольцовывает
   приглашение. */
.site-footer::after {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: max(clamp(0.875rem, 2vw, 1.25rem), env(safe-area-inset-top))
         max(clamp(0.875rem, 2vw, 1.25rem), env(safe-area-inset-right))
         max(clamp(0.875rem, 2vw, 1.25rem), env(safe-area-inset-bottom))
         max(clamp(0.875rem, 2vw, 1.25rem), env(safe-area-inset-left));
  border: 1px solid rgb(var(--gold-rgb) / 0.32);
  outline: 1px solid rgb(var(--gold-rgb) / 0.14);
  outline-offset: 5px;
}

.site-footer__glow {
  pointer-events: none;
  position: absolute;
  left: 50%;
  top: 0;
  height: 18rem;
  width: 46rem;
  max-width: 140vw;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: rgb(var(--gold-rgb) / 0.14);
  filter: blur(64px);
}

.site-footer__inner { position: relative; }

.site-footer__title {
  margin-top: 2.5rem;
  color: var(--ivory);
}

.site-footer__body {
  margin: 2rem auto 0;
  max-width: 36rem;
  font-size: 1.5rem;
  font-style: italic;
  line-height: 1.625;
  color: rgb(var(--ivory-rgb) / 0.8);
}

.site-footer__meta {
  margin-top: 2.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: rgb(var(--ivory-rgb) / 0.6);
}

.site-footer__sign {
  margin-top: 3.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.site-footer__rule {
  width: 9rem;
  opacity: 0.7;
}

.site-footer__love {
  font-size: 1.5rem;
  font-style: italic;
  color: rgb(var(--ivory-rgb) / 0.85);
}

@media (min-width: 640px) {
  .site-footer { padding-top: 8.5rem; }
  .site-footer .monogram--large { font-size: 4rem; padding: 1.6rem 2.4rem; }
  .site-footer__body { font-size: 1.65rem; }
}

/* ==========================================================================
   12. Плеер
   ========================================================================== */

.music {
  max-width: 100%;
  border-radius: 999px;
  padding: 0.5rem;
}

.music__row {
  display: flex;
  min-height: 2.5rem;
  align-items: center;
  gap: 0.75rem;
}

.music__btn {
  position: relative;
  display: grid;
  height: 2.75rem;
  width: 2.75rem;
  flex: none;
  place-items: center;
  border-radius: 999px;
  background: var(--ink);
  color: var(--ivory);
  box-shadow: 0 10px 26px rgba(38, 35, 46, 0.28);
  transition: transform 0.25s var(--ease-luxury);
}

.music__btn:hover  { transform: scale(1.06); }
.music__btn:active { transform: scale(0.94); }

.music__pulse {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  border: 1px solid var(--gold);
  opacity: 0;
}

.music.is-playing .music__pulse {
  animation: music-pulse 1.8s ease-out infinite;
}

@keyframes music-pulse {
  from { transform: scale(1);    opacity: 0.7; }
  to   { transform: scale(1.45); opacity: 0; }
}

.music__meta {
  min-width: 0;
  padding-right: 0.25rem;
}

.music__title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.025em;
  color: var(--ink);
}

.music__track {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.68rem;
  color: rgb(var(--ink-rgb) / 0.7);
}

.music__vol {
  display: none;
  margin-left: auto;
  align-items: center;
  gap: 0.5rem;
  padding-right: 0.5rem;
  color: rgb(var(--ink-rgb) / 0.55);
}

.music__vol input {
  width: 5rem;
  accent-color: var(--gold-deep);
}

.music__error {
  padding: 0 0.75rem 0.25rem;
  font-size: 0.75rem;
  color: #b91c1c;
}

.music__error[hidden] { display: none; }

@media (min-width: 640px) {
  .music__vol { display: flex; }
}

/* ==========================================================================
   13. Уважение к prefers-reduced-motion
   Гость мог попросить систему не анимировать интерфейсы — тогда сайт
   показывает всё сразу и ничего не двигает.
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .reveal-heading .word i,
  .hero__name i {
    transform: none;
  }

  .palette__swatch {
    opacity: 1;
    transform: none;
  }

  .petals,
  .celebration__particles,
  .scroll-cue__dot {
    display: none;
  }

  .pimg__img {
    transform: none;
  }
}