/*
  Cell affordance — the soft ring that tells a visitor a hexagon is live.

  The ring is born near the wall (scale .74) and dies exactly on it (.97), so it
  never leaves its own hexagon and the stage's edge cropping can't eat it. Stroke
  weight is its own keyframe track rather than a by-product of the transform, so
  "very light at birth, heavier on arrival" is tunable on its own; peak opacity
  stays low (.30) so gaining weight never reads as gaining volume.

  Stroke is in design units (no non-scaling-stroke) so it scales with stage.js's
  --scale like everything else on the page. The first-iteration delay clears the
  hive build-in wave in hive.js, so the ring never competes with cells landing.
  Only one ring is ever in flight: the cycle carries a silent tail so the next
  ripple cannot start before the previous has completely gone.

  A cell retires its own ring once it has been hovered or tapped — see
  scripts/affordance.js, which adds .is-known.
*/

.cell__ripple {
  position: absolute; inset: 0; pointer-events: none;
  transition: opacity 0.35s var(--ease);
}
.cell__ripple svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.cell__ripple use {
  fill: none; stroke: var(--cream); opacity: 0;
  transform-origin: 240px 240px;                 /* centre of the 480-unit hex box */
  animation: bzb-ring 5.2s cubic-bezier(0.3, 0.55, 0.25, 1) 2.6s infinite;
}
/*
  One ring at a time. The cycle is 5.2s but the ripple itself is done by 65%
  (3.4s): the last 1.8s holds it finished and invisible, so a new ring can never
  begin before the previous one has fully faded.
*/
@keyframes bzb-ring {
  0%   { transform: scale(0.74); stroke-width: 2.2; opacity: 0; }
  12%  { opacity: 0.3; }
  47%  { opacity: 0.22; }
  65%  { transform: scale(0.97); stroke-width: 6.4; opacity: 0; }
  100% { transform: scale(0.97); stroke-width: 6.4; opacity: 0; }
}

/*
  The stacked cell is 242 units against the desktop's 480, so an identical stroke
  would render at half the weight on a phone — near-invisible at the light end.
  Doubling the ramp keeps the ring at the same on-screen weight on both layouts.
*/
.m-cell .cell__ripple use { animation-name: bzb-ring-stacked; }
@keyframes bzb-ring-stacked {
  0%   { transform: scale(0.74); stroke-width: 4.4; opacity: 0; }
  12%  { opacity: 0.32; }
  47%  { opacity: 0.24; }
  65%  { transform: scale(0.97); stroke-width: 12.7; opacity: 0; }
  100% { transform: scale(0.97); stroke-width: 12.7; opacity: 0; }
}

/* Learned: this cell has been hovered or tapped, so it stops inviting. */
.cell.is-known .cell__ripple { opacity: 0; }

/* The ring is a nicety, not information — reduced motion drops it entirely. */
@media (prefers-reduced-motion: reduce) {
  .cell__ripple { display: none; }
}
