/* ==========================================================================
   Ziad & Nany — "Pearl & Blush" invitation suite
   Palette sampled from the couple's portrait: warm peach backdrop, ivory lace,
   pearl and champagne, with dusty-rose florals and soft sage.
   ========================================================================== */

:root {
  /* colour */
  --linen: #efe2d3;
  --linen-deep: #e3cdb8;
  --paper: #fcf8f2;
  --paper-warm: #f7efe4;
  --ink: #4b3934;
  --ink-soft: #76625b;
  --rose: #a9586a;
  --rose-deep: #8a4252;
  --blush: #e9c4bd;
  --gold: #b0905f;
  --gold-soft: #d6c19b;
  --sage: #7d9184;
  --focus: #8a4252;

  /* type */
  --serif: "Cormorant Garamond", "Cormorant", Garamond, "Times New Roman", serif;
  --script: "Pinyon Script", "Cormorant Garamond", cursive;
  --ar-display: "Aref Ruqaa", "Amiri", serif;
  --ar-serif: "Amiri", "Noto Naskh Arabic", serif;
  --ar-sans: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;

  --font-body: var(--serif);
  --font-display: var(--script);
  --font-label: var(--serif);

  /* rhythm */
  --gutter: clamp(1rem, 5vw, 3rem);
  --ease-paper: cubic-bezier(.22, .8, .24, 1);

  /* textures — generated noise, no image requests */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .38 0 0 0 0 .29 0 0 0 0 .22 0 0 0 .075 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --fibres: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='420'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.006 .09' numOctaves='2' seed='4' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .4 0 0 0 0 .3 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E");

  color-scheme: light;
}

