/* Lilac palette from the original design, with calligraphic type and
   generous spacing for a printed-stationery feel. */
:root {
  --radius: .5rem;
  --background: oklch(97.6% .01 310);
  --paper: oklch(98.8% .006 85);
  --foreground: oklch(26% .065 305);
  --card: oklch(99.5% .005 85);
  --primary: oklch(60% .11 305);
  --primary-foreground: oklch(98% .01 300);
  --secondary: oklch(93% .035 305);
  --muted-foreground: oklch(42% .055 305);
  --accent: oklch(84% .09 88);
  --input: oklch(88% .035 305);
  --destructive: oklch(58% .22 27);
  --gold: oklch(74% .1 80);
  --gold-deep: oklch(55% .09 70);
  --lilac: oklch(88% .06 305);
  --plum: oklch(46% .11 305);
  --envelope: oklch(80% .08 305);
  --envelope-dark: oklch(70% .1 305);
  --hairline: color-mix(in oklab, var(--plum) 22%, transparent);

  --font-display: "Aref Ruqaa", "Amiri", serif;
  --font-body: "Amiri", serif;
  --font-latin: "Cinzel", serif;
  --font-en: "Cormorant Garamond", Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-body);
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}
body.is-sealed { overflow: hidden; }
p, h1, h2, h3, ol { margin: 0; }
ol { padding: 0; list-style: none; }
button, input, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }

.font-display { font-family: var(--font-display); }
.font-latin { font-family: var(--font-latin); }
.invitation-english { font-family: var(--font-en); font-size: 1.08em; font-weight: 600; }
.invitation-english .font-display { font-family: var(--font-en); font-weight: 700; }

main { overflow: hidden; background: var(--paper); }

