/* ============================================================
   Abdul Ali & Aysha Reem — Nikah Invitation
   Cream / Ivory + Gold edition — compact, animated, mobile-first
   ============================================================ */

:root {
  --cream: #FBF4E8;
  --cream-2: #F5E9D7;
  --cream-3: #EFDFC7;
  --ivory: #FFFCF6;
  --blush: #F6E3DA;
  --sand: #E8D5B5;

  --gold: #C8A24A;
  --gold-deep: #A57C2B;
  --gold-soft: #E3C77F;
  --gold-pale: #F7E7BC;

  --rose: #B26B62;
  --maroon: #7C2F3A;
  --ink: #4A3526;
  --ink-soft: #6E5643;
  --muted: rgba(74, 53, 38, .68);

  --line: rgba(200, 162, 74, .38);
  --line-soft: rgba(200, 162, 74, .2);
  --glass: rgba(255, 252, 246, .72);
  --shadow-s: 0 4px 14px rgba(124, 47, 58, .07);
  --shadow-m: 0 10px 30px rgba(124, 47, 58, .10);
  --shadow-l: 0 18px 48px rgba(124, 47, 58, .14);

  --radius: 20px;
  --radius-s: 14px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  background: var(--cream);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100svh;
  overflow-x: hidden;
  color: var(--ink);
  font-family: "Cormorant Garamond", "Playfair Display", serif;
  background:
    radial-gradient(circle at 50% -5%, rgba(247, 231, 188, .9), transparent 42%),
    radial-gradient(circle at 8% 14%, rgba(246, 227, 218, .8), transparent 34%),
    radial-gradient(circle at 94% 22%, rgba(232, 213, 181, .65), transparent 32%),
    radial-gradient(circle at 50% 104%, rgba(243, 224, 199, .9), transparent 46%),
    linear-gradient(160deg, #FFFCF6 0%, #FBF4E8 30%, #F6EADA 65%, #FAF2E4 100%);
}

body.locked { overflow: hidden; }

/* Paper grain + soft vignette */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .5;
  background:
    repeating-linear-gradient(122deg, rgba(165, 124, 43, .035) 0, rgba(165, 124, 43, .035) 1px, transparent 1px, transparent 6px),
    radial-gradient(circle at 30% 20%, rgba(200, 162, 74, .06), transparent 30%),
    radial-gradient(circle at 78% 74%, rgba(178, 107, 98, .05), transparent 30%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 52%, rgba(165, 124, 43, .07) 82%, rgba(124, 47, 58, .1) 100%);
}

/* ---------------- Halo & floating dust ---------------- */
.moon {
  position: fixed;
  top: -20vw;
  left: 50%;
  width: min(680px, 96vw);
  height: min(680px, 96vw);
  transform: translateX(-50%);
  z-index: 1;
  pointer-events: none;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(247, 231, 188, .85), rgba(232, 213, 181, .32) 40%, transparent 68%);
  filter: blur(2px);
  animation: moonGlow 9s ease-in-out infinite alternate;
}

@keyframes moonGlow {
  from { opacity: .55; transform: translateX(-50%) scale(.95); }
  to   { opacity: .95; transform: translateX(-50%) scale(1.05); }
}

.ambient {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(200, 162, 74, .85);
  box-shadow: 0 0 10px rgba(200, 162, 74, .6);
  animation: floatParticle linear infinite;
}

.particle.petal {
  width: 9px;
  height: 9px;
  border-radius: 60% 10% 60% 10%;
  background: linear-gradient(135deg, rgba(246, 227, 218, .95), rgba(178, 107, 98, .55));
  box-shadow: 0 2px 6px rgba(124, 47, 58, .12);
}

@keyframes floatParticle {
  0%   { transform: translate3d(0, 108vh, 0) rotate(0deg) scale(.7); opacity: 0; }
  12%  { opacity: 1; }
  88%  { opacity: 1; }
  100% { transform: translate3d(var(--drift, 40px), -12vh, 0) rotate(320deg) scale(1.05); opacity: 0; }
}

/* ---------------- Layout ---------------- */
.page {
  position: relative;
  z-index: 3;
  padding: 18px 12px calc(104px + var(--safe-bottom));
}

