/* ============================================================
   Свадебное приглашение — оформление
   Палитра 2026: вино/бордо + крем + золото + шалфейный зелёный
   ============================================================ */

:root {
  --wine:      #4A1220;
  --wine-soft: #6E2033;
  --plum:      #3B1B2B;
  --cream:     #F7F1E8;
  --cream-2:   #EFE5D8;
  --paper:     #FDFBF7;
  --gold:      #B08D57;
  --gold-soft: #D9C4A0;
  --sage:      #6E7A63;
  --ink:       #2A2024;
  --ink-soft:  #6A5C60;

  --serif: "Cormorant Garamond", "Iowan Old Style", Palatino, Georgia, "Times New Roman", serif;
  --sans:  Manrope, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --wrap: 1080px;
  --radius: 4px;
  --shadow: 0 1px 2px rgba(42, 32, 36, .05), 0 12px 32px rgba(42, 32, 36, .06);
  --ease: cubic-bezier(.22, .61, .36, 1);
}

* { box-sizing: border-box; }

/* Атрибут hidden должен побеждать любые author-правила display:
   иначе .btn и .countdown остаются видимыми, когда помечены hidden. */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }

h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.15; margin: 0; }

a { color: var(--wine-soft); }

.skip {
  position: absolute; left: -9999px; top: 0; background: var(--wine); color: #fff;
  padding: 12px 20px; z-index: 100; border-radius: 0 0 var(--radius) 0;
}
.skip:focus { left: 0; }

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

/* ── экран-вход: закрытый конверт и кнопка ───────────────── */

/* Пока конверт не открыт, страница за фоновым экраном не видна: body
   закрыт классом is-locked, который снимается по кнопке. */
body.is-locked .hero,
body.is-locked .nav,
body.is-locked main,
body.is-locked .footer { visibility: hidden; }

.intro {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 28px 24px calc(28px + env(safe-area-inset-bottom));
  text-align: center;
  color: var(--cream);
  background:
    radial-gradient(120% 90% at 50% 0%, #6E2033 0%, #4A1220 45%, #2E0C16 100%);
  transition: opacity .45s var(--ease);
}
.intro.is-opening { opacity: 0; pointer-events: none; }

.intro__inner { max-width: 520px; width: 100%; }

.intro__kicker {
  margin: 0 0 22px;
  font-size: 11px; letter-spacing: .42em; text-transform: uppercase; color: var(--gold-soft);
}

/* Конверт — фотография, поэтому sized по высоте и ширине: в альбомной
   ориентации без ограничения он не влезает вместе с кнопкой. Тень
   отбрасывается фильтром, а не картинкой, — её видно на любом фоне. */
.intro__photo {
  display: block;
  width: min(600px, 92vw, 52vh);
  height: auto;
  margin: 0 auto;
  filter: drop-shadow(0 16px 28px rgba(20, 4, 10, .55));
  transition: transform .7s var(--ease), opacity .45s var(--ease);
}
.intro.is-opening .intro__photo { transform: scale(1.035); opacity: 0; }

.intro__open { margin-top: 30px; }
.intro__hint {
  margin: 16px 0 0; font-size: 13px; letter-spacing: .04em; color: var(--gold-soft);
  transition: opacity .4s var(--ease);
}
.intro.is-opening .intro__open,
.intro.is-opening .intro__hint { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  .intro__photo, .intro__open, .intro__hint { transition: none; }
}

@media (max-width: 480px) {
  .intro__photo { width: min(500px, 96vw, 42vh); }
}

/* ── обложка ─────────────────────────────────────────────── */

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 72px 24px calc(96px + env(safe-area-inset-bottom));
  text-align: center;
  color: var(--cream);
  background:
    radial-gradient(120% 90% at 50% 0%, #6E2033 0%, #4A1220 45%, #2E0C16 100%);
  overflow: hidden;
}

/* мягкое зерно, чтобы плоский градиент не выглядел «пластиковым» */
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.35'/%3E%3C/svg%3E");
  opacity: .05;
  pointer-events: none;
}

.hero__inner {
  position: relative;
  z-index: 2;
  max-width: 720px;
  /* Проявляется вместе с раскрывающимся конвертом. */
  opacity: 1;
  transform: none;
  transition: opacity .9s var(--ease) .45s, transform .9s var(--ease) .45s;
}
body.is-locked .hero__inner { opacity: 0; transform: translateY(16px); }

