/* ----------------------------------------------------------------------------
   SPEC-129 §4.5 (M-4) — the neon leaf's membership rhythms. SINGLE SOURCE:
   authored here, byte-copied to public-site/css/leaf-rhythms.css by
   scripts/check-public-site.sh's parity contract (AC-P8). Edit here only.

   Four rhythms (TECHNICAL_SPEC §7, prototype values verbatim):
     on        — steady, rare brief dip                      (active)
     mostly    — frequent multi-blade brownouts               (expires_soon)
     potential — mostly dark, periodic full-ignition tease    (new_visitor)
     attempt   — keeps trying to catch, never fully lit       (in-between states)
   Hard-switching like real neon: steps(1, end) everywhere — never a fade.
   ---------------------------------------------------------------------------- */

@keyframes ab-leaf-potential {
  0%, 66% { opacity: .92; filter: brightness(.82) saturate(.72) drop-shadow(0 0 3px rgba(170,150,215,.45)); }
  67%, 68% { opacity: 1; filter: brightness(1.05) saturate(1) drop-shadow(0 0 4px rgba(255,190,212,.95)) drop-shadow(0 0 14px rgba(248,113,160,.7)) drop-shadow(0 0 30px rgba(248,113,160,.4)); }
  69%, 83% { opacity: .92; filter: brightness(.82) saturate(.72) drop-shadow(0 0 3px rgba(170,150,215,.45)); }
  84%, 85% { opacity: 1; filter: brightness(1.05) saturate(1) drop-shadow(0 0 4px rgba(255,190,212,.95)) drop-shadow(0 0 14px rgba(248,113,160,.7)) drop-shadow(0 0 30px rgba(248,113,160,.4)); }
  86%, 100% { opacity: .92; filter: brightness(.82) saturate(.72) drop-shadow(0 0 3px rgba(170,150,215,.45)); }
}

@keyframes ab-leaf-mostly {
  0%, 28% { opacity: 1; filter: brightness(1.05) saturate(1) drop-shadow(0 0 4px rgba(255,190,212,.95)) drop-shadow(0 0 14px rgba(248,113,160,.7)) drop-shadow(0 0 30px rgba(248,113,160,.4)); }
  29%, 29.6% { opacity: .42; filter: brightness(.42) saturate(.32); }
  30%, 62% { opacity: 1; filter: brightness(1.05) saturate(1) drop-shadow(0 0 4px rgba(255,190,212,.95)) drop-shadow(0 0 14px rgba(248,113,160,.7)) drop-shadow(0 0 30px rgba(248,113,160,.4)); }
  63%, 63.4% { opacity: .42; filter: brightness(.42) saturate(.32); }
  64%, 100% { opacity: 1; filter: brightness(1.05) saturate(1) drop-shadow(0 0 4px rgba(255,190,212,.95)) drop-shadow(0 0 14px rgba(248,113,160,.7)) drop-shadow(0 0 30px rgba(248,113,160,.4)); }
}

@keyframes ab-leaf-on {
  0%, 54% { opacity: 1; filter: brightness(1.05) saturate(1) drop-shadow(0 0 4px rgba(255,190,212,.95)) drop-shadow(0 0 14px rgba(248,113,160,.7)) drop-shadow(0 0 30px rgba(248,113,160,.4)); }
  55%, 55.3% { opacity: .82; filter: brightness(.86) saturate(1) drop-shadow(0 0 3px rgba(255,190,212,.8)) drop-shadow(0 0 10px rgba(248,113,160,.5)); }
  56%, 100% { opacity: 1; filter: brightness(1.05) saturate(1) drop-shadow(0 0 4px rgba(255,190,212,.95)) drop-shadow(0 0 14px rgba(248,113,160,.7)) drop-shadow(0 0 30px rgba(248,113,160,.4)); }
}

@keyframes ab-leaf-attempt {
  0%, 21% { opacity: .92; filter: brightness(.82) saturate(.7) drop-shadow(0 0 3px rgba(170,150,215,.4)); }
  22%, 23% { opacity: 1; filter: brightness(.98) saturate(.85) drop-shadow(0 0 4px rgba(120,190,220,.55)); }
  24%, 49% { opacity: .92; filter: brightness(.82) saturate(.7) drop-shadow(0 0 3px rgba(170,150,215,.4)); }
  50%, 51% { opacity: 1; filter: brightness(1.02) saturate(.95) drop-shadow(0 0 5px rgba(255,190,212,.7)) drop-shadow(0 0 12px rgba(248,113,160,.4)); }
  52%, 77% { opacity: .92; filter: brightness(.82) saturate(.7) drop-shadow(0 0 3px rgba(170,150,215,.4)); }
  78%, 79% { opacity: 1; filter: brightness(1.04) saturate(1) drop-shadow(0 0 5px rgba(255,190,212,.75)) drop-shadow(0 0 16px rgba(248,113,160,.5)); }
  80%, 100% { opacity: .92; filter: brightness(.82) saturate(.7) drop-shadow(0 0 3px rgba(170,150,215,.4)); }
}

/* cycle lengths match the prototype's rAF loops */
.leaf-on        { animation: ab-leaf-on 9s steps(1, end) infinite; }
.leaf-mostly    { animation: ab-leaf-mostly 6s steps(1, end) infinite; }
.leaf-potential { animation: ab-leaf-potential 7s steps(1, end) infinite; }
.leaf-attempt   { animation: ab-leaf-attempt 5.6s steps(1, end) infinite; }

/* Reduced motion: the leaf is simply on (lit states) or quiet glass (unlit
   states) — no rhythm, no tease (AC-12). */
@media (prefers-reduced-motion: reduce) {
  .leaf-on, .leaf-mostly, .leaf-potential, .leaf-attempt { animation: none; }
  .leaf-on, .leaf-mostly {
    opacity: 1;
    filter: brightness(1.05) saturate(1) drop-shadow(0 0 4px rgba(255,190,212,.95)) drop-shadow(0 0 14px rgba(248,113,160,.7));
  }
  .leaf-potential, .leaf-attempt {
    opacity: .92;
    filter: brightness(.82) saturate(.72) drop-shadow(0 0 3px rgba(170,150,215,.45));
  }
}

/* ceremony 'off' — no flicker anywhere; segments render lit (AC-2). */
[data-ceremony="off"] .leaf-on,
[data-ceremony="off"] .leaf-mostly,
[data-ceremony="off"] .leaf-potential,
[data-ceremony="off"] .leaf-attempt {
  animation: none;
  opacity: 1;
  filter: brightness(1.05) saturate(1);
}
