/* ==========================================================================
   TAKLIFNOMA — Fatxiddin & Zarnigor
   1. Tokens          5. Muqova
   2. Reset / layout  6. Taklif
   3. Typografiya     7. Sana / Manzil / To'yona / RSVP
   4. Komponentlar    8. Interfeys (eshik, dots, fab, effektlar)
   ========================================================================== */

/* ===== 1. TOKENS ========================================================= */

:root {
  /* Ranglar — asosiy rasmdagi qog'oz tusidan olingan */
  --paper:      #faf7f2;
  --paper-2:    #f2e9dd;
  --paper-3:    #e7ddd3;
  --ink:        #3a2f26;
  --ink-2:      #6d5c4c;
  --ink-3:      #9b8877;
  --gold:       #b8905a;
  --gold-soft:  #d8b878;
  --gold-deep:  #8a6a3c;
  --gold-pale:  #f0dcae;
  --line:       rgba(184, 144, 90, .28);
  --line-light: rgba(255, 255, 255, .32);

  /* Shriftlar */
  --f-script: 'Great Vibes', cursive;
  --f-serif:  'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --f-sans:   'Montserrat', system-ui, -apple-system, sans-serif;

  /* O'lchamlar */
  --frame: 480px;
  --pad: clamp(20px, 6vw, 30px);
  --gutter: max(14px, calc(50vw - var(--frame) / 2 + 14px));
  --radius: 18px;
  --radius-lg: 26px;

  /* Soyalar */
  --sh-1: 0 2px 10px rgba(58, 47, 38, .07);
  --sh-2: 0 10px 30px -12px rgba(58, 47, 38, .28);
  --sh-3: 0 24px 60px -24px rgba(58, 47, 38, .45);

  /* Harakat */
  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

/* ===== 2. RESET / LAYOUT ================================================= */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 0;
  overflow-x: clip;
}

