:root {
  --ink: #141827;
  --paper: #fff8ef;
  --coral: #ff5f57;
  --rose: #ec3f8c;
  --teal: #00b7a8;
  --gold: #ffd166;
  --violet: #5845d6;
  --blue: #1d4ed8;
  --shadow: 0 26px 90px rgba(15, 19, 34, .32);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #141827;
}

body {
  position: relative;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 209, 102, .34), transparent 24rem),
    radial-gradient(circle at 86% 22%, rgba(236, 63, 140, .26), transparent 24rem),
    radial-gradient(circle at 54% 100%, rgba(0, 183, 168, .3), transparent 24rem),
    linear-gradient(135deg, #141827 0%, #26315c 42%, #f46f4d 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .14;
  background-image:
    linear-gradient(30deg, rgba(255, 255, 255, .32) 12%, transparent 12.5%, transparent 87%, rgba(255, 255, 255, .32) 87.5%, rgba(255, 255, 255, .32)),
    linear-gradient(150deg, rgba(255, 255, 255, .32) 12%, transparent 12.5%, transparent 87%, rgba(255, 255, 255, .32) 87.5%, rgba(255, 255, 255, .32));
  background-size: 72px 126px;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

#confetti {
  position: fixed;
  inset: 0;
  z-index: 8;
  pointer-events: none;
}

.party-shell {
  position: relative;
  z-index: 1;
  width: min(1240px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 0;
  display: grid;
  align-content: center;
  gap: 18px;
}

.hero {
  position: relative;
  min-height: min(735px, calc(100vh - 132px));
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 500px);
  align-items: center;
  gap: clamp(30px, 5vw, 74px);
  padding: clamp(26px, 5vw, 68px);
  border: 1px solid rgba(255, 255, 255, .34);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
  background:
    linear-gradient(118deg, rgba(255, 248, 239, .97), rgba(255, 255, 255, .78) 55%, rgba(255, 209, 102, .3)),
    repeating-linear-gradient(90deg, rgba(20, 24, 39, .05) 0 1px, transparent 1px 32px);
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 18px;
  background: linear-gradient(90deg, var(--coral), var(--gold), var(--teal), var(--violet), var(--rose));
}

.sky {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.balloon,
.star,
.ribbon {
  position: absolute;
  display: block;
}

.balloon {
  width: 62px;
  height: 78px;
  border-radius: 48% 48% 46% 46%;
  box-shadow: inset -12px -14px 0 rgba(0, 0, 0, .12);
  animation: float 5.5s ease-in-out infinite;
}

.balloon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 77px;
  width: 2px;
  height: 86px;
  background: rgba(16, 32, 51, .32);
}

.balloon-one {
  left: 4%;
  top: 9%;
  background: var(--coral);
}

.balloon-two {
  right: 10%;
  top: 7%;
  background: var(--teal);
  animation-delay: -2s;
}

.balloon-three {
  right: 43%;
  top: 5%;
  width: 48px;
  height: 62px;
  background: var(--gold);
  animation-delay: -3.5s;
}

.star {
  width: 22px;
  aspect-ratio: 1;
  background: var(--gold);
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 56%, 79% 91%, 50% 70%, 21% 91%, 32% 56%, 2% 35%, 39% 35%);
  opacity: .88;
  animation: twinkle 2.8s ease-in-out infinite;
}

.star-one {
  left: 48%;
  top: 20%;
}

.star-two {
  left: 11%;
  bottom: 24%;
  background: var(--teal);
  animation-delay: -.8s;
}

.star-three {
  right: 6%;
  bottom: 28%;
  background: var(--coral);
  animation-delay: -1.4s;
}

.ribbon {
  width: 138px;
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--rose), var(--gold));
  opacity: .78;
  transform: rotate(-24deg);
}

.ribbon-one {
  left: 19%;
  top: 22%;
}

.ribbon-two {
  right: 20%;
  bottom: 17%;
  background: linear-gradient(90deg, var(--teal), var(--violet));
  transform: rotate(18deg);
}

.copy,
.cake-stage,
.message-panel {
  position: relative;
  z-index: 2;
}

