:root {
  color-scheme: light;
  --ink: #44382f;
  --muted: #8d7467;
  --coral: #ee806e;
  --coral-dark: #dc6658;
  --cream: #fffaf0;
  --yellow: #ffc96c;
  --mint: #b9dec9;
  --paper: rgba(255, 253, 247, 0.88);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  background:
    radial-gradient(circle at 8% 13%, rgba(255, 255, 255, 0.95) 0 2px, transparent 3px),
    radial-gradient(circle at 90% 22%, rgba(255, 255, 255, 0.9) 0 3px, transparent 4px),
    linear-gradient(165deg, #fff8e7 0%, #ffefdf 52%, #ffe2dd 100%);
}

body::before,
body::after {
  position: fixed;
  z-index: -1;
  width: 40vw;
  height: 40vw;
  border-radius: 50%;
  content: "";
  filter: blur(12px);
  opacity: 0.45;
}

body::before {
  top: -20vw;
  left: -12vw;
  background: #ffdc94;
}

body::after {
  right: -18vw;
  bottom: -18vw;
  background: #f3bcbc;
}

button {
  font: inherit;
}

.sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.star {
  position: absolute;
  color: #e7a64f;
  animation: twinkle 2.8s ease-in-out infinite;
}

.star--1 { top: 9%; left: 8%; font-size: 1.5rem; }
.star--2 { top: 18%; right: 11%; font-size: 1.1rem; animation-delay: -1s; }
.star--3 { top: 52%; left: 7%; font-size: 1.7rem; animation-delay: -1.8s; }
.star--4 { top: 69%; right: 8%; font-size: 1.2rem; animation-delay: -0.7s; }
.star--5 { top: 88%; left: 16%; font-size: 1rem; animation-delay: -2.2s; }

main {
  width: min(92vw, 920px);
  margin: 0 auto;
  padding: 76px 0 36px;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(270px, 0.85fr) minmax(340px, 1.15fr);
  align-items: center;
  gap: 34px;
  min-height: 72vh;
}

.eyebrow {
  position: absolute;
  top: 0;
  left: 50%;
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  transform: translateX(-50%);
  white-space: nowrap;
}

.eyebrow span {
  color: var(--coral);
  font-size: 1.1rem;
}

.illustration {
  position: relative;
  min-height: 380px;
  animation: float 5s ease-in-out infinite;
}

.sun {
  position: absolute;
  top: 37px;
  left: 51%;
  width: 188px;
  height: 188px;
  border: 8px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  background: linear-gradient(145deg, #ffd982, #ffb963);
  box-shadow: 0 18px 42px rgba(224, 151, 62, 0.2);
  transform: translateX(-50%);
}

.sun::before {
  position: absolute;
  inset: -28px;
  border: 3px dashed rgba(237, 168, 79, 0.34);
  border-radius: 50%;
  content: "";
  animation: spin 22s linear infinite;
}

.sun__face,
.cloud__face {
  position: absolute;
  inset: 0;
}

.sun__face i,
.cloud__face i {
  position: absolute;
  width: 9px;
  height: 14px;
  border-radius: 50%;
  background: #71513d;
}

.sun__face i:first-child { top: 77px; left: 54px; }
.sun__face i:nth-child(2) { top: 77px; right: 54px; }
.sun__face b {
  position: absolute;
  top: 100px;
  left: 50%;
  width: 38px;
  height: 18px;
  border-bottom: 4px solid #71513d;
  border-radius: 0 0 50% 50%;
  transform: translateX(-50%);
}

.cloud {
  position: absolute;
  border-radius: 80px;
  background: #fffdfa;
  box-shadow: 0 18px 34px rgba(124, 91, 72, 0.11);
}

.cloud::before,
.cloud::after {
  position: absolute;
  border-radius: 50%;
  background: inherit;
  content: "";
}

.cloud--back {
  right: 10px;
  bottom: 118px;
  width: 125px;
  height: 48px;
  opacity: 0.78;
}

.cloud--back::before { top: -27px; left: 22px; width: 58px; height: 58px; }
.cloud--back::after { top: -15px; right: 15px; width: 43px; height: 43px; }

.cloud--front {
  bottom: 50px;
  left: 12px;
  width: 245px;
  height: 94px;
}

.cloud--front::before { top: -57px; left: 38px; width: 116px; height: 116px; }
.cloud--front::after { top: -35px; right: 30px; width: 84px; height: 84px; }

.cloud__face {
  z-index: 2;
}

.cloud__face i:first-child { top: 36px; left: 88px; }
.cloud__face i:nth-child(2) { top: 36px; right: 88px; }
.cloud__face b {
  position: absolute;
  top: 53px;
  left: 50%;
  width: 28px;
  height: 13px;
  border-bottom: 3px solid #71513d;
  border-radius: 0 0 50% 50%;
  transform: translateX(-50%);
}

.tiny-heart {
  position: absolute;
  color: #ef8e7f;
  font-size: 1.15rem;
  filter: drop-shadow(0 3px 4px rgba(214, 101, 86, 0.16));
  animation: heart-float 3s ease-in-out infinite;
}

.tiny-heart--one { top: 66px; left: 23px; transform: rotate(-16deg); }
.tiny-heart--two { top: 170px; right: 14px; animation-delay: -1.2s; }

.letter {
  position: relative;
  padding: 52px 48px 44px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 38px 38px 38px 8px;
  background: var(--paper);
  box-shadow: 0 30px 80px rgba(132, 92, 72, 0.14);
  backdrop-filter: blur(18px);
}

.letter::after {
  position: absolute;
  top: 24px;
  right: 28px;
  color: rgba(238, 128, 110, 0.13);
  content: "♡";
  font-family: Georgia, serif;
  font-size: 6rem;
  line-height: 1;
  transform: rotate(12deg);
}

.letter__hello,
.letter__body,
.letter h1,
.wish-button,
.button-hint {
  position: relative;
  z-index: 1;
}

.letter__hello {
  margin: 0 0 16px;
  color: var(--coral-dark);
  font-family: "KaiTi", "STKaiti", serif;
  font-size: 1.2rem;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-family: "KaiTi", "STKaiti", "Microsoft YaHei", serif;
  font-size: clamp(2rem, 4.1vw, 3.2rem);
  font-weight: 700;
  line-height: 1.32;
  letter-spacing: -0.04em;
}

h1 span {
  color: var(--coral-dark);
}

.letter__body {
  margin: 26px 0 30px;
  color: #79675d;
  font-size: 1rem;
  line-height: 2;
}

.wish-button,
.hug-button {
  cursor: pointer;
  border: 0;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.wish-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 8px 24px 8px 10px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #ef8a75, #e96d64);
  box-shadow: 0 12px 24px rgba(225, 99, 87, 0.25);
  font-weight: 800;
}

.wish-button__icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  color: #e16a5e;
  background: #fff2cf;
  font-size: 1.15rem;
}

.wish-button:hover,
.wish-button:focus-visible,
.hug-button:hover,
.hug-button:focus-visible {
  transform: translateY(-3px);
}

.wish-button:hover,
.wish-button:focus-visible {
  box-shadow: 0 17px 30px rgba(225, 99, 87, 0.32);
}

.wish-button:focus-visible,
.hug-button:focus-visible {
  outline: 3px solid rgba(74, 109, 91, 0.35);
  outline-offset: 4px;
}

.button-hint {
  margin: 12px 0 0 8px;
  color: #ae968a;
  font-size: 0.76rem;
}

.wish {
  position: relative;
  width: min(100%, 720px);
  max-height: 0;
  margin: 0 auto;
  padding: 0 28px;
  overflow: hidden;
  text-align: center;
  opacity: 0;
  transform: translateY(24px);
  transition: max-height 700ms ease, opacity 600ms ease, transform 600ms ease, padding 600ms ease;
}

.wish.is-open {
  max-height: 620px;
  padding: 58px 28px 46px;
  opacity: 1;
  transform: translateY(0);
}

.wish__glow {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: -1;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 207, 108, 0.25), transparent 68%);
  transform: translate(-50%, -50%);
}

