/* ============================================================
   Crystal Bull — drop-in element styles
   Scoped under .crystal-bull. No global resets, no font deps.
   All tunables are CSS custom properties (see :root defaults).
   ============================================================ */

.crystal-bull {
  /* ---- tunables (override per-instance via inline style) ---- */
  --cb-width: clamp(320px, 58vw, 880px); /* rendered bull width */
  --cb-glow: #cfe0ff;                    /* halo color (match tint) */
  --cb-glow-amt: 0.45;                   /* halo opacity 0–0.9 */
  --cb-float-dist: 20px;                 /* vertical float travel */
  --cb-float-dur: 8s;                    /* float loop duration */

  position: relative;
  display: inline-grid;
  place-items: center;
  isolation: isolate;            /* keeps mix-blend-mode shine local */
  -webkit-user-select: none;
  user-select: none;
}

/* soft colored halo behind the bull */
.crystal-bull .cb-glow {
  position: absolute;
  z-index: 0;
  left: 50%;
  top: 52%;
  width: 78%;
  aspect-ratio: 1.4 / 1;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse at center, var(--cb-glow) 0%, transparent 62%);
  opacity: var(--cb-glow-amt);
  filter: blur(36px);
  pointer-events: none;
  animation: cb-pulse 7s ease-in-out infinite;
}
@keyframes cb-pulse {
  0%, 100% { opacity: calc(var(--cb-glow-amt) * 0.82); }
  50%      { opacity: var(--cb-glow-amt); }
}

/* layer 1 — mouse parallax (transform set by JS) */
.crystal-bull .cb-parallax {
  position: relative;
  z-index: 1;
  will-change: transform;
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* layer 2 — idle float (CSS keyframe) */
.crystal-bull .cb-float {
  animation: cb-float var(--cb-float-dur) ease-in-out infinite;
}
@keyframes cb-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(calc(-1 * var(--cb-float-dist))) rotate(-0.4deg); }
}

/* the artwork + its shine overlay share one box */
.crystal-bull .cb-box { position: relative; }

.crystal-bull .cb-img {
  display: block;
  width: var(--cb-width);
  height: auto;
  filter: drop-shadow(0 30px 60px rgba(0, 0, 0, 0.45));
}

/* moving specular highlight, clipped to the bull silhouette via mask */
.crystal-bull .cb-shine {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  mix-blend-mode: screen;
  -webkit-mask-size: contain;            mask-size: contain;
  -webkit-mask-repeat: no-repeat;        mask-repeat: no-repeat;
  -webkit-mask-position: center;         mask-position: center;
  /* mask-image is set by JS from the <img> src so it always matches the tint */
  background: radial-gradient(
    circle at var(--cb-mx, 50%) var(--cb-my, 40%),
    rgba(255, 255, 255, 0.85) 0%,
    rgba(255, 255, 255, 0.25) 14%,
    transparent 34%
  );
  transition: opacity 0.4s ease;
}

/* honor reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .crystal-bull .cb-float { animation: none; }
  .crystal-bull .cb-glow  { animation: none; }
  .crystal-bull .cb-parallax { transition: none; }
}
