/* ==========================================================================
   Walima of Aman & Yusra
   Colours and fonts are set in the first two blocks. Change them there and
   the whole page follows. The dark-mode block sets the colours used when a
   guest's phone is in dark mode.
   ========================================================================== */

:root {
  /* Midnight navy and gold */
  --paper: #101B36;          /* page background */
  --paper-raised: #16244A;   /* raised surfaces */
  --ink: #F3EBDC;            /* main text */
  --ink-soft: #C9C3B5;       /* supporting text */
  --heading: #E2C27E;        /* headings */
  --accent: #D9B36C;         /* buttons and links */
  --accent-hover: #E6C687;
  --on-accent: #101B36;      /* text on buttons */
  --gold: #D9B36C;           /* lines and ornaments */
  --gold-strong: #E2C27E;    /* large gold text */
  --gold-text: #D9B36C;      /* small gold text */
  --lattice: rgba(217, 179, 108, 0.2);
  --line: rgba(217, 179, 108, 0.45);
  --focus: #E2C27E;
  --field-bg: #16244A;
  --field-border: #6272A0;
  --error: #F4A8A8;
  --shadow: rgba(0, 0, 0, 0.38);

  /* Gold foil: the arch lines and the Arabic "و" between the names */
  --foil-1: #B8914A;
  --foil-2: #D9B36C;
  --foil-3: #F3DFA6;
  --gate-foil-1: #B8914A;
  --gate-foil-2: #D9B36C;
  --gate-foil-3: #F3DFA6;

  /* Velvet texture */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 0.95 0 0 0 0 0.85 0.24 0 0 0 -0.09'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");

  /* Full-width verse band: ivory, like the details card */
  --band-bg: #FBF6EC;
  --band-ink: #101B36;
  --band-arabic: #1A2A55;
  --band-source: #7D5E27;
  --band-rule: #B8914A;
  --band-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.32 0 0 0 0 0.24 0 0 0 0 0.1 0.3 0 0 0 -0.1'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --band-lattice: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28'%3E%3Cg fill='none' stroke='%23B8914A' stroke-opacity='0.26' stroke-width='.8'%3E%3Crect x='8.5' y='8.5' width='11' height='11'/%3E%3Crect x='8.5' y='8.5' width='11' height='11' transform='rotate(45 14 14)'/%3E%3Cpath d='M14 0V6.22M14 21.78V28M0 14H6.22M21.78 14H28M0 0L8.5 8.5M28 0L19.5 8.5M28 28L19.5 19.5M0 28L8.5 19.5'/%3E%3C/g%3E%3C/svg%3E");

  /* Opening doors */
  --gate-bg: #101B36;
  --gate-panel: #0A1328;
  --gate-gold: #D9B36C;
  --gate-lattice: rgba(217, 179, 108, 0.28);
  --gate-ink: #F3EBDC;

  /* Details card: ivory, like a printed card on velvet */
  --card-bg: #FBF6EC;
  --card-ink: #101B36;
  --card-heading: #1A2A55;
  --card-label: #7D5E27;
  --card-line: #B8914A;

  /* Card linking to the other event (emerald, to match the Nikah site) */
  --sister-bg: #0B4F3C;
  --sister-ink: #F6EFDF;
  --sister-soft: #CBDCD3;
  --sister-gold: #D4B36A;
  --sister-gold-hover: #E3C886;

  --font-display: "Cormorant Garamond", "Cormorant", Garamond, "Iowan Old Style", "Times New Roman", serif;
  --font-body: "Jost", "Avenir Next", "Segoe UI", Roboto, system-ui, sans-serif;
  --font-arabic: "Amiri", "Noto Naskh Arabic", "Traditional Arabic", "Geeza Pro", serif;
  --font-urdu: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", "Urdu Typesetting", "Amiri", serif;

  --measure: 34rem;
  --gutter: clamp(1.25rem, 5vw, 2rem);
  --radius: 12px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #080F22;
    --paper-raised: #0F1A33;
    --ink: #EFE7D6;
    --ink-soft: #BDB7AA;
    --lattice: rgba(217, 179, 108, 0.16);
    --field-bg: #0F1A33;
    --field-border: #5A6994;

    --gate-bg: #0B1429;
    --gate-panel: #070D1E;

    --card-bg: #111C38;
    --card-ink: #EFE7D6;
    --card-heading: #E2C27E;
    --card-label: #D9B36C;
    --card-line: #C9A65E;

    --sister-bg: #0A3D2F;

    --band-bg: #0F1A33;
    --band-ink: #EFE7D6;
    --band-arabic: #E2C27E;
    --band-source: #D9B36C;
    --band-rule: #C9A65E;
    --band-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 0.95 0 0 0 0 0.85 0.24 0 0 0 -0.09'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    --band-lattice: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28'%3E%3Cg fill='none' stroke='%23D9B36C' stroke-opacity='0.13' stroke-width='.8'%3E%3Crect x='8.5' y='8.5' width='11' height='11'/%3E%3Crect x='8.5' y='8.5' width='11' height='11' transform='rotate(45 14 14)'/%3E%3Cpath d='M14 0V6.22M14 21.78V28M0 14H6.22M21.78 14H28M0 0L8.5 8.5M28 0L19.5 8.5M28 28L19.5 19.5M0 28L8.5 19.5'/%3E%3C/g%3E%3C/svg%3E");
  }
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--paper);
  background-image: var(--grain);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

