/* FALAH Invitations: shared base. Each page sets these variables and adds its own layout:
   --bg (page colour), --text, --muted, --accent, --accent-ink (text on accent), --field-bg, --field-line, --choice, --choice-on,
   --script, --serif, --num (font for numbers) */
* { box-sizing: border-box; }
html, body { margin: 0; overflow-x: clip; }
html { background: var(--bg); }   /* body stays transparent so the fixed background picture (body::before) shows */
main, section { overflow-x: clip; }
body { font-family: var(--serif); color: var(--text); font-variant-numeric: lining-nums; -webkit-font-smoothing: antialiased; text-align: center; }
body.locked { overflow: hidden; height: 100svh; }
img { display: block; max-width: 100%; height: auto; }
.mul { mix-blend-mode: multiply; }
[hidden] { display: none !important; }
.guest { font-size: 21px; font-style: italic; margin: 30px 0 0; }

/* cover */
.cover { background: var(--bg); position: fixed; inset: 0; z-index: 10; cursor: pointer; overflow: hidden; transition: opacity .9s ease .5s, visibility 0s 1.5s; }
.opened .cover { opacity: 0; visibility: hidden; }
.cover .env { transition: transform 1.2s cubic-bezier(.5,0,.2,1); }
.opened .cover .env { transform: translateY(-6vh) scale(1.12) rotate(-3deg); }
.tap { animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .4; } }
/* main is always visible under the cover (the cover fades away). No opacity/transform on wrappers of .mul images:
   those make an isolated layer and the white image backgrounds would show as boxes. */
.rise { position: relative; top: 24px; transition: top 1.4s cubic-bezier(.2,.7,.2,1) 1s; }
.opened .rise { top: 0; }

/* falling effect */
.fx { position: fixed; top: -30px; z-index: 30; pointer-events: none; animation: fall var(--d) cubic-bezier(.35,.1,.6,1) var(--delay) forwards; opacity: 0; }
.spark { width: var(--s); height: var(--s); border-radius: 50%; background: radial-gradient(circle, #FFF6D8 0 25%, var(--spark, #E2C27F) 45%, transparent 70%); }
.petal { width: var(--s); }
@keyframes fall {
  0% { opacity: 0; transform: translate(0, 0) rotate(var(--r0)); }
  10% { opacity: 1; }
  50% { transform: translate(var(--sway), 55vh) rotate(calc(var(--r0) + 160deg)); }
  85% { opacity: .9; }
  100% { opacity: 0; transform: translate(calc(var(--sway) * -.6), 112vh) rotate(calc(var(--r0) + 320deg)); }
}

/* arabic calligraphy */
.ar { display: block; font-family: "Aref Ruqaa", serif; font-weight: 700; line-height: 1.5; }

/* countdown */
.digits { display: flex; justify-content: center; align-items: flex-start; gap: 4px; font: 500 clamp(34px, 11vw, 56px)/1 var(--num); font-variant-numeric: lining-nums tabular-nums; }
.digits b { display: block; font-weight: inherit; }
.digits span { display: block; font: 12px/1 var(--num); letter-spacing: .1em; margin-top: 10px; color: var(--muted); }
.digits i { font-style: normal; opacity: .5; }

/* RSVP form */
form { text-align: left; display: grid; gap: 16px; }
label, .q { font-size: 17px; display: block; margin-bottom: 7px; color: var(--muted); }
input[type=number] { font-family: var(--num) !important; }
input[type=text], input[type=number], textarea { width: 100%; font: 19px var(--serif); font-variant-numeric: lining-nums; color: var(--text); padding: 12px; border: 1px solid var(--field-line); border-radius: 10px; background: var(--field-bg); }
.choice { display: grid; gap: 8px; }
.choice label { margin: 0; position: relative; }
.choice input { position: absolute; opacity: 0; }
.choice span { display: block; padding: 13px 14px; border-radius: 10px; background: var(--choice); color: var(--text); font-size: 18px; border: 1px solid transparent; }
.choice input:checked + span { border-color: var(--accent); background: var(--choice-on); }
.choice input:checked + span::before { content: "✓ "; color: var(--accent); }
.choice input:focus-visible + span, input:focus-visible, textarea:focus-visible, .send:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.send { font: 600 17px var(--serif); letter-spacing: .14em; text-transform: uppercase; color: var(--accent-ink); background: var(--accent); border: 0; border-radius: 999px; padding: 15px; cursor: pointer; }
.send:disabled { opacity: .6; }
.msg { text-align: center; font-size: 18px; min-height: 1.3em; margin: 0; }
.msg.err { color: #A11B1B; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01s !important; transition-delay: 0s !important; }
  .fx { display: none; }
}
