/* ═══════════════════════════════════════════════
   دعوة زفاف — Morad & Fatema-Ezzahrae
   ثيم: عاجي فاخر + زمردي + ذهبي
   ═══════════════════════════════════════════════ */

:root {
  --ivory:      #f7f3ea;
  --ivory-deep: #efe8d8;
  --paper:      #fcfaf4;
  --emerald:    #1e4d3b;
  --emerald-2:  #2c6a52;
  --gold:       #b98a2f;
  --gold-soft:  #cfa94b;
  --ink:        #3a3a33;
  --ink-soft:   #6d6a5d;
  --shadow:     0 18px 50px rgba(60, 50, 20, .14);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; overflow-x: clip; }

body {
  font-family: 'Amiri', serif;
  background: var(--ivory);
  color: var(--ink);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* خلفية ورق ناعمة */
body::before {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(207,169,75,.10), transparent),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(30,77,59,.06), transparent),
    repeating-linear-gradient(45deg, rgba(120,100,60,.012) 0 2px, transparent 2px 6px);
  pointer-events: none;
  z-index: 0;
}

/* ═══════════ شاشة الظرف ═══════════ */

#envelope-screen {
  position: fixed; inset: 0;
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(ellipse at 50% 30%, #f9f5ec, #eee6d3 70%, #e5dbc2);
  transition: opacity 1s ease .9s, visibility 1s ease .9s;
}
#envelope-screen.opened { opacity: 0; visibility: hidden; }

.env-shine {
  position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 45%, rgba(255,255,255,.65), transparent 45%);
  animation: shine 5s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes shine { to { opacity: .4; } }

.envelope {
  position: relative;
  width: min(88vw, 400px);
  aspect-ratio: 10 / 7;
  filter: drop-shadow(0 30px 40px rgba(70, 55, 20, .25));
  animation: env-float 4s ease-in-out infinite;
}
@keyframes env-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}
#envelope-screen.opened .envelope { animation: none; }