html.gate-on body { overflow: hidden; }

svg { display: block; }

h1, h2, h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.15;
  color: var(--heading);
}

p { margin: 0; text-wrap: pretty; }

h1, h2, h3,
.section__lead,
.footer__dua,
.footer__translit,
.footer__sign,
.crosslink__when,
.countdown__note,
.ayah__arabic { text-wrap: balance; }

a { color: var(--accent); }

[lang="ar"] { font-family: var(--font-arabic); }
[lang="ur"] { font-family: var(--font-urdu); }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

[tabindex="-1"]:focus { outline: none; }

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

.skip-link {
  position: absolute;
  top: -100px;
  inset-inline-start: 1rem;
  z-index: 60;
  padding: 0.75rem 1.1rem;
  border-radius: 8px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 500;
  text-decoration: none;
}
.skip-link:focus { top: 1rem; }

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.jali-line {
  fill: none;
  stroke: var(--lattice);
  stroke-width: 0.8;
}
.jali-line--gate { stroke: var(--gate-lattice); }

/* ---------- Opening doors ---------- */

.gate { display: none; }

html.gate-on .gate {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 100;
  perspective: 1800px;
  color: var(--gate-ink);
}

.gate__door {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  overflow: hidden;
  background: var(--gate-bg);
  backface-visibility: hidden;
  transition: transform 1.7s var(--ease), opacity 0.7s ease 1.05s;
}
.gate__door--left { left: 0; transform-origin: left center; box-shadow: inset -1px 0 0 var(--gate-gold); }
.gate__door--right { right: 0; transform-origin: right center; box-shadow: inset 1px 0 0 var(--gate-gold); }

.gate__art {
  position: absolute;
  top: 0;
  width: 100vw;
  height: 100%;
}
.gate__door--left .gate__art { left: 0; }
.gate__door--right .gate__art { right: 0; }

.gate__art .lattice { fill: url(#jali-gate); }
.gate__art .panel { fill: var(--gate-panel); stroke: var(--gate-gold); stroke-width: 1.3; }
.gate__art .panel-inner { fill: none; stroke: var(--gate-gold); stroke-width: 0.7; opacity: 0.75; }

.gate__center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem var(--gutter);
  text-align: center;
  transition: opacity 0.45s ease;
}

.gate__seal {
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  margin-bottom: 1.5rem;
  border: 1px solid var(--gate-gold);
  border-radius: 50%;
  background: var(--gate-panel);
  color: var(--gate-gold);
  box-shadow: 0 0 0 6px var(--gate-panel), 0 0 0 7px rgba(212, 179, 106, 0.5);
}
.gate__seal svg { width: 44px; height: 44px; }

.gate {
  --foil-1: var(--gate-foil-1);
  --foil-2: var(--gate-foil-2);
  --foil-3: var(--gate-foil-3);
}

.gate__greeting {
  margin-bottom: 0.5rem;
  font-size: 1rem;
  color: var(--gate-gold);
}

.gate__names .wa {
  font-size: 1.3em;
  line-height: 1;
  vertical-align: -0.04em;
}

.gate__names {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(2.6rem, 11vw, 3.6rem);
  line-height: 1.05;
  color: var(--gate-ink);
}

.gate__sub {
  margin: 0.6rem 0 2rem;
  font-size: 1rem;
  color: var(--gate-gold);
}

.gate__skip {
  position: absolute;
  left: 50%;
  bottom: max(1.25rem, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  min-height: 44px;
  padding: 0.5rem 1rem;
  border: 0;
  background: none;
  color: var(--gate-ink);
  font: 400 0.9375rem var(--font-body);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: rgba(212, 179, 106, 0.6);
  cursor: pointer;
  transition: opacity 0.3s ease;
}

.gate.is-opening .gate__door--left { transform: rotateY(96deg); }
.gate.is-opening .gate__door--right { transform: rotateY(-96deg); }
.gate.is-opening .gate__door { opacity: 0; }
.gate.is-opening .gate__center,
.gate.is-opening .gate__skip { opacity: 0; pointer-events: none; }

.gate.is-fading { opacity: 0; transition: opacity 0.4s ease; }

/* ---------- Buttons ---------- */

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 50px;
  padding: 0.75rem 1.5rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font: 500 1rem/1.2 var(--font-body);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}
.btn:active { transform: scale(0.98); }
.btn svg { width: 1.2em; height: 1.2em; flex: none; }

.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent-hover); }

