/* ---------- design tokens ---------- */
:root {
  --pink-50:  #fff5f7;
  --pink-100: #ffe6ee;
  --pink-200: #ffccdd;
  --pink-300: #ffa3c0;
  --pink-400: #ff7aa8;
  --pink-500: #ff5c96;
  --pink-600: #e2427c;
  --pink-700: #b02f5f;
  --cream:    #fffaf8;
  --sage:     #8ba888;
  --ink:      #4a2c3a;

  --font-display: 'Dancing Script', cursive;
  --font-heading: 'Cormorant Garamond', serif;
  --font-body: 'Quicksand', sans-serif;

  color-scheme: light;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100svh;
  font-family: var(--font-body);
  color: var(--ink);
  background: linear-gradient(180deg, var(--pink-50) 0%, var(--cream) 40%, var(--pink-50) 100%);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

main { position: relative; z-index: 1; }

h1, h2 { margin: 0; font-family: var(--font-heading); font-weight: 600; }

img, svg { max-width: 100%; }

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

.petal {
  position: absolute;
  top: -8vh;
  width: 14px;
  height: 18px;
  background: radial-gradient(circle at 40% 30%, #fff 0%, var(--pink-100) 70%, var(--pink-200) 100%);
  border-radius: 100% 0 100% 0;
  opacity: 0.85;
  animation: fall linear forwards, sway-x ease-in-out infinite;
  animation-duration: var(--fall-dur, 12s), var(--sway-dur, 4s);
  will-change: transform;
}

@keyframes fall {
  to { transform: translateY(115vh) rotate(360deg); }
}
@keyframes sway-x {
  0%, 100% { margin-left: 0; }
  50% { margin-left: 40px; }
}

/* ---------- decorative flowers ---------- */
.deco-wrap {
  position: absolute;
  z-index: 1;
}
.deco-wrap::before {
  content: '';
  position: absolute;
  inset: -25%;
  background: radial-gradient(circle, rgba(255, 200, 222, 0.85) 0%, rgba(255, 200, 222, 0) 70%);
  z-index: -1;
  border-radius: 50%;
}
.deco {
  display: block;
  opacity: 0.97;
  filter: drop-shadow(0 8px 14px rgba(176, 47, 95, 0.22));
}
.deco-rose { width: clamp(90px, 22vw, 170px); transform: rotate(-10deg); }
.deco-hydrangea { width: clamp(110px, 26vw, 200px); }

.deco-wrap--tl { top: -6%; left: -8%; }
.deco-wrap--br { bottom: -6%; right: -8%; }

.sway { animation: sway 6s ease-in-out infinite; transform-origin: 50% 100%; }
.sway-slow { animation: sway 9s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes sway {
  0%, 100% { transform: rotate(-4deg); }
  50% { transform: rotate(4deg); }
}

.story-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pink-100), var(--pink-50));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}
.story-icon svg {
  width: 19px;
  height: 19px;
  color: var(--pink-500);
  animation: heartbeat 2.2s ease-in-out infinite;
}
@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  15% { transform: scale(1.18); }
  30% { transform: scale(1); }
  45% { transform: scale(1.12); }
  60% { transform: scale(1); }
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1.5rem;
}

.eyebrow {
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pink-600);
  margin-bottom: 0.5rem;
}

.hero-name {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 16vw, 7rem);
  color: var(--pink-700);
  line-height: 1;
}

.hero-sub {
  margin-top: 1rem;
  font-size: clamp(1.1rem, 3.6vw, 1.5rem);
  color: var(--ink);
  opacity: 0.85;
}

.reveal-in {
  opacity: 0;
  transform: translateY(16px);
  animation: reveal-in 0.9s ease forwards;
  animation-delay: var(--d, 0s);
}
@keyframes reveal-in {
  to { opacity: 1; transform: translateY(0); }
}