.eyebrow,
.panel-kicker {
  margin: 0 0 10px;
  color: var(--rose);
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

h1 {
  max-width: 760px;
  margin: 0;
  color: var(--ink);
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(3.6rem, 8vw, 7.4rem);
  line-height: .9;
  letter-spacing: 0;
}

.lead {
  max-width: 610px;
  margin: 26px 0 0;
  color: rgba(20, 24, 39, .76);
  font-size: clamp(1.02rem, 1.5vw, 1.22rem);
  line-height: 1.7;
}

.dedication {
  width: min(100%, 430px);
  margin-top: 28px;
  padding: 16px 0 16px 18px;
  border-left: 6px solid var(--rose);
  display: grid;
  gap: 4px;
  background: linear-gradient(90deg, rgba(255, 255, 255, .74), rgba(255, 255, 255, .18));
}

.dedication span {
  color: var(--ink);
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  font-weight: 800;
  line-height: 1;
}

.dedication strong {
  color: rgba(20, 24, 39, .62);
  font-size: .84rem;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.actions button,
.message-panel button {
  min-height: 50px;
  border: 0;
  border-radius: 8px;
  padding: 0 20px;
  font-weight: 900;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.actions button:hover,
.message-panel button:hover,
.cake:hover {
  transform: translateY(-2px);
}

.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--coral), var(--rose));
  box-shadow: 0 16px 34px rgba(236, 63, 140, .28);
}

.secondary {
  color: var(--ink);
  background: var(--gold);
  box-shadow: 0 14px 28px rgba(255, 209, 102, .28);
}

.secondary[aria-pressed="true"] {
  color: #fff;
  background: var(--teal);
}

.cake-stage {
  position: relative;
  display: grid;
  justify-items: center;
  align-self: center;
  min-height: 560px;
}

.photo-panel {
  position: absolute;
  inset: 0;
  margin: 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 28px 70px rgba(20, 24, 39, .26);
  background: #101827;
}

.photo-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(20, 24, 39, .06), rgba(20, 24, 39, .42)),
    radial-gradient(circle at 50% 42%, transparent 0 32%, rgba(20, 24, 39, .5) 100%);
}

.photo-panel img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: 42% center;
  transform: scale(1.02);
}

.photo-panel figcaption {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
  padding: 10px 13px;
  border-radius: 8px;
  color: #fff;
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
  background: rgba(20, 24, 39, .52);
  border: 1px solid rgba(255, 255, 255, .24);
  backdrop-filter: blur(10px);
}

.glow-ring {
  position: absolute;
  left: 50%;
  bottom: 48px;
  width: min(78%, 390px);
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(255, 209, 102, .52), rgba(236, 63, 140, .08) 48%, transparent 68%);
  filter: blur(10px);
  animation: pulse 2.8s ease-in-out infinite;
}

.cake {
  position: relative;
  align-self: end;
  width: min(82%, 370px);
  aspect-ratio: 1 / .82;
  border: 0;
  background: transparent;
  border-radius: 8px;
  isolation: isolate;
  margin-top: auto;
  margin-bottom: 58px;
  filter: drop-shadow(0 24px 32px rgba(8, 10, 18, .32));
}

.cake-layer,
.frosting {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  border-radius: 8px 8px 22px 22px;
}

.cake-layer {
  box-shadow: inset 0 -14px 0 rgba(0, 0, 0, .08);
}