.shell {
  position: relative;
  width: 100%;
  max-width: 660px;
  margin: 0 auto;
  padding: 26px 18px 30px;
  border-radius: var(--radius);
  background: linear-gradient(165deg, rgba(255, 252, 246, .92), rgba(251, 244, 232, .86));
  border: 1px solid var(--line);
  box-shadow: var(--shadow-l), inset 0 0 0 1px rgba(255, 255, 255, .7);
  overflow: hidden;
  animation: shellIn 1s cubic-bezier(.2, .8, .25, 1) both;
}

@keyframes shellIn {
  from { opacity: 0; transform: translateY(26px) scale(.985); }
  to   { opacity: 1; transform: none; }
}

.shell::before {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: calc(var(--radius) - 7px);
  border: 1px solid var(--line-soft);
  pointer-events: none;
}

/* shimmer sweep across the card */
.shell::after {
  content: "";
  position: absolute;
  top: -60%;
  left: -45%;
  width: 45%;
  height: 220%;
  pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .55), transparent);
  transform: rotate(12deg);
  animation: sweep 7.5s ease-in-out infinite;
}

@keyframes sweep {
  0%, 62% { left: -45%; opacity: 0; }
  70%     { opacity: .9; }
  100%    { left: 120%; opacity: 0; }
}

section { position: relative; z-index: 2; }

/* ---------------- Hero ---------------- */
.hero {
  position: relative;
  text-align: center;
  padding: 6px 2px 8px;
}

.arch {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: min(300px, 84%);
  height: 260px;
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: 50% 50% 0 0 / 62% 62% 0 0;
  opacity: .55;
  pointer-events: none;
  animation: archBreathe 6s ease-in-out infinite alternate;
}

.arch::before {
  content: "";
  position: absolute;
  inset: 9px 9px 0;
  border: 1px solid var(--line-soft);
  border-bottom: none;
  border-radius: 50% 50% 0 0 / 62% 62% 0 0;
}

.arch::after {
  content: "\2726";
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  font-size: .9rem;
  color: var(--gold);
  animation: twinkle 3s ease-in-out infinite;
}

@keyframes archBreathe {
  from { opacity: .4;  transform: translateX(-50%) scaleY(1); }
  to   { opacity: .75; transform: translateX(-50%) scaleY(1.03); }
}

.arabic {
  font-family: "Amiri", "Cormorant Garamond", serif;
  direction: rtl;
  line-height: 1.85;
}

.bismillah {
  font-size: clamp(1.15rem, 5.4vw, 1.6rem);
  color: var(--gold-deep);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .8);
  animation: fadeUp .9s .1s ease both;
}

.subtitle {
  margin-top: 5px;
  font-size: clamp(.68rem, 2.9vw, .8rem);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  animation: fadeUp .9s .2s ease both;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 14px 0 6px;
  font-family: "Cinzel", serif;
  font-size: clamp(.6rem, 2.6vw, .7rem);
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--gold-deep);
  animation: fadeUp .9s .3s ease both;
}

.eyebrow::before,
.eyebrow::after {
  content: "";
  width: 32px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold));
}

.eyebrow::after { background: linear-gradient(90deg, var(--gold), transparent); }

.names {
  position: relative;
  padding: 4px 0 2px;
}