.btn--outline { background: transparent; color: var(--accent); border-color: var(--gold); }
.btn--outline:hover { background: rgba(184, 145, 74, 0.12); }

.btn--sister { background: var(--sister-gold); color: var(--sister-bg); }
.btn--sister:hover { background: var(--sister-gold-hover); }

.btn--gate {
  background: transparent;
  color: var(--gate-ink);
  border-color: var(--gate-gold);
  padding-inline: 2rem;
}
.btn--gate:hover { background: rgba(212, 179, 106, 0.16); }
.gate .btn--gate:focus-visible,
.gate__skip:focus-visible { outline-color: var(--gate-gold); }

.btn--text {
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  background: none;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.btn--block { width: 100%; }

.actions .btn { min-width: min(100%, 17.5rem); }

/* ---------- Hero ---------- */

.hero {
  --apex: 68px;
  --crown: 190px;
  --arch-w: 34rem;
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: calc(var(--apex) + var(--crown) * 0.46) var(--gutter) 2.5rem;
  text-align: center;
  overflow: hidden;
}

.hero__frame {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  -webkit-mask-image: linear-gradient(to bottom, #000 72%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 72%, transparent 100%);
}

.hero__lattice { fill: url(#jali); }

.arch-line {
  fill: none;
  stroke: var(--gold);
  stroke-linecap: round;
}
.arch-line--outer { stroke-width: 1.4; }
.arch-line--inner { stroke-width: 0.7; opacity: 0.85; }
.arch-line--finial { stroke-width: 1.4; }
.arch-line--outer,
.arch-line--inner { stroke: url(#foil); }

.foil-a { stop-color: var(--foil-1); }
.foil-b { stop-color: var(--foil-2); }
.foil-c { stop-color: var(--foil-3); }

.hero__content {
  width: min(100%, calc(var(--arch-w) - 3rem));
  display: flex;
  flex-direction: column;
  align-items: center;
}

.bismillah {
  font-size: clamp(1.45rem, 6.4vw, 2.1rem);
  line-height: 1.9;
  color: var(--heading);
}

.hero__urdu {
  margin-top: 0.25rem;
  font-size: clamp(1rem, 4.4vw, 1.3rem);
  line-height: 2.2;
  color: var(--gold-text);
}

.hero__names {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: clamp(1.25rem, 5vh, 2.25rem);
  font-style: italic;
  font-size: clamp(2.65rem, 12vw, 4.4rem);
  line-height: 1.02;
  color: var(--ink);
}
.hero__name { display: block; }
.hero__amp {
  display: block;
  margin: -0.16em 0 -0.04em;
  font-size: 1.6em;
  line-height: 1;
}

/* Arabic "و" (wa, meaning "and") in gold foil with a slow sheen */
.wa {
  display: inline-block;
  padding: 0 0.12em;
  font-family: var(--font-arabic);
  font-style: normal;
  font-weight: 400;
  color: var(--gold-strong);
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .wa {
    background: linear-gradient(110deg, var(--foil-1) 20%, var(--foil-2) 38%, var(--foil-3) 50%, var(--foil-2) 62%, var(--foil-1) 80%);
    background-size: 300% 100%;
    background-position: 100% 0;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: sheen 7s ease-in-out 3s infinite;
  }
}
@keyframes sheen {
  0% { background-position: 100% 0; }
  40%, 100% { background-position: 0 0; }
}

.hero__event {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-top: 1.35rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.35rem;
  letter-spacing: 0.06em;
  color: var(--heading);
}
.hero__event::before,
.hero__event::after {
  content: "";
  width: 2.75rem;
  height: 1px;
}
.hero__event::before { background: linear-gradient(to right, transparent, var(--foil-2)); }
.hero__event::after { background: linear-gradient(to left, transparent, var(--foil-2)); }

.hero__date {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  margin-top: 0.9rem;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink);
}
.hero__hijri {
  margin-top: 0.2rem;
  font-size: 0.875rem;
  color: var(--gold-text);
}

.hero__cue {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-top: 1.25rem;
  border-radius: 50%;
  color: var(--gold-strong);
}
.hero__cue svg { width: 26px; height: 26px; }

/* Hero entrance: the arch draws itself, then the words appear in turn */
.js .arch-line { stroke-dasharray: 1; stroke-dashoffset: 1; }
.js.is-ready .arch-line { animation: draw 2.4s var(--ease) forwards; }
.js.is-ready .arch-line--inner { animation-delay: 0.25s; }
.js.is-ready .arch-line--finial { animation-duration: 0.6s; animation-delay: 1.5s; }

.js .hero__lattice,
.js .hero__symbol { opacity: 0; }
.js.is-ready .hero__lattice { animation: fade 1.6s ease forwards 0.2s; }
.js.is-ready .hero__symbol { animation: fade 1s ease forwards 1.8s; }

.js .hero__content > * { opacity: 0; transform: translateY(10px); }
.js.is-ready .hero__content > * {
  animation: rise 1s var(--ease) forwards;
  animation-delay: calc(0.5s + var(--i, 0) * 0.16s);
}
.js.is-ready .hero__content > .sr-only { animation: none; }

@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade { to { opacity: 1; } }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ---------- Sections ---------- */

.section {
  max-width: calc(var(--measure) + var(--gutter) * 2);
  margin: 0 auto;
  padding: clamp(3.5rem, 11vw, 5.5rem) var(--gutter);
  text-align: center;
}

.section__title {
  font-size: clamp(2rem, 7.4vw, 2.65rem);
}

.section__title-sub {
  display: block;
  margin-top: 0.2em;
  font-style: italic;
  font-size: 0.6em;
  color: var(--gold-strong);
}

.section__lead {
  max-width: 30rem;
  margin: 0.9rem auto 0;
  color: var(--ink-soft);
}

.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  width: min(15rem, 70%);
  margin: 0 auto;
  color: var(--gold);
}
.divider svg { width: 20px; height: 20px; flex: none; }
.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
}
.divider::before { background: linear-gradient(to right, transparent, var(--line)); }
.divider::after { background: linear-gradient(to left, transparent, var(--line)); }

/* Scroll reveal */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.js [data-reveal].is-visible { opacity: 1; transform: none; }

/* ---------- Countdown ---------- */

.countdown__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.4rem;
  max-width: 27rem;
  margin: 1.75rem auto 0;
}

.countdown__unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.95rem 0 0.75rem;
  border-block: 1px solid var(--line);
}

.countdown__num {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.35rem, 11.5vw, 3.5rem);
  line-height: 1;
  color: var(--heading);
  font-variant-numeric: lining-nums tabular-nums;
}

