@font-face {
  font-family: "Ahlan Wasahlan";
  src: url("../assets/fonts/a-ahlan-wasahlan.otf") format("opentype");
  font-display: block;
}

:root {
  /* Палитра */
  --ivory: #FAF7F2;      /* основной фон */
  --powder: #E8D8D0;     /* подложки, мягкие акценты */
  --graphite: #292929;   /* кнопки, детали */
  --deep: #03415A;       /* синий с пригласительной */
  --deep-2: #022C3E;
  --cream: #F7EFDF;      /* кремовый с пригласительной */
  --gold: #C9A26B;
  --peach: #F2C38E;
  --muted: #6E625C;
  --line: rgba(41, 41, 41, .12);

  --f-head: "Ahlan Wasahlan", "Cormorant Garamond", Georgia, serif;
  --f-body: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --gutter: 16px;
  --radius: 14px;
  --ease: cubic-bezier(.22, .8, .24, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ivory);
  color: var(--graphite);
  font-family: var(--f-body);
  font-weight: 500;
  font-size: 1.2rem;
  line-height: 1.55;
  font-variant-numeric: lining-nums;
  overflow-x: hidden;
}
main section { scroll-margin-top: 56px; }
body.is-locked { overflow: hidden; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.font-ahlan { font-family: var(--f-head); font-weight: 400; }

/* ====================== Вступление ====================== */
.intro { display: none; }
.js .intro {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background:
    radial-gradient(ellipse at 50% 45%, rgba(233, 198, 123, .16), transparent 55%),
    radial-gradient(ellipse at 50% 50%, #0A4E6B 0%, var(--deep) 35%, var(--deep-2) 100%);
  color: var(--cream);
  transition: opacity .9s ease, visibility .9s;
  overflow: hidden;
}
.intro::before {
  content: ""; position: absolute; inset: 0;
  background: url("../assets/img/pattern.jpg") center / 520px auto repeat;
  opacity: .07; mix-blend-mode: screen;
  animation: drift 40s linear infinite;
}
.intro::after {
  content: ""; position: absolute; left: 50%; top: 45%;
  width: 40vmax; height: 40vmax; margin: -20vmax 0 0 -20vmax;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 245, 215, 1) 0%, rgba(255, 225, 160, .7) 25%, rgba(255, 210, 130, 0) 70%);
  opacity: 0; transform: scale(.2);
  pointer-events: none;
}
.intro.is-opening::after { animation: bloom 1.1s var(--ease) forwards; }
.intro.is-gone { opacity: 0; visibility: hidden; }
@keyframes bloom {
  0% { opacity: 0; transform: scale(.2); }
  35% { opacity: 1; }
  100% { opacity: 1; transform: scale(4.5); }
}
@keyframes drift { from { background-position: 0 0; } to { background-position: -520px -1040px; } }

.intro__sparks { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; }
.intro__stage {
  position: relative; z-index: 1;
  width: min(920px, 100%); padding: 0 var(--gutter);
  text-align: center;
}
.intro__calli { width: 100%; height: auto; overflow: visible; filter: drop-shadow(0 0 18px rgba(255, 205, 120, .35)); }
.calli { font-family: "Aref Ruqaa", "Amiri", serif; font-weight: 700; font-size: 230px; }
.calli--stroke {
  fill: none; stroke: #F6DB98; stroke-width: 2.2; stroke-linejoin: round;
  stroke-dasharray: 1400; stroke-dashoffset: 1400;
}
.calli--fill { opacity: 0; transition: opacity 1.2s ease; }
.intro.is-filled .calli--fill { opacity: 1; }
.intro.is-filled .calli--stroke { stroke-opacity: .55; transition: stroke-opacity 1.2s; }
.intro.is-writing .calli--stroke { animation: write 3s cubic-bezier(.45, .05, .35, 1) forwards; }
@keyframes write { to { stroke-dashoffset: 0; } }

