:root {
  color-scheme: dark;
  --forest: #10231f;
  --forest-light: #1c3730;
  --gold: #c6a76c;
  --gold-muted: #88734c;
  --ivory: #f3ecd9;
  --ink: #28352d;
  --serif: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --sans: "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(ellipse at 50% 42%, rgba(46, 77, 65, 0.58), transparent 49%),
    linear-gradient(145deg, #142a25, var(--forest) 55%, #0b1917);
  color: var(--ivory);
  font-family: var(--sans);
}

button {
  font: inherit;
}

.invitation-page {
  position: relative;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  padding: clamp(1.5rem, 4vw, 3.25rem) 1.25rem clamp(1rem, 2vw, 1.75rem);
  isolation: isolate;
}

.invitation-page::before,
.invitation-page::after {
  position: absolute;
  z-index: -1;
  width: min(74vw, 700px);
  aspect-ratio: 1;
  border: 1px solid rgba(198, 167, 108, 0.12);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.invitation-page::before {
  top: 12%;
}

.invitation-page::after {
  top: calc(12% + 18px);
  width: min(70vw, 660px);
}

.ambient {
  position: absolute;
  z-index: -1;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 12px 2px rgba(198, 167, 108, 0.38);
  opacity: 0.65;
}

.ambient--one {
  top: 22%;
  left: 14%;
}

.ambient--two {
  top: 38%;
  right: 12%;
  width: 3px;
  height: 3px;
}

.page-heading {
  text-align: center;
}

.eyebrow,
.card-eyebrow {
  margin: 0;
  color: var(--gold);
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.23em;
  text-transform: uppercase;
}

.page-heading h1 {
  margin: 0 0 9px;
  font-family: var(--serif);
  color: #f0d9a5;
  font-size: clamp(1.75rem, 7vw, 3.15rem);
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0.015em;
  text-shadow: 0 2px 18px rgba(198, 167, 108, 0.2);
}

.heading-note {
  margin: 0;
  color: rgba(243, 236, 217, 0.69);
  font-family: var(--serif);
  font-size: 1rem;
  font-style: italic;
  letter-spacing: 0.035em;
}

.invitation-scene {
  position: relative;
  display: grid;
  width: min(100%, 580px);
  min-height: clamp(300px, 40vw, 376px);
  flex: 1 0 clamp(300px, 40vw, 376px);
  place-items: center;
  margin-block: clamp(0.25rem, 1vw, 0.875rem) 0;
}

.envelope-wrap {
  position: relative;
  z-index: 2;
  width: min(82vw, 390px);
  aspect-ratio: 1.52;
  margin-top: clamp(0.25rem, 1vw, 1rem);
  perspective: 1100px;
  transition: opacity 450ms ease, transform 650ms cubic-bezier(0.2, 0.65, 0.3, 1);
}

.envelope {
  position: absolute;
  inset: 0;
  overflow: visible;
  filter: drop-shadow(0 24px 24px rgba(0, 0, 0, 0.32));
}

.envelope-back,
.envelope-front,
.envelope-flap,
.envelope-letter {
  position: absolute;
  inset: 0;
}

.envelope-back {
  border: 1px solid rgba(232, 211, 159, 0.72);
  border-radius: 3px;
  background:
    radial-gradient(ellipse at 50% 100%, rgba(214, 187, 128, 0.2), transparent 55%),
    linear-gradient(145deg, #3b8064, #286349 66%, #1e4a39);
}

.envelope-back::after {
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(198, 167, 108, 0.38);
  content: "";
}

.envelope-letter {
  z-index: 1;
  inset: 8% 8% 12%;
  border: 1px solid rgba(164, 137, 88, 0.65);
  background: linear-gradient(135deg, #f5efdf, #e7dcc1);
  opacity: 0;
  transform: translateY(0);
  transition:
    opacity 450ms ease 350ms,
    transform 750ms cubic-bezier(0.2, 0.65, 0.3, 1) 250ms;
}

.envelope-letter::before,
.envelope-letter::after {
  position: absolute;
  right: 15%;
  left: 15%;
  height: 1px;
  background: rgba(112, 91, 58, 0.25);
  content: "";
}

.envelope-letter::before {
  top: 34%;
}

.envelope-letter::after {
  top: 45%;
}

.envelope-flap {
  z-index: 2;
  background: linear-gradient(145deg, #4c9675, #2c684f);
  clip-path: polygon(0 0, 100% 0, 50% 62%);
  transform-origin: 50% 0;
  transition: transform 560ms cubic-bezier(0.2, 0.65, 0.3, 1);
}

.envelope-front {
  z-index: 3;
  background:
    linear-gradient(32deg, transparent 49.7%, rgba(232, 204, 139, 0.65) 50%, transparent 50.3%),
    linear-gradient(148deg, transparent 49.7%, rgba(232, 204, 139, 0.6) 50%, transparent 50.3%),
    linear-gradient(180deg, transparent 47%, rgba(11, 29, 24, 0.14)),
    linear-gradient(145deg, #3e8062, #286046);
  clip-path: polygon(0 0, 50% 57%, 100% 0, 100% 100%, 0 100%);
}

.seal-control {
  position: absolute;
  z-index: 5;
  top: 46%;
  left: 50%;
  display: grid;
  width: 84px;
  height: 84px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transform: translate(-50%, -5%);
  -webkit-tap-highlight-color: transparent;
}

.seal-sparkles {
  position: absolute;
  inset: -12px;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.seal-sparkle {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff4cf 0 14%, #edcd7d 43%, transparent 76%);
  filter: drop-shadow(0 0 4px rgba(241, 211, 139, 0.95));
  animation: seal-sparkle-twinkle 2.8s ease-in-out infinite;
}

.seal-sparkle:nth-child(1) {
  top: 10%;
  left: 19%;
  animation-duration: 2.4s;
  animation-delay: -0.4s;
}

.seal-sparkle:nth-child(2) {
  top: 27%;
  right: 4%;
  animation-duration: 3.1s;
  animation-delay: -1.1s;
}

.seal-sparkle:nth-child(3) {
  right: 16%;
  bottom: 6%;
  animation-duration: 2.7s;
  animation-delay: -2s;
}

.seal-sparkle:nth-child(4) {
  bottom: 21%;
  left: 3%;
  animation-duration: 3.5s;
  animation-delay: -0.5s;
}

.seal-sparkle:nth-child(5) {
  top: 3%;
  right: 31%;
  width: 6px;
  height: 6px;
  animation-duration: 2.9s;
  animation-delay: -1.6s;
}

.seal-sparkle:nth-child(6) {
  bottom: 3%;
  left: 37%;
  width: 4px;
  height: 4px;
  animation-duration: 3.3s;
  animation-delay: -0.8s;
}

@keyframes seal-sparkle-twinkle {
  0%,
  100% {
    opacity: 0.25;
    transform: translateY(1px) scale(0.75);
  }

  50% {
    opacity: 0.95;
    transform: translateY(-2px) scale(1.1);
  }
}

.seal-control:focus-visible,
.text-button:focus-visible,
.details-button:focus-visible {
  outline: 2px solid #f1d99f;
  outline-offset: 5px;
}

.seal {
  display: block;
  width: 84px;
  height: 84px;
  object-fit: contain;
  filter: drop-shadow(0 5px 5px rgba(0, 0, 0, 0.4));
  transition: transform 500ms ease, opacity 350ms ease;
}

.seal-control:hover .seal {
  transform: scale(1.06) rotate(-3deg);
}

.invitation-card {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  width: min(100%, 390px);
  min-height: 330px;
  padding: 12px;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 50% 0, rgba(255, 255, 255, 0.72), transparent 66%),
    radial-gradient(ellipse at 8% 42%, rgba(157, 119, 60, 0.07), transparent 42%),
    radial-gradient(ellipse at 92% 72%, rgba(157, 119, 60, 0.055), transparent 46%),
    linear-gradient(135deg, #f5eedc, #eee2c8 52%, #f3ead6);
  box-shadow:
    inset 0 0 22px rgba(133, 101, 55, 0.12),
    0 24px 50px rgba(0, 0, 0, 0.35),
    0 3px 8px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translate(-50%, -43%) scale(0.96);
  transition:
    opacity 550ms ease 100ms,
    transform 700ms cubic-bezier(0.2, 0.65, 0.3, 1);
}

.invitation-card[hidden] {
  display: none;
}

.card-border {
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(151, 120, 66, 0.58);
  pointer-events: none;
}

.card-corner-flourish {
  position: absolute;
  z-index: 1;
  top: 14px;
  width: clamp(64px, 22%, 86px);
  height: auto;
  opacity: 0.9;
  pointer-events: none;
}

.card-corner-flourish--left {
  left: 14px;
}

.card-corner-flourish--right {
  right: 14px;
}

.card-content {
  position: relative;
  z-index: 2;
  display: flex;
  min-height: 306px;
  flex-direction: column;
  align-items: center;
  padding: 24px 17px 20px;
  text-align: center;
}

.card-eyebrow {
  color: #76603a;
  font-size: 0.54rem;
  letter-spacing: 0.19em;
}

.couple-names {
  display: flex;
  flex-direction: column;
  margin: 11px 0 6px;
  color: #3e3529;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.5rem, 6.5vw, 2rem);
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.06;
}

.ampersand {
  margin: 2px 0;
  color: #9a7944;
  font-size: 1.15rem;
  font-style: italic;
}

.divider {
  width: min(88%, 270px);
  margin: 0 0 9px;
}

.divider-image {
  display: block;
  width: 100%;
  height: auto;
}

.invitation-copy,
.invitation-message,
.card-signoff {
  margin: 0;
  font-family: var(--serif);
  font-size: 0.83rem;
  line-height: 1.5;
}

.wedding-date {
  margin: 6px 0 8px;
  color: #765c33;
  font-family: var(--serif);
  font-size: 1.05rem;
  font-style: italic;
  line-height: 1.4;
}

.wedding-date span {
  display: block;
}

.invitation-message {
  max-width: 265px;
  margin-top: 2px;
  color: #596056;
  font-size: 0.76rem;
}

.card-signoff {
  margin: 9px 0 11px;
  color: #5e5038;
  font-size: 0.82rem;
  font-style: italic;
  line-height: 1.4;
}

.details-button {
  min-height: 36px;
  padding: 8px 16px;
  border: 1px solid #a68b5c;
  background: transparent;
  color: #635334;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.details-button--faq {
  margin-top: 6px;
}

.details-button:disabled {
  cursor: not-allowed;
}

.easter-egg {
  display: flex;
  width: calc(100% + 14px);
  min-height: 28px;
  align-items: center;
  flex-direction: row-reverse;
  justify-content: flex-start;
  gap: 5px;
  margin-top: 4px;
  margin-right: -14px;
}

.d20-control {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  padding: 2px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #99845f;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: width 220ms ease, height 220ms ease, flex-basis 220ms ease, color 180ms ease;
}

.d20-control:focus-visible {
  outline: 2px solid #8b7043;
  outline-offset: 2px;
}

.d20-control[aria-expanded="true"] {
  cursor: default;
}

.d20-control.is-rolling,
.d20-control[aria-expanded="true"] {
  width: 42px;
  height: 42px;
  flex-basis: 42px;
}

.d20-control svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  fill: rgba(166, 139, 92, 0.08);
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.4;
}

.d20-control .d20-facet {
  fill: none;
  opacity: 0.86;
  stroke-width: 0.8;
}

.d20-control .d20-face {
  fill: rgba(166, 139, 92, 0.13);
  stroke-width: 1;
}

.d20-control text {
  fill: #5e492b;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  opacity: 0;
  stroke: none;
  transition: opacity 180ms ease;
}

.d20-control:hover:not([aria-expanded="true"]) {
  color: #6f572f;
}

.d20-control:hover text,
.d20-control:focus-visible text,
.d20-control.is-rolling text,
.d20-control[aria-expanded="true"] text {
  opacity: 1;
}

.d20-control.is-rolling svg {
  animation: d20-roll 600ms ease-in-out;
}

.easter-egg-message {
  max-width: 235px;
  margin: 0;
  color: #75613f;
  font-family: var(--serif);
  font-size: 0.68rem;
  font-style: italic;
  line-height: 1.35;
  text-align: right;
}

.easter-egg-message[hidden] {
  display: none;
}

@keyframes d20-roll {
  0% {
    transform: rotate(0) scale(1);
  }

  55% {
    transform: rotate(200deg) scale(1.12);
  }

  100% {
    transform: rotate(360deg) scale(1);
  }
}

.interaction-controls {
  display: flex;
  min-height: 53px;
  flex-direction: column;
  align-items: center;
  gap: clamp(0.35rem, 1vw, 0.5rem);
}

.interaction-hint {
  margin: 0;
  color: rgba(243, 236, 217, 0.78);
  font-family: var(--serif);
  font-size: 0.86rem;
  font-style: italic;
  letter-spacing: 0.02em;
}

.text-button {
  padding: 3px 8px;
  border: 0;
  background: transparent;
  color: var(--gold);
  cursor: pointer;
  font-size: 0.65rem;
  letter-spacing: 0.07em;
  text-decoration: underline;
  text-decoration-color: rgba(198, 167, 108, 0.55);
  text-underline-offset: 3px;
}

.text-button:hover {
  color: #f0d9a5;
}

.page-footer {
  margin: auto 0 0;
  padding-top: clamp(0.9rem, 2vw, 1.75rem);
  color: rgba(243, 236, 217, 0.62);
  font-family: var(--serif);
  font-size: 0.7rem;
  font-style: italic;
  letter-spacing: 0.1em;
  text-align: center;
}

.save-date-page {
  overflow: auto;
}

.save-date-page .page-heading h1 {
  margin-top: 12px;
  color: #f0d9a5;
  font-style: italic;
}

.save-date-page .page-heading h1::after {
  display: block;
  width: 48px;
  height: 1px;
  margin: 0.85rem auto 0;
  background: rgba(198, 167, 108, 0.72);
  content: "";
}

.portrait-frame {
  position: relative;
  width: min(100%, 390px);
  margin: clamp(1.3rem, 4vw, 2.1rem) 0 1.1rem;
  padding: 9px;
  border: 1px solid rgba(198, 167, 108, 0.68);
  background: linear-gradient(145deg, rgba(198, 167, 108, 0.12), rgba(16, 35, 31, 0.6));
  box-shadow: 0 20px 42px rgba(0, 0, 0, 0.24);
}

.portrait-photo {
  display: block;
  width: 100%;
  height: auto;
}

.runestone-control {
  position: absolute;
  right: -10px;
  bottom: -15px;
  display: grid;
  width: 48px;
  height: 48px;
  padding: 7px;
  place-items: center;
  border: 1px solid rgba(198, 167, 108, 0.62);
  border-radius: 42% 52% 46% 54% / 48% 42% 58% 52%;
  background:
    radial-gradient(ellipse at 32% 25%, rgba(105, 117, 98, 0.8), transparent 55%),
    linear-gradient(145deg, #35463b, #1a2c26 75%);
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.38), inset 0 0 8px rgba(0, 0, 0, 0.28);
  color: #c6a76c;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 180ms ease, box-shadow 180ms ease, color 180ms ease;
}

.runestone-control svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: rgba(198, 167, 108, 0.04);
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.runestone-control .runestone-rune {
  fill: none;
  opacity: 0.82;
  stroke-width: 1.8;
}

.runestone-control:hover {
  color: #f0d9a5;
  box-shadow: 0 0 14px rgba(198, 167, 108, 0.38), 0 5px 12px rgba(0, 0, 0, 0.38);
  transform: translateY(-2px);
}

.runestone-control:focus-visible {
  outline: 2px solid #f1d99f;
  outline-offset: 3px;
}

.runestone-control[aria-expanded="true"] {
  color: #f0d9a5;
  box-shadow: 0 0 12px rgba(198, 167, 108, 0.28), 0 5px 12px rgba(0, 0, 0, 0.38);
}

.save-date-copy {
  text-align: center;
}

.save-date-invitation {
  margin: 0;
  color: rgba(243, 236, 217, 0.78);
  font-family: var(--serif);
  font-size: 0.95rem;
  font-style: italic;
}

.save-date-names {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25em;
  margin: 0.55rem 0 0;
  font-family: var(--serif);
  font-size: clamp(1.45rem, 6vw, 2.15rem);
  font-weight: 400;
  line-height: 1.2;
}

.save-date-names span {
  color: var(--gold);
  font-style: italic;
}

.save-date-landscape {
  position: relative;
  display: grid;
  width: min(100%, 440px);
  min-height: 130px;
  align-content: center;
  row-gap: 0.3rem;
  place-items: center;
  margin: 0.6rem auto 0;
  isolation: isolate;
}

.save-date-landscape svg {
  position: absolute;
  z-index: -1;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  color: rgba(198, 167, 108, 0.52);
}

.landscape-star {
  fill: currentColor;
}

.landscape-star--center {
  color: rgba(225, 199, 144, 0.62);
}

.landscape-star--left,
.landscape-star--right {
  color: rgba(198, 167, 108, 0.46);
}

.landscape-mountain {
  fill: url("#landscapeMountainFill");
}

.landscape-ridge {
  fill: none;
  opacity: 0.24;
  stroke: rgba(225, 199, 144, 0.58);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.1;
}

.landscape-facet {
  fill: none;
  opacity: 0.14;
  stroke: rgba(225, 199, 144, 0.48);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 0.8;
}

.save-date-date {
  position: relative;
  z-index: 1;
  margin: 0;
  color: #f0d9a5;
  font-family: var(--serif);
  font-size: clamp(1rem, 4.2vw, 1.25rem);
  letter-spacing: 0.025em;
}

.save-date-note {
  margin: 0.6rem 0 0;
  color: rgba(243, 236, 217, 0.7);
  font-family: var(--serif);
  font-size: 0.86rem;
  font-style: italic;
}

.save-date-location {
  margin: 0;
  color: var(--ivory);
  font-family: var(--serif);
  font-size: 0.9rem;
}

.save-date-tagline {
  margin: 1.35rem 0 0;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(198, 167, 108, 0.28);
  color: var(--gold);
  font-family: var(--serif);
  font-size: clamp(0.9rem, 3.8vw, 1.05rem);
  font-style: italic;
}

.save-date-website {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  margin-top: 1rem;
  padding: 8px 16px;
  border: 1px solid rgba(198, 167, 108, 0.68);
  background: rgba(16, 35, 31, 0.5);
  color: #f0d9a5;
  font-size: 0.68rem;
  letter-spacing: 0.11em;
  text-decoration: none;
  text-transform: uppercase;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

.save-date-website:hover {
  border-color: #f0d9a5;
  background: rgba(198, 167, 108, 0.12);
}

.save-date-website:focus-visible {
  outline: 2px solid #f1d99f;
  outline-offset: 3px;
}

.runestone-message {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 50%;
  width: max-content;
  max-width: calc(100vw - 2rem);
  margin: 0;
  padding: 0.6rem 0.9rem;
  border: 1px solid rgba(166, 139, 92, 0.72);
  border-radius: 0.45rem;
  background:
    radial-gradient(ellipse at 50% 0, rgba(255, 255, 255, 0.8), transparent 70%),
    linear-gradient(135deg, #f5eedc, #e9dec6);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.32);
  color: #4b473d;
  font-family: var(--serif);
  font-size: 0.95rem;
  font-style: italic;
  letter-spacing: 0.035em;
  opacity: 0;
  pointer-events: none;
  text-align: center;
  transform: translate(-50%, 8px);
}

.runestone-message::after {
  position: absolute;
  bottom: -6px;
  left: calc(50% - 5px);
  width: 10px;
  height: 10px;
  border-right: 1px solid rgba(166, 139, 92, 0.72);
  border-bottom: 1px solid rgba(166, 139, 92, 0.72);
  background: #e9dec6;
  content: "";
  transform: rotate(45deg);
}

.runestone-message.is-below::after {
  top: -6px;
  bottom: auto;
  border: 0;
  border-top: 1px solid rgba(166, 139, 92, 0.72);
  border-left: 1px solid rgba(166, 139, 92, 0.72);
}

.runestone-message.is-visible {
  animation: runestone-message-float 4s ease-out forwards;
}

.runestone-message:empty {
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  border: 0;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

@keyframes runestone-message-float {
  0% {
    opacity: 0;
    transform: translate(-50%, 8px);
  }

  10%,
  72% {
    opacity: 1;
    transform: translate(-50%, 0);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -10px);
  }
}

@media (max-width: 480px) {
  .invitation-page {
    padding-top: 2rem;
    padding-bottom: 1rem;
  }

  .invitation-scene {
    min-height: 272px;
    flex-basis: 272px;
  }

  .envelope-wrap {
    width: min(76vw, 320px);
  }

  .page-footer {
    padding-top: 1rem;
  }


}

@media (max-height: 640px) {
  .invitation-page {
    padding-top: 1.5rem;
    padding-bottom: 0.75rem;
  }

  .invitation-scene {
    min-height: 248px;
    flex-basis: 248px;
  }

  .page-footer {
    padding-top: 0.75rem;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.is-opening .envelope-flap {
  z-index: 0;
  transform: rotateX(180deg);
}

.is-opening .envelope-letter,
.is-open .envelope-letter {
  transform: translateY(-35%);
}

.is-opening .envelope-letter {
  opacity: 1;
}

.is-opening .seal,
.is-open .seal {
  opacity: 0;
  transform: scale(0.5) rotate(20deg);
}

.is-opening .seal-sparkles,
.is-open .seal-sparkles {
  visibility: hidden;
  opacity: 0;
}

.is-opening .seal-sparkle,
.is-open .seal-sparkle {
  animation: none;
}

.is-open .invitation-card {
  position: relative;
  top: auto;
  left: auto;
  opacity: 1;
  transform: none;
}

.is-open .envelope-wrap {
  opacity: 0;
  pointer-events: none;
  transform: translateY(92px) scale(0.91);
}

.is-open .envelope-letter {
  opacity: 0;
}

.is-open .envelope-flap {
  z-index: 0;
  transform: rotateX(180deg);
}

.is-instant *,
.is-instant *::before,
.is-instant *::after {
  transition: none !important;
}

@media (min-width: 700px) {
  .invitation-page {
    padding-top: 68px;
  }

  .invitation-scene {
    min-height: 425px;
    flex-basis: 425px;
  }

  .envelope-wrap {
    width: 390px;
  }

  .invitation-card {
    width: 390px;
    min-height: 350px;
  }

  .card-content {
    min-height: 326px;
    padding-top: 29px;
  }
}

@media (min-width: 900px) {
  .invitation-scene {
    flex-grow: 0.24;
  }

  .is-open .invitation-card,
  .is-open .envelope-wrap {
    grid-area: 1 / 1;
  }
}

@media (max-height: 680px) and (min-width: 560px) {
  .invitation-page {
    padding-top: 25px;
  }

  .invitation-scene {
    min-height: 340px;
    flex-basis: 340px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }

  .seal-sparkles {
    display: none;
  }

  .runestone-message.is-visible {
    animation: none;
    opacity: 1;
    transform: translateX(-50%);
  }
}

@media (max-height: 640px) {
  .is-open .invitation-scene {
    min-height: 392px;
    flex-basis: 392px;
    place-items: start center;
    margin-top: 0.75rem;
  }
}

@media (max-height: 640px) and (max-width: 480px) {
  .is-open .invitation-scene {
    min-height: 440px;
    flex-basis: 440px;
  }
}
