/* ============================================================
   قالب moon — بشارة مولود جديد: ليلٌ حالم، نجوم لطيفة، هلالٌ مهد
   كحلي/بنفسجي ناعم + لافندر + ذهبي خافت + لمسة وردية مطمئنّة
   ============================================================ */

:root {
  --bg:        #1d1b3a;   /* كحلي ليلي عميق */
  --bg-2:      #2a2752;   /* بنفسجي ليلي */
  --card:      #353069;   /* بطاقة ليلية */
  --card-2:    #423b80;
  --lav:       #c4b5fd;   /* لافندر */
  --lav-dp:    #a78bfa;   /* بنفسجي ناعم غامق */
  --lav-sf:    #ded6ff;
  --gold:      #ffd98a;   /* ذهبي نجمي خافت */
  --gold-sf:   #fff3c4;
  --blush:     #ffc6d9;   /* وردي مطمئن */
  --accent:    var(--lav-dp);   /* اللون المميّز — يتبدّل حسب الجنس */
  --accent-sf: var(--lav);
  --ink:       #f3f0ff;   /* نص فاتح حالم */
  --ink-sf:    #c3bce6;   /* نص ثانوي خافت */
  --line:      rgba(196, 181, 253, 0.26);

  --font-display: "Lalezar", system-ui, sans-serif;
  --font-body:    "Tajawal", system-ui, sans-serif;
}