.scroll-cue {
  position: absolute;
  bottom: max(2rem, env(safe-area-inset-bottom));
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
}
.scroll-cue span {
  display: block;
  width: 12px;
  height: 12px;
  border-right: 2px solid var(--pink-500);
  border-bottom: 2px solid var(--pink-500);
  transform: rotate(45deg);
  animation: bob 1.6s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: rotate(45deg) translate(0,0); }
  50% { transform: rotate(45deg) translate(6px,6px); }
}

/* ---------- story ---------- */
.story {
  max-width: 640px;
  margin: 0 auto;
  padding: 5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.story-card {
  background: #fffffe;
  border: 1px solid var(--pink-100);
  border-radius: 20px;
  padding: 1.75rem 2rem;
  box-shadow: 0 10px 30px rgba(176, 47, 95, 0.06);
}

.story-date {
  margin: 0 0 0.15rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--pink-400);
}

.story-card h2 {
  font-size: 1.6rem;
  color: var(--pink-600);
  margin-bottom: 0.5rem;
}

.story-card p {
  margin: 0;
  line-height: 1.6;
  font-size: 1.02rem;
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- calendar ---------- */
.calendar-section {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.5rem 5rem;
  text-align: center;
}

.section-title {
  font-size: clamp(1.8rem, 5.5vw, 2.4rem);
  color: var(--pink-700);
}

.meet-count {
  margin-top: 0.5rem;
  color: var(--pink-600);
  font-weight: 600;
}

.calendar-grid-wrap {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
}

.month-card {
  position: relative;
  background: #fffffe;
  border: 1px solid var(--pink-100);
  border-radius: 20px;
  padding: 1.25rem 1.1rem 1.5rem;
  box-shadow: 0 10px 30px rgba(176, 47, 95, 0.06);
  width: 100%;
  max-width: 300px;
}

.month-card h3 {
  margin: 0 0 0.9rem;
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: var(--pink-600);
}

.month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.month-grid .weekday {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--pink-300);
  padding-bottom: 0.3rem;
}

.day-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.82rem;
  color: var(--ink);
  opacity: 0.55;
}

.day-cell.has-event {
  cursor: pointer;
  opacity: 1;
  background: var(--pink-100);
  color: var(--pink-700);
  font-weight: 600;
  border: none;
  font-family: inherit;
  transition: transform 0.15s ease, background 0.15s ease;
}
.day-cell.has-event:hover,
.day-cell.has-event:focus-visible {
  background: var(--pink-300);
  color: white;
  transform: scale(1.12);
}
.day-cell.has-event.selected {
  background: var(--pink-600);
  color: white;
}

.day-cell.empty { visibility: hidden; }

/* little tooltip that pops up directly over (or under) the tapped day */
.day-tooltip {
  position: absolute;
  z-index: 5;
  min-width: 170px;
  max-width: 220px;
  background: var(--pink-600);
  color: white;
  padding: 0.65rem 0.9rem;
  border-radius: 12px;
  font-size: 0.85rem;
  line-height: 1.4;
  text-align: left;
  box-shadow: 0 10px 24px rgba(176, 47, 95, 0.3);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 12px)) scale(0.92);
  transform-origin: bottom center;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.day-tooltip.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, calc(-100% - 12px)) scale(1);
}
.day-tooltip::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 11px;
  height: 11px;
  background: var(--pink-600);
  transform: translateX(-50%) rotate(45deg);
  border-radius: 2px;
}
.day-tooltip.below {
  transform-origin: top center;
  transform: translate(-50%, 12px) scale(0.92);
}
.day-tooltip.below.visible {
  transform: translate(-50%, 12px) scale(1);
}
.day-tooltip.below::after {
  bottom: auto;
  top: -5px;
}

.day-tooltip-date {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.85;
  margin-bottom: 0.15rem;
}

