/* Farida & Mohamed — the invitation PDF, brought to life.
   Colours are sampled from the invitation itself. */
:root {
  --cream: #ece3cd;
  --cream-2: #e9e1cb;
  --ink: #3f221d;
  --brown: #2a1714;
  --olive: #2f3320;
  --gold: #c9a467;
  --gold-hi: #f3dca4;
  --col: min(100vw, 560px);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--brown);
  color: var(--cream);
  font-family: "Cormorant Garamond", Georgia, serif;
  overflow-x: hidden;
}
body.locked { overflow: hidden; height: 100svh; }
img { display: block; }
button { font: inherit; color: inherit; }

/* ---------- desktop backdrop ---------- */
.backdrop {
  position: fixed; inset: -40px; z-index: 0;
  background: url(assets/bg/bg0.jpg) center / cover;
  filter: blur(28px) brightness(.45) saturate(.9);
}
.stage-wrap {
  position: relative; z-index: 1;
  width: var(--col); margin: 0 auto;
  box-shadow: 0 0 120px rgba(0,0,0,.65);
}

/* ---------- the page canvas: all geometry in PDF points (1080 wide) ---------- */
.canvas {
  --u: calc(100cqw / 1080);
  container-type: inline-size;
  position: relative;
  width: 100%;
  aspect-ratio: 1080 / 8103.18;
  overflow: hidden;
  overflow: clip; /* clip, not hidden: a hidden overflow would stop the birds' layer from sticking */
  /* matches the artwork while tiles load: brown down to the mantel, olive below */
  background: linear-gradient(#3a221d 0 34.4%, var(--olive) 34.4% 97%, #2d2912 97%);
}
.tile, .el, .overlay {
  position: absolute;
  left: calc(var(--x) * var(--u));
  top: calc(var(--y) * var(--u));
  width: calc(var(--w) * var(--u));
  height: calc(var(--h) * var(--u));
}
.tile { z-index: 0; }
.tile img { width: 100%; height: 100%; }
.el { pointer-events: none; }
.el > .in, .el > .in > img { width: 100%; height: 100%; }
.el > .in { position: relative; }

/* ---------- entrance reveals (wrapper .el gets .on when it scrolls in) ---------- */
.r > .in { transition: opacity 1.4s var(--ease-out), transform 1.6s var(--ease-out), filter 1.4s var(--ease-out), clip-path 1.6s var(--ease-out); transition-delay: var(--d, 0s); }
.r-rise > .in   { opacity: 0; transform: translateY(calc(26 * var(--u))); }
.r-fade > .in   { opacity: 0; }
.r-wipe > .in   { clip-path: inset(0 100% 0 0); opacity: .2; transition-duration: 2.4s, 1s, 1s, 2.4s; }
.r-drop > .in   { opacity: 0; transform: translateY(calc(-60 * var(--u))); }
.r-bloom > .in  { opacity: 0; transform: scale(.82) rotate(var(--br, -5deg)); transform-origin: var(--o, 50% 100%); }
.r-left > .in   { opacity: 0; transform: translateX(calc(-120 * var(--u))) rotate(-4deg); transform-origin: 0 100%; }
.r-right > .in  { opacity: 0; transform: translateX(calc(120 * var(--u))) rotate(4deg); transform-origin: 100% 100%; }
.r-ink > .in    { opacity: 0; transform: scale(.9); filter: blur(10px); transition-duration: 2.2s; }
.r-rise-big > .in { opacity: 0; transform: translateY(calc(70 * var(--u))) scale(.97); }
.r.on > .in { opacity: 1; transform: none; filter: none; clip-path: inset(0 0 0 0); }

/* ---------- ambient loops (on the img, so they stack with the reveal) ---------- */
.vis.l-sway > .in > img   { animation: sway var(--dur, 9s) var(--ease-io) infinite alternate; transform-origin: var(--so, 50% 0); }
.vis.l-float > .in > img  { animation: float var(--dur, 11s) ease-in-out infinite alternate; }
.vis.l-spin > .in > img   { animation: spin var(--dur, 90s) linear infinite; }
.vis.l-breathe > .in > img { animation: breathe var(--dur, 7s) ease-in-out infinite alternate; transform-origin: var(--so, 50% 100%); }
.vis.l-pulse > .in > img  { animation: pulse 6s ease-in-out infinite alternate; }
.vis.l-flicker > .in > img { animation: flicker 3.2s steps(1) infinite; }
@keyframes sway    { from { transform: rotate(calc(var(--amp, 1.2deg) * -1)); } to { transform: rotate(var(--amp, 1.2deg)); } }
@keyframes float   { from { transform: translateX(calc(-14 * var(--u))); } to { transform: translateX(calc(14 * var(--u))); } }
@keyframes spin    { to { transform: rotate(360deg); } }
@keyframes breathe { from { transform: scale(1) rotate(0); } to { transform: scale(1.025) rotate(var(--amp, .8deg)); } }
@keyframes pulse   { from { filter: brightness(.96); } to { filter: brightness(1.12); } }
@keyframes flicker {
  0% { filter: brightness(1); } 13% { filter: brightness(1.07); } 21% { filter: brightness(.97); }
  37% { filter: brightness(1.1); } 52% { filter: brightness(1.02); } 68% { filter: brightness(1.12); }
  81% { filter: brightness(.98); } 92% { filter: brightness(1.06); }
}

/* candle glow sits above the candles */
.glow {
  display: none;
  position: absolute; inset: -12% -8% 30%;
  background: radial-gradient(ellipse at 50% 60%, rgba(255,214,150,.22), rgba(255,190,110,0) 65%);
  pointer-events: none;
  animation: glow 2.7s ease-in-out infinite alternate;
}
.vis .glow { display: block; }
@keyframes glow { 0% { opacity: .55; } 30% { opacity: .9; } 55% { opacity: .65; } 100% { opacity: 1; } }

/* gold-foil glint: a light band slides (transform only) inside a holder masked to the artwork */
.sheen {
  position: absolute; inset: 0; overflow: hidden; pointer-events: none;
  -webkit-mask: var(--src) center / 100% 100% no-repeat;
          mask: var(--src) center / 100% 100% no-repeat;
}
.sheen::before {
  content: ""; position: absolute; top: -10%; bottom: -10%; left: 0; width: 60%;
  background: linear-gradient(105deg, transparent 20%, rgba(255,248,222,.55) 50%, transparent 80%);
  transform: translateX(-120%);
}
.vis .sheen::before { animation: glint var(--gdur, 7s) var(--gdel, 1s) ease-in-out infinite; }
@keyframes glint { 0% { transform: translateX(-120%); } 45%, 100% { transform: translateX(260%); } }

/* the artwork's birds, redrawn live: perch (flies off and lands) > hover (circles) > wing (flaps) */
.bird { pointer-events: auto; cursor: pointer; }
.perch { position: absolute; display: block; height: 0; }
.hover { display: block; width: 100%; }
.wing {
  display: block; width: 100%; aspect-ratio: 130 / 148;
  translate: -60% -50%; transform-origin: 60% 50%; scale: var(--face, 1) 1;
  background: url(assets/el/birdFly.webp) 0 0 / 400% 100% no-repeat;
}
.vis .wing { animation: wingbeat var(--flap, .55s) steps(4) var(--fd, 0s) infinite; }
.perch.flying .wing { animation-duration: .34s; }
.vis .hover { animation: circle var(--hd, 6s) ease-in-out var(--hdl, 0s) infinite; }
@keyframes circle {
  0%, 100% { transform: translate(0, 0) rotate(0); }
  25% { transform: translate(calc(16 * var(--u)), calc(-12 * var(--u))) rotate(-5deg); }
  50% { transform: translate(calc(4 * var(--u)), calc(-22 * var(--u))) rotate(2deg); }
  75% { transform: translate(calc(-14 * var(--u)), calc(-9 * var(--u))) rotate(5deg); }
}

/* scroll-linked pieces (JS writes --p from 0 to 1) */
.curtain-l > .in { transform: translateX(calc((1 - var(--p, 0)) * 215 * var(--u))); }
.curtain-r > .in { transform: translateX(calc((1 - var(--p, 0)) * -250 * var(--u))); }
.ribbon > .in { clip-path: inset(0 0 calc((1 - var(--p, 0)) * 100%) 0); }

/* ---------- HTML overlays inside the artwork ---------- */
.overlay {
  z-index: 250;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  font-size: calc(30 * var(--u));
  opacity: 0; transform: translateY(calc(24 * var(--u)));
  transition: opacity 1.4s var(--ease-out) .3s, transform 1.6s var(--ease-out) .3s;
}
.overlay.on { opacity: 1; transform: none; }
.kicker {
  margin: 0; text-transform: uppercase;
  letter-spacing: .14em; font-weight: 500;
  font-size: calc(26 * var(--u));
}
.script { font-family: "Pinyon Script", cursive; font-size: calc(56 * var(--u)); margin: 0; line-height: 1.2; }

.countdown { color: var(--ink); gap: calc(36 * var(--u)); }
.count { display: grid; grid-template-columns: 1fr 1fr; gap: calc(30 * var(--u)) calc(70 * var(--u)); }
.count div { display: flex; flex-direction: column; align-items: center; }
.count b {
  font-weight: 500; font-size: calc(124 * var(--u)); line-height: 1;
  font-variant-numeric: lining-nums tabular-nums;
}
.count span { text-transform: uppercase; letter-spacing: .16em; font-size: calc(22 * var(--u)); margin-top: calc(10 * var(--u)); }
.count b.tick { animation: tick .6s var(--ease-out); }
@keyframes tick { from { opacity: .3; transform: translateY(-12%); } to { opacity: 1; transform: none; } }

.venues { color: var(--cream); gap: calc(46 * var(--u)); }
.venue h2 { font-weight: 500; font-size: calc(52 * var(--u)); line-height: 1.12; margin: calc(14 * var(--u)) 0 calc(26 * var(--u)); }
.venue .kicker { color: var(--gold-hi); }
.rule { width: calc(220 * var(--u)); height: 1px; background: linear-gradient(90deg, transparent, var(--gold), transparent); }

.closing { color: var(--cream); gap: calc(14 * var(--u)); }
.closing__names { margin: 0; white-space: nowrap; font-size: calc(44 * var(--u)); font-weight: 500; letter-spacing: .04em; }
.closing .kicker { color: var(--gold-hi); }

.btn {
  display: inline-block; cursor: pointer; text-decoration: none;
  font-size: calc(24 * var(--u)); text-transform: uppercase; letter-spacing: .18em; font-weight: 600;
  padding: calc(20 * var(--u)) calc(44 * var(--u));
  min-height: 44px; display: inline-flex; align-items: center;
  color: var(--cream); background: transparent;
  border: 1px solid rgba(201,164,103,.8); border-radius: 999px;
  transition: background .3s, color .3s, transform .3s var(--ease-out);
}
.btn:hover { background: rgba(201,164,103,.18); }
.btn:active { transform: scale(.97); }
.btn--ink { color: var(--ink); border-color: rgba(63,34,29,.55); }
.btn--ink:hover { background: rgba(63,34,29,.08); }
.btn:focus-visible, .seal:focus-visible, .music:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 4px; }

