/* =================================================================
   Приглашение · золото + казахский орнамент · тёмная и светлая темы
   Мобильный приоритет
   ================================================================= */

:root,
[data-theme="dark"] {
  --bg: #0b0a07;
  --bg-2: #15110a;
  --card: rgba(255, 248, 230, 0.05);
  --card-brd: rgba(205, 169, 104, 0.26);
  --line: rgba(205, 169, 104, 0.22);
  --gold: #cda968;
  --gold-hi: #f1da9f;
  --gold-lo: #927239;
  --text: #efe6d3;
  --head: #fbf6ec;
  --muted: #b3a585;
  --shade: rgba(8, 7, 5, 0.86);
}

[data-theme="light"] {
  --bg: #f2ead9;
  --bg-2: #f8f2e6;
  --card: rgba(255, 253, 247, 0.7);
  --card-brd: rgba(138, 104, 46, 0.26);
  --line: rgba(138, 104, 46, 0.3);
  --gold: #9a7a34;
  --gold-hi: #7d5a14;
  --gold-lo: #6a4d12;
  --text: #34291a;
  --head: #221a0d;
  --muted: #6a5b41;
  --shade: rgba(8, 7, 5, 0.78);
}

:root {
  --grad-gold: linear-gradient(135deg, var(--gold-hi) 0%, var(--gold) 45%, var(--gold-lo) 100%);
  --f-display: 'Cormorant Garamond', Georgia, serif;
  --f-body: 'Jost', system-ui, sans-serif;
  --f-hand: 'Bad Script', 'Cormorant Garamond', cursive;
  --f-play: 'Playfair Display', 'Cormorant Garamond', serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 300 16px/1.65 var(--f-body);
  overflow-x: hidden;
  transition: background .5s, color .5s;
}
body.no-scroll { overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; }
em { font-style: italic; color: var(--gold); }

/* ---------- орнамент и монограмма ---------- */
.orn { color: var(--gold); width: 180px; max-width: 60%; margin: 18px auto; }
.orn svg { display: block; width: 100%; height: auto; }

.mono {
  width: 96px; height: 96px; margin: 0 auto;
  border: 1px solid var(--line); border-radius: 50%;
  display: grid; place-items: center; position: relative;
  color: var(--gold);
  font: 400 34px/1 var(--f-display); letter-spacing: 1px;
}
.mono::after { content: ''; position: absolute; inset: 6px; border: 1px solid var(--line); border-radius: 50%; opacity: .6; }
.mono sup { font-size: .55em; opacity: .8; margin: 0 1px; }
.mono--sm { width: 76px; height: 76px; font-size: 27px; }

.eyebrow {
  display: block;
  font: 400 12px/1 var(--f-body); letter-spacing: .32em; text-transform: uppercase;
  color: var(--gold);
}

