:root {
  --gold: #b97d3e;
  --gold-deep: #9a6530;
  --olive: #8d8f58;
  --muted: #a3936a;
  --paper: #fbf8f1;
  /* same font stacks as the original invitation; only Lora, Viaoda Libre,
     Alex Brush and EB Garamond are web fonts, the rest come from the device */
  --serif: Baskerville, "Libre Baskerville", "Times New Roman", serif;
  --arabic-head: "Cormorant Garamond", "Noto Naskh Arabic", "Times New Roman", serif;
  --times: "Times New Roman", Times, serif;
  --sys: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  --lora: Lora, "Times New Roman", serif;
  --script: "Alex Brush", "The Nautigal", cursive;
  --display: "Viaoda Libre", "EB Garamond", cursive;
  --garamond: "EB Garamond", serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: #fff;
  color: var(--olive);
  font-family: var(--serif);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
html.js:not(.skip-envelope) body.locked { overflow: hidden; height: 100vh; }
p, h1, h2 { margin: 0; }
button { font: inherit; }

/* ---------------- Envelope (values taken from the original cover) ---------------- */
.envelope { display: none; }
html.js:not(.skip-envelope) .envelope {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 16px;
  background:
    linear-gradient(to bottom right, rgba(138, 90, 42, .9), rgba(185, 125, 62, .9), rgba(216, 175, 135, .9)),
    url("img/bg-1440.webp") center / 1200px repeat,
    #b97d3e;
  transition: opacity .9s ease .25s, visibility 0s linear 1.15s;
}
.envelope.leaving { opacity: 0; visibility: hidden; pointer-events: none; }
.envelope.leaving .card { transform: translateY(-24px) scale(1.04); opacity: 0; }

.card {
  position: relative;
  z-index: 10;
  width: 310px;
  max-width: 100%;
  border-radius: 8px;
  box-shadow: 0 25px 60px -12px rgba(0, 0, 0, .45), 0 8px 24px rgba(0, 0, 0, .2), 0 0 40px rgba(185, 125, 62, .15);
  text-align: center;
  transition: transform .8s cubic-bezier(.2,.7,.2,1), opacity .7s ease;
  animation: card-in 1s cubic-bezier(.2,.7,.2,1) both;
}
@media (min-width: 640px)  { .card { width: 340px; } }
@media (min-width: 768px)  { .card { width: 520px; } }
@media (min-width: 1024px) { .card { width: 600px; } }
@keyframes card-in { from { opacity: 0; transform: translateY(18px) scale(.97); } }

.card-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(251, 248, 241, .98);
  border: 1px solid rgba(185, 125, 62, .15);
  clip-path: inset(0 round 8px);
}
.card-fl { position: absolute; width: 42%; max-width: 220px; height: auto; opacity: .5; pointer-events: none; }
.card-fl.tl { top: 0; left: 0; transform: translate(-28%, -28%) rotate(8deg); }
.card-fl.br { bottom: 0; right: 0; transform: translate(28%, 28%) rotate(8deg) scaleX(-1); }

.heart {
  position: absolute;
  z-index: 30;
  top: 21px;
  left: 50%;
  width: 57px;
  height: 57px;
  margin-left: -28.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 5px 27px rgba(185, 125, 62, .5);
}
.heart svg { width: 28px; height: 28px; }

