/* ============================================================
   قالب confetti — احتفال عيد ميلاد: ألوان مبهجة + قصاصات ملوّنة
   ============================================================ */

:root {
  --bg:      #fff7ec;   /* كريمي دافئ */
  --cream:   #fffdf8;
  --coral:   #ff5d73;   /* مرجاني */
  --coral-dp:#e8455c;
  --sun:     #ffd23f;   /* أصفر مشمس */
  --teal:    #2dd4bf;   /* تركواز */
  --violet:  #7b5cff;   /* بنفسجي */
  --ink:     #3a2b54;   /* نص بنفسجي داكن */
  --ink-sf:  #7a6c92;
  --line:    rgba(123, 92, 255, 0.22);

  --font-display: "Lalezar", "Baloo Bhaijaan 2", system-ui, sans-serif;
  --font-fun:     "Baloo Bhaijaan 2", system-ui, sans-serif;
  --font-body:    "Tajawal", system-ui, sans-serif;
}

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

body {
  font-family: var(--font-body);
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 50% -5%, #fff0d6, transparent 55%),
    radial-gradient(circle at 0% 100%, rgba(45,212,191,0.16), transparent 42%),
    radial-gradient(circle at 100% 85%, rgba(123,92,255,0.16), transparent 42%),
    radial-gradient(circle at 0% 10%, rgba(255,93,115,0.12), transparent 40%);
  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%, #fffdf8, var(--bg) 80%),
    linear-gradient(160deg, rgba(255,210,63,0.10), rgba(123,92,255,0.10));
  transition: opacity 0.9s ease, visibility 0.9s ease;
}
.cover.is-open { opacity: 0; visibility: hidden; pointer-events: none; }

/* خلفية صورة اختيارية بحواف متلاشية (feathered) خلف الغلاف والترويسة */
.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.62; }

.cover__poppers { position: absolute; inset: 0; pointer-events: none; }
.popper { position: absolute; width: clamp(90px, 26vw, 150px); height: auto; }
.popper--l { bottom: 6%; inset-inline-start: 2%; transform: rotate(-6deg); animation: popShake 2.6s ease-in-out infinite; }
.popper--r { bottom: 6%; inset-inline-end: 2%; transform: rotate(6deg); animation: popShake 2.6s ease-in-out 0.4s infinite; }
@keyframes popShake { 0%,100%{ transform: rotate(-6deg);} 50%{ transform: rotate(2deg) translateY(-4px);} }

.cover__inner { position: relative; z-index: 2; width: min(380px, 88vw); }
.cover__cake { width: clamp(140px, 42vw, 190px); margin: 0 auto 6px; animation: floaty 3.4s ease-in-out infinite; }
.cover__cake svg { width: 100%; height: auto; display: block; }
.flame { transform-origin: bottom center; animation: flicker 1.1s ease-in-out infinite; }
.flame--2 { animation-delay: 0.2s; }
.flame--3 { animation-delay: 0.4s; }
@keyframes flicker { 0%,100%{ transform: scaleY(1) translateY(0); opacity:1;} 50%{ transform: scaleY(0.82) translateX(1px); opacity:.85;} }
@keyframes floaty { 0%,100%{ transform: translateY(0);} 50%{ transform: translateY(-8px);} }

.cover__label { color: var(--violet); letter-spacing: normal; font-size: 13px; font-weight: 700; }
.cover__mono {
  font-family: var(--font-display);
  font-size: clamp(40px, 13vw, 70px); padding: 0 14px;
  background: linear-gradient(100deg, var(--coral), var(--violet) 50%, var(--teal));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: var(--violet);
  line-height: 1.15; margin: 4px 0 20px;
}
.cover__btn {
  font-family: var(--font-fun); font-size: 16px; font-weight: 700;
  color: #fff;
  background: linear-gradient(120deg, var(--coral), var(--violet));
  border: none; border-radius: 999px; padding: 14px 36px; cursor: pointer;
  letter-spacing: normal; box-shadow: 0 12px 28px rgba(123, 92, 255, 0.35);
  transition: transform 0.25s ease, filter 0.25s ease;
}
.cover__btn:hover { transform: translateY(-2px) scale(1.03); filter: brightness(1.05); }

/* ====================== طبقة القصاصات ====================== */
.confetti-layer { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 50; }
.cover.is-open ~ .confetti-layer { z-index: 1; }
.confetto {
  position: absolute; top: -24px; width: 10px; height: 16px; border-radius: 2px;
  opacity: 0; will-change: transform;
}
.confetto--burst { animation: burst var(--dur, 1.5s) cubic-bezier(.2,.7,.3,1) forwards; }
.confetto--drift { animation: drift var(--dur, 9s) linear infinite; }
.streamer { position: absolute; top: -10px; width: 5px; height: 60px; border-radius: 4px; opacity: 0; }
.streamer--burst { animation: burst var(--dur, 1.7s) cubic-bezier(.2,.7,.3,1) forwards; }