.countdown__label {
  margin-top: 0.4rem;
  font-size: 0.8125rem;
  color: var(--ink-soft);
}

.countdown__note {
  max-width: 26rem;
  margin: 1.5rem auto 0;
  font-family: var(--font-display);
  font-size: 1.4rem;
  line-height: 1.4;
  color: var(--ink);
}

/* ---------- Invitation ---------- */

.ayah { margin: 0 auto; max-width: 32rem; }
.ayah__quote { margin: 0; }

.ayah__arabic {
  font-size: clamp(1.45rem, 5.8vw, 1.9rem);
  line-height: 2.15;
  color: var(--heading);
}

.ayah__english {
  margin-top: 1.25rem;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.2rem, 4.8vw, 1.42rem);
  line-height: 1.5;
  color: var(--ink);
}

.ayah__source {
  margin-top: 0.85rem;
  font-size: 0.875rem;
  color: var(--gold-text);
}

.invitation__text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.invitation__greeting {
  margin-bottom: 0.9rem;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.6rem;
  line-height: 1.25;
  color: var(--heading);
}

.invitation__line { color: var(--ink-soft); }

.invitation__hosts {
  margin: 0.35rem 0 0.5rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.4rem;
  line-height: 1.35;
  color: var(--ink);
}
.invitation__and {
  display: block;
  font-weight: 500;
  font-style: italic;
  font-size: 1.1rem;
  color: var(--gold-strong);
}

.invitation__person {
  margin-top: 0.85rem;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(2.1rem, 9vw, 2.6rem);
  line-height: 1.1;
  color: var(--heading);
}

