:root {
  --burgundy: #7b0022;
  --burgundy-deep: #410013;
  --ivory: #fff8f0;
  --paper: #f7ecdf;
  --ink: #352823;
  --muted: #77675e;
  --gold: #c79a52;
  --blush: #eec7bd;
  --sky: #dce9ee;
  --sea: #48798b;
  --forest: #273d35;
  --shadow: 0 18px 45px rgba(54, 17, 16, 0.2);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(120deg, rgba(72, 121, 139, 0.18), rgba(123, 0, 34, 0.16)),
    #201817;
  font-family: Georgia, "Times New Roman", serif;
}

body.cover-active {
  overflow: hidden;
}

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

[hidden] {
  display: none !important;
}

.page-shell {
  min-height: 100vh;
  display: flex;
  justify-content: center;
}

.memory-site {
  width: min(100%, 520px);
  min-height: 100vh;
  overflow: hidden;
  background: var(--ivory);
  box-shadow: 0 0 70px rgba(0, 0, 0, 0.3);
}

section,
footer {
  position: relative;
  padding: 66px 24px;
}

.section-night {
  color: var(--ivory);
  background:
    radial-gradient(circle at 20% 12%, rgba(238, 199, 189, 0.16), transparent 25%),
    radial-gradient(circle at 82% 72%, rgba(72, 121, 139, 0.28), transparent 28%),
    linear-gradient(180deg, #251118, var(--burgundy-deep));
}

.section-burgundy {
  color: var(--ivory);
  background:
    radial-gradient(circle at 12% 8%, rgba(238, 199, 189, 0.12), transparent 24%),
    linear-gradient(180deg, var(--burgundy), var(--burgundy-deep));
}

.section-ivory {
  background:
    linear-gradient(135deg, rgba(199, 154, 82, 0.08), transparent 35%),
    var(--ivory);
}

.section-sky {
  color: #17303b;
  background:
    linear-gradient(180deg, #f6fbfb 0%, var(--sky) 48%, #eef4ef 100%);
}

.section-forest {
  color: var(--ivory);
  background:
    radial-gradient(circle at 85% 12%, rgba(199, 154, 82, 0.16), transparent 26%),
    linear-gradient(180deg, #315247, var(--forest));
}

.paper-top::before,
.paper-bottom::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 34px;
  background:
    linear-gradient(135deg, transparent 10px, var(--ivory) 0) 0 0 / 22px 22px,
    linear-gradient(225deg, transparent 10px, var(--ivory) 0) 0 0 / 22px 22px;
  pointer-events: none;
}

.paper-top::before {
  top: -1px;
  transform: rotate(180deg);
}

.paper-bottom::after {
  bottom: -33px;
  z-index: 2;
}

.reveal {
  opacity: 0;
  transform: translateY(28px) scale(0.985);
  transition: opacity 0.75s ease, transform 0.75s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.hero-section {
  min-height: 760px;
  padding: 0;
  display: grid;
  align-items: end;
}

.hero-photo,
.hero-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-photo {
  object-fit: cover;
}

.hero-overlay {
  background:
    linear-gradient(180deg, rgba(15, 14, 18, 0.1), rgba(35, 13, 24, 0.5) 42%, rgba(32, 0, 14, 0.9)),
    linear-gradient(90deg, rgba(0, 0, 0, 0.18), transparent 35%);
}

.hero-photo-frame {
  position: absolute;
  inset: 18px;
  z-index: 1;
  border: 2px solid rgba(255, 248, 240, 0.72);
  border-radius: 18px;
  box-shadow:
    inset 0 0 0 1px rgba(199, 154, 82, 0.68),
    inset 0 0 34px rgba(255, 248, 240, 0.14),
    0 18px 40px rgba(30, 0, 14, 0.22);
  pointer-events: none;
}

.hero-photo-frame::before,
.hero-photo-frame::after {
  content: "";
  position: absolute;
  inset: 11px;
  border: 1px solid rgba(255, 248, 240, 0.32);
  border-radius: 12px;
}

.hero-photo-frame::after {
  inset: auto 22px 24px;
  height: 1px;
  border: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 248, 240, 0.75), transparent);
}

.hero-photo-frame span {
  position: absolute;
  width: 18px;
  height: 18px;
  transform: rotate(45deg);
  background: var(--burgundy);
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.22));
}

