:root {
  --wine: #702d2d;
  --wine-dark: #471a1d;
  --paper: #eee5d5;
  --paper-light: #faf7ef;
  --ink: #27231e;
  --gold: #b18b50;
  --serif: "Italiana", Georgia, serif;
  --serif-alt: "Cormorant Garamond", Georgia, serif;
  --sans: "Montserrat", Arial, sans-serif;
  --script: "Mrs Saint Delafield", cursive;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: #20191a;
  font-family: var(--sans);
  font-weight: 300;
}
button, a { -webkit-tap-highlight-color: transparent; }

.intro {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 46%, rgba(255,231,195,.25), transparent 48%),
    linear-gradient(115deg, rgba(255,255,255,.12), transparent 35%, rgba(75,39,22,.1)),
    repeating-radial-gradient(circle at 40% 50%, transparent 0 3px, rgba(72,42,25,.025) 4px 5px),
    #a9825e;
  perspective: 1400px;
  transition: opacity .8s ease 2.8s, visibility .8s ease 2.8s;
}
.intro::before {
  position: absolute;
  inset: 0;
  content: "";
  opacity: .35;
  background:
    linear-gradient(115deg, transparent 20%, rgba(65,35,20,.12) 21%, transparent 22%),
    linear-gradient(17deg, transparent 65%, rgba(255,255,255,.12) 66%, transparent 68%);
  filter: url("#noise");
}
.intro__grain {
  position: absolute;
  inset: 0;
  opacity: .22;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.32'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
  pointer-events: none;
}
.intro__message {
  position: absolute;
  top: 9%;
  color: rgba(255,255,255,.85);
  text-align: center;
  text-transform: uppercase;
  transition: opacity .4s ease;
}
.intro__message p {
  margin: 0;
  font: 300 clamp(1.1rem, 4vw, 1.8rem)/1 var(--serif);
  letter-spacing: .18em;
}
.intro__message strong {
  display: block;
  margin-top: -.2rem;
  font: 400 clamp(4rem, 13vw, 7rem)/1 var(--script);
  text-transform: none;
}
.envelope {
  position: relative;
  width: min(600px, 90vw);
  height: min(405px, 60.75vw);
  margin-top: 7vh;
  filter:
    drop-shadow(0 8px 5px rgba(52,27,15,.18))
    drop-shadow(0 30px 28px rgba(37,18,12,.34));
  transform-style: preserve-3d;
}
.envelope::before {
  position: absolute;
  z-index: -1;
  right: 3%;
  bottom: -7%;
  left: 3%;
  height: 16%;
  content: "";
  background: rgba(39,18,9,.4);
  border-radius: 50%;
  filter: blur(18px);
}
.envelope__back,
.envelope__front,
.envelope__left,
.envelope__right,
.envelope__flap {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background-color: #b58a60;
  background-image:
    linear-gradient(118deg, rgba(255,255,255,.12), transparent 35%, rgba(78,40,20,.1)),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 140 140' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.72' numOctaves='4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.22'/%3E%3C/svg%3E");
  background-blend-mode: soft-light, multiply;
}
.envelope__back {
  border: 1px solid rgba(85,46,25,.22);
  border-radius: 5px;
  box-shadow:
    inset 0 2px 2px rgba(255,255,255,.2),
    inset 0 -5px 12px rgba(72,37,18,.12);
}
.envelope__flap {
  z-index: 5;
  clip-path: polygon(0 0, 100% 0, 50% 72%);
  filter:
    brightness(1.08)
    drop-shadow(0 3px 2px rgba(67,33,16,.28));
  transform-origin: top;
  backface-visibility: visible;
  transition: transform 1.05s cubic-bezier(.3,.1,.2,1), filter 1s ease;
}
.envelope__left {
  z-index: 3;
  clip-path: polygon(0 0, 54% 55%, 0 100%);
  filter:
    brightness(.94)
    drop-shadow(2px 0 1px rgba(72,37,18,.18));
}
.envelope__right {
  z-index: 3;
  clip-path: polygon(100% 0, 46% 55%, 100% 100%);
  filter:
    brightness(1.01)
    drop-shadow(-2px 0 1px rgba(72,37,18,.15));
}
.envelope__front {
  z-index: 4;
  clip-path: polygon(0 100%, 50% 47%, 100% 100%);
  filter:
    brightness(.91)
    drop-shadow(0 -2px 1px rgba(72,37,18,.2));
}
.envelope__letter {
  position: absolute;
  z-index: 2;
  right: 5%;
  bottom: 3%;
  left: 5%;
  height: 92%;
  padding: 10% 1rem;
  color: var(--wine);
  text-align: center;
  background:
    linear-gradient(100deg, rgba(109,78,47,.04), transparent 28%, rgba(255,255,255,.38)),
    var(--paper-light);
  border: 1px solid rgba(109,78,47,.12);
  border-radius: 2px 2px 0 0;
  box-shadow:
    0 -4px 12px rgba(53,27,14,.2),
    inset 0 0 35px rgba(111,79,46,.06);
  font: 400 clamp(4rem, 15vw, 7.5rem)/.8 var(--serif);
  transition: transform 1.2s cubic-bezier(.2,.8,.2,1) .75s;
}
.envelope__letter i, .seal i, .monogram-mark i {
  color: var(--gold);
  font-family: var(--script);
  font-style: normal;
}
.envelope__letter small {
  display: block;
  margin-top: 2rem;
  font: 500 .65rem/1 var(--sans);
  letter-spacing: .35em;
}
.seal {
  position: absolute;
  z-index: 7;
  top: 46%;
  left: 50%;
  display: grid;
  grid-template-columns: auto auto auto;
  align-items: center;
  justify-content: center;
  width: 104px;
  height: 104px;
  padding: 0;
  color: #e9c99b;
  border: 0;
  border-radius: 48% 52% 45% 55% / 53% 46% 54% 47%;
  background:
    radial-gradient(circle at 36% 27%, rgba(255,255,255,.28), transparent 17%),
    radial-gradient(circle at 55% 70%, rgba(45,5,9,.22), transparent 34%),
    radial-gradient(circle, #8f343b 0 61%, #5d1b22 64% 72%, #79262e 74%);
  box-shadow:
    0 3px 2px rgba(51,12,13,.42),
    0 9px 15px rgba(51,12,13,.34),
    inset 2px 3px 5px rgba(255,255,255,.12),
    inset -4px -5px 8px rgba(45,8,10,.3);
  font: 400 1.65rem/1 var(--serif);
  transform: translate(-50%,-50%);
  cursor: pointer;
  transition: transform .35s ease, opacity .5s ease;
}
.seal::after {
  position: absolute;
  inset: 14px;
  content: "";
  border: 1px solid rgba(238,199,149,.35);
  border-radius: 50%;
  box-shadow:
    0 0 0 2px rgba(49,9,12,.2),
    inset 0 1px 2px rgba(255,255,255,.16);
}
.seal:hover { transform: translate(-50%,-50%) scale(1.07) rotate(-3deg); }
.seal i { margin: 0 .14rem; font-size: 1.6rem; }
.intro__hint {
  position: absolute;
  bottom: 7%;
  color: rgba(255,255,255,.72);
  font-size: .6rem;
  font-weight: 500;
  letter-spacing: .27em;
  text-transform: uppercase;
  animation: pulse 2s infinite;
}
.intro.opened .seal { opacity: 0; transform: translate(-50%,-50%) scale(.3); pointer-events: none; }
.intro.opened .envelope__flap {
  z-index: 1;
  filter: brightness(.87) drop-shadow(0 -2px 3px rgba(67,33,16,.24));
  transform: rotateX(180deg);
}
.intro.opened .envelope__letter { transform: translateY(-72%); }
.intro.opened .intro__message,
.intro.opened .intro__hint { opacity: 0; }
.intro.finished { visibility: hidden; opacity: 0; pointer-events: none; }

.invitation {
  width: min(100%, 760px);
  margin: 0 auto;
  overflow: hidden;
  background: var(--paper);
  box-shadow: 0 0 80px rgba(0,0,0,.45);
  opacity: 1;
}
.intro-active .invitation { height: 100vh; overflow: hidden; }
.panel { position: relative; min-height: 100svh; overflow: hidden; }
.paper-edge {
  position: absolute;
  z-index: 4;
  top: 0;
  right: 0;
  left: 0;
  height: 13px;
  background: var(--paper-light);
  clip-path: polygon(0 42%,2% 72%,4% 35%,7% 70%,10% 30%,13% 66%,16% 38%,20% 70%,24% 28%,28% 62%,32% 32%,36% 68%,40% 26%,44% 65%,48% 35%,52% 72%,56% 27%,60% 64%,65% 32%,70% 68%,74% 29%,79% 65%,84% 34%,89% 71%,94% 31%,100% 60%,100% 100%,0 100%);
}
.cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.cover__shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(25,15,12,.05), rgba(32,15,14,.12) 42%, rgba(29,11,12,.78));
}
.cover__content {
  position: absolute;
  z-index: 2;
  right: 7%;
  bottom: 7%;
  left: 7%;
  color: white;
  text-align: center;
}
.kicker {
  margin: 0 0 1.1rem;
  font-size: .62rem;
  font-weight: 500;
  letter-spacing: .3em;
  text-transform: uppercase;
}
.cover h1 {
  margin: 0;
  font: 400 clamp(4.2rem, 15vw, 7rem)/.86 var(--serif);
  letter-spacing: -.04em;
}
.cover h1 em {
  display: block;
  margin: -.1em 0 -.25em;
  color: #dbbd84;
  font: 400 .8em/1 var(--script);
}
.cover__date {
  margin: 2.2rem 0;
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .55em;
}
.continue {
  color: white;
  border: 0;
  background: none;
  font: 500 .58rem/1 var(--sans);
  letter-spacing: .28em;
  text-transform: uppercase;
  cursor: pointer;
}
.continue i {
  display: block;
  width: 1px;
  height: 42px;
  margin: 1rem auto 0;
  background: white;
  animation: pulse 2s infinite;
}
.paper-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6rem clamp(2rem,8vw,5rem);
  text-align: center;
  background:
    radial-gradient(circle at 80% 20%, rgba(120,79,42,.07), transparent 22%),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.1'/%3E%3C/svg%3E"),
    var(--paper-light);
}
.script {
  margin: 0;
  color: var(--wine);
  font: 400 clamp(3.5rem,11vw,6rem)/.8 var(--script);
}
.welcome h2, .rsvp h2 {
  margin: 1.2rem 0 1rem;
  font: 400 clamp(3rem,10vw,5.2rem)/.95 var(--serif);
  text-transform: uppercase;
}
.welcome h2 {
  font-family: var(--serif-alt);
  font-weight: 400;
  letter-spacing: .035em;
}
.welcome blockquote {
  max-width: 520px;
  margin: 0;
  padding: 2.5rem 0;
  border-top: 1px solid rgba(39,35,30,.25);
  border-bottom: 1px solid rgba(39,35,30,.25);
  font: 400 clamp(1.4rem,5vw,2.1rem)/1.35 var(--serif);
}
.welcome cite {
  display: block;
  margin-top: 1rem;
  font: 500 .55rem/1 var(--sans);
  letter-spacing: .22em;
  text-transform: uppercase;
}
.opening-verse { margin-bottom: 3.5rem !important; }
.closing-verse { margin-top: 2.5rem !important; }
.union-line {
  margin: 0 0 1.5rem;
  color: var(--wine);
  font: 400 clamp(1.2rem,4vw,1.65rem)/1.3 var(--serif);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.body-copy { max-width: 490px; margin: 2.3rem auto; font-size: .78rem; line-height: 1.9; }
.monogram-mark { color: var(--wine); font: 400 2rem/1 var(--serif); }
.monogram-mark i { margin: 0 .2rem; font-size: 2rem; }

.date-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5rem 2rem;
  color: #f7ede0;
  text-align: center;
  background:
    linear-gradient(rgba(81,30,31,.95),rgba(81,30,31,.95)),
    url("assets/joseph-and-sara.jpg") center/cover;
}
.date-card__date { display: flex; align-items: center; font: 400 clamp(4rem,17vw,8rem)/1 var(--serif); }
.date-card__date i { width: 1px; height: 80px; margin: 0 1.1rem; background: rgba(255,255,255,.35); transform: rotate(18deg); }
.date-card__day { margin: 1rem 0 3rem; font: 400 1.2rem/1 var(--serif); letter-spacing: .14em; text-transform: uppercase; }
.countdown { display: grid; grid-template-columns: repeat(4,1fr); width: min(100%,560px); border-top: 1px solid rgba(255,255,255,.3); padding-top: 2rem; }
.countdown strong { display: block; font: 400 2.7rem/1 var(--serif); }
.countdown small { display: block; margin-top: .7rem; font-size: .48rem; letter-spacing: .18em; text-transform: uppercase; }

