:root {
  --parchment: #f6ead9;
  --parchment-deep: #eadbc5;
  --paper: #fbf4ea;
  --cream: #fff9f0;
  --ink: #4b3427;
  --ink-soft: #7d6552;
  --bronze: #5c3f27;
  --gold: #b8905a;
  --gold-deep: #9a7240;
  --gold-light: #e6cc9a;
  --blush: #e2a3a8;
  --rose: #cf8a92;
  --sky: #aec8de;
  --sky-light: #dcebf4;
  --sage: #93a98f;
  --line: rgba(184, 144, 90, .38);
  --accent: var(--gold);
  --accent-ink: #fffaf0;
  --card: #fdf6ec;
  --font-display: "Aref Ruqaa", serif;
  --font-serif: "Amiri", serif;
  --font-body: "Tajawal", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { background: #e9d8c2; scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% 0, rgba(255, 246, 230, .75), transparent 34rem),
    #e9d8c2;
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}
body.locked { overflow: hidden; }
button, a, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

/* ============================================================
   الغبار السحري والبتلات (مشتركة)
   ============================================================ */
.magic-dust { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.magic-dust i {
  position: absolute;
  width: var(--s, 3px);
  height: var(--s, 3px);
  border-radius: 50%;
  background: #fff8e1;
  box-shadow: 0 0 6px #f7e2b2, 0 0 14px rgba(247, 226, 178, .6);
  animation: twinkle var(--t, 3.4s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}
.petals { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.petals i {
  position: absolute;
  top: -4%;
  left: var(--x, 50%);
  width: var(--w, 10px);
  height: calc(var(--w, 10px) * .66);
  border-radius: 70% 30% 70% 30%;
  background: linear-gradient(135deg, #f8d3d5, #e8a4ab);
  opacity: .82;
  animation: petalFall var(--t, 12s) linear infinite;
  animation-delay: var(--delay, 0s);
}

/* ============================================================
   بوابة الدخول: كتاب الحكاية
   ============================================================ */
.gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  overflow: hidden;
  background: #efe1cf url("assets/entrance-poster.jpg") center/cover no-repeat;
  color: var(--cream);
  isolation: isolate;
  transition: opacity 1.5s ease;
}
.gate.is-ending { opacity: 0; }
.gate.is-finished { visibility: hidden; pointer-events: none; transition: none; }
.gate__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  opacity: 0;
  pointer-events: none;
  transition: opacity .45s ease;
}
.gate.is-playing .gate__video { opacity: 1; }
.gate__shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(circle at 53% 50%, rgba(255, 240, 205, .2), transparent 34%),
    linear-gradient(180deg, rgba(70, 45, 25, .42), rgba(70, 45, 25, .03) 32%, rgba(70, 45, 25, .02) 64%, rgba(70, 45, 25, .52)),
    radial-gradient(circle at 53% 48%, transparent 30%, rgba(60, 40, 22, .14) 100%);
  transition: opacity .9s ease;
  pointer-events: none;
}
.gate.is-playing .gate__shade { opacity: 0; }
/* شعاع ضوء بطيء يمرّ على الرخام والكتاب قبل الفتح */
.gate__light {
  position: absolute;
  inset: -30% -60%;
  z-index: 2;
  background: linear-gradient(112deg, transparent 42%, rgba(255, 244, 214, .3) 50%, transparent 58%);
  mix-blend-mode: soft-light;
  animation: lightSweep 8s ease-in-out infinite alternate;
  transition: opacity .5s ease;
  pointer-events: none;
}
.gate__dust { z-index: 2; transition: opacity .6s ease; }
.gate__dust i { animation-name: dustRise; }
.gate__petals { z-index: 2; transition: opacity .5s ease; }
.gate.is-playing .gate__light,
.gate.is-playing .gate__petals,
.gate.is-playing .gate__dust { opacity: 0; }
.gate.is-ending .gate__dust { opacity: 1; }
.gate__ui {
  position: relative;
  z-index: 3;
  display: flex;
  min-height: 100svh;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: max(2rem, env(safe-area-inset-top)) 1.2rem max(1.7rem, calc(env(safe-area-inset-bottom) + 1rem));
  text-align: center;
  transition: opacity .5s ease;
}
.gate.is-playing .gate__ui { opacity: 0; pointer-events: none; }
.gate__top { width: min(92vw, 460px); text-shadow: 0 2px 16px rgba(70, 45, 25, .85), 0 0 3px rgba(70, 45, 25, .55); }
.gate__bismillah {
  margin: 0;
  color: #fff8ea;
  font-family: var(--font-serif);
  font-size: clamp(1rem, 4.2vw, 1.32rem);
  letter-spacing: .02em;
}
.gate__kicker {
  display: inline-block;
  margin: .55rem 0 0;
  padding: .3rem .95rem;
  border: 1px solid rgba(255, 236, 196, .5);
  border-radius: 999px;
  background: rgba(60, 40, 20, .28);
  color: #fff1d6;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-shadow: none;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
/* الأسماء مذهّبة تلمع كحبر الغلاف — فوق الحديقة لا فوق الكتاب */
.gate__names {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0 .55rem;
  margin: .45rem 0 0;
  color: #f4dfae;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 8.2vw, 2.8rem);
  font-weight: 700;
  line-height: 1.3;
  text-shadow: none;
  background: linear-gradient(100deg, #f7e7c3 0%, #d9b46e 28%, #fff6dc 50%, #d2aa62 72%, #f7e7c3 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 3px rgba(60, 40, 20, .75)) drop-shadow(0 6px 18px rgba(60, 40, 20, .45));
  animation: shimmer 6s linear infinite;
}
.gate__name { display: inline-block; max-width: 92vw; }
.gate__amp { font-family: var(--font-serif); font-size: .72em; font-style: italic; font-weight: 400; }
.gate__flourish { display: block; width: min(240px, 64vw); height: auto; margin: .1rem auto 0; overflow: visible; filter: drop-shadow(0 1px 4px rgba(60, 40, 20, .6)); }
.gate__flourish path { fill: none; stroke: #f0d9a4; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 470; stroke-dashoffset: 470; animation: draw 1.7s ease .9s forwards; }
.gate__chapter { margin: .2rem 0 0; color: #fff3dc; font-family: var(--font-serif); font-size: .95rem; letter-spacing: .02em; }
.gate__date { margin: .2rem 0 0; color: #ffe9c1; font-size: .72rem; font-weight: 700; letter-spacing: .04em; }
.gate__action { width: min(86vw, 350px); }
.gate__button {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 60px;
  align-items: center;
  gap: .75rem;
  padding: .5rem 1rem .5rem .75rem;
  overflow: hidden;
  border: 1px solid rgba(255, 236, 196, .7);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(190, 150, 96, .9), rgba(138, 100, 52, .92));
  box-shadow: 0 14px 34px rgba(60, 40, 20, .32), inset 0 1px rgba(255, 255, 255, .35);
  color: #fffaf0;
  cursor: pointer;
  text-align: right;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform .2s ease, filter .2s ease, opacity .2s ease;
}
.gate__button::after {
  content: "";
  position: absolute;
  top: -50%;
  bottom: -50%;
  left: -28%;
  width: 18%;
  background: rgba(255, 255, 255, .36);
  transform: rotate(17deg);
  animation: buttonShine 4s ease-in-out infinite;
  pointer-events: none;
}
.gate__button-icon {
  display: grid;
  flex: none;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 248, 232, .94);
  color: #9a7240;
  box-shadow: inset 0 0 0 1px rgba(184, 144, 90, .55), 0 4px 12px rgba(60, 40, 20, .25);
}
.gate__button-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.gate__button-text { flex: 1; min-width: 0; }
.gate__button-text span { display: block; font-size: .98rem; font-weight: 700; }
.gate__button-text small { display: block; margin-top: .1rem; color: rgba(255, 250, 240, .76); font-size: .66rem; }
.gate__button > i { flex: none; font-size: 1.25rem; font-style: normal; }
.gate__button:disabled { opacity: .68; cursor: wait; filter: saturate(.7); }
.gate__button:not(:disabled):active { transform: scale(.975); }
/* هالة نبض خفيفة تدعو إلى اللمس بعد الجاهزية */
.gate__action::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 60px;
  border-radius: 999px;
  box-shadow: 0 0 0 0 rgba(255, 228, 170, .55);
  pointer-events: none;
}
.gate__action { position: relative; }
.gate.is-ready .gate__action::before { animation: buttonPulse 2.4s ease-out infinite; }
.gate__progress {
  width: 60%;
  height: 1px;
  margin: .6rem auto 0;
  overflow: hidden;
  background: rgba(255, 244, 220, .28);
}
.gate__progress span { display: block; width: 8%; height: 100%; background: var(--gold-light); transition: width .35s ease; }
.gate__flash {
  position: absolute;
  inset: 0;
  z-index: 6;
  background: radial-gradient(circle at 53% 50%, #fffbef 0, #f7e6c6 22%, rgba(230, 204, 154, .75) 44%, transparent 70%);
  opacity: 0;
  pointer-events: none;
}
.gate.is-ending .gate__flash { animation: gateFlash 1.35s ease both; }
/* دخول متدرّج لعناصر البوابة (يُعطَّل مع تقليل الحركة فتظهر مباشرة) */
@media (prefers-reduced-motion: no-preference) {
  .gate-in { opacity: 0; transform: translateY(10px); animation: gateIn .9s ease forwards; }
  .gate__top .gate-in:nth-child(1) { animation-delay: .15s; }
  .gate__top .gate-in:nth-child(2) { animation-delay: .3s; }
  .gate__names.gate-in { animation: gateIn .9s ease .45s forwards, shimmer 6s linear infinite; }
  .gate__top .gate-in:nth-child(4) { animation-delay: .6s; }
  .gate__top .gate-in:nth-child(5) { animation-delay: .8s; }
  .gate__top .gate-in:nth-child(6) { animation-delay: .95s; }
  .gate__action.gate-in { animation-delay: 1.15s; }
}

/* ============================================================
   جسم الدعوة: صفحات الكتاب
   ============================================================ */
.invite {
  position: relative;
  width: min(100%, 660px);
  min-height: 100svh;
  margin: 0 auto;
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  background: linear-gradient(180deg, #f9f0e3, #f2e4d1);
  box-shadow: 0 0 70px rgba(80, 55, 30, .28);
  transition: opacity .35s ease;
}
.invite.visible { visibility: visible; opacity: 1; }
.invite::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
  opacity: .1;
  pointer-events: none;
}
.invite > * { position: relative; z-index: 1; }

/* الواجهة الرئيسية — اللوحة نفسها التي غاصت فيها الكاميرا */
.hero {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  background: #efe1cf;
  color: var(--bronze);
}
.hero__bg { position: absolute; inset: -14px; will-change: transform; }
.hero__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 100%;
  transform: scale(1.06);
}
.invite.visible .hero__image { animation: heroBreath 18s cubic-bezier(.2, .7, .2, 1) both; }
.hero__veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 250, 242, .42), rgba(255, 250, 242, 0) 36%, rgba(244, 230, 211, 0) 78%, rgba(240, 226, 206, .62)),
    radial-gradient(ellipse at 50% 24%, rgba(255, 252, 246, .3), transparent 52%);
}
.hero__dust i { animation-name: dustFloat; }
.hero__dust, .hero__trail, .petals, .wish-sky { will-change: transform; }
/* قماش المؤثرات: شرارات اللمس وألعاب القصر النارية */
.hero__fx { position: absolute; inset: 0; z-index: 3; width: 100%; height: 100%; pointer-events: none; }
.wish-sky { position: absolute; inset: 0; z-index: 1; overflow: hidden; pointer-events: none; }
.wish-star { position: absolute; width: 12px; height: 12px; transform: translate(-50%, -50%); animation: wishRise 1.5s cubic-bezier(.2, .7, .3, 1) forwards; }
.wish-star b {
  display: block;
  width: 100%;
  height: 100%;
  background: #f2c15c;
  clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%);
  filter: drop-shadow(0 0 4px #fff3cf) drop-shadow(0 0 10px rgba(190, 130, 40, .85));
  animation: twinkle 3.2s ease-in-out 1.5s infinite;
}
.hero__castle-hint {
  position: absolute;
  left: 50%;
  top: 62%;
  z-index: 4;
  padding: .42rem .95rem;
  border: 1px solid rgba(184, 144, 90, .5);
  border-radius: 999px;
  background: rgba(252, 246, 236, .86);
  box-shadow: 0 8px 22px rgba(90, 60, 30, .18);
  color: var(--bronze);
  cursor: pointer;
  font-size: .7rem;
  font-weight: 700;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: opacity .6s ease, transform .6s ease;
}
.hero__castle-hint.hero-reveal { transform: translate(-50%, 13px); }
.hero__castle-hint.hero-reveal.is-visible { transform: translate(-50%, 0); animation: hintPulse 2.2s ease-in-out 1s infinite; }
.hero__castle-hint.is-done { opacity: 0 !important; pointer-events: none; animation: none !important; }
.hero__copy {
  position: relative;
  z-index: 2;
  display: flex;
  min-height: 100svh;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: max(3.1rem, calc(env(safe-area-inset-top) + 2rem)) 1.2rem 9rem;
  text-align: center;
  text-shadow: 0 0 18px rgba(255, 252, 244, .95), 0 0 4px rgba(255, 252, 244, .9);
}
.hero__bismillah {
  margin: 0;
  color: var(--bronze);
  font-family: var(--font-serif);
  font-size: clamp(1.14rem, 4.7vw, 1.5rem);
}
.hero__kicker {
  margin: .7rem 0 .05rem;
  color: var(--gold-deep);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
}
.gold-rule {
  display: flex;
  width: min(265px, 70vw);
  align-items: center;
  justify-content: center;
  gap: .7rem;
  margin: .6rem auto;
  color: var(--gold);
}
.gold-rule i { display: block; height: 1px; flex: 1; background: linear-gradient(90deg, transparent, currentColor); }
.gold-rule i:last-child { background: linear-gradient(90deg, currentColor, transparent); }
.gold-rule b { font-size: .8rem; font-weight: 400; line-height: 1; }
.hero__names { display: grid; justify-items: center; }
.hero__name {
  max-width: 92vw;
  margin: -.06em 0;
  color: var(--bronze);
  font-family: var(--font-display);
  font-size: clamp(3rem, 13.4vw, 5rem);
  font-weight: 700;
  line-height: 1.14;
  text-shadow: none;
  background: linear-gradient(100deg, #5c3f27 0%, #7d5634 30%, #bd955c 50%, #7d5634 70%, #5c3f27 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 7s linear infinite;
}
.hero__name.hero-reveal.is-visible { filter: drop-shadow(0 0 10px rgba(255, 252, 244, .95)) drop-shadow(0 1px 2px rgba(255, 252, 244, .9)); }
.hero__flourish { display: block; width: min(250px, 66vw); height: auto; margin: .05rem auto 0; overflow: visible; }
.hero__flourish path { fill: none; stroke: var(--gold); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 470; stroke-dashoffset: 470; }
.invite.visible .hero__flourish path { animation: draw 1.8s ease 1.3s forwards; }
/* أثر سحري من الطائر إلى الكيكة — كما في الفيديو */
.hero__trail { position: absolute; inset: 0; z-index: 1; overflow: hidden; pointer-events: none; }
.hero__trail i {
  position: absolute;
  width: var(--s, 10px);
  height: var(--s, 10px);
  background: #fff7dc;
  clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%);
  filter: drop-shadow(0 0 5px #f9e6b8) drop-shadow(0 0 14px rgba(255, 226, 160, .85));
  opacity: 0;
  transform: translate(-50%, -50%) scale(.35);
  animation: trailTwinkle 3.2s ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}
.hero__amp {
  margin: -.05rem 0 -.2rem;
  color: var(--gold);
  font-family: var(--font-serif);
  font-size: 2.3rem;
  font-style: italic;
  line-height: 1;
}
.hero__sub {
  max-width: 28rem;
  margin: .8rem auto 0;
  color: #6f5843;
  font-size: .86rem;
  font-weight: 500;
  line-height: 1.9;
}
.hero__date { margin: .3rem 0 0; color: var(--gold-deep); font-size: .8rem; font-weight: 700; }
.hero__scroll {
  position: absolute;
  bottom: max(1.05rem, calc(env(safe-area-inset-bottom) + .5rem));
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  width: max-content;
  flex-direction: column;
  align-items: center;
  gap: .3rem;
  margin: 0 auto;
  padding: .5rem 1.1rem .4rem;
  border: 1px solid rgba(184, 144, 90, .45);
  border-radius: 999px;
  background: rgba(252, 246, 236, .78);
  box-shadow: 0 8px 22px rgba(90, 60, 30, .14);
  color: var(--bronze);
  font-size: .72rem;
  font-weight: 700;
  text-decoration: none;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.hero__scroll-chevrons { position: relative; display: block; width: 14px; height: 14px; }
.hero__scroll-chevrons b {
  position: absolute;
  left: 2px;
  top: 0;
  width: 8px;
  height: 8px;
  border-right: 1.6px solid var(--gold-deep);
  border-bottom: 1.6px solid var(--gold-deep);
  transform: rotate(45deg);
  animation: chevronDrop 1.6s ease-in-out infinite;
}
.hero__scroll-chevrons b:last-child { animation-delay: .3s; }
.hero-reveal { opacity: 0; transform: translateY(13px); filter: blur(4px); transition: opacity .85s ease, transform .85s ease, filter .85s ease; }
.hero-reveal.is-visible { opacity: 1; transform: none; filter: none; }

/* ============================================================
   الأقسام — صفحات الرقّ
   ============================================================ */
.page { position: relative; padding: 4.3rem clamp(1.25rem, 6vw, 3rem); text-align: center; }
.page + .page::before {
  content: "";
  position: absolute;
  top: 0;
  right: 16%;
  left: 16%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
}
.section-heading { position: relative; max-width: 32rem; margin: 0 auto 1.65rem; }
.section-eyebrow {
  margin: 0 0 .42rem;
  color: var(--rose);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .1em;
}
.section-heading h2,
.sky h2 {
  margin: 0;
  color: var(--bronze);
  font-family: var(--font-display);
  font-size: clamp(1.95rem, 7.8vw, 2.8rem);
  line-height: 1.38;
}
.gold-rule--ink { color: var(--gold); }

/* قصاصات من اللوحة نفسها — بحواف مذابة في الرقّ */
.orn {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 42%, transparent 71%);
  mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 42%, transparent 71%);
  opacity: .96;
}
.orn--dove { top: -.4rem; left: -1.4rem; width: min(38vw, 165px); animation: hover 6s ease-in-out infinite; pointer-events: auto; cursor: pointer; z-index: 2; }
.orn--dove:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
.orn--dove.is-hopping { animation: doveHop .9s ease; }
/* الفراشات: غلاف يتحرّك هرباً من الإصبع، والصورة داخله ترفرف */
.orn--butterfly { position: absolute; z-index: 0; width: 46px; pointer-events: none; transform: translate(var(--fx, 0px), var(--fy, 0px)); transition: transform 1.3s cubic-bezier(.25, .8, .3, 1); }
.orn--butterfly img {
  display: block;
  width: 100%;
  -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 42%, transparent 71%);
  mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 42%, transparent 71%);
  animation: flutter 5.2s ease-in-out infinite;
}
.orn--butterfly.is-fleeing img { animation-duration: .8s; }
.orn--butterfly-blue { top: 1.4rem; right: 8%; }
.orn--butterfly-pink { bottom: 1.2rem; left: 9%; width: 40px; }
.orn--butterfly-pink img { animation-delay: -2.6s; animation-duration: 6.1s; }
/* بتلات تتناثر من الحمامة عند لمسها */
.petal-burst { position: absolute; inset: 0; z-index: 5; overflow: visible; pointer-events: none; }
.petal-burst i {
  position: absolute;
  width: var(--w, 9px);
  height: calc(var(--w, 9px) * .66);
  border-radius: 70% 30% 70% 30%;
  background: linear-gradient(135deg, #f8d3d5, #e8a4ab);
  animation: petalBurst var(--t, 2s) ease-out forwards;
}
.orn--roses { top: -2.4rem; right: -1.6rem; width: min(34vw, 150px); }
.orn--swans { position: relative; display: block; width: 110px; margin: .2rem auto 0; }
.orn--cake { top: 3rem; left: -1.2rem; width: min(30vw, 130px); opacity: .9; }
.section-heading, .frame, .invitation-text, .families__grid, .details-card, .timeline, .notes__list { position: relative; z-index: 1; }

/* صورة أصحاب الدعوة (اختيارية) داخل وسام مذهّب */
.portrait {
  width: min(58vw, 230px);
  aspect-ratio: 10 / 12;
  margin: 0 auto 1.6rem;
  overflow: hidden;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(184, 144, 90, .5), 0 0 0 5px var(--card), 0 0 0 6px rgba(184, 144, 90, .5), 0 18px 40px rgba(90, 60, 30, .18);
}
.portrait img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* إطار الآية بزوايا مذهّبة كإطار غلاف الكتاب */
.frame {
  position: relative;
  max-width: 34rem;
  margin: 0 auto;
  border: 1px solid rgba(184, 144, 90, .5);
  background: rgba(255, 252, 246, .72);
  box-shadow: 0 22px 48px rgba(90, 60, 30, .1), inset 0 1px rgba(255, 255, 255, .9);
}
.frame::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(184, 144, 90, .32);
  pointer-events: none;
}
.frame__corner {
  position: absolute;
  width: 26px;
  height: 26px;
  border-color: var(--gold);
  border-style: solid;
  border-width: 0;
}
.frame__corner::after {
  content: "❦";
  position: absolute;
  color: var(--gold);
  font-size: .72rem;
  line-height: 1;
}
.frame__corner--tl { top: -1px; left: -1px; border-width: 2px 0 0 2px; }
.frame__corner--tr { top: -1px; right: -1px; border-width: 2px 2px 0 0; }
.frame__corner--bl { bottom: -1px; left: -1px; border-width: 0 0 2px 2px; }
.frame__corner--br { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; }
.frame__corner--tl::after { top: 6px; left: 6px; }
.frame__corner--tr::after { top: 6px; right: 6px; }
.frame__corner--bl::after { bottom: 6px; left: 6px; }
.frame__corner--br::after { bottom: 6px; right: 6px; }
.frame--verse { padding: 2.6rem 1.6rem 2.3rem; }
.verse {
  position: relative;
  margin: 0;
  color: #5b4030;
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 6.2vw, 2.05rem);
  line-height: 1.95;
}
.invitation-text {
  max-width: 31rem;
  margin: 1.7rem auto 0;
  color: var(--ink-soft);
  font-size: .96rem;
  line-height: 2.2;
}

