/* ================================================================
   COMPONENTS — gate opener, invitation, countdown, verse, music
   ================================================================ */

/* ── Shared gold-foil text effect ─────────────────────────────── */
.gold-foil {
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ================================================================
   GATE OPENER — photo door split in half, swings open on tap.
   Open sequence classes set by gate.js:
     #gate-scene.opening → doors swing → #gate-scene.opened
   ================================================================ */

.gate-frame {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: flex;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transform-style: preserve-3d;
}
.gate-frame:focus-visible {
  outline: 3px solid var(--gold-bright);
  outline-offset: 12px;
  border-radius: 8px;
}

/* ── Light glow behind doors ───────────────────────────────────── */
.gate-light,
.gate-flash { display: none; }

/* Light crack between the two closed doors */
.gate-frame::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 8%;
  bottom: 3%;
  width: 2px;
  transform: translateX(-50%);
  z-index: 4;
  background: rgba(255, 240, 200, 0.85);
  box-shadow: 0 0 20px 8px rgba(255, 225, 160, 0.5);
  opacity: 0;
  transition: opacity 0.3s ease, width 1.2s ease, box-shadow 1s ease;
  pointer-events: none;
}

/* ── Door leaves — real photo halves, tinted to the site palette ── */
.gate-door {
  flex: 1;
  position: relative;
  z-index: 2;
  overflow: hidden;
  background-size: cover;
  background-repeat: no-repeat;
  transition: transform 1.5s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 1.5s ease;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  box-shadow: 4px 0 25px rgba(0, 0, 0, 0.3);
}
/* Recolors the photo with the theme gradient — mix-blend-mode: color keeps
   the photo's own light/shadow (luminance) but swaps in our hue/saturation */
.gate-door::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(160deg, var(--primary) 0%, var(--gate-trim) 50%, var(--primary-deep) 100%);
  mix-blend-mode: color;
  opacity: 0.65;
  pointer-events: none;
}
.gate-door-left {
  transform-origin: left center;
  background-image: url("../assets/door-left.jpg");
  background-position: right center;
  border-radius: 3px 0 0 3px;
}
.gate-door-right {
  transform-origin: right center;
  background-image: url("../assets/door-right.jpg");
  background-position: left center;
  border-radius: 0 3px 3px 0;
  box-shadow: -4px 0 25px rgba(0, 0, 0, 0.3);
}

/* ── Center ornament (monogram circle) ─────────────────────────── */
.gate-ornament {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 5;
  transform: translate(-50%, -50%);
  width: clamp(64px, 16vw, 96px);
  height: clamp(64px, 16vw, 96px);
  border-radius: 50%;
  background: var(--cream-light);
  border: 2.5px solid var(--gate-trim);
  display: grid;
  place-items: center;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
  transition: opacity 0.4s ease, transform 0.6s ease;
}
.gate-monogram {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 600;
  font-size: clamp(20px, 5vw, 30px);
  color: var(--primary);
}

/* ── Welcome heading ───────────────────────────────────────────── */
.gate-welcome {
  position: absolute;
  top: clamp(16px, 3vh, 36px);
  left: 50%;
  z-index: 2;
  transform: translateX(-50%);
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(22px, 5.5vw, 34px);
  color: var(--cream-light);
  letter-spacing: 0.04em;
  text-align: center;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
  animation: gate-welcome-in 900ms ease both;
  transition: opacity 0.25s ease;
}