.name {
  font-family: "Great Vibes", cursive;
  font-weight: 400;
  font-size: clamp(2.4rem, 12vw, 3.6rem);
  /* Great Vibes has tall ascenders and long tails — give the glyphs
     room so the gradient text-clip never cuts them off. */
  line-height: 1.5;
  padding: .12em 0 .18em;
  margin: -.14em 0 -.12em;
  overflow: visible;
  background: linear-gradient(100deg, var(--gold-deep) 0%, #D9B45F 26%, #7C2F3A 50%, #D9B45F 74%, var(--gold-deep) 100%);
  background-size: 260% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: goldFlow 7s linear infinite, fadeUp 1s .35s ease both;
  filter: drop-shadow(0 2px 4px rgba(124, 47, 58, .12));
}

@keyframes goldFlow {
  from { background-position: 0% 50%; }
  to   { background-position: 260% 50%; }
}

.lineage {
  margin-top: 1px;
  font-size: clamp(.72rem, 3.1vw, .86rem);
  letter-spacing: .07em;
  color: var(--ink-soft);
  font-style: italic;
  animation: fadeUp 1s .45s ease both;
}

.amp {
  display: block;
  margin: 8px auto;
  font-family: "Playfair Display", serif;
  font-size: clamp(1.2rem, 5.2vw, 1.6rem);
  color: var(--rose);
  animation: ampBeat 2.6s ease-in-out infinite;
}

@keyframes ampBeat {
  0%, 100% { transform: scale(1);    opacity: .82; }
  50%      { transform: scale(1.16); opacity: 1; }
}

.crest {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 14px;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: radial-gradient(circle, var(--ivory), var(--cream-2));
  box-shadow: var(--shadow-s), inset 0 0 12px rgba(200, 162, 74, .18);
  animation: fadeUp 1s .55s ease both;
}

.crest::before,
.crest::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1px dashed rgba(200, 162, 74, .5);
}

.crest::before { inset: -8px; animation: spinRight 16s linear infinite; }
.crest::after {
  inset: 6px;
  border-style: solid;
  border-color: rgba(200, 162, 74, .3);
  animation: spinLeft 12s linear infinite;
}

.crest span {
  font-family: "Cinzel", serif;
  font-size: .62rem;
  letter-spacing: .14em;
  color: var(--gold-deep);
}

.sparkle {
  position: absolute;
  font-size: .78rem;
  color: var(--gold);
  opacity: 0;
  animation: twinkle 3.4s ease-in-out infinite;
  pointer-events: none;
}

.s1 { top: 10%;    left: 6%;   animation-delay: .2s; }
.s2 { top: 34%;    right: 7%;  animation-delay: .9s; }
.s3 { bottom: 18%; left: 13%;  animation-delay: 1.6s; }
.s4 { bottom: 30%; right: 16%; animation-delay: 2.1s; }

@keyframes twinkle {
  0%, 100% { opacity: 0; transform: scale(.6) rotate(0deg); }
  50%      { opacity: 1; transform: scale(1.2) rotate(90deg); }
}

/* ---------------- Dividers ---------------- */
.divider {
  position: relative;
  height: 1px;
  margin: 20px auto;
  width: 88%;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
}

.divider::after {
  content: "\2756";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 0 9px;
  font-size: .68rem;
  color: var(--gold);
  background: var(--cream);
  animation: pulseDot 3.2s ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: .55; transform: translate(-50%, -50%) scale(.9); }
  50%      { opacity: 1;   transform: translate(-50%, -50%) scale(1.15); }
}

.ornament { display: none; }

/* ---------------- Verse / dua cards ---------------- */
.section-card,
.dua-card {
  position: relative;
  padding: 18px 16px;
  border-radius: var(--radius-s);
  border: 1px solid var(--line-soft);
  background: linear-gradient(160deg, var(--ivory), rgba(245, 233, 215, .8));
  box-shadow: var(--shadow-s);
  text-align: center;
  overflow: hidden;
}

.section-card::before,
.dua-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 40%, rgba(255, 255, 255, .6) 50%, transparent 60%);
  transform: translateX(-100%);
  animation: cardShine 6s ease-in-out infinite;
  pointer-events: none;
}

@keyframes cardShine {
  0%, 70% { transform: translateX(-100%); }
  100%    { transform: translateX(100%); }
}

.verse-arabic {
  font-size: clamp(1rem, 4.6vw, 1.3rem);
  color: var(--maroon);
  line-height: 2;
}

.reference,
.attribution,
.card-label,
.card-sub,
.countdown-title,
.time-label,
.closing-en {
  font-family: "Cinzel", serif;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.reference {
  margin-top: 9px;
  font-size: .6rem;
  color: var(--gold-deep);
}

.translation {
  margin-top: 10px;
  font-size: clamp(.86rem, 3.6vw, .98rem);
  line-height: 1.62;
  color: var(--ink-soft);
}

.attribution {
  margin-top: 8px;
  font-size: .55rem;
  color: var(--muted);
}

/* ---------------- Info cards ---------------- */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

.info-card,
.time-tile {
  position: relative;
  border-radius: var(--radius-s);
  border: 1px solid var(--line-soft);
  background: linear-gradient(165deg, var(--ivory), var(--cream-2));
  box-shadow: var(--shadow-s);
  overflow: hidden;
  transition: transform .35s cubic-bezier(.2, .8, .25, 1), box-shadow .35s ease;
}

.info-card {
  padding: 14px 6px;
  text-align: center;
}

.info-card::after,
.time-tile::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: .8;
}