/* ---------- footer credit (Hafez) ---------- */
.credit { background: #111; display: flex; justify-content: center; padding: 28px 16px 34px; }
.credit a { display: inline-flex; }
.credit a:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 4px; }
.credit img { height: 72px; width: auto; max-width: 100%; object-fit: contain; }

/* ---------- opening curtains ---------- */
.intro {
  position: fixed; inset: 0; z-index: 50;
  background: var(--brown);
  display: grid; place-items: center;
  transition: background-color 1.1s ease .35s, visibility 0s linear 2.6s;
}
.intro__curtain {
  position: absolute; top: 0; height: 100%; width: 55%;
  object-fit: cover;
  transition: transform 2.2s var(--ease-io) .25s;
  filter: drop-shadow(0 0 30px rgba(0,0,0,.6));
}
.intro__curtain--l { left: 0; object-position: 100% 50%; }
.intro__curtain--r { right: 0; object-position: 0 50%; }
.intro__center {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  transition: opacity .8s ease, transform 1s var(--ease-out);
}
.seal {
  position: relative; width: 150px; height: 150px; border-radius: 50%;
  border: 0; padding: 26px; cursor: pointer;
  background: radial-gradient(circle at 35% 30%, #4d2a24, #2a1714 70%);
  box-shadow: 0 10px 40px rgba(0,0,0,.55), inset 0 0 0 1px rgba(243,220,164,.25);
  animation: seal 2.8s ease-in-out infinite;
}
.seal img { width: 100%; height: 100%; object-fit: contain; }
.seal__ring {
  position: absolute; inset: 8px; border-radius: 50%;
  border: 1px solid rgba(201,164,103,.7);
  box-shadow: 0 0 0 5px rgba(42,23,20,.6), 0 0 0 6px rgba(201,164,103,.35);
}
@keyframes seal { 0%,100% { transform: scale(1); } 50% { transform: scale(1.04); box-shadow: 0 10px 50px rgba(201,164,103,.25), inset 0 0 0 1px rgba(243,220,164,.35); } }
.intro__names { margin: 6px 0 0; font-size: 30px; letter-spacing: .06em; font-weight: 500; color: var(--cream); }
.intro__names span { font-family: "Pinyon Script", cursive; color: var(--gold); padding: 0 .1em; }
.intro__hint { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: .3em; color: rgba(236,227,205,.7); animation: hint 2.4s ease-in-out infinite; }
@keyframes hint { 50% { opacity: .35; } }

body.opened .intro { background-color: transparent; visibility: hidden; pointer-events: none; }
body.opened .intro__curtain--l { transform: translateX(-105%); }
body.opened .intro__curtain--r { transform: translateX(105%); }
body.opened .intro__center { opacity: 0; transform: scale(1.15); }

/* ---------- music toggle ---------- */
.music {
  position: fixed; z-index: 60; right: max(16px, calc(50vw - var(--col) / 2 + 16px)); bottom: 18px;
  width: 46px; height: 46px; border-radius: 50%; cursor: pointer;
  border: 1px solid rgba(201,164,103,.6); background: rgba(42,23,20,.75);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; gap: 3px;
}
.music[hidden] { display: none; }
.music span { width: 3px; height: 14px; background: var(--gold-hi); border-radius: 2px; animation: eq 1s ease-in-out infinite alternate; }
.music span:nth-child(2) { animation-delay: -.4s; }
.music span:nth-child(3) { animation-delay: -.7s; }
.music.paused span { animation-play-state: paused; height: 4px; }
@keyframes eq { from { transform: scaleY(.3); } to { transform: scaleY(1); } }

/* ---------- the sky: birds crossing, gold dust, petals (fixed over the column) ---------- */
.sky {
  position: fixed; z-index: 40; top: 0; bottom: 0; left: 50%;
  width: var(--col); transform: translateX(-50%);
  overflow: hidden; pointer-events: none;
}
.sky canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
body:not(.opened) .sky { visibility: hidden; }
.air {
  position: sticky; top: 0;
  height: 100vh; height: 100lvh;
  margin-bottom: -100vh; margin-bottom: -100lvh;
  overflow: hidden; pointer-events: none;
}
.flyer {
  position: absolute; left: 0; top: 0;
  transform-origin: 95.4% 50%; /* the head: JS offsets the box so the head rides the path */
  background: url(assets/el/birdFly.webp) 0 0 / 400% 100% no-repeat;
  animation: wingbeat var(--flap, .5s) steps(4) var(--fd, 0s) infinite;
  filter: drop-shadow(0 6px 6px rgba(0,0,0,.25));
  will-change: transform;
}
@keyframes wingbeat { to { background-position-x: 133.333%; } }
.petal {
  position: absolute; left: 0; top: 0;
  border-radius: 85% 8% 85% 8%;
  background: radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--c) 70%, #fff), var(--c) 70%);
  box-shadow: inset -1px -1px 2px rgba(0,0,0,.15);
  opacity: .9;
  will-change: transform;
}