.families { padding-top: 3.8rem; }
.families__grid { display: grid; max-width: 34rem; grid-template-columns: 1fr 1fr; gap: .7rem; margin: 0 auto; }
.families__grid.is-single { max-width: 17rem; grid-template-columns: minmax(0, 1fr); }
.family-card {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.35rem .75rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: 1.2rem 1.2rem 1.2rem 1.2rem / 1.6rem 1.6rem 1.6rem 1.6rem;
  background: rgba(255, 252, 247, .74);
  box-shadow: 0 15px 34px rgba(90, 60, 30, .07);
}
.family-card::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(184, 144, 90, .2);
  border-radius: inherit;
  pointer-events: none;
}
.family-card__icon { display: block; margin-bottom: .3rem; color: var(--gold); font-size: .8rem; }
.family-card small { color: var(--rose); font-size: .64rem; font-weight: 700; letter-spacing: .06em; }
.family-card p { margin: .42rem 0 0; white-space: pre-line; overflow-wrap: anywhere; color: var(--bronze); font-family: var(--font-serif); font-size: clamp(.98rem, 3.7vw, 1.22rem); line-height: 1.8; }

/* لوح السماء والعدّ التنازلي — غيوم وقصر بعيد */
.sky {
  position: relative;
  margin: 2.2rem clamp(.9rem, 4vw, 2rem) 1.2rem;
  padding: 3.4rem clamp(.9rem, 4vw, 2rem) 9.2rem;
  overflow: hidden;
  border: 1px solid rgba(184, 144, 90, .42);
  border-radius: 150px 150px 1.4rem 1.4rem / 68px 68px 1.4rem 1.4rem;
  background:
    radial-gradient(ellipse at 50% 100%, rgba(255, 250, 240, .9), transparent 58%),
    linear-gradient(180deg, #d9e9f3, #eaf1f3 48%, #f7ede0);
  box-shadow: inset 0 0 0 5px rgba(255, 252, 246, .7), 0 22px 46px rgba(90, 60, 30, .1);
  color: var(--bronze);
  text-align: center;
}
.sky__clouds { position: absolute; inset: 0; pointer-events: none; }
.sky__clouds i {
  position: absolute;
  width: var(--w, 46%);
  height: var(--h, 22%);
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 60%, rgba(255, 255, 255, .95), rgba(255, 255, 255, .55) 45%, rgba(255, 255, 255, 0) 72%);
  filter: blur(6px);
  animation: cloudDrift var(--t, 34s) ease-in-out infinite alternate;
}
.sky__clouds i:nth-child(1) { --w: 58%; --h: 20%; top: 6%; left: -12%; --t: 38s; }
.sky__clouds i:nth-child(2) { --w: 48%; --h: 16%; top: 16%; right: -14%; --t: 30s; animation-delay: -12s; }
.sky__clouds i:nth-child(3) { --w: 42%; --h: 15%; top: 42%; left: 4%; --t: 44s; animation-delay: -20s; }
.sky__clouds i:nth-child(4) { --w: 62%; --h: 22%; bottom: 8%; right: -8%; --t: 36s; animation-delay: -6s; }
.sky__castle {
  position: absolute;
  bottom: -.6rem;
  left: 50%;
  width: min(62vw, 250px);
  transform: translateX(-50%);
  pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 40%, transparent 72%);
  mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 40%, transparent 72%);
}
.sky__dust i { animation-name: dustFloat; }
.sky__content { position: relative; z-index: 2; }
.section-eyebrow--sky { color: #6f8aa5; }
.countdown {
  display: grid;
  max-width: 34rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .55rem;
  margin: 1.9rem auto 0;
  direction: ltr;
}
.countdown div {
  min-width: 0;
  padding: 1rem .25rem .85rem;
  border: 1px solid rgba(184, 144, 90, .45);
  border-radius: .95rem;
  background: rgba(255, 252, 246, .78);
  box-shadow: inset 0 1px rgba(255, 255, 255, .9), 0 8px 20px rgba(90, 60, 30, .08);
  backdrop-filter: blur(5px);
}
.countdown strong { display: block; color: var(--bronze); font-family: var(--font-serif); font-size: clamp(1.65rem, 8vw, 2.5rem); font-weight: 400; line-height: 1; }
.countdown span { display: block; margin-top: .55rem; color: var(--ink-soft); font-size: .66rem; }
.countdown__arrived { margin: 2rem 0 0; color: var(--bronze); font-family: var(--font-serif); font-size: 1.5rem; }

/* التفاصيل */
.details-card {
  position: relative;
  max-width: 34rem;
  margin: 0 auto;
  padding: 1.1rem;
  overflow: visible;
  border: 1px solid rgba(184, 144, 90, .45);
  border-radius: 1.35rem;
  background: rgba(255, 252, 247, .86);
  box-shadow: 0 22px 46px rgba(90, 60, 30, .1);
}
.details-card > .detail-row, .details-card > .details-card__line, .details-card > .gold-button { position: relative; z-index: 1; }
.detail-row { display: grid; grid-template-columns: 3.2rem 1fr; align-items: center; gap: .9rem; padding: 1.05rem .7rem; text-align: right; }
.detail-row__icon {
  display: grid;
  width: 3.05rem;
  height: 3.05rem;
  place-items: center;
  border: 1px solid rgba(184, 144, 90, .4);
  border-radius: 50%;
  color: var(--gold-deep);
  background: #fffaf1;
}
.detail-row__icon svg { width: 1.35rem; fill: none; stroke: currentColor; stroke-width: 1.45; stroke-linecap: round; stroke-linejoin: round; }
.detail-row small { display: block; margin-bottom: .28rem; color: var(--rose); font-size: .67rem; font-weight: 700; letter-spacing: .08em; }
.detail-row strong { display: block; color: var(--bronze); font-family: var(--font-serif); font-size: 1.23rem; font-weight: 700; line-height: 1.55; }
.detail-row p { margin: .15rem 0 0; color: var(--ink-soft); font-size: .79rem; line-height: 1.8; }
.details-card__line { display: block; height: 1px; margin: 0 .8rem; background: linear-gradient(90deg, transparent, var(--line), transparent); }
.gold-button {
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  margin: .6rem .55rem .45rem;
  padding: .76rem 1.2rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #a67c3d, #c9a468);
  box-shadow: 0 12px 25px rgba(114, 75, 39, .22), inset 0 1px rgba(255, 255, 255, .25);
  color: #fffaf1;
  font-size: .84rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease;
}
.gold-button:active { transform: scale(.98); }

/* البرنامج: خيط ذهبي يمتلئ مع التمرير وفراشة تنزل عليه فقرةً فقرة */
.timeline-wrap { position: relative; max-width: 32rem; margin: 0 auto; }
.timeline { position: relative; margin: 0; padding: .4rem 0; list-style: none; }
.timeline__track {
  position: absolute;
  top: 1.4rem;
  bottom: 1.4rem;
  right: calc(5.75rem - 1px);
  width: 2px;
  border-radius: 2px;
  background: rgba(184, 144, 90, .22);
  overflow: hidden;
}
.timeline__fill { position: absolute; top: 0; left: 0; width: 100%; height: 0; background: linear-gradient(180deg, var(--gold-light), var(--gold)); box-shadow: 0 0 10px rgba(184, 144, 90, .6); }
.timeline__marker {
  position: absolute;
  top: 1.4rem;
  right: calc(5.75rem - 21px);
  z-index: 3;
  width: 42px;
  transform: translateY(-50%) rotate(-8deg);
  pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 42%, transparent 71%);
  mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 42%, transparent 71%);
  filter: drop-shadow(0 4px 8px rgba(90, 60, 30, .25));
  animation: markerFlutter 1.1s ease-in-out infinite;
}
.timeline__item {
  position: relative;
  display: grid;
  grid-template-columns: 4.6rem 1.6rem minmax(0, 1fr);
  align-items: center;
  gap: .3rem;
  min-height: 5.2rem;
  text-align: right;
}
.timeline__time {
  justify-self: end;
  padding: .34rem .62rem;
  border: 1px solid rgba(184, 144, 90, .45);
  border-radius: 999px;
  background: rgba(255, 252, 247, .86);
  color: var(--gold-deep);
  font-size: .7rem;
  font-weight: 700;
  white-space: nowrap;
  transition: background .5s ease, color .5s ease, box-shadow .5s ease;
}
.timeline__dot {
  justify-self: center;
  width: .8rem;
  height: .8rem;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: #e6d6bd;
  box-shadow: 0 0 0 1px rgba(184, 144, 90, .4);
  transition: background .5s ease, box-shadow .5s ease, transform .5s ease;
}
.timeline__card {
  position: relative;
  padding: .95rem 1.1rem;
  border: 1px solid rgba(184, 144, 90, .28);
  border-radius: 1rem;
  background: linear-gradient(135deg, rgba(255, 252, 247, .86), rgba(250, 242, 229, .86));
  box-shadow: 0 10px 24px rgba(90, 60, 30, .06);
  color: var(--bronze);
  font-family: var(--font-serif);
  font-size: 1.12rem;
  line-height: 1.6;
  transition: transform .5s ease, box-shadow .5s ease, border-color .5s ease;
}
.timeline__card::before {
  content: "❦";
  position: absolute;
  top: .35rem;
  left: .6rem;
  color: rgba(184, 144, 90, .5);
  font-size: .62rem;
  font-family: var(--font-body);
}
.timeline__item.is-passed .timeline__time { background: linear-gradient(135deg, #c9a468, #a67c3d); color: #fffaf0; box-shadow: 0 6px 14px rgba(114, 75, 39, .25); }
.timeline__item.is-passed .timeline__dot { background: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 0 14px rgba(184, 144, 90, .6); transform: scale(1.15); }
.timeline__item.is-passed .timeline__card { border-color: rgba(184, 144, 90, .62); box-shadow: 0 14px 30px rgba(90, 60, 30, .12); transform: translateX(-3px); }

/* التنويهات: بطاقات رقّ صغيرة بوسام ذهبي */
.notes__list { display: grid; max-width: 32rem; gap: .7rem; margin: 0 auto; padding: 0; list-style: none; }
.notes__item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: .85rem;
  padding: .85rem 1rem;
  border: 1px solid rgba(184, 144, 90, .3);
  border-radius: 1rem;
  background: rgba(255, 252, 247, .8);
  box-shadow: 0 10px 24px rgba(90, 60, 30, .06);
  color: var(--bronze);
  font-size: .9rem;
  font-weight: 500;
  line-height: 1.85;
  text-align: right;
}
.notes__mark {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #e6cc9a, #b8905a);
  box-shadow: inset 0 1px rgba(255, 255, 255, .55), 0 4px 10px rgba(90, 60, 30, .16);
  color: #fffaf0;
  font-size: .8rem;
  line-height: 1;
}
/* الملاحظة البارزة المحقونة من المنصّة تجلس فوق القائمة بنفس الرقّ */
#da3wa-note { padding-top: 38px; }
#da3wa-note .hn-card { box-shadow: 0 16px 38px rgba(90, 60, 30, .14), inset 0 0 0 5px rgba(255, 252, 247, .8); }

/* بطاقة الخدش الذهبية — رسالة مخبّأة */
.scratch {
  position: relative;
  width: min(88vw, 340px);
  aspect-ratio: 17 / 9;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 18px;
  box-shadow: 0 0 0 1px rgba(184, 144, 90, .5), 0 0 0 5px var(--card), 0 0 0 6px rgba(184, 144, 90, .45), 0 20px 44px rgba(90, 60, 30, .18);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.scratch__inner {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  padding: 1rem;
  background: radial-gradient(circle at 50% 30%, #fffdf7, #f7ebd8 80%);
  text-align: center;
}
.scratch__orn { color: var(--gold); font-size: .95rem; }
.scratch__hidden { margin: .2rem 0 0; color: var(--bronze); font-family: var(--font-serif); font-size: 1.15rem; line-height: 1.7; }
.scratch__names { margin: .1rem 0 0; color: var(--gold-deep); font-family: var(--font-display); font-size: 1.55rem; line-height: 1.3; }
.scratch__foil { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; transition: opacity .9s ease; }
.scratch.is-revealed .scratch__foil { opacity: 0; pointer-events: none; }
.scratch__caption { margin: 1rem 0 0; color: var(--ink-soft); font-size: .78rem; }
.scratch.is-revealed + .scratch__caption { color: var(--gold-deep); }
/* بتلات الاحتفال بعد تأكيد الحضور */
.celebrate { position: fixed; inset: 0; z-index: 95; overflow: hidden; pointer-events: none; }
.celebrate i {
  position: absolute;
  top: -6%;
  left: var(--x, 50%);
  width: var(--w, 9px);
  height: calc(var(--w, 9px) * .7);
  border-radius: 60% 40% 60% 40%;
  background: var(--c, #f6d98a);
  opacity: .95;
  animation: celebrateFall var(--t, 3s) ease-in var(--delay, 0s) forwards;
}

/* الختام — البحيرة والكيكة من اللوحة نفسها */
.closing { position: relative; min-height: 40rem; overflow: hidden; color: var(--bronze); text-align: center; }
.closing__image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 100%; transform: scale(1.03); }
.closing__veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(242, 228, 209, 1), rgba(242, 228, 209, .55) 22%, rgba(255, 250, 242, .18) 46%, rgba(242, 228, 209, 0) 70%),
    radial-gradient(ellipse at 50% 30%, rgba(255, 252, 246, .55), transparent 55%);
}
.closing__dust i { animation-name: dustFloat; }
.closing__content {
  position: relative;
  z-index: 2;
  display: flex;
  min-height: 40rem;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 3.4rem 1.35rem max(3.2rem, calc(env(safe-area-inset-bottom) + 2rem));
  text-shadow: 0 0 16px rgba(255, 252, 244, .95), 0 0 4px rgba(255, 252, 244, .9);
}
.closing__orn { color: var(--gold); font-size: 1rem; }
.closing__note { max-width: 28rem; margin: .7rem auto .3rem; color: var(--bronze); font-family: var(--font-serif); font-size: clamp(1.35rem, 5.8vw, 1.9rem); line-height: 1.8; }
.closing h2 { margin: 0; color: var(--bronze); font-family: var(--font-display); font-size: clamp(2.6rem, 11vw, 4.2rem); line-height: 1.25; }
.closing__families { margin: .5rem 0 0; color: var(--ink-soft); font-size: .8rem; font-weight: 500; }
.closing__hashtag { margin: .3rem 0 0; color: var(--gold-deep); font-size: .78rem; font-weight: 700; }
.contact { display: grid; gap: .4rem; margin-top: 1.3rem; }
.contact span { color: var(--ink-soft); font-size: .68rem; }
.contact a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: .65rem 1.4rem;
  border: 1px solid rgba(184, 144, 90, .55);
  border-radius: 999px;
  background: rgba(255, 252, 246, .82);
  color: var(--bronze);
  font-size: .8rem;
  font-weight: 700;
  text-decoration: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.closing .gold-rule { margin-top: 1.4rem; }
.closing__last { margin: 0; color: var(--ink-soft); font-family: var(--font-serif); font-size: 1rem; }


/* طبقة ثابتة على الشاشة كلها: بتلات وغبار ذهبي وأوراق تهبط على طول الدعوة أثناء التمرير */
.fall { position: fixed; inset: 0; z-index: 70; overflow: hidden; opacity: 0; pointer-events: none; transition: opacity 1.4s ease; }
body:not(.locked) .fall { opacity: 1; }
.fall i {
  position: absolute;
  top: -6vh;
  left: var(--x, 50%);
  width: var(--w, 10px);
  height: calc(var(--w, 10px) * .66);
  border-radius: 70% 30% 70% 30%;
  background: linear-gradient(135deg, #f8d3d5, #e8a4ab);
  opacity: 0;
  animation: fallDrift var(--t, 16s) linear infinite;
  animation-delay: var(--delay, 0s);
  will-change: transform;
}
.fall i.is-gold { height: var(--w, 6px); border-radius: 50%; background: #fbe7bd; box-shadow: 0 0 6px #f6dfae, 0 0 12px rgba(246, 223, 174, .65); }
.fall i.is-leaf { background: linear-gradient(135deg, #c4d2ae, #93a98f); border-radius: 80% 20% 80% 20%; }
.fall i.is-blush { background: linear-gradient(135deg, #fbe3e5, #f0bcc2); }

/* زر الصوت الخاص بالقالب */
.music-button {
  position: fixed;
  right: max(15px, env(safe-area-inset-right));
  bottom: max(15px, calc(env(safe-area-inset-bottom) + 8px));
  z-index: 80;
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border: 1px solid rgba(184, 144, 90, .45);
  border-radius: 50%;
  background: rgba(255, 250, 242, .92);
  box-shadow: 0 10px 28px rgba(60, 40, 20, .22);
  color: var(--bronze);
  cursor: pointer;
  font-size: 1.15rem;
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
}

/* ظهور الأقسام */
.reveal-section { opacity: 0; transform: translateY(18px); filter: blur(6px); transition: opacity .8s ease, transform .8s ease, filter .8s ease; }
.reveal-section.is-visible { opacity: 1; transform: none; filter: none; }

/* الأقسام المحقونة من المنصّة (تأكيد الحضور، التقويم، الذكريات) */
#da3wa-music { display: none !important; }
.invite > section[dir="rtl"], .invite > section[dir="ltr"] { position: relative; z-index: 4; }

@keyframes wishRise { from { transform: translate(-50%, -50%) scale(1.7); } to { transform: translate(calc(-50% + var(--dx, 0px)), calc(-50% + var(--dy, -140px))) scale(.85); } }
@keyframes doveHop { 0%, 100% { transform: translateY(0) rotate(-1deg); } 35% { transform: translateY(-22px) rotate(-6deg) scale(1.04); } 70% { transform: translateY(-6px) rotate(2deg); } }
@keyframes hintPulse { 0%, 100% { box-shadow: 0 8px 22px rgba(90, 60, 30, .18), 0 0 0 0 rgba(230, 204, 154, .7); } 60% { box-shadow: 0 8px 22px rgba(90, 60, 30, .18), 0 0 0 12px rgba(230, 204, 154, 0); } }
@keyframes petalBurst { 0% { transform: translate(0, 0) rotate(0deg); opacity: 1; } 100% { transform: translate(var(--dx, 0px), var(--dy, 160px)) rotate(420deg); opacity: 0; } }
@keyframes celebrateFall { to { transform: translateY(112vh) rotate(var(--r, 360deg)); opacity: .55; } }
@keyframes chevronDrop { 0% { opacity: 0; transform: translateY(-5px) rotate(45deg); } 45% { opacity: 1; } 100% { opacity: 0; transform: translateY(6px) rotate(45deg); } }
@keyframes markerFlutter { 0%, 100% { transform: translateY(-50%) rotate(-8deg) scaleX(1); } 50% { transform: translateY(-50%) rotate(-2deg) scaleX(.82); } }
@keyframes gateIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes shimmer { from { background-position: 110% 0; } to { background-position: -110% 0; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes lightSweep { from { transform: translateX(-38%); } to { transform: translateX(38%); } }
@keyframes buttonPulse { 0% { box-shadow: 0 0 0 0 rgba(255, 228, 170, .55); } 70% { box-shadow: 0 0 0 16px rgba(255, 228, 170, 0); } 100% { box-shadow: 0 0 0 16px rgba(255, 228, 170, 0); } }
@keyframes dustRise { 0% { opacity: 0; transform: translateY(14px) scale(.5); } 40% { opacity: .95; transform: translateY(-4px) scale(1.15); } 100% { opacity: 0; transform: translateY(-26px) scale(.6); } }
@keyframes trailTwinkle { 0%, 100% { opacity: 0; transform: translate(-50%, -50%) scale(.35) rotate(0deg); } 45% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(40deg); } 70% { opacity: .55; } }
@keyframes twinkle { 0%, 100% { opacity: .08; transform: scale(.55); } 50% { opacity: .95; transform: scale(1.4); } }
@keyframes dustFloat { 0%, 100% { opacity: .1; transform: translateY(8px) scale(.6); } 50% { opacity: .9; transform: translateY(-10px) scale(1.2); } }
@keyframes fallDrift {
  0% { transform: translate3d(0, 0, 0) rotate(0deg); opacity: 0; }
  6% { opacity: .9; }
  50% { transform: translate3d(var(--drift, 30px), 55vh, 0) rotate(210deg); }
  94% { opacity: .8; }
  100% { transform: translate3d(calc(var(--drift, 30px) * -.5), 112vh, 0) rotate(430deg); opacity: 0; }
}
@keyframes petalFall {
  0% { transform: translate3d(0, -4vh, 0) rotate(0deg); opacity: 0; }
  8% { opacity: .85; }
  50% { transform: translate3d(var(--drift, 26px), 50vh, 0) rotate(260deg); }
  92% { opacity: .75; }
  100% { transform: translate3d(calc(var(--drift, 26px) * -.6), 104vh, 0) rotate(540deg); opacity: 0; }
}
@keyframes buttonShine { 0%, 38% { left: -28%; } 72%, 100% { left: 125%; } }
@keyframes gateFlash { 0% { opacity: 0; transform: scale(.6); } 40% { opacity: .92; transform: scale(1.4); } 100% { opacity: 0; transform: scale(2.8); } }
@keyframes heroBreath { from { transform: scale(1.065); } to { transform: scale(1); } }
@keyframes scrollLine { 0%, 100% { opacity: .25; transform: scaleY(.5); transform-origin: top; } 50% { opacity: 1; transform: scaleY(1); } }
@keyframes hover { 0%, 100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-9px) rotate(1.5deg); } }
@keyframes flutter { 0%, 100% { transform: translate(0, 0) rotate(-6deg) scaleX(1); } 25% { transform: translate(6px, -8px) rotate(4deg) scaleX(.86); } 50% { transform: translate(-3px, -14px) rotate(-3deg) scaleX(1); } 75% { transform: translate(-8px, -5px) rotate(5deg) scaleX(.88); } }
@keyframes cloudDrift { from { transform: translateX(-4%); } to { transform: translateX(6%); } }

@media (min-width: 560px) {
  .family-card { min-height: 10.5rem; padding: 1.6rem 1.25rem 1.35rem; }
  .orn--dove { left: -.5rem; }
}

@media (max-width: 390px) {
  .hero__copy { padding-top: max(2.6rem, calc(env(safe-area-inset-top) + 1.4rem)); }
  .countdown { gap: .38rem; }
  .countdown div { padding-inline: .1rem; }
  .timeline__item { grid-template-columns: 4.3rem 1.4rem minmax(0, 1fr); }
  .timeline__track { right: calc(5.35rem - 1px); }
  .timeline__marker { right: calc(5.35rem - 21px); }
  .sky { padding-bottom: 8rem; }
}

/* الشاشات العريضة (حاسوب/جهاز لوحي بالعرض): الملصق يتضخّم فتقع كتابة البوابة فوق عنوان الغلاف —
   ظلّ علوي أقوى وكتلة أصغر يبقيان النص واضحاً بلا أن يشوّشا على الكتاب */
@media (min-aspect-ratio: 1/1) {
  .gate__shade {
    background:
      radial-gradient(circle at 53% 50%, rgba(255, 240, 205, .16), transparent 34%),
      linear-gradient(180deg, rgba(60, 38, 20, .62), rgba(60, 38, 20, .22) 26%, rgba(60, 38, 20, 0) 44%, rgba(60, 38, 20, .02) 66%, rgba(60, 38, 20, .5));
  }
  .gate__ui { padding-top: max(1.4rem, env(safe-area-inset-top)); }
  .gate__bismillah { font-size: 1rem; }
  .gate__names { font-size: clamp(1.7rem, 3.4vw, 2.3rem); }
  .gate__flourish { width: 190px; }
  .gate__chapter { font-size: .85rem; }
}

@media (max-height: 640px) {
  .hero__copy { padding-top: max(2rem, calc(env(safe-area-inset-top) + 1rem)); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .hero__image { transform: none !important; }
  .reveal-section, .hero-reveal { opacity: 1; transform: none; filter: none; }
  .magic-dust, .petals, .hero__trail, .gate__light, .hero__fx, .hero__castle-hint, .wish-sky, .celebrate, .fall { display: none; }
  .timeline__marker { animation: none; }
  .gate__flourish path, .hero__flourish path { stroke-dashoffset: 0; }
}
