@font-face {
  font-family: Instrument;
  src: url("assets/fonts/instrument-serif.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: Instrument;
  src: url("assets/fonts/instrument-serif-italic.woff2") format("woff2");
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: Carattere;
  src: url("assets/fonts/carattere.woff2") format("woff2");
  font-display: swap;
}
:root {
  --cover-edge: #c6dfee;
  --blue-ink: #283e50;
  --ink-deep: #1b3041;
  --cream: #fbf3e2;
  --ink: #263b4b;
  --serif: Instrument, Georgia, serif;
  --script: Carattere, "Brush Script MT", cursive;
  --mono: "Courier New", monospace;
  font-family: var(--serif);
  color: var(--ink);
  background: var(--cream);
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body,
h1,
h2,
p,
figure {
  margin: 0;
}
body {
  background: var(--cream) url("assets/images/paper-grain.png");
}
h1,
h2 {
  font-weight: 400;
}
a {
  color: inherit;
  text-underline-offset: 0.25em;
}
:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 6px;
}
button,
summary {
  cursor: pointer;
}
.ink-filters {
  position: absolute;
  pointer-events: none;
}
.flap-paper {
  filter: url(#blue-wax);
}
.cover {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  isolation: isolate;
  overflow: clip;
  color: var(--blue-ink);
  background-color: var(--cover-edge);
  background-image:
    url("assets/images/paper-grain.png"),
    linear-gradient(0deg, var(--cover-edge), transparent 34%),
    linear-gradient(
      123deg,
      #b8d5e7 0%,
      #c9e2ee 28%,
      #d9e9ef 45%,
      #cbe1ee 72%,
      #bdd6e7 100%
    );
}
.paper-wash {
  height: clamp(130px, 23svh, 250px);
  background:
    url("assets/images/paper-grain.png"),
    linear-gradient(
      to bottom,
      var(--cover-edge),
      #cfe2e9 22%,
      #e0e8e6 49%,
      #efeee3 75%,
      var(--cream)
    );
}
.mast {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(90%, 1450px);
  margin: 0 auto;
}
.mast {
  flex: none;
  height: 70px;
  border-bottom: 1px solid #354b6050;
}
.monogram {
  display: block;
  width: clamp(36px, 4vw, 53px);
  height: auto;
}
.mast a,
footer a,
.date-foot,
.locality,
.post-kicker,
.seal-action,
summary {
  font: 11px/1.5 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.mast a,
footer a {
  text-decoration: none;
  padding: 10px 0;
}
.mast a:hover,
footer a:hover {
  text-decoration: underline;
}
.cover-content {
  flex: 1 0 auto;
  padding: clamp(24px, 5.5vh, 75px) 20px clamp(35px, 5vh, 72px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.cover-title {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.open-envelope {
  width: min(820px, 108svh, 88vw);
  color: inherit;
  text-decoration: none;
  display: grid;
  justify-items: center;
  gap: clamp(23px, 4.2vh, 44px);
  -webkit-tap-highlight-color: transparent;
}
.envelope-stage {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 1.57;
  perspective: 1450px;
}
.envelope {
  position: absolute;
  width: 70%;
  right: 3%;
  top: 27%;
  aspect-ratio: 1200/677;
  transform: rotate(4deg);
  background: linear-gradient(#bca789, #e6dbc6 60%);
  box-shadow:
    2px 4px 3px #26354260,
    8px 16px 16px #34445259,
    20px 36px 44px #25364440;
  transition: transform 0.35s;
  isolation: isolate;
  border-radius: 2px;
}
.open-envelope:hover .envelope {
  transform: translateY(-3px) rotate(4deg);
}
.pocket,
.hinge,
.flap-front,
.flap-paper,
.flap-back {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.pocket {
  z-index: 3;
  pointer-events: none;
}
.cover-waiter {
  position: absolute;
  z-index: 5;
  left: 4%;
  bottom: 0;
  height: 100%;
  width: auto;
  transform: rotate(-5deg);
  transform-origin: 45% 78%;
  pointer-events: none;
  filter: drop-shadow(2px 5px 3px #28374544);
  transition: transform 0.85s cubic-bezier(0.22, 0.65, 0.24, 1);
}
.is-open .cover-waiter {
  transform: translate(-13%, 4%) rotate(-11deg);
}
.hinge {
  z-index: 4;
  transform-origin: center top;
  transform-style: preserve-3d;
  transition: transform 0.59s cubic-bezier(0.55, 0.02, 0.35, 1);
}
.flap-front,
.flap-back {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.envelope-monogram {
  position: absolute;
  top: 23%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20%;
  height: auto;
  mix-blend-mode: multiply;
}
.flap-back {
  background: #e6d6ba url("assets/images/envelope-lining.webp");
  transform: rotateY(180deg);
  clip-path: polygon(0 0, 100% 0, 98% 9%, 50% 69%, 2% 9%);
}
.insert {
  position: absolute;
  z-index: 2;
  inset: 3% 4% 4%;
  background: #fcf2df url("assets/images/paper-grain.png");
  border: 1px solid #caba9c;
  box-shadow: 0 1px 6px #68564345;
  transition: transform 0.54s 0.23s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.insert-face {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 48%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 2%;
  background: var(--cream) url("assets/images/paper-grain.png");
  color: var(--blue-ink);
}
.insert-face img {
  height: 46%;
  width: auto;
}
.insert-date {
  font: clamp(17px, 2.6vw, 38px)/1 var(--serif);
  letter-spacing: -0.065em;
}
.is-open .hinge {
  transform: rotateX(168deg);
  z-index: 1;
  transition:
    transform 0.59s cubic-bezier(0.55, 0.02, 0.35, 1),
    z-index 0s 0.28s;
}
.is-open .insert {
  transform: translateY(-45%);
}
.seal-action {
  display: inline-flex;
  gap: 13px;
  align-items: center;
  border-bottom: 1px solid #354b6099;
  padding: 4px 0 7px;
}
.date-scene {
  position: relative;
  background: var(--cream) url("assets/images/paper-grain.png");
  padding: clamp(65px, 8vw, 120px) 5% clamp(75px, 8vw, 130px);
  color: var(--blue-ink);
  text-align: center;
  overflow: clip;
}
.date-spread {
  width: min(100%, 1030px);
  margin: auto;
  position: relative;
}
.date-art {
  --figure-height: clamp(174px, 20vw, 285px);
  height: var(--figure-height);
  position: relative;
  display: grid;
  place-items: end center;
}
.dance-step {
  --trail-gap: clamp(12px, 1.5vw, 22px);
  --trail-width: clamp(
    34px,
    calc(
      (min(90vw, 1030px) - var(--figure-height)) / 2 - var(--trail-gap) - 6px
    ),
    280px
  );
  --travel: clamp(
    0px,
    calc(
      (100vw - var(--figure-height)) / 2 - var(--trail-width) -
        var(--trail-gap) - 8px
    ),
    180px
  );
  height: var(--figure-height);
  width: calc(var(--figure-height) * 615 / 628);
  position: relative;
  transform-origin: center bottom;
}
.dancers {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
/* Move the trail and the figures on one track. The gap is always outside the artwork. */
.dance-ribbon {
  position: absolute;
  right: calc(100% + var(--trail-gap));
  bottom: 7%;
  width: var(--trail-width);
  overflow: visible;
  color: #738799;
}
.dance-ribbon path {
  stroke: currentColor;
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-dasharray: 1;
  vector-effect: non-scaling-stroke;
}
.script {
  font: clamp(26px, 3.5vw, 53px)/1.25 var(--script);
}
.date-scene .script {
  margin-top: 16px;
}
.date-spread h2 {
  font: clamp(87px, 16.7vw, 245px)/0.89 var(--serif);
  letter-spacing: -0.065em;
  white-space: nowrap;
  margin: 0 0 23px;
}
.date-spread h2 time,
.insert-date {
  display: inline-flex;
  align-items: baseline;
  gap: 0.026em;
  line-height: 0.89;
}
.date-dot {
  font-size: 0.79em;
}
/* Keep the ink gaps even around the two dots despite the digits' different side bearings. */
.date-dot ~ .date-dot {
  margin-inline: -0.03em 0.02em;
}
.date-foot {
  margin: auto;
  padding-top: 20px;
  border-top: 1px solid #40596b55;
  display: flex;
  align-items: center;
  gap: 18px;
  justify-content: center;
  width: min(100%, 690px);
}
.date-foot a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration-thickness: 1px;
}
.date-foot svg {
  width: 15px;
  height: 15px;
  flex: none;
}
.mast a,
.seal-action {
  font: clamp(15px, 1.5vw, 20px)/1.35 var(--script);
  text-transform: none;
  letter-spacing: 0;
}
.date-foot > span:nth-child(2) {
  font: 22px/1 var(--serif);
}
.place {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(32px, 7vw, 92px);
  align-items: center;
  width: min(88%, 1060px);
  margin: 0 auto;
  padding: 10px 0 clamp(70px, 8vw, 125px);
  color: var(--blue-ink);
}
.couple-portrait,
.farewell-print {
  position: relative;
  background: #fffaef url("assets/images/paper-grain.png");
  box-shadow:
    0 1px 2px #263b4b33,
    2px 7px 16px #263b4b26;
}
.couple-portrait {
  padding: clamp(9px, 1vw, 15px);
  transform: rotate(-2deg);
}
.couple-portrait #main-photo {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4/5;
  object-fit: cover;
  object-position: center 40%;
}
.paper-cutout {
  filter: drop-shadow(1px 3px 2px #263b4b40);
}
.disco-cutout {
  position: absolute;
  top: -5%;
  right: 1%;
  width: clamp(56px, 19%, 96px);
  height: auto;
  transform: rotate(12deg);
}
.venue-letter {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.castle-sketch {
  display: block;
  width: min(68%, 218px);
  height: auto;
}
.venue-caption {
  margin: 12px 0 clamp(18px, 2.3vw, 32px);
}
.venue-caption .script {
  font-size: clamp(22px, 2.5vw, 32px);
}
.venue-caption h2 {
  font: clamp(42px, 5.6vw, 80px)/1 var(--serif);
  letter-spacing: -0.045em;
  margin: 6px 0 10px;
}
.venue-photo {
  position: relative;
  width: 100%;
  max-width: 375px;
  overflow: hidden;
  border: 6px solid #fffaf0;
  transform: rotate(2deg);
  box-shadow: 0 2px 6px #263b4b26;
}
.venue-portrait {
  display: block;
  width: 100%;
  height: auto;
}
.farewell-print img {
  display: block;
  width: 100%;
  height: auto;
}
.post {
  position: relative;
  isolation: isolate;
  background: #c6dfee url("assets/images/paper-grain.png");
  padding: clamp(58px, 7vw, 106px) 6%;
}
.postcard {
  --inset: clamp(24px, 4.7vw, 68px);
  position: relative;
  isolation: isolate;
  margin: auto;
  width: min(100%, 875px);
  padding: clamp(28px, 4vw, 54px) var(--inset) 0;
  color: var(--blue-ink);
  background: #fbf5e6 url("assets/images/paper-grain.png");
  box-shadow:
    0 2px 3px #273c492c,
    3px 14px 24px #30485721;
}
.postcard::before {
  content: "";
  position: absolute;
  inset: 9px;
  border: 1px solid #5b798a88;
  border-radius: 3% 1% 2% 1% / 1% 2% 1% 2%;
  pointer-events: none;
  z-index: -1;
}
.post-head,
.post-face {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5%;
}
.post-head {
  padding-bottom: 14px;
  border-bottom: 1px solid #5777893d;
}
.post h2 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 0.16em;
  font: clamp(56px, 6.8vw, 99px)/1 var(--serif);
  letter-spacing: -0.055em;
}
.post h2 i {
  font: 0.79em/1.16 var(--script);
  letter-spacing: -0.03em;
  white-space: nowrap;
}
.postage {
  position: relative;
  flex: none;
  width: clamp(85px, 12vw, 145px);
  height: clamp(61px, 8.4vw, 99px);
}
.stamp {
  position: absolute;
  right: 0;
  top: 0;
  width: 57%;
  height: 90%;
  transform: rotate(7deg);
  display: grid;
  place-items: center;
  padding: 7%;
  background: radial-gradient(circle at 4px 4px, #bad8e8 3.7px, transparent 4px)
    0 0/8px 8px;
}
.stamp::before {
  content: "";
  position: absolute;
  inset: 4px;
  background: #bad8e8;
  outline: 1px solid #526e80;
  outline-offset: -6px;
}
.swallow {
  position: relative;
  width: 100%;
  height: auto;
  mix-blend-mode: multiply;
}
.postmark {
  position: absolute;
  z-index: 1;
  left: 0;
  bottom: 0;
  display: grid;
  place-content: center;
  text-align: center;
  width: 54%;
  aspect-ratio: 1;
  color: #4e6979;
  border: 2px double currentColor;
  outline: 1px solid currentColor;
  outline-offset: -5px;
  border-radius: 50%;
  font: clamp(6px, 0.62vw, 9px)/1.05 var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.11em;
  transform: rotate(-15deg);
}
.postmark b {
  font-size: 1.18em;
}
.post-face {
  padding: clamp(20px, 3.2vw, 43px) 0;
  gap: 7%;
}
.post-illustration {
  width: 43%;
  overflow: visible;
}
.postman {
  display: block;
  width: 100%;
  height: auto;
  transform-origin: center 88%;
}
.post-message {
  width: 50%;
  border-left: 1px solid #5b798a60;
  padding: 8px 0 8px 7%;
}
.post-kicker {
  font-size: 10px;
  letter-spacing: 0.08em;
  margin-bottom: 11px;
}
.post-intro {
  font: clamp(26px, 3.1vw, 49px)/1.05 var(--serif);
  letter-spacing: -0.025em;
}
.address-section {
  border-top: 1px dashed #51738c88;
}
summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  list-style: none;
  min-height: 70px;
  padding: 13px 1px;
  font-size: 12px;
  letter-spacing: 0.06em;
}
summary:hover .reply-label,
summary:hover .reply-close {
  text-decoration: underline;
  text-underline-offset: 5px;
}
summary::-webkit-details-marker {
  display: none;
}
.slip-icon {
  flex: none;
  width: 20px;
  height: 20px;
}
.reply-close,
details[open] .reply-label {
  display: none;
}
details[open] .reply-close {
  display: inline;
}
details[open] .slip-stem {
  display: none;
}
.reply-slip {
  border-top: 1px solid #5b798a44;
  padding: 20px 0 35px;
}
.form-intro {
  font: 22px/1.3 var(--serif);
  margin: 0 0 20px;
}
form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 17px 22px;
  text-align: left;
}
.full-width,
.form-pair {
  grid-column: 1/-1;
}
label {
  display: grid;
  gap: 5px;
  font:
    14px/1.4 system-ui,
    sans-serif;
  color: var(--ink);
}
input,
textarea {
  border: none;
  border-bottom: 1px solid #5271869c;
  min-height: 44px;
  padding: 10px 8px;
  background: #ecf2f4;
  color: var(--ink);
  border-radius: 0;
  font:
    16px/1.4 system-ui,
    sans-serif;
  width: 100%;
  min-width: 0;
}
textarea {
  resize: vertical;
}
.form-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
.guest-notes {
  display: grid;
  gap: 5px;
}
.guest-notes p {
  font: 14px/1.5 system-ui, sans-serif;
  color: var(--blue-ink);
}
.submit {
  grid-column: 1/-1;
  justify-self: start;
  background: var(--blue-ink);
  color: var(--cream);
  border: none;
  min-height: 44px;
  font:
    14px/1.2 system-ui,
    sans-serif;
  padding: 14px 20px;
}
.submit:hover {
  background: var(--ink-deep);
}
.form-status {
  font:
    16px/1.5 Georgia,
    serif;
}
.form-status:empty {
  position: absolute;
}
footer {
  background: #e5eff4 url("assets/images/paper-grain.png");
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(30px, 7vw, 110px);
  padding: clamp(50px, 7vw, 110px) 7%;
  color: var(--blue-ink);
}
.farewell-print {
  width: clamp(160px, 22vw, 280px);
  padding: clamp(7px, 1vw, 12px);
  transform: rotate(4deg);
}
.sign-off {
  text-align: center;
}
.toast-cutout {
  display: block;
  width: clamp(70px, 9vw, 125px);
  height: auto;
  margin: 0 auto 14px;
  transform: rotate(-9deg);
}
.sign-off p {
  font: clamp(24px, 2.4vw, 36px)/1 var(--serif);
}
.sign-off .signature {
  margin: 7px 0 16px;
  font: clamp(33px, 4.5vw, 65px)/1.2 var(--script);
}
.sign-off a {
  display: inline-block;
  border-bottom: 1px solid #58738577;
}
@media (max-width: 700px) {
  .mast {
    height: 55px;
  }
  footer a,
  .date-foot,
  .locality,
  .post-kicker,
  summary {
    font-size: 10px;
  }
  .cover-content {
    padding: 35px 6% 42px;
  }
  .open-envelope {
    width: min(92vw, 550px, 116svh);
    gap: 27px;
  }
  .envelope-stage {
    aspect-ratio: 1.21;
  }
  .envelope {
    top: 32%;
  }
  .date-foot {
    gap: 12px;
  }
  .date-art {
    --figure-height: clamp(162px, 48vw, 248px);
  }
  .place {
    width: min(86%, 450px);
    grid-template-columns: 1fr;
    gap: 38px;
  }
  .venue-letter {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 32%;
    gap: 12px 4%;
    text-align: left;
  }
  .venue-caption {
    grid-area: 1 / 1;
    margin: 0;
  }
  .venue-caption h2 {
    font-size: clamp(34px, 9vw, 55px);
  }
  .castle-sketch {
    grid-area: 1 / 2;
    width: 100%;
  }
  .venue-photo {
    grid-column: 1 / -1;
  }
  .post {
    padding: 54px 5%;
  }
  .postcard {
    padding: 24px 22px 0;
  }
  form,
  .form-pair {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  .post h2 {
    font-size: clamp(38px, 9.5vw, 64px);
  }
  .post-head {
    flex-direction: column;
    gap: 12px;
  }
  .postage {
    order: -1;
    width: 110px;
    height: 67px;
  }
  .postmark {
    width: 50%;
    font-size: 7px;
  }
  .stamp {
    width: 52%;
    height: 94%;
    padding: 10px;
  }
  .post-face {
    gap: 4%;
    padding: 24px 0;
  }
  .post-illustration {
    width: 42%;
  }
  .post-message {
    width: 54%;
    padding: 5px 0 5px 5%;
  }
  .post-intro {
    font-size: clamp(23px, 5.7vw, 33px);
  }
  .post-kicker {
    font-size: 9px;
    margin-bottom: 8px;
  }
  summary {
    min-height: 64px;
  }
  .reply-slip {
    padding-top: 15px;
  }

  footer {
    gap: 7%;
    padding: 50px 5%;
  }
  .farewell-print {
    width: 40%;
  }
  .sign-off .signature {
    font-size: clamp(25px, 5.9vw, 42px);
    margin-bottom: 5px;
  }
}
@media (min-aspect-ratio: 3/2) and (max-height: 500px) {
  .mast {
    height: 44px;
  }
  .cover-content {
    padding: 14px 5% 18px;
  }
  .open-envelope {
    width: min(108svh, calc((100svh - 126px) * 1.57), 70vw);
    gap: 15px;
  }
  .envelope-stage {
    aspect-ratio: 1.57;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
.open-envelope.is-open .seal-action {
  opacity: 0;
}
.seal-action {
  transition: opacity 0.25s;
}

/* Track the stock, ink illustration and typeset date independently. */
.paper-source,
.paper-destination {
  view-transition-name: wedding-paper;
}
.paper-source img,
.paper-destination .dancers {
  view-transition-name: wedding-dancers;
}
.paper-source .insert-date,
.paper-destination time {
  view-transition-name: wedding-day;
}
::view-transition-group(wedding-paper),
::view-transition-group(wedding-dancers),
::view-transition-group(wedding-day) {
  animation-duration: 820ms;
  animation-timing-function: cubic-bezier(0.42, 0.02, 0.18, 1);
}
::view-transition-group(wedding-paper) {
  z-index: 2;
}
::view-transition-group(wedding-dancers),
::view-transition-group(wedding-day) {
  z-index: 3;
}
::view-transition-image-pair(wedding-paper) {
  background: var(--cream);
  overflow: clip;
}
::view-transition-old(wedding-paper),
::view-transition-old(wedding-dancers),
::view-transition-old(wedding-day) {
  display: none;
}
::view-transition-new(wedding-paper) {
  height: 100%;
  width: 100%;
  object-fit: cover;
  animation: paper-in 820ms ease both;
  mix-blend-mode: normal;
}
::view-transition-new(wedding-dancers),
::view-transition-new(wedding-day) {
  animation: none;
  mix-blend-mode: normal;
  height: 100%;
  width: 100%;
  object-fit: contain;
}
::view-transition-group(root) {
  animation-duration: 820ms;
}
::view-transition-old(root) {
  animation: scene-out 820ms ease both;
}
::view-transition-new(root) {
  animation: scene-in 820ms ease both;
}
@keyframes paper-in {
  0%,
  35% {
    opacity: 0;
  }
  85%,
  100% {
    opacity: 1;
  }
}
.ink-in-flight > * {
  visibility: hidden;
}
.flight-stock {
  position: absolute;
  inset: 0;
  background: var(--cream) url("assets/images/paper-grain.png");
  z-index: -1;
}
.paper-flight {
  inset: 0 auto auto 0;
  isolation: isolate;
  background: transparent;
  overflow: visible;
  position: fixed;
  z-index: 30;
  pointer-events: none;
  margin: 0;
  transform-origin: 0 0;
}

@keyframes scene-out {
  0%,
  65% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
@keyframes scene-in {
  0%,
  65% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}