.card-body { position: relative; z-index: 10; padding: 112px 24px 56px; }
@media (min-width: 768px) { .card-body { padding: 96px 24px 32px; } }
.env-names {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 0 8px;
  font-family: var(--display);
  font-weight: 400;
  font-size: 30px;
  line-height: 1.25;
  color: var(--gold);
}
.env-amp { font-family: var(--script); font-size: 18px; line-height: 1; }
@media (min-width: 640px) {
  .env-names { font-size: 36px; }
  .env-amp { font-size: 20px; }
}
.env-rule { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 0 0 8px; }
.env-rule .ln { width: 40px; height: 1px; }
.env-rule .ln.l { background: linear-gradient(to right, transparent, var(--gold)); }
.env-rule .ln.r { background: linear-gradient(to left, transparent, var(--gold)); }
.fleuron { font-family: var(--sys); font-size: 14px; line-height: 20px; color: var(--gold); opacity: .7; }
.env-date {
  margin: 0 0 24px;
  font-family: var(--lora);
  font-weight: 300;
  font-size: 18px;
  line-height: 27px;
  color: rgba(141, 143, 88, .85);
}
.open-btn {
  display: flex;
  width: fit-content;
  margin: 0 auto;
  padding: 10px 32px;
  border: 0;
  border-radius: 999px;
  background: var(--gold);
  color: #fff;
  font-family: var(--lora);
  font-weight: 600;
  font-size: 18px;
  line-height: 28px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(185, 125, 62, .35);
  transition: transform .2s ease, background .2s ease;
}
@media (min-width: 640px) { .open-btn { font-weight: 500; } }
.open-btn:hover { transform: translateY(-1px); background: #ad7236; }
.open-btn:active { transform: translateY(1px); }
.open-btn:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

/* falling blossoms: their own layer so they never affect the card's centering */
.petals { position: absolute; inset: 0; z-index: 1; overflow: hidden; pointer-events: none; }
.petals i {
  position: absolute;
  top: -30px;
  width: 18px; height: 18px;
  background: url("img/blossom.svg") center / contain no-repeat;
  animation: drift linear infinite;
}
.petals i:nth-child(1)  { left: 8%;  animation-duration: 19s; animation-delay: -2s;  width: 20px; height: 20px; }
.petals i:nth-child(2)  { left: 22%; animation-duration: 24s; animation-delay: -11s; width: 15px; height: 15px; }
.petals i:nth-child(3)  { left: 37%; animation-duration: 21s; animation-delay: -6s; }
.petals i:nth-child(4)  { left: 51%; animation-duration: 27s; animation-delay: -17s; width: 14px; height: 14px; }
.petals i:nth-child(5)  { left: 64%; animation-duration: 20s; animation-delay: -9s;  width: 22px; height: 22px; }
.petals i:nth-child(6)  { left: 78%; animation-duration: 22s; animation-delay: -3s; }
.petals i:nth-child(7)  { left: 90%; animation-duration: 23s; animation-delay: -14s; width: 16px; height: 16px; }
.petals i:nth-child(8)  { left: 14%; animation-duration: 29s; animation-delay: -20s; width: 14px; height: 14px; }
.petals i:nth-child(9)  { left: 70%; animation-duration: 31s; animation-delay: -24s; width: 15px; height: 15px; }
.petals i:nth-child(10) { left: 44%; animation-duration: 26s; animation-delay: -1s;  width: 20px; height: 20px; }
@keyframes drift {
  0%   { transform: translate3d(0, 0, 0) rotate(0deg); }
  50%  { transform: translate3d(20px, 55vh, 0) rotate(180deg); }
  100% { transform: translate3d(-12px, 112vh, 0) rotate(360deg); }
}

/* ---------------- Paper ---------------- */
.paper {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  background: var(--paper);
  isolation: isolate;
  overflow: hidden;
  text-align: center;
}
.paper::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: url("img/bg-1440.webp") 0 0 / 286% auto repeat;
  opacity: .06;
}
@media (min-width: 768px) { .paper { border: 1px solid rgba(185, 125, 62, .2); } }
section { position: relative; padding: 0 24px; }
.deco { position: absolute; pointer-events: none; z-index: 0; }
section > *:not(.deco):not(.pillar) { position: relative; z-index: 1; }

