/* ---------------------------------------------
   Palette & tokens
--------------------------------------------- */
:root {
  --cream: #FFF8EC;
  --yellow-pastel: #FDE39B;
  --yellow-soft: #FCEFC7;
  --orange-pastel: #F6B489;
  --coral: #E8875F;
  --coral-deep: #D9714A;
  --pink-pastel: #F3A6B0;
  --sage: #B7C89A;
  --sage-dark: #93A876;
  --brown: #5B3A29;
  --white-soft: #FFFDF8;

  --font-display: 'Fraunces', 'Iowan Old Style', serif;
  --font-body: 'Quicksand', 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  color: var(--brown);
  position: relative;
  overflow-x: hidden;
  background: linear-gradient(180deg, var(--yellow-pastel) 0%, var(--orange-pastel) 100%);
}

/* ---------------------------------------------
   Ambient background
--------------------------------------------- */
.sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.sun {
  position: absolute;
  top: -70px;
  right: -70px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #FFF6DA 0%, var(--yellow-pastel) 55%, transparent 76%);
  filter: blur(1px);
  opacity: 0.9;
  animation: sunPulse 8s ease-in-out infinite;
}

.meadow {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 24vh;
  min-height: 130px;
  animation: meadowSway 12s ease-in-out infinite;
  transform-origin: bottom center;
}

@keyframes sunPulse {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.06); opacity: 1; }
}

@keyframes meadowSway {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(-1.2%); }
}

/* ---------------------------------------------
   Layout
--------------------------------------------- */
.scene {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 56px 20px;
}

.card {
  position: relative;
  background: var(--white-soft);
  border-radius: 32px;
  padding: 92px 36px 44px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow:
    0 30px 60px -22px rgba(91, 58, 41, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.5) inset;
  animation: cardIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

/* ---------------------------------------------
   Flower wreath (signature element)
--------------------------------------------- */
.wreath {
  position: absolute;
  top: -32px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 2px;
}

.flower {
  width: 58px;
  height: 58px;
  overflow: visible;
}

.flower:nth-child(2),
.flower:nth-child(4) {
  margin-top: 16px;
}

.flower:nth-child(1) .petal ellipse,
.flower:nth-child(1) { --petal-color: var(--coral); }
.flower:nth-child(2) .petal ellipse { --petal-color: var(--yellow-pastel); }
.flower:nth-child(3) .petal ellipse { --petal-color: var(--orange-pastel); }
.flower:nth-child(4) .petal ellipse { --petal-color: var(--pink-pastel); }

.flower .petal ellipse {
  fill: var(--petal-color);
}

.flower .center {
  fill: var(--coral-deep);
  transform: scale(1);
  transform-origin: 32px 32px;
  transition: transform 0.4s ease;
}

.flower .petal {
  transform: rotate(var(--r)) scale(0.05);
  transform-origin: 32px 32px;
  opacity: 0;
  transition: transform 0.65s cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 0.45s ease;
}

.flower .petal:nth-child(1) { transition-delay: 0s; }
.flower .petal:nth-child(2) { transition-delay: 0.04s; }
.flower .petal:nth-child(3) { transition-delay: 0.08s; }
.flower .petal:nth-child(4) { transition-delay: 0.12s; }
.flower .petal:nth-child(5) { transition-delay: 0.16s; }
.flower .petal:nth-child(6) { transition-delay: 0.2s; }

.flower.bloomed .petal {
  transform: rotate(var(--r)) scale(1);
  opacity: 1;
}

.flower.bloomed .center {
  transform: scale(1.12);
  transition-delay: 0.5s;
}

/* Note: rotate() combined with scale() as separate functions in one
   transform value keeps the base rotation fixed while only the
   scale animates smoothly (rotate value never changes). */

/* ---------------------------------------------
   Text
--------------------------------------------- */
.eyebrow {
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.7rem;
  color: var(--coral-deep);
  margin: 0 0 12px;
}

.heading {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.4rem, 4.6vw, 1.85rem);
  line-height: 1.4;
  color: var(--brown);
  margin: 0 0 32px;
  min-height: 2.8em;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.heading.is-transitioning {
  opacity: 0;
  transform: translateY(6px);
}

/* ---------------------------------------------
   Button
--------------------------------------------- */
.btn {
  appearance: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  background: linear-gradient(135deg, var(--coral) 0%, var(--coral-deep) 100%);
  padding: 16px 34px;
  border-radius: 999px;
  box-shadow: 0 14px 28px -10px rgba(217, 113, 74, 0.55);
  transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.3s ease;
}

.btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 18px 34px -10px rgba(217, 113, 74, 0.65);
}

.btn:active {
  transform: translateY(0) scale(0.97);
}

.btn:focus-visible {
  outline: 3px solid var(--brown);
  outline-offset: 3px;
}

.btn.is-hidden {
  opacity: 0;
  transform: translateY(10px) scale(0.95);
  pointer-events: none;
  position: absolute;
}

/* ---------------------------------------------
   Falling petals (final reveal)
--------------------------------------------- */
.petals {
  position: fixed;
  inset: 0;
  z-index: 5;
  overflow: hidden;
  pointer-events: none;
}

.petal-fall {
  position: absolute;
  top: -6%;
  width: 12px;
  height: 16px;
  border-radius: 60% 40% 60% 40%;
  opacity: 0.9;
  animation-name: fall;
  animation-timing-function: ease-in;
  animation-fill-mode: forwards;
}

@keyframes fall {
  to {
    transform: translateY(115vh) translateX(var(--drift, 0px)) rotate(var(--rot, 360deg));
    opacity: 0;
  }
}

/* ---------------------------------------------
   Responsive
--------------------------------------------- */
@media (max-width: 420px) {
  .card {
    padding: 84px 24px 36px;
    border-radius: 26px;
  }
  .flower {
    width: 46px;
    height: 46px;
  }
  .wreath {
    top: -26px;
  }
}

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