:root {
  color-scheme: light;
  --ink: #322722;
  --rust: #a74027;
  --serif: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background: #faf6ed;
  font-family: Arial, sans-serif;
}

.scene {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px;
  overflow: hidden;
  background: radial-gradient(ellipse at center, #ecd7be 0%, #f7ebd9 48%, #faf6ed 92%);
}

canvas {
  display: block;
  position: absolute;
  z-index: -1;
  inset: 0;
  width: 100%;
  height: 100%;
}

.letter {
  width: min(100%, 390px);
  padding: clamp(26px, 5vw, 45px) clamp(23px, 5vw, 42px);
  text-align: center;
  background: #fffbf1;
  border: 1px solid #bc876b;
  outline: 1px solid #e5cdb6;
  outline-offset: -8px;
  box-shadow: 0 12px 48px #71331928;
  animation: unfold .75s cubic-bezier(.2,.75,.35,1) both;
}

.letter-heart {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin: 0 auto 15px;
  border-radius: 50%;
  background: var(--rust);
  color: #fff5e9;
}

.letter h1 {
  margin: 0 auto 17px;
  font: 400 clamp(2.35rem, 6vw, 3.75rem)/.98 var(--serif);
  letter-spacing: -.055em;
}

.letter h1 em { display: block; color: var(--rust); }
.letter p { margin: 0; font-size: 1rem; line-height: 1.5; color: #675044; }
.letter .signoff { margin-top: 19px; font: italic 1.12rem/1.3 var(--serif); color: var(--rust); }
.signoff span { font-size: .78rem; }

@media (max-width: 520px) {
  .letter { width: min(82vw, 340px); }
}

@keyframes unfold {
  from { opacity: 0; transform: translateY(22px) scale(.9); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .letter { animation: none; }
}