/* ====== لمسة الجنس: تلوين خفيف للّون المميّز فقط ====== */
.tint-girl {
  --accent:    #f48fb4;
  --accent-sf: #ffc6d9;
}
.tint-boy {
  --accent:    #8fb6f4;
  --accent-sf: #bcd4ff;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

/* ====== خلفية صورة اختيارية بحوافّ متلاشية (تندمج مع خلفية القالب) ====== */
.bg-photo {
  position: absolute; inset: 0; z-index: 0;
  background-size: cover; background-position: center;
  opacity: 0; transition: opacity 0.9s ease; pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse 80% 74% at 50% 42%, #000 48%, transparent 100%);
          mask-image: radial-gradient(ellipse 80% 74% at 50% 42%, #000 48%, transparent 100%);
}
.bg-photo.is-shown { opacity: 0.5; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse at 50% -8%, #3a356e, transparent 55%),
    radial-gradient(circle at 8% 14%, rgba(167,139,250,0.22), transparent 40%),
    radial-gradient(circle at 92% 86%, rgba(255,217,138,0.12), transparent 42%),
    linear-gradient(180deg, #201d40, #16142e 100%);
  background-attachment: fixed;
  line-height: 1.85;
  overflow-x: hidden;
}

/* ====================== شاشة الدخول ====================== */
.cover {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 30%, #34306a, #221f46 62%, #141228 100%);
  transition: opacity 1s ease, visibility 1s ease;
}
.cover.is-open { opacity: 0; visibility: hidden; pointer-events: none; }

/* نجوم تومض على الغلاف */
.cover__stars { position: absolute; inset: 0; pointer-events: none; }
.cover__stars span {
  position: absolute; border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 6px 1px rgba(255,255,255,0.7);
  animation: twinkle ease-in-out infinite;
}
@keyframes twinkle {
  0%, 100% { opacity: 0.15; transform: scale(0.7); }
  50%      { opacity: 1;    transform: scale(1.1); }
}

.cover__inner { position: relative; width: min(360px, 88vw); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.cover__moon { width: min(264px, 64vw); }
.moonSvg { width: 100%; height: auto; display: block; filter: drop-shadow(0 14px 30px rgba(124,107,176,0.45)); }

/* لمسات حيّة: تأرجح المهد، توهّج، نجمة متدلّية، نجمات تومض */
.moonBody { transform-box: fill-box; transform-origin: 130px 156px; animation: cradleSway 4.2s ease-in-out infinite; }
.hangStar { transform-box: fill-box; transform-origin: 130px 8px; animation: hangSwing 3.6s ease-in-out infinite; }
.moonGlow { transform-box: fill-box; transform-origin: center; animation: glowPulse 4.4s ease-in-out infinite; }
.orbStar  { transform-box: fill-box; transform-origin: center; animation: starTwinkle 2.6s ease-in-out infinite; }
.orbStar:nth-child(2) { animation-delay: 1.1s; }
.orbDot   { animation: dotTwinkle 2.2s ease-in-out infinite; }
.orbDot:nth-child(4)  { animation-delay: 0.9s; }
@keyframes cradleSway { 0%,100% { transform: rotate(-2.2deg); } 50% { transform: rotate(2.2deg); } }
@keyframes hangSwing  { 0%,100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
@keyframes glowPulse  { 0%,100% { opacity: 0.55; transform: scale(0.95); } 50% { opacity: 0.9; transform: scale(1.05); } }
@keyframes starTwinkle{ 0%,100% { opacity: 0.5; transform: scale(0.85); } 50% { opacity: 1; transform: scale(1.15); } }
@keyframes dotTwinkle { 0%,100% { opacity: 0.35; } 50% { opacity: 1; } }

/* فتحة افتتاحية: المهد يتأرجح بلطف ثم يطفو لأعلى */
.moonSvg.is-pop { animation: moonPop 1s cubic-bezier(0.22, 1.2, 0.4, 1) both; }
@keyframes moonPop {
  0%   { transform: scale(1) translateY(0) rotate(0); }
  30%  { transform: scale(1.04) translateY(6px) rotate(-3deg); }
  60%  { transform: scale(1.02) translateY(-30px) rotate(3deg); }
  100% { transform: scale(1) translateY(0) rotate(0); }
}

.cover__center { position: relative; z-index: 2; }
.cover__label { color: var(--ink-sf); font-size: 13px; letter-spacing: normal; }
.cover__mono {
  font-family: var(--font-display);
  font-size: clamp(30px, 9vw, 48px); padding: 0 10px;
  background: linear-gradient(90deg, var(--lav), var(--gold-sf) 55%, var(--blush));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  line-height: 1.2; margin: 4px 0 16px;
}
.cover__btn {
  font-family: var(--font-body); font-size: 16px; font-weight: 800;
  color: #221f46;
  background: linear-gradient(180deg, var(--lav-sf), var(--lav));
  border: none; border-radius: 999px; padding: 13px 32px; cursor: pointer;
  letter-spacing: normal; box-shadow: 0 12px 26px rgba(167,139,250,0.42);
  transition: transform 0.25s ease, filter 0.25s ease;
}
.cover__btn:hover { transform: translateY(-2px); filter: brightness(1.06); }

/* ====================== المحتوى ====================== */
.invite { position: relative; max-width: 680px; margin: 0 auto; padding: 0 20px 72px; }
.floaties { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 1; }
.floaty { position: absolute; bottom: -30px; opacity: 0; animation: floatUpScreen linear forwards; }
@keyframes floatUpScreen {
  0% { opacity: 0; transform: translateY(0) rotate(-6deg); }
  12% { opacity: 0.95; }
  100% { opacity: 0; transform: translateY(-114vh) rotate(8deg); }
}

/* نجوم ثابتة خافتة في خلفية المحتوى */
.skyStars { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.skyStars span {
  position: absolute; border-radius: 50%; background: #fff;
  box-shadow: 0 0 5px 1px rgba(255,255,255,0.55);
  animation: twinkle ease-in-out infinite;
}

.section { position: relative; z-index: 2; text-align: center; padding: clamp(46px, 9vw, 82px) clamp(10px, 4vw, 30px); }
.section + .section { border-top: 1px dashed var(--line); }
.section__title {
  font-family: var(--font-display); font-weight: 400; letter-spacing: normal;
  font-size: clamp(27px, 7vw, 40px); color: var(--lav); margin-bottom: 16px;
}
.divider { display: flex; align-items: center; justify-content: center; gap: 12px; max-width: 280px; margin: 22px auto; font-size: 24px; }
.divider span { height: 2px; flex: 1; border-radius: 2px; background: repeating-linear-gradient(90deg, var(--lav-dp) 0 8px, transparent 8px 16px); opacity: 0.55; }

/* الترويسة */
.hero { padding-top: clamp(54px, 13vw, 100px); overflow: hidden; }
.hero__kicker { color: var(--gold); letter-spacing: normal; font-size: 13px; margin-bottom: 6px; }
.celebrant {
  font-family: var(--font-display); font-weight: 400; line-height: 1.15; letter-spacing: normal;
  font-size: clamp(48px, 16vw, 92px);
  background: linear-gradient(92deg, var(--lav), var(--accent-sf) 50%, var(--gold-sf));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  margin: 4px 0 12px; filter: drop-shadow(0 4px 14px rgba(167,139,250,0.32));
}
.weightwrap {
  display: inline-flex; align-items: center; gap: 8px;
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 2px solid rgba(255,255,255,0.10); border-radius: 999px; padding: 7px 20px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.30); margin: 4px 0 14px;
}
.weight__icon { font-size: 20px; }
.weight__lbl { color: var(--ink-sf); font-weight: 700; font-size: 14px; letter-spacing: normal; }
.weight__val { font-family: var(--font-display); font-size: clamp(20px, 5vw, 26px); color: var(--gold); line-height: 1; letter-spacing: normal; }
.hero__greet { font-family: var(--font-display); color: var(--accent); font-size: clamp(20px, 5.5vw, 28px); margin-top: 4px; letter-spacing: normal; }
.hero__date { color: var(--lav); font-weight: 700; font-size: clamp(14px, 4vw, 18px); margin-top: 12px; letter-spacing: normal; }

/* تلميح التمرير للأسفل — لطيف وواضح فوق الخلفية الليلية */
.hero__scroll {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  margin-top: 26px; color: var(--lav-sf);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
}
.hero__scroll-text {
  font-family: var(--font-body); font-weight: 700;
  font-size: 0.88rem; letter-spacing: normal;
}
.hero__scroll-arrow {
  font-size: 1.2rem; line-height: 1;
  animation: heroScrollBob 1.8s ease-in-out infinite;
}
@keyframes heroScrollBob {
  0%, 100% { transform: translateY(0); opacity: 0.85; }
  50%      { transform: translateY(7px); opacity: 1; }
}

/* صورة المولود في الترويسة — إطار دائري حالم محاط بهالة قمرية */
#heroPhoto {
  display: none;
  width: clamp(120px, 34vw, 180px);
  aspect-ratio: 1 / 1;
  margin: 6px auto 14px;
  padding: 6px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 3px solid rgba(255,255,255,0.16);
  box-shadow: 0 14px 34px rgba(0,0,0,0.40), 0 0 0 5px rgba(196,181,253,0.22), 0 0 26px rgba(196,181,253,0.30);
}
#heroPhoto.is-shown { display: block; animation: heroPhotoIn 0.9s cubic-bezier(0.22, 1, 0.36, 1) both; }
#heroPhoto img {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
@keyframes heroPhotoIn {
  0%   { opacity: 0; transform: scale(0.86); }
  100% { opacity: 1; transform: scale(1); }
}

/* نجمات صغيرة طافية في الترويسة */
.miniStar { position: absolute; top: 18px; width: 34px; height: 34px; opacity: 0.9; animation: starBob 4.8s ease-in-out infinite; }
.miniStar svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 4px 10px rgba(0,0,0,0.35)); }
.miniStar--a { inset-inline-start: 7%; }
.miniStar--b { inset-inline-end: 8%; top: 36px; animation-delay: 1.5s; }
@keyframes starBob { 0%,100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-12px) rotate(6deg); } }

