/* bp-glow: the app's Explainer glow, ported. A blue-to-gold arc circling an element:
   a 1.5px ring on its edge plus a blurred halo just outside it. Both layers are masked to a band
   outside the element's own box, so nothing paints over the fill.
   Usage: class="bp-glow" + data-lit (shown) or data-hover-lit (shown on hover/focus).
   A pill needs nothing more; a rounded-rect host sets data-glow-shape="rect" and its own corner in --bp-glow-r.
   Works on white product UI and on the dark page.
   Variants: .bp-glow--slow (6s turn), .bp-glow--panel (wide soft halo for a window edge). */
@property --bp-glow-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}
@keyframes bp-glow-spin {
  to {
    --bp-glow-angle: 360deg;
  }
}

.bp-glow {
  position: relative;
  isolation: isolate;
  --bp-glow-r: 999px;
  --bp-glow-ring: 1.5px;
  --bp-glow-halo: 6px;
  --bp-glow-blur: 5px;
  --bp-glow-speed: 3.4s;
  --bp-glow-ring-o: .95;
  --bp-glow-halo-o: .5;
  /* the arc: a long blue tail easing up to a gold head, then gone. Under it, a steady faint track of the same
     two colours, so the edge the arc has left is never bare */
  --bp-glow-arc: conic-gradient(
    from var(--bp-glow-angle),
    rgba(60, 186, 255, 0) 0deg,
    rgba(60, 186, 255, 0.22) 50deg,
    rgba(60, 186, 255, 0.7) 100deg,
    #3cbaff 135deg,
    #f2ab00 196deg,
    rgba(242, 171, 0, 0.55) 224deg,
    rgba(242, 171, 0, 0) 252deg,
    rgba(242, 171, 0, 0) 360deg
  );
  --bp-glow-track: linear-gradient(115deg, rgba(60, 186, 255, 0.3), rgba(242, 171, 0, 0.3));
}
.bp-glow[data-glow-shape="rect"] {
  --bp-glow-r: 12px;
}
.bp-glow::before,
.bp-glow::after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: 1;
  background: var(--bp-glow-arc), var(--bp-glow-track);
  opacity: 0;
  transition: opacity 0.5s var(--ease, cubic-bezier(0.16, 1, 0.3, 1));
  animation: bp-glow-spin var(--bp-glow-speed) linear infinite;
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box exclude,
    linear-gradient(#000 0 0);
}
.bp-glow::before {
  inset: calc(var(--bp-glow-ring) * -1);
  padding: var(--bp-glow-ring);
  border-radius: calc(var(--bp-glow-r) + var(--bp-glow-ring));
}
/* the halo is painted in a band of --bp-glow-halo and blurred. The mask is applied after the blur, so the box
   carries a transparent border wide enough for the blur to die out in before the mask's outer edge cuts it */
.bp-glow::after {
  --bp-glow-room: calc(var(--bp-glow-blur) * 2.6);
  inset: calc((var(--bp-glow-halo) + var(--bp-glow-room)) * -1);
  padding: var(--bp-glow-halo);
  border: var(--bp-glow-room) solid transparent;
  border-radius: calc(var(--bp-glow-r) + var(--bp-glow-halo) + var(--bp-glow-room));
  background-clip: padding-box;
  filter: blur(var(--bp-glow-blur)) saturate(1.15);
}

.bp-glow[data-lit]::before {
  opacity: var(--bp-glow-ring-o);
}
.bp-glow[data-lit]::after {
  opacity: var(--bp-glow-halo-o);
}
.bp-glow[data-hover-lit]:is(:hover, :focus-visible)::before {
  opacity: var(--bp-glow-ring-o);
}
.bp-glow[data-hover-lit]:is(:hover, :focus-visible)::after {
  opacity: var(--bp-glow-halo-o);
}
/* only run the turn while it shows */
.bp-glow:not([data-lit]):not(:hover):not(:focus-visible)::before,
.bp-glow:not([data-lit]):not(:hover):not(:focus-visible)::after {
  animation-play-state: paused;
}

.bp-glow--slow {
  --bp-glow-speed: 6s;
}
/* on the dark page the halo can carry more: brighter, wider */
.bp-glow--dark {
  --bp-glow-halo: 9px;
  --bp-glow-blur: 9px;
  --bp-glow-halo-o: .62;
  --bp-glow-ring-o: 1;
}
/* a window edge when a feature completes: thin ring, wide soft halo, slow */
.bp-glow--panel {
  --bp-glow-ring: 1.5px;
  --bp-glow-halo: 16px;
  --bp-glow-blur: 18px;
  --bp-glow-speed: 8s;
  --bp-glow-ring-o: .85;
  --bp-glow-halo-o: .55;
}

@media (prefers-reduced-motion: reduce) {
  .bp-glow::before,
  .bp-glow::after {
    animation: none;
    --bp-glow-angle: 300deg;
  }
}
