/* Layout concept: a Persian illuminated manuscript. An envelope with a wax seal holds a folded card with two palace
   doors; behind the doors, a long ivory scroll (tumar) with a gold-leaf border carries the names inside a medallion
   (toranj). Every colour comes from a palette token the engine sets on :root. */
@font-face { font-family: "Noto Nastaliq Urdu"; font-weight: 500; font-display: swap; src: url(../fonts/noto-nastaliq-urdu-arabic-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Noto Nastaliq Urdu"; font-weight: 700; font-display: swap; src: url(../fonts/noto-nastaliq-urdu-arabic-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Markazi Text"; font-weight: 400; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+200C-200E, U+FB50-FDFF, U+FE70-FEFC; src: url(../fonts/markazi-text-arabic-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Markazi Text"; font-weight: 600; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+200C-200E, U+FB50-FDFF, U+FE70-FEFC; src: url(../fonts/markazi-text-arabic-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Markazi Text"; font-weight: 400; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F; src: url(../fonts/markazi-text-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Markazi Text"; font-weight: 600; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F; src: url(../fonts/markazi-text-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-weight: 500; font-display: swap; src: url(../fonts/cormorant-garamond-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-weight: 700; font-display: swap; src: url(../fonts/cormorant-garamond-latin-700-normal.woff2) format("woff2"); }

:root {
  color-scheme: dark;
  --band: clamp(22px, 6vw, 32px);
  --frame: calc(var(--band) + 7px);
  --ew: 340px;
}
:root[data-font="nastaliq-markazi"] {
  --font-display: "Noto Nastaliq Urdu", "Markazi Text", serif;
  --font-body: "Markazi Text", serif;
  --lh-prelude: 2.2; --lh-guest: 2.5; --lh-verse: 2.5; --lh-name: 1.86; --lh-heading: 2.3;
}
:root[data-font="naskh-markazi"] {
  --font-display: "Markazi Text", serif;
  --font-body: "Markazi Text", serif;
  --lh-prelude: 1.6; --lh-guest: 1.7; --lh-verse: 1.75; --lh-name: 1.35; --lh-heading: 1.55;
  /* Naskh sits smaller on its body than Nastaliq, so the couplet is set larger to keep its place on the scroll. */
  --verse-scale: 1.32;
}
:root[data-font="serif-latin"] {
  --font-display: "Cormorant Garamond", "Markazi Text", serif;
  --font-body: "Markazi Text", serif;
  --lh-prelude: 1.4; --lh-guest: 1.5; --lh-verse: 1.5; --lh-name: 1.3; --lh-heading: 1.4;
}
[hidden] { display: none !important; }
html, body { min-height: 100%; }
#invite, #invite *, #invite *::before, #invite *::after { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--deep-950);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 21px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
#invite { position: relative; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: max(16px, env(safe-area-inset-top, 0px)) 44px; overflow-x: clip; }
#invite.blank { visibility: hidden; }
.defs-holder { position: absolute; }
.unseen { visibility: hidden; }

/* Night sky behind everything */
.sky { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
  background:
    radial-gradient(90vmax 70vmax at 50% 42%, var(--sky-glow), transparent 68%),
    linear-gradient(180deg, var(--deep-900), var(--deep-950)); }
.sky::before { content: ""; position: absolute; inset: 0; background-image: var(--khatam-faint); background-size: 72px 72px; opacity: .55;
  -webkit-mask-image: radial-gradient(circle at 50% 45%, #000 12%, transparent 78%); mask-image: radial-gradient(circle at 50% 45%, #000 12%, transparent 78%); }
.sky svg { position: absolute; top: 50%; width: 62vh; height: 62vh; opacity: .09; display: none; }
.sky .sun-r { right: 0; transform: translate(50%, -50%); }
.sky .sun-l { left: 0; transform: translate(-50%, -50%); }
@media (min-width: 1000px) { .sky svg { display: block; } }
#dust { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 30; pointer-events: none; }

/* Stage: envelope and doors */
#stage { position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(14px, 3.4vh, 30px); text-align: center; }
.prelude { font-family: var(--font-display); font-weight: 500; color: var(--gold-hi); font-size: clamp(25px, 6.6vw, 38px); line-height: var(--lh-prelude); margin: 0; text-shadow: 0 2px 22px var(--text-shadow); }
.hint { display: inline-flex; align-items: center; gap: 8px; margin: 0; color: var(--ivory); font-size: 21px; opacity: .9; }
.hint i { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); animation: beat 1.8s ease-in-out infinite; }
@keyframes beat { 50% { transform: scale(1.7); opacity: .45; } }

#envbox { position: relative; width: var(--ew); aspect-ratio: 1000 / 704; cursor: pointer; flex: none; }
.layer { position: absolute; inset: 0; }
.layer svg { display: block; width: 100%; height: 100%; overflow: visible; }
.l-back { z-index: 1; filter: drop-shadow(0 26px 34px var(--shadow)); }
.l-flap { z-index: 5; pointer-events: none; }
.l-front { z-index: 4; }
.l-seal { z-index: 6; pointer-events: none; }
.pocket { position: absolute; inset: 0; }
.flap-behind .l-flap { z-index: 2; }
.flap { position: absolute; top: 0; left: 0; width: 100%; aspect-ratio: 1000 / 470; transform-origin: 50% 0; transform: perspective(1400px) rotateX(0deg); }
.flap-face { position: absolute; inset: 0; }
.flap-face.inner { transform: rotateX(180deg); visibility: hidden; }
.flap-behind .flap-face.inner { visibility: visible; }
.flap-behind .flap-face.outer { visibility: hidden; }
.guest { position: absolute; left: 0; right: 0; bottom: 3.5%; text-align: center; margin: 0; font-family: var(--font-display); font-weight: 500; color: var(--gold-hi); font-size: calc(var(--ew) * .043); line-height: var(--lh-guest); }
#sealBtn { position: absolute; left: 50%; top: 62.5%; width: 21%; aspect-ratio: 1; transform: translate(-50%, -50%); padding: 0; border: 0; background: none; cursor: pointer; pointer-events: auto; border-radius: 50%; }
#sealBtn:focus-visible { outline: 3px solid var(--gold-hi); outline-offset: 5px; }
#sealBtn::before { content: ""; position: absolute; inset: -9%; border-radius: 50%; background: radial-gradient(circle, var(--glow-gold), transparent 70%); animation: glow 2.8s ease-in-out infinite; }
@keyframes glow { 0%, 100% { opacity: .15; transform: scale(.92); } 50% { opacity: 1; transform: scale(1.22); } }
#sealBtn svg { position: relative; display: block; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 5px 7px var(--wax-shadow)); }
.opening #sealBtn::before { animation: none; opacity: 0; }

#card { position: fixed; z-index: 3; perspective: 1500px; transform-origin: 50% 50%; }
.card-top #card { z-index: 7; }
.door { position: absolute; top: 0; bottom: 0; width: 50%; box-shadow: 0 18px 60px var(--shadow); }
.door svg { display: block; width: 100%; height: 100%; }
.door.left { left: 0; transform-origin: 0 50%; }
.door.right { right: 0; transform-origin: 100% 50%; }
#bloom { position: absolute; inset: 0; opacity: 0; pointer-events: none; background: radial-gradient(ellipse 60% 50% at 50% 50%, var(--bloom-core), var(--bloom-mid) 45%, transparent 75%); }
#skip { position: fixed; z-index: 31; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); border: 0; background: var(--veil); color: var(--ivory); font: inherit; font-size: 18px; padding: 3px 16px 5px; border-radius: 99px; cursor: pointer; }
#sound { position: fixed; z-index: 32; top: calc(12px + env(safe-area-inset-top, 0px)); inset-inline-end: calc(12px + env(safe-area-inset-left, 0px)); width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line-gold); border-radius: 50%; background: var(--veil); color: var(--gold-hi); cursor: pointer; padding: 0; }
#sound svg { width: 20px; height: 20px; }
#sound[aria-pressed="false"] .wave { display: none; }
#sound[aria-pressed="true"] .mute { display: none; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--gold-hi); outline-offset: 3px; }

/* The scroll */
#tumar { position: relative; z-index: 1; width: min(100%, 600px); margin-inline: auto; padding: var(--frame) calc(var(--frame) + clamp(10px, 3vw, 22px)); box-shadow: 0 30px 90px var(--shadow);
  background: radial-gradient(120% 46vh at 50% 34vh, var(--paper-light), transparent 80%), var(--noise), linear-gradient(90deg, var(--ivory-deep), var(--ivory) 14%, var(--ivory) 86%, var(--ivory-deep)); }
.strip, .corner { position: absolute; background-color: var(--deep-800); box-shadow: 0 0 0 1px var(--gold), 0 0 0 3px var(--ivory), 0 0 0 4px var(--gold-lo); }
.strip.top, .strip.bottom { left: calc(7px + var(--band)); right: calc(7px + var(--band)); height: var(--band); background-image: var(--band-h); background-size: auto 100%; background-repeat: round; }
.strip.top { top: 7px; } .strip.bottom { bottom: 7px; }
.strip.side-r, .strip.side-l { top: calc(7px + var(--band)); bottom: calc(7px + var(--band)); width: var(--band); background-image: var(--band-v); background-size: 100% auto; background-repeat: round; }
.strip.side-r { right: 7px; } .strip.side-l { left: 7px; }
.corner { width: var(--band); height: var(--band); background-image: var(--corner); background-size: 100% 100%; z-index: 1; }
.c1 { top: 7px; right: 7px; } .c2 { top: 7px; left: 7px; } .c3 { bottom: 7px; right: 7px; } .c4 { bottom: 7px; left: 7px; }

.hero { display: flex; flex-direction: column; align-items: center; justify-content: space-evenly; gap: 10px; text-align: center; min-height: calc(min(100vh, 900px) - 32px - var(--frame)); min-height: calc(min(100svh, 900px) - 32px - var(--frame)); padding-block: 8px 2px; }
.verse { margin: 0; font-family: var(--font-display); font-weight: 500; color: var(--deep-800); font-size: calc(clamp(13.5px, 3.75vw, 19px) * var(--verse-scale, 1)); line-height: var(--lh-verse); }
.verse span { display: block; text-wrap: balance; }
.lead { margin: 0; color: var(--ink-soft); font-size: clamp(20px, 5.4vw, 24px); line-height: 1.32; text-wrap: balance; max-width: 26em; }
.names-wrap { position: relative; margin-block: 14px; width: min(100%, 430px); padding-block: clamp(34px, 9.5vw, 52px); }
.names-wrap > svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.names { position: relative; margin: 0; font-family: var(--font-display); font-weight: 700; display: flex; flex-direction: column; align-items: center; line-height: 1; }
.name { display: block; font-size: var(--name-size, 48px); line-height: var(--lh-name); padding-inline: .3em; white-space: nowrap; color: var(--gold-hi);
  background: linear-gradient(100deg, var(--leaf-1) 0%, var(--gold-hi) 26%, var(--leaf-3) 48%, var(--leaf-4) 62%, var(--leaf-5) 100%); background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; animation: leaf 7s linear infinite; }
@keyframes leaf { to { background-position: -220% 0; } }
.and { display: block; font-weight: 500; font-size: calc(var(--name-size, 48px) * .46); line-height: 1.2; color: var(--ivory); margin-block: -.25em; }
.when { display: grid; gap: 0; color: var(--ink); }
.when b { font-weight: 600; font-size: clamp(25px, 6.8vw, 31px); line-height: 1.2; color: var(--deep-800); }
.when span { font-size: clamp(20px, 5.4vw, 23px); line-height: 1.25; }
.when small { font-size: 16px; letter-spacing: .1em; color: var(--ink-soft); line-height: 1.5; }
.more { color: var(--gold-lo); font-size: 18px; line-height: 1; display: grid; justify-items: center; gap: 2px; }
.more svg { width: 18px; height: 11px; animation: nudge 1.9s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateY(5px); } }

.ornament { display: block; width: min(100%, 300px); height: auto; margin: 22px auto 10px; }
.panel { display: grid; gap: 16px; justify-items: center; text-align: center; padding-block: 8px 12px; }
.panel h2 { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: clamp(25px, 7vw, 32px); line-height: var(--lh-heading); color: var(--deep-800); text-wrap: balance; }

.calendar { width: min(100%, 360px); background: var(--deep-800); color: var(--ivory); padding: 12px 14px 16px; box-shadow: 0 0 0 1px var(--gold), 0 0 0 4px var(--deep-800), 0 0 0 5px var(--gold-lo), 0 16px 30px var(--cal-shadow); }
.cal-title { font-weight: 600; font-size: 24px; color: var(--gold-hi); margin-bottom: 6px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 1px; font-variant-numeric: tabular-nums; font-size: 20px; line-height: 1.55; }
.cal-grid .wd { color: var(--gold); font-size: 16px; }
.cal-grid .today { position: relative; color: var(--gold-hi); font-weight: 600; }
.cal-grid .today svg { position: absolute; left: 50%; top: 50%; width: 42px; height: 38px; transform: translate(-50%, -50%); overflow: visible; }
.count { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: min(100%, 360px); }
.count div { display: grid; gap: 0; padding-block: 2px 6px; border-block: 1px solid var(--gold); }
.count b { font-weight: 600; font-size: clamp(30px, 8.6vw, 38px); line-height: 1.15; color: var(--deep-800); font-variant-numeric: tabular-nums; }
.count span { font-size: 17px; color: var(--ink-soft); line-height: 1.1; }
.count-note { margin: 0; color: var(--ink-soft); }

.program { list-style: none; margin: 0; padding: 0; width: min(100%, 390px); display: grid; text-align: start; }
.program li { position: relative; display: grid; grid-template-columns: 58px 1fr; column-gap: 34px; padding-block: 8px 12px; min-width: 0; }
.program li::before { content: ""; position: absolute; inset-inline-start: 75px; top: 21px; bottom: -21px; width: 1px; background: var(--gold); }
.program li:last-child::before { display: none; }
.program li::after { content: ""; position: absolute; inset-inline-start: 70px; top: 16px; width: 11px; height: 11px; background: var(--accent); box-shadow: 0 0 0 1.5px var(--gold); transform: rotate(45deg); }
.program time { font-weight: 600; font-size: 24px; color: var(--deep-800); line-height: 1.25; font-variant-numeric: tabular-nums; }
.program strong { display: block; font-weight: 600; font-size: 24px; line-height: 1.25; }
.program span { display: block; color: var(--ink-soft); font-size: 20px; line-height: 1.25; }

.venue-name { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: clamp(25px, 7.4vw, 34px); line-height: var(--lh-heading); color: var(--accent-text); }
.venue-addr { margin: -6px 0 0; max-width: 24em; text-wrap: balance; user-select: all; -webkit-user-select: all; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 3px 20px 6px; font: inherit; font-size: 21px; font-weight: 600; line-height: 1.1; border-radius: 2px; text-decoration: none; cursor: pointer; border: 1px solid var(--gold-lo); background: transparent; color: var(--deep-800); transition: background .25s, color .25s; }
.btn.solid { background: var(--deep-800); color: var(--gold-hi); box-shadow: inset 0 0 0 3px var(--deep-800), inset 0 0 0 4px var(--gold); border-color: var(--deep-800); }
.btn:hover { background: var(--deep-700); color: var(--gold-hi); }
.shamdan { width: min(62%, 210px); height: auto; display: block; }
.flame { transform-box: fill-box; transform-origin: 50% 100%; animation: flicker 2.3s ease-in-out infinite; }
.flame.b { animation-delay: -1.1s; }
@keyframes flicker { 30% { transform: scale(.92, 1.08); } 60% { transform: scale(1.05, .95) skewX(2deg); } }
.hosts { margin: -8px 0 0; color: var(--ink-soft); }
.again { border: 0; background: none; font: inherit; font-size: 19px; color: var(--ink-soft); text-decoration: underline; text-underline-offset: 4px; cursor: pointer; padding: 6px 10px 10px; }

/* A still preview (`motion.still`): nothing animates or transitions. */
html.still *, html.still *::before, html.still *::after { animation: none !important; transition: none !important; }

@media (prefers-reduced-motion: reduce) {
  .name, .more svg, .flame, .hint i, #sealBtn::before { animation: none; }
}
