/* --- Variables --- */
:root {
  --color-bg: #fdf2f4;
  --color-bg-deep: #fce4ea;
  --color-surface: #ffffff;
  --color-blush: #f8d4dc;
  --color-rose: #e8b4bc;
  --color-rose-dark: #c97b8a;
  --color-accent: #c94c62;
  --color-text: #3d2c33;
  --color-text-soft: #6b5360;
  --font-display: "Great Vibes", cursive;
  --font-body: "Lato", sans-serif;
  --shadow-soft: 0 4px 20px rgba(201, 76, 98, 0.1);
  --shadow-card: 0 8px 32px rgba(61, 44, 51, 0.12);
  --radius: 16px;
  --radius-btn: 999px;
}

/* --- Reset & base --- */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--color-text);
  background: var(--color-bg);
  background-image:
    radial-gradient(ellipse 120% 80% at 50% 0%, #fce4ea 0%, transparent 45%),
    radial-gradient(ellipse 80% 50% at 80% 60%, #f8d4dc 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 20% 80%, #f8e4e8 0%, transparent 45%);
  min-height: 100vh;
  line-height: 1.6;
}

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

/* --- Music toggle --- */
.music-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 50;
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-btn);
  border: 2px solid var(--color-rose);
  background: var(--color-surface);
  color: var(--color-accent);
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, background 0.2s ease;
}
.music-toggle:hover {
  background: var(--color-blush);
  transform: scale(1.05);
}
.music-toggle.playing {
  background: var(--color-blush);
}

/* --- Hero --- */
.hero {
  text-align: center;
  padding: 4rem 1rem 3rem;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.75rem, 9vw, 4.25rem);
  font-weight: 400;
  color: var(--color-accent);
  margin: 0 0 0.75rem;
  line-height: 1.2;
}

.hero-subtitle {
  font-size: 1.2rem;
  font-weight: 300;
  color: var(--color-text-soft);
  margin: 0;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

/* --- Timeline (alternating left/right, center line) --- */
.timeline-section {
  padding: 2rem 0 4rem;
}

.timeline {
  position: relative;
  padding: 0 0.5rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 3px;
  transform: translateX(-50%);
  background: linear-gradient(to bottom, var(--color-rose), var(--color-blush));
  border-radius: 3px;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin-bottom: 3.5rem;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.65s ease-out, transform 0.65s ease-out;
}

.timeline-item.visible {
  opacity: 1;
  transform: translateY(0);
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 2rem;
  transform: translateX(-50%);
  width: 16px;
  height: 16px;
  background: var(--color-accent);
  border-radius: 50%;
  border: 3px solid var(--color-bg);
  box-shadow: var(--shadow-soft);
  z-index: 1;
}

.timeline-col {
  min-width: 0;
}

.timeline-col-left {
  padding-right: 1.5rem;
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
}

.timeline-col-right {
  padding-left: 1.5rem;
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
}

.timeline-item.right .timeline-col-left {
  justify-content: flex-end;
}

.timeline-item.right .timeline-col-right {
  justify-content: flex-start;
}

.timeline-image-wrap {
  width: 100%;
  max-width: 520px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  background: var(--color-blush);
  aspect-ratio: 4 / 3;
}

.timeline-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.timeline-content {
  width: 100%;
  max-width: 320px;
  margin-top: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.timeline-item .timeline-col-right .timeline-content {
  text-align: left;
}

.timeline-item.right .timeline-col-left .timeline-content {
  text-align: right;
}

.timeline-item.right .timeline-col-left .timeline-tag {
  margin-left: auto;
}

.timeline-tag {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-accent);
  background: var(--color-blush);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-btn);
  margin-bottom: 0.5rem;
  text-transform: none;
  letter-spacing: 0.02em;
}

.timeline-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 400;
  color: var(--color-text);
  margin: 0 0 0.35rem;
  line-height: 1.2;
}

.timeline-caption {
  font-size: 1rem;
  color: var(--color-text-soft);
  margin: 0;
  line-height: 1.5;
}