/* ---------- static background particles ---------- */
.sparkle-field {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.scatter-item {
  position: absolute;
}
.scatter-item svg {
  display: block;
}

/* ---------- ask section ---------- */
.ask {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1.5rem;
}

.ask-question {
  position: relative;
  z-index: 2;
  font-size: clamp(2rem, 7vw, 3.2rem);
  color: var(--pink-700);
  max-width: 18ch;
}

.ask-buttons {
  position: relative;
  z-index: 2;
  margin-top: 2.5rem;
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  justify-content: center;
  min-height: 70px;
}

.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.05rem;
  border: none;
  border-radius: 999px;
  padding: 0.9rem 1.9rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-yes {
  background: linear-gradient(135deg, var(--pink-400), var(--pink-600));
  color: white;
  box-shadow: 0 10px 24px rgba(226, 66, 124, 0.35);
  animation: invite-bounce 1.5s ease-in-out infinite;
}
.btn-yes:hover {
  animation-play-state: paused;
  transform: translateY(-6px) scale(1.1);
}
.btn-yes:active { transform: scale(0.97); }

.btn-icon {
  width: 16px;
  height: 16px;
  color: white;
  vertical-align: -2px;
  margin-left: 5px;
}

@keyframes invite-bounce {
  0%, 100% {
    transform: translateY(0) scale(1);
    box-shadow: 0 10px 24px rgba(226, 66, 124, 0.35);
  }
  50% {
    transform: translateY(-8px) scale(1.06);
    box-shadow: 0 20px 30px rgba(226, 66, 124, 0.5);
  }
}

.btn-no {
  position: relative;
  background: white;
  color: var(--pink-600);
  border: 1.5px solid var(--pink-200);
  transition: transform 0.18s ease, left 0.25s ease, top 0.25s ease;
}
.btn-no:hover { background: var(--pink-50); }

/* once JS starts relocating it, position absolute within .ask */
.btn-no.dodging {
  position: absolute;
}

/* ---------- celebrate ---------- */
.celebrate {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1.5rem;
  overflow: hidden;
}
.celebrate[hidden] { display: none; }

.celebrate-title {
  font-size: clamp(2.2rem, 7vw, 3.4rem);
  color: var(--pink-700);
  opacity: 0;
  transform: scale(0.85);
  animation: pop-in 0.7s cubic-bezier(.2,1.4,.4,1) forwards;
}

.celebrate-sub {
  margin-top: 0.5rem;
  opacity: 0;
  animation: reveal-in 0.8s ease forwards;
  animation-delay: 0.3s;
  color: var(--ink);
}

@keyframes pop-in {
  to { opacity: 1; transform: scale(1); }
}

.btn-lights {
  margin-top: 2.5rem;
  background: linear-gradient(135deg, var(--pink-500), var(--pink-700));
  color: white;
  box-shadow: 0 12px 28px rgba(176, 47, 95, 0.4);
  opacity: 0;
  animation: reveal-in 0.8s ease forwards;
  animation-delay: 0.6s;
}
.btn-lights:hover { transform: scale(1.05); }
.btn-lights:disabled { opacity: 0.6; cursor: default; transform: none; }

.lights-status {
  margin-top: 1rem;
  min-height: 1.5em;
  color: var(--pink-600);
  font-size: 0.98rem;
}

/* confetti burst */
.confetti-burst {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.confetti-piece {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 13px;
  background: var(--pink-300);
  border-radius: 100% 0 100% 0;
  animation: burst 1.1s ease-out forwards;
}
@keyframes burst {
  to {
    transform: translate(var(--tx), var(--ty)) rotate(var(--rot));
    opacity: 0;
  }
}

/* ---------- footer ---------- */
.site-footer {
  text-align: center;
  padding: 2rem 1rem calc(2rem + env(safe-area-inset-bottom));
  color: var(--pink-400);
  font-size: 0.9rem;
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .petal, .sway, .sway-slow, .scroll-cue span, .btn-yes, .story-icon svg {
    animation: none !important;
  }
  .reveal-in, .reveal, .celebrate-title, .celebrate-sub, .btn-lights {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