/* ── Opening states ────────────────────────────────────────────── */
.gate-scene.opening .gate-door-left  { transform: rotateY(-105deg); box-shadow: 0 0 60px rgba(0,0,0,0.08); }
.gate-scene.opening .gate-door-right { transform: rotateY(105deg);  box-shadow: 0 0 60px rgba(0,0,0,0.08); }
.gate-scene.opening .gate-ornament   { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
.gate-scene.opening .gate-hint       { opacity: 0; }
.gate-scene.opening .gate-welcome    { opacity: 0; }
.gate-scene.opening .gate-frame::after { opacity: 1; width: 160px; box-shadow: 0 0 70px 28px rgba(255, 225, 160, 0.65); }

/* ── Sparkles ──────────────────────────────────────────────────── */
.gate-sparkles {
  position: absolute;
  inset: 0;
  z-index: 101;
  pointer-events: none;
  overflow: hidden;
}
.sparkle {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: radial-gradient(circle, #E8DCC7, #8B5C3A);
  animation: sparkle-burst var(--dur, 1s) ease-out forwards;
  pointer-events: none;
}

/* ── Tap hint ──────────────────────────────────────────────────── */
.gate-hint {
  position: absolute;
  bottom: clamp(24px, 5vh, 56px);
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  animation: tap-hint-float 1.6s ease-in-out infinite;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: opacity 0.25s ease;
}
.gate-hint-icon {
  display: block;
  width: clamp(26px, 7vw, 32px);
  height: auto;
  color: var(--cream-light);
  filter: drop-shadow(0 1px 6px rgba(0, 0, 0, 0.3));
}
.gate-hint-text {
  display: block;
  margin-top: 6px;
  font-family: var(--kufi);
  font-size: clamp(11px, 3vw, 14px);
  color: var(--cream-light);
  white-space: nowrap;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}

/* ================================================================
   INVITATION CONTENT
   ================================================================ */

.hero {
  width: min(92vw, 520px);
  text-align: center;
}

.inner { position: relative; z-index: 1; }

/* ── Bismillah ────────────────────────────────────────────────── */
.bismillah {
  font-family: var(--ar-display);
  font-size: clamp(22px, 6.2vw, 34px);
  line-height: 1.4;
  margin-bottom: 0.5em;
}

/* ── Ornamental divider (inline SVG flourish) ─────────────────── */
.orn {
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--gold);
  margin: clamp(16px, 3.4vw, 26px) auto;
  line-height: 0;
  width: 100%;
}
.orn svg { width: clamp(150px, 56%, 230px); height: auto; }

/* ── Eyebrow label ────────────────────────────────────────────── */
.eyebrow {
  font-family: var(--kufi);
  text-transform: uppercase;
  letter-spacing: 0.36em;
  font-size: clamp(9px, 2.4vw, 11px);
  color: var(--text-eyebrow);
  margin-bottom: 1.1em;
}

/* ── Names ────────────────────────────────────────────────────── */
.names { margin: clamp(6px, 1.6vw, 12px) auto 0; text-align: center; }

.name-ar {
  font-family: var(--ar-display);
  font-size: clamp(40px, 12vw, 72px);
  line-height: 1.05;
  color: var(--text-name-ar);
}
.name-ar + .name-en { margin-bottom: 0.5em; }
.name-en {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: 0.04em;
  font-size: clamp(17px, 4.4vw, 24px);
  color: var(--text-name-en);
  text-transform: uppercase;
  margin-top: 0.2em;
}
.amp {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(22px, 6vw, 34px);
  color: var(--text-amp);
  margin: clamp(6px, 1.6vw, 12px) 0;
  line-height: 1;
}
.amp::before,
.amp::after {
  content: "";
  width: clamp(36px, 10vw, 64px);
  height: 1px;
  background: var(--gold);
  opacity: 0.7;
}

/* ── Invitation line ──────────────────────────────────────────── */
.invite-line {
  font-size: clamp(15px, 3.6vw, 19px);
  font-style: italic;
  color: var(--text-invite-line);
  max-width: 100%;
  margin: clamp(24px, 5vw, 36px) auto 0;
  line-height: 1.75;
  text-wrap: balance;
}
.invite-line .ar {
  font-family: var(--ar-body);
  font-style: normal;
  display: block;
  font-size: 1.08em;
  margin-bottom: 0.55em;
  color: var(--text-verse-ar);
}

/* ── Section label pill ───────────────────────────────────────── */
.section-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--primary);
  font-family: var(--kufi);
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: clamp(9px, 2.3vw, 11px);
  color: var(--text-section-label);
  margin-bottom: clamp(14px, 3vw, 20px);
}
.section-label svg { flex-shrink: 0; }

/* ── When / Where detail grid ────────────────────────────────── */
.details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: clamp(24px, 5vw, 36px) 0 clamp(20px, 4vw, 30px);
}
.detail-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0 clamp(8px, 2.5vw, 16px);
}
.detail-col + .detail-col { border-left: 1px solid rgba(139, 92, 58, 0.4); }
.detail-col .date-main,
.detail-col .venue-name { font-size: clamp(17px, 4.2vw, 22px); }
@media (max-width: 380px) {
  .details-grid { grid-template-columns: 1fr; row-gap: clamp(18px, 5vw, 26px); }
  .detail-col + .detail-col {
    border-left: 0;
    border-top: 1px solid rgba(139, 92, 58, 0.4);
    padding-top: clamp(18px, 5vw, 26px);
  }
}

