/* ============================================================
   قالب royal — افتتاح ستارة مسرح + نبيذي/ذهبي فاخر
   ============================================================ */

:root {
  --bg-0:    #160a12;   /* نبيذي شبه أسود */
  --bg-1:    #24101c;
  --wine:    #4a1a2c;
  --wine-2:  #6e2440;
  --gold:    #e3c179;
  --gold-2:  #f0d79b;
  --gold-dp: #b8923f;
  --cream:   #f6ead3;
  --muted:   #c9a9a5;
  --rose:    #d98a9a;
  --line:    rgba(227, 193, 121, 0.30);

  --font-grand:   "Aref Ruqaa", serif;
  --font-title:   "El Messiri", sans-serif;
  --font-script:  "Amiri", 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(--cream);
  background-color: var(--bg-0);
  line-height: 1.9;
  overflow-x: hidden;
}

/* خلفية محيطة متوهّجة */
.ambient {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(60% 45% at 50% 18%, rgba(110,36,64,0.55), transparent 70%),
    radial-gradient(50% 40% at 80% 80%, rgba(74,26,44,0.5), transparent 70%),
    radial-gradient(45% 35% at 12% 70%, rgba(110,36,64,0.35), transparent 70%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0));
  animation: ambientDrift 16s ease-in-out infinite alternate;
}
@keyframes ambientDrift { from { filter: hue-rotate(0deg) brightness(1); } to { filter: hue-rotate(-8deg) brightness(1.12); } }

