@import url("https://fonts.googleapis.com/css2?family=Caveat:wght@500;600&family=Playfair+Display:ital,wght@0,500;0,600;0,700;1,500&display=swap");

html:has(body.page-birthday),
body.page-birthday {
  margin: 0;
  background: #2b2c30;
}

body.page-birthday .snowflakes {
  display: none !important;
}

.hb {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: safe center;
  gap: 28px;
  padding: 36px 20px 56px;
  overflow: hidden;
  color: #f7f1e6;
  background:
    radial-gradient(720px 420px at 50% 42%, rgba(92, 78, 70, .55), transparent 72%),
    #2b2c30;
}

.hb-title {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.hb-card {
  width: min(560px, 92vw);
  margin: 0;
  padding: 0;
  background: transparent;
  border-radius: 28px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, .38);
  animation: hb-card 1.05s cubic-bezier(.16, 1, .3, 1) both;
}

.hb-card img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 28px;
  background: #2b2c30;
}

.hb-again {
  padding: 10px 18px;
  border: 1px solid rgba(231, 197, 107, .55);
  border-radius: 999px;
  background: transparent;
  color: #f7f1e6;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  animation: hb-line .9s .4s cubic-bezier(.16, 1, .3, 1) both;
}

.hb-again:hover,
.hb-again:focus-visible {
  background: rgba(255, 250, 243, .08);
  outline: 2px solid #e7c56b;
  outline-offset: 2px;
}

.hb-popper {
  position: absolute;
  top: 72px;
  width: 120px;
  height: 160px;
  z-index: 86;
  pointer-events: none;
  opacity: 0;
}

.hb.is-boom .hb-popper {
  opacity: 1;
}

.hb-popper--left { left: max(8px, calc(50% - 360px)); }
.hb-popper--right { right: max(8px, calc(50% - 360px)); transform: scaleX(-1); }

.hb-popper__cone {
  position: absolute;
  left: 22px;
  bottom: 0;
  width: 76px;
  height: 112px;
  background:
    repeating-linear-gradient(115deg,
      #f7e7b0 0 8px,
      #e7c56b 8px 14px,
      #f7f1e6 14px 18px,
      #d4537e 18px 28px,
      #f3d27a 28px 34px);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  filter: drop-shadow(0 10px 10px rgba(90, 50, 20, .18));
  transform-origin: 50% 100%;
}

.hb-popper__cone::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: -6px;
  height: 14px;
  border-radius: 50%;
  background: #c45c6a;
}

.hb.is-boom .hb-popper__cone {
  animation: hb-kick .7s cubic-bezier(.2, .8, .2, 1) both;
}

.hb-popper__burst {
  position: absolute;
  left: 34px;
  bottom: 86px;
  width: 20px;
  height: 20px;
}

.hb-ribbon {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 7px;
  border-radius: 6px;
  opacity: 0;
  transform-origin: center bottom;
}

.hb.is-boom .hb-ribbon {
  animation: hb-ribbon .95s cubic-bezier(.05, .7, .2, 1) both;
}

.hb-confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 80;
}

@keyframes hb-card {
  from { opacity: 0; transform: translateY(24px) scale(.96); }
  to { opacity: 1; transform: none; }
}

@keyframes hb-line {
  from { opacity: 0; transform: translateY(22px); filter: blur(6px); }
  to { opacity: 1; transform: none; filter: none; }
}

@keyframes hb-name {
  0% { opacity: 0; transform: scale(.86); letter-spacing: .14em; filter: blur(8px); }
  100% { opacity: 1; transform: none; letter-spacing: -.03em; filter: none; }
}

@keyframes hb-kick {
  0% { transform: rotate(-8deg) translateY(16px) scale(.9); }
  38% { transform: rotate(-24deg) translateY(-8px) scale(1.06); }
  100% { transform: rotate(-16deg) translateY(0) scale(1); }
}

@keyframes hb-ribbon {
  0% { opacity: 0; transform: translate(0, 12px) rotate(var(--r)) scaleY(.15); }
  18% { opacity: 1; }
  100% {
    opacity: 0;
    transform: translate(var(--x), var(--y)) rotate(calc(var(--r) + 50deg)) scaleY(1);
  }
}

@media (max-width: 720px) {
  .hb { gap: 28px; padding: 28px 16px 48px; }
  .hb-popper {
    top: 8px;
    width: 72px;
    height: 100px;
  }
  .hb-popper--left { left: 4px; }
  .hb-popper--right { right: 4px; }
  .hb-popper__cone { width: 52px; height: 76px; left: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .hb-card,
  .hb-letter > *,
  .hb.is-boom .hb-popper__cone,
  .hb.is-boom .hb-ribbon {
    animation: none !important;
  }
}