.invitation__parent {
  font-size: 0.9375rem;
  color: var(--ink-soft);
}

.invitation__with {
  margin-top: 0.6rem;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.3rem;
  color: var(--gold-strong);
}

.invitation__close {
  max-width: 26rem;
  margin-top: 1.75rem;
}

/* ---------- Verse band ---------- */

.verse {
  position: relative;
  padding: clamp(3.75rem, 13vw, 5.75rem) var(--gutter);
  border-block: 1px solid var(--band-rule);
  background-color: var(--band-bg);
  background-image: var(--band-grain), var(--band-lattice);
  color: var(--band-ink);
  text-align: center;
}
.verse::before,
.verse::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--band-rule);
  opacity: 0.55;
}
.verse::before { top: 5px; }
.verse::after { bottom: 5px; }

.verse__inner { max-width: var(--measure); margin: 0 auto; }
.verse__star { width: 24px; height: 24px; margin: 0 auto 1.5rem; color: var(--band-rule); }
.verse .ayah__arabic { color: var(--band-arabic); }
.verse .ayah__english { color: var(--band-ink); }
.verse .ayah__source { color: var(--band-source); }

/* ---------- Programme ---------- */

.programme__list {
  max-width: 26rem;
  margin: 2.25rem auto 0;
  padding: 0;
  list-style: none;
  text-align: start;
}

.programme__item {
  position: relative;
  display: grid;
  grid-template-columns: 4.6rem 1.5rem minmax(0, 1fr);
  column-gap: 0.6rem;
  padding-bottom: 1.75rem;
}
.programme__item:last-child { padding-bottom: 0; }

/* The thread joining one step to the next */
.programme__item:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 1.75rem;
  bottom: 0.3rem;
  inset-inline-start: calc(4.6rem + 0.6rem + 0.75rem);
  width: 1px;
  background: var(--line);
}

.programme__time {
  padding-top: 0.2rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  line-height: 1.3;
  text-align: end;
  white-space: nowrap;
  color: var(--gold-text);
  font-variant-numeric: lining-nums;
}

.programme__node {
  justify-self: center;
  width: 18px;
  height: 18px;
  margin-top: 0.35rem;
  color: var(--gold);
}

.programme__title { font-size: 1.45rem; }

.programme__text {
  margin-top: 0.15rem;
  font-size: 0.975rem;
  color: var(--ink-soft);
}

/* ---------- Arched cards ---------- */

.arch-card {
  position: relative;
  color: var(--card-ink);
  isolation: isolate;
  max-width: 30rem;
  margin: 0 auto;
  padding: clamp(6.25rem, 27vw, 7.5rem) clamp(1.25rem, 6vw, 2.25rem) 2.5rem;
}

.arch-card__art {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 10px 24px var(--shadow));
}
.arch-card__art .fill { fill: var(--card-bg); stroke: var(--card-line); stroke-width: 1.3; }
.arch-card__art .inner { fill: none; stroke: var(--card-line); stroke-width: 0.7; opacity: 0.8; }
.arch-card .section__title { color: var(--card-heading); }

.arch-card__ornament {
  position: absolute;
  top: clamp(2.6rem, 11vw, 3.1rem);
  left: 50%;
  width: 30px;
  height: 30px;
  transform: translateX(-50%);
  color: var(--card-line);
}

.no-js .arch-card {
  border: 1px solid var(--card-line);
  border-radius: 50% 50% 4px 4px / 7rem 7rem 4px 4px;
  background: var(--card-bg);
}

/* ---------- Details ---------- */

.details__list {
  display: grid;
  gap: 1.35rem;
  margin: 1.75rem 0 0;
}

.details__list dt {
  font-size: 0.875rem;
  letter-spacing: 0.03em;
  color: var(--card-label);
}

.details__list dd {
  margin: 0.15rem 0 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.4rem;
  line-height: 1.35;
  color: var(--card-ink);
}

address { font-style: normal; }
.details__list dd address { font-size: 1.25rem; line-height: 1.4; }

/* ---------- Map ---------- */

.map__frame {
  position: relative;
  max-width: 32rem;
  aspect-ratio: 4 / 3;
  margin: 1.75rem auto 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--paper-raised);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28'%3E%3Cg fill='none' stroke='%23B8914A' stroke-opacity='.35' stroke-width='.8'%3E%3Crect x='8.5' y='8.5' width='11' height='11'/%3E%3Crect x='8.5' y='8.5' width='11' height='11' transform='rotate(45 14 14)'/%3E%3Cpath d='M14 0V6.22M14 21.78V28M0 14H6.22M21.78 14H28M0 0L8.5 8.5M28 0L19.5 8.5M28 28L19.5 19.5M0 28L8.5 19.5'/%3E%3C/g%3E%3C/svg%3E");
}