/* ── Date ─────────────────────────────────────────────────────── */
.date-main { font-size: clamp(20px, 5.2vw, 30px); letter-spacing: 0.02em; color: var(--text-date-main); }
.date-main .ar { font-family: var(--ar-display); display: block; font-size: 1.15em; margin-bottom: 0.15em; }
.date-time {
  font-family: var(--kufi);
  letter-spacing: 0.18em;
  font-size: clamp(11px, 2.8vw, 13px);
  color: var(--text-date-time);
  text-transform: uppercase;
  margin-top: 0.5em;
}
.date-time .ar { font-family: var(--ar-body); letter-spacing: 0; font-size: 1.25em; display: block; margin-bottom: 0.2em; }

/* ── Detail link ──────────────────────────────────────────────── */
.detail-link {
  display: inline-block;
  margin-top: 6px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--gold);
  padding: 0 0 2px;
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.25s ease, border-color 0.25s ease;
}
.detail-link:hover { color: var(--clay); border-color: var(--clay); }
.detail-link:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.detail-link[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }

/* ── Venue ────────────────────────────────────────────────────── */
.venue-name { font-size: clamp(19px, 4.8vw, 26px); color: var(--text-venue-name); }
.venue-name .ar { font-family: var(--ar-display); display: block; font-size: 1.1em; }
.venue-addr { color: var(--text-venue-addr); font-size: clamp(14px, 3.4vw, 17px); margin-top: 0.3em; }
.venue-addr .ar { font-family: var(--ar-body); display: block; font-size: 1.1em; }

/* ── Buttons ──────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 26px;
  border: 1.5px solid var(--gold);
  background: transparent;
  color: var(--ink);
  font-family: var(--kufi);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: clamp(10px, 2.6vw, 12px);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.35s ease, color 0.35s ease, transform 0.25s ease;
  border-radius: 999px;
  min-height: 46px;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover  { background: var(--clay-gradient); color: var(--cream-light); transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.btn svg { flex-shrink: 0; }

/* ── Countdown ────────────────────────────────────────────────── */
.countdown {
  display: flex;
  justify-content: center;
  gap: clamp(4px, 2vw, 14px);
  flex-wrap: nowrap;
  direction: ltr;
  margin-top: clamp(20px, 4vw, 30px);
}
.cd-unit {
  min-width: clamp(52px, 15vw, 74px);
  padding: 10px 6px 8px;
  border-radius: 10px;
  background: var(--primary);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}
.cd-num {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(26px, 7vw, 40px);
  line-height: 1;
  color: var(--text-cd-num);
  font-variant-numeric: tabular-nums;
}
.cd-label {
  font-family: var(--kufi);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: clamp(7px, 1.9vw, 9px);
  color: var(--text-cd-lbl);
  margin-top: 0.7em;
}
.cd-sep {
  align-self: center;
  font-size: clamp(20px, 6vw, 30px);
  color: var(--gold);
  line-height: 1;
  margin-bottom: 1.1em;
}
@media (max-width: 340px) { .cd-sep { display: none; } }
.cd-num-accent { color: var(--gold-bright); }

/* ── Verse block ──────────────────────────────────────────────── */
.verse {
  position: relative;
  padding: clamp(20px, 4.5vw, 30px) clamp(10px, 3vw, 20px);
  background:
    repeating-linear-gradient(45deg, rgba(139, 92, 58, .05) 0 1px, transparent 1px 14px),
    rgba(139, 92, 58, 0.04);
  border-top:    1px solid rgba(139, 92, 58, 0.32);
  border-bottom: 1px solid rgba(139, 92, 58, 0.32);
}
.verse .ar  { font-family: var(--ar-body); font-size: clamp(18px, 4.8vw, 26px); line-height: 2; color: var(--text-verse-ar); }
.verse .en  { font-style: italic; color: var(--text-verse-en); font-size: clamp(14px, 3.4vw, 17px); max-width: 36ch; margin: 1em auto 0; line-height: 1.55; text-wrap: balance; }
.verse .ref { font-family: var(--kufi); letter-spacing: 0.24em; text-transform: uppercase; font-size: clamp(9px, 2.2vw, 11px); color: var(--text-verse-ref); margin-top: 1.1em; }

