/* Reserve scrolling space on the body without reducing viewport-based type sizes. */
html { scroll-behavior: smooth; }
body { overflow-x: hidden; overflow-y: scroll; }
body.intro-active { overscroll-behavior: none; }
[hidden] { display: none !important; }
button, [role="button"], a, canvas { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, [role="button"]:focus-visible { outline: 2px solid var(--primary); outline-offset: 6px; }
#opening { touch-action: none; transition: opacity .85s ease, transform .85s ease; }
#opening .opening-monogram { display: flex; align-items: center; justify-content: center; gap: .2em; direction: ltr; font: 400 2.6rem/1 "Marcellus", serif; letter-spacing: 0; }
#opening .opening-monogram > span { display: block; }
/* Balance the script glyph's visible ink with the capital initials. */
#opening .opening-monogram-separator { font: 400 1.9rem/1 "Italianno", cursive; color: var(--gold); transform: translate(-.065em, -.025em); }
#opening-video { transition: opacity .35s ease; }
#opening.is-playing video { opacity: 1; }
#opening.is-playing > header, #opening.is-playing > div { opacity: 0; }
#opening.is-leaving { opacity: 0; transform: scale(1.035); pointer-events: none; }
#invitation-content { position: relative; isolation: isolate; transition: opacity .85s ease; }
/* Keep a compact rhythm and a clear reading area inside the floral margins. */
#invitation-content > section:not(.reference-hero) {
  padding-block: clamp(44px, 5vw, 60px);
  padding-inline: clamp(32px, 6vw, 48px);
}
#invitation-content > .candle-section { padding-block: 36px 44px; }
#details > div { gap: clamp(28px, 4vw, 40px); }
#invitation-content > footer {
  min-height: 0;
  padding: 56px clamp(32px, 6vw, 48px);
}
/* Balance the visible gaps around the names, including the script's upper flourish. */
.reference-hero-copy { --hero-name-gap: 8%; }
#invitation-root:not(.invitation-ar) .reference-hero-copy > h1 { margin-top: calc(var(--hero-name-gap) + 0.1em); }
/* Cormorant's tabular set uses a descending 3; its default figures align with capitals. */
#invitation-root:not(.invitation-ar) .hero-date > span:nth-child(2) { font-variant-numeric: lining-nums proportional-nums; }
@media (max-width: 767px) {
  .reference-hero-copy { --hero-name-gap: 6%; top: 15%; }
  .reference-hero-copy > h1 + p { margin-top: var(--hero-name-gap); }
  .reference-hero-copy .hero-date { margin-top: 4%; }
  .reference-hero-copy .hero-year { margin-top: 2%; }
  .reference-hero-copy .hero-venue { margin-top: 3%; }
}
/* Flowers share one layer above section backgrounds and below the invitation text. */
#floral-layer {
  --floral-clear-edge: max(28px, calc((100% - 768px) / 2 - 20px));
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to right, #000, transparent var(--floral-clear-edge), transparent calc(100% - var(--floral-clear-edge)), #000);
  mask-image: linear-gradient(to right, #000, transparent var(--floral-clear-edge), transparent calc(100% - var(--floral-clear-edge)), #000);
}
#floral-layer > img {
  bottom: auto;
  height: auto;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 8%, #000 84%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 8%, #000 84%, transparent);
}
#language-toggle { position: fixed; top: 16px; inset-inline-end: 16px; z-index: 70; display: inline-flex; align-items: center; justify-content: center; gap: 5px; height: 34px; padding: 0 10px; border: 1px solid color-mix(in oklab, var(--primary) 18%, transparent); border-radius: 100px; background: color-mix(in oklab, var(--card) 65%, transparent); color: var(--foreground); box-shadow: none; backdrop-filter: blur(4px); cursor: pointer; font: 400 13px/1.4 var(--font-editorial); transition: background .2s, border-color .2s; }
/* Keep a comfortable touch target around the smaller visual button. */
#language-toggle::after { content: ""; position: absolute; inset: -5px; border-radius: inherit; }
#language-toggle svg { width: 12px; height: 12px; pointer-events: none; }
#language-toggle:hover, #language-toggle:focus-visible { background: var(--card); border-color: color-mix(in oklab, var(--primary) 35%, transparent); }
#skip-intro { position: fixed; z-index: 75; bottom: 20px; inset-inline-end: 22px; padding: 9px 14px; border-radius: 30px; border: 1px solid color-mix(in oklab, var(--primary) 25%, transparent); color: var(--primary); background: color-mix(in oklab, var(--card) 85%, transparent); font: 14px var(--font-editorial); cursor: pointer; backdrop-filter: blur(8px); }
.candle-reveal { opacity: 0; transform: translateY(10px); transition: opacity 1s .2s, transform 1s .2s; }
.is-out .candle-reveal { opacity: 1; transform: translateY(0); }
.candle-event-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 400px; margin: 20px auto 0; }
.candle-event-grid > div + div { border-inline-start: 1px solid color-mix(in oklab, var(--gold) 45%, transparent); }
.candle-event-grid svg { margin: 0 auto 8px; width: 22px; height: 22px; color: var(--primary); }
.candle-event-grid strong { display: block; color: var(--rose-deep); font: 600 18px var(--font-editorial); }
.candle-event-grid p { margin-top: 5px; color: var(--muted-foreground); font: 14px var(--font-editorial); }
[data-attendance][aria-pressed="true"] { color: var(--primary-foreground); background: var(--primary); border-color: var(--primary); }
#rsvp-status:empty { display: none; }
#rsvp-status { border: 1px solid color-mix(in oklab, var(--gold) 50%, transparent); background: color-mix(in oklab, var(--card) 70%, transparent); text-align: center; padding: 24px; margin-top: 22px; }
#rsvp-status h3 { color: var(--primary); font: 36px "Italianno", cursive; }
#rsvp-status p { margin-top: 8px; font: 17px/1.65 var(--font-editorial); }
#scratch-card { transition: opacity .65s ease; }
#scratch-card.revealed { opacity: 0; pointer-events: none; }
/* Arabic needs its own font metrics, including content revealed after interaction. */
.invitation-ar {
  --font-editorial: "IBM Plex Sans Arabic", sans-serif;
  --font-body: "IBM Plex Sans Arabic", sans-serif;
}
.invitation-ar #invitation-content {
  font-family: var(--font-body);
  line-height: 1.9;
}
.invitation-ar .font-editorial,
.invitation-ar #skip-intro {
  font-family: var(--font-editorial);
  font-weight: 400;
  line-height: 1.85;
}
.invitation-ar .font-script { line-height: 1.65; }
.invitation-ar .font-display { line-height: 1.6; }
.invitation-ar header > p { margin-bottom: .3em; }
.invitation-ar header > h2 {
  font-size: clamp(32px, 7.8vw, 46px);
  line-height: 1.6;
  text-wrap: balance;
}
.invitation-ar p:not(.font-display, .font-editorial, .font-script, .font-couple) { line-height: 1.9; }
.invitation-ar .reference-hero-copy > p:first-child,
.invitation-ar .reference-hero-copy > h1 + p {
  font-size: clamp(12px, 3.3vw, 17px);
  line-height: 1.85;
}
.invitation-ar .reference-hero-copy > h1 {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: clamp(6px, 2vw, 12px);
  font-family: "Aref Ruqaa", serif;
  font-size: clamp(44px, 13.5vw, 84px);
  line-height: 1.35;
}
.invitation-ar .couple-name { display: block; }
.invitation-ar .couple-separator {
  margin: .05em 0;
  font-family: "Cormorant Infant", serif;
  font-size: .28em;
  line-height: 1.5;
  /* Optically center the ornament between Yaman above and Leanne below. */
  transform: translateY(.55em);
}
.invitation-ar .reference-hero-copy > h1 + p { margin-top: clamp(10px, 3vw, 18px); }
.invitation-ar .hero-date { margin-top: 4%; }
.invitation-ar .hero-year { margin-top: 2%; line-height: 1.5; }
.invitation-ar .hero-venue {
  margin-top: 3%;
  font-size: clamp(12px, 3.1vw, 16px);
  line-height: 1.85;
}
.invitation-ar .candle-section > p { line-height: 1.9; }
.invitation-ar .candle-reveal > .font-script { font-size: 32px; line-height: 1.65; }
.invitation-ar .candle-event-grid { gap: 8px; }
.invitation-ar .candle-event-grid > div { min-width: 0; padding-inline: 4px; }
.invitation-ar .candle-event-grid strong { font: 500 15px/1.9 var(--font-body); }
.invitation-ar .candle-event-grid p { font: 400 13px/1.9 var(--font-body); }
.invitation-ar .candle-stage.is-out {
  height: auto;
  min-height: 34rem;
  padding-bottom: 17rem;
}
.invitation-ar .is-out .candle-reveal { position: relative; top: 0; padding-top: 12px; }
.invitation-ar strong.number-face { font-size: clamp(30px, 8.5vw, 46px); line-height: 1.5; }
.invitation-ar strong.number-face + span { font-size: 13px; line-height: 1.8; }
.invitation-ar .scratch-message-frame { height: auto; min-height: 16rem; padding: 28px 20px; }
.invitation-ar .scratch-message-frame .font-script { font-size: 30px; line-height: 1.65; }
.invitation-ar .scratch-message-frame p + p { font-size: 13px; line-height: 1.9; }
.invitation-ar #reveal-button { height: auto; min-height: 44px; line-height: 1.8; white-space: normal; }
.invitation-ar [data-attendance],
.invitation-ar #rsvp-submit {
  height: auto;
  min-height: 48px;
  font-size: 14px;
  line-height: 1.8;
  white-space: normal;
}
.invitation-ar #rsvp-note { font-size: 16px; line-height: 1.9; text-align: start; }
.invitation-ar #rsvp-submit + p { font-size: 13px; line-height: 1.9; }
.invitation-ar #rsvp-status h3 { font: 400 32px/1.65 "Aref Ruqaa", serif; }
.invitation-ar #rsvp-status p { font: 400 15px/1.9 var(--font-body); }
.invitation-ar footer h2 { line-height: 1.6; }
.noscript-note { position: fixed; bottom: 0; inset-inline: 0; padding: 10px; background: var(--card); text-align: center; font-size: 14px; z-index: 99; }
@media (min-width: 768px) { .scroll-hint { bottom: 6%; } }
@media (max-width: 400px) { .candle-event-grid strong { font-size: 16px; } .candle-event-grid p { font-size: 12px; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } #opening, #opening-video, #scratch-card, .candle-reveal { transition: none; } }