html[lang="ar"] {
  --font-body: var(--ar-serif);
  --font-display: var(--ar-display);
  --font-label: var(--ar-sans);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  text-wrap: pretty;
  min-height: 100svh;
  background-color: var(--linen);
  background-image:
    var(--grain),
    radial-gradient(120% 80% at 50% 0%, #f6ece0 0%, rgba(246, 236, 224, 0) 60%),
    radial-gradient(90% 70% at 50% 110%, var(--linen-deep) 0%, rgba(227, 205, 184, 0) 70%);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: clamp(1.06rem, 0.98rem + 0.4vw, 1.22rem);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.is-sealed { overflow: hidden; height: 100svh; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
img { user-select: none; -webkit-user-drag: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; border-radius: 4px; }
::selection { background: var(--blush); color: var(--ink); }
[hidden] { display: none !important; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ambient window light drifting across the linen */
.atmosphere { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.atmosphere__light {
  position: absolute; width: 120vmax; height: 120vmax; left: -30vmax; top: -50vmax;
  background: radial-gradient(closest-side, rgba(255, 248, 238, .75), rgba(255, 248, 238, 0));
  animation: drift 26s ease-in-out infinite alternate;
}
@keyframes drift { to { transform: translate3d(28vmax, 18vmax, 0) scale(1.08); } }

/* ---------- paper ---------- */
.paper {
  background-color: var(--paper);
  background-image:
    var(--grain),
    var(--fibres),
    linear-gradient(160deg, #fffdf9 0%, var(--paper) 45%, var(--paper-warm) 100%);
}
.shadow {
  filter:
    drop-shadow(0 1px 1px rgba(92, 64, 50, .10))
    drop-shadow(0 12px 22px rgba(92, 64, 50, .12))
    drop-shadow(0 34px 50px rgba(92, 64, 50, .08));
}

/* ---------- controls ---------- */
.controls {
  position: fixed; z-index: 50;
  top: max(14px, env(safe-area-inset-top));
  inset-inline-end: max(14px, env(safe-area-inset-right));
  display: flex; gap: 10px;
}
.control {
  min-width: 48px; height: 48px; padding: 0 16px;
  display: inline-grid; place-items: center;
  border: 1px solid rgba(176, 144, 95, .45); border-radius: 999px;
  background: rgba(252, 248, 242, .72);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  color: var(--ink);
  transition: background .3s, border-color .3s, transform .3s var(--ease-paper);
}
@media (hover: hover) { .control:hover { background: rgba(252, 248, 242, .95); border-color: var(--gold); } }
.control:active { transform: scale(.96); }
.control--lang .control__text { font-size: 1rem; letter-spacing: .04em; line-height: 1; }
html[lang="en"] .control--lang .control__text { font-family: var(--ar-sans); font-size: 1.02rem; }
html[lang="ar"] .control--lang .control__text { font-family: var(--serif); font-size: 1.08rem; letter-spacing: .08em; }
.control--music { padding: 0; }
.music-bars { width: 22px; height: 22px; fill: var(--ink-soft); }
.music-bars rect { transform-origin: center; transform-box: fill-box; transform: scaleY(.5); transition: transform .4s; }
.control--music[aria-pressed="true"] .music-bars rect { animation: bars 1.1s ease-in-out infinite alternate; }
.control--music[aria-pressed="true"] .music-bars rect:nth-child(2) { animation-delay: -.3s; }
.control--music[aria-pressed="true"] .music-bars rect:nth-child(3) { animation-delay: -.6s; }
.control--music[aria-pressed="true"] .music-bars rect:nth-child(4) { animation-delay: -.9s; }
@keyframes bars { from { transform: scaleY(.35); } to { transform: scaleY(1); } }

/* ==========================================================================
   OPENING — the sealed envelope
   ========================================================================== */
.opening {
  position: fixed; inset: 0; z-index: 20; overflow: hidden;
  display: grid; place-items: center;
  padding: max(72px, env(safe-area-inset-top)) var(--gutter) max(32px, env(safe-area-inset-bottom));
}
.opening__inner { display: grid; justify-items: center; gap: clamp(1.1rem, 3.5svh, 2.2rem); width: 100%; }

.greeting { margin: 0; text-align: center; line-height: 1.1; }
.greeting__salutation {
  display: block; font-family: var(--font-label); text-transform: uppercase;
  letter-spacing: .32em; font-size: .78rem; color: var(--ink-soft); margin-bottom: .35em;
}
.greeting__name {
  display: block; font-family: var(--font-display); color: var(--rose-deep);
  font-size: clamp(2.4rem, 10vw, 3.6rem); line-height: 1.15; padding-inline: .2em;
  max-width: 88vw; overflow-wrap: anywhere;
}
html[lang="ar"] .greeting__salutation { letter-spacing: 0; text-transform: none; font-size: 1rem; }
html[lang="ar"] .greeting__name { font-size: clamp(2.2rem, 9vw, 3.2rem); line-height: 1.5; }

.opening__title { margin: 0; font-weight: 400; }
.opening__kicker {
  display: block; font-family: var(--font-label); text-transform: uppercase;
  letter-spacing: .42em; font-size: .8rem; color: var(--ink-soft); padding-inline-start: .42em;
}
html[lang="ar"] .opening__kicker { letter-spacing: 0; text-transform: none; font-size: 1.05rem; padding: 0; }
.greeting:not([hidden]) + .opening__title { display: none; }

.opening__hint {
  margin: 0; font-family: var(--font-label); font-style: italic; font-size: 1.05rem;
  color: var(--ink-soft); display: flex; align-items: center; gap: .8em;
}
.opening__hint::before, .opening__hint::after {
  content: ""; width: 28px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold));
}
.opening__hint::after { transform: scaleX(-1); }
html[lang="ar"] .opening__hint { font-style: normal; font-size: 1rem; }

/* stage + envelope */
.stage {
  --w: min(86vw, 700px, calc(58svh * 1.5));
  --flap-h: 60%;
  --seal-k: .22;
  width: var(--w);
  aspect-ratio: 3 / 2;
  position: relative;
}
/* phones in portrait get a tall envelope that fills the screen like a real card */
@media (max-aspect-ratio: 4/5) {
  .stage { --w: min(80vw, 400px, calc(56svh * .72)); --flap-h: 50%; --seal-k: .3; aspect-ratio: 5 / 7; }
}
.envelope {
  position: absolute; inset: 0;
  animation: float 6s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(-.4deg); }
  50% { transform: translate3d(0, -6px, 0) rotate(.35deg); }
}
.envelope.is-opening { animation: none; }
.envelope.is-opening .envelope__florals { animation-play-state: paused; }

.envelope__shadow {
  position: absolute; left: 4%; right: 4%; bottom: -7%; height: 18%;
  background: radial-gradient(closest-side, rgba(84, 58, 44, .28), rgba(84, 58, 44, 0));
  filter: blur(6px);
}
.envelope__back {
  position: absolute; inset: 0; z-index: 1; border-radius: 3px;
  background:
    linear-gradient(180deg, rgba(120, 80, 60, .16), rgba(120, 80, 60, 0) 55%),
    url("../assets/florals/liner.svg") 0 0 / calc(var(--w) * .2) auto,
    #ead2c9;
  box-shadow: inset 0 0 0 1px rgba(150, 110, 80, .12);
}
.envelope__card {
  position: absolute; z-index: 3;
  left: 6%; right: 6%; top: 5%; height: 90%;
  will-change: transform;
}
.mini-card {
  position: relative; height: 100%; border-radius: 2px;
  display: grid; align-content: center; justify-items: center; gap: .2em;
  box-shadow: 0 1px 2px rgba(92, 64, 50, .18), 0 10px 26px rgba(92, 64, 50, .12);
  overflow: hidden; text-align: center;
}
.mini-card::after {
  content: ""; position: absolute; inset: 7px; border: 1px solid rgba(176, 144, 95, .45); pointer-events: none;
}
.mini-card__garland { position: absolute; top: -2%; left: -4%; width: 108%; max-width: none; }
.mini-card__names {
  margin: .2em 0 0; font-family: var(--font-display); color: var(--ink);
  font-size: calc(var(--w) * .085); line-height: 1.2;
}
.mini-card__date {
  margin: 0; font-family: var(--font-label); letter-spacing: .3em; font-size: calc(var(--w) * .024);
  color: var(--ink-soft); padding-inline-start: .3em;
}
html[lang="ar"] .mini-card__date { letter-spacing: .1em; font-size: calc(var(--w) * .03); }

.envelope__pocket { position: absolute; inset: 0; z-index: 4; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 -1px 0 rgba(255, 255, 255, .6)); }

.envelope__flap {
  position: absolute; z-index: 5; left: 0; right: 0; top: 0; height: var(--flap-h);
  transform-origin: 50% 0;
  transform: perspective(1400px) rotateX(0deg);
  transform-style: preserve-3d;
  will-change: transform;
}
.flap__face {
  position: absolute; inset: 0;
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 240' preserveAspectRatio='none'%3E%3Cpath d='M0 0H600L322 228Q300 244 278 228Z'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 240' preserveAspectRatio='none'%3E%3Cpath d='M0 0H600L322 228Q300 244 278 228Z'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat;
}
.flap__face--out {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .5), rgba(255, 255, 255, 0) 40%),
    linear-gradient(0deg, rgba(150, 112, 84, .16), rgba(150, 112, 84, 0) 35%),
    var(--grain),
    #f8f0e5;
}
.flap__face--in {
  transform: rotateX(180deg);
  background:
    linear-gradient(0deg, rgba(110, 70, 55, .2), rgba(110, 70, 55, 0) 50%),
    url("../assets/florals/liner.svg") 0 0 / calc(var(--w) * .2) auto,
    #efd3cb;
}
/* soft cast shadow of the closed flap on the pocket */
.envelope__flap::before {
  content: ""; position: absolute; inset: 6% 2% -5%;
  background: rgba(84, 58, 44, .2); filter: blur(7px);
  -webkit-mask: inherit; mask: inherit;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 240' preserveAspectRatio='none'%3E%3Cpath d='M0 0H600L322 228Q300 244 278 228Z'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 240' preserveAspectRatio='none'%3E%3Cpath d='M0 0H600L322 228Q300 244 278 228Z'/%3E%3C/svg%3E") 0 0 / 100% 100% no-repeat;
  transform: translateZ(-1px);
  opacity: var(--flap-shadow, 1);
}