.cake-layer.top {
  bottom: 144px;
  height: 58px;
  background: linear-gradient(90deg, #fff0a1, #ffd166);
}

.cake-layer.middle {
  bottom: 92px;
  height: 68px;
  width: 88%;
  background: linear-gradient(90deg, #ff7a58, #ec3f8c);
}

.cake-layer.bottom {
  bottom: 32px;
  height: 78px;
  width: 96%;
  background: linear-gradient(90deg, #00b7a8, #5845d6);
}

.frosting {
  bottom: 190px;
  height: 40px;
  width: 84%;
  border-radius: 28px;
  background:
    radial-gradient(circle at 16% 70%, #fff 0 16px, transparent 17px),
    radial-gradient(circle at 38% 70%, #fff 0 17px, transparent 18px),
    radial-gradient(circle at 60% 70%, #fff 0 15px, transparent 16px),
    radial-gradient(circle at 82% 70%, #fff 0 18px, transparent 19px),
    #fff;
  z-index: 3;
}

.candle {
  position: absolute;
  bottom: 228px;
  z-index: 4;
  width: 18px;
  height: 64px;
  border-radius: 5px;
  background: repeating-linear-gradient(-35deg, #fff 0 7px, var(--coral) 7px 14px);
  box-shadow: 0 10px 18px rgba(16, 32, 51, .16);
}

.candle-a {
  left: 34%;
}

.candle-b {
  left: 49%;
  background: repeating-linear-gradient(-35deg, #fff 0 7px, var(--teal) 7px 14px);
}

.candle-c {
  left: 64%;
  background: repeating-linear-gradient(-35deg, #fff 0 7px, var(--blue) 7px 14px);
}

.candle i {
  position: absolute;
  left: 50%;
  top: -29px;
  width: 22px;
  height: 32px;
  transform: translateX(-50%);
  border-radius: 50% 50% 46% 46%;
  background: radial-gradient(circle at 50% 70%, #fff7c4 0 18%, var(--gold) 19% 54%, #ff7a45 56% 100%);
  box-shadow: 0 0 24px rgba(255, 209, 102, .9);
  transform-origin: 50% 100%;
  animation: flame .8s ease-in-out infinite alternate;
}

.cake.blown .candle i {
  animation: puff .38s ease forwards;
}

.hint {
  position: absolute;
  left: 22px;
  bottom: 20px;
  margin: 0;
  color: rgba(255, 255, 255, .88);
  font-size: .9rem;
  font-weight: 900;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .3);
}

.message-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 22px 24px;
  border-radius: 8px;
  color: #fff;
  background:
    linear-gradient(100deg, rgba(20, 24, 39, .86), rgba(88, 69, 214, .72)),
    linear-gradient(90deg, transparent, rgba(255, 209, 102, .2));
  border: 1px solid rgba(255, 255, 255, .24);
  backdrop-filter: blur(14px);
}

.message-panel h2 {
  margin: 0;
  font-size: clamp(1.25rem, 3vw, 2.05rem);
  line-height: 1.15;
  letter-spacing: 0;
}

.message-panel .panel-kicker {
  color: var(--gold);
}

.message-panel button {
  color: var(--ink);
  background: #fff8ef;
  white-space: nowrap;
}

.burst {
  animation: pop .45s ease;
}

.pointer-spark {
  position: fixed;
  z-index: 7;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  pointer-events: none;
  background: var(--gold);
  box-shadow: 0 0 16px rgba(255, 209, 102, .9);
  animation: spark .75s ease-out forwards;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0) rotate(-3deg);
  }
  50% {
    transform: translateY(18px) rotate(4deg);
  }
}

@keyframes twinkle {
  0%, 100% {
    transform: scale(.78) rotate(0);
    opacity: .42;
  }
  50% {
    transform: scale(1.12) rotate(12deg);
    opacity: 1;
  }
}

@keyframes flame {
  from {
    transform: translateX(-50%) rotate(-4deg) scale(.96);
  }
  to {
    transform: translateX(-50%) rotate(5deg) scale(1.08);
  }
}

@keyframes puff {
  to {
    opacity: 0;
    transform: translateX(-50%) translateY(-18px) scale(.2);
  }
}

@keyframes pop {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.03);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: .58;
    transform: translateX(-50%) scale(.94);
  }
  50% {
    opacity: .9;
    transform: translateX(-50%) scale(1.04);
  }
}

@keyframes spark {
  to {
    opacity: 0;
    transform: translateY(-24px) scale(.35);
  }
}

@media (max-width: 860px) {
  .party-shell {
    width: min(100% - 22px, 680px);
    padding: 16px 0;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 34px 20px 42px;
  }

  .cake-stage {
    align-self: center;
    width: 100%;
    min-height: 500px;
  }

  .cake {
    width: min(78vw, 360px);
  }

  .message-panel {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .message-panel button {
    width: 100%;
  }
}

@media (max-width: 520px) {
  h1 {
    font-size: clamp(3rem, 17vw, 4.25rem);
  }

  .actions {
    display: grid;
  }

  .actions button {
    width: 100%;
  }

  .balloon-two,
  .balloon-three {
    opacity: .48;
  }

  .cake-stage {
    min-height: 430px;
  }

  .photo-panel figcaption {
    top: 12px;
    right: 12px;
  }

  .hint {
    left: 14px;
    bottom: 14px;
    max-width: calc(100% - 28px);
  }
}