body {
  min-height: 100dvh;
  font-family: var(--f-sans);
  font-weight: 300;
  color: var(--ink);
  background:
    radial-gradient(1200px 700px at 50% -10%, #fffdf9, transparent 70%),
    linear-gradient(160deg, #efe6d8, #e3d6c4 55%, #d9c9b4);
  background-attachment: fixed;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
button, input, textarea { font: inherit; color: inherit; }
a { color: inherit; }

::selection { background: var(--gold-pale); color: var(--ink); }

/* Telefon ramkasi — desktopda markazda turadi */
.frame {
  position: relative;
  width: 100%;
  max-width: var(--frame);
  margin-inline: auto;
  background: var(--paper);
  overflow: clip;
  box-shadow: 0 0 0 1px rgba(184, 144, 90, .16), 0 30px 90px -30px rgba(58, 47, 38, .55);
}

.section {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 100svh;
  padding: clamp(56px, 12svh, 92px) var(--pad) clamp(76px, 14svh, 104px);
  text-align: center;
  overflow: clip;
}

.section__body {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
}

.section__bg {
  position: absolute;
  inset: -10% 0;
  background-size: cover;
  background-position: center;
}
.section__bg::after {
  content: '';
  position: absolute;
  inset: 0;
}

/* ===== 3. TYPOGRAFIYA ==================================================== */

.script {
  font-family: var(--f-script);
  font-weight: 400;
  font-size: clamp(2.6rem, 11vw, 3.4rem);
  line-height: 1.05;
  color: var(--gold-deep);
}
.script--light {
  color: #fff;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .45);
}
.script--sm { font-size: clamp(2rem, 8vw, 2.5rem); }

.eyebrow {
  font-size: clamp(9px, 2.6vw, 11px);
  font-weight: 500;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.eyebrow--light { color: rgba(255, 255, 255, .9); text-shadow: 0 2px 10px rgba(0, 0, 0, .5); }
.eyebrow--gold  { color: var(--gold-pale); text-shadow: 0 2px 10px rgba(0, 0, 0, .5); }

.lede {
  max-width: 30ch;
  font-family: var(--f-serif);
  font-size: clamp(15px, 4.2vw, 17px);
  font-weight: 400;
  line-height: 1.75;
  color: var(--ink-2);
}
.lede--light { color: rgba(255, 255, 255, .94); text-shadow: 0 2px 14px rgba(0, 0, 0, .5); }

.bismillah {
  font-size: clamp(20px, 6vw, 26px);
  font-weight: 400;
  color: var(--gold-deep);
  opacity: .85;
}

/* Ismlar */
.names {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: var(--f-script);
  font-weight: 400;
  font-size: clamp(2.9rem, 13vw, 4rem);
  line-height: .92;
  color: var(--ink);
}
.names span {
  background: linear-gradient(100deg, var(--gold-deep), #c9a063 45%, var(--gold-deep));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.names__amp {
  margin: .06em 0;
  font-family: var(--f-serif);
  font-style: italic;
  font-size: .42em;
  color: var(--gold);
}

/* Bezakli ajratgich */
.rule {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(240px, 70%);
  color: var(--gold);
}
.rule span {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, currentColor 45%, currentColor 55%, transparent);
  opacity: .6;
}
.rule b { font-size: 11px; line-height: 1; opacity: .8; }
.rule--soft { width: min(180px, 60%); }

/* ===== 4. KOMPONENTLAR ================================================== */

.btn {
  --btn-bg: var(--gold-deep);
  --btn-fg: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 26px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), background .3s var(--ease);
  box-shadow: 0 8px 22px -10px rgba(138, 106, 60, .8);
}
.btn svg {
  width: 15px; height: 15px;
  fill: none; stroke: currentColor; stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 14px 28px -12px rgba(138, 106, 60, .9); }
.btn:active { transform: translateY(0); }

.btn--outline {
  background: transparent;
  border-color: var(--line);
  color: var(--gold-deep);
  box-shadow: none;
}
.btn--ghost {
  background: rgba(255, 255, 255, .12);
  border-color: rgba(255, 255, 255, .5);
  color: #fff;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: none;
}
.btn--ghost:hover { background: rgba(255, 255, 255, .22); }
.btn--sm { padding: 10px 20px; font-size: 10px; }
.btn--wide { width: 100%; }

/* Oq karta */
.card {
  width: 100%;
  padding: 26px 22px;
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: var(--radius-lg);
  background: rgba(255, 253, 250, .9);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  box-shadow: var(--sh-3);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.card__title {
  font-family: var(--f-serif);
  font-size: clamp(19px, 5.4vw, 23px);
  font-weight: 500;
  color: var(--ink);
}
.card__list {
  display: grid;
  gap: 12px;
  list-style: none;
  text-align: left;
  width: 100%;
}
.card__list li {
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: start;
  gap: 10px;
  font-family: var(--f-serif);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink-2);
}
.card__list svg {
  width: 18px; height: 18px; margin-top: 2px;
  fill: none; stroke: var(--gold); stroke-width: 1.4;
  stroke-linecap: round; stroke-linejoin: round;
}
.card__actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 4px; }

/* Pastga o'q */
.scroll-cue {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .28em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-3);
  animation: cue 2.4s var(--ease) infinite;
}
.scroll-cue svg {
  width: 18px; height: 18px;
  fill: none; stroke: currentColor; stroke-width: 1.3;
  stroke-linecap: round; stroke-linejoin: round;
}
.scroll-cue--light { color: rgba(255, 255, 255, .88); text-shadow: 0 2px 10px rgba(0, 0, 0, .5); }

@keyframes cue {
  0%, 100% { transform: translate(-50%, 0); opacity: .85; }
  50%      { transform: translate(-50%, 7px); opacity: 1; }
}

/* ===== 5. MUQOVA ======================================================== */

/* Mazmun ekran o'rtasida turadi (pastdagi o'q uchun ozgina joy qoldirib) */
.cover { justify-content: center; padding-bottom: clamp(84px, 15svh, 112px); }

.cover__art {
  position: absolute;
  inset: 0;
  /* Gorizontal siljish — tor ekranda kelin ham kadrga tushsin */
  background: url("../images/couple/couple2.jpg") 28% center / cover no-repeat;
  transform: scale(1.06);
  animation: kenburns 22s var(--ease) infinite alternate;
}
.cover__scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(30, 24, 19, .5) 0%, rgba(30, 24, 19, .16) 28%, rgba(30, 24, 19, .44) 52%, rgba(30, 24, 19, .66) 76%, rgba(30, 24, 19, .84) 100%),
    radial-gradient(120% 70% at 50% 100%, rgba(138, 106, 60, .35), transparent 70%);
}
.cover__body {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
/* ==========================
   KONVERT — bosilganda ochiladi
   Qatlamlar: back → card → front → flap → seal
   ========================== */

.envelope {
  position: relative;
  width: min(228px, 55vw);
  aspect-ratio: 3 / 2;
  margin-bottom: 10px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  perspective: 900px;
  transform-style: preserve-3d;
  animation: float 5s ease-in-out infinite;
  transition: transform .4s var(--ease);
}
.envelope:focus-visible { outline: 2px solid var(--gold-pale); outline-offset: 8px; border-radius: 12px; }
.envelope > * { position: absolute; }

/* Orqa qism */
.envelope__back {
  inset: 0;
  border-radius: 10px;
  background: linear-gradient(158deg, #f4e9d6, #e2cdaa 60%, #d8bf95);
  box-shadow: inset 0 0 0 1px rgba(138, 106, 60, .28), 0 20px 34px rgba(0, 0, 0, .45);
}

/* Ichidagi varaq — ochilganda yuqoriga suriladi */
.envelope__card {
  inset: 7% 8% 7%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 5px;
  background: linear-gradient(172deg, #fffdf8, #f7f0e4);
  box-shadow: 0 8px 18px rgba(58, 47, 38, .22);
  z-index: 1;
  transform: translateY(0);
  transition: transform 1.05s .5s var(--ease-out);
}
.envelope__mono {
  font-family: var(--f-script);
  font-size: clamp(20px, 5.6vw, 26px);
  line-height: 1;
  color: var(--gold-deep);
}
.envelope__rule {
  width: 44%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: .7;
}
.envelope__date {
  font-size: clamp(7px, 2vw, 9px);
  font-weight: 500;
  letter-spacing: .3em;
  color: var(--ink-3);
}

/* Old panel — yuqorisida "V" o'yig'i bor */
.envelope__front {
  inset: 0;
  z-index: 3;
  border-radius: 10px;
  background: linear-gradient(168deg, #f8efdd, #e9d5b2 70%, #dcc296);
  clip-path: polygon(0 0, 50% 52%, 100% 0, 100% 100%, 0 100%);
  filter: drop-shadow(0 -1px 0 rgba(138, 106, 60, .35));
}

/* Yuqori qopqoq — ochilganda orqaga ag'dariladi */
.envelope__flap {
  inset: 0;
  height: 57%;
  z-index: 4;
  border-radius: 10px 10px 0 0;
  background: linear-gradient(180deg, #f6ecda, #e6d0ab);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top center;
  transform: rotateX(0deg);
  transform-style: preserve-3d;
  transition: transform .85s var(--ease-out), z-index 0s .42s;
}

/* Muhr */
.envelope__seal {
  left: 50%;
  top: 50%;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 26%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #c9a063, #8a6a3c 62%, #6d5128);
  box-shadow: 0 3px 8px rgba(58, 47, 38, .5), inset 0 1px 2px rgba(255, 255, 255, .45);
  font-family: var(--f-script);
  font-size: clamp(11px, 3vw, 14px);
  color: #f6e6c4;
  transition: transform .4s var(--ease), opacity .35s var(--ease);
}
.envelope__seal::after {
  content: '';
  position: absolute;
  inset: -6px;
  border: 1px solid rgba(240, 220, 174, .65);
  border-radius: 50%;
  animation: pulse 2.4s var(--ease) infinite;
}

/* --- Ochilgan holat --- */
.envelope.is-open { cursor: default; animation: none; }
.envelope.is-open .envelope__seal {
  transform: translate(-50%, -50%) scale(.2) rotate(-35deg);
  opacity: 0;
}
.envelope.is-open .envelope__flap {
  z-index: 0;
  transform: rotateX(180deg);
}
.envelope.is-open .envelope__card { transform: translateY(-58%); }
.cover__title {
  max-width: 100%;
  font-family: var(--f-script);
  font-weight: 400;
  font-size: clamp(2.3rem, 11vw, 3.1rem);
  line-height: 1.12;
  color: #fff;
  text-wrap: balance;
  text-shadow: 0 4px 26px rgba(0, 0, 0, .55);
}

@keyframes kenburns {
  from { transform: scale(1.04) translate3d(0, 0, 0); }
  to   { transform: scale(1.16) translate3d(0, -1.5%, 0); }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-9px); }
}

/* ===== 6. TAKLIF ======================================================== */

.invite {
  justify-content: flex-start;
  gap: 0;
  padding-top: clamp(28px, 6svh, 48px);
  background:
    radial-gradient(90% 55% at 50% 0%, #fffdf9, transparent 60%),
    linear-gradient(180deg, var(--paper) 0%, var(--paper-2) 62%, var(--paper) 100%);
}
.invite .bismillah { margin-bottom: 14px; }

/* Rasm faqat yuqori qismi ko'rinadi — pastdagi bo'sh chiziqlar qog'ozga singib ketadi */
.invite__art {
  position: relative;
  align-self: stretch;
  width: auto;
  min-height: 0;
  margin-inline: calc(var(--pad) * -1);
  aspect-ratio: 3 / 4;
  overflow: clip;
}
.invite__art img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 28%;
  animation: kenburns 26s var(--ease) infinite alternate;
}
/* Suratning pastki qismini yumshoq qoraytiradi — sana / vaqt / manzil
   ustidagi matn o'qiladigan bo'lsin. Eng pastda yana shaffoflashadi,
   shunda qog'oz tusiga o'tish toza chiqadi. */
.invite__art-wash {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(40, 29, 20, 0) 26%,
    rgba(40, 29, 20, .34) 48%,
    rgba(40, 29, 20, .72) 66%,
    rgba(40, 29, 20, .74) 84%,
    rgba(40, 29, 20, 0) 99%
  );
}

.invite__art-fade {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(242, 233, 221, 0) 0%,
    rgba(242, 233, 221, 0) 84%,
    rgba(242, 233, 221, .5) 93%,
    var(--paper-2) 100%
  );
}

/* Surat ustidagi sana / vaqt / manzil qatori — pastdan biriktirilgan uch ustun,
   ular oralig'ida ingichka oltin chiziq. */
.artfacts {
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: 20%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  text-align: center;
}
.artfacts__row { display: block; padding-inline: 3px; }
.artfacts__row + .artfacts__row {
  border-left: 1px solid rgba(240, 220, 174, .3);
}
.artfacts dt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: clamp(6px, 1.7vw, 8px);
  font-weight: 500;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--gold-pale);
  opacity: .8;
}
.artfacts dt svg {
  width: clamp(16px, 4.8vw, 24px);
  height: clamp(20px, 6vw, 30px);
  fill: none; stroke: var(--gold-soft); stroke-width: 1.4;
  stroke-linecap: round; stroke-linejoin: round;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .45));
}
.artfacts dd {
  margin-top: 3px;
  font-family: var(--f-serif);
  font-size: clamp(11.5px, 3.1vw, 15px);
  font-weight: 500;
  line-height: 1.25;
  color: #fdf6ea;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .55);
}

