:root {
  --sky-top: #1a2744;
  --sky-mid: #c45c2a;
  --sky-low: #f0b429;
  --gold: #ffd54a;
  --gold-deep: #e8a317;
  --petal: #ffe566;
  --center: #6b3a12;
  --leaf: #2f6b3a;
  --stem: #1f4d2a;
  --ink: #1c1408;
  --cream: #fff6e0;
  --soft: rgba(255, 246, 224, 0.78);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: "Outfit", sans-serif;
  color: var(--cream);
  background: linear-gradient(180deg, var(--sky-top) 0%, #3d2a4a 28%, var(--sky-mid) 58%, var(--sky-low) 82%, #f7d27a 100%);
  -webkit-font-smoothing: antialiased;
}

#sky {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.glow-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
}

.glow-a {
  width: min(55vw, 420px);
  height: min(55vw, 420px);
  right: -8%;
  top: 12%;
  background: radial-gradient(circle, #ffb347 0%, transparent 70%);
  animation: drift 14s ease-in-out infinite alternate;
}

.glow-b {
  width: min(40vw, 280px);
  height: min(40vw, 280px);
  left: -6%;
  top: 38%;
  background: radial-gradient(circle, #ffd76a 0%, transparent 70%);
  animation: drift 18s ease-in-out infinite alternate-reverse;
}

.glow-c {
  width: min(30vw, 200px);
  height: min(30vw, 200px);
  left: 40%;
  bottom: 22%;
  background: radial-gradient(circle, rgba(255, 210, 80, 0.55) 0%, transparent 70%);
  animation: drift 11s ease-in-out infinite alternate;
  opacity: 0.4;
}

.stage {
  position: relative;
  z-index: 2;
  height: 100%;
  width: 100%;
}

.intro {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0.85rem;
  padding: 2rem;
  text-align: center;
  transition: opacity 0.9s ease, transform 0.9s ease;
}

.intro.fade-out {
  opacity: 0;
  transform: translateY(-18px) scale(0.98);
  pointer-events: none;
}

.date {
  font-size: 0.78rem;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--soft);
  font-weight: 300;
  animation: rise 1s ease both;
}

.brand {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(3.6rem, 14vw, 6.5rem);
  font-weight: 400;
  line-height: 0.9;
  letter-spacing: 0.02em;
  text-shadow: 0 8px 40px rgba(0, 0, 0, 0.28);
  animation: rise 1.1s ease 0.1s both;
}

.lead {
  max-width: 22rem;
  font-weight: 300;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--soft);
  animation: rise 1.15s ease 0.2s both;
}

.cta {
  margin-top: 1.1rem;
  border: 0;
  cursor: pointer;
  padding: 0.95rem 1.8rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffe27a, #f0b429);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  box-shadow: 0 10px 30px rgba(240, 180, 41, 0.35);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  animation: rise 1.2s ease 0.35s both, pulse 2.8s ease-in-out 1.6s infinite;
}

.cta:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 14px 36px rgba(240, 180, 41, 0.45);
}

.cta:active {
  transform: scale(0.98);
}

.garden {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 1s ease 0.15s, transform 1s ease 0.15s;
}

.garden.visible {
  opacity: 1;
  transform: none;
}

.garden.hidden {
  pointer-events: none;
}

.message {
  position: relative;
  z-index: 4;
  text-align: center;
  padding: clamp(1.4rem, 5vh, 2.8rem) 1.25rem 0;
  pointer-events: none;
}

.whisper {
  font-size: 0.85rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(255, 246, 224, 0.7);
  font-weight: 300;
  animation: rise 1s ease 0.4s both;
}

.title {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(2.6rem, 10vw, 4.8rem);
  font-weight: 400;
  font-style: italic;
  line-height: 1;
  margin: 0.35rem 0 0.7rem;
  text-shadow: 0 6px 28px rgba(0, 0, 0, 0.25), 0 0 40px rgba(255, 200, 80, 0.25);
  animation: rise 1.1s ease 0.55s both;
}

.note {
  font-weight: 300;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--soft);
  max-width: 24rem;
  margin: 0 auto;
  animation: rise 1.15s ease 0.7s both;
}