.info-card:hover,
.info-card:active {
  transform: translateY(-4px);
  box-shadow: var(--shadow-m);
}

.card-label {
  font-size: .5rem;
  color: var(--gold-deep);
}

.card-main {
  margin-top: 6px;
  font-family: "Playfair Display", serif;
  font-size: clamp(.95rem, 4.2vw, 1.18rem);
  color: var(--maroon);
  line-height: 1.2;
}

.card-sub {
  margin-top: 4px;
  font-size: .54rem;
  color: var(--ink-soft);
}

.blessing-ar {
  font-size: clamp(1rem, 4.4vw, 1.2rem);
  color: var(--gold-deep);
}

/* ---------------- Countdown ---------------- */
.countdown-title {
  text-align: center;
  font-size: clamp(.7rem, 3vw, .82rem);
  color: var(--gold-deep);
}

.countdown-subtitle {
  margin-top: 5px;
  text-align: center;
  font-size: clamp(.8rem, 3.3vw, .9rem);
  font-style: italic;
  color: var(--muted);
}

.countdown-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  margin-top: 13px;
}

.time-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 12px 2px 10px;
  animation: tilePulse 3.6s ease-in-out infinite;
}

.time-tile:nth-child(2) { animation-delay: .25s; }
.time-tile:nth-child(3) { animation-delay: .5s; }
.time-tile:nth-child(4) { animation-delay: .75s; }

@keyframes tilePulse {
  0%, 100% { box-shadow: var(--shadow-s); }
  50%      { box-shadow: 0 8px 22px rgba(200, 162, 74, .22); }
}

.time-value {
  font-family: "Cinzel", serif;
  font-weight: 600;
  font-size: clamp(1.15rem, 6vw, 1.6rem);
  color: var(--maroon);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .9);
  transition: transform .25s ease;
}

.time-value.tick { animation: tickPop .5s ease; }

@keyframes tickPop {
  0%   { transform: translateY(0)    scale(1); }
  35%  { transform: translateY(-3px) scale(1.1); color: var(--gold-deep); }
  100% { transform: translateY(0)    scale(1); }
}

.time-label {
  font-size: .48rem;
  color: var(--gold-deep);
}

.finished {
  display: none;
  margin-top: 14px;
  padding: 14px 12px;
  text-align: center;
  border-radius: var(--radius-s);
  border: 1px solid var(--line);
  background: linear-gradient(160deg, var(--gold-pale), var(--cream-2));
}

.finished.show {
  display: block;
  animation: riseIn .8s ease both;
}

.finished h3 {
  font-family: "Great Vibes", cursive;
  font-weight: 400;
  font-size: clamp(1.3rem, 6vw, 1.7rem);
  color: var(--maroon);
}

.finished p {
  margin-top: 5px;
  font-size: .86rem;
  color: var(--ink-soft);
}

@keyframes riseIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

/* ---------------- Families ---------------- */
.families-title {
  text-align: center;
  font-family: "Cinzel", serif;
  font-size: clamp(.7rem, 3vw, .82rem);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

.families-subtitle {
  margin-top: 5px;
  text-align: center;
  font-size: clamp(.8rem, 3.3vw, .9rem);
  font-style: italic;
  color: var(--muted);
}

/* Explicit track: without it the auto column collapses to max-content and
   the card never uses the width the phone actually has. */
.family-grid {
  display: grid;
  grid-template-columns: min(420px, 100%);
  justify-content: center;
  margin-top: 14px;
}

.family-grid .family-card {
  width: 100%;
}

.family-card {
  position: relative;
  padding: 15px 12px 14px;
  border-radius: var(--radius-s);
  border: 1px solid var(--line-soft);
  background: linear-gradient(165deg, var(--ivory), var(--cream-2));
  box-shadow: var(--shadow-s);
  text-align: center;
  overflow: hidden;
  transition: transform .35s cubic-bezier(.2, .8, .25, 1), box-shadow .35s ease;
}

.family-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: .8;
}