/* جزيئات ذهبية */
.particles { position: fixed; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.pt { position: absolute; bottom: -10px; width: 4px; height: 4px; border-radius: 50%;
  background: radial-gradient(circle, var(--gold-2), rgba(227,193,121,0)); opacity: 0; animation: rise linear infinite; }
@keyframes rise {
  0% { transform: translateY(0) scale(0.6); opacity: 0; }
  12% { opacity: 0.9; } 85% { opacity: 0.7; }
  100% { transform: translateY(-108vh) scale(1.1); opacity: 0; }
}

/* ====================== ستارة المسرح ====================== */
.theater { position: fixed; inset: 0; z-index: 50; overflow: hidden; background: transparent; }
.theater.is-open { pointer-events: none; }

/* الكَنّة العلوية (valance) */
.valance {
  position: absolute; top: 0; left: 0; right: 0; height: 17%; z-index: 6;
  background:
    linear-gradient(180deg, #7a2a42, #4a1a2c 70%, #3a1320);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  border-bottom: 3px solid var(--gold-dp);
  transition: transform 1.6s cubic-bezier(.7,0,.2,1) 0.1s;
}
.valance::before { /* طيّات الكَنّة */
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(90deg, rgba(0,0,0,0.28) 0, transparent 26px, rgba(255,255,255,0.06) 52px, transparent 78px);
}
.valance__fringe {
  position: absolute; bottom: -14px; left: 0; right: 0; height: 16px;
  background:
    radial-gradient(circle at 12px 0, var(--gold) 6px, transparent 7px) 0 0/24px 16px repeat-x;
  filter: drop-shadow(0 2px 1px rgba(0,0,0,0.4));
}
.theater.is-open .valance { transform: translateY(-100%); }

/* لوحتا الستارة */
.curtain {
  position: absolute; top: 0; bottom: 0; width: 51%; z-index: 5;
  background-color: #4a1626;
  background-image: url("assets/curtain.jpg");
  background-image: image-set(
    url("assets/curtain.webp") type("image/webp"),
    url("assets/curtain.jpg") type("image/jpeg")
  );
  background-size: 200% 100%;
  background-repeat: no-repeat;
  box-shadow: inset 0 0 60px rgba(0,0,0,0.32);
  transition: transform 1.35s cubic-bezier(.62,0,.25,1);
  will-change: transform;
}
.curtain--l { left: 0; background-position: left center; transform-origin: left; }
.curtain--r { right: 0; background-position: right center; transform-origin: right; }
/* الصورة الواقعية تتضمّن الكَنّة والشراشيب — نُخفي الزخارف المرسومة */
.valance, .valance__fringe, .tieback { display: none !important; }
/* حبل التزيين (tieback) — على الجانب الخارجي لكل لوحة */
.tieback {
  position: absolute; top: 50%; width: 42%; height: 20px; border-radius: 50%;
  background: linear-gradient(180deg, var(--gold-2), var(--gold-dp));
  box-shadow: 0 6px 16px rgba(0,0,0,0.4); opacity: 0.85;
}
.curtain--l .tieback { left: 6%; } .curtain--r .tieback { right: 6%; }

.theater.is-open .curtain--l { transform: translateX(-101%); }
.theater.is-open .curtain--r { transform: translateX(101%); }

/* مركز الستارة: الشعار والزر */
.theater__center {
  position: absolute; inset: 0; z-index: 7;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 24px;
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.theater.is-open .theater__center { opacity: 0; transform: scale(1.15); pointer-events: none; }

.crest { position: relative; width: clamp(120px, 34vw, 156px); aspect-ratio: 1; display: grid; place-items: center; margin-bottom: 20px; }
.crest__svg { position: absolute; inset: 0; width: 100%; height: 100%; color: var(--gold); animation: spin 26s linear infinite; }
.crest__ring { fill: none; stroke: currentColor; stroke-width: 2; opacity: 0.9; }
.crest__ring--thin { fill: none; stroke: currentColor; stroke-width: 1; opacity: 0.55; stroke-dasharray: 3 6; }
.crest__mono { font-family: var(--font-grand); font-size: clamp(46px, 13vw, 64px); color: var(--gold-2); text-shadow: 0 0 24px rgba(227,193,121,0.5); }
@keyframes spin { to { transform: rotate(360deg); } }

.theater__label { font-family: var(--font-title); letter-spacing: normal; color: var(--gold); font-size: 15px; margin-bottom: 10px; }
.theater__names { font-family: var(--font-grand); font-size: clamp(28px, 8vw, 48px); color: var(--gold-2); line-height: 1.25; margin: 2px 0 18px; padding: 0 14px; }
.theater__btn {
  font-family: var(--font-title); font-weight: 600; font-size: 16px; color: #2a0f1a;
  background: linear-gradient(180deg, var(--gold-2), var(--gold)); border: none;
  border-radius: 999px; padding: 14px 40px; cursor: pointer; letter-spacing: normal;
  box-shadow: 0 0 0 1px var(--gold-dp), 0 12px 34px rgba(227,193,121,0.4);
  transition: transform 0.25s ease, box-shadow 0.25s ease; animation: glowPulse 2.4s ease-in-out infinite;
}
.theater__btn:hover { transform: translateY(-2px) scale(1.03); }
.theater__hint { color: var(--muted); font-size: 13px; margin-top: 16px; letter-spacing: normal; }
@keyframes glowPulse {
  0%,100% { box-shadow: 0 0 0 1px var(--gold-dp), 0 10px 28px rgba(227,193,121,0.32); }
  50% { box-shadow: 0 0 0 1px var(--gold-dp), 0 14px 40px rgba(227,193,121,0.6); }
}

/* ====================== خلفية صورة مخصّصة بحواف متلاشية ====================== */
/* طبقة اختيارية خلف الغلاف والواجهة؛ الحواف تتلاشى بقناع دائري كي تندمج مع خلفية القالب */
.bg-photo {
  position: absolute; inset: 0; z-index: 0;
  background-size: cover; background-position: center;
  opacity: 0; transition: opacity .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: .5; }
@media (prefers-reduced-motion: reduce) { .bg-photo { transition: none; } }

/* ====================== المحتوى ====================== */
.invite { position: relative; z-index: 2; max-width: 680px; margin: 0 auto; }
.section { position: relative; text-align: center; padding: clamp(46px, 9vw, 86px) clamp(18px, 6vw, 40px); }
.section + .section::before {
  content: "❖"; position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  color: var(--gold); font-size: 13px; opacity: 0.6;
}

.section__title {
  font-family: var(--font-title); font-weight: 600; font-size: clamp(22px, 5.6vw, 32px);
  color: var(--gold); margin-bottom: 18px; letter-spacing: normal;
}
.orn { color: var(--gold); font-size: 24px; display: inline-block; }

/* فاصل ذهبي */
.gdivider { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 4px auto 22px; max-width: 280px; color: var(--gold); }
.gdivider i { height: 1px; flex: 1; background: linear-gradient(90deg, transparent, var(--gold), transparent); transform: scaleX(0); transform-origin: center; transition: transform 1s ease; }
.reveal.is-visible .gdivider i, .hero .gdivider i { transform: scaleX(1); }
.gdivider span { font-size: 15px; }

/* ====================== الواجهة ====================== */
.hero { position: relative; min-height: 100svh; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.stage-bg {
  position: absolute; inset: 0; z-index: -2; background-size: cover; background-position: center;
  /* لإضافة صورة: ضع assets/hero.jpg — تظهر تلقائياً عبر script.js */
}
.mandala { position: absolute; top: 50%; left: 50%; width: min(120vw, 560px); aspect-ratio: 1; transform: translate(-50%,-50%); color: var(--gold); opacity: 0.16; z-index: -1; animation: spin 60s linear infinite; }
.m-draw { stroke-dasharray: 1000; stroke-dashoffset: 1000; animation: draw 3s ease forwards 0.3s; }
@keyframes draw { to { stroke-dashoffset: 0; } }

.hero__inner { position: relative; z-index: 1; padding: 30px; }

/* صورة العرسين المؤطّرة */
.hero-photo { display: none; width: clamp(120px, 34vw, 180px); aspect-ratio: 1; margin: 6px auto 18px; }
.hero-photo.is-shown { display: block; animation: heroPhotoIn 0.9s cubic-bezier(.2,.7,.2,1) forwards; }
.hero-photo img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block;
  border: 2px solid var(--gold);
  box-shadow:
    0 0 0 6px rgba(74,26,44,0.55),
    0 0 0 7px var(--gold-dp),
    0 18px 44px rgba(0,0,0,0.5),
    0 0 30px rgba(227,193,121,0.3);
}
@keyframes heroPhotoIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }
.bismillah { font-family: var(--font-script); color: var(--gold); font-size: clamp(18px, 4.6vw, 24px); margin: 12px 0 14px; }
.kicker { font-family: var(--font-title); color: var(--muted); letter-spacing: normal; font-size: 13px; margin-bottom: 8px; }
.couple { font-family: var(--font-grand); font-weight: 700; line-height: 1.38; font-size: clamp(42px, 13vw, 80px); margin: 6px 0 16px; }
.couple__name { display: block; color: var(--cream); }
.couple__amp { display: block; color: var(--gold); font-size: 0.5em; margin: 2px 0; }
.hero__date { font-family: var(--font-title); color: var(--gold-2); font-size: clamp(15px, 4.2vw, 20px); }

/* لمعة ذهبية على الأسماء */
.shimmer {
  background: linear-gradient(100deg, var(--cream) 30%, var(--gold-2) 48%, #fff7e6 52%, var(--gold-2) 56%, var(--cream) 72%);
  background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  animation: shine 5.5s ease-in-out infinite;
}
@keyframes shine { 0%,100% { background-position: 0% 0; } 50% { background-position: 100% 0; } }

.scroll-cue {
  display: inline-flex; flex-direction: column; align-items: center; gap: 4px;
  margin-top: 30px; color: var(--gold);
  text-shadow: 0 1px 8px rgba(0,0,0,0.45);
}
.scroll-cue__text { font-family: var(--font-title); font-size: 0.88rem; letter-spacing: normal; opacity: 0.95; }
.scroll-cue__arrow { font-size: 1.2rem; line-height: 1; animation: bob 1.8s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0); opacity: 0.85; } 50% { transform: translateY(7px); opacity: 1; } }

/* دعاء / نصوص */
.verse__text { font-family: var(--font-script); font-size: clamp(19px, 5vw, 26px); color: var(--gold-2); line-height: 2; max-width: 30ch; margin: 0 auto; }
.invitation__text { font-size: clamp(15px, 4vw, 17px); color: var(--cream); line-height: 2.1; max-width: 42ch; margin: 0 auto; opacity: 0.95; }

/* عائلتان */
.families { display: flex; align-items: center; justify-content: center; gap: clamp(12px, 5vw, 30px); flex-wrap: wrap; }
.family { flex: 1; min-width: 130px; }
.family__label { display: block; color: var(--muted); font-size: 13px; letter-spacing: normal; margin-bottom: 6px; }
.family__names { font-family: var(--font-grand); color: var(--cream); font-size: clamp(16px, 4.4vw, 21px); }
.families__heart { color: var(--rose); font-size: 22px; animation: beat 1.8s ease-in-out infinite; }
@keyframes beat { 0%,100% { transform: scale(1); } 14% { transform: scale(1.22); } 28% { transform: scale(1); } 42% { transform: scale(1.16); } }

/* عدّاد */
.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(8px, 2vw, 14px); max-width: 440px; margin: 26px auto 0; }
.cd__cell { border: 1px solid var(--line); border-radius: 14px; padding: 16px 4px; background: rgba(227,193,121,0.06); backdrop-filter: blur(2px); box-shadow: inset 0 0 20px rgba(227,193,121,0.05); }
.cd__num { display: block; font-family: var(--font-grand); font-size: clamp(28px, 8vw, 44px); color: var(--gold-2); font-variant-numeric: tabular-nums; line-height: 1.1; }
.cd__num.flip { animation: flip 0.5s ease; }
@keyframes flip { 0% { transform: rotateX(0); } 50% { transform: rotateX(90deg); opacity: 0.3; } 100% { transform: rotateX(0); } }
.cd__lbl { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }
.when__arrived { font-family: var(--font-grand); color: var(--gold-2); font-size: clamp(24px, 6vw, 34px); margin-top: 22px; }