.hero-photo-frame span::before,
.hero-photo-frame span::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: inherit;
}

.hero-photo-frame span::before {
  left: -9px;
}

.hero-photo-frame span::after {
  top: -9px;
}

.hero-photo-frame span:nth-child(1) {
  left: 18px;
  top: 18px;
}

.hero-photo-frame span:nth-child(2) {
  right: 18px;
  top: 18px;
  background: #e14f75;
}

.hero-photo-frame span:nth-child(3) {
  left: 18px;
  bottom: 18px;
  background: var(--gold);
}

.hero-photo-frame span:nth-child(4) {
  right: 18px;
  bottom: 18px;
}

.floating-stars span {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 18px rgba(255, 235, 186, 0.9);
  animation: drift 7s ease-in-out infinite;
}

.floating-stars span:nth-child(1) { left: 14%; top: 16%; animation-delay: -1s; }
.floating-stars span:nth-child(2) { left: 68%; top: 10%; animation-delay: -3s; }
.floating-stars span:nth-child(3) { left: 84%; top: 35%; animation-delay: -4s; }
.floating-stars span:nth-child(4) { left: 24%; top: 48%; animation-delay: -2s; }
.floating-stars span:nth-child(5) { left: 52%; top: 27%; animation-delay: -5s; }

@keyframes drift {
  0%, 100% { transform: translate3d(0, 0, 0); opacity: 0.45; }
  50% { transform: translate3d(8px, -14px, 0); opacity: 1; }
}

.hero-copy {
  position: relative;
  z-index: 2;
  padding: 0 24px 56px;
  text-align: center;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
}

.kicker,
.date-line {
  margin: 0;
  color: var(--blush);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.section-sky .kicker,
.section-ivory .kicker {
  color: var(--burgundy);
}

h1,
h2 {
  font-family: "Brush Script MT", "Segoe Script", Georgia, serif;
  font-weight: 400;
  letter-spacing: 0;
}

h1 {
  max-width: 100%;
  margin: 10px auto 12px;
  font-size: clamp(3.1rem, 14vw, 5.6rem);
  line-height: 0.86;
  text-shadow: 0 6px 28px rgba(0, 0, 0, 0.35);
  overflow-wrap: normal;
}

h1 small {
  display: block;
  margin-top: 14px;
  font-family: inherit;
  font-size: clamp(2.75rem, 12vw, 4.9rem);
  line-height: 0.88;
  color: var(--ivory);
  text-transform: none;
  letter-spacing: 0;
}

h2 {
  margin: 0 0 22px;
  font-size: clamp(2.7rem, 14vw, 4.6rem);
  line-height: 0.92;
  text-align: center;
}

p {
  font-size: 1.12rem;
  line-height: 1.65;
}

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

.letter-section {
  padding-top: 78px;
  text-align: center;
}

.letter-copy p {
  max-width: 29rem;
  margin: 18px auto 0;
  color: #6d5148;
}

.flower-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
}