/* العدّاد */
.when__date { font-family: var(--font-display); font-size: clamp(22px, 5.5vw, 31px); color: var(--ink); letter-spacing: normal; }
.when__time { color: var(--ink-sf); margin-top: 2px; font-size: 15px; }
.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(8px, 2vw, 14px); max-width: 430px; margin: 26px auto 0; }
.cd__cell {
  border: 2px solid rgba(255,255,255,0.10); border-radius: 18px; padding: 15px 4px;
  background: linear-gradient(180deg, var(--card-2), var(--card));
  box-shadow: 0 8px 20px rgba(0,0,0,0.30);
}
.cd__num { display: block; font-family: var(--font-display); font-size: clamp(28px, 8vw, 42px); color: var(--lav); font-variant-numeric: tabular-nums; line-height: 1.1; letter-spacing: normal; }
.cd__lbl { display: block; color: var(--ink-sf); font-size: 12px; margin-top: 2px; }
.when__arrived { font-family: var(--font-display); color: var(--gold); font-size: clamp(23px, 6vw, 34px); margin-top: 20px; letter-spacing: normal; }

/* نص الدعوة */
.invitation__text { font-size: clamp(15px, 4vw, 17px); color: var(--ink); line-height: 2.1; max-width: 42ch; margin: 0 auto; }

