@font-face { font-family: "Amiri"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/fonts/Amiri.a7d28175fb.woff2") format("woff2"); }
@font-face { font-family: "Amiri"; font-style: normal; font-weight: 700; font-display: swap; src: url("/assets/fonts/Amiri-Bold.0f1412572a.woff2") format("woff2"); }
@font-face { font-family: "Aref Ruqaa"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/fonts/ArefRuqaa.e72e2e462e.woff2") format("woff2"); }
@font-face { font-family: "EB Garamond"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/fonts/EBGaramond.578d1b1de8.woff2") format("woff2"); }
@font-face { font-family: "EB Garamond"; font-style: normal; font-weight: 700; font-display: swap; src: url("/assets/fonts/EBGaramond-Bold.25f9bfdff4.woff2") format("woff2"); }
@font-face { font-family: "EB Garamond"; font-style: italic; font-weight: 400; font-display: swap; src: url("/assets/fonts/EBGaramond-Italic.337214d458.woff2") format("woff2"); }
@font-face { font-family: "Dancing Script"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/fonts/DancingScript.18031c0b39.woff2") format("woff2"); }
@font-face { font-family: "Marcellus"; font-style: normal; font-weight: 400; font-display: swap; src: url("/assets/fonts/Marcellus.714c946997.woff2") format("woff2"); }
/* Fonts: @font-face rules are injected by build.py from static/fonts/fonts.json */

/* ---------- tokens ---------- */
:root {
  --page: #f6f5ea;
  --stage: #e6e6d7;
  --card: #fffefa;
  --ink: #2e3826;
  --ink-soft: #4f5944;
  --olive: #566730;
  --olive-deep: #465527;
  --names: #46552a;
  --gold: #7c5f22;
  --line: #d6d3bc;
  --display: "Aref Ruqaa", serif;
  --text: "Amiri", serif;
  --settle: cubic-bezier(.16, 1, .3, 1);
  --envelope-width: min(86vw, 27.5rem, 78vh);
  --envelope-half: calc(var(--envelope-width) * .33);
}
html:lang(en) { --display: "Dancing Script", cursive; --text: "EB Garamond", "Amiri", serif; }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--stage); scrollbar-color: #b9bd9e var(--page); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; overflow: hidden; color: var(--ink); font: 1.125rem/1.75 var(--text); text-align: center; -webkit-tap-highlight-color: transparent; }
h1, h2, p { margin: 0; }
img, svg { display: block; }
picture { display: contents; }
::selection { background: #dde2c4; }
:focus-visible { outline: 3px solid var(--olive); outline-offset: 3px; }
.letter:focus { outline: none; }
.defs { position: absolute; width: 0; height: 0; }

/* ---------- envelope ---------- */
.stage { position: fixed; top: 0; right: 0; bottom: 0; left: 0; overflow: hidden; background: linear-gradient(rgba(240, 240, 227, .55), rgba(240, 240, 227, .55)), url("/assets/img/paper.f146f012a6.jpg") center / 32.5rem; }
.envelope { position: absolute; left: 50%; top: 50%; width: var(--envelope-width); height: calc(var(--envelope-width) * .66); margin-left: calc(var(--envelope-width) / -2); margin-top: calc(var(--envelope-width) * -.33); perspective: 1300px; }
.envelope svg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: visible; }
.envelope-front { pointer-events: none; }
.stage { cursor: pointer; touch-action: manipulation; }
.is-open .stage { cursor: auto; }
.envelope-body { position: absolute; top: 0; right: 0; bottom: 0; left: 0; border-radius: 5px; background: #c9cab2; box-shadow: 0 26px 44px -20px rgba(46, 48, 26, .55), 0 4px 10px rgba(46, 48, 26, .14); }
.flap { transform-origin: 50% 0; }
.flap-lining { transform: rotateX(90deg); visibility: hidden; }
.flap-edge { filter: drop-shadow(0 3px 3px rgba(60, 62, 36, .34)); }
.pocket-edge { filter: drop-shadow(0 -1.5px 2px rgba(60, 62, 36, .28)); }
.envelope-heading, .envelope-cue { position: absolute; left: 1.25rem; right: 1.25rem; pointer-events: none; }
.envelope-heading { bottom: calc(50% + var(--envelope-half) + 2.125rem); font: 400 2.25rem/1.45 var(--display); color: var(--names); }
.envelope-cue { top: calc(50% + var(--envelope-half) + 2.125rem); font-size: 1.5rem; color: var(--ink-soft); }
html:lang(en) .envelope-heading { font-size: min(2.75rem, 11.2vw); }
html:lang(en) .envelope-cue { font-size: min(1.4rem, 5.6vw); font-style: italic; }
/* The gradient stands in until the photo arrives, so there is always a seal to tap. */
.seal { position: absolute; left: 32%; top: 58%; width: 36%; height: calc(var(--envelope-width) * .36); margin-top: -18%; border-radius: 50%; pointer-events: auto; cursor: pointer; touch-action: manipulation; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.seal-image { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 6px 6px rgba(40, 10, 12, .38)); pointer-events: none; }
.seal::after { content: ""; position: absolute; z-index: -1; top: 6%; right: 6%; bottom: 6%; left: 6%; border-radius: 50%; background: radial-gradient(circle at 38% 32%, #a8303f, #7a1422 58%, #55101a); }
.has-script .seal-ready::after { display: none; }
.seal::before { content: ""; position: absolute; top: 4%; right: 4%; bottom: 4%; left: 4%; border: 2px solid #8a1e2c; border-radius: 50%; opacity: 0; animation: invite 2.8s var(--settle) 1.4s infinite; }
.is-opening .seal::before { animation: none; }
@keyframes invite { 0% { opacity: .75; transform: scale(.95); } 100% { opacity: 0; transform: scale(1.4); } }

/* ---------- the letter, closed and open ---------- */
.letter { position: absolute; top: 0; right: 0; bottom: 0; left: 0; overflow: hidden; visibility: hidden; transform-origin: 0 0; background: linear-gradient(rgba(249, 248, 239, .7), rgba(249, 248, 239, .7)), url("/assets/img/paper.f146f012a6.jpg") center top / 32.5rem, var(--page); }
.is-opening .letter { will-change: transform, clip-path; }
.is-opening .reveal { transition: none !important; }

.is-open body { overflow: visible; }
.is-open .stage { position: static; overflow: visible; background: none; }
.is-open .letter, .is-open .letter:target { position: static; overflow: visible; visibility: visible; min-height: 100vh; }
.is-open .envelope, .is-open .envelope-heading, .is-open .envelope-cue { display: none; }

/* Script-free fallback. The first rule needs no recent browser; the rest tidies up where :has() exists.
   Kept apart from the rules above: a browser that does not
   know :has() drops only this block. */
.letter:target { position: fixed; z-index: 10; overflow: auto; visibility: visible; }
html:has(#letter:target) body { overflow: visible; }
html:has(#letter:target) .stage { position: static; overflow: visible; background: none; }
html:has(#letter:target) .letter:target { position: static; overflow: visible; visibility: visible; min-height: 100vh; }
html:has(#letter:target) .envelope, html:has(#letter:target) .envelope-heading, html:has(#letter:target) .envelope-cue { display: none; }

/* ---------- page ---------- */
.column { max-width: 29.375rem; margin: 0 auto; }
section { padding: 2.875rem 1.75rem; }
.has-script .reveal { opacity: 0; transform: translateY(0.875rem); transition: opacity 1s var(--settle), transform 1s var(--settle); }
.has-script .reveal.is-visible { opacity: 1; transform: none; }

.verse { padding: 4.625rem 1.5rem 0; font-family: "Amiri", serif; }
.basmala { font-size: 1.625rem; color: var(--gold); }
.ayah { margin-top: 0.875rem; font-size: 1.375rem; line-height: 2.05; text-wrap: balance; }
.ayah-reference { margin-top: 0.25rem; font-size: 1.0625rem; color: var(--ink-soft); }

.lead { max-width: 20.625rem; margin: 0 auto; font-size: 1.3rem; line-height: 1.85; color: var(--ink-soft); text-wrap: balance; }
html:lang(en) .lead { font-size: 1.32rem; line-height: 1.55; font-style: italic; }
.opening { padding: 1.625rem 1.75rem 0; }

.couple { padding: 0.625rem 1.375rem 1.25rem; }
.couple-art { position: relative; max-width: 23.125rem; margin: 0 auto; }
.couple-art::before { content: ""; display: block; padding-bottom: 81%; }
.wreath { position: absolute; left: -3%; top: 4%; width: 106%; height: auto; }
.figures { position: absolute; left: 0; right: 0; top: 0; width: auto; height: 102%; margin: 0 auto; }
.occasion { margin-top: 1.125rem; font-size: 1.25rem; color: var(--ink-soft); }
html:lang(en) .occasion { font: 400 1.0625rem/1.6 "Marcellus", serif; letter-spacing: .08em; }
.names { margin-top: 0.625rem; font: 400 min(3.875rem, 18vw)/1.5 var(--display); color: var(--names); }
.names span { display: block; }
.names .joiner { color: var(--gold); }
html:lang(ar) .names .joiner, html:lang(ar) .names .joiner + span { display: inline; }
html:lang(ar) .names .joiner { margin-left: -.16em; }
html:lang(en) .names { font-size: min(3.875rem, 16.2vw); line-height: 1.25; }
html:lang(en) .names .joiner { display: flex; align-items: center; justify-content: center; gap: 1rem; margin: 0.5rem 0; font: 400 1.5rem/1 "Marcellus", serif; }
html:lang(en) .names .joiner::before, html:lang(en) .names .joiner::after { content: ""; width: 3.375rem; height: 1px; background: currentColor; opacity: .55; }

.has-script .fades { opacity: 0; transition: opacity .6s ease-out; }
.has-script .fades.is-loaded { opacity: 1; }

.ornament { width: 8rem; height: auto; margin: 0.375rem auto; }
.together { max-width: 20.625rem; margin: 0 auto; font-size: 1.5625rem; line-height: 1.8; color: var(--names); text-wrap: balance; }
html:lang(en) .together { line-height: 1.5; font-style: italic; }

h2 { margin-bottom: 0.375rem; font: 400 2.25rem/1.45 var(--display); color: var(--names); }
html:lang(en) h2 { font: 400 1.6875rem/1.4 "Marcellus", serif; }
.weekday { margin-top: 0.875rem; font-size: 1.375rem; color: var(--ink-soft); }
.date { font: 400 2.875rem/1.35 var(--display); color: var(--names); }
html:lang(ar) .date { word-spacing: .14em; }
html:lang(en) .date { font: 400 2.125rem/1.35 "Marcellus", serif; }
.time { margin-bottom: 1.5rem; font-size: 1.375rem; font-weight: 700; color: var(--gold); }
.countdown { display: flex; justify-content: center; gap: 0.5rem; margin: 0.875rem 0 1.625rem; }
.countdown div { width: 4.5rem; padding: 0.625rem 0.125rem; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.countdown b { display: block; font-size: 1.6875rem; line-height: 1.35; color: var(--names); font-variant-numeric: tabular-nums; }
.countdown span { font-size: 1rem; color: var(--ink-soft); }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 0.5625rem; min-height: 3.25rem; padding: 0 1.75rem; border: 1.5px solid var(--olive); border-radius: 999px; color: #4b5a27; font-size: 1.1875rem; text-decoration: none; transition: background-color .2s, transform .2s; }
.button:hover { background: #e6e9d3; }
.button:active { transform: scale(.97); }
.button svg { width: 1.1875rem; height: 1.1875rem; }
.button-solid { border-color: var(--olive); background: var(--olive); color: #fff; }
.button-solid:hover { background: var(--olive-deep); }

.mosque { width: 100%; max-width: 21.25rem; height: auto; margin: 0.875rem auto 0.625rem; }
.venue-name, html:lang(en) .venue-name { margin: 0; font: 700 1.5rem/1.5 var(--text); color: var(--ink); }
.venue-area { margin-bottom: 1.125rem; font-size: 1.2rem; color: var(--ink-soft); }

.closing { padding: 2.875rem 1.25rem 5.25rem; padding-bottom: calc(5.25rem + env(safe-area-inset-bottom)); }
.separator { display: flex; align-items: center; justify-content: center; gap: 0.875rem; margin: 1.875rem auto 1.125rem; }
.separator::before, .separator::after { content: ""; width: 3.875rem; height: 1px; background: #8b9468; opacity: .6; }
.sprig { width: 5.75rem; height: auto; }
.dua { font: 400 1.5rem/2 "Amiri", serif; }
.dua span { display: block; }
.dua-translation { max-width: 20.625rem; margin: 0.625rem auto 0; line-height: 1.55; font-style: italic; color: var(--ink-soft); }
.signature { margin-top: 1.375rem; font: 400 min(2.375rem, 9.6vw)/1.5 var(--display); color: var(--names); white-space: nowrap; }
html:lang(en) .signature { font-size: min(2.375rem, 8.6vw); }

/* ---------- sound ---------- */
.sound { position: fixed; z-index: 20; top: 0.875rem; top: calc(0.875rem + env(safe-area-inset-top)); display: flex; align-items: center; justify-content: center; width: 3rem; height: 3rem; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: rgba(255, 254, 250, .94); color: #4b5a27; cursor: pointer; transition: opacity .25s, transform .25s, visibility 0s; }
html[dir="rtl"] .sound { left: 14px; left: max(14px, env(safe-area-inset-left)); }
html[dir="ltr"] .sound { right: 14px; right: max(14px, env(safe-area-inset-right)); }
.sound svg { width: 1.25rem; height: 1.25rem; }
.sound[aria-pressed="true"] .sound-off, .sound[aria-pressed="false"] .sound-on { display: none; }
.sound.is-away { visibility: hidden; opacity: 0; transform: translateY(-0.75rem); transition: opacity .25s, transform .25s, visibility 0s .25s; }

/* ---------- larger screens: the same page, scaled as a whole ---------- */
@media (min-width: 600px) and (min-height: 600px) { html { font-size: 118%; } }
@media (min-width: 960px) and (min-height: 520px) {
  html { font-size: calc(50% + 1.15vw); }
  .column { max-width: 46rem; }
  .ayah { max-width: 27rem; margin-left: auto; margin-right: auto; }
  .lead, .dua-translation { max-width: 26rem; }
  .together { max-width: 28rem; }
  .couple-art { max-width: 28rem; }
  .ornament { width: 9.5rem; }
  .mosque { max-width: 26rem; }
  .countdown div { width: 5.25rem; }
}
@media (min-width: 1900px) { html { font-size: calc(50% + min(1.15vw, 26px)); } }

/* ---------- other screens ---------- */
@media (max-height: 620px) { .envelope-heading { font-size: 1.75rem; } }
@media (max-height: 480px) {
  :root { --envelope-width: min(86vw, 74vh); }
  .envelope-heading, html:lang(en) .envelope-heading { bottom: calc(50% + var(--envelope-half) + 0.75rem); font-size: 1.6875rem; line-height: 1.3; }
  .envelope-cue { top: calc(50% + var(--envelope-half) + 0.875rem); font-size: 1.125rem; }
}
@media (prefers-reduced-motion: reduce) {
  .seal::before { animation: none; opacity: .45; transform: scale(1.1); }
  .has-script .reveal { opacity: 1; transform: none; transition: none; }
  .button, .sound, .has-script .fades { transition: none; }
}

/* ---------- 404 ---------- */
body.plain { overflow: auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.125rem; min-height: 100vh; background: var(--page); }

/* ---------- paper ---------- */
@media print {
  body { overflow: visible; }
  .stage { position: static; overflow: visible; background: none; }
  .letter { position: static !important; overflow: visible !important; visibility: visible !important; background: none; }
  .envelope, .envelope-heading, .envelope-cue, .sound, .button, #countdown { display: none !important; }
  .has-script .reveal, .has-script .fades { opacity: 1; transform: none; }
}
