/* ================= TOKENS ================= */
:root {
  --bg: #241238;
  --bg-2: #1b0d2c;
  --pink: #ff3d7f;
  --gold: #ffc857;
  --teal: #2de0c9;
  --cream: #fff6e9;
  --text: #f4ecff;
  --muted: #b9a6d4;
  --card: rgba(255, 255, 255, 0.06);
  --font-head: "Baloo 2", system-ui, sans-serif;
  --font-body: "Space Grotesk", system-ui, sans-serif;
  --spring: cubic-bezier(0.68, -0.4, 0.265, 1.45);
}

/* ================= BASE ================= */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

button {
  font: inherit;
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
}

/* ================= CONFETTI CANVAS ================= */
#confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 999;
}

/* ================= SECTIONS ================= */
.section {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  overflow: hidden;
}

.section-inner {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
  position: relative;
  z-index: 2;
}

.section-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(2rem, 6vw, 3.2rem);
  letter-spacing: 0.02em;
  margin-bottom: clamp(1.5rem, 5vh, 3rem);
  color: var(--text);
}

.section-title::after {
  content: "";
  display: block;
  width: 64px;
  height: 4px;
  margin: 12px auto 0;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--pink), var(--gold), var(--teal));
}

/* ================= HERO / SCROLL INTRO ================= */
.hero-track {
  position: relative;
  height: 420vh;
}

.hero-track .hero {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  min-height: 100vh;
  min-height: 100svh;
  justify-content: center;
  background:
    radial-gradient(ellipse 80% 60% at 50% 110%, rgba(255, 61, 127, 0.16), transparent 60%),
    radial-gradient(ellipse 50% 40% at 85% 10%, rgba(45, 224, 201, 0.1), transparent 60%),
    radial-gradient(ellipse 50% 40% at 10% 20%, rgba(255, 200, 87, 0.08), transparent 60%),
    var(--bg);
}

/* scroll-driven reveal targets (JS sets opacity/transform) */
[data-intro] {
  opacity: 0;
  will-change: transform, opacity, filter;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 16px;
}

.hero-kicker {
  font-family: var(--font-head);
  color: var(--teal);
  font-size: clamp(1rem, 3vw, 1.25rem);
  letter-spacing: 0.35em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.hero-title {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(2.4rem, 9vw, 5.5rem);
  line-height: 1.05;
  color: var(--text);
}

.hero-name {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(4rem, 18vw, 11rem);
  line-height: 1;
  margin: 4px 0 20px;
  background: linear-gradient(
    100deg,
    var(--pink) 0%,
    var(--gold) 45%,
    var(--teal) 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 6s ease-in-out infinite alternate;
}

@keyframes shimmer {
  from { background-position: 0% center; }
  to { background-position: 100% center; }
}

.hero-sub {
  max-width: 520px;
  margin: 0 auto;
  color: var(--muted);
  font-size: clamp(0.95rem, 2.5vw, 1.15rem);
}

/* scroll hint — decorative only, no skip link */
.scroll-hint {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  z-index: 3;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.scroll-arrow {
  font-size: 1.4rem;
  color: var(--gold);
  animation: bounce 1.6s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(10px); }
}

/* ================= BALLOONS ================= */
.balloons {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

.balloon {
  position: absolute;
  bottom: -140px;
  left: var(--x);
  animation: rise var(--dur) linear var(--delay) infinite;
  will-change: transform, opacity;
}

.balloon .sway {
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: sway calc(var(--dur) / 5) ease-in-out var(--delay) infinite alternate;
}

.balloon .b-body {
  width: var(--size);
  height: calc(var(--size) * 1.18);
  border-radius: 50% 50% 46% 46%;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.55), transparent 42%),
    var(--c);
  position: relative;
  box-shadow: 0 0 24px color-mix(in srgb, var(--c) 45%, transparent);
}

.balloon .b-body::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 8px solid var(--c);
}

.balloon .b-string {
  width: 1.5px;
  height: calc(var(--size) * 1.1);
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.5), transparent);
  margin-top: 8px;
}

@keyframes rise {
  0% {
    transform: translateY(0);
    opacity: 0;
  }
  8% { opacity: 0.85; }
  92% { opacity: 0.85; }
  100% {
    transform: translateY(calc(-100vh - 220px));
    opacity: 0;
  }
}

@keyframes sway {
  from { transform: translateX(calc(var(--drift) * -1)); }
  to { transform: translateX(var(--drift)); }
}

