:root {
  --bg-top: #fffaf7;
  --bg-mid: #fde9e8;
  --bg-bottom: #f5d9df;
  --heart-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 464'%3E%3Cpath fill='white' d='M256 464c-13-11-26-22-38-31C92 332 12 267 12 159C12 93 62 45 126 45c48 0 97 27 130 71c33-44 82-71 130-71c64 0 114 48 114 114c0 108-80 173-206 274c-12 9-25 20-38 31Z'/%3E%3C/svg%3E");
  --panel: rgba(255, 251, 248, 0.74);
  --panel-border: rgba(143, 84, 102, 0.18);
  --card: #fffdfa;
  --ink-strong: #5e2840;
  --ink-soft: #866173;
  --ink-faint: #a68191;
  --rose: #cb7896;
  --rose-deep: #8f5466;
  --button-shadow: rgba(164, 98, 123, 0.25);
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  font-family: "Avenir Next", "Helvetica Neue", sans-serif;
  color: var(--ink-strong);
  background:
    radial-gradient(circle at 18% 14%, rgba(255, 255, 255, 0.95), transparent 22%),
    radial-gradient(circle at 82% 16%, rgba(255, 234, 239, 0.96), transparent 21%),
    radial-gradient(circle at 24% 84%, rgba(255, 224, 215, 0.88), transparent 18%),
    radial-gradient(circle at 78% 74%, rgba(250, 210, 221, 0.82), transparent 19%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-mid) 54%, var(--bg-bottom) 100%);
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  width: 20rem;
  height: 20rem;
  border-radius: 50%;
  filter: blur(20px);
  opacity: 0.7;
  pointer-events: none;
  z-index: 0;
}

body::before {
  top: -4rem;
  right: -4rem;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0));
}

body::after {
  bottom: -5rem;
  left: -5rem;
  background: radial-gradient(circle, rgba(255, 223, 214, 0.96), rgba(255, 223, 214, 0));
}

body > * {
  position: relative;
}

body::selection {
  background: rgba(203, 120, 150, 0.22);
}

button {
  font: inherit;
}

.app-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding:
    calc(2rem + env(safe-area-inset-top))
    1.25rem
    calc(2rem + env(safe-area-inset-bottom));
}

.home-panel {
  position: relative;
  width: min(100%, 28rem);
  padding: 2.3rem 1.7rem 2.25rem;
  border: 1px solid var(--panel-border);
  border-radius: 2.2rem;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.88), transparent 56%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 247, 244, 0.82)),
    var(--panel);
  backdrop-filter: blur(18px);
  box-shadow:
    0 1.5rem 3.4rem rgba(123, 71, 90, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    inset 0 -1.2rem 2.4rem rgba(255, 238, 241, 0.36);
  text-align: center;
  animation: rise-in 650ms ease both;
}

.home-panel::before {
  content: "";
  position: absolute;
  inset: 0.75rem;
  border: 1px solid rgba(244, 223, 198, 0.76);
  border-radius: 1.7rem;
  pointer-events: none;
}

.panel-glow {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
}

.panel-glow::before,
.panel-glow::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  opacity: 0.9;
}

.panel-glow::before {
  top: -3rem;
  right: -2.6rem;
  width: 10rem;
  height: 10rem;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0));
}

.panel-glow::after {
  bottom: -3rem;
  left: -2.8rem;
  width: 9rem;
  height: 9rem;
  background: radial-gradient(circle, rgba(248, 209, 217, 0.8), rgba(248, 209, 217, 0));
}

.eyebrow {
  position: relative;
  z-index: 1;
  margin: 0 0 0.4rem;
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--rose-deep);
}

.whisper {
  position: relative;
  z-index: 1;
  margin: 0 0 0.8rem;
  font-family: "Snell Roundhand", "Apple Chancery", "URW Chancery L", cursive;
  font-size: clamp(1.15rem, 5vw, 1.6rem);
  color: var(--ink-faint);
}