.map__iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.map__frame.is-loaded .map__iframe { opacity: 1; }

.map__load {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--paper-raised);
}
.map__load:active { transform: translate(-50%, -50%) scale(0.98); }
.map__load:hover { background: var(--paper); }
.map__frame.is-loaded .map__load { display: none; }

/* ---------- RSVP ---------- */

.rsvp__returning {
  max-width: 28rem;
  margin: 1.25rem auto 0;
  padding: 0.75rem 1rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  font-size: 0.9375rem;
  color: var(--ink-soft);
}

.rsvp__form {
  display: grid;
  gap: 1.35rem;
  max-width: 28rem;
  margin: 2rem auto 0;
  text-align: start;
}

.field { margin: 0; padding: 0; border: 0; min-width: 0; }

.field__label {
  display: block;
  margin-bottom: 0.45rem;
  padding: 0;
  font-weight: 500;
  font-size: 0.9375rem;
  color: var(--ink);
}

.field__optional { font-weight: 400; color: var(--ink-soft); }

.field__input {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 0.75rem 0.95rem;
  border: 1px solid var(--field-border);
  border-radius: 10px;
  background: var(--field-bg);
  color: var(--ink);
  font: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field__input::placeholder { color: var(--ink-soft); opacity: 0.6; }
.field__input:focus-visible {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(184, 145, 74, 0.35);
}
.field__input--area { min-height: 6.5rem; resize: vertical; }

.field.is-invalid .field__input,
.field.is-invalid .choice__option span { border-color: var(--error); }

.field__error {
  margin-top: 0.4rem;
  font-size: 0.875rem;
  color: var(--error);
}

.choice {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.choice__option { position: relative; display: block; }

.choice__option input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.choice__option span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--field-border);
  border-radius: 10px;
  background: var(--field-bg);
  font-size: 0.9375rem;
  line-height: 1.3;
  text-align: center;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.choice__option input:checked + span {
  border-color: var(--accent);
  background: rgba(184, 145, 74, 0.14);
  box-shadow: inset 0 0 0 1px var(--accent);
  color: var(--heading);
  font-weight: 500;
}

.choice__option input:focus-visible + span {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.stepper {
  display: inline-flex;
  direction: ltr;
  overflow: hidden;
  border: 1px solid var(--field-border);
  border-radius: 10px;
  background: var(--field-bg);
}

.stepper__btn {
  width: 52px;
  min-height: 52px;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: 400 1.5rem/1 var(--font-body);
  cursor: pointer;
}
.stepper__btn:hover { background: rgba(184, 145, 74, 0.12); }
.stepper__btn:focus-visible { outline-offset: -3px; }

.stepper__input {
  width: 4.25rem;
  border: 0;
  border-inline: 1px solid var(--field-border);
  background: transparent;
  color: var(--ink);
  font: 500 1.15rem var(--font-body);
  text-align: center;
  -moz-appearance: textfield;
  appearance: textfield;
}
.stepper__input::-webkit-outer-spin-button,
.stepper__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper__input:focus-visible { outline-offset: -3px; }

.field[data-guests][hidden] { display: none; }

.field--trap {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
}

.rsvp__hint {
  margin-top: -0.5rem;
  font-size: 0.875rem;
  text-align: center;
  color: var(--ink-soft);
}

.rsvp__status {
  font-size: 0.9375rem;
  text-align: center;
  color: var(--error);
}
.rsvp__status:empty { display: none; }
.rsvp__status a { color: inherit; font-weight: 500; }

.rsvp__form.is-sending [data-rsvp-submit] { opacity: 0.7; pointer-events: none; }

.rsvp__thanks {
  max-width: 26rem;
  margin: 2rem auto 0;
  padding: 2rem 1.5rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-raised);
}
.rsvp__thanks-star { width: 28px; height: 28px; margin: 0 auto 0.75rem; color: var(--gold); }
.rsvp__thanks-title { font-size: 1.9rem; }
.rsvp__thanks-text { margin: 0.6rem 0 0.5rem; color: var(--ink-soft); }

.rsvp__closed {
  max-width: 26rem;
  margin: 1.5rem auto 0;
  font-family: var(--font-display);
  font-size: 1.3rem;
}

/* ---------- Guest notes ---------- */

.notes__list {
  display: grid;
  gap: 2rem;
  max-width: 28rem;
  margin: 2.25rem auto 0;
  padding: 0;
  list-style: none;
}

.notes__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.notes__star { width: 18px; height: 18px; margin-bottom: 0.2rem; color: var(--gold); }
.notes__title { font-size: 1.5rem; }
.notes__text { color: var(--ink-soft); }

/* ---------- Contacts ---------- */

.contacts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: 1rem;
  max-width: 34rem;
  margin: 2rem auto 0;
  padding: 0;
  list-style: none;
}