.family-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg, transparent 40%, rgba(255, 255, 255, .55) 50%, transparent 60%);
  transform: translateX(-100%);
  animation: cardShine 7s ease-in-out infinite;
}


.family-card:hover,
.family-card:active {
  transform: translateY(-4px);
  box-shadow: var(--shadow-m);
}

.family-side {
  font-family: "Cinzel", serif;
  font-size: .5rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

.family-list {
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid var(--line-soft);
  list-style: none;
  display: grid;
  gap: 7px;
}

.family-list li {
  display: grid;
  gap: 1px;
  animation: fadeUp .7s ease both;
}

.family-list li:nth-child(2) { animation-delay: .08s; }
.family-list li:nth-child(3) { animation-delay: .16s; }
.family-list li:nth-child(4) { animation-delay: .24s; }
.family-list li:nth-child(5) { animation-delay: .32s; }
.family-list li:nth-child(6) { animation-delay: .4s; }

.family-role {
  font-family: "Cinzel", serif;
  font-size: .44rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold-deep);
  opacity: .85;
}

.family-name {
  font-size: clamp(.82rem, 3.4vw, .94rem);
  line-height: 1.4;
  color: var(--ink);
  /* long names must break between words, never mid-word, and wrap into
     even lines rather than leaving one word stranded */
  overflow-wrap: break-word;
  hyphens: none;
  text-wrap: pretty;
  padding: 0 2px;
}

.family-alias {
  font-style: italic;
  color: var(--ink-soft);
}

/* ---------------- Romance lines ---------------- */
.romance-lines {
  display: grid;
  gap: 8px;
  text-align: center;
}

.romance-line {
  font-size: clamp(.88rem, 3.7vw, 1rem);
  font-style: italic;
  color: var(--ink-soft);
  line-height: 1.5;
}

.romance-line.gold {
  font-family: "Great Vibes", cursive;
  font-style: normal;
  font-size: clamp(1.15rem, 5.4vw, 1.45rem);
  color: var(--gold-deep);
}

/* ---------------- Dua ---------------- */
.dua-ar {
  font-size: clamp(1rem, 4.6vw, 1.26rem);
  color: var(--maroon);
  line-height: 2;
}

.dua-en {
  margin-top: 9px;
  font-size: clamp(.85rem, 3.5vw, .96rem);
  font-style: italic;
  color: var(--ink-soft);
  line-height: 1.55;
}

/* ---------------- Closing ---------------- */
.closing {
  text-align: center;
  padding-top: 2px;
}

.closing-ar {
  font-size: clamp(1.4rem, 7vw, 1.9rem);
  color: var(--gold-deep);
  animation: glowPulse 4s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% { opacity: .78; text-shadow: none; }
  50%      { opacity: 1;   text-shadow: 0 0 18px rgba(200, 162, 74, .5); }
}

.closing-en {
  margin-top: 8px;
  font-size: .58rem;
  color: var(--gold-deep);
}

.footer-text {
  margin-top: 8px;
  font-size: clamp(.82rem, 3.4vw, .92rem);
  font-style: italic;
  color: var(--muted);
  line-height: 1.55;
}

/* ---------------- Controls ---------------- */
.controls {
  position: fixed;
  left: 50%;
  bottom: calc(12px + var(--safe-bottom));
  transform: translateX(-50%);
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 252, 246, .88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-m);
  max-width: calc(100vw - 20px);
  animation: fadeUp .8s .8s ease both;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 7px;
}

.actions { gap: 6px; }

.lux-btn,
.audio-label {
  font-family: "Cinzel", serif;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.lux-btn {
  position: relative;
  padding: 8px 13px;
  font-size: .55rem;
  color: var(--maroon);
  border-radius: 999px;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, var(--ivory), var(--cream-2));
  cursor: pointer;
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease, color .25s ease;
}

