:root {
  --ivory: #f8efda;
  --ivory-light: #fffaf0;
  --paper-shadow: #cbb990;
  --ink: #4e2927;
  --wine: #6e232a;
  --wine-dark: #3d1218;
  --gold: #b98a3c;
  --gold-light: #e2c784;
  --gold-dark: #7c5724;
  --scene-speed: 1;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  scroll-behavior: smooth;
  background: #261216;
}

html.is-locked,
body.is-locked {
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background-color: #33191b;
  background-image:
    linear-gradient(180deg, rgba(31, 15, 16, 0.38), rgba(46, 17, 20, 0.58)),
    url("assets/wedding-background.jpg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  background-attachment: fixed;
  font-family: "Geeza Pro", "Noto Naskh Arabic", "Traditional Arabic", Tahoma, serif;
  text-align: center;
  -webkit-font-smoothing: antialiased;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button,
input,
textarea,
select {
  font: inherit;
}

.ambient-glow {
  position: fixed;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 38%, rgba(245, 206, 134, 0.16), transparent 35%),
    linear-gradient(90deg, rgba(31, 12, 14, 0.22), transparent 28%, transparent 72%, rgba(31, 12, 14, 0.22));
}

.opening-scene {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  min-height: 100svh;
  padding: max(24px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom));
  overflow: hidden;
  transition: opacity 700ms ease, visibility 700ms step-end;
}

.opening-scene::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(69, 26, 28, 0.05), rgba(31, 13, 15, 0.26));
  pointer-events: none;
}

.envelope-trigger {
  position: relative;
  width: min(88vw, 520px);
  aspect-ratio: 1.52;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  perspective: 1400px;
  isolation: isolate;
  transition: transform 300ms ease;
}

.envelope-trigger:hover:not(:disabled) {
  transform: translateY(-5px);
}

.envelope-trigger:focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: 12px;
  border-radius: 16px;
}

.envelope-trigger:disabled {
  cursor: default;
}

.envelope-shadow {
  position: absolute;
  z-index: -1;
  right: 5%;
  bottom: -11%;
  left: 5%;
  height: 18%;
  border-radius: 50%;
  background: rgba(19, 7, 8, 0.52);
  filter: blur(20px);
  transform: scaleX(0.9);
  transition: opacity 700ms ease, transform 900ms ease;
}

.envelope {
  position: absolute;
  inset: 0;
  filter: drop-shadow(0 20px 24px rgba(23, 8, 10, 0.28));
  transform-style: preserve-3d;
}

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

.envelope-back {
  z-index: 1;
  border: 1px solid rgba(126, 91, 42, 0.4);
  border-radius: 8px;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.65), transparent 28%),
    linear-gradient(145deg, #f7eccf, #e9d7ae 78%);
  box-shadow: inset 0 0 34px rgba(130, 92, 42, 0.12);
}

.letter-preview {
  position: absolute;
  z-index: 2;
  right: 8%;
  bottom: 8%;
  left: 8%;
  height: 78%;
  display: block;
  overflow: hidden;
  border-radius: 5px 5px 2px 2px;
  background:
    linear-gradient(rgba(255, 250, 239, 0.86), rgba(246, 233, 207, 0.94)),
    repeating-linear-gradient(0deg, transparent 0 5px, rgba(117, 84, 45, 0.025) 5px 6px);
  box-shadow: 0 2px 12px rgba(78, 45, 20, 0.2);
  transform: translateY(2%);
  transform-origin: center bottom;
  transition:
    transform 1150ms cubic-bezier(0.22, 0.83, 0.22, 1),
    opacity 520ms ease 800ms,
    box-shadow 900ms ease;
}