h1 {
  position: relative;
  z-index: 1;
  margin: 0;
  max-width: 12ch;
  margin-inline: auto;
  font-family: "Iowan Old Style", "Baskerville", "Georgia", serif;
  font-size: clamp(2.45rem, 9vw, 3.45rem);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: 0.02em;
  text-wrap: balance;
}

.primary-button,
.back-button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}

.primary-button {
  position: relative;
  z-index: 1;
  margin-top: 1.35rem;
  min-width: 15rem;
  padding: 1rem 1.55rem;
  color: #fffaf9;
  letter-spacing: 0.02em;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent 42%),
    linear-gradient(135deg, #dda0b4, var(--rose));
  box-shadow:
    0 1rem 2rem var(--button-shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 -0.3rem 0.8rem rgba(131, 67, 88, 0.18);
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.primary-button::before,
.primary-button::after {
  content: "";
  display: inline-block;
  width: 0.42rem;
  height: 0.42rem;
  position: relative;
  top: -0.08rem;
  border-radius: 50%;
  background: rgba(255, 250, 249, 0.9);
  box-shadow: 0 0 0 0.08rem rgba(255, 255, 255, 0.14);
  opacity: 0.9;
}

.primary-button::before {
  margin-right: 0.45rem;
}

.primary-button::after {
  margin-left: 0.45rem;
}

.primary-button:hover,
.primary-button:focus-visible {
  transform: translateY(-1px);
  box-shadow:
    0 1.25rem 2.1rem rgba(121, 63, 82, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.36);
  filter: saturate(1.03);
}

.primary-button:focus-visible,
.back-button:focus-visible {
  outline: 3px solid rgba(143, 84, 102, 0.2);
  outline-offset: 3px;
}

.home-note {
  position: relative;
  z-index: 1;
  margin: 1rem 0 0;
  max-width: 18rem;
  margin-inline: auto;
  font-size: 0.88rem;
  letter-spacing: 0.02em;
  color: var(--ink-faint);
}

.message-overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding:
    calc(1.2rem + env(safe-area-inset-top))
    1rem
    calc(1.25rem + env(safe-area-inset-bottom));
}

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

.overlay-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at center, rgba(255, 250, 246, 0.16), rgba(94, 40, 64, 0.26)),
    rgba(94, 40, 64, 0.2);
  backdrop-filter: blur(8px);
}

.message-dialog {
  position: relative;
  width: min(100%, 25rem);
  display: grid;
  justify-items: center;
  gap: 0.55rem;
  animation: card-in 260ms ease both;
}

.message-dialog__title {
  margin: 0;
  position: relative;
  padding-bottom: 0.65rem;
  font-family: "Iowan Old Style", "Baskerville", "Georgia", serif;
  font-size: 1.18rem;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: 0.03em;
  text-transform: none;
  color: rgba(143, 84, 102, 0.96);
  text-shadow: 0 1px 0 rgba(255, 250, 248, 0.8);
}

.message-dialog__title::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 7.25rem;
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, rgba(203, 120, 150, 0.7), transparent);
}

.message-card {
  position: relative;
  width: min(100%, 22.75rem);
  aspect-ratio: 512 / 544;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.78), transparent 48%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 246, 241, 0.9)),
    var(--card);
  overflow: hidden;
  box-shadow:
    0 1.8rem 3.4rem rgba(80, 33, 48, 0.22),
    0 0.5rem 1rem rgba(80, 33, 48, 0.12);
  -webkit-mask: var(--heart-mask) center / 100% 100% no-repeat;
  mask: var(--heart-mask) center / 100% 100% no-repeat;
}

.message-photo {
  position: absolute;
  inset: 0;
  background-position: 50% 24%;
  background-repeat: no-repeat;
  background-size: cover;
  opacity: 0.68;
  transform: scale(1.02);
}

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

.message-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 253, 252, 0.28), rgba(255, 245, 241, 0.55)),
    radial-gradient(circle at top, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0));
}