.intro__translit, .intro__meaning, .intro__open {
  opacity: 0; transform: translateY(12px);
  transition: opacity 1s ease, transform 1s var(--ease);
}
.intro__translit {
  margin: .4rem 0 0;
  font-family: var(--f-head); font-size: clamp(2rem, 7vw, 3.2rem);
  color: var(--peach); letter-spacing: .02em;
}
.intro__meaning {
  margin: .2rem 0 2rem; font-style: italic; font-size: 1.15rem;
  color: rgba(247, 239, 223, .75); letter-spacing: .08em;
}
.intro.show-text .intro__translit, .intro.show-text .intro__meaning { opacity: 1; transform: none; }
.intro.show-btn .intro__open { opacity: 1; transform: none; }
.intro.show-text .intro__meaning { transition-delay: .35s; }
.intro__open { pointer-events: none; }
.intro.show-btn .intro__open { pointer-events: auto; }
.intro__skip {
  position: absolute; z-index: 3; right: var(--gutter); bottom: calc(var(--gutter) + env(safe-area-inset-bottom));
  background: none; border: 0; padding: .5rem;
  font-size: .95rem; color: rgba(247, 239, 223, .55); letter-spacing: .06em;
}
.intro__skip:hover { color: var(--cream); }

/* ====================== Кнопки ====================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 48px; padding: .7rem 1.5rem;
  border: 1px solid var(--graphite); border-radius: 999px;
  background: var(--graphite); color: var(--ivory);
  font-family: var(--f-body); font-weight: 600; font-size: 1.05rem; letter-spacing: .04em;
  text-decoration: none;
  transition: background .25s, color .25s, border-color .25s, transform .25s var(--ease);
}
.btn:hover { background: var(--deep); border-color: var(--deep); }
.btn:active { transform: scale(.98); }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn--ghost { background: transparent; color: var(--graphite); }
.btn--ghost:hover { background: var(--graphite); color: var(--ivory); border-color: var(--graphite); }
.btn--gold {
  background: linear-gradient(180deg, #F4D896, #C9A15B);
  border-color: transparent; color: var(--deep-2);
  box-shadow: 0 0 0 1px rgba(255, 236, 190, .35), 0 10px 30px rgba(233, 190, 110, .25);
}
.btn--gold:hover { background: linear-gradient(180deg, #FBE6B3, #D4AE6A); border-color: transparent; }
.btn--block { width: 100%; }
.btn--sm { min-height: 40px; padding: .45rem 1.05rem; font-size: .98rem; }

.link-btn {
  display: inline-flex; align-items: center; gap: .45rem;
  background: none; border: 0; padding: .4rem .2rem;
  color: var(--muted); font-size: 1.05rem; text-decoration: none; letter-spacing: .03em;
}
.link-btn:hover { color: var(--deep); }
.link-btn svg { width: 18px; height: 18px; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(250, 247, 242, .7);
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn[aria-pressed="true"] { background: var(--graphite); color: var(--ivory); border-color: var(--graphite); }
.icon-btn[aria-pressed="true"] svg { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.12); } }

/* ====================== Верхняя панель ====================== */
.topbar {
  position: fixed; z-index: 50; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) var(--gutter) 10px;
  transition: background .3s, box-shadow .3s;
}
.topbar.is-solid { background: rgba(250, 247, 242, .88); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 1px 0 var(--line); }
.topbar__mark { font-size: 1.7rem; text-decoration: none; color: var(--deep); line-height: 1; }
.topbar__tools { display: flex; align-items: center; gap: 10px; }
.lang { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: rgba(250, 247, 242, .7); }
.lang button {
  border: 0; background: none; padding: .3rem .75rem; border-radius: 999px;
  font-size: .95rem; font-weight: 600; letter-spacing: .08em; color: var(--muted);
}
.lang button[aria-pressed="true"] { background: var(--graphite); color: var(--ivory); }