@keyframes burst {
  0%   { opacity: 0; transform: translate(0,0) rotate(0); }
  10%  { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--tx,0), var(--ty,90vh)) rotate(var(--rot,720deg)); }
}
@keyframes drift {
  0%   { opacity: 0; transform: translate(0,-5vh) rotate(0); }
  10%  { opacity: .9; }
  90%  { opacity: .9; }
  100% { opacity: 0; transform: translate(var(--sway,20px),108vh) rotate(540deg); }
}

/* ====================== المحتوى ====================== */
.invite { position: relative; max-width: 680px; margin: 0 auto; padding: 0 20px 80px; z-index: 2; }

.section { position: relative; z-index: 2; text-align: center; padding: clamp(44px, 9vw, 78px) clamp(10px, 4vw, 30px); }
.section + .section { border-top: 1px dashed var(--line); }
.section__title {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(26px, 6.4vw, 40px); color: var(--violet); margin-bottom: 18px;
}

.divider { display: flex; align-items: center; justify-content: center; gap: 12px; font-size: 22px; max-width: 280px; margin: 22px auto; }
.divider span { height: 2px; flex: 1; border-radius: 2px; background: linear-gradient(90deg, transparent, var(--coral), var(--teal), transparent); }

/* الترويسة */
.hero { padding-top: clamp(50px, 12vw, 96px); }
/* محتوى الترويسة فوق طبقة خلفية الصورة */
.hero > :not(.bg-photo) { position: relative; z-index: 1; }
.hero__balloons { display: block; width: clamp(150px, 46vw, 200px); margin: 0 auto 6px; animation: floaty 4s ease-in-out infinite; }
.hero__balloons svg { width: 100%; height: auto; display: block; }
.hero__kicker { color: var(--teal); letter-spacing: normal; font-size: 13px; font-weight: 700; margin-bottom: 6px; }

