/* Palette: a mosque courtyard at night — deep malachite, brass lattice, pearl text. */
:root {
  --night: #0F211E;
  --malachite: #17322D;
  --malachite-2: #1E3F38;
  --brass: #C8A25E;
  --brass-light: #E7D2A0;
  --pearl: #F3EDE1;
  --mist: #A7B8B0;

  --font-display: "Aref Ruqaa", "Amiri", serif;
  --font-serif: "Amiri", serif;
  --font-ui: "Readex Pro", system-ui, sans-serif;

  --lattice: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%23C8A25E' stroke-width='1'%3E%3Crect x='28' y='28' width='24' height='24'/%3E%3Crect x='28' y='28' width='24' height='24' transform='rotate(45 40 40)'/%3E%3Cpath d='M0 40H23M57 40H80M40 0V23M40 57V80'/%3E%3Cpath d='M0 -9L9 0L0 9L-9 0Z M80 -9L89 0L80 9L71 0Z M0 71L9 80L0 89L-9 80Z M80 71L89 80L80 89L71 80Z'/%3E%3C/g%3E%3C/svg%3E");

  --gutter: 20px;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100svh;
  background-color: var(--night);
  color: var(--pearl);
  font-family: var(--font-ui);
  font-weight: 300;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body::before { /* faint lattice over the whole page */
  content: "";
  position: fixed;
  inset: 0;
  background: var(--lattice) center / 80px;
  opacity: .055;
  pointer-events: none;
  z-index: 0;
}
body.is-locked { overflow: hidden; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

:focus-visible { outline: 2px solid var(--brass-light); outline-offset: 3px; }

/* ---------- Opening doors ---------- */
.doors {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  perspective: 1400px;
  -webkit-tap-highlight-color: transparent;
}
.doors:focus-visible { outline-offset: -6px; }

.door {
  position: absolute;
  top: 0; bottom: 0;
  width: 50%;
  background: linear-gradient(180deg, var(--malachite-2), var(--malachite) 60%, var(--night));
  transition: transform 1.6s var(--ease-out), filter 1.6s var(--ease-out);
  backface-visibility: hidden;
}
.door::after { /* lattice at readable strength */
  content: "";
  position: absolute; inset: 0;
  background: var(--lattice) center / 64px;
  opacity: .13;
}
.door--left  { left: 0;  transform-origin: left center;  box-shadow: inset -1px 0 0 rgba(200,162,94,.55); }
.door--right { right: 0; transform-origin: right center; box-shadow: inset 1px 0 0 rgba(200,162,94,.55); }

/* The two inner frames meet at the seam and form one arch. */
.door__frame {
  position: absolute;
  top: max(28px, env(safe-area-inset-top));
  bottom: max(28px, env(safe-area-inset-bottom));
  border: 1px solid var(--brass);
  z-index: 1;
}
.door--left .door__frame  { left: 18px; right: 0; border-right: 0; border-top-left-radius: 100% 22vh; }
.door--right .door__frame { right: 18px; left: 0; border-left: 0; border-top-right-radius: 100% 22vh; }

.door__ring {
  position: absolute;
  top: 76%;
  width: 22px; height: 22px;
  border: 2px solid var(--brass);
  border-radius: 50%;
  z-index: 1;
  box-shadow: 0 2px 6px rgba(0,0,0,.4);
}
.door--left .door__ring  { right: 14px; }
.door--right .door__ring { left: 14px; }

.doors__center {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  transition: opacity .5s ease;
}
.doors__eyebrow {
  font-size: .8rem;
  letter-spacing: .3em;
  color: var(--brass-light);
  background: var(--night);
  padding: 4px 14px;
}

.medallion {
  position: relative;
  width: 168px; height: 168px;
  display: grid;
  place-items: center;
}
.medallion svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.medallion rect { fill: var(--night); stroke: var(--brass); stroke-width: 1.4; }
.medallion__initials {
  position: relative;
  font-family: var(--font-display);
  font-size: 2.6rem;
  line-height: 1;
  color: var(--brass-light);
}
.medallion__initials i { font-style: normal; font-size: .55em; color: var(--brass); margin-inline: .1em; }

.doors__hint {
  font-size: .95rem;
  color: var(--pearl);
  background: var(--night);
  padding: 8px 18px;
  border: 1px solid rgba(200,162,94,.5);
  border-radius: 999px;
  animation: hint 2.4s ease-in-out infinite;
}
@keyframes hint { 50% { opacity: .55; } }

.doors.is-open { pointer-events: none; }
.doors.is-open .doors__center { opacity: 0; }
.doors.is-open .door--left  { transform: rotateY(-100deg); filter: brightness(.6); }
.doors.is-open .door--right { transform: rotateY(100deg);  filter: brightness(.6); }
.doors.is-gone { display: none; }

/* ---------- Page ---------- */
.page {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 520px;
  margin-inline: auto;
  padding: 0 var(--gutter) calc(96px + env(safe-area-inset-bottom));
}

.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding-top: max(32px, env(safe-area-inset-top));
  padding-bottom: 28px;
}

.arch {
  position: relative;
  width: 100%;
  padding: 92px 22px 40px;
  text-align: center;
  border: 1px solid var(--brass);
  border-bottom: 0;
  border-radius: 999px 999px 0 0;
  background: radial-gradient(120% 70% at 50% 0%, rgba(200,162,94,.12), transparent 70%);
}
.arch::before { /* second, outer line of the arch */
  content: "";
  position: absolute;
  inset: -9px -9px 0;
  border: 1px solid rgba(200,162,94,.4);
  border-bottom: 0;
  border-radius: 999px 999px 0 0;
  pointer-events: none;
}

.basmala {
  margin: 0 0 14px;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: var(--brass-light);
}

.verse { margin: 0 auto 30px; max-width: 34ch; }
.verse p {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.12rem;
  line-height: 2.1;
  color: var(--pearl);
}
.verse cite {
  display: block;
  margin-top: 6px;
  font-style: normal;
  font-size: .78rem;
  color: var(--mist);
}

.invite-line {
  margin: 0 0 6px;
  font-size: .95rem;
  color: var(--mist);
}

.names {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  color: var(--brass-light);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.names__one, .names__two {
  font-size: clamp(4rem, 22vw, 5.6rem);
  text-shadow: 0 2px 24px rgba(200,162,94,.25);
}
.names__and {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 4px 0 8px;
}
.names__and svg { width: 22px; height: 22px; }
.names__and rect { fill: var(--night); stroke: var(--brass); stroke-width: 1.3; }
.names__and::before, .names__and::after {
  content: "";
  width: 54px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--brass));
}
.names__and::after { transform: scaleX(-1); }

