:root {
  --bg-top: #778e81;
  --bg-mid: #314a3f;
  --bg-bottom: #132019;
  --surface: rgba(236, 244, 233, 0.11);
  --surface-strong: rgba(245, 249, 242, 0.18);
  --border-soft: rgba(252, 255, 250, 0.18);
  --text-main: #f8faf5;
  --text-soft: rgba(248, 250, 245, 0.8);
  --text-muted: rgba(228, 236, 223, 0.62);
  --accent: #e2efd6;
  --accent-deep: #9ec193;
  --glow: rgba(226, 239, 214, 0.28);
  --shadow: 0 28px 72px rgba(7, 16, 11, 0.32);
  --radius-lg: 28px;
  --radius-md: 22px;
  --max-width: 540px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text-main);
  background:
    radial-gradient(circle at 50% -6%, rgba(255, 251, 231, 0.22), transparent 24%),
    radial-gradient(circle at 50% 120%, rgba(147, 187, 132, 0.22), transparent 30%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-mid) 42%, var(--bg-bottom) 100%);
  font-family:
    "Iowan Old Style",
    "Palatino Linotype",
    "Book Antiqua",
    "Times New Roman",
    "PingFang SC",
    serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 16% 18%, rgba(255, 255, 255, 0.08), transparent 14%),
    radial-gradient(circle at 84% 12%, rgba(255, 255, 255, 0.05), transparent 12%),
    radial-gradient(circle at 50% 88%, rgba(217, 234, 207, 0.1), transparent 24%);
}

.page-shell {
  opacity: 0;
}

.page-shell.is-ready {
  opacity: 1;
  transition: opacity 600ms ease;
}

.music-float {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 20;
  width: min(280px, calc(100vw - 32px));
  padding: 14px 14px 12px;
  display: grid;
  gap: 10px;
  border: 1px solid rgba(252, 255, 250, 0.18);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
    rgba(20, 33, 26, 0.76);
  box-shadow: 0 18px 40px rgba(7, 16, 11, 0.32);
  backdrop-filter: blur(16px);
}

.music-float.is-hidden {
  display: none;
}

.music-dock {
  position: fixed;
  right: 16px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 20;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(226, 239, 214, 0.24);
  border-radius: 999px;
  background: rgba(20, 33, 26, 0.76);
  color: var(--text-main);
  font: inherit;
  box-shadow: 0 16px 30px rgba(7, 16, 11, 0.24);
  backdrop-filter: blur(14px);
}

.music-meta {
  display: grid;
  gap: 4px;
}

.music-title,
.music-status {
  margin: 0;
}

.music-title {
  font-size: 0.98rem;
  color: var(--text-main);
}

.music-status {
  font-size: 0.82rem;
  color: var(--text-soft);
}

.music-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.music-toggle,
.music-close {
  border: 1px solid rgba(226, 239, 214, 0.26);
  color: var(--text-main);
  font: inherit;
}

.music-toggle {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 248, 228, 0.14), rgba(216, 233, 207, 0.1));
}

.music-close {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
}

.page {
  min-height: 100vh;
}