.wish__label {
  margin: 0 0 17px;
  color: var(--coral-dark);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.22em;
}

.wish__message {
  margin: 0;
  font-family: "KaiTi", "STKaiti", serif;
  font-size: clamp(1.75rem, 5vw, 2.9rem);
  font-weight: 700;
  line-height: 1.55;
}

.wish__signature {
  display: block;
  width: min(100%, 570px);
  margin: 16px auto 0;
  padding-right: clamp(0px, 8vw, 72px);
  color: #9f6c60;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 0.48em;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: right;
}

.wish__tokens {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 28px 0;
  flex-wrap: wrap;
}

.wish__tokens span {
  padding: 8px 14px;
  border: 1px solid rgba(108, 151, 128, 0.28);
  border-radius: 999px;
  color: #567564;
  background: rgba(223, 244, 230, 0.62);
  font-size: 0.82rem;
  font-weight: 700;
}

.hug-button {
  padding: 13px 20px;
  border: 1px solid rgba(238, 128, 110, 0.28);
  border-radius: 999px;
  color: #a5554b;
  background: rgba(255, 255, 255, 0.72);
  font-weight: 700;
}

.hug-count {
  min-height: 22px;
  margin: 12px 0 0;
  color: #9f7a6e;
  font-size: 0.82rem;
}

footer {
  padding: 20px 16px 38px;
  color: #9f8175;
  text-align: center;
  font-size: 0.84rem;
  letter-spacing: 0.08em;
}

footer span {
  margin: 0 5px;
  color: var(--coral);
}

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

.confetti__piece {
  position: absolute;
  top: -32px;
  width: 10px;
  height: 16px;
  border-radius: 10px;
  animation: fall var(--duration) cubic-bezier(0.1, 0.4, 0.65, 1) forwards;
}

.pulse-heart {
  position: fixed;
  z-index: 11;
  color: var(--coral);
  pointer-events: none;
  animation: heart-pop 900ms ease-out forwards;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.35; transform: scale(0.85) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.15) rotate(18deg); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes heart-float {
  0%, 100% { margin-top: 0; opacity: 0.55; }
  50% { margin-top: -12px; opacity: 1; }
}

@keyframes fall {
  0% { opacity: 1; transform: translate3d(0, -5vh, 0) rotate(0); }
  100% { opacity: 0.25; transform: translate3d(var(--drift), 108vh, 0) rotate(var(--spin)); }
}

@keyframes heart-pop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.25); }
  35% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -140px) scale(1.4) rotate(var(--tilt)); }
}

@media (max-width: 760px) {
  main {
    width: min(91vw, 560px);
    padding-top: 64px;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .eyebrow {
    top: -8px;
  }

  .illustration {
    min-height: 280px;
    transform: scale(0.84);
    transform-origin: center bottom;
  }

  .letter {
    margin-top: -30px;
    padding: 38px 28px 34px;
    border-radius: 30px 30px 30px 7px;
  }

  .letter__body br {
    display: none;
  }

  .wish.is-open {
    padding-top: 50px;
  }
}

@media (max-width: 410px) {
  .illustration {
    margin-inline: -20px;
  }

  .letter {
    padding-inline: 22px;
  }

  h1 {
    font-size: 1.9rem;
  }

  .wish-button {
    width: 100%;
    justify-content: center;
  }

  .button-hint {
    text-align: center;
  }
}

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