.flower-row span {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 38%, #f8e5d9 0 18%, transparent 19%),
    radial-gradient(circle at 35% 52%, var(--blush) 0 20%, transparent 21%),
    radial-gradient(circle at 64% 52%, #f7ddd5 0 20%, transparent 21%),
    radial-gradient(circle at 50% 68%, #f4c9bf 0 20%, transparent 21%);
  box-shadow: 0 5px 12px rgba(120, 0, 31, 0.16);
}

.flower-row span:nth-child(2n) {
  background:
    radial-gradient(circle at 50% 38%, #fff5ea 0 18%, transparent 19%),
    radial-gradient(circle at 35% 52%, #f8efe4 0 20%, transparent 21%),
    radial-gradient(circle at 64% 52%, #ead7bd 0 20%, transparent 21%),
    radial-gradient(circle at 50% 68%, #fff8f0 0 20%, transparent 21%);
}

.journey-section {
  --journey-progress: 0;
  min-height: 860px;
  padding-top: 82px;
}

.journey-map {
  margin: 30px auto 22px;
}

.map-card {
  position: relative;
  overflow: hidden;
  min-height: 470px;
  border: 1px solid rgba(72, 121, 139, 0.22);
  border-radius: 8px;
  background: #dff1ee;
  box-shadow: 0 22px 48px rgba(33, 62, 71, 0.16);
}

.map-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.cloud {
  fill: rgba(255, 255, 255, 0.68);
}

.land {
  fill: #d6c594;
  filter: url("#softMapShadow");
  stroke: rgba(91, 112, 76, 0.22);
  stroke-width: 2;
}

.europe {
  fill: #cbd8a5;
}

.africa {
  fill: #d8bd83;
}

.middle-east {
  fill: #d0bf8a;
}

.country {
  fill: var(--burgundy);
  stroke: #fff4df;
  stroke-width: 3;
  filter: drop-shadow(0 8px 10px rgba(70, 0, 21, 0.22));
}

.flight-shadow,
.flight-line {
  fill: none;
  stroke-linecap: round;
}

.flight-shadow {
  stroke: rgba(45, 55, 61, 0.2);
  stroke-width: 14;
}

.flight-line {
  stroke: var(--burgundy);
  stroke-width: 5;
  stroke-dasharray: 220;
  stroke-dashoffset: calc(220 - (220 * var(--journey-progress)));
  filter: drop-shadow(0 7px 10px rgba(123, 0, 34, 0.2));
}

.map-pin {
  position: absolute;
  z-index: 3;
  min-width: 112px;
  border: 1px solid rgba(123, 0, 34, 0.18);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(255, 248, 240, 0.9);
  box-shadow: 0 12px 26px rgba(35, 63, 72, 0.15);
}

.map-pin::before {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--burgundy);
  box-shadow: 0 0 0 7px rgba(123, 0, 34, 0.14);
}

.uk-pin {
  left: 16px;
  top: 72px;
}

.uk-pin::before {
  right: -28px;
  top: 29px;
}

.libya-pin {
  right: 14px;
  bottom: 82px;
}

.libya-pin::before {
  left: -24px;
  top: 28px;
}

.map-pin strong {
  display: block;
  color: var(--burgundy);
  font: 700 0.78rem/1 Arial, sans-serif;
  letter-spacing: 0.12em;
}

.map-pin span {
  display: block;
  margin-top: 6px;
  color: #49616b;
  font-size: 0.88rem;
  line-height: 1.25;
}

.flight-plane {
  position: absolute;
  z-index: 4;
  left: calc(37% + (20% * var(--journey-progress)));
  top: calc(24% + (39% * var(--journey-progress)));
  width: 52px;
  height: 34px;
  transform: translate(-50%, -50%) rotate(calc(38deg + (13deg * var(--journey-progress))));
  filter: drop-shadow(0 8px 12px rgba(31, 48, 54, 0.34));
}

.flight-plane::before {
  content: "";
  position: absolute;
  inset: 0;
  clip-path: polygon(0 44%, 100% 0, 70% 50%, 100% 100%);
  background: linear-gradient(90deg, #fff8df, #d8a24f);
}

.flight-plane::after {
  content: "";
  position: absolute;
  left: 12px;
  top: 14px;
  width: 20px;
  height: 7px;
  border-radius: 999px;
  background: rgba(123, 0, 34, 0.34);
}

.flight-heart {
  position: absolute;
  z-index: 3;
  left: calc(35% + (22% * var(--journey-progress)));
  top: calc(29% + (34% * var(--journey-progress)));
  width: 16px;
  height: 16px;
  transform: rotate(45deg) scale(calc(0.7 + var(--journey-progress) * 0.45));
  background: var(--burgundy);
  box-shadow: 0 0 0 8px rgba(123, 0, 34, 0.08);
}

.flight-heart::before,
.flight-heart::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--burgundy);
}

.flight-heart::before {
  left: -8px;
}

.flight-heart::after {
  top: -8px;
}

.map-caption {
  display: grid;
  grid-template-columns: 1fr 44px 1fr;
  align-items: center;
  gap: 12px;
  margin: 14px 6px 0;
  color: #405a63;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
}

.map-caption b {
  display: block;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--burgundy), transparent);
}

.journey-notes {
  display: grid;
  gap: 12px;
}

.journey-notes article,
.promise-grid article {
  border: 1px solid rgba(199, 154, 82, 0.38);
  border-radius: 8px;
  padding: 18px;
  background: rgba(255, 248, 240, 0.72);
  box-shadow: 0 12px 28px rgba(53, 40, 35, 0.08);
}

.journey-notes span,
.promise-grid span,
.timeline span {
  display: block;
  margin-bottom: 8px;
  color: var(--burgundy);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.journey-notes p,
.promise-grid p {
  margin: 0;
  color: #514640;
}

.memory-timeline {
  padding-top: 96px;
  padding-bottom: 94px;
}

.memory-timeline h2,
.promise-section h2,
.final-section h2 {
  color: var(--ivory);
}

.timeline {
  position: relative;
  width: min(100%, 380px);
  margin: 38px auto 0;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 38px;
  top: 4px;
  bottom: 8px;
  width: 1px;
  background: rgba(255, 248, 240, 0.42);
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 18px;
  min-height: 118px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: 33px;
  top: 10px;
  width: 11px;
  height: 11px;
  transform: rotate(45deg);
  background: var(--ivory);
  box-shadow: 0 0 0 7px rgba(199, 154, 82, 0.18);
}

.timeline time {
  color: var(--ivory);
  font-size: 1.5rem;
}

.timeline p {
  margin: 0;
  color: var(--ivory);
  font-size: 1.08rem;
  line-height: 1.25;
}

.timeline span {
  color: rgba(255, 248, 240, 0.7);
  letter-spacing: 0.04em;
  text-transform: none;
  font-size: 0.95rem;
  line-height: 1.45;
}

.gallery-section {
  padding-top: 82px;
}

.photo-stack {
  display: grid;
  gap: 18px;
}

figure {
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(199, 154, 82, 0.45);
  border-radius: 8px;
  box-shadow: var(--shadow);
  background: var(--paper);
}

figure img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 0.78;
  object-fit: cover;
}

.featured-memory img {
  aspect-ratio: 4 / 5;
  object-position: center top;
}

.portrait-memory img {
  aspect-ratio: 4 / 5;
  object-position: center top;
}

.full-memory img {
  aspect-ratio: auto;
  height: auto;
  object-fit: contain;
  object-position: center center;
  background: linear-gradient(180deg, rgba(255, 248, 240, 0.92), rgba(247, 236, 223, 0.98));
}

figcaption {
  padding: 14px 16px 18px;
  color: #6d5148;
  font-size: 0.98rem;
  line-height: 1.45;
}

.promise-section {
  padding-bottom: 72px;
}

.promise-grid {
  display: grid;
  gap: 14px;
  margin-top: 30px;
}

.promise-grid article {
  background: rgba(255, 248, 240, 0.09);
  border-color: rgba(255, 248, 240, 0.18);
}

.promise-grid span {
  color: var(--blush);
}

.promise-grid p {
  color: var(--ivory);
}

.rsvp-section {
  text-align: center;
}

.rsvp-section p {
  max-width: 22rem;
  margin: 0 auto 16px;
  color: var(--muted);
}

.primary-button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--gold);
  border-radius: 999px;
  padding: 0 24px;
  color: var(--ivory);
  background: var(--burgundy);
  font: 700 0.8rem/1 Arial, sans-serif;
  letter-spacing: 0.12em;
  text-decoration: none;
  text-transform: uppercase;
  box-shadow: 0 10px 24px rgba(120, 0, 31, 0.18);
  cursor: pointer;
}