.letter-preview > .letter-preview__actual-card {
  position: absolute;
  inset: 0;
  width: 100%;
  min-height: 100%;
  padding: clamp(12px, 3.2vw, 18px) clamp(16px, 4vw, 23px) clamp(14px, 3.5vw, 20px);
  border: 0;
  border-radius: 4px;
  background: linear-gradient(rgba(255, 250, 240, 0.97), rgba(248, 237, 215, 0.98));
  box-shadow: none;
  text-shadow: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.opening-scene.is-flap-open .letter-preview__actual-card {
  opacity: 1;
  transition-delay: 280ms;
}

.letter-preview > .letter-preview__actual-card::before,
.letter-preview > .letter-preview__actual-card::after,
.letter-preview__actual-card .card-corner {
  display: none;
}

.letter-preview__actual-card .card-frame {
  inset: 5px;
  border-color: rgba(185, 138, 60, 0.55);
  box-shadow: none;
}

.letter-preview__actual-card .card-frame::before,
.letter-preview__actual-card .card-frame::after {
  width: 28px;
  height: 5px;
}

.letter-preview__actual-card .card-content {
  display: flex;
  height: 100%;
  justify-content: space-between;
  text-shadow: none;
}

.letter-preview__actual-card .verse {
  margin: 0 0 4px;
  color: #624122;
  font-size: clamp(0.27rem, 1.05vw, 0.42rem);
  font-weight: 700;
  line-height: 1.55;
}

.letter-preview__actual-card .gold-divider {
  width: 42%;
  margin: 0 auto 4px;
}

.letter-preview__actual-card .gold-divider span {
  width: 4px;
  height: 4px;
  margin: 0 4px;
}

.letter-preview__actual-card .gold-divider span::after {
  display: none;
}

.letter-preview__actual-card .blessing {
  margin: 0 0 4px;
  font-size: clamp(0.39rem, 1.35vw, 0.58rem);
  line-height: 1.45;
}

.letter-preview__actual-card .body-copy {
  margin: 0 0 3px;
  color: #4e2927;
  font-size: clamp(0.24rem, 0.78vw, 0.35rem);
  font-weight: 500;
  line-height: 1.45;
}

.letter-preview__actual-card .honor-line {
  margin: 0 0 4px;
  color: #6a4725;
  font-size: clamp(0.28rem, 0.9vw, 0.4rem);
  line-height: 1.4;
}

.letter-preview__actual-card .couple-names {
  gap: 0;
}

.letter-preview__actual-card .couple-names h1 {
  font-size: clamp(0.53rem, 1.8vw, 0.8rem);
  line-height: 1.12;
  text-shadow: none;
}

.letter-preview__actual-card .couple-names > span {
  width: 25px;
  height: 8px;
  font-size: 0.38rem;
}

.letter-preview__actual-card .couple-names > span::before,
.letter-preview__actual-card .couple-names > span::after {
  width: 7px;
}

.letter-preview__actual-card .gold-divider--wide {
  margin-top: 3px;
  margin-bottom: 3px;
}

.letter-preview__actual-card .event-details {
  gap: 1px;
  font-size: clamp(0.25rem, 0.82vw, 0.37rem);
  line-height: 1.25;
}

.letter-preview__actual-card .event-details time:first-child {
  font-size: clamp(0.34rem, 1.05vw, 0.48rem);
}

.letter-preview__actual-card .event-details address {
  margin-top: 0;
}

.letter-preview__actual-card .map-button {
  width: auto;
  min-height: 0;
  margin-top: 3px;
  align-self: center;
  padding: 2px 7px;
  gap: 3px;
  border-width: 0.5px;
  box-shadow: none;
  font-size: clamp(0.22rem, 0.72vw, 0.32rem);
  line-height: 1.2;
  transform: none;
}

.letter-preview__actual-card .map-pin {
  width: 4px;
  height: 5px;
  border-width: 0.5px;
}

.letter-preview__actual-card .map-pin::after {
  display: none;
}

.preview-border {
  position: absolute;
  inset: 7%;
  border: 1px solid rgba(185, 138, 60, 0.5);
}

.preview-border::before,
.preview-border::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 24%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(185, 138, 60, 0.62), transparent);
}

.preview-border::before {
  right: 12%;
}

.preview-border::after {
  left: 12%;
}

.preview-ornament {
  position: absolute;
  left: 50%;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(185, 138, 60, 0.72);
  transform: translateX(-50%) rotate(45deg);
}

.preview-ornament::before,
.preview-ornament::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(185, 138, 60, 0.46);
  border-radius: 50%;
}

.preview-ornament--top {
  top: 16%;
}

.preview-ornament--bottom {
  bottom: 16%;
}