.letter {
  position: absolute;
  z-index: 5;
  top: clamp(0.8rem, 2.5vh, 1.6rem);
  left: 50%;
  transform: translateX(-50%);
  width: min(92vw, 34rem);
  max-height: min(48vh, 420px);
  overflow-y: auto;
  padding: 1.35rem 1.5rem 1.5rem;
  color: #fff8e8;
  text-align: center;
  background:
    linear-gradient(165deg, rgba(28, 18, 8, 0.28) 0%, rgba(40, 24, 10, 0.22) 55%, rgba(20, 12, 4, 0.26) 100%);
  border: 1px solid rgba(255, 220, 140, 0.28);
  box-shadow:
    0 18px 50px rgba(20, 10, 0, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 0 40px rgba(255, 200, 80, 0.1);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: letterIn 1.1s cubic-bezier(0.22, 1, 0.36, 1) 0.35s both;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 220, 140, 0.35) transparent;
}

.letter::-webkit-scrollbar {
  width: 5px;
}

.letter::-webkit-scrollbar-thumb {
  background: rgba(255, 220, 140, 0.35);
  border-radius: 999px;
}

.letter-ornament {
  font-size: 1.1rem;
  color: #ffd76a;
  opacity: 0.8;
  margin-bottom: 0.15rem;
  letter-spacing: 0.2em;
}

.letter-title {
  font-family: "Great Vibes", cursive;
  font-size: clamp(2.4rem, 8vw, 3.4rem);
  font-weight: 400;
  color: #ffe9a8;
  line-height: 1.1;
  margin-bottom: 0.85rem;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.35), 0 0 24px rgba(255, 200, 80, 0.25);
}

.letter-body {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(1.02rem, 2.8vw, 1.18rem);
  font-weight: 500;
  font-style: italic;
  line-height: 1.65;
  color: rgba(255, 246, 224, 0.92);
  text-align: left;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}

.letter-body p {
  margin-bottom: 0.85rem;
}

.letter-body p:last-child {
  margin-bottom: 0;
}

.letter-sign {
  margin-top: 1.1rem;
  font-family: "Great Vibes", cursive;
  font-size: 1.55rem;
  color: #ffd76a;
  text-align: right;
  padding-right: 0.2rem;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

@keyframes letterIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(18px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

.field {
  position: absolute;
  inset: 0;
  z-index: 3;
  cursor: crosshair;
}

.ground {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 20vh;
  z-index: 2;
  background:
    radial-gradient(ellipse 120% 90% at 50% 100%, rgba(28, 52, 24, 0.95) 0%, rgba(28, 52, 24, 0.55) 45%, transparent 75%),
    linear-gradient(180deg, transparent, rgba(18, 36, 16, 0.8));
  pointer-events: none;
  overflow: hidden;
}

.grass {
  position: absolute;
  bottom: 8%;
  width: 3px;
  height: var(--h, 18px);
  background: linear-gradient(180deg, #4a9a4a, #1a3d1a);
  border-radius: 2px 2px 0 0;
  transform-origin: 50% 100%;
  animation: grassSway 3.2s ease-in-out infinite;
  animation-delay: var(--d, 0s);
  opacity: 0.75;
}

.hint {
  position: absolute;
  bottom: 1.4rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 246, 224, 0.55);
  pointer-events: none;
  transition: opacity 0.6s ease;
}

.hint.dim {
  opacity: 0;
}

/* —— Plant base —— */
.plant {
  position: absolute;
  width: var(--size, 72px);
  height: calc(var(--size, 72px) * 2.05);
  transform: translate(-50%, -100%);
  transform-origin: 50% 100%;
  pointer-events: none;
  animation: sprout 1.15s cubic-bezier(0.22, 1.2, 0.36, 1) both;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.22));
}

.plant .stem {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 5px;
  height: 58%;
  margin-left: -2.5px;
  border-radius: 4px;
  background: linear-gradient(180deg, #4caf50, var(--stem));
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.15);
  transform-origin: 50% 100%;
  animation: sway 3.8s ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}

