/* Published visitors: page view counts on project cards and in the editor,
   with milestone celebrations (published-visitors.mjs). Self-themed: both
   palettes are inline, so no generated light twin is needed. */
:root {
  --bh-vis-ink: #f1eaf2;
  --bh-vis-muted: #a69daa;
  --bh-vis-surface: rgba(26,21,32,.95);
  --bh-vis-raised: rgba(255,255,255,.06);
  --bh-vis-line: rgba(255,255,255,.11);
  --bh-vis-accent: #ff6aae;
  --bh-vis-accent-strong: #f04491;
  --bh-vis-accent-soft: rgba(240,68,145,.17);
  --bh-vis-shadow: 0 18px 50px rgba(0,0,0,.48), 0 0 0 1px rgba(255,255,255,.035);
}
html[data-theme="light"] {
  --bh-vis-ink: #2b2230;
  --bh-vis-muted: #6c6172;
  --bh-vis-surface: rgba(255,255,255,.98);
  --bh-vis-raised: #f6eff4;
  --bh-vis-line: rgba(84,37,65,.14);
  --bh-vis-accent: #bd2c6c;
  --bh-vis-accent-strong: #e0337f;
  --bh-vis-accent-soft: #fde3ef;
  --bh-vis-shadow: 0 16px 40px rgba(84,37,65,.17), 0 0 0 1px rgba(84,37,65,.04);
}

/* ---- Visit chip on project cards and in the editor ---------------------- */
.bh-visits-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums;
  color: var(--bh-vis-muted); white-space: nowrap; cursor: default;
}
.bh-visits-chip[data-empty="true"] { opacity: .6; }
.bh-visits-chip .bh-visits-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.bh-visits-eye {
  flex: none; width: 15px; height: 15px; fill: none; stroke: currentColor;
  stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round;
}
.bh-visits-label { color: var(--bh-vis-muted); }
.bh-visits-number { color: var(--bh-vis-ink); font-weight: 750; }
.bh-visits-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.bh-visits-bump { animation: bh-vis-bump .35s ease; }
.bh-visits-editor { margin-inline-start: 8px; }
.bh-visits-card { margin-top: 4px; }

/* ---- Milestone celebration ---------------------------------------------- */
.bh-visit-celebration {
  position: fixed; z-index: 270; inset: 0; display: grid; place-items: center;
  background: rgba(0,0,0,.55); animation: bh-vis-fade-in .3s ease both;
}
.bh-visit-celebration.is-leaving { animation: bh-vis-fade-out .26s ease both; }
.bh-visit-burst {
  position: absolute; width: 0; height: 0; pointer-events: none;
}
.bh-visit-burst i {
  position: absolute; left: 0; top: 0; color: var(--bh-vis-accent);
  font-size: 15px; font-style: normal; line-height: 1; opacity: 0;
  animation: bh-vis-heart .9s cubic-bezier(.2,.8,.3,1) var(--delay, 0ms) both;
}
.bh-visit-badge {
  position: relative; z-index: 1; display: grid; place-items: center;
  width: 80px; height: 80px; border-radius: 50%;
  background: linear-gradient(140deg, var(--bh-vis-accent), var(--bh-vis-accent-strong));
  color: #fff; font-size: 20px; font-weight: 900; font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 4px var(--bh-vis-accent-soft), 0 8px 28px rgba(240,68,145,.45);
  animation: bh-vis-badge .55s cubic-bezier(.2,1.4,.4,1) .15s both;
}
.bh-visit-copy {
  position: relative; z-index: 1; display: grid; gap: 4px; margin-top: 14px;
  text-align: center; color: #fff;
}
.bh-visit-copy strong { font-size: 17px; font-weight: 800; line-height: 1.3; }
.bh-visit-project { font-size: 13px; opacity: .7; overflow-wrap: anywhere; }
.bh-visit-celebration .bh-visit-close {
  position: absolute; top: 16px; right: 16px; z-index: 2;
  display: grid; place-items: center; width: 36px; height: 36px; margin: 0; padding: 0;
  border: 1px solid rgba(255,255,255,.18) !important; border-radius: 50%;
  background: rgba(255,255,255,.08) !important; color: #fff; font-size: 20px;
  line-height: 1; cursor: pointer;
}
.bh-visit-celebration .bh-visit-close:hover { background: rgba(255,255,255,.16) !important; }
.bh-visit-celebration .bh-visit-close:focus-visible { outline: 2px solid var(--bh-vis-accent) !important; outline-offset: 2px; }

@keyframes bh-vis-bump { 0% { transform: scale(1); } 40% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes bh-vis-fade-in { from { opacity: 0; } }
@keyframes bh-vis-fade-out { to { opacity: 0; } }
@keyframes bh-vis-badge { from { opacity: 0; transform: scale(.5); } }
@keyframes bh-vis-heart {
  0% { opacity: 1; transform: translate(0, 0) scale(.6); }
  100% { opacity: 0; transform: translate(var(--dx, 0), var(--dy, -40px)) scale(1.1); }
}

@media (forced-colors: active) {
  .bh-visit-badge { border: 2px solid CanvasText; forced-color-adjust: none; }
}
@media (prefers-reduced-motion: reduce) {
  .bh-quality, .bh-visit-celebration, .bh-visit-celebration.is-leaving,
  .bh-visit-badge, .bh-visit-burst i, .bh-visits-bump { animation: none !important; }
}
