* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: #f2f0e5;
  color: #000;
  font-family: "Cagliostro", serif;
  font-weight: 400;
  font-style: normal;
  text-align: center;
}

.intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 80vh;
  height: 80svh;
  padding-inline: 24px;
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero .meta {
  margin-top: 24px;
}

.hero .rsvp {
  margin-top: 40px;
}

.site {
  position: relative;
  z-index: 0;
  transition: opacity 650ms cubic-bezier(0.22, 1, 0.36, 1);
}

.site.is-faded {
  opacity: 0;
}

.thanks-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.thanks-page.is-overlay {
  position: fixed;
  inset: 0;
  z-index: 5;
  min-height: 0;
  opacity: 0;
  transition: opacity 650ms cubic-bezier(0.22, 1, 0.36, 1);
}

.thanks-page.is-overlay.is-visible {
  opacity: 1;
}

.thanks-page[hidden] {
  display: none;
}

.meta {
  font-size: 16px;
  letter-spacing: 0.48px;
  line-height: 1;
  text-transform: uppercase;
}

.names {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: clamp(2rem, 10vw, 3rem);
  letter-spacing: -0.96px;
  line-height: 1;
  text-transform: uppercase;
  cursor: pointer;
}

.names span {
  display: block;
}

.rsvp {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  border: 0;
  background: #000;
  color: #fff;
  font-family: inherit;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.48px;
  line-height: 1;
  height: 36px;
  padding: 0 40px;
  border-radius: 2px;
  cursor: pointer;
  text-decoration: none;
  text-transform: uppercase;
}

.sections {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 0 24px;
  gap: 80px;
  margin-top: 0;
  padding-bottom: 160px;
}

.section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  width: 100%;
  max-width: 640px;
}

.section h2,
.section-body,
.section-body p {
  width: 100%;
  max-width: 640px;
  text-align: center;
}

.section h2 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.48px;
  line-height: 1;
  text-transform: uppercase;
  -webkit-text-stroke: 0.4px currentColor;
}

.section-body,
.section-body p {
  font-size: 16px;
  letter-spacing: 0.48px;
  line-height: 1.5;
  text-transform: none;
}

.section-body {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.section-body a {
  color: inherit;
  text-underline-offset: 0.18em;
}

.figures {
  display: block;
  width: 96px;
  height: 96px;
}

html.dark body {
  background: #000;
  color: #fff;
}

html.dark .rsvp {
  background: #fff;
  color: #000;
}

html.dark .figures,
html.dark .skyline img {
  filter: invert(1);
}

.skyline {
  display: flex;
  justify-content: center;
  width: 100%;
  overflow: hidden;
}

.skyline img {
  display: block;
  flex-shrink: 0;
  width: 640px;
  max-width: none;
  height: auto;
}

.lamp-cord {
  --cord-paper: #f2f0e5;
  position: fixed;
  top: 0;
  right: -80px;
  z-index: 100;
  width: 256px;
  height: 160px;
  color: inherit;
  pointer-events: none;
  overflow: visible;
}

html.dark .lamp-cord {
  --cord-paper: #000;
}

.lamp-cord-art {
  display: block;
  width: 256px;
  height: 160px;
  overflow: visible;
  pointer-events: none;
}

.lamp-cord-knob {
  appearance: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 46px;
  height: 58px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: grab;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  will-change: transform;
}

.lamp-cord-knob.is-dragging {
  cursor: grabbing;
}

.lamp-cord-knob:focus-visible {
  outline: 1px solid currentColor;
  outline-offset: -5px;
}

@media (prefers-reduced-motion: reduce) {
  .lamp-cord-knob {
    transform: translate(105px, 88px);
  }
}

body.rsvp-open {
  overflow: hidden;
}

.rsvp-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  overflow: hidden;
  background: rgb(0 0 0 / 0);
  transition: background 400ms cubic-bezier(0.22, 1, 0.36, 1);
}

.rsvp-overlay.is-present,
.rsvp-overlay.is-open {
  background: rgb(0 0 0 / 45%);
}