.message-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  box-shadow:
    inset 0 0 0 1.3px rgba(255, 244, 239, 0.72),
    inset 0 0 3rem rgba(255, 248, 245, 0.18);
  pointer-events: none;
}

.card-aura {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.card-aura::before,
.card-aura::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(8px);
}

.card-aura::before {
  top: -1.8rem;
  left: 50%;
  width: 12rem;
  height: 6rem;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(255, 239, 243, 0.7), rgba(255, 239, 243, 0));
}

.card-aura::after {
  bottom: 1.5rem;
  right: 2.5rem;
  width: 8rem;
  height: 8rem;
  background: radial-gradient(circle, rgba(255, 241, 229, 0.34), rgba(255, 241, 229, 0));
}

.message-card__content {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  align-content: stretch;
  justify-items: center;
  height: 100%;
  padding: 3.55rem 2.9rem 4.4rem;
  text-align: center;
  overflow: hidden;
}

.message-lines {
  display: grid;
  align-self: stretch;
  place-content: center;
  gap: 0.65rem;
  width: min(100%, 12.9rem);
  min-height: 0;
  margin-top: 0;
}

.message-line {
  display: inline-block;
  margin: 0;
  padding: 0;
  max-width: 100%;
  font-family: "Iowan Old Style", "Baskerville", "Georgia", serif;
  font-size: clamp(1.48rem, 6vw, 2.1rem);
  line-height: 1.22;
  color: var(--ink-strong);
  text-wrap: balance;
  overflow-wrap: anywhere;
  text-shadow:
    0 1px 0 rgba(255, 253, 252, 0.7),
    0 0 1.2rem rgba(255, 249, 245, 0.34);
}

.back-button {
  position: relative;
  z-index: 2;
  margin-bottom: 0.45rem;
  padding: 0.65rem 1rem;
  color: var(--rose-deep);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 243, 239, 0.92));
  box-shadow: 0 0.55rem 1rem rgba(145, 80, 102, 0.12);
}

.heart-ring {
  position: absolute;
  inset: 2.35rem 0 0;
  pointer-events: none;
}

.heart {
  position: absolute;
  width: 0.98rem;
  height: 0.98rem;
  background: linear-gradient(135deg, #ffd8e0, #d996ad);
  transform: rotate(-45deg);
  border-radius: 0.18rem;
  box-shadow: 0 0.55rem 0.85rem rgba(180, 120, 142, 0.18);
  opacity: 0.82;
}

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

.heart::before {
  top: -0.49rem;
  left: 0;
}

.heart::after {
  top: 0;
  left: 0.49rem;
}

.heart-1 { top: 2.7rem; left: 0.95rem; }
.heart-2 { top: 3rem; right: 1rem; }
.heart-3 { top: 8.15rem; right: 0.55rem; }
.heart-4 { right: 2rem; bottom: 1.1rem; }
.heart-5 { left: 1.95rem; bottom: 0.95rem; }
.heart-6 { top: 8.35rem; left: 0.45rem; }

.overlay-open .home-panel {
  filter: blur(2px);
}

@media (max-width: 480px) {
  .home-panel {
    padding: 2rem 1.2rem 2.05rem;
  }

  .message-dialog {
    width: min(100%, 22.8rem);
  }

  .message-dialog__title {
    padding-bottom: 0.55rem;
    font-size: 1.02rem;
    letter-spacing: 0.02em;
  }

  .back-button {
    margin-bottom: 0.35rem;
  }

  .message-card__content {
    padding: 3.15rem 2.25rem 3.85rem;
  }

  .message-lines {
    width: min(100%, 11.35rem);
    margin-top: 0;
  }

  .message-line {
    font-size: clamp(1.36rem, 6vw, 1.74rem);
  }

  .whisper {
    font-size: 1.28rem;
  }

  .home-note {
    max-width: 17rem;
    margin-inline: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