.plant .leaf {
  position: absolute;
  width: 26px;
  height: 14px;
  background: linear-gradient(135deg, #5cbc5c, var(--leaf));
  border-radius: 0 100% 0 100%;
  bottom: 28%;
  opacity: 0.95;
  box-shadow: 0 0 8px rgba(80, 180, 80, 0.25);
}

.plant .leaf.left {
  left: calc(50% - 26px);
  transform: rotate(-28deg);
}

.plant .leaf.right {
  left: 50%;
  transform: rotate(150deg);
}

.plant .leaf.mid {
  bottom: 42%;
  width: 20px;
  height: 11px;
  left: calc(50% - 22px);
  transform: rotate(-18deg);
}

.bloom {
  position: absolute;
  left: 50%;
  top: 0;
  width: var(--size, 72px);
  height: var(--size, 72px);
  margin-left: calc(var(--size, 72px) / -2);
  transform-origin: 50% 70%;
  animation: bloom 1s cubic-bezier(0.2, 1.35, 0.35, 1) 0.25s both, sway 3.8s ease-in-out infinite;
  animation-delay: 0.25s, var(--delay, 0s);
}

.bloom .halo {
  position: absolute;
  inset: -28%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 230, 120, 0.55) 0%, rgba(255, 180, 40, 0.2) 40%, transparent 70%);
  animation: haloPulse 2.6s ease-in-out infinite;
  z-index: 0;
  pointer-events: none;
}

.bloom .spark {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #fff8d0;
  box-shadow: 0 0 8px 2px rgba(255, 230, 120, 0.9);
  z-index: 5;
  animation: sparkle 2.2s ease-in-out infinite;
  animation-delay: var(--sd, 0s);
}

/* Daisy / classic yellow */
.bloom.daisy .petal {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 34%;
  height: 48%;
  margin-left: -17%;
  margin-top: -48%;
  border-radius: 50% 50% 45% 45%;
  background: linear-gradient(180deg, #fff8c0 0%, var(--petal) 40%, var(--gold-deep) 100%);
  box-shadow: 0 0 12px rgba(255, 213, 74, 0.55), inset 0 -4px 6px rgba(200, 120, 20, 0.15);
  transform-origin: 50% 100%;
  transform: rotate(calc(var(--i) * 45deg));
  z-index: 1;
}

.bloom.daisy .petal::after {
  content: "";
  position: absolute;
  left: 30%;
  top: 12%;
  width: 40%;
  height: 35%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  filter: blur(1px);
}

.bloom.daisy .core {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 30%;
  height: 30%;
  margin: -15% 0 0 -15%;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #a86b2e, var(--center) 55%, #2a1608 100%);
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.35), 0 0 18px rgba(255, 200, 60, 0.65);
  z-index: 2;
}

.bloom.daisy .core::after {
  content: "";
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  background: radial-gradient(circle, transparent 35%, rgba(0, 0, 0, 0.2) 36%) 0 0 / 3px 3px;
  opacity: 0.6;
}