.envelope-flap {
  z-index: 5;
  height: 58%;
  border-radius: 8px 8px 0 0;
  background:
    radial-gradient(circle at 50% 16%, rgba(255, 255, 255, 0.5), transparent 38%),
    linear-gradient(155deg, #f9eed3, #e4d0a6);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: 50% 0;
  transform-style: preserve-3d;
  transition: transform 900ms cubic-bezier(0.25, 0.68, 0.28, 1), z-index 0ms linear 450ms;
  backface-visibility: visible;
  filter: drop-shadow(0 4px 4px rgba(98, 64, 31, 0.14));
}

.envelope-flap::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(165deg, rgba(174, 137, 80, 0.16), transparent 48%);
  clip-path: inherit;
  transform: translateZ(-1px);
}

.envelope-front {
  z-index: 4;
  border-radius: 0 0 8px 8px;
  overflow: hidden;
}

.envelope-front--left {
  background: linear-gradient(130deg, #f4e6c5, #e1caa0);
  clip-path: polygon(0 0, 55% 55%, 50% 100%, 0 100%);
}

.envelope-front--right {
  background: linear-gradient(230deg, #f7e9c9, #dfc596);
  clip-path: polygon(100% 0, 45% 55%, 50% 100%, 100% 100%);
}

.envelope-front--bottom {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.24), transparent 35%),
    linear-gradient(145deg, #ebd7ad, #f5e6c6);
  clip-path: polygon(0 100%, 50% 42%, 100% 100%);
}

.wax-seal {
  position: absolute;
  z-index: 8;
  top: 56%;
  left: 50%;
  width: clamp(68px, 17vw, 90px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 2px solid rgba(142, 92, 25, 0.78);
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 26%, rgba(255, 255, 232, 0.9), transparent 16%),
    radial-gradient(circle at 50% 46%, #fff1bd 0 34%, #eac36f 62%, #b77926 84%, #7e4c16 100%);
  box-shadow:
    0 7px 13px rgba(76, 48, 14, 0.3),
    0 1px 2px rgba(76, 48, 14, 0.32),
    inset 0 0 0 4px rgba(255, 240, 180, 0.4),
    inset 0 0 12px rgba(113, 68, 14, 0.24);
  transform: translate(-50%, -50%) rotate(-2deg);
  transform-origin: center;
}

.wax-seal::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 6px;
  border: 2px solid rgba(137, 87, 24, 0.58);
  border-radius: 50%;
}

.wax-seal::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -5px;
  border: 1px solid rgba(238, 201, 119, 0.6);
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(119, 76, 20, 0.22);
}

.wax-seal__heart {
  position: relative;
  z-index: 1;
  color: #95601f;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.55rem, 10vw, 4rem);
  font-weight: 700;
  line-height: 0.72;
  text-shadow:
    0 1px 0 rgba(255, 249, 216, 0.86),
    0 -1px 0 rgba(107, 64, 16, 0.38),
    1px 0 1px rgba(107, 64, 16, 0.2);
  transform: translateY(-1px);
}

.opening-scene.is-breaking .wax-seal {
  animation: break-seal 620ms cubic-bezier(0.42, 0, 0.8, 0.3) forwards;
}

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

.opening-scene.is-letter-rising .letter-preview {
  z-index: 7;
  opacity: 0;
  box-shadow: 0 30px 50px rgba(35, 13, 11, 0.25);
  transform: translateY(-92%) scale(1.28);
}

.opening-scene.is-letter-rising .envelope-shadow {
  opacity: 0.52;
  transform: scaleX(0.72);
}

.opening-scene.is-revealing {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

@keyframes break-seal {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(-2deg) scale(1);
  }
  35% {
    transform: translate(-50%, -50%) rotate(7deg) scale(1.08);
  }
  72% {
    opacity: 1;
    filter: blur(0);
  }
  100% {
    opacity: 0;
    filter: blur(2px);
    transform: translate(-50%, 12%) rotate(22deg) scale(0.42);
  }
}