.hero__kicker {
  margin: 0 0 28px;
  font-size: 12px;
  letter-spacing: .42em;
  text-transform: uppercase;
  color: var(--gold-soft);
}

.hero__names { display: grid; gap: 4px; }

.hero__name {
  font-size: clamp(44px, 12vw, 96px);
  line-height: 1.02;
  letter-spacing: .01em;
}

.hero__amp {
  font-size: clamp(22px, 5vw, 34px);
  color: var(--gold);
  font-style: italic;
  padding: 2px 0;
}

.hero__date {
  margin: 32px 0 0;
  font-family: var(--serif);
  font-size: clamp(18px, 4.4vw, 26px);
  color: var(--cream-2);
}
.hero__place { display: block; font-size: .72em; color: var(--gold-soft); letter-spacing: .12em; text-transform: uppercase; margin-top: 10px; }

.hero__cta { margin-top: 44px; }

/* тонкая арка-ornament */
.hero__ornament {
  position: absolute; z-index: 1;
  left: 50%; bottom: -70px; transform: translateX(-50%);
  width: 280px; height: 140px;
  border: 1px solid rgba(176, 141, 87, .35);
  border-bottom: none;
  border-radius: 280px 280px 0 0;
}

.countdown {
  display: flex; justify-content: center; gap: clamp(18px, 5vw, 44px);
  margin: 40px 0 0;
}
.countdown__cell { display: grid; gap: 2px; }
.countdown__cell b {
  font-family: var(--serif); font-size: clamp(28px, 7vw, 40px); font-weight: 500;
  color: var(--cream); font-variant-numeric: tabular-nums;
}
.countdown__cell span {
  font-size: 10px; letter-spacing: .22em; text-transform: uppercase; color: var(--gold-soft);
}

/* ── навигация ───────────────────────────────────────────── */

.nav {
  position: sticky; top: 0; z-index: 40;
  display: flex; gap: clamp(10px, 3vw, 26px);
  justify-content: center; flex-wrap: wrap;
  padding: 12px 20px;
  background: rgba(253, 251, 247, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--cream-2);
  font-size: 12px; letter-spacing: .16em; text-transform: uppercase;
}
.nav a { color: var(--ink-soft); text-decoration: none; padding: 4px 2px; border-bottom: 1px solid transparent; }
.nav a:hover, .nav a:focus-visible { color: var(--wine); border-color: var(--gold); }

/* Всё, что несёт текст, лежит выше конверта. */
.hero__inner,
.nav,
.section > .wrap,
.footer .wrap { position: relative; z-index: 2; }

/* ── секции ──────────────────────────────────────────────── */

.section { padding: clamp(64px, 11vw, 120px) 24px; }
.section--tint { background: var(--cream); }

.wrap { max-width: var(--wrap); margin: 0 auto; }
.wrap--narrow { max-width: 720px; }

.section__kicker {
  margin: 0 0 12px;
  font-size: 11px; letter-spacing: .34em; text-transform: uppercase; color: var(--gold);
}
.section__title { font-size: clamp(30px, 6vw, 46px); margin-bottom: 28px; }

.prose p { margin: 0 0 18px; }
.prose p:first-child::first-letter { /* буквица только в длинных текстах */
  font-family: var(--serif); font-size: 3.1em; float: left; line-height: .82;
  padding: 6px 10px 0 0; color: var(--wine);
}
.signature {
  margin-top: 30px; font-family: var(--serif); font-style: italic;
  font-size: 21px; color: var(--wine-soft);
}

.fineprint { font-size: 14px; color: var(--ink-soft); margin-top: 18px; }

/* ── кнопки ──────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 14px 30px;
  background: var(--wine); color: var(--cream);
  border: 1px solid var(--wine); border-radius: var(--radius);
  font: inherit; font-size: 14px; letter-spacing: .14em; text-transform: uppercase;
  text-decoration: none; cursor: pointer;
  transition: background .25s var(--ease), transform .15s var(--ease), box-shadow .25s var(--ease);
}
.btn:hover { background: var(--wine-soft); box-shadow: var(--shadow); }
.btn:active { transform: translateY(1px); }
.btn--ghost { background: transparent; color: currentColor; border-color: currentColor; }
.btn--ghost:hover { background: rgba(255, 255, 255, .08); }
.btn--small { min-height: 44px; padding: 10px 20px; font-size: 12px; }

/* ── карточки деталей ────────────────────────────────────── */