/* صورة الطفل في الترويسة */
.hero-photo { display: none; width: clamp(120px, 34vw, 180px); margin: 10px auto 14px; }
.hero-photo.is-shown { display: block; animation: photoPop 0.7s cubic-bezier(.2,1.4,.4,1) both; }
.hero-photo img {
  display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover;
  border-radius: 50%;
  border: 5px solid var(--cream);
  background: var(--cream);
  box-shadow:
    0 0 0 4px var(--violet),
    0 0 0 8px var(--sun),
    0 16px 34px rgba(123, 92, 255, 0.32);
}
@keyframes photoPop { 0% { opacity: 0; transform: scale(0.7); } 100% { opacity: 1; transform: scale(1); } }
.celebrant {
  font-family: var(--font-display); font-weight: 400; line-height: 1.15;
  font-size: clamp(48px, 16vw, 92px);
  background: linear-gradient(100deg, var(--coral), var(--violet) 55%, var(--teal));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: var(--coral);
  margin: 4px 0 10px;
  filter: drop-shadow(0 6px 18px rgba(123,92,255,0.18));
}
.age {
  position: relative; display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  width: clamp(96px, 28vw, 130px); height: clamp(96px, 28vw, 130px); margin: 6px auto 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #fff, var(--sun) 70%, #f4b400);
  box-shadow: 0 12px 30px rgba(255,177,63,0.4), inset 0 -8px 16px rgba(244,160,0,0.35);
  animation: pop 0.7s cubic-bezier(.2,1.4,.4,1) both, floaty 3.6s ease-in-out 0.7s infinite;
}
.age::before, .age::after {
  content: ""; position: absolute; width: 14px; height: 14px; border-radius: 50%;
}
.age::before { background: var(--coral); top: -4px; inset-inline-end: 8px; }
.age::after  { background: var(--teal);  bottom: 2px; inset-inline-start: -2px; }
.age__num { font-family: var(--font-display); font-size: clamp(40px, 12vw, 58px); color: #6a3d00; line-height: 1; }
.age__lbl { font-family: var(--font-fun); font-weight: 700; font-size: 13px; color: #8a5200; margin-top: 2px; }
@keyframes pop { 0%{ transform: scale(0);} 100%{ transform: scale(1);} }

.hero__greet { font-family: var(--font-fun); font-weight: 700; color: var(--coral-dp); font-size: clamp(17px, 5vw, 24px); margin-top: 4px; }
.hero__date { color: var(--violet); font-family: var(--font-fun); font-weight: 500; font-size: clamp(14px, 4vw, 18px); margin-top: 12px; }

/* تلميح التمرير للأسفل */
.hero__scroll {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  margin-top: clamp(22px, 5vw, 34px);
  color: var(--violet); font-family: var(--font-fun); font-weight: 700;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.28);
}
.hero__scroll-text { font-size: 0.88rem; letter-spacing: normal; }
.hero__scroll-arrow {
  font-size: 1.2rem; line-height: 1;
  animation: scrollBob 1.8s ease-in-out infinite;
}
@keyframes scrollBob {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50%      { transform: translateY(7px); opacity: 0.85; }
}

/* العدّاد */
.when__date { font-family: var(--font-display); font-size: clamp(22px, 5.6vw, 32px); color: var(--ink); }
.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: 440px; margin: 8px auto 0; }
.cd__cell {
  border-radius: 16px; padding: 16px 4px;
  background: linear-gradient(165deg, #fff, #fff4f6);
  box-shadow: 0 8px 20px rgba(123,92,255,0.12); border: 1px solid var(--line);
}
.cd__cell:nth-child(1) .cd__num { color: var(--coral); }
.cd__cell:nth-child(2) .cd__num { color: var(--teal); }
.cd__cell:nth-child(3) .cd__num { color: var(--violet); }
.cd__cell:nth-child(4) .cd__num { color: #f4a000; }
.cd__num { display: block; font-family: var(--font-display); font-size: clamp(28px, 8vw, 44px); font-variant-numeric: tabular-nums; line-height: 1.1; }
.cd__lbl { display: block; color: var(--ink-sf); font-size: 12px; font-weight: 500; margin-top: 2px; }
.when__arrived { font-family: var(--font-display); color: var(--coral); font-size: clamp(24px, 6.4vw, 36px); margin-top: 16px; }

/* نص الدعوة */
.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: 380px; margin: 6px auto 0; text-align: start; }
.timeline__item { position: relative; display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 12px; padding: 13px 18px 13px 0; border-inline-start: 2px dashed var(--line); margin-inline-start: 8px; }
.timeline__dot { position: absolute; inset-inline-start: -8px; top: 18px; width: 13px; height: 13px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 4px var(--bg); }
.timeline__item:nth-child(2n) .timeline__dot { background: var(--teal); }
.timeline__item:nth-child(3n) .timeline__dot { background: var(--violet); }
.timeline__time { font-family: var(--font-fun); font-weight: 700; color: var(--violet); font-size: 15px; min-width: 86px; }
.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: 9px 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(--violet); width: clamp(150px, 44vw, 200px); margin: 0 auto 14px; }
.venue__art svg { width: 100%; height: auto; display: block; }
.venue__name { font-family: var(--font-display); font-size: clamp(24px, 6.4vw, 34px); color: var(--ink); }
.venue__addr { color: var(--ink-sf); margin-top: 4px; font-size: 15px; }
.venue__btn {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 22px;
  font-family: var(--font-fun); font-weight: 700; font-size: 15px; color: #fff;
  background: linear-gradient(120deg, var(--teal), var(--violet));
  border-radius: 999px; padding: 12px 28px; text-decoration: none;
  box-shadow: 0 10px 24px rgba(45,212,191,0.32); transition: transform 0.25s ease, filter 0.25s ease;
}
.venue__btn:hover { transform: translateY(-2px) scale(1.03); filter: brightness(1.05); }

/* الخاتمة */
.closing__note { font-family: var(--font-display); font-size: clamp(22px, 6vw, 32px); color: var(--coral); margin-bottom: 8px; }
.closing__hashtag { color: var(--violet); font-weight: 700; font-size: 15px; letter-spacing: normal; margin-bottom: 20px; }
.contact { margin: 0 auto 18px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 16px; max-width: 290px; background: linear-gradient(165deg, #fff, #f6f2ff); box-shadow: 0 8px 20px rgba(123,92,255,0.1); }
.contact__label { display: block; color: var(--ink-sf); font-size: 13px; margin-bottom: 6px; }
.contact__link {
  display: inline-flex; align-items: center; gap: 7px; color: #fff; font-family: var(--font-fun); font-weight: 700; font-size: 16px; text-decoration: none;
  background: linear-gradient(120deg, #25d366, #128c4a); padding: 9px 20px; border-radius: 999px;
}
.contact__link::before { content: "💬"; }
.contact__link:hover { filter: brightness(1.05); }
.closing__host { color: var(--ink-sf); font-size: 15px; margin-bottom: 16px; }
.cake-mini { font-size: 30px; display: inline-block; animation: floaty 3s ease-in-out infinite; }

/* حركة الظهور */
.reveal { opacity: 0; transform: translateY(30px); 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; }
  .confetti-layer { display: none; }
  .hero-photo.is-shown { opacity: 1; transform: none; }
  .bg-photo { transition: none !important; }
}
