/* Shalima invitation: ivory paper, gold foil, deep wine ink. */

:root {
  --paper: #f7f1e6;
  --paper-hi: #fcf8f1;
  --ink: #3a2b22;
  --ink-soft: #6c5847;
  --wine: #5e2332;
  --wine-deep: #3d1520;
  --gold: #b8913f;
  --gold-deep: #8c6a2f;
  --gold-light: #e8cf8a;
  --hair: rgba(168, 128, 52, 0.55);

  --f-script: 'Pinyon Script', 'Snell Roundhand', cursive;
  --f-serif: 'Cormorant Garamond', 'Cormorant', Garamond, 'Times New Roman', serif;
  --f-arabic: 'Amiri Quran', 'Amiri', 'Traditional Arabic', 'Geeza Pro', serif;

  --foil: linear-gradient(105deg, #7d5d24 0%, #a8822f 22%, #cfa955 38%, #f1dc9c 48%, #c9a24e 58%, #9a7630 76%, #b8913f 100%);
  --foil-x: 50%;

  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
}

*,
*::before,
*::after { box-sizing: border-box; }

html,
body { height: 100%; margin: 0; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-serif);
  font-size: 18px;
  line-height: 1.5;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-variant-numeric: lining-nums;
  -webkit-tap-highlight-color: transparent;
}

img,
svg { display: block; }