.panel {
  position: relative;
  min-height: 100svh;
  padding:
    calc(28px + env(safe-area-inset-top))
    20px
    calc(42px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  overflow: hidden;
}

.hero-copy,
.section-heading,
.letter-card,
.section-copy,
.rabbit-cards,
.voucher-strip,
.closing-card {
  width: min(100%, var(--max-width));
  margin: 0 auto;
}

.section-heading {
  display: grid;
  gap: 10px;
}

.hero-note {
  color: var(--accent);
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.section-tag,
.eyebrow,
.voucher-kicker {
  margin: 0;
  color: var(--accent);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.panel h1,
.panel h2,
.panel h3,
.panel p {
  margin: 0;
}

.panel h1 {
  max-width: 6ch;
  display: grid;
  gap: 6px;
  font-size: clamp(3.2rem, 12vw, 5.4rem);
  line-height: 0.9;
  letter-spacing: -0.05em;
  text-shadow: 0 0 24px rgba(255, 251, 232, 0.12);
}

.panel h2 {
  font-size: clamp(1.9rem, 7vw, 3rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
}

.panel h3 {
  font-size: 1.25rem;
  line-height: 1.15;
}

.lede,
.section-copy,
.letter-card p,
.voucher p,
.voucher-foot,
.closing-line,
.signoff,
.secret-message,
.rabbit-card p {
  font-size: 1.05rem;
  line-height: 1.8;
}

.lede,
.section-copy,
.signoff,
.hint {
  color: var(--text-soft);
}

.hint {
  font-size: 0.98rem;
  padding-top: 12px;
}

.pet-name {
  color: var(--accent);
}

.panel-hero {
  justify-content: flex-end;
}

.hero-copy {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 20px;
  padding-bottom: 10svh;
  padding-top: 18px;
}

.hero-copy::before {
  content: "";
  position: absolute;
  inset: -26px -18px -20px -18px;
  z-index: -1;
  border-radius: 32px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0)),
    radial-gradient(circle at 50% 24%, rgba(255, 248, 228, 0.1), transparent 48%);
  filter: blur(3px);
}

.sky-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.sky-layer-moon {
  inset: auto auto 62% 50%;
  width: 200px;
  height: 200px;
  margin-left: -100px;
  border-radius: 999px;
  background:
    radial-gradient(circle, rgba(255, 249, 223, 0.88) 0 18%, rgba(255, 249, 223, 0.12) 45%, transparent 66%);
  filter: blur(4px);
  opacity: 0.85;
  box-shadow: 0 0 120px rgba(255, 245, 212, 0.16);
}

.sky-layer-clouds {
  background:
    radial-gradient(ellipse at 24% 26%, rgba(248, 250, 245, 0.18), transparent 24%),
    radial-gradient(ellipse at 72% 18%, rgba(248, 250, 245, 0.12), transparent 22%),
    radial-gradient(ellipse at 58% 44%, rgba(248, 250, 245, 0.1), transparent 34%),
    radial-gradient(ellipse at 38% 58%, rgba(248, 250, 245, 0.08), transparent 24%);
  filter: blur(10px);
}

.sky-layer-stars {
  opacity: 0.6;
  background-image:
    radial-gradient(circle at 18% 32%, rgba(255, 255, 255, 0.78) 0 1px, transparent 1.5px),
    radial-gradient(circle at 72% 24%, rgba(255, 255, 255, 0.66) 0 1px, transparent 1.5px),
    radial-gradient(circle at 84% 38%, rgba(255, 255, 255, 0.78) 0 1.2px, transparent 1.7px),
    radial-gradient(circle at 62% 14%, rgba(255, 255, 255, 0.58) 0 1px, transparent 1.6px);
}

.garden-glow {
  position: absolute;
  inset: auto -16% -12% -16%;
  height: 48%;
  background:
    radial-gradient(circle at 15% 25%, rgba(192, 224, 167, 0.16) 0 7%, transparent 28%),
    radial-gradient(circle at 38% 42%, rgba(219, 239, 198, 0.18) 0 7%, transparent 26%),
    radial-gradient(circle at 62% 18%, rgba(192, 224, 167, 0.14) 0 6%, transparent 26%),
    radial-gradient(circle at 80% 36%, rgba(219, 239, 198, 0.16) 0 7%, transparent 30%);
  filter: blur(26px);
  opacity: 0.96;
}

.letter-card,
.rabbit-card,
.voucher,
.closing-card {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 30%),
    linear-gradient(180deg, var(--surface-strong), var(--surface));
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.letter-card,
.closing-card {
  padding: 28px 24px;
}

.letter-card-interactive {
  position: relative;
  overflow: hidden;
}

.letter-copy {
  display: grid;
  gap: 14px;
}

.char-fragment {
  display: inline-block;
  will-change: transform, opacity, filter;
}

.letter-actions {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.release-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  width: fit-content;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid rgba(226, 239, 214, 0.3);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 248, 228, 0.14), rgba(216, 233, 207, 0.1));
  color: var(--text-main);
  font: inherit;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 24px rgba(226, 239, 214, 0.12);
  overflow: visible;
}

.release-word {
  display: inline-block;
  position: relative;
  color: var(--accent);
  overflow: visible;
}