.invitation-page {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  min-height: 100svh;
  padding: clamp(24px, 5vw, 72px) clamp(12px, 3vw, 32px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(30px) scale(0.985);
  transition:
    opacity 800ms ease,
    visibility 0ms linear 800ms,
    transform 900ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

body.is-complete .invitation-page {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0ms;
}

body.is-complete {
  background-image:
    linear-gradient(180deg, rgba(31, 15, 16, 0.06), rgba(46, 17, 20, 0.16)),
    url("assets/wedding-background.jpg");
}

body.is-complete .ambient-glow {
  opacity: 0.32;
  transition: opacity 700ms ease;
}

.invitation-card {
  position: relative;
  width: min(100%, 760px);
  padding: clamp(44px, 8vw, 90px) clamp(27px, 8vw, 92px);
  overflow: hidden;
  border: 1px solid rgba(198, 157, 86, 0.72);
  border-radius: 3px;
  background:
    linear-gradient(rgba(255, 250, 240, 0.91), rgba(248, 237, 215, 0.94)),
    repeating-linear-gradient(90deg, transparent 0 4px, rgba(113, 76, 37, 0.018) 4px 5px);
  box-shadow:
    0 30px 70px rgba(25, 8, 10, 0.42),
    inset 0 0 80px rgba(162, 118, 55, 0.08);
  outline: none;
}

.invitation-card::before,
.invitation-card::after {
  content: "";
  position: absolute;
  width: 270px;
  height: 270px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.55;
  background:
    radial-gradient(circle at center, transparent 0 31%, rgba(185, 138, 60, 0.08) 31.5% 32.5%, transparent 33%),
    repeating-conic-gradient(from 0deg, rgba(185, 138, 60, 0.12) 0 3deg, transparent 3deg 12deg);
  -webkit-mask-image: radial-gradient(circle, #000 0 48%, transparent 70%);
  mask-image: radial-gradient(circle, #000 0 48%, transparent 70%);
}

.invitation-card::before {
  top: -126px;
  right: -120px;
}

.invitation-card::after {
  bottom: -126px;
  left: -120px;
}

.card-frame {
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(185, 138, 60, 0.48);
  box-shadow: inset 0 0 0 4px rgba(255, 250, 239, 0.44);
  pointer-events: none;
}

.card-frame::before,
.card-frame::after {
  content: "";
  position: absolute;
  right: 50%;
  width: 90px;
  height: 16px;
  border-right: 1px solid rgba(185, 138, 60, 0.62);
  border-left: 1px solid rgba(185, 138, 60, 0.62);
  transform: translateX(50%);
}

.card-frame::before {
  top: -1px;
  border-radius: 0 0 50% 50%;
  border-bottom: 1px solid rgba(185, 138, 60, 0.62);
}

.card-frame::after {
  bottom: -1px;
  border-radius: 50% 50% 0 0;
  border-top: 1px solid rgba(185, 138, 60, 0.62);
}

.card-corner {
  position: absolute;
  width: 44px;
  height: 44px;
  pointer-events: none;
}

.card-corner::before,
.card-corner::after {
  content: "";
  position: absolute;
  border-color: rgba(185, 138, 60, 0.78);
}

.card-corner::before {
  inset: 0;
  border-style: solid;
  border-width: 0;
}

.card-corner::after {
  width: 21px;
  height: 21px;
  border: 1px solid rgba(185, 138, 60, 0.52);
  border-radius: 50% 12%;
}

.card-corner--tr {
  top: 14px;
  right: 14px;
}

.card-corner--tr::before {
  border-top-width: 2px;
  border-right-width: 2px;
}

.card-corner--tr::after {
  top: 7px;
  right: 7px;
}

.card-corner--tl {
  top: 14px;
  left: 14px;
  transform: scaleX(-1);
}

.card-corner--tl::before {
  border-top-width: 2px;
  border-right-width: 2px;
}

.card-corner--tl::after {
  top: 7px;
  right: 7px;
}

.card-corner--br {
  right: 14px;
  bottom: 14px;
  transform: scaleY(-1);
}

.card-corner--br::before {
  border-top-width: 2px;
  border-right-width: 2px;
}

.card-corner--br::after {
  top: 7px;
  right: 7px;
}

.card-corner--bl {
  bottom: 14px;
  left: 14px;
  transform: scale(-1);
}

.card-corner--bl::before {
  border-top-width: 2px;
  border-right-width: 2px;
}

.card-corner--bl::after {
  top: 7px;
  right: 7px;
}

.card-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.verse,
.blessing,
.body-copy,
.honor-line,
.couple-names,
.event-details {
  width: 100%;
  margin-right: auto;
  margin-left: auto;
}

.verse {
  max-width: 610px;
  margin-top: 0;
  margin-bottom: clamp(23px, 4vw, 36px);
  color: #6a4725;
  font-size: clamp(1.05rem, 2.6vw, 1.42rem);
  font-weight: 600;
  line-height: 2.05;
}

.gold-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(210px, 56%);
  margin: 0 auto clamp(24px, 5vw, 39px);
}

.gold-divider::before,
.gold-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold));
}