.final-section {
  min-height: 660px;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
  overflow: hidden;
  padding: 74px 28px;
  background: #fff8f0;
}

.final-floral-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.final-section::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 248, 240, 0.86) 0 28%, rgba(255, 248, 240, 0.58) 42%, rgba(255, 248, 240, 0.1) 66%),
    linear-gradient(180deg, rgba(65, 0, 19, 0.04), rgba(65, 0, 19, 0.16));
}

.final-copy {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 18px;
  width: min(100%, 390px);
  padding: 44px 18px 34px;
}

.final-section p {
  max-width: 23rem;
  margin: 0 auto;
  color: var(--burgundy-deep);
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  font-size: clamp(1.45rem, 7vw, 2rem);
  font-weight: 600;
  line-height: 1.85;
  text-shadow: 0 2px 14px rgba(255, 248, 240, 0.88);
}

.final-section h2 {
  margin: 0;
  color: var(--burgundy);
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  font-size: clamp(2rem, 9vw, 3rem);
  font-weight: 800;
  line-height: 1.35;
  text-shadow: 0 3px 16px rgba(255, 248, 240, 0.92);
}

.cover {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background:
    linear-gradient(145deg, rgba(70, 48, 44, 0.08), transparent 28%),
    linear-gradient(35deg, transparent 48%, rgba(120, 0, 31, 0.08) 49%, rgba(120, 0, 31, 0.08) 51%, transparent 52%),
    linear-gradient(145deg, transparent 48%, rgba(72, 121, 139, 0.08) 49%, rgba(72, 121, 139, 0.08) 51%, transparent 52%),
    var(--paper);
  transition: opacity 0.7s ease, visibility 0.7s ease;
}