.lux-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 35%, rgba(255, 255, 255, .8) 50%, transparent 65%);
  transform: translateX(-110%);
  transition: transform .6s ease;
}

.lux-btn:hover::after,
.lux-btn:active::after { transform: translateX(110%); }

.lux-btn.circle {
  width: 36px;
  height: 36px;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: .9rem;
  color: var(--gold-deep);
}

.lux-btn.circle.playing { animation: notePulse 1.8s ease-in-out infinite; }

@keyframes notePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(200, 162, 74, .45); }
  60%      { box-shadow: 0 0 0 10px rgba(200, 162, 74, 0); }
}

.lux-btn:hover,
.lux-btn:active {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(200, 162, 74, .28);
}

.audio-label {
  font-size: .45rem;
  color: var(--muted);
  max-width: 74px;
  line-height: 1.25;
}

/* ---------------- Share card (offscreen render) ---------------- */
.share-card {
  position: fixed;
  top: 0;
  left: -9999px;
  width: 720px;
  padding: 44px 40px;
  z-index: -1;
  opacity: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 0%, rgba(247, 231, 188, .9), transparent 45%),
    linear-gradient(160deg, #FFFCF6 0%, #FBF4E8 45%, #F4E6D2 100%);
  color: var(--ink);
  text-align: center;
}

.share-card.ready { opacity: 1; }

.share-inner {
  position: relative;
  padding: 34px 28px;
  border-radius: 24px;
  border: 2px solid var(--gold);
  box-shadow: inset 0 0 0 1px rgba(200, 162, 74, .35);
  background: linear-gradient(165deg, rgba(255, 252, 246, .96), rgba(245, 233, 215, .9));
}

.share-bismillah {
  font-family: "Amiri", serif;
  direction: rtl;
  font-size: 1.6rem;
  color: var(--gold-deep);
}

.share-name {
  margin-top: 14px;
  font-family: "Great Vibes", cursive;
  font-size: 3.2rem;
  color: var(--maroon);
  line-height: 1.35;
}

.share-lineage {
  font-size: 1rem;
  font-style: italic;
  color: var(--ink-soft);
}

.share-amp {
  margin: 8px 0;
  font-size: 1.6rem;
  color: var(--rose);
}

.share-barakah {
  margin-top: 18px;
  font-family: "Amiri", serif;
  direction: rtl;
  font-size: 2rem;
  color: var(--gold-deep);
}

.share-short {
  margin-top: 8px;
  font-size: 1.05rem;
  font-style: italic;
  color: var(--ink-soft);
}

.share-count-title {
  margin-top: 22px;
  font-family: "Cinzel", serif;
  font-size: .78rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

.share-count-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.share-tile {
  padding: 14px 4px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(165deg, #FFFCF6, #F2E4CE);
}

.share-val {
  display: block;
  font-family: "Cinzel", serif;
  font-weight: 600;
  font-size: 1.6rem;
  color: var(--maroon);
}

.share-lab {
  display: block;
  margin-top: 4px;
  font-family: "Cinzel", serif;
  font-size: .52rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

/* ---------------- Project overlay ---------------- */
.project-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  place-items: center;
  padding: 16px;
  background:
    radial-gradient(circle at 50% 0%, rgba(247, 231, 188, .9), transparent 45%),
    linear-gradient(160deg, #FFFCF6 0%, #F8EFE0 50%, #F2E4CE 100%);
}

.project-overlay.show {
  display: grid;
  animation: fadeUp .5s ease both;
}

.project-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 30%, rgba(200, 162, 74, .12), transparent 30%),
    radial-gradient(circle at 80% 70%, rgba(178, 107, 98, .12), transparent 30%);
  animation: drift 12s ease-in-out infinite alternate;
}

@keyframes drift {
  from { transform: translate3d(-2%, -1%, 0) scale(1); }
  to   { transform: translate3d(2%, 1%, 0) scale(1.06); }
}

.project-panel {
  position: relative;
  width: min(560px, 94vw);
  padding: 30px 20px 26px;
  text-align: center;
  border-radius: var(--radius);
  border: 1px solid var(--gold);
  background: linear-gradient(165deg, rgba(255, 252, 246, .96), rgba(245, 233, 215, .92));
  box-shadow: var(--shadow-l);
  animation: projectIn .6s cubic-bezier(.2, .8, .25, 1) both;
}

@keyframes projectIn {
  from { opacity: 0; transform: translateY(20px) scale(.96); }
  to   { opacity: 1; transform: none; }
}

.project-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  font-size: 1.3rem;
  line-height: 1;
  color: var(--maroon);
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--ivory);
  cursor: pointer;
  transition: transform .25s ease;
}