.contacts__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
  padding: 1.5rem 1rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-raised);
}

.contacts__name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.5rem;
  line-height: 1.25;
  color: var(--heading);
}

.contacts__number {
  font-size: 0.9375rem;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  unicode-bidi: isolate;
}

.contacts__role {
  font-size: 0.9375rem;
  color: var(--gold-text);
}

/* Buttons sit on the same line in both cards, whatever is above them */
.contacts__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.85rem;
}
.contacts__actions .btn { min-height: 46px; padding-inline: 1.1rem; }

html[lang="ur"] .contacts__name { font-size: 1.35rem; line-height: 2; }

/* ---------- Card linking to the other event ---------- */

.crosslink { padding-top: 1.5rem; }

.arch-card--sister {
  --card-bg: var(--sister-bg);
  --card-ink: var(--sister-ink);
  --card-heading: var(--sister-gold);
  --card-line: var(--sister-gold);
}
.arch-card--sister .arch-card__ornament { width: 34px; height: 34px; }
.arch-card--sister .section__title { font-size: clamp(1.85rem, 7vw, 2.4rem); }
.arch-card--sister .btn:focus-visible { outline-color: var(--sister-gold); }

.crosslink__when {
  margin-top: 0.9rem;
  font-size: 1.05rem;
  color: var(--sister-soft);
}

/* ---------- Footer ---------- */