/* ====================== Пригласительная ====================== */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 84px var(--gutter) 36px;
  overflow: hidden;
}
.hero__glow {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 60% 45% at 50% 40%, rgba(232, 216, 208, .9), transparent 70%),
    radial-gradient(circle at 12% 88%, rgba(232, 216, 208, .6), transparent 30%),
    radial-gradient(circle at 90% 12%, rgba(232, 216, 208, .6), transparent 30%);
}
.card { position: relative; width: min(400px, 100%); perspective: 1600px; }
.card__inner {
  display: grid;
  transform-style: preserve-3d;
  transition: transform 1.4s var(--ease);
}
.card.is-back .card__inner { transform: rotateY(180deg); }
.card__face {
  grid-area: 1 / 1;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border-radius: 6px; overflow: hidden;
  box-shadow: 0 30px 60px -20px rgba(3, 65, 90, .45), 0 8px 20px -8px rgba(41, 41, 41, .25);
}
.card__front { background: var(--deep); color: var(--cream); text-align: center; }
.card__back {
  transform: rotateY(180deg);
  background: var(--deep) url("../assets/img/pattern.jpg") center / cover;
  border: 6px solid var(--deep);
}
.card__art { width: 100%; height: auto; }
.card__body { padding: .2rem 1.6rem 2rem; margin-top: -6%; position: relative; }
.card__title { margin: 0; font-size: clamp(2.6rem, 12vw, 3.4rem); line-height: 1.1; color: var(--cream); }
.card__greet { margin: .7rem 0 .4rem; font-size: 1.35rem; font-weight: 600; font-style: italic; color: var(--peach); }
.card__text { margin: 0 auto; max-width: 30ch; font-size: 1.1rem; line-height: 1.5; color: rgba(247, 239, 223, .9); }
.card__names { margin: 1rem 0 .2rem; font-size: clamp(2rem, 9vw, 2.5rem); line-height: 1.15; color: var(--cream); }
.card__names .amp { color: var(--peach); padding: 0 .1em; }
.card__date {
  display: inline-block; margin: .5rem 0 .3rem; padding: .35rem 1rem;
  border-top: 1px solid rgba(242, 195, 142, .45); border-bottom: 1px solid rgba(242, 195, 142, .45);
  font-size: 1.15rem; font-weight: 600; letter-spacing: .06em; color: var(--peach);
}
.card__venue { margin: .2rem 0 0; font-size: 1.05rem; letter-spacing: .08em; text-transform: uppercase; color: rgba(247, 239, 223, .8); }

.hero__actions { position: relative; display: flex; gap: 1.2rem; margin-top: 1.4rem; flex-wrap: wrap; justify-content: center; }

/* Полоска узора — как кайма на сюзане */
.ornament-strip {
  height: 18px;
  background: var(--deep) url("../assets/img/pattern.jpg") center / 180px auto repeat-x;
  border-top: 2px solid var(--peach); border-bottom: 2px solid var(--peach);
}

/* ====================== Секции ====================== */
.section, .band {
  padding: clamp(64px, 10vw, 110px) var(--gutter);
  text-align: center;
}
.section > *, .band > * { margin-left: auto; margin-right: auto; }
.section--powder { background: var(--powder); }
.band { position: relative; background: var(--deep); color: var(--cream); overflow: hidden; isolation: isolate; }
.band::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: url("../assets/img/pattern.jpg") center / 420px auto repeat;
  opacity: .1;
}
.h-title {
  margin: 0; font-family: var(--f-head); font-weight: 400;
  font-size: clamp(2.5rem, 9vw, 3.8rem); line-height: 1.1; color: var(--deep);
}
.h-title--light { color: var(--cream); }
.h-title--small { font-size: clamp(1.9rem, 6vw, 2.6rem); }
/* В шрифте Ahlan Wasahlan нет кириллицы — для русского берём курсивный Cormorant */
html[lang="ru"] .h-title { font-family: var(--f-body); font-style: italic; font-weight: 600; font-size: clamp(2.2rem, 7.5vw, 3.2rem); }

.divider {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  margin: 1rem auto 2rem; max-width: 280px;
}
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }
.divider::after { transform: scaleX(-1); }
.divider img { width: 34px; height: 34px; object-fit: contain; }

.lead { max-width: 36rem; margin: 0 auto 2rem; font-size: 1.25rem; color: var(--muted); }
.lead--light { color: rgba(247, 239, 223, .85); margin-top: .8rem; }

.actions { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: center; margin-top: 1.6rem; }
.actions--small { margin-top: .9rem; gap: .5rem; }