@media (prefers-reduced-motion: reduce) {
  .balloon { animation: none; opacity: 0.5; }
  .balloon .sway { animation: none; }
}

/* ================= CAKE SECTION ================= */
.cake-section {
  background:
    radial-gradient(ellipse 70% 50% at 50% 100%, rgba(255, 200, 87, 0.09), transparent 65%),
    radial-gradient(ellipse 40% 30% at 15% 0%, rgba(255, 61, 127, 0.1), transparent 60%),
    var(--bg-2);
}

.cake {
  position: relative;
  width: min(320px, 80vw);
  margin: 0 auto;
  padding-top: 90px; /* room for candles */
  filter: drop-shadow(0 24px 40px rgba(0, 0, 0, 0.45));
}

/* --- candles --- */
.candles {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 96px;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: clamp(10px, 4vw, 22px);
  z-index: 3;
}

.candle {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease;
}

.candle:hover:not(.out) {
  transform: translateY(-3px);
}

.candle:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 6px;
  border-radius: 6px;
}

.candle .candle-body {
  width: clamp(12px, 3.5vw, 16px);
  height: clamp(44px, 12vw, 60px);
  border-radius: 4px 4px 2px 2px;
  background:
    repeating-linear-gradient(
      -45deg,
      rgba(255, 255, 255, 0.28) 0 5px,
      transparent 5px 10px
    ),
    var(--pink);
  box-shadow: inset -3px 0 6px rgba(0, 0, 0, 0.25);
}

.candle:nth-child(2) .candle-body { background-color: var(--gold); }
.candle:nth-child(3) .candle-body { background-color: var(--teal); }
.candle:nth-child(4) .candle-body { background-color: var(--pink); }
.candle:nth-child(5) .candle-body { background-color: var(--gold); }

.candle .wick {
  width: 2px;
  height: 8px;
  background: #4a3b2f;
  border-radius: 2px;
}

/* flame */
.candle .flame {
  position: absolute;
  bottom: calc(clamp(44px, 12vw, 60px) + 8px);
  width: clamp(12px, 3vw, 15px);
  height: clamp(20px, 5vw, 26px);
  background: radial-gradient(circle at 50% 75%, #fff8c4 0%, var(--gold) 45%, #ff7a1a 100%);
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  box-shadow:
    0 0 14px rgba(255, 200, 87, 0.9),
    0 0 34px rgba(255, 122, 26, 0.55);
  transform-origin: 50% 100%;
  animation: flicker 0.35s ease-in-out infinite alternate;
  transition: opacity 0.35s ease, transform 0.35s ease;
  z-index: 2;
}

.candle:nth-child(2) .flame { animation-delay: 0.12s; }
.candle:nth-child(3) .flame { animation-delay: 0.24s; }
.candle:nth-child(4) .flame { animation-delay: 0.08s; }
.candle:nth-child(5) .flame { animation-delay: 0.3s; }

@keyframes flicker {
  0% {
    transform: scale(1) rotate(-2deg);
    filter: brightness(1);
  }
  50% {
    transform: scale(1.06, 0.95) rotate(1deg);
    filter: brightness(1.1);
  }
  100% {
    transform: scale(0.96, 1.05) rotate(2deg);
    filter: brightness(1.05);
  }
}

.candle.out .flame {
  opacity: 0;
  transform: scale(0.2) translateY(6px);
  animation: none;
  pointer-events: none;
}

/* smoke puff */
.candle .smoke {
  position: absolute;
  bottom: calc(clamp(44px, 12vw, 60px) + 16px);
  left: 50%;
  width: 0;
  height: 0;
  pointer-events: none;
}

.candle .smoke i {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(230, 220, 245, 0.7);
  opacity: 0;
}

.candle.puff .smoke i {
  animation: smoke 0.9s ease-out forwards;
}

.candle.puff .smoke i:nth-child(1) { --dx: -12px; animation-delay: 0s; }
.candle.puff .smoke i:nth-child(2) { --dx: 4px;  animation-delay: 0.1s; width: 6px; height: 6px; }
.candle.puff .smoke i:nth-child(3) { --dx: 14px; animation-delay: 0.05s; width: 10px; height: 10px; }

@keyframes smoke {
  0% {
    opacity: 0.85;
    transform: translate(-50%, 0) scale(0.5);
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx, 0px)), -46px) scale(2.4);
  }
}

