/* ═══════════════════════════════════════════════════════════════
   XODE — LIKES  (src/likes.js)

   The heart on portfolio, resume and website cards, its burst, and the
   heart in the thank-you card. Violet for the heart, lime in the burst:
   the site's own two colours, in light and in dark.

   The burst is the classic heart-like sequence: the heart drops away, a
   circle swells out of where it was and opens into a ring, and the
   heart pops back filled, with dots flying out around it.
   ═══════════════════════════════════════════════════════════════ */

.xl-like {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  /* A comfortable target without moving anything: the padding is
     given back with a negative margin. */
  padding: 5px 9px 5px 7px;
  margin: -5px -7px -5px 0;
  border-radius: 100px;
  color: var(--text-3, #8B8D98);
  font: 700 12px/1 var(--font-body, Inter, system-ui, sans-serif);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .15s ease;
}
.xl-like:hover { color: var(--violet-ink, #7C5CFF); background: rgba(124, 92, 255, .09); }
.xl-like:focus-visible { outline: 2px solid var(--violet, #7C5CFF); outline-offset: 2px; }

.xl-hw { position: relative; display: inline-grid; place-items: center; width: 16px; height: 16px; }
.xl-h {
  width: 16px; height: 16px; overflow: visible;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round;
  transition: transform .2s cubic-bezier(.34, 1.56, .64, 1);
}
.xl-like:hover .xl-h { transform: scale(1.14); }
.xl-n:empty { display: none; }

.xl-like.is-liked { color: var(--violet-ink, #7C5CFF); }
.xl-like.is-liked .xl-h { fill: currentColor; }

/* The old static count on the wall's cards was a red heart; the live
   one follows the site's colours. */
.gw-card-likes.xl-like svg { color: inherit; width: 16px; height: 16px; }

/* ── the burst ────────────────────────────────────────────────── */
.xl-like.is-pop .xl-h { animation: xl-pop .72s cubic-bezier(.17, .89, .32, 1.28) both; }
@keyframes xl-pop {
  0%, 30% { transform: scale(0); }
  62%     { transform: scale(1.32); }
  80%     { transform: scale(.9); }
  100%    { transform: scale(1); }
}

.xl-burst { position: absolute; left: 50%; top: 50%; width: 0; height: 0; pointer-events: none; }
.xl-burst u {
  position: absolute; left: -17px; top: -17px; width: 34px; height: 34px;
  box-sizing: border-box; border-radius: 50%;
  border: 17px solid #9D85FF;
  transform: scale(0);
  animation: xl-ring .5s cubic-bezier(.21, .61, .35, 1) both;
}
@keyframes xl-ring {
  0%   { transform: scale(0);    border-width: 17px; border-color: #C9BCFF; }
  45%  { transform: scale(.85);  border-width: 17px; border-color: #7C5CFF; }
  100% { transform: scale(1.15); border-width: 0;    border-color: #C9F26B; }
}
.xl-burst i {
  position: absolute; left: -3px; top: -3px; width: 6px; height: 6px;
  border-radius: 50%; background: #7C5CFF; opacity: 0;
  transform: rotate(var(--a)) translateY(-9px);
  animation: xl-dot .62s cubic-bezier(.2, .8, .3, 1) .24s both;
}
.xl-burst i.s {
  left: -2px; top: -2px; width: 4px; height: 4px;
  background: #C9F26B;
  box-shadow: 0 0 0 1px rgba(11, 11, 15, .08);
  animation-name: xl-dot-s;
}
@keyframes xl-dot {
  0%   { opacity: 1; transform: rotate(var(--a)) translateY(-9px) scale(1); }
  100% { opacity: 0; transform: rotate(var(--a)) translateY(-25px) scale(.2); }
}
@keyframes xl-dot-s {
  0%   { opacity: 1; transform: rotate(var(--a)) translateY(-7px) scale(1); }
  100% { opacity: 0; transform: rotate(var(--a)) translateY(-20px) scale(.2); }
}

/* ── where the heart sits on each kind of card ──────────────────
   The wall's website and resume cards, and the resume page's layouts,
   put their text in one block and the heart to its right. */
.gw-w-meta.has-like,
.gw-r-meta.has-like,
.rz-card-meta.has-like { display: flex; align-items: center; gap: 10px; }
.has-like > .xl-txt { flex: 1; min-width: 0; display: block; }
.rz-card-meta.has-like .rz-card-layout { display: inline-block; margin-top: 4px; }

/* ── the thank-you card ───────────────────────────────────────────
   The sign-in cheer (ambience.css, .xt.party) with a heart in it that
   beats twice as it arrives. */
.xt.love .xt-icon svg { fill: var(--bg-0, #0B0C0F); stroke: none; }
.xt.love.in .xt-icon svg { animation: xl-beat 1.1s ease-in-out .25s 2; }
@keyframes xl-beat {
  0%, 100% { transform: scale(1); }
  14%      { transform: scale(1.28); }
  28%      { transform: scale(1); }
  42%      { transform: scale(1.16); }
  70%      { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .xl-burst { display: none; }
  .xl-like.is-pop .xl-h,
  .xt.love.in .xt-icon svg { animation: none; }
  .xl-h { transition: none; }
}