.cover::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.24;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(53, 40, 35, 0.4) 0 1px, transparent 1px),
    radial-gradient(circle at 80% 70%, rgba(53, 40, 35, 0.3) 0 1px, transparent 1px);
  background-size: 38px 42px, 57px 61px;
}

.cover.is-open {
  opacity: 0;
  visibility: hidden;
}

.envelope-button {
  position: relative;
  z-index: 1;
  width: min(100vw, 520px);
  height: 100vh;
  min-height: 620px;
  border: 0;
  color: var(--burgundy);
  background: transparent;
  cursor: pointer;
  font: inherit;
  perspective: 900px;
}

.mail-scene {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(86vw, 390px);
  height: 360px;
  transform: translate(-50%, -50%);
}

.mail-envelope {
  position: absolute;
  left: 50%;
  bottom: 22px;
  z-index: 4;
  width: min(82vw, 350px);
  height: 214px;
  transform: translateX(-50%);
}

.envelope-back,
.envelope-front {
  position: absolute;
  inset: 0;
  border: 2px solid rgba(92, 65, 52, 0.74);
  border-radius: 3px;
  background: linear-gradient(180deg, #fffdf8, #f6eadc);
  box-shadow: 0 20px 34px rgba(65, 42, 35, 0.18);
}

.envelope-back {
  z-index: 1;
}

.envelope-front {
  top: 66px;
  z-index: 5;
  height: 148px;
  overflow: hidden;
  background:
    linear-gradient(38deg, transparent 49%, rgba(92, 65, 52, 0.5) 50%, transparent 51%),
    linear-gradient(142deg, transparent 49%, rgba(92, 65, 52, 0.5) 50%, transparent 51%),
    linear-gradient(180deg, #fff9f0, #efe0cf);
}

.letter-panel {
  position: absolute;
  left: 50%;
  bottom: 92px;
  z-index: 2;
  width: min(70vw, 286px);
  height: 168px;
  border: 2px solid rgba(92, 65, 52, 0.62);
  border-radius: 4px;
  transform: translateX(-50%) translateY(78px) rotate(-1deg);
  transform-origin: center bottom;
  background:
    radial-gradient(circle at 26% 20%, rgba(184, 0, 52, 0.08) 0 14px, transparent 15px),
    radial-gradient(circle at 74% 31%, rgba(225, 79, 117, 0.08) 0 11px, transparent 12px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 248, 240, 0.98)),
    repeating-linear-gradient(0deg, transparent 0 28px, rgba(123, 0, 34, 0.08) 29px 30px);
  box-shadow: 0 18px 40px rgba(65, 42, 35, 0.16);
  opacity: 0.96;
  transition: transform 1s cubic-bezier(0.16, 0.88, 0.2, 1), opacity 0.5s ease;
}

.letter-panel::before {
  content: "♥";
  position: absolute;
  left: 50%;
  top: 24px;
  color: var(--burgundy);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.45rem;
  line-height: 1;
  transform: translateX(-50%);
  text-shadow: 0 6px 14px rgba(123, 0, 34, 0.14);
}

.letter-heart {
  position: absolute;
  color: #e14f75;
  font-size: 1.25rem;
  line-height: 1;
}

.letter-heart-one {
  right: 32px;
  top: 44px;
  transform: rotate(12deg);
}

.letter-heart-two {
  left: 32px;
  bottom: 22px;
  color: var(--gold);
  transform: rotate(-14deg);
}

.letter-line {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  top: 92px;
  height: 2px;
  border-radius: 999px;
  background: rgba(123, 0, 34, 0.16);
}

.letter-line-short {
  top: 114px;
  right: 34%;
}

.envelope-flap {
  position: absolute;
  background: linear-gradient(135deg, #fff9f1, #ead9c6);
  filter: drop-shadow(0 2px 8px rgba(65, 42, 35, 0.12));
  transition: transform 0.95s cubic-bezier(0.17, 0.84, 0.25, 1), opacity 0.45s ease;
}

.envelope-flap-top {
  left: 0;
  top: 0;
  z-index: 6;
  width: 100%;
  height: 118px;
  transform-origin: center top;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  border-top: 2px solid rgba(92, 65, 52, 0.74);
}

.envelope-flap-bottom {
  left: 0;
  bottom: 0;
  z-index: 6;
  width: 100%;
  height: 150px;
  transform-origin: center bottom;
  clip-path: polygon(0 100%, 100% 100%, 50% 0);
  background: linear-gradient(180deg, #fff4e8, #ead8c4);
}

.envelope-flap-left,
.envelope-flap-right {
  bottom: 0;
  z-index: 6;
  width: 50%;
  height: 148px;
}

.envelope-flap-left {
  left: 0;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
  background: linear-gradient(150deg, #fffaf4, #ecdecd);
}

.envelope-flap-right {
  right: 0;
  clip-path: polygon(100% 0, 0 50%, 100% 100%);
  background: linear-gradient(210deg, #fffaf4, #ecdecd);
}

.heart-seal {
  position: absolute;
  left: 50%;
  top: 68%;
  z-index: 8;
  width: 126px;
  height: 126px;
  transform: translate(-50%, -50%) rotate(45deg);
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 18px 18px 10px 18px;
  background:
    radial-gradient(circle at 33% 30%, rgba(255, 255, 255, 0.28), transparent 22%),
    linear-gradient(135deg, #b80034, var(--burgundy));
  box-shadow:
    inset 0 8px 24px rgba(255, 255, 255, 0.16),
    inset 0 -10px 20px rgba(67, 0, 20, 0.2),
    0 14px 32px rgba(74, 0, 21, 0.24);
  animation: heartPulse 1.8s ease-in-out infinite;
  transition: opacity 0.4s ease, transform 0.6s ease;
}

.heart-seal::before,
.heart-seal::after {
  content: "";
  position: absolute;
  width: 126px;
  height: 126px;
  border-radius: 50%;
  background: inherit;
}

.heart-seal::before {
  left: -63px;
}

.heart-seal::after {
  top: -63px;
}

.heart-seal span {
  position: relative;
  z-index: 2;
  display: grid;
  width: 96px;
  height: 96px;
  place-items: center;
  color: var(--ivory);
  font-family: Georgia, "Times New Roman", serif;
  font-style: normal;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
  transform: rotate(-45deg);
}

.cover.is-opening .envelope-flap-top {
  transform: rotateX(154deg);
  opacity: 0.9;
  z-index: 2;
}

.cover.is-opening .envelope-flap-bottom {
  transform: translateY(10px);
  opacity: 0.92;
}

.cover.is-opening .letter-panel {
  transform: translateX(-50%) translate(44px, -82px) rotate(6deg);
  opacity: 1;
  z-index: 7;
}

.cover.is-opening .heart-seal {
  animation: none;
  transform: translate(-50%, -50%) rotate(45deg) scale(0.64);
  opacity: 0;
}

@keyframes heartPulse {
  0%, 100% {
    transform: translate(-50%, -50%) rotate(45deg) scale(1);
  }

  50% {
    transform: translate(-50%, -50%) rotate(45deg) scale(1.06);
  }
}

.heart-confetti {
  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  overflow: hidden;
}

.confetti-heart {
  position: absolute;
  left: var(--start-x);
  top: var(--start-y);
  color: var(--burgundy);
  font-size: var(--size);
  line-height: 1;
  opacity: 0;
  transform: translate(-50%, -50%) scale(var(--scale));
  animation: heartConfetti var(--duration) ease-out var(--delay) forwards;
  text-shadow: 0 4px 12px rgba(123, 0, 34, 0.18);
}

.confetti-heart:nth-child(3n) {
  color: #e14f75;
}

.confetti-heart:nth-child(4n) {
  color: var(--gold);
}

@keyframes heartConfetti {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.35) rotate(0deg);
  }

  12% {
    opacity: 1;
  }

  70% {
    opacity: 0.95;
  }

  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--drift)), calc(-50% - var(--rise))) scale(var(--scale)) rotate(320deg);
  }
}

