:root {
  --paper: #fff8ec;
  --ink: #201615;
  --wine: #8f1d2c;
  --rose: #d84a5f;
  --gold: #e3b756;
  --blue: #183b56;
  --mist: rgba(255, 248, 236, 0.76);
  --shadow: 0 26px 80px rgba(32, 22, 21, 0.22);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #160f15;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  font-family: "Songti SC", "Noto Serif CJK SC", "SimSun", Georgia, serif;
  background:
    radial-gradient(circle at 18% 16%, rgba(216, 74, 95, 0.4), transparent 26rem),
    radial-gradient(circle at 86% 18%, rgba(227, 183, 86, 0.2), transparent 22rem),
    radial-gradient(circle at 62% 92%, rgba(24, 59, 86, 0.78), transparent 30rem),
    linear-gradient(140deg, #211019 0%, #3d1320 44%, #102333 100%);
}

#sky {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

body::before,
body::after {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  content: "";
}

body::before {
  opacity: 0.2;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.13) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
  background-size: 58px 58px;
  mask-image: radial-gradient(circle at center, black, transparent 78%);
}

body::after {
  opacity: 0.16;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.42'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.page-shell {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: clamp(24px, 4vw, 56px);
}

.hero {
  position: relative;
  display: grid;
  width: min(1120px, 100%);
  min-height: min(720px, calc(100vh - 56px));
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  align-items: center;
  gap: clamp(28px, 5vw, 72px);
}

.hero::before {
  position: absolute;
  top: 4%;
  right: 18%;
  width: clamp(92px, 13vw, 156px);
  aspect-ratio: 1;
  border-radius: 50%;
  content: "";
  background:
    radial-gradient(circle at 38% 34%, #fff5cf 0 18%, #f4d27f 42%, rgba(244, 210, 127, 0.02) 70%),
    radial-gradient(circle, rgba(255, 238, 188, 0.5), transparent 68%);
  box-shadow: 0 0 70px rgba(244, 210, 127, 0.38);
  opacity: 0.78;
}

.hero__copy {
  position: relative;
  color: var(--paper);
  text-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
  animation: rise 900ms ease both;
}

.hero__copy::after {
  display: block;
  width: min(260px, 54vw);
  height: 1px;
  margin-top: 36px;
  content: "";
  background: linear-gradient(90deg, rgba(255, 248, 236, 0.66), rgba(227, 183, 86, 0));
}

.eyebrow {
  width: fit-content;
  margin: 0 0 18px;
  padding: 7px 12px;
  border: 1px solid rgba(255, 248, 236, 0.42);
  color: #ffdf9e;
  font-size: clamp(0.82rem, 1.7vw, 0.96rem);
  letter-spacing: 0;
  background: rgba(255, 248, 236, 0.08);
  backdrop-filter: blur(12px);
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 9em;
  margin-bottom: 24px;
  font-family: "KaiTi", "STKaiti", "Songti SC", serif;
  font-size: clamp(3.1rem, 9vw, 7.4rem);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: 0;
}

.lead {
  max-width: 34rem;
  margin-bottom: 34px;
  color: rgba(255, 248, 236, 0.84);
  font-size: clamp(1.05rem, 2vw, 1.28rem);
  line-height: 1.9;
}

.keepsake {
  position: relative;
  min-height: 440px;
  padding: clamp(22px, 3vw, 38px);
  border: 1px solid rgba(255, 248, 236, 0.28);
  border-radius: 8px;
  box-shadow: var(--shadow);
  background:
    linear-gradient(90deg, rgba(143, 29, 44, 0.06) 1px, transparent 1px),
    linear-gradient(150deg, rgba(255, 248, 236, 0.94), rgba(255, 236, 213, 0.82)),
    url("assets/pressed-flower.svg") center 86% / 74% auto no-repeat;
  background-size: 28px 100%, auto, 74% auto;
  transform: rotate(2deg);
  animation: floatIn 1000ms 160ms ease both;
  transition: transform 360ms ease, box-shadow 360ms ease;
}

.keepsake:hover {
  box-shadow: 0 34px 100px rgba(32, 22, 21, 0.3);
  transform: translateY(-8px) rotate(1.2deg);
}

.keepsake::before,
.keepsake::after {
  position: absolute;
  content: "";
}

.keepsake::before {
  inset: 18px;
  border: 1px solid rgba(143, 29, 44, 0.22);
}

.keepsake::after {
  right: 26px;
  bottom: 24px;
  width: 86px;
  height: 86px;
  border: 1px solid rgba(143, 29, 44, 0.26);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(143, 29, 44, 0.1), transparent 58%);
}

