:root {
  --night: #100b1b;
  --wine: #3e1834;
  --rose: #ff7597;
  --blush: #ffd0d9;
  --paper: #fff8ee;
  --ink: #4f3041;
  --gold: #e6bf86;
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
  margin: 0;
  min-height: 100svh;
  overflow-x: hidden;
  color: var(--paper);
  background: var(--night);
  font-family: "Gowun Batang", serif;
}

button { font: inherit; }

.sky {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 112%, rgba(157, 52, 105, .56), transparent 44%),
    linear-gradient(155deg, #0d0917 0%, #25132e 54%, #4b1c3e 100%);
}

.sky::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .24;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.95' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.22'/%3E%3C/svg%3E");
  pointer-events: none;
}

.moon {
  position: absolute;
  top: 8%;
  right: 12%;
  width: 92px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #ffe9d1;
  box-shadow: 0 0 40px 12px rgba(255, 222, 190, .15);
  opacity: .84;
}

.moon::after {
  content: "";
  position: absolute;
  width: 90%;
  height: 90%;
  left: -18%;
  top: -12%;
  border-radius: 50%;
  background: #171020;
}

.star {
  position: absolute;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: #fff5ea;
  opacity: var(--opacity);
  animation: twinkle var(--speed) ease-in-out infinite alternate;
}

.glow {
  position: absolute;
  width: 34vw;
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(100px);
  opacity: .13;
}

.glow-one { left: -12%; top: 28%; background: #ff6b9a; }
.glow-two { right: -15%; bottom: -16%; background: #ffb15d; }

main {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  min-height: 100svh;
  padding: 48px 20px;
}

.love-letter {
  position: relative;
  width: min(92vw, 660px);
  padding: clamp(44px, 8vw, 76px) clamp(28px, 8vw, 80px) 36px;
  text-align: center;
  color: var(--ink);
  background:
    linear-gradient(rgba(255, 248, 238, .96), rgba(255, 248, 238, .96)),
    repeating-linear-gradient(0deg, transparent 0 27px, rgba(93, 48, 68, .08) 28px);
  border: 1px solid rgba(255, 255, 255, .65);
  border-radius: 2px;
  box-shadow: 0 32px 90px rgba(0, 0, 0, .42), 0 0 0 10px rgba(255, 255, 255, .025);
  transform: rotate(-.35deg);
  animation: letter-in 1s cubic-bezier(.2, .75, .25, 1) both;
}

.love-letter::before,
.love-letter::after {
  content: "";
  position: absolute;
  width: 70px;
  height: 2px;
  top: 31px;
  background: linear-gradient(90deg, transparent, var(--gold));
  opacity: .8;
}

.love-letter::before { left: 28px; }
.love-letter::after { right: 28px; transform: scaleX(-1); }

.eyebrow {
  margin: 0 0 28px;
  color: #916276;
  font-size: .74rem;
  letter-spacing: .2em;
}

.heart-seal {
  position: absolute;
  top: -27px;
  left: 50%;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  color: #ffdce4;
  background: linear-gradient(145deg, #b8305e, #751d43);
  border-radius: 50%;
  box-shadow: 0 7px 16px rgba(68, 14, 42, .35), inset 1px 1px 5px rgba(255,255,255,.25);
  transform: translateX(-50%);
}

.heart-seal span { transform: translateY(-1px); }

h1 { margin: 0; font-weight: 400; line-height: 1; }
h1 span { display: block; }

.line-small {
  margin-bottom: 16px;
  color: #6f4155;
  font-size: clamp(1.4rem, 4vw, 2rem);
}

.line-love {
  color: #9f2856;
  font-family: "Nanum Pen Script", cursive;
  font-size: clamp(3.6rem, 11vw, 6.4rem);
  letter-spacing: -.035em;
  text-shadow: 0 3px 0 rgba(134, 31, 73, .08);
}

.intro {
  margin: 30px 0 28px;
  color: #725064;
  font-size: clamp(.96rem, 2.7vw, 1.08rem);
  line-height: 1.95;
}

.promise-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 21px;
  color: #fff8f5;
  background: #9f2856;
  border: 1px solid #9f2856;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(159, 40, 86, .2);
  cursor: pointer;
  transition: transform .25s ease, box-shadow .25s ease, background .25s ease;
}

.promise-button:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(159, 40, 86, .28); }
.promise-button:focus-visible { outline: 3px solid rgba(159, 40, 86, .3); outline-offset: 4px; }
.button-heart { animation: heartbeat 1.6s ease-in-out infinite; }

.promise {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows .75s cubic-bezier(.2,.8,.2,1), opacity .55s ease, margin .6s ease;
}

.promise.open { grid-template-rows: 1fr; opacity: 1; margin-top: 27px; }
.promise-inner { overflow: hidden; }
.promise p { margin: 0 0 13px; color: #725064; font-size: .95rem; line-height: 1.9; }
.promise strong { display: block; color: #9f2856; font-size: 1.04rem; }
.signature { display: block; margin-top: 18px; color: #957082; font-family: "Nanum Pen Script", cursive; font-size: 1.35rem; }

.date {
  margin: 30px 0 0;
  color: #ad8e9a;
  font-size: .67rem;
  letter-spacing: .18em;
}

.hint {
  position: fixed;
  z-index: 2;
  right: 28px;
  bottom: 22px;
  color: rgba(255, 239, 239, .55);
  font-size: .68rem;
  letter-spacing: .15em;
}

.floating-heart {
  position: fixed;
  z-index: 3;
  left: var(--x);
  bottom: -30px;
  color: var(--color);
  font-size: var(--size);
  pointer-events: none;
  animation: float-heart var(--duration) ease-out forwards;
  filter: drop-shadow(0 3px 8px rgba(112, 19, 58, .3));
}

@keyframes letter-in {
  from { opacity: 0; transform: translateY(24px) rotate(-1.5deg) scale(.98); }
  to { opacity: 1; transform: translateY(0) rotate(-.35deg) scale(1); }
}

@keyframes twinkle { to { opacity: .15; transform: scale(.55); } }
@keyframes heartbeat { 0%, 100% { transform: scale(1); } 12% { transform: scale(1.24); } 24% { transform: scale(1); } }
@keyframes float-heart {
  0% { opacity: 0; transform: translateY(0) rotate(0) scale(.75); }
  12% { opacity: .9; }
  100% { opacity: 0; transform: translateY(-105vh) rotate(var(--rotate)) scale(1.3); }
}

@media (max-width: 560px) {
  main { padding: 52px 14px 34px; }
  .love-letter { padding-inline: 24px; }
  .moon { right: 5%; width: 70px; }
  .hint { display: none; }
  .love-letter::before, .love-letter::after { width: 40px; }
}

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