.reveal { opacity: 0; transform: translateY(16px); transition: opacity 1s ease, transform 1s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
html:not(.js) .reveal { opacity: 1; transform: none; }

/* hero */
.hero { padding-top: 84px; padding-bottom: 40px; }
.deco-hero-tr { width: 318px; height: auto; right: -80px; top: -102px; opacity: .45; transform: rotate(190deg); }
.ar-head {
  font-family: var(--arabic-head);
  font-weight: 700;
  font-size: 20px;
  line-height: 1.55;
  color: var(--gold);
  white-space: pre-line;
}
.frame {
  position: relative;
  width: min(515px, 100%);
  aspect-ratio: 1074 / 1293;
  margin: 34px auto 0;
  container-type: inline-size;
}
.frame-img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.frame-names {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1;
  font-family: var(--display);
  color: var(--gold);
  text-transform: uppercase;
}
.fn-row { display: flex; width: 56%; justify-content: center; }
.fn {
  white-space: nowrap;
  /* 47px at full frame width, scales down with the frame on phones */
  font-size: min(47px, 9.13cqw);
  line-height: 1.25;
  padding-top: .16em;
}
.fn-amp {
  margin: 8px 0;
  font-family: var(--script);
  font-size: min(24px, 4.66cqw);
  text-transform: none;
  line-height: 1;
  opacity: .95;
}
@media (min-width: 768px) { .fn-amp { margin: 12px 0; } }

/* announcement */
.announce { padding-top: 40px; padding-bottom: 60px; }
.deco-ann-l { width: 208px; height: auto; left: -73px; top: -73px; transform: rotate(80deg); }
.deco-ann-r { width: 164px; height: auto; right: -76px; top: 228px; }
.dots { font-family: var(--times); font-weight: 700; color: var(--gold); font-size: 24px; line-height: 1; margin-bottom: 22px; }
.ar-text {
  font-family: var(--serif);
  font-weight: 300;
  font-size: 20px;
  line-height: 1.75;
  color: var(--gold);
  white-space: pre-line;
  max-width: 470px;
  margin: 0 auto;
}
.couple { margin-top: 36px; }
.name {
  font-family: var(--garamond);
  font-weight: 400;
  font-size: clamp(48px, 15vw, 66px);
  line-height: 1.15;
  color: var(--olive);
}
.role {
  font-size: 12px;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  color: var(--olive);
  margin-top: 18px;
}
.amp-lg { font-family: var(--script); font-size: 38px; color: var(--gold); line-height: 1; margin: 28px 0 26px; }

/* when */
.when { padding-top: 70px; padding-bottom: 26px; }
.pillar {
  position: absolute;
  top: 70px;
  width: clamp(34px, 6.2vw, 56px);
  aspect-ratio: 60 / 420;
  height: auto;
  z-index: 0;
}
.pillar-l { left: 0; }
.pillar-r { right: 0; }
/* scroll art leans up-right; mirror the right one so both lean in toward the center */
.deco-when-l { width: 171px; height: auto; left: -71px; top: -104px; }
.deco-when-r { width: 171px; height: auto; right: -71px; top: -104px; transform: scaleX(-1); }
.ar-title {
  font-family: var(--times);
  font-weight: 700;
  font-size: 24px;
  line-height: 1.4;
  color: var(--gold);
}
.kicker {
  font-weight: 600;
  font-size: clamp(15px, 4.2vw, 20px);
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--gold);
  margin: 4px auto 0;
  max-width: 780px;
  line-height: 1.5;
  text-wrap: balance;
}
.when .kicker, .when .time, .when .dateline, .when .year, .when .countdown { padding: 0 clamp(28px, 6vw, 40px); }
.time { font-size: 30px; margin-top: 22px; }
.dateline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 24px;
  font-size: 16px;
  text-transform: uppercase;
}
.dateline .day { font-size: 40px; line-height: 1; }
.dateline .bar { width: 1.5px; height: 36px; background: var(--olive); }
.year { font-size: 24px; margin-top: 22px; }
.kicker-sm { font-size: 18px; letter-spacing: 1.44px; margin-top: 32px; }
.countdown { font-size: 18px; margin-top: 8px; font-variant-numeric: tabular-nums; }