.project-close:hover { transform: rotate(90deg); }

.project-name {
  font-family: "Great Vibes", cursive;
  font-size: clamp(2rem, 9vw, 2.9rem);
  color: var(--maroon);
  line-height: 1.35;
}

.project-lineage {
  font-size: .82rem;
  font-style: italic;
  color: var(--ink-soft);
}

.project-amp {
  margin: 6px 0;
  font-size: 1.3rem;
  color: var(--rose);
  animation: ampBeat 2.6s ease-in-out infinite;
}

.project-title {
  margin: 16px 0 10px;
  font-family: "Cinzel", serif;
  font-size: .66rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

/* ---------------- Confetti ---------------- */
.confetti-piece {
  position: fixed;
  top: -12vh;
  width: 9px;
  height: 14px;
  border-radius: 2px;
  z-index: 80;
  pointer-events: none;
  animation: confettiFall linear forwards;
}

@keyframes confettiFall {
  to { transform: translateY(118vh) rotate(720deg); opacity: 0; }
}

.capturing .controls {
  opacity: 0;
  pointer-events: none;
}

/* ---------------- Royal doors ---------------- */
#door-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(160deg, #FBF4E8, #F2E4CE);
  transition: opacity .8s ease, visibility .8s ease;
  contain: layout paint;
}

#door-screen.hidden {
  opacity: 0;
  visibility: hidden;
}

.door {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50.6%;
  background:
    repeating-linear-gradient(90deg, rgba(200, 162, 74, .07) 0 2px, transparent 2px 16px),
    linear-gradient(165deg, #FFFCF6 0%, #F6EADA 40%, #EFDFC7 100%);
  box-shadow: inset 0 0 60px rgba(200, 162, 74, .18);
  /* Promote each door to its own compositor layer so the slide is a pure
     GPU transform — no repaint of the filigree while it moves. */
  transform: translate3d(0, 0, 0);
  will-change: transform;
  backface-visibility: hidden;
  transition: transform 2.1s cubic-bezier(.62, .02, .3, 1);
}

.door-texture {
  position: absolute;
  inset: 22px;
  border: 2px solid rgba(200, 162, 74, .45);
  border-radius: 160px 160px 12px 12px;
  box-shadow: inset 0 0 0 6px rgba(255, 255, 255, .55), inset 0 0 28px rgba(200, 162, 74, .16);
}

.door-texture::before {
  content: "";
  position: absolute;
  inset: 16px;
  border: 1px solid rgba(200, 162, 74, .3);
  border-radius: 150px 150px 8px 8px;
}

.door-texture::after {
  content: "\2726";
  position: absolute;
  top: 14%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.2rem;
  color: rgba(200, 162, 74, .55);
  animation: twinkle 3.2s ease-in-out infinite;
}

.door-left  { left: 0;  border-right: 1px solid rgba(200, 162, 74, .4); }
.door-right { right: 0; border-left: 1px solid rgba(200, 162, 74, .4); }

.door-edge-right,
.door-edge-left {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 8px;
  background: linear-gradient(90deg, rgba(200, 162, 74, .5), rgba(247, 231, 188, .9));
}

.door-edge-right { right: 0; }
.door-edge-left {
  left: 0;
  background: linear-gradient(270deg, rgba(200, 162, 74, .5), rgba(247, 231, 188, .9));
}

#door-screen.open .door-left  { transform: translate3d(-102%, 0, 0); }
#door-screen.open .door-right { transform: translate3d(102%, 0, 0); }

.door-lock {
  position: relative;
  z-index: 5;
  width: 132px;
  height: 132px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform .6s ease, opacity .6s ease;
}

.door-lock:hover { transform: scale(1.06); }

.gold-ring {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.outer-ring {
  inset: 0;
  border: 2px dashed var(--gold);
  opacity: .75;
  animation: spinRight 14s linear infinite;
}

.inner-ring {
  inset: 16px;
  border: 1px solid var(--gold-deep);
  opacity: .6;
  animation: spinLeft 10s linear infinite;
}

@keyframes spinRight { to { transform: rotate(360deg); } }
@keyframes spinLeft  { to { transform: rotate(-360deg); } }

.lock-crest {
  width: 84px;
  height: 84px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--gold);
  background: radial-gradient(circle, var(--ivory), var(--cream-3));
  animation: lockBreathe 2.8s ease-in-out infinite;
}

@keyframes lockBreathe {
  0%, 100% { box-shadow: 0 6px 22px rgba(200, 162, 74, .3),  inset 0 0 14px rgba(200, 162, 74, .18); }
  50%      { box-shadow: 0 10px 32px rgba(200, 162, 74, .55), inset 0 0 22px rgba(200, 162, 74, .3); }
}

.lock-crest span {
  font-family: "Cinzel", serif;
  font-size: .66rem;
  letter-spacing: .12em;
  color: var(--gold-deep);
}

.light-burst {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .95), rgba(247, 231, 188, .6) 40%, transparent 70%);
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
}