/* ---------- tap sparkle ---------- */
.spark {
  position: fixed; z-index: 70; width: 7px; height: 7px; border-radius: 50% 0;
  background: radial-gradient(circle at 30% 30%, #fff3cf, #c9a467);
  pointer-events: none;
  animation: spark 1.1s cubic-bezier(.2,.6,.3,1) forwards;
}
@keyframes spark { to { transform: translate(var(--tx), var(--ty)) rotate(var(--tr)) scale(.2); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; }
  .r > .in, .overlay, .intro__curtain { transition-duration: .01s !important; transition-delay: 0s !important; }
  .curtain-l > .in, .curtain-r > .in { transform: none; }
  .ribbon > .in { clip-path: none; }
}

/* ---------- guest details: parking, hotels, RSVP, notes (below the artwork) ---------- */
.guest {
  --pad: clamp(16px, 5vw, 28px);
  background: #302b12 url(assets/bg/olive.jpg) top center / 100% auto repeat-y;
  position: relative; margin-top: -2px; /* tucks over sub-pixel rounding at the artwork's edge */
  padding: 20px var(--pad) 56px;
  display: flex; flex-direction: column; gap: 22px;
  color: var(--cream);
  font-size: 18px; line-height: 1.5;
}
.guest .kicker { font-size: 12px; letter-spacing: .22em; }
.guest .script { font-size: clamp(40px, 11vw, 54px); line-height: 1.1; }
.orn {
  display: block; width: 180px; height: 14px; margin: 0 auto;
  background:
    radial-gradient(circle, var(--gold) 0 3px, transparent 3.5px) center / 14px 14px no-repeat,
    linear-gradient(90deg, transparent, var(--gold) 40%, transparent 46%, transparent 54%, var(--gold) 60%, transparent) center / 100% 1px no-repeat;
}
.g-head { text-align: center; padding: 14px 0 4px; }
.g-head .kicker { color: var(--gold-hi); }
.g-head h2 { font-weight: 400; margin: 6px 0 12px; }

/* cream paper cards with a gold hairline, like the lace frame */
.g-card {
  position: relative;
  background: linear-gradient(#efe7d3, #e7ddc4);
  color: var(--ink);
  border-radius: 6px;
  padding: 30px clamp(18px, 6vw, 34px) 30px;
  text-align: center;
  box-shadow: 0 18px 40px rgba(0,0,0,.35);
}
.g-card::before {
  content: ""; position: absolute; inset: 8px; pointer-events: none;
  border: 1px solid rgba(169,128,68,.55); border-radius: 3px;
}
.g-card .kicker { color: #8a6634; }
.g-card h3 { font-weight: 500; font-size: clamp(28px, 7.4vw, 34px); line-height: 1.15; margin: 8px 0 18px; }
.g-card .note { margin: 18px 0 0; font-size: 17px; font-style: italic; color: rgba(63,34,29,.85); }
.g-card > .btn { margin-top: 22px; }
.g-card .note + .form { margin-top: 20px; }

/* the countdown's lace doily as a stretchable frame: corners + one scallop repeat per edge (assets/el/lace-frame.webp, cut from lace.webp) */
.g-card--lace {
  background: #ece4ce padding-box;
  border: 26px solid transparent;
  border-image: url(assets/el/lace-frame.webp) 258 213 258 213 / 82px 68px 82px 68px round;
  border-radius: 0;
  padding: 22px clamp(18px, 5vw, 28px) 24px;
  box-shadow: none;
  filter: drop-shadow(0 14px 22px rgba(0,0,0,.4));
}
/* olive sprigs (same art as the countdown) laid across two opposite corners, alternating per card */
.g-card--lace::before, .g-card--lace::after {
  content: ""; position: absolute; z-index: 2; pointer-events: none;
  background: no-repeat center / contain;
  border: 0; border-radius: 0; inset: auto; height: 162px;
}
.g-card--lace::before { /* top-right, leaning in */
  width: 76px; top: -78px; right: -56px;
  background-image: url(assets/el/palmR.webp); transform: rotate(-122deg);
}
.g-card--lace::after { /* bottom-left, leaning in */
  width: 62px; bottom: -78px; left: -48px;
  background-image: url(assets/el/palmL.webp); transform: rotate(58deg);
}
.g-card--lace:nth-of-type(even)::before { /* top-left, leaning in */
  top: -78px; left: -56px; right: auto; bottom: auto; width: 62px;
  background-image: url(assets/el/palmL.webp); transform: rotate(122deg);
}
.g-card--lace:nth-of-type(even)::after { /* bottom-right, leaning in */
  bottom: -78px; right: -48px; left: auto; top: auto; width: 76px;
  background-image: url(assets/el/palmR.webp); transform: rotate(-58deg);
}
.guest { overflow-x: clip; }
.g-card--lace .steps { gap: 14px; }
.g-card--lace .steps li { grid-template-columns: 34px 1fr; column-gap: 12px; }
.g-card--lace .steps li::before { width: 34px; height: 34px; font-size: 17px; }
.g-card--lace .steps span { font-size: 16.5px; }
.g-card--lace .hotels li { gap: 10px; }
.g-card--lace .hotels b { font-size: 18px; }
.g-card--lace .hotels span { font-size: 15px; }
.g-card--lace .hotels a { min-width: 52px; font-size: 11px; letter-spacing: .12em; }
.closing .script { font-size: calc(46 * var(--u)); }
.guest .btn { font-size: 13px; padding: 12px 26px; }

.steps { list-style: none; margin: 0; padding: 0; text-align: start; display: grid; gap: 16px; counter-reset: step; }
.steps li { display: grid; grid-template-columns: 38px 1fr; column-gap: 14px; counter-increment: step; }
.steps li::before {
  content: counter(step); grid-row: span 2;
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid rgba(169,128,68,.7); color: #8a6634;
  font-size: 19px; font-weight: 600; font-variant-numeric: lining-nums;
}
.steps b { font-weight: 600; font-size: 19px; line-height: 1.2; padding-top: 2px; }
.steps span { font-size: 17px; }

.hotels { list-style: none; margin: 0; padding: 0; text-align: start; }
.hotels li { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid rgba(63,34,29,.15); }
.hotels li:last-child { border-bottom: 1px solid rgba(63,34,29,.15); }
.hotels div { flex: 1; display: flex; flex-direction: column; }
.hotels b { font-weight: 600; font-size: 20px; line-height: 1.2; }
.hotels span { font-size: 16px; color: rgba(63,34,29,.75); }
.hotels a {
  flex: none; min-width: 64px; min-height: 40px; display: grid; place-items: center;
  font-size: 12px; text-transform: uppercase; letter-spacing: .16em; font-weight: 600;
  color: var(--ink); text-decoration: none;
  border: 1px solid rgba(63,34,29,.4); border-radius: 999px;
  transition: background .3s;
}
.hotels a:hover { background: rgba(63,34,29,.08); }

/* forms */
.form { display: grid; gap: 16px; text-align: start; }
.field { display: grid; gap: 6px; }
.field > span, .choice legend { font-size: 13px; text-transform: uppercase; letter-spacing: .14em; font-weight: 600; color: #6b4a2c; }
.field i { text-transform: none; letter-spacing: 0; font-weight: 400; }
.field input, .field textarea {
  width: 100%; font: inherit; font-size: 19px; color: var(--ink);
  background: rgba(255,252,244,.7);
  border: 1px solid rgba(63,34,29,.3); border-radius: 4px;
  padding: 10px 12px; min-height: 46px;
  transition: border-color .25s, box-shadow .25s, background .25s;
}
.field textarea { resize: vertical; line-height: 1.4; }
.field input:focus, .field textarea:focus { outline: none; border-color: #a98044; background: #fffcf4; box-shadow: 0 0 0 3px rgba(201,164,103,.3); }
.field [aria-invalid="true"] { border-color: #9a3b2b; }
.choice { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice legend { padding: 0; margin-bottom: 6px; }
.choice label { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice span {
  display: grid; place-items: center; text-align: center; height: 100%;
  min-height: 52px; padding: 8px 10px; border-radius: 4px;
  border: 1px solid rgba(63,34,29,.3); background: rgba(255,252,244,.5);
  font-size: 18px; line-height: 1.2;
  transition: background .3s, color .3s, border-color .3s;
}
.choice input:checked + span { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.choice input:focus-visible + span { outline: 2px solid #a98044; outline-offset: 2px; }
.choice--side { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.choice--side span { padding: 8px 6px; font-size: 17px; }
.g-card .note--form { margin: -8px 0 0; font-size: 16px; text-align: center; }
.field--guests[hidden], .form[hidden], .done[hidden] { display: none; }
.stepper { display: flex; align-items: center; gap: 4px; width: max-content; border: 1px solid rgba(63,34,29,.3); border-radius: 999px; background: rgba(255,252,244,.5); }
.stepper button { width: 46px; height: 46px; border: 0; background: none; cursor: pointer; font-size: 24px; color: var(--ink); border-radius: 50%; }
.stepper button:disabled { opacity: .3; cursor: default; }
.stepper output { min-width: 34px; text-align: center; font-size: 22px; font-weight: 600; font-variant-numeric: lining-nums tabular-nums; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.err { margin: 0; min-height: 0; color: #9a3b2b; font-size: 16px; }
.err:empty { display: none; }
.btn--solid { justify-self: center; background: var(--ink); color: var(--cream); border-color: var(--ink); }
.btn--solid:hover { background: #5a3129; }
.btn--solid[disabled] { opacity: .6; cursor: progress; }
.done { padding: 6px 0 0; animation: done-in 1s var(--ease-out); }
.done .script { color: var(--ink); }
.done__text { margin: 6px 0 14px; font-size: 19px; }
.link { border: 0; background: none; cursor: pointer; font-size: 16px; text-decoration: underline; text-underline-offset: 3px; color: #6b4a2c; padding: 8px; }
@keyframes done-in { from { opacity: 0; transform: translateY(10px); } }

.g-end { text-align: center; padding: 18px 0 6px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.g-end .orn { margin-bottom: 8px; }
.g-end .closing__names { font-size: clamp(28px, 7.6vw, 36px); }
.g-end .kicker { color: var(--gold-hi); }

/* sections rise in as they arrive */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 1.1s var(--ease-out), transform 1.2s var(--ease-out); }
.reveal.on { opacity: 1; transform: none; }

/* floating RSVP shortcut, next to the music button */
.rsvp-chip {
  position: fixed; z-index: 60; bottom: 18px; left: max(16px, calc(50vw - var(--col) / 2 + 16px));
  height: 46px; padding: 0 20px; display: flex; align-items: center;
  border-radius: 999px; border: 1px solid rgba(201,164,103,.6);
  background: rgba(42,23,20,.8); backdrop-filter: blur(6px);
  color: var(--gold-hi); text-decoration: none;
  font-size: 13px; letter-spacing: .24em; font-weight: 600;
  transition: opacity .4s, transform .4s var(--ease-out);
}
.rsvp-chip[hidden] { display: none; }
.rsvp-chip.away { opacity: 0; transform: translateY(12px); pointer-events: none; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- language switch ---------- */
.lang {
  position: fixed; z-index: 80; top: 14px; right: max(14px, calc(50vw - var(--col) / 2 + 14px));
  height: 40px; min-width: 40px; padding: 0 16px; cursor: pointer;
  border-radius: 999px; border: 1px solid rgba(201,164,103,.6);
  background: rgba(42,23,20,.78); backdrop-filter: blur(6px);
  color: var(--gold-hi); font-size: 17px; font-weight: 600; letter-spacing: .04em;
  transition: background .3s, transform .3s var(--ease-out);
}
.lang:hover { background: rgba(42,23,20,.92); }
.lang:active { transform: scale(.96); }
.lang:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 4px; }
.lang[lang="ar"] { font-family: "Aref Ruqaa", serif; font-weight: 700; font-size: 20px; letter-spacing: 0; padding-bottom: 3px; }

/* ---------- Arabic: right-to-left, Aref Ruqaa for titles, IBM Plex Sans Arabic for reading ----------
   Arabic never takes letter-spacing or capitals, and italics only slant it. */
html[lang="ar"] body { font-family: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif; }
html[lang="ar"] body *, html[lang="ar"] body *::before { letter-spacing: 0 !important; text-transform: none !important; }
html[lang="ar"] i, html[lang="ar"] .note { font-style: normal; }
html[lang="ar"] .script, html[lang="ar"] .intro__names, html[lang="ar"] .intro__names span,
html[lang="ar"] .venue h2, html[lang="ar"] .g-card h3, html[lang="ar"] .closing__names {
  font-family: "Aref Ruqaa", "Amiri", serif; font-weight: 700;
}
html[lang="ar"] .intro__names { font-size: 36px; }
html[lang="ar"] .intro__hint { font-size: 16px; }

/* the artwork's lettering: live Arabic laid over each text layer's box (the English lettering is an image) */
.el .ar { display: none; }
html[lang="ar"] .el.t > .in > img { display: none; }
html[lang="ar"] .el.t .ar {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; white-space: nowrap;
  font: 700 calc(var(--fs, 40) * var(--u)) / 1.3 "Aref Ruqaa", "Amiri", serif;
  color: var(--cream-2);
  transform: translateY(calc(var(--dy, 0) * var(--u)));
}
html[lang="ar"] .el.t.ink .ar { color: var(--ink); }
html[lang="ar"] .el.t .ar.b { font-family: "IBM Plex Sans Arabic", "Segoe UI", sans-serif; font-weight: 600; line-height: 1.35; }
/* tall calligraphy overflows its box a little, so the reveal's clip must not trim it */
html[lang="ar"] .el.t.r.on > .in { clip-path: inset(-100% -40%); }
/* the "Save the date" wipe unfurls from the right, the way Arabic is written */
html[lang="ar"] .r-wipe:not(.on) > .in { clip-path: inset(0 0 0 100%); }

html[lang="ar"] .kicker { font-size: calc(30 * var(--u)); font-weight: 500; }
html[lang="ar"] .guest .kicker { font-size: 15px; }
html[lang="ar"] .script { line-height: 1.5; font-size: calc(52 * var(--u)); }
html[lang="ar"] .guest .script { font-size: clamp(36px, 10vw, 48px); line-height: 1.4; }
html[lang="ar"] .closing .script { font-size: calc(46 * var(--u)); }
html[lang="ar"] .count b { font-family: "IBM Plex Sans Arabic", sans-serif; font-weight: 500; }
html[lang="ar"] .count span { font-size: calc(30 * var(--u)); margin-top: calc(6 * var(--u)); }
html[lang="ar"] .venue h2 { font-size: calc(54 * var(--u)); line-height: 1.45; }
html[lang="ar"] .btn { font-size: calc(27 * var(--u)); font-weight: 600; }
html[lang="ar"] .guest .btn { font-size: 16px; }
html[lang="ar"] .closing__names { font-size: calc(54 * var(--u)); }

html[lang="ar"] .guest { font-size: 17px; line-height: 1.8; }
html[lang="ar"] .g-card h3 { line-height: 1.5; }
html[lang="ar"] .g-card .note { font-size: 16px; }
html[lang="ar"] .g-card--lace .steps span { font-size: 16px; }
html[lang="ar"] .steps li::before { content: counter(step, arabic-indic); }
html[lang="ar"] .steps b { font-size: 18px; }
html[lang="ar"] .hotels b { font-size: 17.5px; }
html[lang="ar"] .hotels span { font-size: 15px; }
html[lang="ar"] .hotels a { font-size: 14px; }
html[lang="ar"] .field > span, html[lang="ar"] .choice legend { font-size: 15px; font-weight: 500; }
html[lang="ar"] .choice span { font-size: 16px; }
html[lang="ar"] .choice--side span { font-size: 15.5px; }
html[lang="ar"] .g-card .note--form { font-size: 15px; }
html[lang="ar"] .g-end .closing__names { font-size: clamp(32px, 9vw, 42px); }
html[lang="ar"] .rsvp-chip { font-size: 16px; }
.field input[type="tel"] { direction: ltr; } /* phone numbers read left to right in both languages */
html[lang="ar"] .field input[type="tel"] { text-align: right; }