.gold-divider::after {
  background: linear-gradient(90deg, var(--gold), transparent);
}

.gold-divider span {
  position: relative;
  width: 13px;
  height: 13px;
  margin: 0 11px;
  border: 1px solid var(--gold);
  transform: rotate(45deg);
}

.gold-divider span::after {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(185, 138, 60, 0.58);
}

.gold-divider--wide {
  width: min(290px, 72%);
  margin-top: clamp(23px, 4vw, 34px);
  margin-bottom: clamp(24px, 4vw, 34px);
}

.blessing {
  margin-top: 0;
  margin-bottom: clamp(25px, 5vw, 40px);
  color: var(--wine);
  font-size: clamp(1.4rem, 4.4vw, 2.02rem);
  font-weight: 700;
  line-height: 1.8;
}

.body-copy {
  max-width: 590px;
  margin-top: 0;
  margin-bottom: clamp(18px, 3.7vw, 28px);
  font-size: clamp(1.04rem, 2.7vw, 1.25rem);
  line-height: 2.08;
}

.honor-line {
  margin-top: clamp(8px, 2vw, 14px);
  margin-bottom: clamp(31px, 6vw, 48px);
  color: #745026;
  font-size: clamp(1.12rem, 3vw, 1.45rem);
  font-weight: 700;
  line-height: 1.8;
}

.couple-names {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--wine);
}

.couple-names h1 {
  margin: 0;
  font-family: "Diwan Kufi", "Geeza Pro", "Traditional Arabic", serif;
  font-size: clamp(2.1rem, 7vw, 3.55rem);
  font-weight: 700;
  line-height: 1.35;
  text-shadow: 0 1px 0 #fff;
}

.couple-names > span {
  position: relative;
  display: grid;
  place-items: center;
  width: 62px;
  height: 32px;
  color: var(--gold-dark);
  font-size: 1.35rem;
  line-height: 1;
}

.couple-names > span::before,
.couple-names > span::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 18px;
  height: 1px;
  background: var(--gold);
}

.couple-names > span::before {
  right: 0;
}

.couple-names > span::after {
  left: 0;
}

.event-details {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: #624025;
  font-size: clamp(1.13rem, 3vw, 1.4rem);
  font-weight: 600;
  line-height: 1.65;
}

.event-details time:first-child {
  color: var(--wine);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  font-weight: 600;
  letter-spacing: 0.08em;
}

.event-details address {
  margin-top: 2px;
  font-style: normal;
}

.map-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  min-height: 50px;
  margin-top: clamp(28px, 5vw, 40px);
  padding: 12px 25px 13px;
  border: 1px solid #93692e;
  border-radius: 999px;
  color: var(--ivory-light);
  background: linear-gradient(135deg, #a97a34, #7e5525);
  box-shadow:
    0 8px 20px rgba(100, 66, 27, 0.23),
    inset 0 1px 0 rgba(255, 255, 255, 0.23);
  font-size: clamp(0.98rem, 2.6vw, 1.08rem);
  font-weight: 700;
  line-height: 1.35;
  text-decoration: none;
  transition: transform 220ms ease, box-shadow 220ms ease, background 220ms ease;
}