.calendar {
  position: relative;
  width: min(435px, 100%);
  margin: 50px auto 0;
  padding: 22px 26px 26px;
  border-top: 1.5px solid var(--gold);
  border-bottom: 1.5px solid var(--gold);
}
.calendar::before {
  content: "";
  position: absolute;
  inset: 10px 0;
  border-left: 1.5px solid var(--gold);
  border-right: 1.5px solid var(--gold);
  pointer-events: none;
}
.cal-corner { position: absolute; width: 54px; height: 54px; overflow: visible; }
.c-tl { left: -12px; top: -12px; }
.c-tr { right: -12px; top: -12px; transform: scaleX(-1); }
.c-bl { left: -12px; bottom: -12px; transform: scaleY(-1); }
.c-br { right: -12px; bottom: -12px; transform: scale(-1, -1); }
.cal-title {
  font-family: var(--sys);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: .35px;
  color: var(--olive);
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(185, 125, 62, .18);
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  font-family: var(--sys);
  font-weight: 300;
  font-size: 13px;
  color: #8a8c55;
}
.cal-grid .wd {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  padding: 8px 0 6px;
  border-bottom: 1.5px solid var(--gold);
  margin-bottom: 8px;
}
.cal-grid .d { height: 36px; display: grid; place-items: center; position: relative; }
.cal-grid .d.hl { color: #fff; font-weight: 700; font-size: 12px; }
.cal-grid .d.hl::before {
  content: "";
  position: absolute;
  width: 26px; height: 26px;
  left: 50%; top: 50%;
  transform: translate(-50%, -46%);
  background: url("img/heart.svg") center / contain no-repeat;
  z-index: -1;
}
.cal-grid .d.hl { z-index: 0; isolation: isolate; }

.text-link {
  display: inline-block;
  margin-top: 24px;
  padding: 4px 2px;
  border: 0;
  background: none;
  color: var(--olive);
  font-family: var(--serif);
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.divider { width: 305px; max-width: 75%; margin: 44px auto 0; }
.divider svg { display: block; width: 100%; height: auto; overflow: visible; }

/* where */
.where { padding-top: 60px; padding-bottom: 30px; }
.deco-where-r { width: 187px; height: auto; right: -73px; bottom: -98px; }
.map-link {
  display: inline-block;
  margin-top: 14px;
  padding-bottom: 12px;
  max-width: 100%;
  overflow-wrap: anywhere;
  color: var(--olive);
  font-size: 14px;
  letter-spacing: .4px;
  text-decoration: none;
  border-bottom: 1px solid rgba(141, 143, 88, .18);
}
.map {
  width: min(563px, 100%);
  margin: 24px auto 0;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 10px 30px -14px rgba(120, 80, 30, .35);
  background: #e9e3d4;
}
.map iframe { display: block; width: 100%; height: 380px; border: 0; }
.directions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 28px;
  color: var(--olive);
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
}
.directions svg { width: 15px; height: 15px; }

/* thanks */
.thanks { padding-top: 60px; padding-bottom: 28px; }
.thanks .ar-text { font-size: 18px; max-width: 480px; }
.deco-thanks-bl { width: 294px; height: auto; left: -61px; bottom: 0; transform: rotate(-10deg); opacity: .85; }
.deco-thanks-r { width: 135px; height: auto; right: -67px; top: 147px; opacity: .9; }
.foot { margin-top: 70px; font-family: var(--sys); font-size: 12px; color: var(--muted); }

/* music */
.music-btn {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 40;
  width: 44px; height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 6px 16px rgba(150, 90, 30, .35);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.music-btn[hidden] { display: none; }
.eq { display: flex; align-items: flex-end; gap: 3px; height: 14px; }
.eq i { width: 3px; height: 5px; background: #fff; border-radius: 1px; }
.music-btn[aria-pressed="true"] .eq i { animation: eq 1s ease-in-out infinite; }
.music-btn[aria-pressed="true"] .eq i:nth-child(2) { animation-delay: -.35s; }
.music-btn[aria-pressed="true"] .eq i:nth-child(3) { animation-delay: -.7s; }
.music-btn[aria-pressed="false"] .eq i:nth-child(2) { height: 9px; }
@keyframes eq { 0%, 100% { height: 4px; } 50% { height: 14px; } }

@media (max-width: 480px) {
  .ar-head { font-size: 18px; }
  .ar-text { font-size: 17px; }
  .thanks .ar-text { font-size: 15.5px; }
  .ar-title { font-size: 21px; }
  .time { font-size: 26px; }
  .dateline { gap: 12px; font-size: 13px; }
  .dateline .day { font-size: 34px; }
  .map iframe { height: 300px; }
  .deco-hero-tr { width: 190px; right: -60px; top: -70px; }
  .deco-ann-l { width: 130px; left: -62px; top: -40px; }
  .deco-ann-r { width: 96px; right: -56px; top: 170px; opacity: .8; }
  .deco-when-l, .deco-when-r { width: 96px; top: -50px; opacity: .85; }
  .deco-when-l { left: -52px; }
  .deco-when-r { right: -52px; }
  .deco-where-r { width: 110px; right: -62px; bottom: -60px; opacity: .85; }
  .deco-thanks-r { width: 84px; right: -50px; opacity: .75; }
  .deco-thanks-bl { width: 170px; left: -56px; bottom: -10px; opacity: .6; }
}

@media (prefers-reduced-motion: reduce) {
  .petals { display: none; }
  .reveal { transition: none; opacity: 1; transform: none; }
  .card { animation: none; }
}
