/* Product page nudges (includes/nudges.php). Dark product pages, brand pink/blue. */

.cs-nudge {
  --nudge-pink: #fc5fad;
  --nudge-blue: #5164f6;
  position: relative;
  overflow: hidden;
  margin: 14px 0 4px;
  height: 40px;
  border-radius: 40px;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .04);
  font: 500 13px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .01em;
  color: #fff;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .5s ease, transform .5s cubic-bezier(.2, .9, .3, 1.2), border-color .4s;
}
.cs-nudge.is-ready { opacity: 1; transform: none; }
.cs-nudge.is-live { border-color: rgba(252, 95, 173, .45); }

/* Light sweep each time the line changes. */
.cs-nudge::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, .10) 45%, transparent 70%);
  transform: translateX(-100%);
  pointer-events: none;
}
.cs-nudge.is-sweep::before { animation: csNudgeSweep 1s ease-out; }

/* Time until the next line. */
.cs-nudge::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 100%;
  background: linear-gradient(90deg, var(--nudge-pink), var(--nudge-blue));
  transform-origin: left;
  transform: scaleX(0);
  opacity: .7;
}
.cs-nudge.is-timing::after { animation: csNudgeTimer var(--nudge-hold, 4.5s) linear forwards; }
.cs-nudge.is-single::after { display: none; }

.cs-nudge__track { position: absolute; inset: 0; }

.cs-nudge__line {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(100%);
  filter: blur(4px);
  transition: opacity .45s ease, transform .55s cubic-bezier(.2, .9, .3, 1.15), filter .45s ease;
}
.cs-nudge__line.is-on { opacity: 1; transform: none; filter: none; }
.cs-nudge__line.is-off { opacity: 0; transform: translateY(-100%); filter: blur(4px); }
.cs-nudge__line > span { overflow: hidden; text-overflow: ellipsis; }

.cs-nudge__line svg {
  flex: none;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--nudge-pink);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.cs-nudge__line[data-kind="count"] svg { animation: csNudgeFlicker 1.6s ease-in-out infinite; }

.cs-nudge__n,
.cs-nudge__t {
  font-weight: 700;
  color: #fff;
  background: linear-gradient(90deg, var(--nudge-pink), #b1adf2);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-variant-numeric: tabular-nums;
}
.cs-nudge__n.is-bump { display: inline-block; animation: csNudgeBump .5s cubic-bezier(.3, 1.6, .5, 1); }

/* Live dot for things that happened in the last couple of days. */
.cs-nudge__pulse {
  position: relative;
  flex: none;
  width: 8px;
  height: 8px;
  margin: 0 4px;
  border-radius: 50%;
  background: var(--nudge-pink);
  box-shadow: 0 0 8px var(--nudge-pink);
}
.cs-nudge__pulse::after {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2px solid var(--nudge-pink);
  animation: csNudgePulse 1.6s ease-out infinite;
}

/* Recent download pop-up. */
.cs-pop {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 300px;
  max-width: calc(100vw - 32px);
  padding: 10px 36px 10px 10px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(20, 19, 26, .92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .5), 0 0 0 1px rgba(81, 100, 246, .15);
  color: #fff;
  font: 400 13px/1.35 'Open Sans', system-ui, sans-serif;
  text-decoration: none;
  transform: translateX(calc(-100% - 40px));
  opacity: 0;
  transition: transform .6s cubic-bezier(.2, .9, .3, 1.15), opacity .4s ease;
}
.cs-pop.is-in { transform: none; opacity: 1; }
.cs-pop img {
  flex: none;
  width: 56px;
  height: 42px;
  object-fit: cover;
  border-radius: 8px;
}
.cs-pop b { font-weight: 700; }
.cs-pop small {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  color: rgba(255, 255, 255, .6);
  font: 500 11px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.cs-pop small::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3ddc97;
}
.cs-pop__x {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: rgba(255, 255, 255, .5);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.cs-pop__x:hover { color: #fff; background: rgba(255, 255, 255, .08); }

@media (max-width: 600px) {
  .cs-nudge { font-size: 12px; }
  .cs-pop { left: 16px; right: 16px; bottom: 16px; width: auto; }
}

@keyframes csNudgeSweep { to { transform: translateX(100%); } }
@keyframes csNudgeTimer { to { transform: scaleX(1); } }
@keyframes csNudgePulse { from { transform: scale(.5); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
@keyframes csNudgeBump { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
@keyframes csNudgeFlicker { 0%, 100% { transform: scale(1) rotate(0); } 30% { transform: scale(1.12) rotate(-4deg); } 60% { transform: scale(.96) rotate(3deg); } }

@media (prefers-reduced-motion: reduce) {
  .cs-nudge, .cs-nudge__line, .cs-pop { transition: opacity .3s ease; transform: none; filter: none; }
  .cs-nudge__line.is-off { transform: none; }
  .cs-pop { transform: none; }
  .cs-nudge::before, .cs-nudge__pulse::after, .cs-nudge__line svg, .cs-nudge__n.is-bump { animation: none !important; }
}