.scroll-cue {
  margin-top: 26px;
  width: 1px; height: 44px;
  background: linear-gradient(var(--brass), transparent);
  animation: cue 2.2s ease-in-out infinite;
}
@keyframes cue { 0%, 100% { transform: scaleY(.4); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } }

/* ---------- Sections ---------- */
.block { text-align: center; padding: 34px 0; }

.eyebrow {
  margin: 0 0 18px;
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: .3em;
  color: var(--brass);
}

.date {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
}
.date__weekday, .date__month {
  font-size: 1.05rem;
  font-weight: 400;
  padding-block: 10px;
  border-block: 1px solid rgba(200,162,94,.45);
}
.date__month span { color: var(--mist); }
.date__day {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 5.2rem;
  line-height: 1;
  color: var(--brass-light);
  padding-inline: 4px;
}
.date__numeric {
  margin: 10px 0 0;
  font-size: .85rem;
  letter-spacing: .12em;
  color: var(--mist);
}
.time {
  margin: 18px 0 0;
  font-size: 1.1rem;
}
.time strong { font-weight: 600; color: var(--brass-light); font-size: 1.25em; }

.countdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 26px 0 0;
}
.countdown__cell {
  padding: 12px 4px 8px;
  border: 1px solid rgba(200,162,94,.35);
  background: rgba(23,50,45,.6);
  border-radius: 14px 14px 4px 4px;
}
.countdown__cell span {
  display: block;
  font-size: 1.6rem;
  font-weight: 500;
  line-height: 1.2;
  color: var(--pearl);
  font-variant-numeric: tabular-nums;
}
.countdown__cell small { font-size: .75rem; color: var(--mist); }
.countdown-done {
  margin: 24px 0 0;
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--brass-light);
}

.cal { margin-top: 26px; }
.cal__label { display: block; font-size: .82rem; color: var(--mist); margin-bottom: 10px; }
.cal__buttons { display: flex; gap: 10px; justify-content: center; }
.cal__buttons .btn { flex: 1; max-width: 200px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 20px;
  border-radius: 999px;
  font: inherit;
  font-size: .95rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease, transform .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); }
.btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.btn--ghost {
  background: transparent;
  color: var(--brass-light);
  border: 1px solid rgba(200,162,94,.6);
}
.btn--ghost:hover { background: rgba(200,162,94,.12); }
.btn--solid {
  margin-top: 22px;
  width: 100%;
  background: var(--brass);
  color: var(--night);
  border: 0;
  font-weight: 600;
}
.btn--solid:hover { background: var(--brass-light); }