.env-back, .env-pocket {
  position: absolute; inset: 0;
  border-radius: 10px;
}
.env-back { background: #e7dcc3; }

/* الجيب الأمامي (مثلثات الظرف) */
.env-pocket {
  background:
    linear-gradient(115deg, #f2ead7 0 50%, transparent 50.5%),
    linear-gradient(245deg, #ede4cd 0 50%, transparent 50.5%),
    linear-gradient(0deg,   #f6efdf 0 58%, transparent 58.5%);
  border-radius: 10px;
  z-index: 3;
  box-shadow: inset 0 -2px 12px rgba(120, 95, 40, .12);
}

/* الغطاء العلوي */
.env-flap {
  position: absolute; top: 0; left: 0; right: 0;
  height: 55%;
  background: linear-gradient(180deg, #efe5cd, #e2d5b5);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  border-radius: 10px 10px 0 0;
  transform-origin: top center;
  transition: transform 1s cubic-bezier(.6, 0, .3, 1) .15s, z-index 0s .6s;
  z-index: 4;
  box-shadow: inset 0 -6px 14px rgba(120, 95, 40, .1);
}
#envelope-screen.opened .env-flap {
  transform: rotateX(180deg);
  z-index: 1;
}

/* البطاقة اللي كتخرج من الظرف */
.env-card {
  position: absolute; left: 6%; right: 6%; top: 6%; bottom: 10%;
  background: linear-gradient(180deg, #fffdf8, #faf5e8);
  border-radius: 8px;
  z-index: 2;
  display: flex; align-items: center; justify-content: center;
  transition: transform 1.1s cubic-bezier(.5, 0, .2, 1) .55s;
  box-shadow: 0 6px 24px rgba(90, 70, 30, .18);
}
#envelope-screen.opened .env-card { transform: translateY(-70%); }

.env-card-inner { text-align: center; padding: 12px; }
.env-card-monogram {
  font-family: 'Great Vibes', cursive;
  font-size: clamp(30px, 8vw, 42px);
  color: var(--gold);
}
.env-card-names {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(13px, 3.4vw, 17px);
  letter-spacing: 2px;
  color: var(--emerald);
  margin-top: 4px;
  text-transform: uppercase;
}
.env-card-date {
  font-family: 'Cormorant Garamond', serif;
  font-size: 13px; letter-spacing: 4px;
  color: var(--ink-soft); margin-top: 6px;
}

/* الختم الشمعي */
.wax-seal {
  position: absolute;
  left: 50%; top: 52%;
  width: clamp(84px, 24vw, 104px); height: clamp(84px, 24vw, 104px);
  transform: translate(-50%, -50%);
  background: none; border: none; cursor: pointer;
  z-index: 6;
  transition: transform .8s cubic-bezier(.6, -0.3, .4, 1), opacity .5s ease .2s;
  animation: seal-pulse 2.2s ease-in-out infinite;
}
@keyframes seal-pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50%      { transform: translate(-50%, -50%) scale(1.06); }
}
.wax-seal:active { transform: translate(-50%, -50%) scale(.92); }
#envelope-screen.opened .wax-seal {
  animation: none;
  transform: translate(-50%, -50%) scale(1.6) rotate(18deg);
  opacity: 0;
  pointer-events: none;
}
.seal-svg { width: 100%; height: 100%; }
.seal-svg path {
  fill: var(--emerald);
  filter: drop-shadow(0 4px 8px rgba(20, 50, 35, .45));
}
.seal-svg { overflow: visible; }
.seal-text {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Great Vibes', cursive;
  font-size: clamp(22px, 6vw, 28px);
  color: #e9dfc2;
  text-shadow: 0 1px 2px rgba(0,0,0,.4);
}

.env-hint {
  position: absolute;
  top: calc(100% + 26px);
  left: 50%; transform: translateX(-50%);
  width: max-content; max-width: 90vw;
  text-align: center;
  color: var(--ink);
  font-size: clamp(16px, 4.2vw, 19px);
  line-height: 1.9;
  transition: opacity .4s ease;
}
.env-hint strong { color: var(--emerald); font-size: 1.15em; }
.hint-tap {
  display: block;
  font-size: .78em;
  color: var(--ink-soft);
  animation: hint-blink 1.8s ease-in-out infinite;
}
@keyframes hint-blink { 50% { opacity: .35; } }
#envelope-screen.opened .env-hint { opacity: 0; }

/* ═══════════ المحتوى ═══════════ */

#invitation {
  position: relative; z-index: 1;
  opacity: 0;
  transition: opacity 1s ease;
}
#invitation.visible { opacity: 1; }

.section {
  max-width: 640px;
  margin: 0 auto;
  padding: clamp(40px, 8vw, 70px) 22px;
  text-align: center;
  position: relative;
}

.section-title {
  font-family: 'Aref Ruqaa', serif;
  font-size: clamp(26px, 6.5vw, 34px);
  color: var(--emerald);
  margin-bottom: 28px;
  position: relative;
  display: inline-block;
}
.section-title::after {
  content: '';
  display: block;
  width: 60%;
  height: 2px;
  margin: 10px auto 0;
  background: linear-gradient(90deg, transparent, var(--gold-soft), transparent);
}

/* أنيميشن الظهور عند السكرول */
.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity .9s ease, transform .9s cubic-bezier(.2, .6, .2, 1);
}
.reveal.in {
  opacity: 1;
  transform: none;
}

/* ─── الواجهة ─── */

.hero {
  min-height: 100svh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: 70px 20px 60px;
  position: relative;
  overflow: hidden;
}

.floral {
  position: absolute;
  width: clamp(170px, 44vw, 300px);
  opacity: .9;
  pointer-events: none;
}
.floral-svg { width: 100%; height: auto; display: block; }
.floral-tr { top: -20px; left: -30px; transform: scaleX(-1); }
.floral-bl { bottom: -30px; right: -30px; transform: scaleY(-1); }

.bismillah {
  font-size: clamp(18px, 4.6vw, 24px);
  color: var(--gold);
  margin-bottom: 18px;
}
.hero-verse {
  font-size: clamp(15px, 3.9vw, 19px);
  color: var(--ink-soft);
  max-width: 480px;
  line-height: 2.1;
}
.hero-ornament {
  color: var(--gold-soft);
  font-size: 26px;
  margin: 22px 0 10px;
}

.names-ar {
  font-family: 'Aref Ruqaa', serif;
  font-weight: 400;
  color: var(--emerald);
  font-size: clamp(40px, 11vw, 64px);
  line-height: 1.5;
  display: flex; flex-direction: column; align-items: center;
  gap: 2px;
}
.amp-ar {
  font-family: 'Great Vibes', cursive;
  color: var(--gold);
  font-size: .55em;
  line-height: 1;
}
.names-latin {
  font-family: 'Great Vibes', cursive;
  font-size: clamp(24px, 6vw, 34px);
  color: var(--gold);
  margin-top: 14px;
}
.names-latin .amp { color: var(--emerald-2); }

.hero-date {
  display: flex; align-items: center; gap: 14px;
  margin-top: 26px;
}
.date-rule {
  width: clamp(40px, 10vw, 70px); height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-soft));
}
.date-rule:last-child { transform: scaleX(-1); }
.date-text {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(18px, 5vw, 24px);
  letter-spacing: 5px;
  color: var(--ink);
  direction: ltr;
  unicode-bidi: isolate;
}