/* --- cake body --- */
.frosting {
  position: relative;
  z-index: 2;
  height: clamp(38px, 10vw, 48px);
  background: linear-gradient(180deg, #ffe3ef 0%, #ffb3cf 100%);
  border-radius: 14px 14px 8px 8px;
  box-shadow: inset 0 -6px 10px rgba(255, 61, 127, 0.25);
}

/* frosting drips */
.frosting::after {
  content: "";
  position: absolute;
  left: -2%;
  right: -2%;
  bottom: -16px;
  height: 26px;
  background:
    radial-gradient(circle at 16px 0, #ffb3cf 15px, transparent 16px) repeat-x;
  background-size: 36px 26px;
}

/* sprinkles on frosting */
.frosting::before {
  content: "";
  position: absolute;
  inset: 8px 14px auto;
  height: 12px;
  background:
    radial-gradient(circle at 10% 40%, var(--teal) 0 2.5px, transparent 3px),
    radial-gradient(circle at 30% 70%, var(--gold) 0 2.5px, transparent 3px),
    radial-gradient(circle at 52% 30%, var(--pink) 0 2.5px, transparent 3px),
    radial-gradient(circle at 74% 65%, var(--teal) 0 2.5px, transparent 3px),
    radial-gradient(circle at 92% 35%, var(--gold) 0 2.5px, transparent 3px);
  z-index: 1;
}

.tier {
  position: relative;
  z-index: 1;
  border-radius: 6px;
}

.tier-top {
  height: clamp(64px, 17vw, 84px);
  margin: 14px auto 0;
  width: 78%;
  background: linear-gradient(180deg, #4a1f5e 0%, #3a1650 100%);
  box-shadow: inset 0 -10px 18px rgba(0, 0, 0, 0.3);
}

.stripe {
  width: 78%;
  height: 14px;
  margin: 0 auto;
  background: repeating-linear-gradient(
    90deg,
    var(--pink) 0 22px,
    var(--gold) 22px 44px,
    var(--teal) 44px 66px
  );
  opacity: 0.85;
}

.tier-bottom {
  height: clamp(74px, 19vw, 96px);
  width: 100%;
  background: linear-gradient(180deg, #55256c 0%, #3f1a55 100%);
  box-shadow: inset 0 -12px 20px rgba(0, 0, 0, 0.32);
}

.plate {
  width: 114%;
  height: 18px;
  margin: 8px auto 0;
  margin-left: -7%;
  background: linear-gradient(180deg, #d9cfe8 0%, #8d7fa8 100%);
  border-radius: 0 0 50% 50% / 0 0 100% 100%;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
}

/* status line */
.candle-status {
  margin-top: clamp(1.6rem, 4vh, 2.4rem);
  font-family: var(--font-head);
  font-size: clamp(1.2rem, 4vw, 1.6rem);
  font-weight: 700;
  color: var(--gold);
  min-height: 1.6em;
  transition: color 0.3s ease, transform 0.3s var(--spring);
}

.candle-status.done {
  color: var(--teal);
  transform: scale(1.12);
  text-shadow: 0 0 24px rgba(45, 224, 201, 0.5);
}

.cake-hint {
  margin-top: 6px;
  font-size: 0.85rem;
  color: var(--muted);
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.cake-hint.hide {
  opacity: 0;
}

/* ================= GIFT SECTION ================= */
.gift-section {
  background:
    radial-gradient(ellipse 60% 45% at 50% 0%, rgba(45, 224, 201, 0.08), transparent 60%),
    radial-gradient(ellipse 50% 40% at 80% 90%, rgba(255, 61, 127, 0.12), transparent 60%),
    var(--bg);
  justify-content: flex-start;
  padding-top: clamp(80px, 12vh, 120px);
}

/* gift box */
.gift {
  position: relative;
  width: clamp(150px, 40vw, 200px);
  height: clamp(150px, 40vw, 200px);
  margin: 0 auto;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.25s var(--spring);
  z-index: 2;
}

.gift:hover:not(.opened) {
  transform: scale(1.05) rotate(-2deg);
}

.gift:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 10px;
  border-radius: 12px;
}

.gift-body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 72%;
  background: linear-gradient(160deg, var(--pink) 0%, #d4245f 100%);
  border-radius: 8px;
  box-shadow:
    inset -8px -10px 18px rgba(0, 0, 0, 0.28),
    0 18px 34px rgba(0, 0, 0, 0.4);
}

.gift-body .ribbon-v,
.gift-lid .ribbon-v {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 18%;
  transform: translateX(-50%);
  background: linear-gradient(90deg, var(--gold) 0%, #ffe6a3 45%, var(--gold) 100%);
}

.gift-body .ribbon-h {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 18%;
  transform: translateY(-50%);
  background: linear-gradient(180deg, var(--gold) 0%, #ffe6a3 45%, var(--gold) 100%);
}

.gift-lid {
  position: absolute;
  left: -6%;
  right: -6%;
  top: 8%;
  height: 30%;
  background: linear-gradient(160deg, #ff5c94 0%, var(--pink) 100%);
  border-radius: 8px;
  box-shadow:
    inset -6px -6px 12px rgba(0, 0, 0, 0.22),
    0 6px 14px rgba(0, 0, 0, 0.3);
  transform-origin: 8% 100%;
  z-index: 3;
  transition: transform 0.8s var(--spring), opacity 0.6s ease 0.35s;
}

.gift.opened .gift-lid {
  transform: rotate(-38deg) translate(-14%, -76%);
  opacity: 0;
}

/* bow */
.bow {
  position: absolute;
  left: 50%;
  top: -70%;
  transform: translateX(-50%);
  width: 74%;
  height: 130%;
}

.bow-loop {
  position: absolute;
  top: 10%;
  width: 48%;
  height: 78%;
  background: linear-gradient(135deg, var(--teal), #1fb9a5);
  border: 3px solid rgba(255, 255, 255, 0.25);
}

.bow-l {
  left: 0;
  border-radius: 70% 30% 55% 45% / 60% 40% 60% 40%;
  transform: rotate(-18deg);
}

.bow-r {
  right: 0;
  border-radius: 30% 70% 45% 55% / 40% 60% 40% 60%;
  transform: rotate(18deg);
}

.bow-knot {
  position: absolute;
  left: 50%;
  top: 34%;
  transform: translateX(-50%);
  width: 26%;
  height: 36%;
  background: radial-gradient(circle at 35% 30%, #7ff5e4, var(--teal) 70%);
  border-radius: 46%;
  z-index: 1;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

.gift-hint {
  margin-top: 18px;
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  transition: opacity 0.4s ease;
}

.gift-hint.hide {
  opacity: 0;
}

/* reveal content */
.gift-reveal {
  margin-top: clamp(2rem, 6vh, 3.5rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1.6rem, 4vh, 2.4rem);
}

.reveal-item {
  opacity: 0;
  transform: translateY(34px);
  transition:
    opacity 0.7s ease,
    transform 0.7s var(--spring);
  width: 100%;
}

.gift-reveal.show .reveal-item {
  opacity: 1;
  transform: translateY(0);
}

.gift-reveal.show .reveal-item:nth-child(1) { transition-delay: 0.15s; }
.gift-reveal.show .reveal-item:nth-child(2) { transition-delay: 0.35s; }
.gift-reveal.show .reveal-item:nth-child(3) { transition-delay: 0.55s; }

/* message card */
.message-card {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: clamp(1.4rem, 4vw, 2.2rem);
  text-align: left;
  backdrop-filter: blur(8px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
}

.message-card h3 {
  font-family: var(--font-head);
  font-size: clamp(1.3rem, 4vw, 1.7rem);
  font-weight: 700;
  margin-bottom: 10px;
  background: linear-gradient(100deg, var(--pink), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.message-card p {
  color: var(--muted);
  font-size: clamp(0.95rem, 2.5vw, 1.05rem);
}

/* gift card image */
.giftcard {
  max-width: 420px;
  margin: 0 auto;
}

.giftcard img {
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  border-radius: 16px;
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.giftcard figcaption {
  margin-top: 14px;
  font-size: 0.92rem;
  color: var(--muted);
  font-style: italic;
  max-width: 380px;
  margin-left: auto;
  margin-right: auto;
}

/* spotify */
.spotify-wrap {
  max-width: 420px;
  margin: 0 auto;
}

.spotify-wrap iframe {
  display: block;
  border: none;
  width: 100%;
  height: 152px;
}

/* footer */
.footer {
  margin-top: clamp(3rem, 10vh, 5rem);
  padding-bottom: 30px;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  opacity: 0.7;
}

/* ================= RESPONSIVE ================= */
@media (max-width: 480px) {
  .section {
    padding: 64px 16px;
  }

  .cake {
    padding-top: 80px;
  }

  .candles {
    height: 86px;
    gap: 9px;
  }

  .gift {
    width: 150px;
    height: 150px;
  }
}

@media (min-width: 768px) {
  .cake {
    width: 340px;
  }
}