/* ---------- Opening overlay ---------- */
.opening {
  position: fixed; inset: 0; z-index: 100; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  transition: opacity 1s ease .9s, visibility 0s 1.9s, transform 1.9s cubic-bezier(.6, 0, .2, 1);
}
.opening-paper { position: absolute; inset: 0; --lace-img: url(../assets/baroque.jpg); }
/* Soft vignette so it reads as paper, not wallpaper. */
.opening-paper::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(color-mix(in oklab, var(--lilac) 30%, transparent), color-mix(in oklab, var(--lilac) 30%, transparent)),
    radial-gradient(ellipse at 50% 45%, color-mix(in oklab, white 30%, transparent), transparent 65%),
    radial-gradient(ellipse at 50% 50%, transparent 55%, color-mix(in oklab, var(--plum) 28%, transparent));
}
.opening-folds { position: absolute; inset: 0; width: 100%; height: 100%; }
.opening-folds path { fill: none; vector-effect: non-scaling-stroke; }
.fold-shadow { stroke: color-mix(in oklab, var(--plum) 35%, transparent); stroke-width: 2; transform: translateY(1px); }
.fold-light { stroke: color-mix(in oklab, white 55%, transparent); stroke-width: 1.2; }
.opening-flap {
  position: absolute; top: 0; left: 0; right: 0; height: 52%;
  --lace-img: url(../assets/baroque.jpg);
  clip-path: polygon(0 0, 100% 0, 100% 2%, 50% 100%, 0 2%);
  transform-origin: top;
  filter: drop-shadow(0 6px 10px color-mix(in oklab, var(--plum) 35%, transparent));
  transition: transform 1.1s cubic-bezier(.65, 0, .35, 1) .35s;
}
.opening-flap::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom, color-mix(in oklab, white 18%, transparent), color-mix(in oklab, var(--plum) 16%, transparent));
}
.seal-btn {
  position: relative; z-index: 2; margin-top: 4vh;
  width: 128px; height: 128px; border: 0; padding: 0; border-radius: 50%; cursor: pointer;
  background:
    radial-gradient(circle at 32% 28%, oklch(95% .07 90), oklch(80% .11 82) 38%, oklch(62% .1 72) 70%, oklch(48% .08 65));
  box-shadow:
    0 10px 22px -6px rgb(60 30 0 / .45),
    inset 0 2px 3px rgb(255 255 255 / .55),
    inset 0 -4px 8px rgb(80 50 0 / .35);
  transition: transform .45s cubic-bezier(.3, 1.4, .5, 1), opacity .5s ease .25s;
  animation: seal-glow 2.8s ease-in-out infinite;
}
.seal-btn:hover { transform: scale(1.04); }
.seal-btn:focus-visible { outline: 2px solid var(--primary-foreground); outline-offset: 6px; }
.seal-art { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.seal-ring, .seal-ring-hi { fill: none; stroke-width: .75; stroke-linejoin: miter; }
.seal-ring { stroke: oklch(42% .07 65); }
.seal-ring-hi { stroke: rgb(255 240 200 / .65); }
/* Script initials, thickened with a stroke of their own colour. */
.seal-mono { font-family: "Great Vibes", cursive; fill: oklch(36% .07 65); stroke: oklch(36% .07 65); stroke-width: .9; paint-order: stroke; }
.seal-mono .seal-mono-hi { fill: rgb(255 240 200 / .75); stroke: rgb(255 240 200 / .75); }
@keyframes seal-glow {
  0%, 100% { box-shadow: 0 10px 22px -6px rgb(60 30 0 / .45), 0 0 0 0 rgb(255 225 150 / 0), inset 0 2px 3px rgb(255 255 255 / .55), inset 0 -4px 8px rgb(80 50 0 / .35); }
  50% { box-shadow: 0 10px 22px -6px rgb(60 30 0 / .45), 0 0 0 14px rgb(255 225 150 / .22), inset 0 2px 3px rgb(255 255 255 / .55), inset 0 -4px 8px rgb(80 50 0 / .35); }
}
.opening-hint {
  position: relative; z-index: 2; margin-top: 1.5rem;
  font-family: var(--font-latin); font-size: .78rem; letter-spacing: .28em; text-transform: uppercase;
  color: color-mix(in oklab, var(--plum) 85%, black);
  transition: opacity .4s ease;
}
html[lang="ar"] .opening-hint { font-family: var(--font-body); font-size: 1.05rem; letter-spacing: 0; }
.opening.opened .seal-btn { transform: scale(.6); opacity: 0; animation: none; }
.opening.opened .opening-hint { opacity: 0; }
.opening.opened .opening-flap { transform: scaleY(-1); }
.opening.opened { opacity: 0; visibility: hidden; transform: scale(1.06); pointer-events: none; }

/* ---------- Floating controls ---------- */
/* A switch, not two buttons: EN always on the left, عر on the right; the pill slides. */
.lang-nav {
  position: fixed; top: max(14px, env(safe-area-inset-top)); left: 14px; z-index: 110;
  display: flex; padding: 3px; gap: 2px; border-radius: 999px;
  background: color-mix(in oklab, var(--paper) 82%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px -6px color-mix(in oklab, var(--plum) 45%, transparent);
}
.lang-nav::before {
  content: ""; position: absolute; top: 3px; left: 3px; width: 2.9rem; height: 2rem;
  border-radius: 999px; background: var(--plum);
  transition: transform .45s cubic-bezier(.65, 0, .35, 1);
}
.lang-nav:has(a[lang="ar"][aria-current])::before { transform: translateX(calc(2.9rem + 2px)); }
.lang-nav a {
  position: relative; width: 2.9rem; height: 2rem; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-latin); font-size: .78rem; color: var(--plum); text-decoration: none;
  transition: color .45s;
}
.lang-nav a[lang="ar"] { font-family: var(--font-body); font-size: 1rem; }
.lang-nav a[aria-current="page"] { color: var(--primary-foreground); }
.sound-btn {
  position: fixed; bottom: max(16px, env(safe-area-inset-bottom)); left: 16px; z-index: 110;
  width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; color: var(--plum);
  background: color-mix(in oklab, var(--paper) 85%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px -6px color-mix(in oklab, var(--plum) 45%, transparent);
}
.sound-btn svg { width: 20px; height: 20px; fill: currentColor; }
.sound-btn[aria-pressed="true"] .off, .sound-btn[aria-pressed="false"] .on { display: none; }

/* ---------- Hero ---------- */
/* The opening page: the formal invitation written over the full palace sketch. */
.hero { position: relative; min-height: 100svh; overflow: hidden; }
.hero-media { position: absolute; inset: 0; }
.hero-img {
  /* Lifted and softened so the pencil lines sit back behind the text. */
  width: 100%; height: 100%; object-fit: cover; filter: brightness(1.1) saturate(.75) contrast(.88);
  object-position: 50% 58%;
  animation: drift 26s ease-in-out infinite alternate;
}
@keyframes drift { from { transform: scale(1.02); } to { transform: scale(1.1) translateY(-1%); } }
/* An even paper wash, as on the original site, so the palace stays visible
   behind every line while the text stays readable. */
.hero-veil {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom,
    color-mix(in oklab, var(--paper) 86%, transparent) 0%,
    color-mix(in oklab, var(--paper) 70%, transparent) 30%,
    color-mix(in oklab, var(--paper) 70%, transparent) 80%,
    var(--paper) 100%);
}
.petals { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.petal {
  position: absolute; top: -40px; width: 12px; height: 9px;
  background: radial-gradient(ellipse at 30% 30%, oklch(95% .03 310), oklch(82% .07 305));
  border-radius: 80% 10% 80% 10%; opacity: .85;
  animation: fall linear infinite, sway ease-in-out infinite alternate;
}
@keyframes fall { to { transform: translateY(110svh) rotate(540deg); } }
@keyframes sway { from { margin-left: -24px; } to { margin-left: 24px; } }
.hero-content {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center;
  padding: 4.5rem max(1.25rem, calc((100% - 640px) / 2)) 6.5rem; text-align: center;
  min-height: 100svh;
}
.hero .letter { width: 100%; padding: 0; flex: 1; display: flex; flex-direction: column; }
/* The venue sits at the foot of the first page, filling the space below the date. */
.hero .letter .venue-line { margin-top: auto; padding-top: 1.5rem; }
/* Deeper ink and a soft paper halo so every line reads cleanly over the sketch. */
.hero {
  --ink: oklch(24% .06 305);
  --ink-plum: oklch(36% .12 305);
  --ink-muted: oklch(40% .06 305);
}
.hero-content p { text-shadow: 0 0 3px var(--paper), 0 0 10px var(--paper), 0 0 22px var(--paper); }
.hero .letter p { color: var(--ink) !important; }
.hero .letter .host, .hero .letter .person, .hero .letter .venue-line, .hero-blessing, .hero-verse { color: var(--ink-plum) !important; }
.hero .letter .rel, .hero-verse-ref { color: var(--ink-muted) !important; }
.hero .letter-line { font-weight: 700; }
.invitation-english .hero .letter-line { font-weight: 700; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.eyebrow {
  font-family: var(--font-body); font-size: 1.05rem; letter-spacing: .02em;
  color: color-mix(in oklab, var(--plum) 92%, black);
}
.invitation-english .eyebrow, .eyebrow:lang(en) {
  font-family: var(--font-latin); font-size: .72rem; letter-spacing: .3em; text-transform: uppercase;
}
/* Floating arrow: points down to the next page, and up on the last one. */
.page-arrow {
  position: fixed; bottom: max(18px, env(safe-area-inset-bottom)); left: 50%; z-index: 110;
  translate: -50% 0; width: 44px; height: 44px; border-radius: 50%; padding: 0; cursor: pointer;
  display: grid; place-items: center; color: var(--plum);
  border: 1px solid color-mix(in oklab, var(--gold) 55%, transparent);
  background: color-mix(in oklab, var(--paper) 85%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px -6px color-mix(in oklab, var(--plum) 45%, transparent);
  animation: bob 2.4s ease-in-out infinite;
}
.page-arrow svg { width: 22px; height: 22px; fill: currentColor; transition: transform .5s ease; }
.page-arrow.up svg { transform: rotate(180deg); }
@keyframes bob { 0%, 100% { translate: -50% 0; } 50% { translate: -50% 6px; } }

/* ---------- Sections ---------- */
/* Full-width bands; content stays in a readable centred column on wide screens. */
.section { position: relative; padding: 4.5rem max(1.75rem, calc((100% - 640px) / 2)); text-align: center; }
.page { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; }
.page-inner { display: flex; flex-direction: column; align-items: center; }
/* Between pages: a gold flourish sits on the seam instead of a hard edge. */
.page + .page::before, .hero + .page::before {
  content: ""; position: absolute; top: 0; left: 50%; z-index: 2; translate: -50% -50%;
  width: 130px; height: 24px; background: url(../assets/flourish.svg) center / contain no-repeat;
  opacity: .9;
}
.section-title { margin-top: .5rem; font-size: 2.3rem; line-height: 1.5; font-weight: 700; color: var(--plum); }
.invitation-english .section-title { font-size: 2.4rem; font-weight: 700; line-height: 1.2; }
.divider { margin: 1rem auto 1.75rem; display: flex; align-items: center; justify-content: center; gap: .6rem; color: var(--gold-deep); }
.divider span { height: 1px; width: 3.5rem; background: linear-gradient(to var(--to, left), transparent, var(--gold)); }
.divider span:last-child { --to: right; }
.divider i { font-style: normal; font-size: .8rem; }
.divider-img { display: block; width: 190px; margin: 0 auto; }
.prose { max-width: 26rem; margin: 0 auto; font-size: 1.15rem; line-height: 2; color: var(--foreground); }
.invitation-english .prose { font-size: 1.2rem; line-height: 1.7; }
.prose.subtle { margin-top: 1rem; font-size: 1rem; font-style: italic; color: var(--muted-foreground); }

.reveal { opacity: 0; transform: translateY(28px); filter: blur(6px); transition: opacity 1.3s ease, transform 1.3s cubic-bezier(.2, .7, .2, 1), filter 1.3s ease; transition-delay: var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; filter: none; }

/* ---------- Countdown ---------- */
.countdown-section > .veil {
  background: linear-gradient(to bottom, var(--paper), color-mix(in oklab, var(--paper) 72%, transparent) 25%, color-mix(in oklab, var(--paper) 72%, transparent) 75%, color-mix(in oklab, var(--secondary) 30%, var(--paper)));
}
.countdown-section .page-inner { position: relative; }
.page-flourish { width: 170px; }
.page-flourish.flip { transform: scaleY(-1); }
.page-flourish.flip.reveal:not(.in) { transform: scaleY(-1) translateY(-28px); }
.countdown-section .eyebrow { margin-top: 1.5rem; }
.countdown-date { margin: 1.5rem 0; font-size: 1.15rem; color: var(--plum); }
.invitation-english .countdown-date { font-size: 1.25rem; font-style: italic; }
.countdown { margin-top: 1.25rem; display: flex; justify-content: center; gap: .9rem; }
.count-unit {
  width: 70px; height: 70px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 1px solid color-mix(in oklab, var(--gold) 70%, transparent);
  box-shadow: inset 0 0 0 4px var(--paper), inset 0 0 0 5px var(--hairline);
}
.count-unit b { font-family: var(--font-en); font-weight: 500; font-size: 1.6rem; line-height: 1; color: var(--plum); font-variant-numeric: tabular-nums; }
.count-unit small { margin-top: .2rem; font-size: .72rem; color: var(--muted-foreground); }
html[lang="ar"] .count-unit b { font-family: var(--font-body); font-size: 1.5rem; }
.countdown-done { margin-top: 1rem; font-family: var(--font-display); font-size: 1.6rem; color: var(--plum); }

/* ---------- Lace / envelope ---------- */
.lace-section { position: relative; background-image: url(../assets/baroque.jpg); background-size: 300px; }
.lace-section > .veil { position: absolute; inset: 0; }
.lace {
  background-color: var(--envelope);
  background-image:
    linear-gradient(color-mix(in oklab, var(--envelope) 35%, transparent), color-mix(in oklab, var(--envelope) 35%, transparent)),
    var(--lace-img);
  background-blend-mode: normal, multiply;
  background-size: cover, 220px;
}

/* ---------- Formal letter ---------- */
.letter { padding: 1.75rem 0; }
.letter p { color: var(--foreground); }
.letter .divider { margin: 1.75rem auto; }
.letter-line { font-size: 1.15rem; line-height: 2; }
/* Two columns: fathers on one row, each child directly beneath their father,
   a gold hairline between the two families. */
.families { display: grid; grid-template-columns: 1fr 1fr; row-gap: .25rem; }
.families > .host, .families > .child { padding: .2rem .7rem; }
.families > .s0 { border-inline-end: 1px solid color-mix(in oklab, var(--gold) 60%, transparent); }
.families-invite { grid-column: 1 / -1; margin: 1rem 0 1.1rem; }
.host { font-size: 1.35rem; line-height: 1.6; color: var(--plum) !important; align-self: end; }
.child { display: flex; flex-direction: column; align-items: center; }
.child .rel { font-size: 1.25rem; color: var(--muted-foreground) !important; }
.child .person { font-size: 1.7rem; line-height: 1.5; font-weight: 700; color: var(--plum) !important; }
.venue-line { margin-top: .25rem; color: var(--plum) !important; font-weight: 700; }
.invitation-english .host { font-size: 1.3rem; }
.invitation-english .child .rel { font-style: italic; }
.invitation-english .child .person { font-size: 1.6rem; font-style: italic; font-weight: 700; line-height: 1.25; }
.invitation-english .letter-line { font-size: 1.2rem; line-height: 1.7; }

/* Bismillah and verse open the hero, above the names. */
.hero-blessing { font-size: 1.45rem; line-height: 1.6; color: var(--plum); }
.hero-verse { margin-top: .35rem; font-size: 1.02rem; line-height: 1.9; }
/* Two lines of matching length, split at the verse's natural pause. */
.hero-verse { width: fit-content; margin-inline: auto; }
.hero-verse span { display: block; white-space: nowrap; text-align: justify; text-align-last: justify; }
.hero-verse-ref { margin-top: .1rem; font-size: .8rem; color: var(--muted-foreground); }
/* The Arabic opening keeps its Arabic type on the English page. */
.invitation-english .hero-content [lang="ar"] { font-family: var(--font-body); font-weight: 400; font-style: normal; }
.invitation-english .hero-content .hero-blessing[lang="ar"] { font-family: var(--font-display); font-weight: 700; }
.hero-flourish { width: 150px; margin: .9rem auto .7rem; }

/* ---------- Programme timeline ---------- */
/* Two columns around a gold thread: the moments alternate sides, each with
   its time above it, so the whole evening fits on one screen. Mirrors in RTL. */
.timeline { position: relative; display: grid; row-gap: .5rem; width: 100%; max-width: 30rem; margin-inline: auto; }
/* A gold vine — leaves and tendrils — winding down between the two columns. */
.timeline::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 28px; translate: -50% 0;
  background: var(--gold);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 64'%3E%3Cg fill='none' stroke='black' stroke-width='1.1' stroke-linecap='round'%3E%3Cpath d='M14 0C23 10 23 22 14 32S5 54 14 64'/%3E%3Cpath d='M19.5 13c3.5-3.5 6.5-3.5 8-2.5'/%3E%3Cpath d='M8.5 45c-3.5 3.5-6.5 3.5-8 2.5'/%3E%3C/g%3E%3Cg fill='black'%3E%3Cpath d='M20.5 13.5c1.5-3.8 4.8-5 7-4.2-.6 3-3.6 4.8-7 4.2Z'/%3E%3Cpath d='M7.5 44.5c-1.5 3.8-4.8 5-7 4.2.6-3 3.6-4.8 7-4.2Z'/%3E%3Ccircle cx='17.5' cy='26' r='1.1'/%3E%3Ccircle cx='10.5' cy='38' r='1.1'/%3E%3C/g%3E%3C/svg%3E") center top / 28px 64px repeat-y, linear-gradient(transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-composite: source-in;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 64'%3E%3Cg fill='none' stroke='black' stroke-width='1.1' stroke-linecap='round'%3E%3Cpath d='M14 0C23 10 23 22 14 32S5 54 14 64'/%3E%3Cpath d='M19.5 13c3.5-3.5 6.5-3.5 8-2.5'/%3E%3Cpath d='M8.5 45c-3.5 3.5-6.5 3.5-8 2.5'/%3E%3C/g%3E%3Cg fill='black'%3E%3Cpath d='M20.5 13.5c1.5-3.8 4.8-5 7-4.2-.6 3-3.6 4.8-7 4.2Z'/%3E%3Cpath d='M7.5 44.5c-1.5 3.8-4.8 5-7 4.2.6-3 3.6-4.8 7-4.2Z'/%3E%3Ccircle cx='17.5' cy='26' r='1.1'/%3E%3Ccircle cx='10.5' cy='38' r='1.1'/%3E%3C/g%3E%3C/svg%3E") center top / 28px 64px repeat-y, linear-gradient(transparent, #000 8%, #000 92%, transparent);
  mask-composite: intersect;
}
.timeline li {
  position: relative; display: grid; grid-template-columns: 1fr 2.4rem 1fr; column-gap: .5rem;
  grid-template-areas: "time dot ." "what dot ." "note dot .";
  text-align: end;
}
.timeline li:nth-child(even) { grid-template-areas: ". dot time" ". dot what" ". dot note"; text-align: start; }
.timeline li:nth-child(even) .time { justify-self: start; }
.timeline .flower {
  grid-area: dot; align-self: center; justify-self: center; width: 18px; height: 18px; color: var(--plum);
  background: var(--paper); border-radius: 50%; box-shadow: 0 0 0 4px var(--paper);
}
.timeline .time { grid-area: time; justify-self: end; font-family: var(--font-en); font-size: 1.15rem; line-height: 1.3; color: var(--gold-deep); letter-spacing: .06em; }
.timeline .what { grid-area: what; font-family: var(--font-display); font-size: 1.35rem; line-height: 1.35; color: var(--plum); }
.invitation-english .timeline .what { font-size: 1.25rem; font-style: italic; font-weight: 700; }
.timeline .note { grid-area: note; font-size: .85rem; line-height: 1.4; color: var(--muted-foreground); font-style: italic; }
/* Arabic sets more compactly than English, so give it more size and air,
   and let the page's side margins shrink so the columns spread out. */
section:has(> #timeline) { padding-inline: max(.9rem, calc((100% - 640px) / 2)); }
main:not(.invitation-english) .timeline { row-gap: .7rem; max-width: 34rem; }
main:not(.invitation-english) .timeline li { column-gap: .7rem; }
main:not(.invitation-english) .timeline .time { font-size: 1.25rem; }
main:not(.invitation-english) .timeline .what { font-size: 1.5rem; line-height: 1.5; white-space: nowrap; }
main:not(.invitation-english) .timeline .note { font-size: .95rem; line-height: 1.6; }


/* ---------- RSVP ---------- */
.rsvp-section { background: linear-gradient(to bottom, var(--paper), color-mix(in oklab, var(--secondary) 34%, var(--paper)) 20%, color-mix(in oklab, var(--secondary) 34%, var(--paper)) 80%, var(--paper)); }
.rsvp-card {
  margin-top: 1rem; padding: 2.25rem 1.4rem; border-radius: 4px; background: var(--card);
  border: 1px solid var(--hairline);
  box-shadow: inset 0 0 0 5px var(--card), inset 0 0 0 6px color-mix(in oklab, var(--gold) 45%, transparent), 0 30px 60px -40px color-mix(in oklab, var(--plum) 55%, transparent);
}
.rsvp-form { display: flex; flex-direction: column; gap: 1.1rem; text-align: start; }
.rsvp-title { text-align: center; font-family: var(--font-display); font-size: 1.9rem; line-height: 1.5; color: var(--plum); }
.invitation-english .rsvp-title { font-family: var(--font-en); font-size: 2rem; font-weight: 700; }
.notice { text-align: center; font-size: .95rem; line-height: 1.6; color: var(--muted-foreground); }
.invitee { padding: .5rem 1rem 1rem; text-align: center; border-bottom: 1px solid var(--hairline); }
.invitee .label { font-size: .95rem; color: var(--muted-foreground); }
.invitee .name { margin-top: .2rem; font-family: var(--font-display); font-size: 1.6rem; line-height: 1.5; color: var(--plum); }
.invitation-english .invitee .name { font-family: var(--font-en); font-style: italic; font-weight: 700; }

.field label { display: block; margin-bottom: .375rem; font-size: .95rem; color: var(--muted-foreground); }
.field input, .field textarea {
  width: 100%; border-radius: 3px; border: 1px solid var(--input);
  background: var(--paper); padding: .7rem .8rem; font-size: 1.05rem; outline: none;
}
.field textarea { min-height: 5.5rem; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }

.choices { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.choice {
  border-radius: 3px; border: 1px solid var(--input); background: var(--paper);
  padding: .8rem .5rem; font-size: 1.05rem; cursor: pointer; transition: all .2s;
}
.choice:hover { border-color: var(--primary); }
.choice[aria-pressed="true"] { border-color: var(--plum); background: var(--secondary); color: var(--plum); box-shadow: 0 0 0 1px var(--plum); }

.counter { text-align: center; }
.counter .label { font-size: .95rem; color: var(--muted-foreground); margin-bottom: .5rem; }
.stepper { display: inline-flex; align-items: center; gap: 1.25rem; }
.stepper button {
  width: 2.5rem; height: 2.5rem; border-radius: 9999px; cursor: pointer;
  border: 1px solid color-mix(in oklab, var(--plum) 35%, transparent);
  background: var(--card); color: var(--plum); font-size: 1.25rem; line-height: 1;
}
.stepper button:disabled { opacity: .4; cursor: not-allowed; }
.stepper output { min-width: 2rem; font-size: 1.6rem; color: var(--plum); font-family: var(--font-en); }
.counter .hint { margin-top: .5rem; font-size: .88rem; color: var(--muted-foreground); }

.submit {
  width: 100%; border: 0; border-radius: 3px; cursor: pointer;
  background: var(--plum); color: var(--primary-foreground);
  padding: .85rem 1rem; font-size: 1.2rem; letter-spacing: .02em;
  box-shadow: 0 10px 20px -12px var(--plum);
  transition: background .2s, transform .2s;
}
.submit:hover { background: color-mix(in oklab, var(--plum) 88%, black); }
.submit:active { transform: translateY(1px); }
.submit:disabled { opacity: .6; cursor: not-allowed; }
.error { text-align: center; font-size: .95rem; color: var(--destructive); }

.thanks { display: flex; flex-direction: column; align-items: center; gap: .6rem; padding: .5rem 0; }
.thanks .rsvp-title { font-size: 2.2rem; }
.thanks p { font-size: 1.15rem; line-height: 1.8; color: var(--muted-foreground); }
.link-btn {
  margin-top: .5rem; border: 0; background: none; cursor: pointer;
  color: var(--primary); font-size: .95rem; text-decoration: underline; text-underline-offset: 4px;
}
.closing-note { margin: 2rem auto 0; max-width: 24rem; font-size: 1.15rem; line-height: 2; color: var(--plum); }
.loading { padding: 2rem 0; text-align: center; color: var(--muted-foreground); }

/* ---------- Venue ---------- */
.venue-address { margin-top: .25rem; color: var(--muted-foreground); }
.map-frame {
  margin: 1.75rem 0 0; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 4px;
  border: 1px solid var(--hairline); background: var(--secondary);
  box-shadow: 0 24px 40px -30px var(--plum);
}
.map-frame iframe { width: 100%; height: 100%; border: 0; filter: saturate(.75) sepia(.08); }
.pill-btn {
  margin-top: 1.5rem; display: inline-flex; align-items: center; gap: .5rem;
  border: 1px solid var(--hairline); border-radius: 999px; padding: .65rem 1.4rem;
  color: var(--plum); text-decoration: none; font-size: 1.02rem; background: var(--card);
  transition: all .2s;
}
.pill-btn svg { width: 17px; height: 17px; fill: currentColor; }
.pill-btn:hover { background: var(--plum); border-color: var(--plum); color: var(--primary-foreground); }

/* ---------- Footer ---------- */
.footer { position: relative; align-items: center; padding: 4rem 1.5rem 6rem; text-align: center; background: linear-gradient(to bottom, var(--paper), color-mix(in oklab, var(--secondary) 55%, var(--paper))); }
.keepsake {
  margin: 0 auto 1.5rem; width: min(100%, 520px); padding: 10px; background: var(--card);
  border: 1px solid color-mix(in oklab, var(--gold) 55%, transparent);
  box-shadow: inset 0 0 0 4px var(--card), inset 0 0 0 5px color-mix(in oklab, var(--gold) 35%, transparent), 0 34px 60px -34px color-mix(in oklab, var(--plum) 70%, transparent);
  rotate: -1.2deg;
}
.keepsake img { display: block; width: 100%; height: auto; }
.footer-names { margin-top: .5rem; font-size: 2.2rem; line-height: 1.5; font-weight: 700; color: var(--plum); }
.invitation-english .footer-names { font-style: italic; font-weight: 700; }
.footer-date { margin-top: .25rem; color: var(--muted-foreground); }
.footer-see { margin-top: 1.25rem; font-family: var(--font-latin); font-size: .72rem; letter-spacing: .3em; color: var(--gold-deep); }
html[lang="ar"] .footer-see { font-family: var(--font-body); font-size: 1.05rem; letter-spacing: 0; }

[hidden] { display: none !important; }

/* ---------- Desktop ---------- */
/* The palace stays full-bleed; the letter sits on a frosted paper panel in
   the middle so long lines stay crisp over the wide sketch. */
@media (min-width: 900px) {
  body { font-size: 18px; }
  .hero-content { padding-top: 5rem; padding-bottom: 7rem; }
  .hero-content::before {
    content: ""; position: absolute; z-index: -1;
    inset: 2.5rem calc(max(1.25rem, calc((100% - 640px) / 2)) - 3rem) 4.5rem;
    border-radius: 6px;
    background: color-mix(in oklab, var(--paper) 80%, transparent);
    -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
    border: 1px solid color-mix(in oklab, var(--gold) 45%, transparent);
    box-shadow: inset 0 0 0 6px color-mix(in oklab, var(--paper) 40%, transparent), 0 40px 80px -50px var(--plum);
  }
  .hero-veil { background: color-mix(in oklab, var(--paper) 30%, transparent); }
  .hero-blessing { font-size: 1.9rem; }
  .hero-verse { font-size: 1.2rem; }
  .hero-verse-ref { font-size: .95rem; }
  .host { font-size: 1.7rem; }
  .child .person { font-size: 2.3rem; }
  .child .rel { font-size: 1.4rem; }
  .hero .letter-line { font-size: 1.3rem; }
  .section { padding-top: 6rem; padding-bottom: 6rem; }
  .section-title { font-size: 2.9rem; }
  .count-unit { width: 96px; height: 96px; }
  .count-unit b { font-size: 2.2rem; }
  html[lang="ar"] .count-unit b { font-size: 2rem; }
  .countdown { gap: 1.5rem; }
  .rsvp-card { max-width: 560px; margin-inline: auto; padding: 2.75rem 2.5rem; }
  .map-frame { aspect-ratio: 16 / 9; }
  .seal-btn { width: 156px; height: 156px; }
  .opening-hint { font-size: .9rem; }
  html[lang="ar"] .opening-hint { font-size: 1.25rem; }
}

/* Shorter phones: tighten the first page so the venue line clears the arrow. */
@media (max-width: 899px) and (max-height: 880px) {
  .hero-content { padding-top: 3.6rem; padding-bottom: 5rem; }
  .hero .letter .divider { margin: 1rem auto; }
  .hero .letter-line { line-height: 1.75; }
  .hero .families-invite { margin: .6rem 0 .7rem; }
  .hero .letter .venue-line { padding-top: .75rem; }
}
@media (prefers-reduced-motion: reduce) {
  .reveal, .opening, .opening-flap, .seal-btn { transition-duration: .01s !important; transition-delay: 0s !important; }
  .hero-img, .page-arrow, .seal-btn, .petal { animation: none !important; }
  .petals { display: none; }
}