.envelope__florals {
  position: absolute; z-index: 6; pointer-events: none;
  width: 62%; max-width: none; left: -17%; bottom: -24%;
  transform: scaleY(-1) rotate(-4deg);
  animation: sway 7s ease-in-out infinite;
}
.envelope__florals--r { width: 44%; left: auto; right: -12%; bottom: -16%; transform: scale(-1, -1) rotate(-4deg); animation-name: sway-r; animation-duration: 8s; }
@keyframes sway { 50% { transform: scaleY(-1) rotate(-2.2deg); } }
@keyframes sway-r { 50% { transform: scale(-1, -1) rotate(-2.4deg); } }
@media (max-aspect-ratio: 4/5) {
  .envelope__florals { width: 78%; left: -22%; bottom: -17%; }
  .envelope__florals--r { width: 56%; left: auto; right: -16%; bottom: -11%; }
}
.envelope__address {
  position: absolute; z-index: 5; left: 0; right: 0; bottom: 9%; margin: 0; text-align: center;
  font-family: var(--script); font-size: calc(var(--w) * .075); line-height: 1.2; color: #9a7a52; opacity: .9;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .7);
}
html[lang="ar"] .envelope__address { font-family: var(--ar-display); font-size: calc(var(--w) * .07); line-height: 1.6; }
@media (max-aspect-ratio: 4/5) { .envelope__address { bottom: 17%; font-size: calc(var(--w) * .1); } }
.flap__edge { position: absolute; inset: 0; width: 100%; height: 100%; }