.invite__card {
  position: relative;
  z-index: 2;
  margin-top: -52px;
  width: 100%;
  padding: 26px 20px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 13px;
}
.invite__card .lede { margin-top: 2px; }

/* ===== 7A. SANA ========================================================= */

.date__bg { background-image: url("../images/couple/couple3.jpg"); background-position: 30% center; }
.date__bg::after {
  background: linear-gradient(180deg, rgba(42, 32, 24, .64), rgba(42, 32, 24, .46) 40%, rgba(42, 32, 24, .8));
}
.date .section__body { gap: 16px; }

.cal {
  width: min(268px, 84%);
  padding: 16px 16px 14px;
  border: 1px solid rgba(255, 255, 255, .45);
  border-radius: var(--radius);
  background: rgba(255, 253, 250, .93);
  box-shadow: var(--sh-3);
}
.cal__month {
  margin-bottom: 10px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold-deep);
}
.cal__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}
.cal__dow {
  padding-bottom: 5px;
  font-size: 8px;
  font-weight: 500;
  letter-spacing: .06em;
  color: var(--ink-3);
}
.cal__day {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  font-size: 11px;
  color: var(--ink-2);
  border-radius: 50%;
}
.cal__day--empty { visibility: hidden; }
.cal__day--on {
  position: relative;
  color: #fff;
  font-weight: 600;
  background: linear-gradient(140deg, var(--gold), var(--gold-deep));
  box-shadow: 0 3px 10px -2px rgba(138, 106, 60, .8);
}
.cal__day--on::before {
  content: '';
  position: absolute;
  inset: -4px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  opacity: .5;
  animation: pulse 2.6s var(--ease) infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1);    opacity: .5; }
  50%      { transform: scale(1.18); opacity: 0; }
}

.count { display: flex; gap: 8px; }
.count__cell {
  flex: 1;
  min-width: 58px;
  padding: 11px 6px 9px;
  border: 1px solid rgba(240, 220, 174, .45);
  border-radius: 12px;
  background: rgba(255, 255, 255, .12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.count__cell b {
  display: block;
  font-family: var(--f-serif);
  font-size: clamp(22px, 7vw, 27px);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--gold-pale);
  text-shadow: 0 2px 12px rgba(0, 0, 0, .45);
  transition: transform .35s var(--ease-out);
}
.count__cell b.is-tick { transform: translateY(-3px) scale(1.04); }
.count__cell i {
  display: block;
  margin-top: 3px;
  font-size: 8px;
  font-style: normal;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .82);
}

/* ===== 7B. MANZIL ======================================================= */