/* Sunflower */
.plant.sunflower .stem {
  width: 6px;
  height: 62%;
  margin-left: -3px;
  background: linear-gradient(180deg, #66bb6a, #1b4d24);
}

.plant.sunflower .leaf {
  width: 34px;
  height: 18px;
  background: linear-gradient(135deg, #6bcf6b, #246b32);
  border-radius: 50% 0 50% 50%;
}

.bloom.sunflower .petal {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 22%;
  height: 46%;
  margin-left: -11%;
  margin-top: -46%;
  border-radius: 40% 40% 20% 20%;
  background: linear-gradient(180deg, #fff59a 0%, #ffd54a 35%, #f9a825 75%, #ef6c00 100%);
  box-shadow: 0 0 14px rgba(255, 193, 7, 0.7), inset 1px 0 0 rgba(255, 255, 200, 0.35);
  transform-origin: 50% 100%;
  transform: rotate(calc(var(--i) * 22.5deg));
  z-index: 1;
}

.bloom.sunflower .petal.inner {
  height: 36%;
  margin-top: -36%;
  width: 18%;
  margin-left: -9%;
  background: linear-gradient(180deg, #ffe082 0%, #ffca28 50%, #ff8f00 100%);
  opacity: 0.95;
  transform: rotate(calc(var(--i) * 22.5deg + 11.25deg));
  z-index: 2;
}

.bloom.sunflower .core {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 42%;
  height: 42%;
  margin: -21% 0 0 -21%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 40% 35%, #8d6e3f 0%, #5d4037 40%, #3e2723 100%);
  box-shadow:
    0 0 22px rgba(255, 200, 60, 0.75),
    0 0 40px rgba(255, 160, 20, 0.35),
    inset 0 2px 8px rgba(0, 0, 0, 0.45);
  z-index: 3;
  overflow: hidden;
}

.bloom.sunflower .core::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle, #ffcc80 1.2px, transparent 1.3px) 0 0 / 5px 5px,
    radial-gradient(circle, #4e342e 1px, transparent 1.1px) 2.5px 2.5px / 5px 5px;
  opacity: 0.85;
  animation: coreShimmer 4s linear infinite;
}

.bloom.sunflower .core::after {
  content: "";
  position: absolute;
  inset: 20%;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255, 200, 100, 0.35), transparent 60%);
}

.bloom.sunflower .halo {
  inset: -35%;
  background: radial-gradient(circle, rgba(255, 220, 80, 0.7) 0%, rgba(255, 150, 30, 0.25) 38%, transparent 68%);
  animation: haloPulse 2.2s ease-in-out infinite;
}

/* Small wildflower */
.plant.wild {
  height: calc(var(--size, 72px) * 1.7);
}

.plant.wild .stem {
  width: 3px;
  height: 52%;
}

.bloom.wild .petal {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 38%;
  height: 42%;
  margin-left: -19%;
  margin-top: -42%;
  border-radius: 50%;
  background: linear-gradient(160deg, #fffde7, #ffee58 50%, #fbc02d);
  box-shadow: 0 0 10px rgba(255, 235, 59, 0.65);
  transform-origin: 50% 100%;
  transform: rotate(calc(var(--i) * 60deg));
  z-index: 1;
}

.bloom.wild .core {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 22%;
  height: 22%;
  margin: -11% 0 0 -11%;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ffecb3, #ff8f00);
  box-shadow: 0 0 12px rgba(255, 193, 7, 0.8);
  z-index: 2;
}

/* Bud burst flash */
.burst {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, #fff8e1, rgba(255, 193, 7, 0.4) 40%, transparent 70%);
  transform: translate(-50%, -50%) scale(0.3);
  animation: burstOut 0.7s ease-out forwards;
  z-index: 6;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 10px 30px rgba(240, 180, 41, 0.35);
  }
  50% {
    box-shadow: 0 12px 40px rgba(255, 220, 100, 0.55);
  }
}

@keyframes drift {
  from {
    transform: translate(0, 0);
  }
  to {
    transform: translate(18px, -22px);
  }
}

@keyframes sprout {
  0% {
    opacity: 0;
    transform: translate(-50%, -100%) scaleY(0.15) scaleX(0.6);
  }
  60% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -100%) scale(1);
  }
}

@keyframes bloom {
  0% {
    transform: scale(0) rotate(-20deg);
    opacity: 0;
  }
  70% {
    transform: scale(1.12) rotate(4deg);
    opacity: 1;
  }
  100% {
    transform: scale(1) rotate(0);
    opacity: 1;
  }
}

@keyframes sway {
  0%,
  100% {
    transform: rotate(-3.5deg);
  }
  50% {
    transform: rotate(3.5deg);
  }
}

@keyframes grassSway {
  0%,
  100% {
    transform: rotate(-8deg);
  }
  50% {
    transform: rotate(8deg);
  }
}

@keyframes haloPulse {
  0%,
  100% {
    opacity: 0.55;
    transform: scale(0.92);
  }
  50% {
    opacity: 1;
    transform: scale(1.08);
  }
}

@keyframes sparkle {
  0%,
  100% {
    opacity: 0.2;
    transform: scale(0.6);
  }
  50% {
    opacity: 1;
    transform: scale(1.3);
  }
}

@keyframes coreShimmer {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes burstOut {
  to {
    transform: translate(-50%, -50%) scale(8);
    opacity: 0;
  }
}

@media (max-width: 520px) {
  .lead,
  .note {
    font-size: 0.9rem;
  }

  .hint {
    bottom: 1rem;
    font-size: 0.7rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