.release-word-burst {
  position: absolute;
  inset: 0 auto auto 0;
  pointer-events: none;
  white-space: nowrap;
  z-index: 2;
  transform-origin: center;
}

.release-word.is-exploding .char-fragment {
  animation: burstAway 1100ms cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
  animation-delay: var(--char-delay, 0ms);
}

.rabbit-cards {
  display: grid;
  gap: 14px;
}

.rabbit-card {
  padding: 22px 20px;
  display: grid;
  gap: 10px;
}

.rabbit-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: rgba(216, 233, 207, 0.16);
  color: var(--accent);
  font-size: 1rem;
  letter-spacing: 0.14em;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06), 0 0 32px rgba(226, 239, 214, 0.16);
}

.rabbit-label {
  color: var(--text-muted);
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.voucher-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 84%;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 4px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.voucher-strip::-webkit-scrollbar {
  display: none;
}

.voucher {
  scroll-snap-align: start;
  min-height: 236px;
  padding: 24px 20px;
  display: grid;
  gap: 12px;
  align-content: start;
  position: relative;
}

.voucher::after {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px dashed rgba(226, 239, 214, 0.22);
  border-radius: 20px;
  pointer-events: none;
}

.voucher-foot {
  margin-top: auto;
  color: var(--accent);
  font-size: 0.92rem;
}

.closing-card {
  display: grid;
  gap: 16px;
}

.secret-trigger {
  width: fit-content;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid rgba(216, 233, 207, 0.3);
  border-radius: 999px;
  background: rgba(216, 233, 207, 0.12);
  color: var(--text-main);
  font: inherit;
  box-shadow: 0 0 22px rgba(226, 239, 214, 0.1);
}

.secret-message {
  color: var(--accent);
}

.signoff {
  color: var(--text-muted);
}

@media (prefers-reduced-motion: no-preference) {
  .panel-hero::before {
    content: "";
    position: absolute;
    inset: -8%;
    background:
      radial-gradient(circle at 50% 24%, rgba(255, 251, 232, 0.14), transparent 28%),
      radial-gradient(circle at 50% 74%, rgba(216, 233, 207, 0.1), transparent 30%);
    opacity: 0.5;
    animation: drift 10s ease-in-out infinite alternate;
  }

  .sky-layer-clouds {
    animation: cloudShift 14s ease-in-out infinite alternate;
  }

  .garden-glow {
    animation: glowBreath 8s ease-in-out infinite alternate;
  }

  .hero-copy::before {
    animation: heroMist 9s ease-in-out infinite alternate;
  }
}

@keyframes drift {
  from {
    transform: translate3d(0, -8px, 0);
  }
  to {
    transform: translate3d(0, 8px, 0);
  }
}

@keyframes cloudShift {
  from {
    transform: translate3d(-2%, 0, 0);
  }
  to {
    transform: translate3d(2%, 0, 0);
  }
}

@keyframes glowBreath {
  from {
    opacity: 0.75;
    transform: translate3d(0, 0, 0) scale(0.98);
  }
  to {
    opacity: 0.98;
    transform: translate3d(0, -6px, 0) scale(1.02);
  }
}

@keyframes heroMist {
  from {
    transform: translate3d(0, 0, 0);
    opacity: 0.82;
  }
  to {
    transform: translate3d(0, 6px, 0);
    opacity: 1;
  }
}

@keyframes burstAway {
  0% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
    filter: blur(0);
    color: var(--text-main);
    text-shadow: 0 0 10px rgba(255, 245, 214, 0.45);
  }
  45% {
    opacity: 1;
    color: #fff5cf;
    text-shadow: 0 0 16px rgba(255, 245, 214, 0.5);
  }
  100% {
    opacity: 0;
    transform:
      translate3d(var(--burst-x, 0px), var(--burst-y, -40px), 0)
      rotate(var(--burst-rotate, 0deg))
      scale(0.4);
    filter: blur(6px);
    color: #d8f0c8;
  }
}

@media (min-width: 768px) {
  .panel {
    padding-left: 32px;
    padding-right: 32px;
  }

  .rabbit-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .voucher-strip {
    grid-auto-columns: minmax(240px, 320px);
  }
}