.guest-badge {
  margin-top: 34px;
  padding: 14px 30px;
  border: 1px solid rgba(185, 138, 47, .45);
  border-radius: 999px;
  background: rgba(255, 253, 246, .75);
  backdrop-filter: blur(4px);
  font-size: clamp(15px, 4vw, 18px);
  line-height: 1.8;
  color: var(--ink-soft);
  box-shadow: 0 8px 24px rgba(120, 95, 40, .1);
}
.guest-badge strong { color: var(--emerald); font-size: 1.2em; }
.guest-badge-icon { display: block; font-size: 20px; }

.scroll-cue {
  position: absolute; bottom: 22px; left: 50%;
  transform: translateX(-50%);
  width: 26px; height: 42px;
  border: 2px solid rgba(110, 100, 70, .4);
  border-radius: 14px;
}
.scroll-cue span {
  position: absolute; top: 7px; left: 50%;
  width: 4px; height: 8px;
  margin-left: -2px;
  background: var(--gold);
  border-radius: 2px;
  animation: cue 1.6s ease-in-out infinite;
}
@keyframes cue {
  0%   { transform: translateY(0); opacity: 1; }
  70%  { transform: translateY(14px); opacity: 0; }
  100% { opacity: 0; }
}

/* ─── نص الدعوة ─── */

.invite-text p {
  font-size: clamp(16px, 4.4vw, 20px);
  line-height: 2.3;
  color: var(--ink-soft);
}
.invite-text strong { color: var(--emerald); }
.invite-highlight {
  font-family: 'Aref Ruqaa', serif;
  font-size: clamp(24px, 6.4vw, 32px) !important;
  color: var(--gold) !important;
  margin-top: 10px;
}

/* ─── العداد ─── */