/* Bir xil surat — ammo boshqa kesim, shunda ikki bo'lim takrorlanmaydi */
.place__bg { background-image: url("../images/couple/couple3.jpg"); background-position: 76% center; }
.place__bg::after {
  background: linear-gradient(180deg, rgba(42, 32, 24, .68), rgba(42, 32, 24, .5) 42%, rgba(42, 32, 24, .88));
}
.place .section__body { gap: 18px; }

.contacts { display: grid; gap: 8px; width: 100%; }
.contacts__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 18px;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  text-decoration: none;
  color: #fff;
  transition: background .3s var(--ease);
}
.contacts__item:hover { background: rgba(255, 255, 255, .22); }
.contacts__item span {
  font-size: 9px;
  letter-spacing: .18em;
  text-transform: uppercase;
  opacity: .8;
}
.contacts__item b {
  font-family: var(--f-serif);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: .02em;
}

/* ===== ERTAKDAGI QASRLAR (manzil bo'limi) =============================== */

.castle {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: min(42%, 270px);
  z-index: 1;
  pointer-events: none;
}
.castle__svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.castle__body { fill: #16110c; opacity: .9; }
.castle__gate { fill: #120d09; }

.castle__wins .castle__win {
  fill: #ffd58a;
  animation: winGlow 4s var(--ease) infinite alternate;
}
.castle__wins .castle__win:nth-child(3n)   { animation-duration: 5.5s; animation-delay: -1.2s; }
.castle__wins .castle__win:nth-child(3n+1) { animation-duration: 6.5s; animation-delay: -2.8s; }
@keyframes winGlow {
  from { opacity: .45; }
  to   { opacity: 1; }
}

.castle__stars circle {
  fill: #fff4d6;
  animation: twinkle 3.4s var(--ease) infinite alternate;
}
.castle__stars circle:nth-child(2n)   { animation-duration: 4.6s; animation-delay: -1.5s; }
.castle__stars circle:nth-child(3n)   { animation-duration: 5.8s; animation-delay: -3s; }
@keyframes twinkle {
  from { opacity: .18; }
  to   { opacity: .9; }
}

/* Qasr etagidagi tuman */
.castle__mist {
  position: absolute;
  left: -6%;
  right: -6%;
  bottom: -6%;
  height: 46%;
  background: linear-gradient(180deg, rgba(214, 190, 152, 0), rgba(214, 190, 152, .16) 55%, rgba(214, 190, 152, .26));
  filter: blur(14px);
  animation: mist 14s ease-in-out infinite alternate;
}
@keyframes mist {
  from { transform: translateX(-3%); opacity: .75; }
  to   { transform: translateX(3%);  opacity: 1; }
}

/* Kartani qasr ustida ushlab turish */
.place .section__body { z-index: 3; }

/* ===== 7C. TO'YONA ====================================================== */

.gift {
  background:
    radial-gradient(70% 45% at 50% 12%, #fffdf9, transparent 70%),
    linear-gradient(170deg, var(--paper-2), #e6d4bd 60%, var(--paper-3));
}
.gift .section__body { gap: 18px; }

.bankcard {
  position: relative;
  width: min(310px, 92%);
  aspect-ratio: 1.586;
  padding: 20px 22px;
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
  color: #5c4226;
  background:
    linear-gradient(135deg, #f6ecdb 0%, #e7d0a9 40%, #d8b878 70%, #eddfc4 100%);
  box-shadow: 0 20px 44px -18px rgba(92, 66, 38, .7), inset 0 1px 0 rgba(255, 255, 255, .6);
  transform: rotate(-1.4deg);
  transition: transform .5s var(--ease-out);
}
.bankcard:hover { transform: rotate(0deg) translateY(-4px); }
.bankcard__shine {
  position: absolute;
  inset: -40% -10%;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, .55) 48%, transparent 58%);
  animation: shine 5.5s var(--ease) infinite;
}
@keyframes shine {
  0%, 65%, 100% { transform: translateX(-70%); }
  85%           { transform: translateX(70%); }
}
.bankcard__top { display: flex; align-items: center; justify-content: space-between; }
.bankcard__chip {
  width: 34px; height: 26px;
  border-radius: 5px;
  background: linear-gradient(135deg, #e5c37e, #b8905a 55%, #f0dcae);
  box-shadow: inset 0 0 0 1px rgba(92, 66, 38, .28);
}
.bankcard__brand {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .3em;
  opacity: .65;
}
.bankcard__number {
  font-family: var(--f-serif);
  font-size: clamp(19px, 6vw, 23px);
  font-weight: 500;
  letter-spacing: .1em;
  font-variant-numeric: tabular-nums;
}
.bankcard__holder {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .22em;
  text-transform: uppercase;
  opacity: .75;
}

/* ===== 7D. RSVP ========================================================= */

.rsvp {
  background:
    radial-gradient(80% 50% at 50% 0%, #fffdf9, transparent 65%),
    linear-gradient(180deg, var(--paper), var(--paper-2));
}
.rsvp .section__body { gap: 16px; }

.rsvp__form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, .72);
  box-shadow: var(--sh-2);
  text-align: left;
}

.field { display: flex; flex-direction: column; gap: 7px; }
.field__label {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.field__label i { font-style: normal; opacity: .6; text-transform: none; letter-spacing: .08em; }
.field input[type="text"],
.field input[type="number"],
.field textarea {
  width: 100%;
  padding: 11px 2px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  font-family: var(--f-serif);
  font-size: 16px;
  color: var(--ink);
  outline: none;
  resize: none;
  transition: border-color .3s var(--ease);
}
.field input::placeholder,
.field textarea::placeholder { color: var(--ink-3); opacity: .55; }
.field input:focus, .field textarea:focus { border-bottom-color: var(--gold); }
.field--inline input { max-width: 90px; text-align: center; }
.field__error { font-size: 11px; font-style: normal; color: #b3543f; }

.choice { border: 0; display: flex; flex-direction: column; gap: 9px; }
.choice legend { margin-bottom: 2px; }
.choice__opt {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--f-serif);
  font-size: 15px;
  color: var(--ink-2);
  transition: border-color .3s var(--ease), background .3s var(--ease), color .3s var(--ease);
}
.choice__opt input { position: absolute; opacity: 0; pointer-events: none; }
.choice__opt::before {
  content: '';
  width: 15px; height: 15px;
  flex: none;
  border: 1px solid var(--gold);
  border-radius: 50%;
  transition: box-shadow .25s var(--ease), background .25s var(--ease);
}
.choice__opt:has(input:checked) {
  border-color: var(--gold);
  background: rgba(216, 184, 120, .16);
  color: var(--ink);
}
.choice__opt:has(input:checked)::before {
  background: var(--gold-deep);
  box-shadow: inset 0 0 0 2.5px #fff;
}
.choice__opt:has(input:focus-visible) { outline: 2px solid var(--gold); outline-offset: 2px; }

/* Javob yuborilgach */
.rsvp__done {
  display: none;
  align-items: center;
  gap: 9px;
  padding: 13px 16px;
  border-radius: 14px;
  background: rgba(216, 184, 120, .2);
  font-family: var(--f-serif);
  font-size: 15px;
  color: var(--gold-deep);
}
.rsvp__done svg {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.rsvp__form.is-done .field,
.rsvp__form.is-done .choice,
.rsvp__form.is-done button { display: none; }
.rsvp__form.is-done .rsvp__done { display: flex; }

/* "Necha kishi" — faqat "boraman" tanlanganda */
.rsvp__form[data-status="cant_come"] [data-when="will_come"] { display: none; }

/* ===== 7E. YAKUN ======================================================== */

.outro {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 54px var(--pad) 96px;
  text-align: center;
  background: linear-gradient(180deg, var(--paper-2), var(--paper-3));
  border-top: 1px solid var(--line);
}
.outro__names {
  font-family: var(--f-serif);
  font-size: 19px;
  font-weight: 500;
  letter-spacing: .1em;
  color: var(--ink);
}
.outro__date {
  margin-bottom: 8px;
  font-size: 10px;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ===== 8. INTERFEYS ===================================================== */

/* Skroll indikatori */
.frame__progress {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  width: min(100%, var(--frame));
  height: 2px;
  background: rgba(184, 144, 90, .14);
}
.frame__progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--gold-soft), var(--gold-deep));
}

/* Nuqtali navigatsiya */
.dots {
  position: fixed;
  right: var(--gutter);
  top: 50%;
  transform: translateY(-50%);
  z-index: 55;
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.dots a {
  position: relative;
  display: block;
  padding: 3px;
  text-decoration: none;
}
.dots a span {
  display: block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(58, 47, 38, .3);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .35);
  transition: all .35s var(--ease);
}
.dots a i {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translate(6px, -50%);
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(58, 47, 38, .82);
  color: #fff;
  font-size: 8px;
  font-style: normal;
  letter-spacing: .12em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all .3s var(--ease);
}
.dots a:hover i { opacity: 1; transform: translate(0, -50%); }
.dots a.is-active span {
  height: 18px;
  border-radius: 4px;
  background: var(--gold-deep);
}
.dots.on-dark a span { background: rgba(255, 255, 255, .45); }
.dots.on-dark a.is-active span { background: var(--gold-pale); }

/* Suzuvchi tugmalar */
.fab {
  position: fixed;
  right: var(--gutter);
  bottom: 18px;
  z-index: 55;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.fab__btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border: 1px solid rgba(184, 144, 90, .3);
  border-radius: 50%;
  background: rgba(255, 253, 250, .88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--sh-2);
  color: var(--gold-deep);
  cursor: pointer;
  text-decoration: none;
  transition: transform .3s var(--ease), opacity .3s var(--ease);
}
.fab__btn:hover { transform: scale(1.07); }
.fab__btn svg {
  width: 19px; height: 19px;
  fill: none; stroke: currentColor; stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round;
}
.fab__btn--sm { width: 38px; height: 38px; opacity: 0; pointer-events: none; }
.fab__btn--sm.is-on { opacity: 1; pointer-events: auto; }

/* Musiqa: play ikonkasi ↔ to'lqin */
.fab__wave { display: none; gap: 2.5px; align-items: flex-end; height: 16px; }
.fab__wave i {
  width: 2.5px;
  background: currentColor;
  border-radius: 2px;
  animation: wave .9s ease-in-out infinite;
}
.fab__wave i:nth-child(1) { height: 55%; animation-delay: -.2s; }
.fab__wave i:nth-child(2) { height: 100%; }
.fab__wave i:nth-child(3) { height: 70%; animation-delay: -.45s; }
@keyframes wave {
  0%, 100% { transform: scaleY(.45); }
  50%      { transform: scaleY(1); }
}
#musicBtn[aria-pressed="true"] .fab__ico--play { display: none; }
#musicBtn[aria-pressed="true"] .fab__wave { display: flex; }
#musicBtn.is-hint::after {
  content: '';
  position: absolute;
  inset: -5px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  animation: pulse 2.2s var(--ease) infinite;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 90;
  max-width: min(88vw, 340px);
  padding: 13px 20px;
  border-radius: 999px;
  background: rgba(58, 47, 38, .94);
  color: #fff;
  font-size: 12px;
  letter-spacing: .04em;
  text-align: center;
  box-shadow: var(--sh-3);
  opacity: 0;
  transform: translate(-50%, 16px);
  pointer-events: none;
  transition: opacity .4s var(--ease), transform .4s var(--ease-out);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* Gul barglari va oltin zarralar */
.fx-layer {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, var(--frame));
  height: 100dvh;
  z-index: 40;
  pointer-events: none;
  overflow: hidden;
}
.petal {
  position: absolute;
  top: -8%;
  will-change: transform, opacity;
  animation: fall linear forwards;
}
@keyframes fall {
  0%   { transform: translate3d(0, 0, 0) rotate(0deg); opacity: 0; }
  8%   { opacity: 1; }
  80%  { opacity: .8; }
  100% { transform: translate3d(var(--drift, 20px), 118dvh, 0) rotate(var(--spin, 540deg)); opacity: 0; }
}
#dust {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, var(--frame));
  height: 100dvh;
  z-index: 39;
  pointer-events: none;
}

/* ===== KIRISH: BAXT ESHIKLARI ===========================================
   Oq bulutlar orasida turgan chambarak (dumaloq) eshik.
   Ochilganda kelin-kuyov qadam tashlab nur tomon yuradi.
   ======================================================================== */

.gate {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 3.4svh, 30px);
  padding: 5svh 18px;
  overflow: hidden;
  touch-action: none;
  overscroll-behavior: contain;
  background: linear-gradient(180deg, #a3c0dd 0%, #bed4e8 24%, #d9e3ea 52%, #eee7db 78%, #ead9c0 100%);
}
.gate.is-gone { animation: gateGone 1.1s var(--ease) forwards; pointer-events: none; }
@keyframes gateGone { to { opacity: 0; visibility: hidden; } }

html.is-locked,
body.is-locked {
  overflow: hidden;
  height: 100%;
  overscroll-behavior: none;
  touch-action: none;
}

/* ---- Bulutlar ---- */

.cloud {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(closest-side, #ffffff, rgba(255, 255, 255, .88) 46%, rgba(255, 255, 255, .35) 72%, rgba(255, 255, 255, 0));
  filter: blur(4px);
  animation: drift linear infinite alternate;
}
@keyframes drift {
  from { transform: translateX(-9%); }
  to   { transform: translateX(9%); }
}

/* Orqa qatlam */
.gate__sky {
  position: absolute;
  inset: -8%;
  z-index: 1;
}
.gate.is-open .gate__sky { animation: skyOut 3s var(--ease-out) forwards; }
@keyframes skyOut { to { transform: scale(1.18); opacity: .5; } }

.cloud--1 { left: -20%; top: 6%;  width: 66%; height: 22%; animation-duration: 46s; }
.cloud--2 { left: 44%;  top: 14%; width: 74%; height: 24%; animation-duration: 62s; animation-delay: -20s; }
.cloud--3 { left: -18%; top: 40%; width: 58%; height: 20%; animation-duration: 54s; animation-delay: -32s; opacity: .8; }
.cloud--4 { left: 56%;  top: 52%; width: 68%; height: 22%; animation-duration: 70s; animation-delay: -10s; opacity: .72; }
.cloud--5 { left: 10%;  top: 74%; width: 84%; height: 26%; animation-duration: 58s; animation-delay: -44s; }

/* Old qatlam — eshik oldidan o'tadi */
.gate__fog {
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: -8%;
  height: 54%;
  z-index: 4;
  pointer-events: none;
}
.gate.is-open .gate__fog { animation: fogOut 3s var(--ease-out) forwards; }
@keyframes fogOut { to { transform: translateY(18%) scale(1.2); opacity: .55; } }

.cloud--f1 { left: -16%; bottom: 12%; width: 78%; height: 48%; animation-duration: 38s; filter: blur(8px); }
.cloud--f2 { left: 42%;  bottom: 2%;  width: 84%; height: 54%; animation-duration: 50s; animation-delay: -18s; filter: blur(10px); }
.cloud--f3 { left: 2%;   bottom: -16%; width: 104%; height: 52%; animation-duration: 64s; animation-delay: -30s; filter: blur(12px); }

/* ---- Sarlavha ---- */

.gate__head {
  position: relative;
  z-index: 5;
  text-align: center;
  animation: rise 1.4s .2s var(--ease-out) both;
}
.gate__mono {
  font-family: var(--f-script);
  font-size: clamp(19px, 5.2vw, 25px);
  color: var(--gold);
  opacity: .8;
}
.gate__title {
  margin-top: 2px;
  font-family: var(--f-script);
  font-weight: 400;
  font-size: clamp(1.9rem, 9vw, 2.7rem);
  line-height: 1.1;
  color: var(--gold-deep);
  text-shadow: 0 2px 22px rgba(255, 255, 255, .95);
}
.gate.is-open .gate__head { animation: headOut .9s var(--ease) forwards; }
@keyframes headOut { to { opacity: 0; transform: translateY(-16px); } }

/* ---- Chambarak eshik ---- */

.gate__stage {
  position: relative;
  z-index: 3;
  width: min(76vw, 340px, 44svh);
  aspect-ratio: 1;
  perspective: 1400px;
  cursor: pointer;
  animation: rise 1.4s .35s var(--ease-out) both;
}
.gate.is-open .gate__stage { animation: stageZoom 3s var(--ease-out) forwards; }
@keyframes stageZoom { to { transform: scale(1.16); } }

/* Tashqi oltin gardish */
.gate__stage::before {
  content: '';
  position: absolute;
  inset: -6.5%;
  border-radius: 50%;
  border: 1px solid rgba(184, 144, 90, .55);
  box-shadow:
    0 0 0 7px rgba(255, 255, 255, .7),
    0 0 0 8px rgba(184, 144, 90, .3),
    0 26px 60px rgba(120, 100, 78, .3);
}

/* Eshik ortidagi olam — doira ichida */
.gate__opening {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 50%;
  background: linear-gradient(180deg, #fdf9f2, #f5ecdc 62%, #e9dcc4);
}
.gate__light {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 40%, #ffffff 0%, #fff9ea 24%, rgba(255, 238, 205, .55) 50%, rgba(255, 226, 180, 0) 76%);
  opacity: .5;
}
.gate.is-open .gate__light { animation: lightUp 2.6s .4s var(--ease) forwards; }
@keyframes lightUp { to { opacity: 1; } }

/* Ostona — yurish uchun yer */
.gate__floor {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 6%;
  height: 16%;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 40%, rgba(196, 168, 126, .34), rgba(196, 168, 126, 0) 72%);
  filter: blur(4px);
}

/* ---- Kelin-kuyov ---- */

.gate__couple {
  position: absolute;
  left: 47%;
  bottom: 7%;
  width: 76%;
  opacity: 0;
  transform: translateX(-50%);
  perspective: 1000px;
}
.gate__couple-stage {
  position: relative;
  perspective: 900px;
}
.gate__couple-stage img {
  display: block;
  width: 100%;
  height: auto;
}
/* Kelin oqimda turadi — balandlikni u beradi */
.cpl-bride {
  position: relative;
  transform-origin: 73% 58%;
  transform-style: preserve-3d;
  filter: drop-shadow(0 12px 16px rgba(120, 96, 62, .22));
}
/* Kuyov ustida — kelinni qo'lidan ushlab turadi */
.cpl-groom {
  position: absolute;
  inset: 0;
  transform-origin: 88% 100%;
  filter: drop-shadow(0 12px 16px rgba(120, 96, 62, .22));
}

/* Oyoqlari ostidagi oq bulutlar */
.cloudlet {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(closest-side, #ffffff, rgba(255, 255, 255, .82) 50%, rgba(255, 255, 255, 0));
  filter: blur(5px);
  animation: floatCloud linear infinite alternate;
}
.cloudlet--1 { left: -12%; bottom: -3%; width: 58%; height: 15%; animation-duration: 9s; }
.cloudlet--2 { left: 34%;  bottom: -6%; width: 66%; height: 18%; animation-duration: 13s; animation-delay: -5s; }
.cloudlet--3 { left: 6%;   bottom: 3%;  width: 80%; height: 12%; animation-duration: 17s; animation-delay: -9s; opacity: .75; }
@keyframes floatCloud {
  from { transform: translateX(-7%); }
  to   { transform: translateX(7%); }
}

/* Paydo bo'lish → aylanish → nur tomon ketish */
.gate.is-open .gate__couple { animation: coupleLife 4.2s 1s var(--ease) forwards; }
@keyframes coupleLife {
  0%   { opacity: 0; transform: translate(-50%, 9%)  scale(1); }
  12%  { opacity: 1; transform: translate(-50%, 0)   scale(1); }
  60%  { opacity: 1; transform: translate(-50%, 0)   scale(1); }
  100% { opacity: 0; transform: translate(-50%, -21%) scale(.4); }
}

/* Kuyov qo'lidan ushlab, kelinni bir marta aylantiradi */
.gate.is-open .cpl-bride { animation: brideTwirl 1.7s 1.8s ease-in-out forwards; }
@keyframes brideTwirl {
  0%   { transform: rotateY(0deg)   translateY(0)     scale(1); }
  16%  { transform: rotateY(75deg)  translateY(-2%)   scale(1.02); }
  50%  { transform: rotateY(205deg) translateY(-3.5%) scale(1.05); }
  84%  { transform: rotateY(330deg) translateY(-1.5%) scale(1.02); }
  100% { transform: rotateY(360deg) translateY(0)     scale(1); }
}

/* Kuyov yetaklaydi — yengil egilib, ko'tarilib qo'yadi */
.gate.is-open .cpl-groom { animation: groomLead 1.7s 1.8s ease-in-out; }
@keyframes groomLead {
  0%, 100% { transform: rotate(0deg)    translateY(0); }
  28%      { transform: rotate(-1.8deg) translateY(-1.2%); }
  62%      { transform: rotate(1.2deg)  translateY(-.6%); }
}


/* ---- Tavaqalar: yarim doira ---- */

.gate__leaf {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  z-index: 2;
  background:
    repeating-linear-gradient(90deg, rgba(160, 140, 115, .045) 0 2px, transparent 2px 8px),
    linear-gradient(102deg, #ffffff 0%, #fcf8f1 42%, #ece1cf 100%);
  box-shadow:
    inset 0 0 0 1px rgba(184, 144, 90, .32),
    inset 0 0 50px rgba(184, 144, 90, .14),
    0 20px 44px rgba(120, 100, 78, .28);
  backface-visibility: hidden;
}
.gate__leaf--l {
  left: 0;
  transform-origin: left center;
  border-radius: 100% 0 0 100% / 50% 0 0 50%;
  background-image:
    linear-gradient(90deg, transparent 72%, rgba(150, 124, 92, .26) 96%, rgba(255, 252, 242, .95) 100%),
    repeating-linear-gradient(90deg, rgba(160, 140, 115, .045) 0 2px, transparent 2px 8px),
    linear-gradient(102deg, #ffffff 0%, #fcf8f1 42%, #ece1cf 100%);
}
.gate__leaf--r {
  right: 0;
  transform-origin: right center;
  border-radius: 0 100% 100% 0 / 0 50% 50% 0;
  background-image:
    linear-gradient(270deg, transparent 72%, rgba(150, 124, 92, .26) 96%, rgba(255, 252, 242, .95) 100%),
    repeating-linear-gradient(90deg, rgba(160, 140, 115, .045) 0 2px, transparent 2px 8px),
    linear-gradient(258deg, #ffffff 0%, #fcf8f1 42%, #ece1cf 100%);
}
.gate.is-open .gate__leaf--l { animation: leafOpenL 2.8s cubic-bezier(.62, 0, .18, 1) forwards; }
.gate.is-open .gate__leaf--r { animation: leafOpenR 2.8s cubic-bezier(.62, 0, .18, 1) forwards; }
@keyframes leafOpenL { to { transform: rotateY(-116deg); } }
@keyframes leafOpenR { to { transform: rotateY(116deg); } }
@keyframes leafFade  { to { opacity: 0; } }

/* Ichki yoy chizig'i */
.gate__panel {
  position: absolute;
  inset: 9%;
  border: 1px solid rgba(184, 144, 90, .38);
}
.gate__leaf--l .gate__panel { border-radius: 100% 0 0 100% / 50% 0 0 50%; border-right: 0; }
.gate__leaf--r .gate__panel { border-radius: 0 100% 100% 0 / 0 50% 50% 0; border-left: 0; }

/* O'yma naqsh */
.gate__motif {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 42%;
  transform: translate(-50%, -50%);
  fill: none;
  stroke: rgba(184, 144, 90, .58);
  stroke-width: 2;
  stroke-linecap: round;
}
.gate__leaf--l .gate__motif { left: 46%; }
.gate__leaf--r .gate__motif { left: 54%; }

/* Halqa tutqich */
.gate__ring {
  position: absolute;
  top: 50%;
  margin-top: -11px;
  width: 22px;
  height: 22px;
  border: 2.5px solid rgba(184, 144, 90, .68);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(120, 100, 78, .35), inset 0 1px 1px rgba(255, 255, 255, .8);
}
.gate__leaf--l .gate__ring { right: 8%; }
.gate__leaf--r .gate__ring { left: 8%; }

/* Yoriqdan sizayotgan nur */
.gate__seam {
  position: absolute;
  left: 50%;
  top: 4%;
  bottom: 4%;
  z-index: 3;
  width: 3px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, transparent, #fffdf4 16%, #ffffff 50%, #fffdf4 84%, transparent);
  box-shadow: 0 0 24px 6px rgba(255, 248, 220, .95), 0 0 56px 18px rgba(255, 234, 186, .5);
  animation: seam 3.4s var(--ease) infinite;
}
.gate.is-open .gate__seam { animation: fadeAway .8s var(--ease) forwards; }
@keyframes fadeAway { to { opacity: 0; } }
@keyframes seam {
  0%, 100% { opacity: .5; }
  50%      { opacity: 1; }
}

/* ---- Pastki qism ---- */

.gate__foot {
  position: relative;
  z-index: 5;
  display: grid;
  place-items: center;
  min-height: 46px;
  animation: rise 1.4s .5s var(--ease-out) both;
}
.gate.is-open .gate__foot { animation: fadeAway .7s var(--ease) forwards; }
.gate__foot > * { grid-area: 1 / 1; }

.gate__bar {
  width: 150px; height: 2px;
  border-radius: 99px;
  background: rgba(184, 144, 90, .2);
  overflow: hidden;
  opacity: 0;
  transition: opacity .4s var(--ease);
}
.gate__bar span {
  display: block;
  width: 40%; height: 100%;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  animation: barSlide 1.4s var(--ease) infinite;
}
@keyframes barSlide {
  from { transform: translateX(-120%); }
  to   { transform: translateX(320%); }
}

.gate__btn {
  padding: 14px 32px;
  border: 1px solid rgba(184, 144, 90, .5);
  border-radius: 999px;
  background: rgba(255, 255, 255, .8);
  color: var(--gold-deep);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 10px 26px -12px rgba(120, 100, 78, .7);
  transition: opacity .5s var(--ease), background .3s var(--ease), transform .3s var(--ease);
}
.gate__btn:hover { background: #fff; transform: translateY(-2px); }

.gate.is-loading .gate__btn { opacity: 0; pointer-events: none; }
.gate.is-loading .gate__bar { opacity: 1; }
.gate:not(.is-loading) .gate__bar { display: none; }

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}

/* ===== SKROLL ANIMATSIYALARI ============================================ */

[data-reveal] {
  opacity: 0;
  transform: translateY(32px) scale(.985);
  filter: blur(7px);
  transition:
    opacity 1.15s var(--ease-out),
    transform 1.25s var(--ease-out),
    filter 1s var(--ease-out);
  transition-delay: calc(var(--d, 0) * 130ms);
}
[data-reveal].is-in {
  opacity: 1;
  transform: none;
  filter: blur(0);
}

/* Fon rasmlari skrollda sekinroq siljiydi */
.section__bg {
  will-change: transform;
  transition: transform .15s linear;
}

[data-reveal-delay="1"] { --d: 1; }
[data-reveal-delay="2"] { --d: 2; }
[data-reveal-delay="3"] { --d: 3; }
[data-reveal-delay="4"] { --d: 4; }
[data-reveal-delay="5"] { --d: 5; }

/* ===== MOSLASHUVCHANLIK ================================================= */

@media (min-width: 700px) {
  .frame { min-height: 100dvh; }
  .dots a i { font-size: 9px; }
}

@media (max-height: 680px) {
  .section { min-height: auto; padding-block: 64px 86px; }
  .invite__card { margin-top: -44px; }
  .names { font-size: clamp(2.5rem, 11vw, 3.2rem); }
}

/* Foydalanuvchi "harakatni kamaytirish"ni yoqqan bo'lsa: takrorlanuvchi va
   katta harakatlar to'xtaydi, ammo hikoya yo'qolmaydi — o'rniga yumshoq
   erish (fade) qoladi. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  /* Uzluksiz takrorlanuvchi bezaklar */
  .cover__art, .invite__art img, .cloud, .gate__seam, .gate__couple-bob,
  .cpl__leg, .cpl__arm--swing, .cpl__gown, .cpl__veil,
  .castle__wins .castle__win, .castle__stars circle, .castle__mist,
  .cloudlet, .gate.is-open .cpl-bride, .gate.is-open .cpl-groom,
  .cal__day--on::before, .bankcard__shine, .scroll-cue,
  .envelope, .fab__wave i, .loader__bar span,
  #musicBtn.is-hint::after {
    animation: none !important;
  }
  .fx-layer, #dust { display: none; }

  /* Bo'limlar siljimasdan, faqat oqarib chiqadi */
  [data-reveal] {
    transform: none !important;
    filter: none !important;
    transition: opacity .7s var(--ease);
  }

  /* Eshik burilmaydi — sekin erib yo'qoladi */
  .gate.is-open .gate__leaf--l,
  .gate.is-open .gate__leaf--r { animation: leafFade 1.3s var(--ease) forwards !important; }
  .gate.is-open .gate__stage,
  .gate.is-open .gate__sky,
  .gate.is-open .gate__fog { animation: none !important; }
  .gate.is-open .gate__couple { animation: coupleFade 1.4s .5s var(--ease) forwards !important; }
}

@media print {
  .gate, .dots, .fab, .fx-layer, #dust, .scroll-cue, .frame__progress { display: none !important; }
  .section { min-height: auto; page-break-inside: avoid; }
}

@keyframes coupleFade { to { opacity: 1; } }