.rsvp-overlay[hidden] {
  display: none;
}

.rsvp-scene {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  padding: 20px;
  perspective: 1400px;
}

.rsvp-letter {
  --paper-color: #f2f0e5;
  --paper-back-color: #e7e4d6;
  --paper-grain: url("illustrations/paper-grain-light.svg");
  --paper-mottle:
    radial-gradient(ellipse at 16% 12%, rgb(126 89 43 / 6%), transparent 48%),
    radial-gradient(ellipse at 84% 88%, rgb(104 75 39 / 4%), transparent 44%);
  position: relative;
  width: 100%;
  height: calc(100% / 3);
  color: #000;
  text-align: left;
  transform: scale(0.76);
  opacity: 0;
  transform-style: preserve-3d;
  transition:
    transform 650ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 650ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform, opacity;
}

.rsvp-overlay.is-present .rsvp-letter,
.rsvp-overlay.is-open .rsvp-letter {
  transform: scale(1);
  opacity: 1;
}

.rsvp-overlay.is-departing {
  background: rgb(0 0 0 / 0);
  transition-duration: 650ms;
}

.rsvp-overlay.is-departing .rsvp-letter {
  transform: scale(1) translate3d(0, -120vh, 0);
  opacity: 0;
  transition-duration: 650ms;
}

.rsvp-form {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
}

.rsvp-letter-body,
.rsvp-flap-face {
  background-color: var(--paper-color);
  background-image: var(--paper-mottle), var(--paper-grain);
  background-position: center, center, 0 0;
  background-repeat: no-repeat, no-repeat, repeat;
  background-size: 100% 100%, 100% 100%, 140px 140px;
}

.rsvp-letter-body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  height: 100%;
  padding: 24px;
  overflow: auto;
  box-sizing: border-box;
  box-shadow: inset 0 1px 0 rgb(0 0 0 / 8%), inset 0 -1px 0 rgb(0 0 0 / 8%);
}

.rsvp-flap {
  position: absolute;
  left: 0;
  right: 0;
  height: 100%;
  transform-style: preserve-3d;
  will-change: transform;
}

.rsvp-flap-top {
  z-index: 3;
  bottom: 100%;
  transform-origin: bottom center;
  transform: rotateX(-180deg);
  transition: transform 750ms cubic-bezier(0.22, 1, 0.36, 1);
}

.rsvp-flap-bottom {
  z-index: 2;
  top: 100%;
  transform-origin: top center;
  transform: rotateX(180deg);
  transition: transform 750ms cubic-bezier(0.22, 1, 0.36, 1);
}

.rsvp-overlay.is-open .rsvp-flap-top,
.rsvp-overlay.is-open .rsvp-flap-bottom {
  transform: rotateX(0deg);
}

.rsvp-overlay.is-open .rsvp-flap-bottom {
  transition-delay: 220ms;
}

.rsvp-overlay.is-closing .rsvp-flap-top,
.rsvp-overlay.is-closing .rsvp-flap-bottom {
  transition-duration: 400ms;
  transition-delay: 0ms;
}

.rsvp-overlay.is-refolding .rsvp-flap-top {
  transition-delay: 220ms;
}

.rsvp-overlay.is-refolding .rsvp-flap-bottom {
  transition-delay: 0ms;
}

.rsvp-flap-face {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.rsvp-flap-back {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--paper-back-color);
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 6%);
}

.rsvp-stamp {
  display: block;
  width: 120px;
  height: auto;
  pointer-events: none;
}

.rsvp-flap-top .rsvp-flap-back {
  transform: rotateX(180deg);
}

.rsvp-flap-bottom .rsvp-flap-back {
  transform: rotateX(-180deg);
}

.rsvp-flap-top .rsvp-flap-front,
.rsvp-flap-bottom .rsvp-flap-front {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  height: 100%;
  overflow: auto;
  box-sizing: border-box;
  padding: 24px;
}

.rsvp-flap-bottom .rsvp-flap-front {
  justify-content: flex-start;
  gap: 24px;
}