.countdown {
  display: flex; align-items: center; justify-content: center;
  gap: clamp(6px, 2vw, 14px);
  direction: ltr;
  flex-wrap: wrap;
}
.cd-box {
  background: linear-gradient(170deg, #ffffff, #f6efdd);
  border: 1px solid rgba(185, 138, 47, .3);
  border-radius: 14px;
  padding: clamp(12px, 3.4vw, 20px) clamp(10px, 3vw, 18px);
  min-width: clamp(64px, 18vw, 92px);
  box-shadow: var(--shadow);
}
.cd-num {
  display: block;
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  font-size: clamp(28px, 8vw, 44px);
  color: var(--emerald);
  font-variant-numeric: tabular-nums;
}
.cd-label {
  display: block;
  font-size: clamp(12px, 3.2vw, 14px);
  color: var(--ink-soft);
  margin-top: 2px;
}
.cd-sep {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(22px, 6vw, 34px);
  color: var(--gold-soft);
  padding-bottom: 18px;
}

/* ─── التفاصيل ─── */

.detail-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}
.detail-card {
  background: linear-gradient(175deg, #fffdf8, #f7f1e2);
  border: 1px solid rgba(185, 138, 47, .25);
  border-radius: 18px;
  padding: 26px 16px;
  box-shadow: var(--shadow);
  transition: transform .35s ease;
}
.detail-card:hover { transform: translateY(-6px); }
.detail-icon { font-size: 30px; margin-bottom: 10px; }
.detail-label {
  font-size: 13px; letter-spacing: 1px;
  color: var(--gold);
  margin-bottom: 8px;
}
.detail-value {
  font-size: clamp(15px, 4vw, 17px);
  color: var(--ink);
  line-height: 1.9;
}

/* ─── البرنامج ─── */

.timeline {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
  padding: 8px 0;
}
.timeline::before {
  content: '';
  position: absolute; top: 0; bottom: 0; left: 50%;
  width: 2px; margin-left: -1px;
  background: linear-gradient(180deg, transparent, var(--gold-soft) 12%, var(--gold-soft) 88%, transparent);
}
.tl-item {
  position: relative;
  width: 50%;
  padding: 16px 34px;
  min-height: 86px;
}
.tl-right { right: 0; margin-right: 50%; text-align: right; }
.tl-left  { text-align: left; }
.tl-dot {
  position: absolute; top: 22px;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  font-size: 19px;
  background: #fffdf6;
  border: 2px solid var(--gold-soft);
  border-radius: 50%;
  box-shadow: 0 6px 16px rgba(120, 95, 40, .18);
  z-index: 1;
}
.tl-right .tl-dot { left: -22px; }
.tl-left  .tl-dot { right: -22px; }
.tl-time {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  font-size: 19px;
  letter-spacing: 2px;
  color: var(--gold);
}
.tl-title {
  font-size: clamp(15px, 4vw, 18px);
  color: var(--ink);
  margin-top: 2px;
}

/* ─── الخريطة ─── */

.map-frame {
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid rgba(185, 138, 47, .3);
  margin-bottom: 20px;
}
.map-frame iframe {
  width: 100%; height: 320px; border: 0; display: block;
}
.map-soon {
  color: var(--ink-soft);
  font-size: 16px;
  padding: 26px;
  border: 1.5px dashed rgba(185, 138, 47, .4);
  border-radius: 16px;
  background: rgba(255, 253, 246, .6);
}

/* ─── الأزرار ─── */

.btn {
  display: inline-block;
  font-family: inherit;
  font-size: clamp(15px, 4vw, 17px);
  padding: 14px 34px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform .25s ease, box-shadow .25s ease;
}
.btn:hover { transform: translateY(-3px); }
.btn-gold {
  background: linear-gradient(135deg, #d4ab4e, #b98a2f);
  color: #fff;
  box-shadow: 0 10px 26px rgba(185, 138, 47, .4);
}
.btn-emerald {
  background: linear-gradient(135deg, #2c6a52, #1e4d3b);
  color: #f3ecd9;
  box-shadow: 0 10px 26px rgba(30, 77, 59, .35);
  width: 100%;
}

/* ─── RSVP ─── */

.rsvp-sub { color: var(--ink-soft); margin-bottom: 26px; font-size: clamp(15px, 4vw, 17px); }

.rsvp-form {
  background: linear-gradient(175deg, #fffdf8, #f8f2e4);
  border: 1px solid rgba(185, 138, 47, .28);
  border-radius: 22px;
  padding: clamp(22px, 6vw, 36px);
  box-shadow: var(--shadow);
  text-align: right;
}
.field { margin-bottom: 20px; }
.field label {
  display: block;
  font-size: 15px;
  color: var(--emerald);
  margin-bottom: 8px;
}
.field input[type=text], .field select, .field textarea {
  width: 100%;
  font-family: inherit;
  font-size: 16px;
  padding: 12px 16px;
  border: 1px solid rgba(120, 100, 60, .3);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  outline: none;
  transition: border-color .25s, box-shadow .25s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--gold-soft);
  box-shadow: 0 0 0 3px rgba(207, 169, 75, .18);
}
.field textarea { resize: vertical; }

.rsvp-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice {
  display: block;
  text-align: center;
  padding: 14px 10px;
  border: 1.5px solid rgba(120, 100, 60, .25);
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  font-size: clamp(14px, 3.8vw, 16px);
  transition: all .25s ease;
}
.choice input { position: absolute; opacity: 0; }
.choice:has(input:checked) {
  transform: translateY(-2px);
}
.choice-yes:has(input:checked) {
  border-color: var(--emerald-2);
  background: #eaf4ee;
  color: var(--emerald);
  box-shadow: 0 8px 20px rgba(30, 77, 59, .18);
}
.choice-no:has(input:checked) {
  border-color: #b0684f;
  background: #f9eeea;
  color: #8f4a34;
  box-shadow: 0 8px 20px rgba(140, 80, 50, .15);
}

.rsvp-msg {
  margin-top: 16px;
  text-align: center;
  font-size: 16px;
  min-height: 24px;
}
.rsvp-msg.ok  { color: var(--emerald-2); }
.rsvp-msg.err { color: #a3462e; }

/* ─── الخاتمة ─── */

.finale {
  position: relative;
  text-align: center;
  padding: 80px 22px 70px;
  margin-top: 30px;
  background: linear-gradient(180deg, transparent, rgba(30, 77, 59, .06));
  overflow: hidden;
}
.floral-footer {
  bottom: -70px; left: 50%;
  transform: translateX(-50%) scaleY(-1);
  opacity: .3;
  width: clamp(200px, 60vw, 340px);
  z-index: 0;
}
.finale > *:not(.floral) { position: relative; z-index: 1; }
.finale-dua {
  font-size: clamp(16px, 4.4vw, 20px);
  color: var(--ink-soft);
  max-width: 440px;
  margin: 0 auto 26px;
  line-height: 2.2;
}
.finale-monogram {
  font-family: 'Great Vibes', cursive;
  font-size: clamp(46px, 12vw, 64px);
  color: var(--gold);
  line-height: 1.2;
}
.finale-names {
  font-family: 'Cormorant Garamond', serif;
  letter-spacing: 3px;
  font-size: clamp(16px, 4.4vw, 20px);
  color: var(--emerald);
  text-transform: uppercase;
  margin-top: 6px;
}
.finale-date {
  font-family: 'Cormorant Garamond', serif;
  letter-spacing: 5px;
  color: var(--ink-soft);
  margin-top: 8px;
}
.finale-heart {
  margin-top: 28px;
  font-size: clamp(15px, 4vw, 17px);
  color: var(--ink-soft);
}

/* ─── زر الموسيقى ─── */

.music-btn {
  position: fixed;
  bottom: 20px; left: 20px;
  z-index: 50;
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(185, 138, 47, .4);
  background: rgba(255, 253, 246, .9);
  backdrop-filter: blur(6px);
  font-size: 22px;
  color: var(--emerald);
  cursor: pointer;
  box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center;
}
.music-btn.playing .music-on { animation: spin-note 2.4s linear infinite; display: inline-block; }
.music-btn.muted { opacity: .55; }
.music-btn.muted .music-on { text-decoration: line-through; }
@keyframes spin-note {
  0%, 100% { transform: rotate(-12deg); }
  50%      { transform: rotate(12deg); }
}

@media (max-width: 560px) {
  .tl-item { padding: 14px 30px; }

  /* العداد يتقاد مع الشاشات الصغيرة */
  .countdown { gap: 8px; }
  .cd-sep { display: none; }
  .cd-box {
    min-width: 0;
    flex: 1;
    max-width: 86px;
    padding: 12px 4px;
  }
}