#door-screen.open .door-lock {
  transform: scale(1.4);
  opacity: 0;
}

#door-screen.open .light-burst { animation: flashBurst 1.2s ease-out forwards; }

#door-screen.open .outer-ring,
#door-screen.open .inner-ring,
#door-screen.open .lock-crest { animation-play-state: paused; }

@keyframes flashBurst {
  0%   { opacity: 0; transform: scale3d(.5, .5, 1); }
  35%  { opacity: 1; transform: scale3d(2.8, 2.8, 1); }
  100% { opacity: 0; transform: scale3d(5.5, 5.5, 1); }
}

.instruction-text {
  position: absolute;
  bottom: 15%;
  z-index: 5;
  font-family: "Cinzel", serif;
  font-size: .66rem;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--maroon);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .9);
  animation: pulseText 2.4s ease-in-out infinite;
  transition: opacity .4s ease;
}

.instruction-text.hidden { opacity: 0; }

@keyframes pulseText {
  0%, 100% { opacity: .72; transform: translateY(0); }
  50%      { opacity: 1;   transform: translateY(-4px); }
}

#main-invitation {
  opacity: 0;
  visibility: hidden;
  transition: opacity 1.4s ease .2s;
}

#main-invitation.visible {
  opacity: 1;
  visibility: visible;
}

/* ---------------- Scroll reveal ---------------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .8s cubic-bezier(.2, .8, .25, 1), transform .8s cubic-bezier(.2, .8, .25, 1);
  will-change: opacity, transform;
}

.reveal.in {
  opacity: 1;
  transform: none;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* ---------------- Responsive ---------------- */
@media (min-width: 720px) {
  .page { padding: 30px 16px calc(110px + var(--safe-bottom)); }
  .shell { padding: 34px 30px 36px; }
  .divider { margin: 26px auto; }
  .cards { gap: 12px; }
  .countdown-grid { gap: 10px; }
}

/* Small phones: let the family card use nearly the full shell width */
@media (max-width: 400px) {
  .family-card { padding: 14px 9px 13px; }
  .family-list { gap: 8px; }
  .family-name { font-size: .86rem; }
  .family-role { font-size: .42rem; letter-spacing: .14em; }
}

@media (max-width: 480px) {
  .shell { padding: 22px 14px 26px; border-radius: 18px; }
  .divider { margin: 17px auto; }
  .section-card,
  .dua-card { padding: 15px 13px; }
  .cards { gap: 7px; }
  .info-card { padding: 12px 4px; }
  .countdown-grid { gap: 6px; }
  .audio-label { display: none; }
  .lux-btn { padding: 8px 11px; font-size: .52rem; }
}

@media (max-width: 360px) {
  .cards { grid-template-columns: 1fr 1fr; }
  .cards .info-card:last-child { grid-column: span 2; }
  .door-lock { width: 112px; height: 112px; }
  .lock-crest { width: 72px; height: 72px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