.youtube-music,
#youtubeMusic {
  position: fixed;
  left: -20px;
  bottom: -20px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.music-toggle {
  position: fixed;
  right: max(16px, calc((100vw - 520px) / 2 + 18px));
  bottom: 18px;
  z-index: 15;
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--ivory);
  background: var(--burgundy);
  box-shadow: 0 10px 28px rgba(54, 0, 14, 0.32);
  cursor: pointer;
}

.pause-icon,
.play-icon {
  position: absolute;
}

.pause-icon {
  width: 20px;
  height: 24px;
  border-left: 7px solid currentColor;
  border-right: 7px solid currentColor;
}

.play-icon {
  display: none;
  width: 0;
  height: 0;
  margin-left: 4px;
  border-top: 14px solid transparent;
  border-bottom: 14px solid transparent;
  border-left: 22px solid currentColor;
}

.music-toggle.is-paused .pause-icon {
  display: none;
}

.music-toggle.is-paused .play-icon {
  display: block;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(30, 13, 12, 0.58);
}

.modal-card {
  position: relative;
  width: min(100%, 420px);
  border-radius: 8px;
  padding: 34px 24px;
  text-align: center;
  background: var(--ivory);
  box-shadow: var(--shadow);
}

.modal-card h2 {
  color: var(--burgundy);
}

.modal-card p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.modal-close::before,
.modal-close::after {
  content: "";
  position: absolute;
  left: 10px;
  top: 17px;
  width: 16px;
  height: 2px;
  background: var(--burgundy);
}

.modal-close::before {
  transform: rotate(45deg);
}

.modal-close::after {
  transform: rotate(-45deg);
}

@media (min-width: 680px) {
  .memory-site {
    margin: 24px 0;
    border-radius: 8px;
  }

  .hero-section {
    min-height: 790px;
  }

  .photo-stack {
    grid-template-columns: 1fr 1fr;
  }

  figure img {
    height: 320px;
  }

  .full-memory img {
    height: auto;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