/* wax seal */
.seal {
  position: absolute; z-index: 7;
  --s: calc(var(--w) * var(--seal-k));
  width: var(--s); height: var(--s);
  left: 50%; top: var(--flap-h);
  margin: calc(var(--s) * -.56) 0 0 calc(var(--s) * -.5);
  padding: 0; border: 0; background: none; border-radius: 50%;
  touch-action: manipulation;
}
.seal__svg { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 3px 3px rgba(70, 25, 35, .35)) drop-shadow(0 8px 14px rgba(70, 25, 35, .18)); transition: transform .45s var(--ease-paper); }
@media (hover: hover) { .seal:hover .seal__svg { transform: scale(1.04) rotate(-2deg); } }
.seal:active .seal__svg { transform: scale(.95); }
.seal__half, .seal__crumb { transform-box: fill-box; transform-origin: 50% 50%; }
.seal__crumb { opacity: 0; fill: #8e4250; }
.seal__mono { font-family: "Pinyon Script", cursive; font-size: 70px; fill: #fbe3e5; }
.seal__amp { font-family: "Cormorant Garamond", serif; font-style: italic; font-size: 30px; }
.seal__ring {
  position: absolute; inset: -14%; border-radius: 50%; pointer-events: none;
  border: 1px solid rgba(169, 88, 106, .45);
  animation: halo 2.8s var(--ease-paper) infinite;
}
@keyframes halo {
  0% { transform: scale(.82); opacity: 0; }
  30% { opacity: .9; }
  100% { transform: scale(1.22); opacity: 0; }
}
.seal:focus-visible { outline-offset: 8px; border-radius: 50%; }
.envelope.is-opening .seal__ring { animation: none; opacity: 0; transition: opacity .2s; }
.mini-card__eyebrow { margin: 16% 0 0; font-family: var(--font-label); text-transform: uppercase; letter-spacing: .34em; font-size: calc(var(--w) * .026); color: var(--ink-soft); padding-inline-start: .34em; }
html[lang="ar"] .mini-card__eyebrow { letter-spacing: 0; text-transform: none; font-size: calc(var(--w) * .038); }

/* ==========================================================================
   INVITATION
   ========================================================================== */
/* florals bleed past the edges by design; clip them so phones never widen the layout viewport */
.invitation { position: relative; z-index: 1; opacity: 0; overflow: hidden; overflow: clip; }
body:not(.is-sealed) .invitation { opacity: 1; }
body.is-sealed .invitation { visibility: hidden; }

/* ---------- hero card ---------- */
.hero {
  position: relative; min-height: 100svh;
  display: grid; place-items: center; align-content: center; gap: 2.2rem;
  padding: clamp(6.5rem, 16vw, 8rem) var(--gutter) 3rem;
  overflow: hidden;
}
.hero__corner { position: absolute; pointer-events: none; width: clamp(240px, 46vw, 560px); max-width: none; opacity: .95; }
.hero__corner--tl { top: clamp(-160px, -14vw, -60px); left: clamp(-150px, -14vw, -50px); }
.hero__corner--br { bottom: clamp(-160px, -14vw, -60px); right: clamp(-150px, -14vw, -50px); transform: rotate(180deg); }
@media (max-width: 720px) { .hero__corner { opacity: .55; } }

.sheet { position: relative; width: min(100%, 620px); margin-inline: auto; }
.sheet--hero { margin-top: clamp(2rem, 8vw, 3.5rem); }
.card { position: relative; text-align: center; }
.card--hero { padding: clamp(5.4rem, 20vw, 8.4rem) clamp(1.4rem, 7vw, 4.2rem) clamp(2.8rem, 9vw, 4.4rem); }
.card__frame {
  position: absolute; inset: 12px; pointer-events: none;
  border: 1px solid rgba(176, 144, 95, .5);
}
.card__frame::after { content: ""; position: absolute; inset: 4px; border: 1px solid rgba(176, 144, 95, .22); }
.card__garland {
  position: absolute; pointer-events: none; max-width: none;
  width: 118%; left: -9%; top: clamp(-70px, -11vw, -40px);
}

.hero__kicker {
  margin: 0 0 .6rem; font-family: var(--font-label); text-transform: uppercase;
  letter-spacing: .34em; font-size: clamp(.72rem, .68rem + .25vw, .84rem); color: var(--ink-soft);
  padding-inline-start: .34em;
}
.hero__names {
  margin: 0; font-weight: 400; font-family: var(--font-display); color: var(--ink);
  display: flex; flex-direction: column; align-items: center; line-height: 1;
  outline: none;
}
.hero__name {
  display: block; font-size: clamp(4rem, 3rem + 7vw, 6.6rem); line-height: 1.12;
  padding: 0 .18em; /* room for script swashes */
}
.hero__amp {
  display: block; font-family: var(--serif); font-style: italic; font-weight: 300;
  color: var(--rose); font-size: clamp(2rem, 1.6rem + 2vw, 2.8rem); line-height: 1; margin: -.1em 0;
}
.hero__alt-names {
  margin: 1.1rem 0 0; font-family: var(--ar-display); color: var(--rose-deep);
  font-size: clamp(1.5rem, 1.3rem + 1vw, 1.9rem); line-height: 1.6;
}
.hero__line { text-wrap: balance; margin: 1.1rem auto 0; max-width: 26em; font-size: clamp(1.12rem, 1rem + .5vw, 1.32rem); font-style: italic; color: var(--ink); line-height: 1.55; }

.rule { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 1.8rem auto 1.5rem; width: min(260px, 70%); }
.rule span { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); transform-origin: right center; }
.rule span:last-child { transform: scaleX(-1); transform-origin: left center; }
.rule i { width: 7px; height: 7px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #efe4d4 50%, #c9b59b); box-shadow: 0 1px 2px rgba(92, 64, 50, .35); flex: none; }

.hero__date { text-wrap: balance; margin: 0; font-size: clamp(1.18rem, 1.05rem + .55vw, 1.4rem); font-weight: 500; letter-spacing: .02em; line-height: 1.45; }
.hero__year { display: block; font-weight: 400; font-style: italic; }
.hero__time { margin: .35rem 0 0; font-style: italic; color: var(--ink-soft); }
.hero__venue {
  margin: 1.3rem 0 0; font-family: var(--font-label); text-transform: uppercase;
  letter-spacing: .26em; font-size: clamp(.72rem, .68rem + .25vw, .84rem); color: var(--ink-soft); padding-inline-start: .26em;
}

.scroll-cue {
  display: grid; justify-items: center; gap: .5rem; color: var(--ink-soft); text-decoration: none;
  font-family: var(--font-label); font-size: .78rem; letter-spacing: .3em; text-transform: uppercase;
  padding: .6rem 1rem; position: relative; z-index: 2;
}
.scroll-cue svg { width: 14px; height: 36px; animation: cue 2.4s ease-in-out infinite; }
@keyframes cue { 0%, 100% { transform: translateY(0); opacity: .6; } 50% { transform: translateY(6px); opacity: 1; } }

/* Arabic art direction for the hero */
html[lang="ar"] .hero__kicker,
html[lang="ar"] .hero__venue,
html[lang="ar"] .scroll-cue { letter-spacing: 0; text-transform: none; font-size: 1rem; padding-inline-start: 0; }
html[lang="ar"] .hero__name { font-size: clamp(3.6rem, 2.6rem + 7vw, 6rem); line-height: 1.5; padding: 0 .1em; }
html[lang="ar"] .hero__amp { font-family: var(--ar-display); font-style: normal; font-weight: 400; font-size: clamp(2rem, 1.6rem + 2vw, 2.6rem); line-height: 1.2; margin: -.35em 0; }
html[lang="ar"] .hero__alt-names { font-family: var(--script); font-size: clamp(1.9rem, 1.6rem + 1.4vw, 2.4rem); line-height: 1.4; }
html[lang="ar"] .hero__line { font-style: normal; line-height: 1.95; font-size: clamp(1.2rem, 1.05rem + .5vw, 1.4rem); }
html[lang="ar"] .hero__date { font-weight: 700; line-height: 1.9; letter-spacing: 0; }
html[lang="ar"] .hero__year { font-style: normal; font-weight: 400; }
html[lang="ar"] .hero__time { font-style: normal; }

/* ---------- date ---------- */
.date {
  position: relative; text-align: center;
  padding: clamp(4.5rem, 14vw, 8rem) var(--gutter) clamp(3.5rem, 10vw, 6rem);
}
.date__weekday { margin: 0; font-family: var(--font-display); font-size: clamp(2.4rem, 2rem + 2.4vw, 3.4rem); color: var(--rose-deep); line-height: 1.3; }
.date__row { display: flex; align-items: center; justify-content: center; gap: clamp(.8rem, 4vw, 2.4rem); margin-top: -.2em; }
.date__day { font-family: var(--serif); font-weight: 300; font-size: clamp(7.5rem, 5rem + 16vw, 13rem); line-height: .95; color: var(--ink); font-variant-numeric: lining-nums; }
.date__wing {
  font-family: var(--font-label); text-transform: uppercase; letter-spacing: .3em; font-size: clamp(.78rem, .7rem + .4vw, 1rem);
  color: var(--ink-soft); padding-block: .9em; border-block: 1px solid rgba(176, 144, 95, .55); min-width: 7.2em;
}
html[lang="ar"] .date__weekday { line-height: 1.7; }
html[lang="ar"] .date__wing { letter-spacing: .02em; text-transform: none; font-size: clamp(1rem, .9rem + .4vw, 1.2rem); min-width: 5.5em; }
html[lang="ar"] .date__day { font-family: var(--ar-serif); font-weight: 400; font-size: clamp(6.5rem, 4.5rem + 14vw, 11rem); line-height: 1.25; }

.date__wing { font-variant-numeric: lining-nums; }
@media (max-width: 480px) {
  .date__row { gap: .7rem; }
  .date__wing { min-width: 0; letter-spacing: .2em; font-size: .72rem; padding-inline: .2em; }
  html[lang="ar"] .date__wing { min-width: 0; font-size: .95rem; }
}
.countdown {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 460px;
  margin: clamp(2rem, 6vw, 3rem) auto 0;
}
.countdown__unit { display: grid; gap: .1rem; padding: .2rem .4rem; position: relative; }
.countdown__unit + .countdown__unit::before { content: ""; position: absolute; inset-inline-start: 0; top: 18%; height: 50%; width: 1px; background: rgba(176, 144, 95, .45); }
.countdown__num { font-family: var(--serif); font-size: clamp(1.9rem, 1.5rem + 2vw, 2.6rem); font-weight: 400; line-height: 1.1; font-variant-numeric: tabular-nums lining-nums; }
.countdown__label { font-family: var(--font-label); font-size: .68rem; letter-spacing: .24em; text-transform: uppercase; color: var(--ink-soft); }
html[lang="ar"] .countdown__num { font-family: var(--ar-serif); }
html[lang="ar"] .countdown__label { font-size: .9rem; letter-spacing: 0; }
.countdown__done { margin: 2rem 0 0; font-style: italic; font-size: 1.3rem; }

/* ---------- section head ---------- */
.section-head { text-align: center; }
.section-head__eyebrow {
  margin: 0; font-family: var(--font-label); text-transform: uppercase; letter-spacing: .34em;
  font-size: .76rem; color: var(--ink-soft); padding-inline-start: .34em;
}
.section-head__title { margin: .2rem 0 0; font-family: var(--serif); font-weight: 300; font-size: clamp(2.6rem, 2rem + 3vw, 3.8rem); line-height: 1.1; letter-spacing: .01em; }
.section-head__title--script { font-family: var(--font-display); font-weight: 400; color: var(--rose-deep); font-size: clamp(3rem, 2.4rem + 3vw, 4.2rem); line-height: 1.25; }
html[lang="ar"] .section-head__eyebrow { letter-spacing: 0; text-transform: none; font-size: 1rem; padding: 0; }
html[lang="ar"] .section-head__title { font-family: var(--ar-display); font-weight: 400; line-height: 1.6; }
html[lang="ar"] .section-head__title--script { line-height: 1.6; }

/* ---------- details suite ---------- */
.suite { padding: clamp(3rem, 10vw, 6rem) var(--gutter); }
.suite__cards {
  display: grid; gap: clamp(1.4rem, 4vw, 2rem);
  max-width: 1040px; margin: clamp(2.2rem, 6vw, 3.4rem) auto 0;
  grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch;
}
.enclosure-wrap { display: flex; }
.enclosure {
  flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: clamp(2.2rem, 5vw, 2.8rem) 1.6rem clamp(2.2rem, 5vw, 2.6rem); position: relative;
}
.enclosure::after { content: ""; position: absolute; inset: 10px; border: 1px solid rgba(176, 144, 95, .35); pointer-events: none; }
.enclosure__icon { width: 46px; height: 46px; fill: none; stroke: var(--gold); stroke-width: 1.1; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 1rem; }
.enclosure__icon .fill { fill: var(--gold); stroke: none; }
.enclosure__label {
  margin: 0; font-family: var(--font-label); font-weight: 500; text-transform: uppercase; letter-spacing: .3em;
  font-size: .74rem; color: var(--ink-soft); padding-inline-start: .3em;
}
.enclosure__value { margin: .55rem 0 0; font-size: clamp(1.4rem, 1.2rem + .8vw, 1.7rem); line-height: 1.3; font-weight: 500; }
.enclosure__sub { margin: .3rem 0 0; font-style: italic; color: var(--ink-soft); }
.enclosure .btn { margin-top: 1.4rem; }
html[lang="ar"] .enclosure__label { letter-spacing: 0; text-transform: none; font-size: .95rem; padding: 0; }
html[lang="ar"] .enclosure__value { font-weight: 700; line-height: 1.7; }
html[lang="ar"] .enclosure__sub { font-style: normal; }

@media (max-width: 820px) {
  .suite__cards { grid-template-columns: 1fr; max-width: 440px; }
}
@media (min-width: 821px) {
  .enclosure-wrap:nth-child(1) .enclosure { transform: rotate(-1.4deg) translateY(10px); }
  .enclosure-wrap:nth-child(3) .enclosure { transform: rotate(1.4deg) translateY(10px); }
  .enclosure-wrap:nth-child(2) { z-index: 1; }
}

/* ---------- buttons ---------- */
.btn {
  --h: 50px;
  display: inline-flex; align-items: center; justify-content: center; gap: .6em;
  min-height: var(--h); padding: 0 1.6em; border-radius: 999px;
  font-family: var(--font-label); font-size: .82rem; letter-spacing: .2em; text-transform: uppercase;
  text-decoration: none; position: relative; isolation: isolate; overflow: hidden;
  transition: color .4s var(--ease-paper), background-color .3s, border-color .4s, transform .3s var(--ease-paper), box-shadow .4s;
}
html[lang="ar"] .btn { letter-spacing: 0; text-transform: none; font-size: 1rem; }
.btn__arrow { width: 13px; height: 13px; transition: transform .4s var(--ease-paper); }
html[dir="rtl"] .btn__arrow { transform: scaleX(-1); }
.btn--line { border: 1px solid rgba(176, 144, 95, .7); color: var(--ink); background: transparent; }
.btn--line::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--ink);
  transform: scaleY(0); transform-origin: bottom; transition: transform .5s var(--ease-paper);
}
.btn--line:focus-visible { color: var(--paper); border-color: var(--ink); }
.btn--line:focus-visible::before { transform: scaleY(1); }
@media (hover: hover) {
  .btn--line:hover { color: var(--paper); border-color: var(--ink); }
  .btn--line:hover::before { transform: scaleY(1); }
  .btn--line:hover .btn__arrow { transform: translate(2px, -2px); }
  html[dir="rtl"] .btn--line:hover .btn__arrow { transform: scaleX(-1) translate(2px, -2px); }
}
.btn--line:active { transform: scale(.98); }
.btn--solid {
  background: var(--rose-deep); color: #fff7f4; border: 0; width: 100%;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 8px 20px rgba(138, 66, 82, .25);
}
@media (hover: hover) {
  .btn--solid:hover { background: #7a3746; transform: translateY(-1px); box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 12px 26px rgba(138, 66, 82, .3); }
}
.btn--solid:active { transform: translateY(0) scale(.985); box-shadow: 0 1px 0 rgba(255, 255, 255, .2) inset, 0 4px 12px rgba(138, 66, 82, .22); transition-duration: .12s; }
.btn--solid[aria-busy="true"] .btn__label { opacity: 0; }
.btn__spinner {
  position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 1.5px solid rgba(255, 247, 244, .35); border-top-color: #fff7f4; opacity: 0;
}
.btn--solid[aria-busy="true"] .btn__spinner { opacity: 1; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn--text {
  background: none; border: 0; color: var(--rose-deep); min-height: 44px; padding: 0 .6em;
  text-decoration: underline; text-decoration-color: rgba(138, 66, 82, .35); text-underline-offset: .35em;
}
@media (hover: hover) { .btn--text:hover { text-decoration-color: currentColor; } }

/* ---------- RSVP ---------- */
.rsvp { padding: clamp(3rem, 10vw, 6rem) var(--gutter); }
.sheet--rsvp { width: min(100%, 560px); }
.card--rsvp { padding: clamp(3.2rem, 9vw, 4.4rem) clamp(1.4rem, 7vw, 3.4rem) clamp(2.6rem, 7vw, 3.4rem); }
.card--rsvp::after { content: ""; position: absolute; inset: 12px; border: 1px solid rgba(176, 144, 95, .4); pointer-events: none; }
.card__sprig { position: absolute; width: min(300px, 64%); left: 50%; top: -58px; transform: translateX(-50%); pointer-events: none; }
html[dir="rtl"] .card__sprig { transform: translateX(50%); left: auto; right: 50%; }
.rsvp__intro { margin: .6rem auto 0; max-width: 22em; color: var(--ink-soft); font-style: italic; }
html[lang="ar"] .rsvp__intro { font-style: normal; }

.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.rsvp__form { margin-top: 2rem; display: grid; gap: 1.6rem; text-align: start; position: relative; z-index: 1; }
.field { display: grid; gap: .35rem; }
.field__label {
  font-family: var(--font-label); font-size: .74rem; letter-spacing: .26em; text-transform: uppercase; color: var(--ink-soft);
  padding: 0; font-weight: 500;
}
html[lang="ar"] .field__label { letter-spacing: 0; text-transform: none; font-size: .98rem; }
.field__input {
  width: 100%; min-height: 52px; padding: .5rem .2rem; border: 0; border-bottom: 1px solid rgba(118, 98, 91, .45);
  background: transparent; font-size: 1.3rem; font-family: var(--font-body); border-radius: 0;
  transition: border-color .3s;
}
html[lang="ar"] .field__input { font-family: var(--ar-sans); font-size: 1.15rem; }
.field__input:focus { outline: none; border-bottom-color: var(--rose-deep); box-shadow: 0 1px 0 var(--rose-deep); }
.field__input[aria-invalid="true"] { border-bottom-color: #a33b3b; }
/* a guest who declines brings nobody: the companion field rests, keeping what was typed */
.field--companion { transition: opacity .35s var(--ease-paper); }
.field--companion:has(.field__input:disabled) { opacity: .45; }
.field__input:disabled { cursor: not-allowed; }
.field__error { margin: 0; min-height: 1.2em; font-size: .95rem; color: #9b3434; font-family: var(--font-label); }
.field__error:empty { min-height: 0; }
html[lang="ar"] .field__error { font-family: var(--ar-sans); font-size: .9rem; }
.field__error--form { text-align: center; }

.choices { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.choices legend { grid-column: 1 / -1; margin-bottom: .7rem; float: inline-start; width: 100%; }
.choices .field__error { grid-column: 1 / -1; }
.choice { position: relative; display: grid; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice__body {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem;
  min-height: 104px; height: 100%; padding: 1rem .6rem; text-align: center;
  border: 1px solid rgba(176, 144, 95, .5); border-radius: 2px;
  background: rgba(255, 255, 255, .35);
  transition: background .35s, border-color .35s, color .35s, box-shadow .35s, transform .35s var(--ease-paper);
}
.choice__mark { width: 26px; height: 26px; fill: none; stroke: var(--gold); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; transition: stroke .35s; }
.choice__text { font-size: 1.12rem; font-style: italic; line-height: 1.3; }
html[lang="ar"] .choice__text { font-style: normal; font-family: var(--ar-sans); font-size: 1rem; line-height: 1.6; }
@media (hover: hover) { .choice:hover .choice__body { border-color: var(--gold); background: rgba(255, 255, 255, .7); } }
.choice:active .choice__body { transform: scale(.985); }
.choice__mark path { stroke-dasharray: 26; stroke-dashoffset: 0; }
.choice input:checked + .choice__body .choice__mark path { animation: draw .5s var(--ease-paper) both; }
@keyframes draw { from { stroke-dashoffset: 26; } }
.choice input:focus-visible + .choice__body { outline: 2px solid var(--focus); outline-offset: 3px; }
.choice input:checked + .choice__body {
  background: var(--ink); border-color: var(--ink); color: var(--paper);
  box-shadow: 0 10px 24px rgba(75, 57, 52, .22); transform: translateY(-2px);
}
.choice input:checked + .choice__body .choice__mark { stroke: var(--gold-soft); }

.rsvp__done { margin-top: 2rem; text-align: center; display: grid; justify-items: center; gap: .4rem; outline: none; }
.rsvp__done-mark { width: 64px; height: 64px; fill: none; stroke: var(--rose-deep); stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }
.rsvp__done-mark circle { stroke: var(--gold); }
.rsvp__done-title { margin: .6rem 0 0; font-family: var(--font-display); font-size: clamp(2.2rem, 1.8rem + 2vw, 3rem); color: var(--rose-deep); line-height: 1.3; overflow-wrap: anywhere; }
html[lang="ar"] .rsvp__done-title { line-height: 1.7; }
.rsvp__done-text { margin: 0; max-width: 24em; font-style: italic; }
html[lang="ar"] .rsvp__done-text { font-style: normal; }
.rsvp__preview-note {
  margin: 1rem 0 0; font-family: var(--font-label); font-size: .82rem; color: var(--ink-soft);
  padding: .6rem .9rem; border: 1px dashed rgba(176, 144, 95, .6); max-width: 28em;
}
html[lang="ar"] .rsvp__preview-note { font-size: .9rem; }

/* ---------- portrait (future) ---------- */
.portrait { padding: clamp(2rem, 8vw, 4rem) var(--gutter); }
.portrait__frame { position: relative; margin: 0 auto; width: min(86vw, 460px); }
.portrait__mat { padding: clamp(12px, 3vw, 18px) clamp(12px, 3vw, 18px) clamp(48px, 10vw, 64px); transform: rotate(-1.2deg); }
.portrait__img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 30%; filter: saturate(.94) contrast(.98); }
.portrait__florals { position: absolute; width: 62%; max-width: none; right: -22%; bottom: -18%; transform: rotate(180deg); pointer-events: none; }
html[dir="rtl"] .portrait__florals { right: auto; left: -22%; transform: rotate(180deg) scaleX(-1); }
.portrait__caption {
  position: absolute; left: 0; right: 0; bottom: clamp(10px, 2.5vw, 16px); text-align: center;
  font-family: var(--font-display); font-size: clamp(1.6rem, 1.3rem + 1vw, 2rem); color: var(--ink); transform: rotate(-1.2deg);
}

/* ---------- closing ---------- */
.closing { text-align: center; padding: clamp(3rem, 10vw, 5rem) var(--gutter) max(4rem, calc(env(safe-area-inset-bottom) + 3rem)); }
.closing__sprig { width: min(260px, 60vw); margin: 0 auto 1.2rem; }
.closing__line { margin: 0 auto; max-width: 20em; font-style: italic; font-size: clamp(1.2rem, 1.05rem + .6vw, 1.45rem); }
.closing__sign { margin: 1.6rem 0 0; font-family: var(--font-label); text-transform: uppercase; letter-spacing: .32em; font-size: .74rem; color: var(--ink-soft); padding-inline-start: .32em; }
.closing__names { margin: .2rem 0 0; font-family: var(--font-display); font-size: clamp(2.8rem, 2.2rem + 3vw, 4rem); line-height: 1.3; color: var(--rose-deep); }
.closing__date { margin: .6rem 0 0; letter-spacing: .34em; font-size: .9rem; color: var(--ink-soft); padding-inline-start: .34em; }
html[lang="ar"] .closing__line { font-style: normal; line-height: 1.9; }
html[lang="ar"] .closing__sign { letter-spacing: 0; text-transform: none; font-size: 1rem; padding: 0; }
html[lang="ar"] .closing__names { line-height: 1.7; }
html[lang="ar"] .closing__date { letter-spacing: .12em; }

/* ---------- motion helpers ---------- */
.lang-fade { transition: opacity .32s var(--ease-paper), transform .32s var(--ease-paper); }
body.is-switching .lang-fade { opacity: 0; transform: translateY(4px); transition-duration: .24s; transition-timing-function: ease-in; }
.control--lang .control__text { transition: opacity .24s ease, transform .24s ease; }
body.is-switching .control--lang .control__text { opacity: 0; transform: translateY(-3px); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .atmosphere__light, .envelope, .seal__ring, .scroll-cue svg { animation: none !important; }
}

/* hide strings until the chosen language is applied (removed by JS, with a timed fallback) */
html.is-booting body > * { opacity: 0; }

/* short phones: keep greeting, envelope and hint on one screen */
.greeting.is-long .greeting__name { font-size: clamp(1.9rem, 7.5vw, 2.8rem); }
@media (max-height: 680px) {
  .opening { padding-top: max(64px, env(safe-area-inset-top)); }
  .opening__inner { gap: .8rem; }
  .greeting__name { font-size: clamp(2rem, 8vw, 2.6rem); }
  .greeting.is-long .greeting__name { font-size: clamp(1.6rem, 6.5vw, 2.1rem); }
}
@media (max-height: 680px) and (max-aspect-ratio: 4/5) {
  .stage { --w: min(76vw, 360px, calc(50svh * .72)); }
}
@media (max-width: 360px) {
  .date__row { gap: .45rem; }
  .date__wing { letter-spacing: .12em; font-size: .66rem; }
  .date__day, html[lang="ar"] .date__day { font-size: 6.2rem; }
}