/* --- Ask section --- */
.ask-section {
  text-align: center;
  padding: 4rem 1rem 5rem;
  background: linear-gradient(to bottom, transparent, var(--color-blush) 12%, var(--color-blush) 88%, transparent);
  border-radius: var(--radius);
  margin: 2rem 0;
}

.ask-leadin {
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--color-text-soft);
  margin: 0 0 1.5rem;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

.ask-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 7vw, 3.75rem);
  font-weight: 400;
  color: var(--color-accent);
  margin: 0 0 2rem;
  line-height: 1.3;
}

.buttons-wrap {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  min-height: 140px;
}

.no-msg {
  position: absolute;
  bottom: -2rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-accent);
  min-height: 1.5em;
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.btn {
  font-family: var(--font-body);
  font-size: 1.15rem;
  font-weight: 700;
  padding: 0.85rem 2rem;
  border: none;
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-yes {
  background: var(--color-accent);
  color: white;
  box-shadow: 0 4px 16px rgba(201, 76, 98, 0.35);
}

.btn-yes:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 24px rgba(201, 76, 98, 0.45);
}

.btn-no {
  background: var(--color-surface);
  color: var(--color-text-soft);
  border: 2px solid var(--color-rose);
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  transition: transform 0.2s ease, left 0.2s ease, top 0.2s ease;
}

.btn-no.runaway {
  transition: left 0.2s ease, top 0.2s ease;
}

/* --- Success section --- */
.success-section {
  text-align: center;
  padding: 4rem 1.5rem;
  animation: fadeIn 0.6s ease;
}

.hidden,
.success-section.hidden,
.ask-section.hidden {
  display: none;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.success-emoji {
  font-size: 4rem;
  margin: 0 0 0.5rem;
  line-height: 1;
}

.success-title {
  font-family: var(--font-display);
  font-size: clamp(2.75rem, 9vw, 4.5rem);
  font-weight: 400;
  color: var(--color-accent);
  margin: 0 0 1rem;
}

.success-message {
  font-size: 1.25rem;
  color: var(--color-text-soft);
  margin: 0;
  max-width: 380px;
  margin-left: auto;
  margin-right: auto;
}

.hearts-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 100;
}

.heart-float,
.confetti-piece {
  position: absolute;
  bottom: 0;
  animation: riseUp 5s ease-in forwards;
}

.heart-float {
  font-size: 1.25rem;
  opacity: 0.9;
}

.heart-float.large {
  font-size: 2.5rem;
}

.confetti-piece {
  width: 10px;
  height: 10px;
  border-radius: 1px;
  opacity: 0.9;
}

@keyframes riseUp {
  0% {
    transform: translateY(0) scale(1);
    opacity: 0.9;
  }
  100% {
    transform: translateY(-120vh) scale(0.5);
    opacity: 0;
  }
}

/* --- Responsive --- */
@media (max-width: 560px) {
  main {
    padding: 1.25rem 1rem 3rem;
  }

  .hero {
    padding: 3rem 0.5rem 2rem;
  }

  .timeline {
    padding: 0 0.5rem;
  }

  .timeline::before {
    width: 2px;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
  }

  .timeline-item.left .timeline-col-left { order: 1; }
  .timeline-item.left .timeline-col-right { order: 2; }
  .timeline-item.right .timeline-col-left { order: 1; }
  .timeline-item.right .timeline-col-right { order: 2; }

  .timeline-col-left,
  .timeline-col-right {
    padding-left: 0;
    padding-right: 0;
    justify-content: center;
  }

  .timeline-item.right .timeline-col-left .timeline-content {
    text-align: left;
  }

  .timeline-item.right .timeline-col-left .timeline-tag {
    margin-left: 0;
  }

  .timeline-item::before {
    left: 50%;
    width: 12px;
    height: 12px;
  }

  .ask-section {
    padding: 3rem 0.75rem 4rem;
  }

  .buttons-wrap {
    min-height: 160px;
  }

  .no-msg {
    bottom: -2.25rem;
    font-size: 0.85rem;
    white-space: normal;
    max-width: 90%;
  }
}