/* ── Blessing box ─────────────────────────────────────────────── */
.blessing {
  position: relative;
  margin: clamp(26px, 5vw, 38px) 0 0;
  padding: clamp(28px, 6vw, 40px) clamp(14px, 4vw, 26px) clamp(22px, 5vw, 32px);
  border: 1px solid rgba(139, 92, 58, 0.5);
}
.blessing-label {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  padding: 4px 14px;
  border: 1px solid rgba(139, 92, 58, 0.5);
  border-radius: 999px;
  background: var(--cream-light);
  font-family: var(--kufi);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--gold);
}
.blessing .verse { background: none; border: none; padding: 0; }
.blessing .verse .ref { color: var(--text-verse-ref); }

/* ── Hashtag ──────────────────────────────────────────────────── */
.hashtag {
  font-family: var(--kufi);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-size: clamp(11px, 2.8vw, 13px);
  color: var(--gold);
}

/* ── Petals ───────────────────────────────────────────────────── */
.petal {
  position: absolute;
  top: -6%;
  width: 18px; height: 16px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cdefs%3E%3CradialGradient id='g' cx='35%25' cy='30%25' r='75%25'%3E%3Cstop offset='0' stop-color='%23F4B4C4'/%3E%3Cstop offset='.55' stop-color='%23E8958F'/%3E%3Cstop offset='1' stop-color='%23D4726A'/%3E%3C/radialGradient%3E%3C/defs%3E%3Cpath fill='url(%23g)' d='M12 21s-6.7-4.4-9.3-8.4C.5 9.2 2.4 4.5 6.6 4.5c2 0 3.6 1.1 5.4 3 1.8-1.9 3.4-3 5.4-3 4.2 0 6.1 4.7 3.9 8.1C18.7 16.6 12 21 12 21z'/%3E%3Cellipse cx='8.2' cy='8.2' rx='2.2' ry='1.3' fill='white' opacity='.55' transform='rotate(-25 8.2 8.2)'/%3E%3C/svg%3E") center / contain no-repeat;
  border-radius: 0;
  opacity: 0;
  will-change: transform;
  animation: petal-fall linear infinite;
}

/* ── Back-to-top button ───────────────────────────────────────── */
.scroll-top {
  position: fixed;
  z-index: 60;
  left: max(16px, 3vw);
  bottom: max(16px, 3vw);
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 1.5px solid var(--gold);
  background: rgba(255, 252, 247, 0.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 22px -8px rgba(92, 64, 51, 0.3);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.35s ease, transform 0.35s ease;
  -webkit-tap-highlight-color: transparent;
}
.scroll-top.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.scroll-top:hover   { background: var(--cream-light); }
.scroll-top:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* ── Toast ────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  z-index: 80;
  left: 50%;
  bottom: calc(max(16px, 3vw) + 62px);
  transform: translate(-50%, 12px);
  max-width: min(84vw, 340px);
  padding: 12px 20px;
  border-radius: 999px;
  background: rgba(92, 64, 51, 0.94);
  color: var(--cream-light);
  font-family: var(--kufi);
  font-size: clamp(11px, 2.6vw, 13px);
  letter-spacing: 0.06em;
  text-align: center;
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ── Music toggle button — minimal equalizer glyph ──────────────── */
.music-btn {
  width: 50px; height: 50px;
  border-radius: 50%;
  border: none;
  -webkit-tap-highlight-color: transparent;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px -6px rgba(46, 27, 18, 0.25);
  transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.6s ease 1.8s;
  opacity: 0;
}
.music-btn.ready   { opacity: 1; }
.music-btn:hover   { transform: scale(1.06); box-shadow: 0 8px 22px -6px rgba(46, 27, 18, 0.32); }
.music-btn:active  { transform: scale(0.96); }
.music-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.eq {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3.5px;
  height: 18px;
}
.eq-bar {
  width: 3px;
  height: 7px;
  border-radius: 2px;
  background: currentColor;
  opacity: 0.55;
  transition: height 0.3s ease, opacity 0.3s ease;
}
.music-btn.playing .eq-bar { opacity: 1; }
.music-btn.playing .eq-bar:nth-child(1) { animation: eq-bounce 0.9s ease-in-out infinite; animation-delay: -0.6s; }
.music-btn.playing .eq-bar:nth-child(2) { animation: eq-bounce 0.9s ease-in-out infinite; animation-delay: -0.3s; }
.music-btn.playing .eq-bar:nth-child(3) { animation: eq-bounce 0.9s ease-in-out infinite; animation-delay: -0.75s; }
.music-btn.playing .eq-bar:nth-child(4) { animation: eq-bounce 0.9s ease-in-out infinite; animation-delay: -0.15s; }