/* Появление при прокрутке */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .9s ease, transform .9s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* ====================== Обратный отсчёт ====================== */
.countdown {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(8px, 2.5vw, 20px);
  max-width: 620px; margin-top: 2rem;
}
.cd {
  display: flex; flex-direction: column; align-items: center;
  padding: clamp(14px, 3vw, 22px) 4px;
  border: 1px solid rgba(242, 195, 142, .35); border-radius: var(--radius);
  background: rgba(2, 44, 62, .45);
}
.cd__num { font-size: clamp(2.2rem, 9vw, 3.6rem); font-weight: 600; line-height: 1; color: var(--cream); font-variant-numeric: lining-nums tabular-nums; }
.cd__label { margin-top: .45rem; font-size: clamp(.85rem, 2.8vw, 1.05rem); letter-spacing: .08em; text-transform: uppercase; color: var(--peach); }
.countdown__status { margin-top: 1.6rem; font-size: 1.5rem; font-style: italic; color: var(--peach); }

/* ====================== Календарь ====================== */
.calendar {
  max-width: 400px; padding: 1.4rem 1.2rem 1.2rem;
  background: #fff; border-radius: 18px;
  box-shadow: 0 1px 0 var(--line), 0 20px 50px -30px rgba(3, 65, 90, .45);
}
.calendar__head { margin-bottom: .8rem; font-size: 1.5rem; font-weight: 600; color: var(--deep); letter-spacing: .03em; }
.calendar__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-wd { padding: .3rem 0; font-size: .85rem; font-weight: 600; letter-spacing: .06em; color: var(--muted); text-transform: uppercase; }
.cal-day {
  position: relative; display: grid; place-items: center;
  aspect-ratio: 1; border-radius: 50%;
  font-size: 1.15rem; font-variant-numeric: lining-nums tabular-nums; color: var(--graphite);
}
.cal-day.is-weekend { color: #9A6B5A; }
.cal-day.is-navkar { box-shadow: inset 0 0 0 2px var(--peach); font-weight: 700; color: var(--deep); }
.cal-day.is-wedding { background: var(--deep); color: var(--cream); font-weight: 700; }
.cal-day.is-wedding::after {
  content: ""; position: absolute; inset: -5px; border-radius: 50%;
  border: 1px solid var(--gold); animation: ring 2.4s ease-in-out infinite;
}
.cal-day .heart { position: absolute; top: -6px; right: -4px; width: 16px; height: 16px; color: #C8473B; }
@keyframes ring { 50% { transform: scale(1.12); opacity: .4; } }
.calendar__legend { list-style: none; margin: 1rem 0 0; padding: .9rem 0 0; border-top: 1px solid var(--line); text-align: left; font-size: 1.05rem; }
.calendar__legend li { display: flex; align-items: center; gap: .7rem; padding: .2rem 0; }
.calendar__legend i { flex: none; width: 18px; height: 18px; border-radius: 50%; }
.calendar__legend .lg-wedding { background: var(--deep); }
.calendar__legend .lg-navkar { box-shadow: inset 0 0 0 2px var(--peach); }

/* ====================== Программа ====================== */
.days { display: grid; gap: 22px; max-width: 920px; }
@media (min-width: 760px) { .days.has-two { grid-template-columns: 1fr 1fr; } .days:not(.has-two) { max-width: 460px; } }
.day {
  text-align: left; background: var(--ivory); border-radius: 18px; overflow: hidden;
  box-shadow: 0 20px 50px -34px rgba(3, 65, 90, .55);
}
.day__head { padding: 1.1rem 1.4rem; background: var(--deep); color: var(--cream); }
.day__date { margin: 0; font-size: 1rem; letter-spacing: .08em; text-transform: uppercase; color: var(--peach); }
.day__title { margin: .1rem 0 0; font-size: 1.7rem; font-weight: 600; line-height: 1.2; }
.timeline { list-style: none; margin: 0; padding: 1.2rem 1.4rem 1.4rem; }
.timeline li { position: relative; display: grid; grid-template-columns: 4.4rem 1fr; gap: .8rem; padding: .55rem 0; }
.timeline li + li { border-top: 1px dashed var(--line); }
.tl-time { font-weight: 700; font-size: 1.2rem; color: var(--deep); font-variant-numeric: lining-nums tabular-nums; }
.tl-what { font-weight: 600; }
.tl-note { display: block; font-weight: 500; font-size: 1.02rem; color: var(--muted); }

/* ====================== Карты ====================== */
.venue__name { margin: 0; font-size: 1.7rem; font-weight: 700; color: var(--deep); }
.venue__when { margin: .2rem 0 1.6rem; color: var(--muted); }
.map {
  max-width: 920px; border-radius: 18px; overflow: hidden;
  border: 6px solid #fff; box-shadow: 0 0 0 1px var(--line), 0 20px 50px -30px rgba(3, 65, 90, .5);
  aspect-ratio: 4 / 3; background: var(--powder);
}
@media (min-width: 760px) { #venue .map { aspect-ratio: 16 / 8; } }
.map iframe { display: block; width: 100%; height: 100%; border: 0; }
.maps-2 { display: grid; gap: 22px; max-width: 920px; }
@media (min-width: 760px) { .maps-2 { grid-template-columns: 1fr 1fr; } }
.map-card { margin: 0; }
.map-card figcaption { margin-bottom: .7rem; font-weight: 600; font-size: 1.15rem; }
.map-card__time {
  display: inline-block; margin-right: .5rem; padding: .05rem .6rem; border-radius: 999px;
  background: var(--deep); color: var(--cream); font-size: 1rem;
}

/* ====================== Анкета ====================== */
.rsvp {
  max-width: 520px; margin-top: 2rem; padding: clamp(1.4rem, 5vw, 2.2rem);
  background: var(--ivory); color: var(--graphite); border-radius: 20px; text-align: left;
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .5);
}
.field { display: block; margin: 0 0 1.3rem; padding: 0; border: 0; min-width: 0; }
.field__label { display: block; margin-bottom: .45rem; padding: 0; font-weight: 700; font-size: 1.1rem; color: var(--deep); }
.field input[type="text"], .field select, .field textarea {
  width: 100%; min-height: 48px; padding: .65rem .9rem;
  border: 1px solid rgba(41, 41, 41, .22); border-radius: 12px; background: #fff;
  font: inherit; font-size: 1.15rem; color: var(--graphite);
}
.field textarea { resize: vertical; min-height: 96px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--deep); box-shadow: 0 0 0 3px rgba(3, 65, 90, .15); }
.field__error { display: block; margin-top: .35rem; font-size: 1rem; color: #B23A2E; }
.choices { display: grid; gap: .55rem; }
@media (min-width: 480px) { .choices { grid-template-columns: 1fr 1fr; } }
.choice { position: relative; display: block; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice span {
  display: flex; align-items: center; justify-content: center; min-height: 48px; padding: .5rem .8rem;
  border: 1px solid rgba(41, 41, 41, .22); border-radius: 12px; background: #fff;
  text-align: center; font-weight: 600; line-height: 1.25; transition: background .2s, color .2s, border-color .2s;
}
.choice input:checked + span { background: var(--graphite); color: var(--ivory); border-color: var(--graphite); }
.choice input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form-msg { margin: 1rem 0 0; color: #B23A2E; text-align: center; }
.rsvp__done { text-align: center; padding: .5rem 0; }
.rsvp__done img { margin: 0 auto 1rem; animation: spin-in 1.2s var(--ease); }
@keyframes spin-in { from { transform: rotate(-90deg) scale(.4); opacity: 0; } }
.rsvp__thanks { margin: 0 0 .5rem; font-size: 1.5rem; font-weight: 600; color: var(--deep); }
.rsvp__note { margin: 0 0 .5rem; color: var(--muted); font-size: 1rem; }

/* ====================== Вопросы ====================== */
.faq { max-width: 720px; text-align: left; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 1.1rem .2rem; cursor: pointer; list-style: none;
  font-weight: 700; font-size: 1.25rem; color: var(--deep);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: none; width: 14px; height: 14px;
  background: linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat, linear-gradient(currentColor, currentColor) center / 2px 100% no-repeat;
  transition: transform .3s var(--ease);
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq p { margin: 0; padding: 0 .2rem 1.2rem; color: var(--muted); }

/* ====================== Подвал ====================== */
.footer {
  padding: 64px var(--gutter) calc(48px + env(safe-area-inset-bottom));
  background: var(--deep-2); color: var(--cream); text-align: center;
}
.footer__medallion { width: 84px; margin: 0 auto 1rem; }
.footer__names { margin: 0; font-size: clamp(2.4rem, 9vw, 3.2rem); line-height: 1.1; }
.footer__date { margin: .4rem 0 0; color: var(--peach); letter-spacing: .1em; }
.footer__text { margin: 1rem 0 0; font-style: italic; color: rgba(247, 239, 223, .75); }

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