:root {
  --page: #ece4d7;          /* the warm table the card lies on */
  --page-light: #f5efe5;    /* the light pooling in the middle */
  --paper: #fbf8f1;         /* cotton paper */
  --paper-edge: #dfd4c1;    /* the thickness of the card, seen at the bottom */
  --ink: #3b332b;           /* the printed words */
  --ink-soft: #8a7e70;      /* the small lines */
  --gold: #b0853f;          /* the foil: the only accent */
  --gold-light: #f3dca2;    /* the foil catching the light */
  --gold-dark: #7c5a26;     /* the foil in shadow */
  --tissue: 250, 248, 243;  /* the tissue, as rgb */
  --shadow: 70, 50, 30;     /* the warm shadow, as rgb */
}

* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body {
  background: var(--page);
  color: var(--ink);
  font-family: 'Mona Sans Variable', system-ui, sans-serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.stage {
  position: relative;
  height: 100vh;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(ellipse 60% 55% at 50% 46%, var(--page-light), transparent 72%),
    var(--page);
}
/* a faint grain over the table */
.stage::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .32;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .38 0 0 0 0 .3 0 0 0 .22 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* the card: sized on the height as well as the width, so it fits the phone box */
.invite {
  --w: min(62vh, 72vw, 372px);
  position: relative;
  width: var(--w);
  height: calc(var(--w) * 1.4);
  z-index: 1;
}
.invite__lift {
  position: absolute;
  inset: 0;
  container-type: inline-size;
  /* the contact shadow: a tight dark line, then two soft layers */
  filter:
    drop-shadow(0 1px 1px rgba(var(--shadow), .2))
    drop-shadow(0 6px 10px rgba(var(--shadow), .1))
    drop-shadow(0 22px 30px rgba(var(--shadow), .09));
}

.invite__edge, .invite__paper {
  position: absolute;
  inset: 0;
}
.invite__edge {
  background: var(--paper-edge);
  transform: translateY(2px);
}
.invite__paper {
  background:
    radial-gradient(ellipse 90% 70% at 30% 18%, rgba(255, 255, 255, .7), transparent 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .44 0 0 0 0 .36 0 0 0 .16 0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23g)'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.012 .09' numOctaves='2' seed='4'/%3E%3CfeColorMatrix values='0 0 0 0 .55 0 0 0 0 .5 0 0 0 0 .42 0 0 0 .1 0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23f)'/%3E%3C/svg%3E"),
    var(--paper);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8cqw 9cqw;
  gap: 0;
}

.mono {
  width: 15cqw;
  height: 15cqw;
  overflow: visible;
  margin-bottom: 6.4cqw;
}
.mono__ring, .mono__stroke {
  fill: none;
  stroke: var(--gold);
  stroke-width: .7;
  stroke-linecap: round;
}
.mono__ring--in { stroke-width: .35; opacity: .7; }
.mono__stroke { stroke-width: .5; }
.mono__l {
  font-family: 'Fraunces Variable', Georgia, serif;
  font-size: 22px;
  font-variation-settings: 'opsz' 144, 'wght' 300, 'SOFT' 100;
  fill: var(--ink);
}
.mono__l--it { font-style: italic; font-size: 20px; }

.eyebrow {
  font-size: 2.85cqw;
  font-variation-settings: 'wdth' 112, 'wght' 520;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 4.4cqw;
  padding-left: .34em;
}

.names {
  font-family: 'Fraunces Variable', Georgia, serif;
  font-weight: normal;
  font-size: 13.4cqw;
  line-height: .96;
  letter-spacing: -.015em;
  font-variation-settings: 'opsz' 144, 'wght' var(--wght, 290), 'SOFT' 100, 'WONK' 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.names__amp {
  font-style: italic;
  font-size: .62em;
  line-height: 1.12;
  color: var(--gold);
  font-variation-settings: 'opsz' 144, 'wght' 260, 'SOFT' 100, 'WONK' 1;
}
.intro {
  font-family: 'Fraunces Variable', Georgia, serif;
  font-style: italic;
  font-size: 4cqw;
  font-variation-settings: 'opsz' 14, 'wght' 340;
  color: var(--ink-soft);
  margin-top: 3.4cqw;
}

/* the date: a blind impression in the paper, and the foil laid over it */
.date {
  position: relative;
  margin-top: 6.6cqw;
}
.date__row {
  display: flex;
  align-items: center;
  gap: 3.2cqw;
  font-family: 'Fraunces Variable', Georgia, serif;
  font-size: 7.2cqw;
  line-height: 1;
  font-variant-numeric: lining-nums;
  font-variation-settings: 'opsz' 72, 'wght' 380, 'SOFT' 50;
  letter-spacing: .02em;
}
.date__row i {
  width: 1px;
  height: .8em;
  transform: rotate(18deg);
}
.date__row--blind {
  color: #f1ebdf;
  text-shadow: 0 -1px 0 rgba(var(--shadow), .26), 0 1px 0 rgba(255, 255, 255, .95);
}
.date__row--blind i { background: rgba(var(--shadow), .2); box-shadow: 1px 0 0 #fff; }
.date__row--foil {
  position: absolute;
  inset: 0;
  color: transparent;
  background: linear-gradient(100deg,
    var(--gold-dark) 0%, var(--gold) calc(var(--sheen, 50%) - 22%),
    var(--gold-light) var(--sheen, 50%),
    var(--gold) calc(var(--sheen, 50%) + 18%), var(--gold-dark) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 .5px 0 rgba(var(--shadow), .28));
  clip-path: inset(0 100% 0 0);
}
.date__row--foil i { background: linear-gradient(var(--gold-light), var(--gold-dark)); }

.place {
  font-size: 3.15cqw;
  font-variation-settings: 'wdth' 100, 'wght' 440;
  letter-spacing: .06em;
  color: var(--ink);
  margin-top: 6cqw;
}
.rule {
  width: 9cqw;
  height: 1px;
  background: var(--gold);
  opacity: .6;
  margin: 3.6cqw 0 3.2cqw;
}
.rsvp {
  font-size: 2.6cqw;
  font-variation-settings: 'wdth' 112, 'wght' 500;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding-left: .26em;
}

/* the tissue: a translucent sheet a little smaller than the card, so the deckle shows around it */
.tissue {
  position: absolute;
  inset: 2.6%;
  pointer-events: none;
}
.tissue__flat, .tissue__flap, .tissue__cast {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.tissue__flat {
  background:
    radial-gradient(ellipse 70% 55% at 40% 30%, rgba(255, 255, 255, .36), transparent 70%),
    rgba(var(--tissue), var(--tissue-a, .6));
  -webkit-backdrop-filter: blur(1.4px) saturate(.85);
  backdrop-filter: blur(1.4px) saturate(.85);
  box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .7);
}
.tissue__flap {
  transform-origin: 0 0;
  background: rgba(var(--tissue), .84);
  box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .8);
  visibility: hidden;
}
.tissue__castwrap {
  position: absolute;
  inset: 0;
  filter: blur(6px);
  visibility: hidden;
}
.tissue__cast {
  transform-origin: 0 0;
  background: rgba(var(--shadow), .13);
}
/* a long band laid along the fold line (placed by the script): light on the flap, shade on the flat sheet */
.tissue__sheen, .tissue__shade {
  position: absolute;
  left: 0;
  top: -1600px;
  width: 3200px;
  height: 3200px;
  transform-origin: 0 1600px;
}
.tissue__sheen {
  background: linear-gradient(90deg, rgba(255, 255, 255, .95) 0, rgba(255, 255, 255, .45) 10px, rgba(255, 255, 255, .12) 70px, rgba(var(--shadow), .05) 220px, transparent 420px);
}
.tissue__shade {
  background: linear-gradient(90deg, rgba(var(--shadow), .1) 0, rgba(var(--shadow), .03) 30px, transparent 90px);
  opacity: 0;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

@media (hover: hover) {
  .invite { cursor: pointer; }
}