.cards {
  display: grid; gap: 20px; margin-top: 34px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.card {
  background: #FDFBF7; border: 1px solid var(--cream-2); border-radius: var(--radius);
  padding: clamp(24px, 4vw, 34px); box-shadow: var(--shadow);
}
.card h3 {
  font-size: 13px; letter-spacing: .28em; text-transform: uppercase;
  color: var(--gold); font-family: var(--sans); font-weight: 400; margin-bottom: 14px;
}
.card__lead { font-family: var(--serif); font-size: clamp(22px, 3.6vw, 28px); margin: 0 0 8px; }
.card__note { color: var(--ink-soft); margin: 0; }
.card__actions { margin: 20px 0 0; }

.note-box {
  margin-top: 24px; padding: 22px 26px;
  background: rgba(247, 241, 232, .96); border-left: 2px solid var(--gold);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--ink-soft);
}
.note-box p { margin: 0 0 10px; }
.note-box p:last-child { margin: 0; }

/* ── тайминг ─────────────────────────────────────────────── */

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  display: grid; grid-template-columns: 92px 1fr; gap: 20px;
  padding: 22px 0; border-top: 1px solid var(--cream-2);
}
.timeline li:last-child { border-bottom: 1px solid var(--cream-2); }
.timeline time {
  font-family: var(--serif); font-size: 22px; color: var(--wine);
  font-variant-numeric: tabular-nums; padding-top: 2px;
}
.timeline h3 { font-size: 22px; margin-bottom: 4px; }
.timeline p { margin: 0; color: var(--ink-soft); font-size: 15px; }
.timeline__tag {
  display: inline-block; margin-top: 8px; padding: 3px 10px;
  background: var(--wine); color: var(--cream);
  border-radius: 999px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
}

/* ── палитра дресс-кода ──────────────────────────────────── */

.swatches { list-style: none; display: flex; flex-wrap: wrap; gap: 14px; margin: 28px 0 0; padding: 0; }
.swatches li { display: grid; gap: 8px; justify-items: center; }
.swatches span.swatch {
  width: 56px; height: 56px; border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(42, 32, 36, .12), var(--shadow);
}
.swatches small { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }

/* ── галерея ─────────────────────────────────────────────── */