.footer {
  padding: 4rem var(--gutter) calc(4.5rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  text-align: center;
}

.footer__symbol { width: 30px; height: 30px; margin: 0 auto 1.25rem; color: var(--gold); }

.footer__dua {
  font-size: clamp(1.4rem, 6vw, 2rem);
  line-height: 2;
  color: var(--heading);
}

.footer__translit {
  max-width: 28rem;
  margin: 0.6rem auto 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.2rem;
  line-height: 1.45;
}

.footer__meaning {
  max-width: 26rem;
  margin: 0.6rem auto 0;
  color: var(--ink-soft);
}

.footer__sign {
  margin-top: 2.25rem;
  font-size: 0.9375rem;
  color: var(--gold-text);
}

/* ---------- Music ---------- */

.music {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 50;
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  padding: 0;
  border: 1px solid var(--gold);
  border-radius: 50%;
  background: var(--paper-raised);
  color: var(--accent);
  box-shadow: 0 6px 18px var(--shadow);
  cursor: pointer;
}
.music[hidden] { display: none; }
.music svg { width: 22px; height: 22px; }

.music__bars { display: none; align-items: flex-end; gap: 3px; height: 16px; }
.music__bars i {
  width: 3px;
  height: 100%;
  border-radius: 2px;
  background: currentColor;
  transform-origin: bottom;
  animation: bars 1.1s ease-in-out infinite;
}
.music__bars i:nth-child(2) { animation-delay: -0.35s; }
.music__bars i:nth-child(3) { animation-delay: -0.7s; }

.music[aria-pressed="true"] .music__icon { display: none; }
.music[aria-pressed="true"] .music__bars { display: flex; }

@keyframes bars {
  0%, 100% { transform: scaleY(0.35); }
  50% { transform: scaleY(1); }
}

/* ---------- Languages ---------- */

.i18n-empty { display: none !important; }

html.lang-pending .gate__center,
html.lang-pending .page { visibility: hidden; }

.lang-switch { display: none; }
.js .lang-switch {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.25rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  direction: ltr;
}

.lang-switch__btn {
  min-width: 5.25rem;
  min-height: 40px;
  padding: 0.2rem 1rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  font: 500 0.95rem/1 "Jost", "Segoe UI", system-ui, sans-serif;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.lang-switch__btn[lang="ur"] {
  padding-bottom: 0.45rem;
  font-family: var(--font-urdu);
  font-size: 1.1rem;
  line-height: 1.5;
}
.lang-switch__btn[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.lang-switch__btn:not([aria-pressed="true"]):hover { color: var(--ink); }

.gate .lang-switch { margin-top: 1.5rem; border-color: rgba(212, 179, 106, 0.45); }
.gate .lang-switch__btn { color: var(--gate-ink); }
.gate .lang-switch__btn[aria-pressed="true"] { background: var(--gate-gold); color: var(--gate-panel); }
.gate .lang-switch__btn:focus-visible { outline-color: var(--gate-gold); }

.footer .lang-switch { margin-top: 2.25rem; }

/* Right-to-left (Urdu) */
[dir="rtl"] .divider::before { background: linear-gradient(to left, transparent, var(--line)); }
[dir="rtl"] .divider::after { background: linear-gradient(to right, transparent, var(--line)); }
[dir="rtl"] .hero__event::before { background: linear-gradient(to left, transparent, var(--foil-2)); }
[dir="rtl"] .hero__event::after { background: linear-gradient(to right, transparent, var(--foil-2)); }
[dir="rtl"] .field__input[type="tel"] { direction: ltr; text-align: right; }

/* Urdu type: Nastaliq for Urdu letters, the usual fonts for numbers.
   Nastaliq is tall, so lines get more room. */
html[lang="ur"] {
  --font-display: "Cormorant Garamond", "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", serif;
  --font-body: "Jost", "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", sans-serif;
  font-synthesis: none;
  font-variant-numeric: lining-nums;
}
html[lang="ur"] body { font-size: 1.125rem; line-height: 2.2; }
html[lang="ur"] h1,
html[lang="ur"] h2,
html[lang="ur"] h3 { line-height: 2; }
html[lang="ur"] .hero__event,
html[lang="ur"] .details__list dt { letter-spacing: 0; }
html[lang="ur"] .hero__names { font-size: clamp(2.2rem, 10vw, 3.5rem); line-height: 1.9; }
html[lang="ur"] .hero__amp { margin: -0.35em 0 -0.25em; }
html[lang="ur"] .gate__names { font-size: clamp(2.3rem, 10vw, 3.2rem); line-height: 2; }
html[lang="ur"] .gate__sub,
html[lang="ur"] .gate__greeting { line-height: 2.1; }
html[lang="ur"] .section__title { font-size: clamp(1.7rem, 6.6vw, 2.3rem); }
html[lang="ur"] .section__title-sub { margin-top: 0; font-size: 0.68em; }
html[lang="ur"] .invitation__greeting { font-size: 1.45rem; line-height: 2; }
html[lang="ur"] .invitation__hosts { font-size: 1.35rem; line-height: 2; }
html[lang="ur"] .invitation__person { font-size: clamp(1.9rem, 8vw, 2.4rem); line-height: 2; }
html[lang="ur"] .invitation__with { font-size: 1.2rem; }
html[lang="ur"] .ayah__english { font-size: clamp(1.1rem, 4.5vw, 1.3rem); line-height: 2.3; }
html[lang="ur"] .details__list dd { font-size: 1.3rem; line-height: 2.1; }
html[lang="ur"] .details__list dd address { font-size: 1.15rem; line-height: 2.2; }
html[lang="ur"] .programme__item { grid-template-columns: 5rem 1.5rem minmax(0, 1fr); }
html[lang="ur"] .programme__item:not(:last-child)::after { inset-inline-start: calc(5rem + 0.6rem + 0.75rem); top: 2.2rem; }
html[lang="ur"] .programme__time { padding-top: 0; font-size: 1.05rem; line-height: 2; }
html[lang="ur"] .programme__node { margin-top: 0.75rem; }
html[lang="ur"] .programme__title { font-size: 1.35rem; }
html[lang="ur"] .notes__title { font-size: 1.4rem; }
html[lang="ur"] .btn { padding-block: 0.3rem; line-height: 2; }
html[lang="ur"] .field__label { font-size: 1.05rem; line-height: 2; }
html[lang="ur"] .choice__option span { line-height: 1.9; }
html[lang="ur"] .countdown__label { font-size: 0.95rem; line-height: 2; }
html[lang="ur"] .rsvp__thanks-title { font-size: 1.7rem; }

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .arch-line { stroke-dasharray: none; stroke-dashoffset: 0; }
  .js .hero__lattice,
  .js .hero__symbol,
  .js .hero__content > * { opacity: 1; transform: none; }
  .js.is-ready .arch-line,
  .js.is-ready .hero__lattice,
  .js.is-ready .hero__symbol,
  .js.is-ready .hero__content > * { animation: none; }
  .js [data-reveal] { opacity: 1; transform: none; transition: none; }
  .gate__door { transition: none; }
  .gate.is-opening .gate__door { transform: none; }
  .music__bars i { animation: none; }
  .wa { animation: none; }
}