.rsvp-flap-bottom .rsvp-flap-front > label {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.rsvp-flap-bottom textarea {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  resize: none;
}

.rsvp-close {
  appearance: none;
  position: absolute;
  top: 12px;
  right: 16px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.rsvp-letter h2 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.48px;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
  -webkit-text-stroke: 0.4px currentColor;
}

.rsvp-form textarea {
  min-height: 48px;
}

.rsvp-form label,
.rsvp-form legend {
  margin: 0;
  padding: 0;
  font-size: 16px;
  letter-spacing: 0.48px;
  text-transform: none;
}

.rsvp-flap-front > label,
.rsvp-letter-body > label {
  display: block;
}

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

.rsvp-form input::placeholder,
.rsvp-form textarea::placeholder {
  color: inherit;
  opacity: 0.45;
  letter-spacing: 0.48px;
  text-transform: none;
}

.rsvp-form input[type="text"],
.rsvp-form input[type="email"],
.rsvp-form textarea {
  display: block;
  width: 100%;
  margin: 0;
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 16px;
  letter-spacing: 0.48px;
  text-transform: none;
}

.rsvp-form input[type="text"],
.rsvp-form input[type="email"] {
  height: 36px;
  padding: 0 12px;
  line-height: 34px;
}

.rsvp-form textarea {
  padding: 12px;
}

.rsvp-form textarea {
  resize: vertical;
}

.rsvp-attendance {
  margin: 0;
  padding: 0;
  border: 0;
  min-inline-size: 0;
  display: flex;
  flex-direction: column;
}

.rsvp-attendance > legend {
  display: block;
  float: none;
  width: 100%;
  margin: 0 0 16px;
  padding: 0;
}

.rsvp-attendance-options {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}

.rsvp-check {
  display: flex;
  align-items: center;
  gap: 12px;
  text-transform: none;
  cursor: pointer;
}

.rsvp-form input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  margin: 0;
  border: 1px solid currentColor;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
}

.rsvp-form input[type="checkbox"]:checked {
  background-color: currentColor;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f2f0e5' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5 10 17.5 19 7'/%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 22px;
}

.rsvp-form .rsvp {
  align-self: center;
  margin: 0;
  text-transform: uppercase;
}

.rsvp-status {
  font-size: 16px;
  letter-spacing: 0.48px;
  line-height: 1.5;
  text-transform: none;
}

html.dark .rsvp-letter {
  --paper-color: #111;
  --paper-back-color: #111;
  --paper-grain: url("illustrations/paper-grain-dark.svg");
  --paper-mottle:
    radial-gradient(ellipse at 18% 14%, rgb(255 255 255 / 3%), transparent 48%),
    radial-gradient(ellipse at 82% 86%, rgb(0 0 0 / 12%), transparent 44%);
  color: #fff;
}

html.dark .rsvp-letter-body {
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 28%),
    inset 0 -1px 0 rgb(255 255 255 / 28%);
}

html.dark .rsvp-form input[type="checkbox"]:checked {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5 10 17.5 19 7'/%3E%3C/svg%3E");
}

html.dark .rsvp-stamp {
  filter: invert(1);
}

@media (min-width: 600px) {
  .rsvp-letter {
    width: 400px;
    max-width: 400px;
    height: 200px;
  }

  .rsvp-form,
  .rsvp-letter-body,
  .rsvp-flap,
  .rsvp-flap-top .rsvp-flap-front,
  .rsvp-flap-bottom .rsvp-flap-front {
    width: 400px;
    max-width: 400px;
    height: 200px;
    min-height: 200px;
    max-height: 200px;
    box-sizing: border-box;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rsvp-overlay,
  .rsvp-letter,
  .rsvp-flap-top,
  .rsvp-flap-bottom,
  .site,
  .thanks-page {
    transition: none;
  }

  .rsvp-letter,
  .rsvp-flap-top,
  .rsvp-flap-bottom {
    transform: none;
    opacity: 1;
  }
}