.details { gap: 2.6rem; }
.event {
  position: relative;
  width: min(100%,520px);
  padding: 2.5rem 1.5rem;
  border-top: 1px solid rgba(39,35,30,.25);
}
.event:last-child { border-bottom: 1px solid rgba(39,35,30,.25); }
.event__number { position: absolute; top: 1.1rem; right: 0; color: rgba(112,45,45,.13); font: 400 4.5rem/1 var(--serif); }
.event h3 { margin: 0; font: 400 clamp(2rem,7vw,3.1rem)/1.05 var(--serif); text-transform: uppercase; }
.event > p:not(.kicker) { margin: .5rem 0 0; font: 400 1.1rem/1 var(--serif); }
.event time { display: block; margin: 1.4rem 0; color: var(--wine); font-size: .75rem; font-weight: 600; letter-spacing: .18em; }
.event a, .rsvp__button {
  display: inline-block;
  padding-bottom: .35rem;
  color: var(--wine);
  border-bottom: 1px solid var(--wine);
  font-size: .57rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-decoration: none;
  text-transform: uppercase;
}

.rsvp { display: grid; grid-template-rows: 42% 58%; color: var(--paper-light); background: var(--wine-dark); }
.rsvp__photo { position: relative; overflow: hidden; }
.rsvp__photo::after { position: absolute; inset: 0; content: ""; background: linear-gradient(transparent 60%,var(--wine-dark)); }
.rsvp__photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 45%; }
.rsvp__content { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2rem; text-align: center; }
.rsvp .script { color: #d0ae76; }
.rsvp h2 { margin-bottom: 1.5rem; }
.rsvp__content > p:not(.script) { margin: 0 0 2rem; font-size: .72rem; line-height: 1.8; letter-spacing: .08em; }
.rsvp__button { padding: 1rem 1.3rem; color: var(--paper-light); border: 1px solid #d0ae76; transition: background .25s,color .25s; }
.rsvp__button:hover { color: var(--wine-dark); background: #d0ae76; }
footer { gap: 2rem; }
footer .script { font-size: clamp(5rem,17vw,8rem); }
footer > p:not(.script) { margin: 0; font: 400 1.3rem/1.3 var(--serif); }
footer small { font-size: .6rem; font-weight: 600; letter-spacing: .35em; }
.reopen {
  position: fixed;
  z-index: 20;
  right: 1rem;
  bottom: 1rem;
  padding: .7rem .9rem;
  color: white;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 30px;
  background: rgba(45,24,24,.7);
  backdrop-filter: blur(8px);
  font: 500 .7rem/1 var(--sans);
  cursor: pointer;
}
.reopen span { margin-left: .35rem; font-size: .52rem; letter-spacing: .15em; text-transform: uppercase; }
.reveal { opacity: 0; transform: translateY(30px); transition: opacity .8s ease, transform .8s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }
@keyframes pulse { 0%,100%{opacity:.35}50%{opacity:1} }

@media (min-width: 820px) {
  body { padding: 3rem 0; }
  .intro-active { padding: 0; }
  .invitation { border-radius: 3px; }
  .panel { min-height: 920px; }
}
@media (max-width: 500px) {
  .intro {
    min-height: 100dvh;
    padding:
      max(1rem, env(safe-area-inset-top))
      .75rem
      max(1rem, env(safe-area-inset-bottom));
  }
  .intro__message { top: max(8%, env(safe-area-inset-top)); }
  .intro__message p { font-size: clamp(.82rem, 4vw, 1.1rem); }
  .intro__message strong { font-size: clamp(3.4rem, 18vw, 5.2rem); }
  .envelope {
    width: min(92vw, 430px);
    height: min(62.1vw, 290px);
    margin-top: 1vh;
  }
  .envelope__letter {
    padding-top: 9%;
    font-size: clamp(3.2rem, 17vw, 5.2rem);
  }
  .envelope__letter small { margin-top: 1.35rem; font-size: .5rem; }
  .seal { width: clamp(72px, 21vw, 88px); height: clamp(72px, 21vw, 88px); font-size: 1.2rem; }
  .seal i { font-size: 1.25rem; }
  .intro__hint { bottom: max(5%, env(safe-area-inset-bottom)); }
  .date-card__date i { height: 55px; margin: 0 .5rem; }
  .countdown strong { font-size: 2rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,*::before,*::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
