/* Layali — a Moroccan night: one lantern you light, the others rise, the Basmala and the names in gold over the
   medina; then dawn: the invitation on soft cream with midnight blue and gold. The lanterns are cut out of their
   black ground (transparent). Phone first, a phone-wide column on a computer. */
@font-face {
  font-family: 'Aref Ruqaa';
  src: url('../assets/fonts/aref-ruqaa-arabic-normal-400.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Aref Ruqaa';
  src: url('../assets/fonts/aref-ruqaa-arabic-normal-700.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'Amiri';
  src: url('../assets/fonts/amiri-arabic-normal-400.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Amiri';
  src: url('../assets/fonts/amiri-arabic-normal-700.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'Amiri Quran';
  src: url('../assets/fonts/amiri-quran-arabic-normal-400.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'Cinzel';
  src: url('../assets/fonts/cinzel-latin-normal-400-700.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: 'Cormorant';
  src: url('../assets/fonts/cormorant-garamond-latin-normal-300-700.woff2') format('woff2');
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: 'Cormorant';
  src: url('../assets/fonts/cormorant-garamond-latin-italic-300-700.woff2') format('woff2');
  font-weight: 300 700;
  font-style: italic;
  font-display: swap;
}

:root {
  --night: #16244a;
  --night-2: #23366a;
  --dusk: #3a4f86;
  --gold: #c9a25a;
  --gold-light: #ecd39a;
  --cream: #f8f3ea;
  --cream-2: #f1e8d9;
  --ink: #2b3352;
  --col: min(100vw, 480px);
  --bg: var(--cream);
  --btn-bg: var(--night-2);
  --btn-ink: var(--gold-light);
  --font-text: 'Cormorant', 'Amiri', Georgia, serif;
  --font-text-ar: 'Amiri', 'Cormorant', serif;
}
body {
  background:
    radial-gradient(70% 50% at 50% 0%, rgba(236, 211, 154, 0.35), transparent 70%),
    linear-gradient(180deg, #eef0f6, #f6efe3 70%);
  background-attachment: fixed;
}

/* ——— 1. The night and the lantern ——— */
.night {
  position: fixed;
  z-index: 50;
  top: 0;
  bottom: 0;
  left: 50%;
  width: var(--col);
  transform: translateX(-50%);
  overflow: hidden;
  background:
    radial-gradient(80% 50% at 50% 100%, rgba(236, 196, 120, 0.18), transparent 70%),
    linear-gradient(180deg, #121e3f, #1d2e5c 60%, #2b3f73);
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 1.6s ease;
}
.stars {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.lamp {
  position: absolute;
  left: 50%;
  top: 0;
  width: 36%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: sway 5s ease-in-out infinite;
  transform-origin: 50% 0;
}
@keyframes sway {
  0%,
  100% {
    rotate: -1.6deg;
  }
  50% {
    rotate: 1.6deg;
  }
}
.lamp-chain {
  width: 1.5px;
  height: 21svh;
  background: linear-gradient(rgba(201, 162, 90, 0.2), var(--gold));
}
.lamp-img {
  width: 100%;
  filter: brightness(0.32) saturate(0.5);
  transition: filter 1.4s ease;
  margin-top: -4%;
}
.lamp-halo {
  position: absolute;
  left: 50%;
  top: calc(21svh + 30%);
  width: 340%;
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0.2);
  background: radial-gradient(circle, rgba(255, 210, 130, 0.55), rgba(255, 180, 90, 0.18) 40%, transparent 68%);
  mix-blend-mode: screen;
  opacity: 0;
  transition:
    opacity 1.6s ease,
    transform 2.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.night-hint {
  position: absolute;
  left: 0;
  right: 0;
  top: 64svh;
  margin: 0;
  text-align: center;
  font-size: 19px;
  color: var(--gold-light);
  animation: breathe 2.6s ease-in-out infinite;
  transition: opacity 0.4s ease;
}
html[dir='ltr'] .night-hint {
  font-style: italic;
  letter-spacing: 0.03em;
}
@keyframes breathe {
  50% {
    opacity: 0.45;
  }
}
.night-lanterns .nl {
  position: absolute;
  opacity: 0;
  transform: translateY(40svh) scale(0.8);
}
.nl-2 {
  left: 6%;
  top: 46%;
  width: 22%;
}
.nl-3 {
  right: 4%;
  top: 40%;
  width: 24%;
}
.nl-4 {
  left: 18%;
  top: 70%;
  width: 17%;
}
.nl-5 {
  right: 16%;
  top: 72%;
  width: 15%;
}
.night.is-lit .night-hint {
  opacity: 0;
  animation: none;
}
.night.is-lit .lamp-img {
  filter: brightness(1.08) saturate(1.05) drop-shadow(0 0 22px rgba(255, 190, 100, 0.65));
}
.night.is-lit .lamp-halo {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.night.is-lit .nl {
  animation: rise 4.2s cubic-bezier(0.25, 0.6, 0.3, 1) forwards;
}
.night.is-lit .nl-3 {
  animation-delay: 0.35s;
}
.night.is-lit .nl-4 {
  animation-delay: 0.7s;
}
.night.is-lit .nl-5 {
  animation-delay: 1s;
}
@keyframes rise {
  0% {
    opacity: 0;
    transform: translateY(30svh) scale(0.8);
  }
  30% {
    opacity: 0.95;
  }
  100% {
    opacity: 0.9;
    transform: translateY(-38svh) scale(1);
  }
}
.night.is-in {
  opacity: 0;
}
.night.is-gone {
  display: none;
}

/* ——— 2. The sky and the names ——— */
.page {
  position: relative;
  width: var(--col);
  margin: 0 auto;
  background: var(--cream);
  box-shadow: 0 0 60px rgba(40, 50, 90, 0.16);
  overflow: hidden;
}
.hero {
  position: relative;
  height: 100svh;
  min-height: 600px;
  overflow: hidden;
  background: var(--night);
}
.hero-sky {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 100%;
  transform: scale(var(--zoom, 1.12));
  transition: transform 3.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}
html[data-opened] .hero-sky {
  --zoom: 1;
}
.hero-stars {
  mix-blend-mode: screen;
}
.drift img {
  position: absolute;
  bottom: -30%;
  width: var(--w);
  opacity: 0;
  animation: float var(--t) linear var(--delay) infinite;
}
@keyframes float {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0);
  }
  12% {
    opacity: var(--o);
  }
  80% {
    opacity: var(--o);
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--sway), -150svh, 0);
  }
}
.hero-text {
  position: absolute;
  z-index: 2;
  top: 6svh;
  left: 0;
  right: 0;
  padding: 0 24px;
  text-align: center;
}
.basmala {
  width: 112px;
  margin: 0 auto 12px;
  filter: drop-shadow(0 0 12px rgba(236, 211, 154, 0.35));
}
.hero-kicker {
  margin: 0 0 8px;
  font-size: 18px;
  color: #f3e6c8;
  text-shadow: 0 2px 12px rgba(10, 16, 40, 0.7);
}
html[dir='ltr'] .hero-kicker {
  font-family: 'Cormorant', serif;
  font-style: italic;
  font-size: 20px;
}
.hero-names {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-weight: 700;
  background: linear-gradient(175deg, #fff5da 15%, #ecd39a 50%, #fff2cf 62%, #d1a55a 92%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 18px rgba(236, 200, 130, 0.35)) drop-shadow(0 3px 8px rgba(10, 16, 40, 0.6));
}
html[dir='rtl'] .hero-names {
  font-family: 'Aref Ruqaa', 'Amiri', serif;
  font-size: clamp(60px, 17vw, 84px);
  line-height: 1.3;
}
html[dir='ltr'] .hero-names {
  font-family: 'Cinzel', serif;
  font-weight: 600;
  font-size: clamp(46px, 13vw, 62px);
  letter-spacing: 0.06em;
  line-height: 1.15;
}
.hero-and {
  font-size: 0.5em;
}
html[dir='ltr'] .hero-and {
  font-family: 'Cormorant', serif;
  font-style: italic;
  font-weight: 400;
}
.hero-date {
  margin: 14px 0 0;
  font-family: 'Cinzel', serif;
  font-size: 16px;
  letter-spacing: 0.3em;
  color: var(--gold-light);
  text-shadow: 0 2px 10px rgba(10, 16, 40, 0.8);
}
.hero-text > * {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 1.6s ease,
    transform 1.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}
html[data-opened] .hero-text > * {
  opacity: 1;
  transform: none;
}
html[data-opened] .basmala {
  transition-delay: 2.4s;
}
html[data-opened] .hero-kicker {
  transition-delay: 2.9s;
}
html[data-opened] .hero-names {
  transition-delay: 3.2s;
}
html[data-opened] .hero-date {
  transition-delay: 3.6s;
}
/* The city melts into its own dark colour at the bottom of the picture (#1c0d07, measured on sky.webp)… */
.hero::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 15%;
  background: linear-gradient(180deg, rgba(28, 13, 7, 0), rgba(28, 13, 7, 0.6) 55%, #1c0d07);
  pointer-events: none;
}

/* ——— 3. The invitation at dawn ———
   …and the page starts from that colour: plum, dusty rose, peach, then the cream, in one gradient (no seam). */
.paper {
  padding: 96px 0 10px;
  background: linear-gradient(
    180deg,
    #1c0d07 0,
    #3a1f27 34px,
    #6e4757 82px,
    #a37b7e 128px,
    #d2ae9f 172px,
    #ecd8c4 218px,
    #f5ebde 262px,
    var(--cream) 300px,
    var(--cream-2) 100%
  );
}
.card {
  position: relative;
  margin: 0 22px;
  padding: 60px 28px 40px;
  text-align: center;
  background: #fffcf6;
  border-radius: 200px 200px 16px 16px;
  box-shadow:
    0 0 0 1px rgba(201, 162, 90, 0.5),
    0 26px 50px -34px rgba(40, 50, 90, 0.4);
}
.card::before {
  content: '';
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(201, 162, 90, 0.35);
  border-radius: 192px 192px 10px 10px;
  pointer-events: none;
}
.crescent {
  display: block;
  width: 30px;
  height: 30px;
  margin: 0 auto 16px;
  border-radius: 50%;
  box-shadow: inset -8px 4px 0 0 var(--gold);
  transform: rotate(-20deg);
}
.card-intro {
  margin: 0;
  font-size: 21px;
  line-height: 1.95;
  color: var(--ink);
}
html[dir='ltr'] .card-intro {
  line-height: 1.6;
}
.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 22px auto;
  max-width: 220px;
}
.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold));
}
.divider::after {
  transform: scaleX(-1);
}
.divider i {
  width: 8px;
  height: 8px;
  background: var(--gold);
  transform: rotate(45deg);
}
.card-date {
  margin: 0;
  font-size: 21px;
  font-weight: 700;
  color: var(--night);
}
html[dir='ltr'] .card-date {
  font-weight: 600;
  font-size: 22px;
}
.card-hour {
  margin: 6px 0 0;
  font-size: 19px;
  color: var(--gold);
}
.verse {
  margin: 30px 22px 0;
  padding: 28px 22px 22px;
  text-align: center;
  border-radius: 16px;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(58, 79, 134, 0.08), transparent 70%),
    #fdfaf3;
  box-shadow: inset 0 0 0 1px rgba(201, 162, 90, 0.45);
}
.verse blockquote {
  margin: 0;
  font-family: 'Amiri Quran', 'Amiri', serif;
  font-size: 22px;
  line-height: 2.1;
  color: var(--night-2);
}
.verse figcaption {
  margin-top: 8px;
  font-size: 15px;
  color: var(--gold);
}
.block {
  margin: 0 22px;
  padding: 50px 0 0;
  text-align: center;
}
.block h2 {
  margin: 0 0 22px;
  font-weight: 700;
  color: var(--night-2);
}
html[dir='rtl'] .block h2 {
  font-family: 'Aref Ruqaa', serif;
  font-size: 31px;
  line-height: 1.5;
}
html[dir='ltr'] .block h2 {
  font-family: 'Cinzel', serif;
  font-weight: 500;
  font-size: 22px;
  letter-spacing: 0.08em;
}
.cd {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.cd-cell {
  display: grid;
  place-content: center;
  gap: 2px;
  aspect-ratio: 0.78;
  border-radius: 999px 999px 10px 10px;
  background: linear-gradient(180deg, #24376b, var(--night));
  box-shadow:
    inset 0 0 0 1px rgba(236, 211, 154, 0.55),
    0 14px 24px -16px rgba(22, 36, 74, 0.8);
}
.cd-num {
  font-family: 'Cinzel', serif;
  font-size: 26px;
  font-weight: 600;
  line-height: 1;
  color: var(--gold-light);
  font-variant-numeric: tabular-nums;
}
.cd-unit {
  font-size: 13px;
  color: #d9dcea;
}
.prog {
  position: relative;
  margin: 0 auto;
  padding: 0;
  max-width: 340px;
  list-style: none;
}
.prog::before {
  content: '';
  position: absolute;
  inset-inline-start: 96px;
  top: 12px;
  bottom: 12px;
  width: 1px;
  background: linear-gradient(transparent, var(--gold) 12%, var(--gold) 88%, transparent);
}
.prog-item {
  position: relative;
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 26px;
  align-items: center;
  padding: 13px 0;
  text-align: start;
}
.prog-moon {
  position: absolute;
  inset-inline-start: 89px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--cream);
  box-shadow: inset -4px 2px 0 0 var(--gold);
}
.prog-time {
  text-align: end;
  font-size: 18px;
  font-weight: 700;
  color: var(--gold);
}
html[dir='ltr'] .prog-time {
  font-family: 'Cinzel', serif;
  font-size: 16px;
}
.prog-label {
  font-size: 20px;
  color: var(--ink);
}
.prog-item[data-reveal] {
  transition-delay: calc(var(--i) * 0.12s);
}
.venue-name {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  color: var(--night);
}
html[dir='rtl'] .venue-name {
  font-family: 'Aref Ruqaa', serif;
  font-size: 30px;
}
.venue-city {
  margin: 2px 0 18px;
  font-size: 19px;
  color: var(--ink);
  opacity: 0.8;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 26px;
  border-radius: 999px;
  background: linear-gradient(180deg, #2a3f78, var(--night));
  color: var(--gold-light);
  font-size: 18px;
  font-weight: 600;
  text-decoration: none;
  box-shadow:
    inset 0 0 0 1px rgba(236, 211, 154, 0.45),
    0 12px 24px -14px rgba(22, 36, 74, 0.9);
}
.btn svg {
  width: 19px;
  height: 19px;
}
/* The blessing under a last bit of night sky. */
.closing {
  position: relative;
  margin: 56px 0 0;
  padding: 120px 26px 70px;
  text-align: center;
  background: linear-gradient(180deg, var(--cream-2), #c9b9b0 18%, #4b5b8c 48%, var(--night) 80%);
  color: var(--gold-light);
}
.closing-text {
  text-wrap: balance;
  margin: 0;
  font-size: 23px;
  line-height: 1.8;
}
html[dir='rtl'] .closing-text {
  font-family: 'Aref Ruqaa', serif;
  font-weight: 700;
  font-size: 25px;
}
html[dir='ltr'] .closing-text {
  font-style: italic;
}
.closing-names {
  margin: 14px 0 0;
  font-size: 22px;
  color: #fff3d4;
}
html[dir='rtl'] .closing-names {
  font-family: 'Aref Ruqaa', serif;
  font-weight: 700;
  font-size: 30px;
}
html[dir='ltr'] .closing-names {
  font-family: 'Cinzel', serif;
  letter-spacing: 0.08em;
}

@media (min-width: 520px) {
  .inv-controls {
    inset-inline-end: calc(50% - 240px + 16px);
  }
}