button { font: inherit; color: inherit; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

.defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------- stage: full screen on phones, a framed card on larger screens ---------- */

.stage {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  isolation: isolate;
}

.paper {
  position: absolute;
  inset: 0;
  background-color: var(--paper);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n' x='0' y='0'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .33 0 0 0 0 .17 0 0 0 1.25 -.5'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.42'/%3E%3C/svg%3E"),
    radial-gradient(120% 70% at 50% 0%, rgba(255, 255, 255, 0.6), transparent 62%),
    radial-gradient(130% 95% at 50% 50%, transparent 58%, rgba(214, 168, 140, 0.16) 88%, rgba(190, 140, 90, 0.22) 100%);
  background-size: 220px 220px, 100% 100%, 100% 100%;
}

.dust {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.scroller {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 58px, #000 calc(100% - 58px), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 58px, #000 calc(100% - 58px), transparent 100%);
}
.scroller::-webkit-scrollbar { display: none; }

.frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  pointer-events: none;
  overflow: visible;
}

@media (min-width: 720px) and (min-height: 600px) {
  body {
    background:
      radial-gradient(90% 80% at 50% 45%, rgba(110, 40, 56, 0.55), transparent 70%),
      radial-gradient(140% 120% at 50% 50%, #4a1b27 0%, #31111a 55%, #1f0a10 100%);
  }
  body::before {
    content: '';
    position: fixed;
    inset: 0;
    opacity: 0.13;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' viewBox='0 0 96 96'%3E%3Cg fill='none' stroke='%23E8CF8A' stroke-width='.9'%3E%3Crect x='33' y='33' width='30' height='30'/%3E%3Crect x='33' y='33' width='30' height='30' transform='rotate(45 48 48)'/%3E%3Cpath d='M48 0v26.8M48 69.2V96M0 48h26.8M69.2 48H96M0 0l33 33M96 0L63 33M0 96l33-33M96 96L63 63'/%3E%3Ccircle cx='48' cy='48' r='6'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 96px 96px;
  }
  .stage {
    width: min(620px, calc(100vw - 64px));
    height: calc(100vh - 56px);
    height: calc(100dvh - 56px);
    margin: 28px auto;
    border-radius: 3px;
    box-shadow:
      0 0 0 1px rgba(232, 207, 138, 0.28),
      0 30px 90px rgba(0, 0, 0, 0.5),
      0 8px 24px rgba(0, 0, 0, 0.3);
  }
}

/* ---------- scenes ---------- */

.scene {
  position: relative;
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 76px 34px;
  text-align: center;
}
.scene-inner {
  position: relative;
  width: 100%;
  max-width: 440px;
}

.eyebrow {
  margin: 0 0 14px;
  padding-left: 0.34em; /* balances the tracking so caps sit centred */
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 0.34em;
  line-height: 1.6;
  text-transform: uppercase;
  color: var(--wine);
}
.eyebrow--wrap { max-width: 260px; margin-inline: auto; }

.foil-text {
  background: var(--foil);
  background-size: 220% 100%;
  background-position: var(--foil-x) 50%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

/* Script lines: plain Pinyon text until main.js swaps in traceable outlines. */
.script {
  display: block;
  margin: 0 auto;
  font-family: var(--f-script);
  font-weight: 400;
  font-size: min(54px, 13.4vw);
  line-height: 1.25;
  color: var(--wine);
}
.script svg {
  width: var(--w, auto);
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  overflow: visible;
}
.script path.f { fill: var(--wine); stroke: none; }
.script path.s { fill: none; stroke: url(#foil); stroke-linejoin: round; stroke-linecap: round; }
.script--long { font-size: min(38px, 9.3vw); }
.script--title { font-size: min(48px, 11vw); margin: 6px auto 4px; }

/* ---------- I. cover ---------- */

.cover { padding-bottom: 116px; } /* room for the scroll cue */
.cover .scene-inner { padding-top: 6px; }

/* The couple under the arch (drawn by js/couple.js) */
.couple {
  display: block;
  width: min(196px, 50vw);
  height: auto;
  margin: -6px auto 12px;
  overflow: visible;
}
.cp-shine { opacity: 0.6; mix-blend-mode: screen; }
.cp-spark {
  transform-box: fill-box;
  transform-origin: center;
  animation: twinkle 3.2s ease-in-out infinite;
}
.cp-spark:nth-child(3n) { animation-delay: -1.1s; }
.cp-spark:nth-child(3n + 1) { animation-delay: -2.2s; }
@keyframes twinkle { 50% { opacity: 0.15; transform: scale(0.55); } }

@media (max-height: 720px) {
  .couple { width: min(156px, 42vw); }
}

.cover-rosette {
  position: absolute;
  left: 50%;
  top: 47%;
  width: min(148vw, 760px);
  height: auto;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  opacity: 0.16;
  pointer-events: none;
  animation: spin 240s linear infinite;
}
.cover-rosette * { vector-effect: non-scaling-stroke; }
@keyframes spin { to { transform: translate(-50%, -50%) rotate(360deg); } }

.names { margin: 0; font-weight: 400; }
.names .script:first-child { margin-top: 4px; }
.amp {
  display: block;
  margin: 2px auto 6px;
  font-family: var(--f-serif);
  font-style: italic;
  font-weight: 400;
  font-size: 40px;
  line-height: 1;
}

.divider {
  width: 200px;
  height: 22px;
  margin: 22px auto 18px;
}
.divider svg { width: 100%; height: 100%; overflow: visible; }
.divider--small { width: 150px; margin: 14px auto 18px; }

.cover-day,
.cover-place {
  margin: 0;
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 0.36em;
  padding-left: 0.36em;
  text-transform: uppercase;
  color: var(--wine);
}
.cover-date {
  margin: 4px 0 6px;
  font-weight: 500;
  font-size: 30px;
  letter-spacing: 0.08em;
  color: var(--ink);
}
.cover-date i { font-style: normal; color: var(--gold); padding: 0 0.12em; }

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  gap: 8px;
  color: var(--gold-deep);
  text-decoration: none;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.32em;
  padding-left: 0.32em;
  text-transform: uppercase;
}
.scroll-cue i {
  position: relative;
  width: 1px;
  height: 38px;
  background: linear-gradient(var(--hair), transparent);
  overflow: hidden;
}
.scroll-cue i::after {
  content: '';
  position: absolute;
  left: -1px;
  top: -12px;
  width: 3px;
  height: 12px;
  border-radius: 2px;
  background: var(--gold);
  animation: cue 2.2s var(--ease-out) infinite;
}
@keyframes cue {
  0% { transform: translateY(0); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translateY(52px); opacity: 0; }
}

/* ---------- II. ayah ---------- */

.bismillah {
  width: min(310px, 84%);
  margin: 0 auto;
}
.bismillah svg { width: 100%; height: auto; overflow: visible; }

.verse {
  margin: 0 0 18px;
  text-wrap: balance;
  font-family: var(--f-arabic);
  font-size: min(25px, 6.2vw);
  line-height: 2.25;
  color: var(--ink);
  word-spacing: 0.04em;
}
.verse .w {
  display: inline-block;
  white-space: nowrap;
}
.js .verse .w {
  opacity: 0;
  transform: translateY(8px);
  filter: blur(2px);
  transition: opacity 0.7s ease, transform 0.8s var(--ease-out), filter 0.7s ease;
}
.js .verse.in .w { opacity: 1; transform: none; filter: none; }

.translation {
  margin: 0 auto 18px;
  text-wrap: pretty;
  max-width: 360px;
  font-style: italic;
  font-size: 18.5px;
  line-height: 1.55;
  color: var(--ink-soft);
}
.ref {
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold-deep);
}
.ref-ar {
  font-family: var(--f-arabic);
  font-size: 17px;
  letter-spacing: 0;
  font-weight: 400;
  color: var(--ink-soft);
}

/* ---------- III. invitation ---------- */

.hosts { margin: 0 0 10px; }
.host {
  display: block;
  font-weight: 600;
  font-size: 21px;
  line-height: 1.35;
  color: var(--wine);
}
.late { font-weight: 400; font-style: italic; color: var(--ink-soft); }

.lead {
  margin: 6px auto;
  max-width: 330px;
  font-style: italic;
  font-size: 18.5px;
  line-height: 1.5;
  color: var(--ink-soft);
}
.invite .script { font-size: min(48px, 12vw); margin: 2px auto 4px; }
.invite .script--title { font-size: min(50px, 11.2vw); margin: 4px auto 10px; }

/* ---------- IV. the day ---------- */

.weekday {
  margin: 0 0 8px;
  font-style: italic;
  font-size: 34px;
  line-height: 1.1;
  color: var(--wine);
}

.calendar {
  width: min(300px, 100%);
  margin: 6px auto 14px;
  padding: 14px 12px 10px;
  border-top: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
}
.cal-month {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3em;
  padding-left: 0.3em;
  text-transform: uppercase;
  color: var(--gold-deep);
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  row-gap: 2px;
}
.cal-grid span {
  position: relative;
  display: grid;
  place-items: center;
  height: 32px;
  font-size: 16px;
  color: var(--ink-soft);
}
.cal-grid .dow {
  height: 24px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--gold-deep);
}
.cal-grid .wknd { color: var(--ink); }
.cal-grid .mark { color: var(--paper-hi); font-weight: 600; z-index: 0; }
.cal-grid .mark::before {
  content: '';
  position: absolute;
  inset: 3px;
  margin: auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #7b3243, var(--wine) 60%, var(--wine-deep));
  z-index: -1;
}
.cal-grid .mark svg {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 46px;
  height: 46px;
  transform: translate(-50%, -50%);
  overflow: visible;
  pointer-events: none;
}

.when {
  margin: 0;
  font-weight: 500;
  font-size: 21px;
  color: var(--ink);
}
.when i { font-style: normal; color: var(--gold); padding: 0 0.45em; }

.insha {
  margin: 2px 0 14px;
  font-family: var(--f-arabic);
  font-size: 22px;
  line-height: 1.9;
  color: var(--gold-deep);
}

.countdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: min(320px, 100%);
  margin: 0 auto 22px;
}
.countdown[hidden] { display: none; }
.unit {
  position: relative;
  display: grid;
  gap: 2px;
  padding: 2px 0;
}
.unit + .unit::before {
  content: '';
  position: absolute;
  left: 0;
  top: 18%;
  bottom: 18%;
  width: 1px;
  background: linear-gradient(transparent, var(--hair), transparent);
}
.unit b {
  font-weight: 500;
  font-size: 32px;
  line-height: 1.1;
  color: var(--wine);
  font-variant-numeric: lining-nums tabular-nums;
}
.unit span {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.22em;
  padding-left: 0.22em;
  text-transform: uppercase;
  color: var(--gold-deep);
}
.countdown-note {
  margin: -6px auto 20px;
  max-width: 300px;
  font-style: italic;
  font-size: 19px;
  color: var(--wine);
}

/* ---------- buttons ---------- */

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 11px 20px 10px;
  border: 1px solid var(--gold);
  border-radius: 999px;
  background: linear-gradient(180deg, #6c2a3b, var(--wine) 55%, #4d1b28);
  color: #f6e6bd;
  font-family: var(--f-serif);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 6px 16px -8px rgba(61, 21, 32, 0.6), inset 0 1px 0 rgba(255, 236, 190, 0.18);
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s ease, background-color 0.25s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 22px -10px rgba(61, 21, 32, 0.7), inset 0 1px 0 rgba(255, 236, 190, 0.2); }
.btn:active { transform: translateY(0); }
.btn:focus-visible,
.card-thumb:focus-visible,
.viewer-close:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.btn--ghost {
  background: rgba(252, 248, 241, 0.55);
  color: var(--wine);
  box-shadow: none;
}
.btn--ghost:hover { background: rgba(252, 248, 241, 0.9); box-shadow: 0 8px 18px -12px rgba(61, 21, 32, 0.45); }

/* ---------- V. venue ---------- */

.venue-name {
  margin: 0;
  font-weight: 500;
  font-size: min(34px, 8.6vw);
  line-height: 1.15;
  color: var(--wine);
}
.venue-city {
  margin: 6px 0 22px;
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 0.36em;
  padding-left: 0.36em;
  text-transform: uppercase;
  color: var(--gold-deep);
}
.arch {
  position: relative;
  display: block;
  width: min(290px, 86%);
  aspect-ratio: 3 / 4;
  margin: 0 auto 30px;
  color: inherit;
  text-decoration: none;
}
.arch:focus-visible { outline: 2px solid var(--gold); outline-offset: 6px; border-radius: 4px; }
.arch-window {
  position: absolute;
  inset: 9px;
  clip-path: url(#arch-clip);
  background: #efe6d4;
}
/* Taller than the window and nudged up so Google's place card sits outside the arch */
.arch-window iframe {
  position: absolute;
  left: 0;
  top: -70px;
  width: 100%;
  height: calc(100% + 70px);
  border: 0;
  filter: sepia(0.28) saturate(0.88) contrast(0.96) brightness(1.02);
  pointer-events: none; /* the whole arch opens Google Maps instead */
}
/* The map centre sits 35px above the window centre (iframe is shifted up 70px). */
.map-pin {
  position: absolute;
  left: 50%;
  top: calc(50% - 35px);
  width: 34px;
  height: 46px;
  transform: translate(-50%, -91%);
  overflow: visible;
  filter: drop-shadow(0 3px 4px rgba(61, 21, 32, 0.35));
}
.pin-pulse {
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.2;
  transform-origin: 0 0;
  animation: pin-pulse 2.4s ease-out infinite;
}
@keyframes pin-pulse {
  0% { transform: scale(0.6); opacity: 0.9; }
  100% { transform: scale(3.2); opacity: 0; }
}
.arch-hint {
  position: absolute;
  left: 50%;
  bottom: -22px;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.26em;
  padding-left: 0.26em;
  text-transform: uppercase;
  color: var(--gold-deep);
}
.arch-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

/* ---------- VI. welcoming ---------- */

.medallion { width: 66px; height: 66px; margin: 0 auto 18px; overflow: visible; }
.family {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}
.family li {
  font-weight: 500;
  font-size: 22px;
  line-height: 1.3;
  color: var(--ink);
}
.family li + li::before {
  content: '';
  display: block;
  width: 5px;
  height: 5px;
  margin: 9px auto;
  transform: rotate(45deg);
  background: var(--gold);
  opacity: 0.8;
}

/* ---------- VII. closing ---------- */

.closing-line {
  margin: 0 auto 26px;
  max-width: 320px;
  font-style: italic;
  font-size: 22px;
  line-height: 1.4;
  color: var(--wine);
}
.cards {
  position: relative;
  display: flex;
  justify-content: center;
  margin: 0 auto 30px;
  height: min(232px, 58vw);
}
.card-thumb {
  position: relative;
  width: min(152px, 38vw);
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: none;
  cursor: zoom-in;
  box-shadow: 0 14px 28px -14px rgba(61, 21, 32, 0.55), 0 0 0 1px rgba(184, 145, 63, 0.35);
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s ease;
}
.card-thumb img { width: 100%; height: auto; border-radius: 2px; }
.card-thumb:first-child { transform: rotate(-6deg) translateX(12px); z-index: 1; }
.card-thumb:last-child { transform: rotate(5deg) translate(-12px, 10px); }
.card-thumb:hover { z-index: 2; transform: rotate(0) translateY(-6px) scale(1.04); }

.foot { margin-top: 34px; color: var(--gold-deep); }
.foot-rings { width: 64px; height: 30px; margin: 0 auto 8px; overflow: visible; }
.foot p {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.34em;
  padding-left: 0.34em;
}

/* ---------- opening: the jaali envelope ---------- */

.intro {
  position: absolute;
  inset: 0;
  z-index: 10;
  overflow: hidden;
  color: #f3e6cc;
}
.velvet {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(55% 38% at 50% 52%, rgba(255, 208, 140, 0.16), transparent 72%),
    radial-gradient(125% 95% at 50% 50%, #612536 0%, #461a26 45%, #2b0e17 82%, #1d0810 100%);
}
.velvet::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' viewBox='0 0 96 96'%3E%3Cg fill='none' stroke='%23E8CF8A' stroke-width='.9'%3E%3Crect x='33' y='33' width='30' height='30'/%3E%3Crect x='33' y='33' width='30' height='30' transform='rotate(45 48 48)'/%3E%3Cpath d='M48 0v26.8M48 69.2V96M0 48h26.8M69.2 48H96M0 0l33 33M96 0L63 33M0 96l33-33M96 96L63 63'/%3E%3Ccircle cx='48' cy='48' r='6'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 96px 96px;
}
.velvet::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.35;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n' x='0' y='0'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 220px 220px;
}
.rays {
  position: absolute;
  left: 50%;
  top: 52%;
  width: 190vmax;
  height: 190vmax;
  transform: translate(-50%, -50%);
  background: repeating-conic-gradient(from 0deg, rgba(255, 222, 156, 0.1) 0deg 3.5deg, transparent 3.5deg 15deg);
  -webkit-mask-image: radial-gradient(closest-side, #000, transparent 62%);
  mask-image: radial-gradient(closest-side, #000, transparent 62%);
  opacity: 0.45;
  animation: rays 90s linear infinite;
}
@keyframes rays { to { transform: translate(-50%, -50%) rotate(360deg); } }

.intro-inner {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 22px 20px calc(22px + env(safe-area-inset-bottom));
  text-align: center;
}
.greet {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-bottom: 22px;
}
.greet p { margin: 0; }
.greet-name {
  font-family: var(--f-script);
  font-size: min(38px, 9.6vw);
  line-height: 1.25;
  margin-bottom: 6px !important;
}
.amp-inline {
  font-family: var(--f-serif);
  font-style: italic;
  font-size: 0.8em;
  padding: 0 0.04em;
}
.greet-line {
  font-style: italic;
  font-size: 20px;
  color: rgba(246, 233, 206, 0.9);
}
.greet-hint {
  flex: 1 1 0;
  margin: 0;
  padding-top: 38px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.34em;
  padding-left: 0.34em;
  text-transform: uppercase;
  color: var(--gold-light);
}
.greet-hint span { display: inline-block; animation: breathe 2.6s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: 0.4; } }

.env-btn {
  position: relative;
  flex: none;
  width: min(290px, 74vw, calc((100vh - 290px) / 1.3));
  width: min(290px, 74vw, calc((100dvh - 290px) / 1.3));
  aspect-ratio: 300 / 390;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.env-btn:disabled { cursor: default; }
.env-btn:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 10px; border-radius: 4px; }
.env-shadow {
  position: absolute;
  left: 4%;
  right: 4%;
  bottom: -7%;
  height: 12%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(10, 2, 5, 0.55), transparent);
  filter: blur(3px);
  animation: shadow 5s ease-in-out infinite;
}
.env-float {
  position: absolute;
  inset: 0;
  animation: float 5s ease-in-out infinite;
}
@keyframes float { 50% { transform: translateY(-7px); } }
@keyframes shadow { 50% { transform: scale(0.93); opacity: 0.8; } }

.envelope {
  position: absolute;
  inset: 0;
  transform: perspective(1100px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
}
.envelope > * { position: absolute; }
.env-inside,
.env-pocket,
.env-tie {
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.env-inside { z-index: 1; }
.env-light {
  z-index: 3;
  left: -40%;
  right: -40%;
  top: -55%;
  height: 110%;
  background: radial-gradient(50% 50% at 50% 50%, rgba(255, 236, 190, 0.95), rgba(244, 196, 120, 0.45) 35%, transparent 70%);
  opacity: 0;
  pointer-events: none;
}
.env-card {
  z-index: 4;
  left: 3.5%;
  top: 3%;
  width: 93%;
  height: 94%;
  border-radius: 3px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(184, 145, 63, 0.55), 0 6px 18px rgba(30, 6, 12, 0.35);
}
.env-card .edge,
.unfold .edge {
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(184, 145, 63, 0.7);
  pointer-events: none;
}
.env-card-emblem,
.unfold-emblem {
  position: absolute;
  left: 50%;
  top: 9%;
  width: 44%;
  transform: translateX(-50%);
  overflow: visible;
}
.env-pocket { z-index: 5; }
.env-flap {
  z-index: 6;
  left: 0;
  top: 0;
  width: 100%;
  height: 61.54%; /* 240 of 390 */
  transform-style: preserve-3d;
}
.flap-face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.flap-back { transform: rotateX(180deg); }
.env-tie { z-index: 7; pointer-events: none; }
.tassel-sway {
  transform-box: view-box;
  transform-origin: 165px 268px;
  animation: sway 3.4s ease-in-out infinite;
}
@keyframes sway {
  0%, 100% { transform: rotate(-3.5deg); }
  50% { transform: rotate(3.5deg); }
}

.unfold {
  position: absolute;
  z-index: 12;
  overflow: hidden;
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(184, 145, 63, 0.55), 0 20px 50px rgba(20, 4, 9, 0.45);
}
.unfold[hidden] { display: none; }

.js .greet > *,
.js .greet-hint,
.js .env-btn { opacity: 0; }
.no-js .intro,
.fallback .intro { display: none; }
.fallback [data-reveal],
.fallback [data-cover],
.fallback .verse .w { opacity: 1 !important; transform: none !important; filter: none !important; }



/* ---------- reveals ---------- */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.9s ease, transform 1s var(--ease-out);
  transition-delay: var(--d, 0s);
}
.js [data-reveal].in { opacity: 1; transform: none; }
.js [data-cover] { opacity: 0; }

/* ---------- card viewer ---------- */

.viewer {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(28, 9, 14, 0.94);
  display: grid;
  place-items: center;
}
.viewer[hidden] { display: none; }
.viewer-track {
  display: flex;
  width: 100%;
  height: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.viewer-track::-webkit-scrollbar { display: none; }
.viewer-track figure {
  flex: 0 0 100%;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 56px 16px 32px;
  scroll-snap-align: center;
}
.viewer-track img {
  max-width: 100%;
  max-height: calc(100dvh - 100px);
  width: auto;
  height: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
.viewer-close {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 1;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(232, 207, 138, 0.5);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.25);
  color: var(--gold-light);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

/* Larger type when the invitation is shown as a card on a big screen */
@media (min-width: 720px) and (min-height: 600px) {
  .scene-inner { max-width: 470px; }
  .couple { width: 216px; }
  .names .script { font-size: 62px; }
  .names .script--long { font-size: 44px; }
  .amp { font-size: 46px; }
  .cover-date { font-size: 34px; }
  .invite .script { font-size: 54px; }
  .invite .script--title { font-size: 58px; }
  .bismillah { width: 330px; }
  .verse { font-size: 27px; }
  .translation,
  .lead { font-size: 20px; }
  .host { font-size: 23px; }
  .family li { font-size: 24px; }
  .greet-line { font-size: 23px; }
}

@media (prefers-reduced-motion: reduce) {
  .cover-rosette,
  .pin-pulse,
  .scroll-cue i::after,
  .rays,
  .env-float,
  .env-shadow,
  .tassel-sway,
  .cp-spark,
  .greet-hint span { animation: none; }
  .js [data-reveal],
  .js .verse .w { transition-duration: 0.01s; transform: none; filter: none; }
  .scroller { scroll-behavior: auto; }
}

.scroller:focus { outline: none; }