.venue {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.9rem;
  line-height: 1.4;
  color: var(--pearl);
}
.venue__area { margin: 4px 0 0; font-size: 1.05rem; color: var(--mist); }

.divider { display: flex; align-items: center; gap: 14px; justify-content: center; }
.divider::before, .divider::after {
  content: ""; height: 1px; flex: 1; max-width: 120px;
  background: linear-gradient(90deg, transparent, rgba(200,162,94,.6));
}
.divider::after { transform: scaleX(-1); }
.divider svg { width: 22px; height: 22px; }
.divider rect { fill: none; stroke: var(--brass); stroke-width: 1.2; }

.halls { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hall {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 26px 10px 20px;
  border: 1px solid rgba(200,162,94,.45);
  border-radius: 999px 999px 10px 10px;
  background: rgba(23,50,45,.6);
}
.hall__for { font-size: .82rem; color: var(--mist); }
.hall__name { font-family: var(--font-serif); font-weight: 700; font-size: 1.45rem; color: var(--brass-light); }

.notice {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
  padding: 16px 18px;
  text-align: start;
  border-radius: 12px;
  background: rgba(200,162,94,.1);
  border: 1px solid rgba(200,162,94,.55);
}
.notice svg {
  flex: none;
  width: 30px; height: 30px;
  fill: none; stroke: var(--brass-light); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round;
}
.notice p { margin: 0; }
.notice__title { font-weight: 500; font-size: 1rem; color: var(--pearl); }
.notice__body { font-size: .82rem; color: var(--mist); }

.closing { text-align: center; padding: 40px 0 8px; }
.closing__line { margin: 0; font-size: 1rem; color: var(--mist); }
.closing__names {
  margin: 6px 0 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.6rem;
  color: var(--brass-light);
}
.closing__names span { font-size: .6em; color: var(--brass); font-weight: 400; }

/* ---------- Music button ---------- */
.music {
  position: fixed;
  left: max(16px, env(safe-area-inset-left));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 40;
  width: 52px; height: 52px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--brass);
  background: rgba(15,33,30,.88);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: var(--brass-light);
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0,0,0,.35);
  -webkit-tap-highlight-color: transparent;
}
.music[hidden] { display: none; }
.music__bars { display: flex; align-items: flex-end; gap: 3px; height: 18px; }
.music__bars i { width: 3px; height: 30%; background: currentColor; border-radius: 2px; }
.music[aria-pressed="true"] .music__bars i { animation: bar 1s ease-in-out infinite; }
.music__bars i:nth-child(2) { animation-delay: -.3s !important; }
.music__bars i:nth-child(3) { animation-delay: -.6s !important; }
.music__bars i:nth-child(4) { animation-delay: -.15s !important; }
@keyframes bar { 0%, 100% { height: 25%; } 50% { height: 100%; } }
.music[aria-pressed="false"]::after { /* slash when muted */
  content: ""; position: absolute; width: 26px; height: 1.5px;
  background: var(--brass-light); transform: rotate(-45deg);
}

.yt-holder {
  position: fixed; left: 0; bottom: 0;
  width: 200px; height: 200px;
  opacity: 0; pointer-events: none; z-index: -1; overflow: hidden;
}

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .9s var(--ease-out), transform .9s var(--ease-out); }
.reveal.is-visible { opacity: 1; transform: none; }
.hero .reveal:nth-child(2) { transition-delay: .15s; }
.hero .reveal:nth-child(3) { transition-delay: .3s; }
.hero .reveal:nth-child(4) { transition-delay: .45s; }

/* ---------- Larger screens ---------- */
@media (min-width: 720px) {
  :root { --gutter: 32px; }
  .page { max-width: 600px; }
  .arch { padding: 120px 48px 48px; }
  .verse p { font-size: 1.25rem; }
  .names__one, .names__two { font-size: 6.4rem; }
  .door__ring { width: 28px; height: 28px; }
  .medallion { width: 200px; height: 200px; }
  .medallion__initials { font-size: 3rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .door { transition: none; }
  .doors { transition: opacity .4s ease; }
  .doors.is-open { opacity: 0; }
  .doors.is-open .door--left, .doors.is-open .door--right { transform: none; }
  .reveal { transform: none; transition: opacity .4s ease; }
  .doors__hint, .scroll-cue, .music[aria-pressed="true"] .music__bars i { animation: none; }
  .music[aria-pressed="true"] .music__bars i:nth-child(odd) { height: 70%; }
}
