/* Scoped preview refinements: preserve the existing celestial artwork and badge. */
body.cosmic-v4 .cosmic-background .cosmic-stars {
  opacity: 1;
}

body.cosmic-v4 .cosmic-background .cosmic-stars > circle {
  transform-box: fill-box;
  transform-origin: center;
  animation: pp-star-twinkle 9.5s ease-in-out infinite;
  animation-delay: -3s;
}

body.cosmic-v4 .cosmic-background .cosmic-stars > circle:nth-child(5n + 1) {
  animation-duration: 7s;
  animation-delay: -1.4s;
}

body.cosmic-v4 .cosmic-background .cosmic-stars > circle:nth-child(5n + 2) {
  animation-duration: 8.5s;
  animation-delay: -6.2s;
}

body.cosmic-v4 .cosmic-background .cosmic-stars > circle:nth-child(5n + 3) {
  animation-duration: 10.5s;
  animation-delay: -8.8s;
}

body.cosmic-v4 .cosmic-background .cosmic-stars > circle:nth-child(5n + 4) {
  animation-duration: 12.5s;
  animation-delay: -4.6s;
}

@keyframes pp-star-twinkle {
  0%, 100% { opacity: .26; transform: scale(.82); }
  40%, 60% { opacity: 1; transform: scale(1.62); }
}

/* The eight existing cross-shaped stars provide visible, slow luminous glints. */
body.cosmic-v4 .cosmic-background .cosmic-stars .cosmic-spark {
  transform-box: fill-box;
  transform-origin: center;
  animation: pp-star-glint 9.5s ease-in-out var(--spark-delay, -2s) infinite !important;
}

body.cosmic-v4 .cosmic-background .cosmic-stars .cosmic-spark:nth-of-type(3n + 1) {
  animation-duration: 8s !important;
}

body.cosmic-v4 .cosmic-background .cosmic-stars .cosmic-spark:nth-of-type(3n + 2) {
  animation-duration: 11.5s !important;
}

body.cosmic-v4 .cosmic-background .cosmic-stars .cosmic-spark path {
  stroke: #d8f4ff;
  stroke-width: .85;
  stroke-linecap: round;
}

body.cosmic-v4 .cosmic-background .cosmic-stars .cosmic-spark circle {
  fill: #f1fbff;
  opacity: 1;
}

@keyframes pp-star-glint {
  0%, 100% {
    opacity: .3;
    transform: scale(.85);
    filter: drop-shadow(0 0 1px #b8eaff00);
  }
  30%, 70% {
    opacity: .7;
    transform: scale(1.2);
    filter: drop-shadow(0 0 2.5px #b8eaff66);
  }
  45%, 55% {
    opacity: 1;
    transform: scale(2.35);
    filter: drop-shadow(0 0 5.5px #b8eaffe6);
  }
}

/* A light dark tint keeps the type legible without covering the fixed stars. */
.pp-home .pp-hero-planet {
  position: absolute;
  z-index: -1;
  width: clamp(360px, 40vw, 640px);
  height: auto;
  top: -100px;
  right: -135px;
  opacity: .72;
  pointer-events: none;
  filter: drop-shadow(0 0 36px #2494be12);
}
@media (max-width: 800px) {
  .pp-home .pp-hero-planet {
    width: 340px;
    top: -95px;
    right: -175px;
    opacity: .45;
  }
}
@media (max-width: 480px) {
  .pp-home .pp-hero-planet {
    width: 280px;
    top: -82px;
    right: -185px;
    opacity: .52;
  }
}
body.cosmic-v4 .pp-home,
body.cosmic-v4 .pp-workflow,
body.cosmic-v4 .ppw-section,
body.cosmic-v4 .ppot-section,
body.cosmic-v4 .pp-original-tour {
  background-color: rgba(7, 11, 23, .22);
  background-image: none;
}

/* Keep feature headings clear of the sticky navigation on anchor jumps. */
#wallet-preview, #original-tour, #desktop-workflow {
  scroll-margin-top: 0;
}

.announcement {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 3px 8px;
  padding: 2px 18px;
  line-height: 1.5;
}

.announcement a.pp-app-store-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 0;
  margin: 0 0 0 2px;
  padding: 10px;
  line-height: 0;
  text-decoration: none;
}

.announcement a.pp-app-store-link img.pp-app-store-badge {
  display: block;
  width: 119.664px;
  height: 40px;
  max-width: none;
  object-fit: contain;
}

.announcement a.pp-app-store-link:focus-visible {
  outline: 2px solid #254b7b;
  outline-offset: 0;
  border-radius: 8px;
}

body.cosmic-v4.motion-paused .cosmic-background .cosmic-stars > circle,
body.cosmic-v4.motion-paused .cosmic-background .cosmic-stars .cosmic-spark {
  animation-play-state: paused !important;
}

@media (max-width: 600px) {
  .announcement {
    padding: 8px 14px 2px;
    gap: 1px 6px;
    font-size: 10px;
  }

  .announcement a.pp-app-store-link {
    margin-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.cosmic-v4 .cosmic-background .cosmic-stars > circle,
  body.cosmic-v4 .cosmic-background .cosmic-stars .cosmic-spark {
    animation: none !important;
    transform: none;
    filter: none;
  }

  body.cosmic-v4 .cosmic-background .cosmic-stars .cosmic-spark {
    opacity: .75;
  }
}

@media print {
  .announcement { display: none; }
}