.map-button:hover {
  background: linear-gradient(135deg, #b68a43, #855b29);
  box-shadow:
    0 10px 24px rgba(100, 66, 27, 0.31),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  transform: translateY(-2px);
}

.map-button:focus-visible {
  outline: 3px solid rgba(124, 87, 36, 0.4);
  outline-offset: 4px;
}

.map-button:active {
  transform: translateY(0);
}

.map-pin {
  position: relative;
  width: 15px;
  height: 19px;
  flex: 0 0 auto;
  border: 1.5px solid currentColor;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
}

.map-pin::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 4px;
  height: 4px;
  border: 1px solid currentColor;
  border-radius: 50%;
}

.reveal-item {
  opacity: 0;
  transform: translateY(18px);
}

body.is-complete .reveal-item {
  opacity: 1;
  transform: none;
  transition:
    opacity 700ms ease calc(260ms + var(--reveal-order) * 105ms),
    transform 700ms cubic-bezier(0.2, 0.72, 0.2, 1) calc(260ms + var(--reveal-order) * 105ms);
}

@media (max-width: 700px) {
  body {
    background: #33191b;
  }

  body::before {
    content: "";
    position: fixed;
    z-index: 0;
    inset: -4vh -4vw;
    background-image:
      linear-gradient(180deg, rgba(31, 15, 16, 0.34), rgba(46, 17, 20, 0.58)),
      url("assets/wedding-background.jpg");
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    transform: translateZ(0);
  }

  body.is-complete::before {
    background-image:
      linear-gradient(180deg, rgba(31, 15, 16, 0.04), rgba(46, 17, 20, 0.12)),
      url("assets/wedding-background.jpg");
  }

  .opening-scene {
    padding-right: 16px;
    padding-left: 16px;
  }

  .invitation-page {
    align-items: start;
    padding-top: max(16px, env(safe-area-inset-top));
    padding-right: 14px;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    padding-left: 14px;
  }

  .invitation-card {
    padding: clamp(80px, 20vw, 100px) clamp(40px, 12vw, 80px);
    border-color: rgba(198, 157, 86, 0.82);
    border-radius: 10px;
    background:
      linear-gradient(165deg, rgba(255, 250, 240, 0.48), rgba(248, 237, 215, 0.38)),
      repeating-linear-gradient(90deg, transparent 0 4px, rgba(113, 76, 37, 0.025) 4px 5px);
    box-shadow:
      0 22px 52px rgba(25, 8, 10, 0.38),
      inset 0 0 62px rgba(162, 118, 55, 0.09);
    -webkit-backdrop-filter: blur(5px) saturate(0.8) brightness(1.03);
    backdrop-filter: blur(5px) saturate(0.8) brightness(1.03);
  }

  .card-frame {
    inset: 11px;
    border-color: rgba(158, 112, 47, 0.62);
    box-shadow: inset 0 0 0 3px rgba(255, 250, 239, 0.32);
  }

  .card-corner--tr,
  .card-corner--tl {
    top: 11px;
  }

  .card-corner--br,
  .card-corner--bl {
    bottom: 11px;
  }

  .card-corner--tr,
  .card-corner--br {
    right: 11px;
  }

  .card-corner--tl,
  .card-corner--bl {
    left: 11px;
  }

  .card-content {
    text-shadow:
      0 1px 0 rgba(255, 255, 255, 0.9),
      0 0 18px rgba(255, 249, 238, 0.46);
  }

  .verse {
    color: #56381d;
  }

  .body-copy {
    color: #3f211f;
    font-weight: 600;
    line-height: 2.05;
  }

  .honor-line {
    color: #62421f;
  }

  .map-button {
    text-shadow: none;
  }
}

@media (max-width: 380px) {
  .envelope-trigger {
    width: 91vw;
  }

  .verse {
    font-size: 1rem;
  }

  .body-copy {
    font-size: 1rem;
  }

  .map-button {
    width: 100%;
    padding-right: 18px;
    padding-left: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
    transition-delay: 0ms !important;
  }

  .envelope-trigger:hover:not(:disabled),
  .map-button:hover {
    transform: none;
  }
}

@media print {
  body {
    background: #fff;
  }

  .ambient-glow,
  .opening-scene {
    display: none;
  }

  .invitation-page,
  .reveal-item {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
  }

  .invitation-page {
    padding: 0;
  }

  .invitation-card {
    box-shadow: none;
  }
}