/* ---------- экран выбора языка ---------- */
.gate {
  position: fixed; inset: 0; z-index: 100;
  background: radial-gradient(ellipse at 50% 40%, var(--bg-2), var(--bg) 70%);
  display: grid; place-items: center; padding: 24px;
  transition: opacity .8s var(--ease), visibility .8s;
}
.gate.is-hidden { opacity: 0; visibility: hidden; }
.gate__inner { text-align: center; animation: rise 1.2s var(--ease) both; }
.gate__label { font-size: 13px; letter-spacing: .3em; text-transform: uppercase; color: var(--muted); margin-bottom: 22px; }
.gate__btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-width: 150px; padding: 14px 26px; border-radius: 999px;
  font-size: 14px; letter-spacing: .14em; text-transform: uppercase;
  transition: transform .3s var(--ease), background .3s, color .3s, box-shadow .3s;
}
.btn:active { transform: scale(.97); }
.btn--ghost { border: 1px solid var(--card-brd); color: var(--head); }
.btn--ghost:hover { background: var(--grad-gold); color: #1a1408; border-color: transparent; }
.btn--gold { background: var(--grad-gold); color: #1a1408; font-weight: 500; width: 100%; box-shadow: 0 14px 30px -14px rgba(205, 169, 104, .6); }
.btn--gold:disabled { opacity: .6; cursor: wait; }

/* ---------- кнопки управления ---------- */
.controls {
  position: fixed; top: 14px; right: 14px; z-index: 50;
  display: flex; gap: 8px;
}
.ctrl {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(20, 16, 10, .45); color: #f1da9f;
  border: 1px solid rgba(205, 169, 104, .35);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.ctrl svg { width: 18px; height: 18px; }
.ctrl--lang { font-size: 11px; letter-spacing: .08em; font-weight: 500; }
#soundBtn .i-on, #soundBtn[data-on="false"] .i-off { display: block; }
#soundBtn .i-off, #soundBtn[data-on="false"] .i-on { display: none; }
#soundBtn[hidden] { display: none; }
[data-theme="dark"] .i-sun, [data-theme="light"] .i-moon { display: block; }
[data-theme="dark"] .i-moon, [data-theme="light"] .i-sun { display: none; }

/* ---------- HERO с единственным фото ---------- */
.hero {
  position: relative; height: 100vh; height: 100svh; min-height: 560px;
  overflow: hidden; display: flex; align-items: flex-end; justify-content: center;
  color: #fbf6ec; text-align: center;
  background: radial-gradient(ellipse at 50% 30%, #3a2e1a, #0b0a07 75%);
}
.hero__photo { position: absolute; inset: 0; }
.hero__photo img {
  width: 100%; height: 100%; object-fit: cover; object-position: center 22%;
  opacity: 0; transform: scale(1.12);
  transition: opacity 1.6s ease, transform 12s cubic-bezier(.15, .6, .3, 1);
}
.hero.is-ready .hero__photo img { opacity: 1; transform: scale(1); }
.hero__shade {
  position: absolute; inset: 0;
  background:
    linear-gradient(to bottom, rgba(8,7,5,.45) 0%, transparent 22%, transparent 42%, var(--shade) 88%),
    radial-gradient(ellipse at 50% 100%, rgba(8,7,5,.5), transparent 65%);
}
.hero__inner { position: relative; padding: 0 20px 17vh; max-width: 640px; }
.hero__inner > * { opacity: 0; transform: translateY(24px); transition: opacity 1.2s var(--ease), transform 1.2s var(--ease); }
.hero.is-ready .hero__inner > * { opacity: 1; transform: none; }
.hero.is-ready .hero__inner > :nth-child(2) { transition-delay: .25s; }
.hero.is-ready .hero__inner > :nth-child(3) { transition-delay: .5s; }
.hero.is-ready .hero__inner > :nth-child(4) { transition-delay: .7s; }
.hero .eyebrow { color: #f1da9f; }
.hero .orn { color: #e4c88c; margin: 12px auto; }
.hero__names {
  margin-top: 14px;
  font: italic 300 clamp(56px, 15vw, 100px)/1.05 var(--f-display);
  text-shadow: 0 4px 30px rgba(0, 0, 0, .5);
  display: flex; flex-direction: column; align-items: center;
}
.hero__names .amp { font: italic 300 .45em/1.2 var(--f-display); color: #f1da9f; }
.hero__date { font: 400 clamp(20px, 5vw, 26px)/1.2 var(--f-display); letter-spacing: .2em; text-transform: uppercase; }
.hero__scroll {
  position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: rgba(251, 246, 236, .7); text-decoration: none;
  font-size: 11px; letter-spacing: .3em; text-transform: uppercase;
}
.hero__scroll i { width: 1px; height: 36px; background: linear-gradient(#f1da9f, transparent); animation: drip 2s ease-in-out infinite; transform-origin: top; }

/* ---------- секции ---------- */
.section {
  position: relative; text-align: center;
  padding: 88px 20px; max-width: 620px; margin: 0 auto;
}
.section + .section::before {
  content: ''; position: absolute; top: 0; left: 50%; width: 1px; height: 48px;
  background: linear-gradient(transparent, var(--line));
}
.title {
  margin-top: 14px;
  font: 300 clamp(34px, 9vw, 48px)/1.1 var(--f-display);
  color: var(--head);
}
.lead { font: 400 clamp(19px, 4.8vw, 22px)/1.6 var(--f-display); color: var(--text); }
.lead--sm { font-size: 18px; color: var(--muted); margin-bottom: 24px; }

.card {
  background: var(--card); border: 1px solid var(--card-brd); border-radius: 22px;
  padding: 26px 22px; text-align: left;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 24px 50px -30px rgba(0, 0, 0, .6);
}

.hosts { margin-top: 34px; }
.eyebrow--long { font: italic 400 20px/1.4 var(--f-display); letter-spacing: .02em; text-transform: none; }
.hosts__names { margin-top: 10px; font: italic 400 clamp(32px, 8.5vw, 42px)/1.2 var(--f-display); color: var(--head); }
.section[hidden] { display: none; }
.gis:hover { background: rgba(25, 170, 30, .08); }

/* отсчёт */
.count { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.count__cell {
  border: 1px solid var(--card-brd); background: var(--card); border-radius: 16px;
  padding: 18px 4px 14px; display: flex; flex-direction: column; gap: 6px;
}
.count__cell b {
  font: 400 clamp(32px, 9vw, 46px)/1 var(--f-display);
  background: var(--grad-gold); -webkit-background-clip: text; background-clip: text; color: transparent;
  font-variant-numeric: tabular-nums;
}
.count__cell span { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.count--done { display: block; font: italic 400 30px var(--f-display); color: var(--gold); }

/* когда и где */
.row { display: flex; gap: 16px; align-items: flex-start; padding: 12px 0; }
.row + .row { border-top: 1px solid var(--line); }
.row__ico {
  flex: none; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--card-brd); display: grid; place-items: center; color: var(--gold);
}
.row__ico svg { width: 20px; height: 20px; }
.row h4 { font: 500 21px/1.3 var(--f-display); color: var(--head); }
.row p { color: var(--muted); font-size: 15px; }

.gis {
  margin-top: 18px; display: flex; align-items: center; gap: 14px;
  padding: 12px 16px; border-radius: 16px; text-decoration: none; color: var(--head);
  border: 1px solid var(--card-brd); transition: background .3s, transform .3s var(--ease);
}
.gis:hover { transform: translateY(-2px); }
.gis__logo { width: 40px; height: 40px; flex: none; }
.gis span { flex: 1; display: flex; flex-direction: column; }
.gis b { font-weight: 500; }
.gis small { color: var(--muted); font-size: 13px; }
.gis__arrow { width: 18px; height: 18px; color: var(--gold); }

/* программа */
.timeline { list-style: none; position: relative; text-align: left; max-width: 420px; margin: 8px auto 0; }
.timeline::before { content: ''; position: absolute; left: 76px; top: 10px; bottom: 10px; width: 1px; background: var(--line); }
.timeline li { position: relative; display: flex; gap: 34px; align-items: baseline; padding: 14px 0; }
.timeline li::before {
  content: ''; position: absolute; left: 72px; top: 24px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--grad-gold); box-shadow: 0 0 0 4px var(--bg);
}
.timeline time { flex: none; width: 60px; text-align: right; font: 500 20px var(--f-display); color: var(--gold); }
.timeline span { font: 400 20px/1.35 var(--f-display); color: var(--head); }

/* RSVP */
.form { display: flex; flex-direction: column; gap: 20px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field > span { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.field input[type=text], .field textarea {
  width: 100%; padding: 13px 16px; border-radius: 12px;
  background: transparent; color: var(--head);
  border: 1px solid var(--card-brd); font: 400 16px var(--f-body); resize: vertical;
  transition: border-color .3s, box-shadow .3s;
}
.field input::placeholder, .field textarea::placeholder { color: var(--muted); opacity: .6; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(205, 169, 104, .15); }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt i {
  display: block; text-align: center; font-style: normal; padding: 12px 8px; border-radius: 12px;
  border: 1px solid var(--card-brd); cursor: pointer; transition: all .3s;
}
.opt input:checked + i { background: var(--grad-gold); color: #1a1408; border-color: transparent; font-weight: 500; }
.opt input:focus-visible + i { outline: 2px solid var(--gold); outline-offset: 2px; }
.stepper { display: flex; align-items: center; gap: 18px; }
.stepper button {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--card-brd);
  font-size: 22px; color: var(--gold);
}
.stepper output { min-width: 28px; text-align: center; font: 500 26px var(--f-display); color: var(--head); }
.form[data-attending="no"] .when-yes { display: none; }
.form__err { color: #e07a6a; font-size: 14px; text-align: center; }

.done { text-align: center; animation: rise .8s var(--ease) both; }
.done svg { width: 72px; height: 72px; color: var(--gold); margin-bottom: 12px; }
.done svg circle { stroke-dasharray: 227; stroke-dashoffset: 227; animation: draw 1s .1s ease forwards; }
.done svg path { stroke-dasharray: 50; stroke-dashoffset: 50; animation: draw .5s .9s ease forwards; }
.done h3 { font: 400 34px var(--f-display); color: var(--head); }
.done p { color: var(--muted); }

/* финальный экран */
.footer {
  position: relative; overflow: hidden; text-align: center;
  min-height: 100vh; min-height: 100svh; padding: 80px 20px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-top: 1px solid var(--line);
  background: radial-gradient(ellipse at 50% 45%, var(--bg-2), var(--bg) 70%);
}
.footer__glow {
  position: absolute; left: 50%; top: 42%; width: 520px; height: 520px; max-width: 120vw;
  transform: translate(-50%, -50%); border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(205, 169, 104, .18), transparent 65%);
  animation: breathe 7s ease-in-out infinite;
}
.footer > :not(.footer__glow) { position: relative; }
.footer__title {
  margin-top: 26px;
  font: 400 clamp(42px, 12vw, 80px)/1.15 var(--f-hand); color: var(--head);
}
.footer__title em { font-style: normal; background: var(--grad-gold); -webkit-background-clip: text; background-clip: text; color: transparent; }
.footer__date { font: italic 400 clamp(20px, 5.4vw, 26px)/1.4 var(--f-play); color: var(--text); letter-spacing: .02em; }
.footer__sign { margin-top: 42px; display: flex; flex-direction: column; gap: 4px; }
.footer__sign span { font: italic 400 19px var(--f-play); color: var(--muted); }
.footer__sign b { font: 400 clamp(34px, 9.5vw, 48px)/1.25 var(--f-hand); color: var(--gold); }
.footer__hash {
  margin-top: 34px; padding: 10px 22px; border: 1px solid var(--card-brd); border-radius: 999px;
  font: italic 500 17px var(--f-play); color: var(--gold); letter-spacing: .03em;
}

/* ---------- появление при прокрутке ---------- */
.reveal {
  opacity: 0; transform: translateY(34px);
  transition: opacity 1.1s var(--ease), transform 1.1s var(--ease), filter 1.1s var(--ease), letter-spacing 1.4s var(--ease);
  transition-delay: calc(var(--d, 0) * 140ms);
}
.reveal[data-anim="left"]  { transform: translateX(-46px); }
.reveal[data-anim="right"] { transform: translateX(46px); }
.reveal[data-anim="scale"] { transform: scale(.9); }
.reveal[data-anim="flip"]  { transform: perspective(900px) rotateX(55deg) translateY(30px); transform-origin: 50% 100%; }
.reveal[data-anim="blur"]  { transform: translateY(18px); filter: blur(10px); letter-spacing: .08em; }
.reveal[data-anim="draw"]  { transform: scaleX(0); transition-duration: 1.4s; }
.reveal.is-in { opacity: 1; transform: none; filter: none; }
.reveal[data-anim="blur"].is-in { letter-spacing: 0; }
.count__cell.reveal { transition-duration: 1.2s; }

/* цифра отсчёта «перелистывается» */
.count__cell b { display: inline-block; }
.count__cell b.tick { animation: tick .6s var(--ease); }
@keyframes tick { 0% { transform: translateY(-40%) rotateX(80deg); opacity: 0; } 100% { transform: none; opacity: 1; } }

/* ---------- лепестки ---------- */
.petals { position: fixed; inset: 0; z-index: 30; pointer-events: none; overflow: hidden; }
.petal {
  position: absolute; top: -40px; left: var(--x);
  animation: fall var(--t) linear var(--delay) infinite;
  will-change: transform;
}
.petal i {
  display: block; width: var(--s); height: calc(var(--s) * .78);
  border-radius: 150% 0 150% 0;
  background: var(--c);
  box-shadow: inset -1px -2px 3px rgba(0, 0, 0, .12);
  opacity: var(--o);
  animation: sway calc(var(--t) / 3) ease-in-out var(--delay) infinite alternate;
}
@keyframes fall {
  0%   { transform: translate3d(0, -5vh, 0); }
  100% { transform: translate3d(var(--drift), 108vh, 0); }
}
@keyframes sway {
  0%   { transform: translateX(-18px) rotate(-25deg) rotateY(0deg); }
  100% { transform: translateX(18px) rotate(60deg) rotateY(160deg); }
}

/* прогресс прокрутки */
.progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 60;
  background: var(--grad-gold); transform-origin: 0 50%; transform: scaleX(0);
}

/* уход экрана выбора языка */
.gate.is-hidden .gate__inner { transform: scale(1.08); filter: blur(6px); transition: transform .8s var(--ease), filter .8s var(--ease); }
.gate .mono { animation: glow 3.5s ease-in-out infinite; }
@keyframes glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(205, 169, 104, 0); } 50% { box-shadow: 0 0 40px 2px rgba(205, 169, 104, .25); } }
@keyframes breathe { 0%, 100% { opacity: .6; transform: translate(-50%, -50%) scale(.92); } 50% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); } }

.hero__photo, .hero__inner { will-change: transform; }

@keyframes rise { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes drip { 0%, 100% { transform: scaleY(.3); opacity: .4; } 50% { transform: scaleY(1); opacity: 1; } }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* широкий экран: портрет целиком, по бокам — размытая копия */
@media (min-aspect-ratio: 4/5) and (min-width: 760px) {
  .hero__photo::before {
    content: ''; position: absolute; inset: -40px;
    background: var(--photo) center / cover; filter: blur(28px) brightness(.55);
  }
  .hero__photo img { position: relative; object-fit: contain; object-position: center; }
}

@media (min-width: 760px) {
  .section { padding: 120px 24px; }
  .card { padding: 34px 32px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal, .hero__inner > *, .hero__photo img { opacity: 1 !important; transform: none !important; filter: none !important; }
  .petals { display: none; }
}