/* برنامج الاستقبال */
.timeline { list-style: none; max-width: 360px; margin: 6px auto 0; text-align: start; }
.timeline__item { position: relative; display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 12px; padding: 12px 18px 12px 0; border-inline-start: 2px dashed var(--line); margin-inline-start: 6px; }
.timeline__dot { position: absolute; inset-inline-start: -8px; top: 17px; width: 12px; height: 12px; border-radius: 50%; background: var(--lav-dp); box-shadow: 0 0 0 3px var(--bg), 0 0 8px var(--lav); }
.timeline__time { font-family: var(--font-display); color: var(--lav); font-size: 16px; min-width: 92px; letter-spacing: normal; }
.timeline__title { color: var(--ink); font-size: 15px; }

/* ملاحظات */
.notes__list { list-style: none; max-width: 400px; margin: 4px auto 0; text-align: start; }
.notes__item { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; color: var(--ink); font-size: 15px; line-height: 1.7; }
.notes__mark { font-size: 15px; margin-top: 2px; flex-shrink: 0; }

/* القاعة */
.venue__art { color: var(--lav); width: clamp(150px, 44vw, 200px); margin: 0 auto 14px; opacity: 0.92; }
.venue__art svg { width: 100%; height: auto; display: block; }
.venue__name { font-family: var(--font-display); font-size: clamp(24px, 6.5vw, 34px); color: var(--ink); letter-spacing: normal; }
.venue__addr { color: var(--ink-sf); margin-top: 4px; font-size: 15px; }
.venue__btn {
  display: inline-flex; align-items: center; gap: 9px; margin-top: 22px;
  font-weight: 800; font-size: 15px; color: #221f46; letter-spacing: normal;
  background: linear-gradient(180deg, var(--lav-sf), var(--lav));
  border-radius: 999px; padding: 12px 28px; text-decoration: none;
  box-shadow: 0 8px 22px rgba(167,139,250,0.4); transition: transform 0.25s ease, filter 0.25s ease;
}
.venue__btn:hover { transform: translateY(-2px); filter: brightness(1.06); }

/* الخاتمة */
.closing__note { font-family: var(--font-display); font-size: clamp(22px, 6vw, 30px); color: var(--ink); margin-bottom: 8px; letter-spacing: normal; }
.closing__hashtag { color: var(--gold); font-weight: 700; font-size: 15px; letter-spacing: normal; margin-bottom: 18px; }
.contact { margin: 0 auto 18px; padding: 14px 18px; border: 2px solid rgba(255,255,255,0.10); border-radius: 18px; max-width: 280px; background: linear-gradient(180deg, var(--card-2), var(--card)); box-shadow: 0 8px 20px rgba(0,0,0,0.30); }
.contact__label { display: block; color: var(--ink-sf); font-size: 13px; margin-bottom: 4px; }
.contact__link { display: inline-flex; align-items: center; gap: 7px; color: var(--lav); font-weight: 800; font-size: 17px; text-decoration: none; }
.contact__link:hover { text-decoration: underline; }
.contact__link::before { content: "💬"; }
.closing__host { color: var(--ink-sf); font-size: 15px; margin-bottom: 16px; }
.cherry { font-size: 26px; display: inline-block; }

/* حركة الظهور */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.9s ease, transform 0.9s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  *, .reveal { transition: none !important; animation: none !important; }
  .reveal { opacity: 1; transform: none; }
  .moonGlow { opacity: 0.6; }
  .cover__stars span, .skyStars span { opacity: 0.7; }
  .hero__scroll-arrow { opacity: 1; }
}