/* برنامج */
.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: 13px 18px 13px 0; border-inline-start: 1px solid var(--line); margin-inline-start: 6px; }
.timeline__dot { position: absolute; inset-inline-start: -6px; top: 18px; width: 11px; height: 11px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 3px var(--bg-0), 0 0 12px var(--gold); }
.timeline__time { font-family: var(--font-grand); color: var(--gold-2); font-size: 15px; min-width: 86px; }
.timeline__title { color: var(--cream); font-size: 15px; }

/* القاعة */
.venue__photo { height: 180px; margin: 0 auto 18px; max-width: 400px; border-radius: 16px; border: 1px solid var(--line);
  background: radial-gradient(circle at 50% 35%, #3a1626, #25101c); background-size: cover; background-position: center;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 14px 40px rgba(0,0,0,0.4); }
.venue__photo .venue__pin { color: var(--gold); font-size: 30px; opacity: 0.6; }
.venue.has-photo .venue__pin { display: none; }
.venue__name { font-family: var(--font-grand); font-size: clamp(22px, 6vw, 32px); color: var(--cream); }
.venue__addr { color: var(--muted); margin-top: 4px; font-size: 15px; }
.when__date { font-family: var(--font-grand); font-size: clamp(20px, 5.5vw, 28px); color: var(--cream); }
.when__time { color: var(--muted); margin-top: 2px; font-size: 15px; margin-bottom: 4px; }
.venue__btn {
  display: inline-flex; align-items: center; gap: 9px; margin-top: 22px; font-family: var(--font-title);
  font-weight: 600; font-size: 15px; color: #2a0f1a;
  background: linear-gradient(180deg, var(--gold-2), var(--gold)); border-radius: 999px; padding: 13px 30px;
  text-decoration: none; box-shadow: 0 10px 26px rgba(227,193,121,0.34); transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.venue__btn:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(227,193,121,0.5); }

/* ملاحظات */
.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(--cream); font-size: 15px; line-height: 1.7; opacity: 0.95; }
.notes__mark { color: var(--gold); font-size: 13px; margin-top: 4px; flex-shrink: 0; }

/* خاتمة */
.closing__note { font-family: var(--font-script); font-size: clamp(20px, 5vw, 28px); color: var(--cream); margin-bottom: 8px; }
.closing__hashtag { color: var(--gold-2); font-weight: 700; font-size: 15px; letter-spacing: normal; margin-bottom: 18px; }
.contact { margin: 0 auto 16px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 14px; max-width: 280px; background: rgba(227,193,121,0.06); }
.contact__label { display: block; color: var(--muted); font-size: 13px; margin-bottom: 4px; }
.contact__link { color: var(--gold-2); font-weight: 700; font-size: 17px; text-decoration: none; }
.contact__link:hover { text-decoration: underline; }
.closing__families { color: var(--muted); font-size: 15px; margin-bottom: 6px; }
.closing__thanks { font-family: var(--font-script); color: var(--rose); font-size: 17px; margin-bottom: 16px; }

/* ====================== حركات الظهور ====================== */
.reveal { opacity: 0; transform: translateY(34px); transition: opacity 1s ease, transform 1s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
.reveal-up { opacity: 0; transform: translateY(26px); }
.hero.play .reveal-up { animation: up 0.9s cubic-bezier(.2,.7,.2,1) forwards; }
.hero.play .bismillah { animation-delay: 0.15s; }
.hero.play .kicker { animation-delay: 0.3s; }
.hero.play .couple__name:first-of-type, .hero.play #groomName { animation-delay: 0.45s; }
.hero.play .couple__amp { animation-delay: 0.6s; }
.hero.play #brideName { animation-delay: 0.72s; }
.hero.play .hero__date { animation-delay: 0.9s; }
.hero.play .scroll-cue { animation-delay: 1.1s; }
.hero.play .orn--top { animation-delay: 0s; }
@keyframes up { to { opacity: 1; transform: translateY(0); } }

@media (prefers-reduced-motion: reduce) {
  *, .reveal { transition: none !important; animation: none !important; }
  .reveal, .reveal-up { opacity: 1 !important; transform: none !important; }
  .m-draw { stroke-dashoffset: 0; }
}

/* أسطر Enter في حقل «الدعاء/العبارة» تُعرض كما كتبها الزبون (بسملة فوق والآية تحتها) */
.verse__text { white-space: pre-line; }