.gallery { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.gallery figure { margin: 0; aspect-ratio: 3 / 4; overflow: hidden; border-radius: var(--radius); background: var(--cream-2); }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.gallery figure:hover img { transform: scale(1.04); }

/* ── форма ───────────────────────────────────────────────── */

.form { display: grid; gap: 22px; margin-top: 34px; }
.field { display: grid; gap: 8px; border: 0; padding: 0; margin: 0; }
.field label, .field legend {
  font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-soft);
}
.field input[type="text"], .field input[type="number"], .field select, .field textarea {
  width: 100%; min-height: 54px; padding: 14px 16px;
  font: inherit; color: var(--ink);
  background: #FDFBF7;
  border: 1px solid var(--cream-2); border-radius: var(--radius);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(176, 141, 87, .18);
}
.field__error input, .field__error select, .field__error textarea { border-color: #A33; }

.choices { display: flex; flex-wrap: wrap; gap: 10px; }
.choice {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 52px; padding: 12px 20px;
  border: 1px solid var(--cream-2); border-radius: var(--radius);
  background: #FDFBF7; cursor: pointer; font-size: 15px;
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.choice:has(input:checked) { border-color: var(--wine); background: #fff; }
.choice input { width: 20px; height: 20px; accent-color: var(--wine); }

.stepper { display: inline-flex; align-items: center; gap: 8px; }
.stepper button {
  width: 54px; height: 54px; font-size: 22px; line-height: 1;
  background: var(--cream); color: var(--wine);
  border: 1px solid var(--cream-2); border-radius: var(--radius); cursor: pointer;
}
.stepper button:hover { background: var(--cream-2); }
.field .stepper input { width: 104px; text-align: center; }

.form__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.form__status { margin: 0; min-height: 1.2em; font-size: 15px; }
.form__status--ok { color: var(--sage); }
.form__status--err { color: #A33; }

/* ── пожелания ───────────────────────────────────────────── */

.wishes { display: grid; gap: 16px; }
.wishes blockquote {
  margin: 0; padding: 22px 26px;
  background: #FDFBF7; border-radius: var(--radius); box-shadow: var(--shadow);
  font-family: var(--serif); font-size: 20px; font-style: italic; line-height: 1.5;
}
.wishes cite { display: block; margin-top: 12px; font-family: var(--sans); font-style: normal; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); }

/* ── FAQ ─────────────────────────────────────────────────── */

.faq { border-top: 1px solid var(--cream-2); }
.faq details { border-bottom: 1px solid var(--cream-2); }
.faq summary {
  cursor: pointer; list-style: none; padding: 22px 40px 22px 0;
  font-family: var(--serif); font-size: 21px; position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  font-size: 24px; color: var(--gold); transition: transform .25s var(--ease);
}
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq p { margin: 0; padding: 0 0 24px; color: var(--ink-soft); }

/* ── подвал ──────────────────────────────────────────────── */

.footer { padding: clamp(60px, 10vw, 100px) 24px; text-align: center; background: var(--plum); color: var(--cream-2); }
.footer__monogram {
  font-family: var(--serif); font-size: 34px; letter-spacing: .18em;
  color: var(--gold-soft); margin: 0 0 26px;
}
.footer__line { margin: 0 0 22px; }
.footer__note { margin: 0; font-size: 14px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-soft); }

/* ── тост ────────────────────────────────────────────────── */

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px);
  z-index: 60; max-width: min(92vw, 460px);
  padding: 16px 22px; border-radius: var(--radius);
  background: var(--ink); color: var(--paper);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .28);
  opacity: 0; transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ── появление при скролле ───────────────────────────────── */

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ── печать: запасной вариант для тех, кому удобнее бумага ── */

@media print {
  .nav, .hero__cta, .form, .footer__line, .toast, .hero__ornament { display: none !important; }
  body { background: #fff; font-size: 12pt; }
  .hero { min-height: auto; color: #000; background: none; padding: 0 0 24pt; }
  .hero::after { display: none; }
  .hero__name { font-size: 34pt; }
  .section { padding: 12pt 0; page-break-inside: avoid; }
  .section--tint { background: none; }
  .countdown { display: none; }
  a { text-decoration: none; color: #000; }
}

/* ── мелкие экраны ───────────────────────────────────────── */

@media (max-width: 480px) {
  body { font-size: 16px; }
  .nav { font-size: 11px; gap: 12px; }
  .timeline li { grid-template-columns: 68px 1fr; gap: 14px; }
  .timeline time { font-size: 19px; }
  .prose p:first-child::first-letter { font-size: 2.6em; }
}

/* ── музыка ─────────────────────────────────────────────── */

/* Выключатель в углу: гостя нельзя оставлять без возможности выключить
   звук, поэтому кнопка появляется только когда музыка реально играет. */
.music-toggle {
  position: fixed; right: 18px; bottom: 18px; z-index: 55;
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, .28); border-radius: 999px;
  background: var(--ink); color: var(--paper);
  font: inherit; font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  cursor: pointer; opacity: .82;
  transition: opacity .25s var(--ease), background .25s var(--ease);
}
/* Своё правило вместо [hidden] браузера: у .music-toggle задана
   display, и она иначе перебила бы скрытие. */
.music-toggle[hidden] { display: none; }

.music-toggle:hover { opacity: 1; }
.music-toggle__note { font-size: 15px; line-height: 1; }
.music-toggle.is-muted { opacity: .5; }
.music-toggle.is-muted .music-toggle__note { text-decoration: line-through; }
.music-toggle:focus-visible { outline: 2px solid var(--gold-soft); outline-offset: 2px; }

@media (max-width: 480px) {
  .music-toggle { right: 12px; bottom: 12px; padding: 10px 14px; }
  .music-toggle__text { display: none; }
}

@media print { .music-toggle { display: none; } }