.keepsake__seal {
  position: absolute;
  top: 34px;
  right: 34px;
  display: grid;
  width: 68px;
  height: 68px;
  place-items: center;
  border-radius: 50%;
  color: #fff2dc;
  font-family: "KaiTi", "STKaiti", serif;
  font-size: 1.45rem;
  background: radial-gradient(circle at 34% 28%, #e86a72, var(--wine) 68%);
  box-shadow: 0 14px 30px rgba(143, 29, 44, 0.32);
}

.keepsake__paper {
  position: relative;
  z-index: 1;
  max-width: 22rem;
  padding-top: 128px;
  color: #3b2522;
  font-size: clamp(1.1rem, 2.1vw, 1.45rem);
  line-height: 1.95;
}

.keepsake__paper p:first-child::first-letter {
  float: left;
  margin: 0.12em 0.12em 0 0;
  color: var(--wine);
  font-family: "KaiTi", "STKaiti", serif;
  font-size: 3.1em;
  line-height: 0.78;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.btn {
  position: relative;
  min-width: 128px;
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  padding: 13px 20px;
  color: var(--paper);
  font: 700 1rem/1.1 "Songti SC", "Noto Serif CJK SC", serif;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn--primary,
.btn--answer {
  background: linear-gradient(135deg, var(--rose), var(--wine));
  box-shadow: 0 14px 34px rgba(216, 74, 95, 0.32);
}

.btn--ghost {
  border: 1px solid rgba(255, 248, 236, 0.48);
  background: rgba(255, 248, 236, 0.08);
  backdrop-filter: blur(12px);
}

.btn--answer {
  margin-top: 12px;
  color: #fff8ec;
}

.letter {
  position: fixed;
  right: clamp(18px, 6vw, 86px);
  bottom: clamp(18px, 7vw, 92px);
  z-index: 2;
  width: min(470px, calc(100vw - 36px));
  padding: clamp(24px, 4vw, 42px);
  border: 1px solid rgba(143, 29, 44, 0.18);
  border-radius: 8px;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.36);
  background: var(--mist);
  backdrop-filter: blur(18px);
  transform: translateY(22px) scale(0.96);
  opacity: 0;
  pointer-events: none;
  transition: opacity 320ms ease, transform 320ms ease;
}

.letter::before {
  position: absolute;
  top: 14px;
  right: 14px;
  bottom: 14px;
  left: 14px;
  border: 1px solid rgba(227, 183, 86, 0.34);
  content: "";
  pointer-events: none;
}

.letter.is-open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.letter__date {
  margin-bottom: 12px;
  color: var(--wine);
  font-size: 0.9rem;
}

.letter h2 {
  margin-bottom: 16px;
  color: var(--wine);
  font-family: "KaiTi", "STKaiti", serif;
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  font-weight: 400;
}

.letter p {
  color: #33211f;
  font-size: 1.02rem;
  line-height: 1.9;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 5;
  width: min(92vw, 390px);
  padding: 14px 18px;
  border-radius: 8px;
  color: var(--paper);
  text-align: center;
  background: rgba(32, 22, 21, 0.78);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
  transform: translate(-50%, 28px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms ease, transform 240ms ease;
}

.toast.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

.petal {
  position: fixed;
  top: -24px;
  z-index: 3;
  width: 13px;
  height: 20px;
  border-radius: 70% 30% 70% 30%;
  background: linear-gradient(135deg, #ffb0b8, #cf3048);
  pointer-events: none;
  animation: petalFall var(--fall-duration, 4s) linear forwards;
}

.love-line {
  position: fixed;
  z-index: 4;
  max-width: min(72vw, 360px);
  padding: 10px 15px;
  border: 1px solid rgba(255, 248, 236, 0.48);
  border-radius: 999px;
  color: #fff8ec;
  font-size: clamp(0.9rem, 2.2vw, 1.12rem);
  line-height: 1.35;
  text-align: center;
  white-space: nowrap;
  background: linear-gradient(135deg, rgba(143, 29, 44, 0.78), rgba(32, 22, 21, 0.62));
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(14px);
  pointer-events: none;
  animation: loveLine 3.7s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes rise {
  from {
    transform: translateY(24px);
    opacity: 0;
  }
}

@keyframes floatIn {
  from {
    transform: translateY(32px) rotate(-1deg);
    opacity: 0;
  }
}

@keyframes petalFall {
  to {
    transform: translate3d(var(--drift, 80px), 110vh, 0) rotate(540deg);
    opacity: 0.2;
  }
}

@keyframes loveLine {
  0% {
    transform: translate3d(-50%, 22px, 0) scale(0.82);
    opacity: 0;
  }

  16% {
    opacity: 1;
  }

  74% {
    opacity: 1;
  }

  100% {
    transform: translate3d(calc(-50% + var(--sway, 0px)), var(--rise, -96px), 0) scale(1.04);
    opacity: 0;
  }
}

@media (max-width: 820px) {
  body {
    min-height: 100svh;
    background:
      radial-gradient(circle at 18% 10%, rgba(216, 74, 95, 0.42), transparent 18rem),
      radial-gradient(circle at 84% 8%, rgba(227, 183, 86, 0.18), transparent 15rem),
      linear-gradient(150deg, #211019 0%, #3d1320 48%, #102333 100%);
  }

  .page-shell {
    align-items: start;
    min-height: 100svh;
    padding: 18px 16px 28px;
  }

  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .hero::before {
    top: 10px;
    right: 10px;
    width: 86px;
    opacity: 0.48;
  }

  .hero__copy::after {
    margin-top: 22px;
  }

  .eyebrow {
    margin-bottom: 14px;
    padding: 6px 10px;
    font-size: 0.82rem;
  }

  h1 {
    max-width: 7.2em;
    margin-bottom: 16px;
    font-size: clamp(2.65rem, 15vw, 4.4rem);
    line-height: 1.02;
  }

  .lead {
    max-width: 21rem;
    margin-bottom: 20px;
    font-size: 1rem;
    line-height: 1.75;
  }

  .actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    gap: 10px;
  }

  .btn {
    min-width: 0;
    width: 100%;
    min-height: 46px;
    padding: 12px 14px;
    font-size: 0.96rem;
  }

  .keepsake {
    order: 3;
    min-height: 300px;
    padding: 20px;
    transform: none;
    background-position: center 92%;
    background-size: 24px 100%, auto, 86% auto;
  }

  .keepsake:hover {
    transform: translateY(-4px);
  }

  .keepsake::before {
    inset: 12px;
  }

  .keepsake__seal {
    top: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    font-size: 1.2rem;
  }

  .keepsake__paper {
    max-width: 18rem;
    padding-top: 82px;
    font-size: 1.04rem;
    line-height: 1.82;
  }

  .letter {
    position: fixed;
    right: 14px;
    bottom: 14px;
    left: 14px;
    width: auto;
    max-height: min(74svh, 560px);
    overflow-y: auto;
    padding: 24px 22px;
  }

  .letter h2 {
    font-size: 2.45rem;
  }

  .letter p {
    font-size: 0.98rem;
    line-height: 1.75;
  }

  .love-line {
    max-width: min(86vw, 320px);
    padding: 9px 13px;
    font-size: 0.92rem;
    white-space: normal;
  }
}

@media (max-width: 390px) {
  .page-shell {
    padding-inline: 12px;
  }

  h1 {
    font-size: clamp(2.35rem, 14vw, 3.5rem);
  }

  .actions {
    grid-template-columns: 1fr;
  }

  .keepsake {
    min-height: 280px;
  }

  .keepsake__paper {
    font-size: 0.98rem;
  }
}

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