/* Holo Reserve Alert Bar — base styles, layout offset, and bar shell.
   Theme + effect styles are appended in subsequent tasks. */

/* Layout offset — redirect the theme nav's top to track the bar height.
   Plugin sets --hr-alert-h on :root from PHP (first paint) and JS (live). */
:root {
  --hr-alert-h: 0px;
  /* Theme glow intensity. Renderer sets --hr-accent-intensity as a 0–1
     fraction of the slider value (slider 60 → 0.6). Used directly as opacity
     on each theme's overlay pseudo-elements, so:
     slider 0   → opacity 0    (no glow)
     slider 60  → opacity 0.6  (default — softer than max)
     slider 100 → opacity 1.0  (full boost — visibly brighter than default) */
  --hr-accent-mult: var(--hr-accent-intensity, 0.6);
}

.nav { top: var(--hr-alert-h, 0px) !important; transition: top 250ms ease; }
body.admin-bar .nav { top: calc(var(--hr-alert-h, 0px) + 32px) !important; }
@media (max-width: 782px) {
  body.admin-bar .nav { top: calc(var(--hr-alert-h, 0px) + 46px) !important; }
}
body { padding-top: calc(58px + var(--hr-alert-h, 0px)); }

/* Bar shell. */
.hrab-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1001;
  height: 38px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(18, 6, 31, 0.96);
  color: #e6dff5;
  font-family: 'Outfit', sans-serif; font-size: 14px; line-height: 1.2;
  overflow: hidden;
  transform: translateY(0); opacity: 1;
  transition: transform 250ms ease, opacity 250ms ease, height 250ms ease;
  contain: layout paint;
}
body.admin-bar .hrab-bar { top: 32px; }
@media (max-width: 782px) { body.admin-bar .hrab-bar { top: 46px; } }

.hrab-bar.is-dismissed { transform: translateY(-100%); opacity: 0; pointer-events: none; }

.hrab-bar.is-expanded { height: auto; align-items: stretch; }
.hrab-bar.is-expanded .hrab-msg.is-active {
  position: static; white-space: normal; overflow: visible; text-overflow: unset;
  padding: 9px 64px; text-align: center;
}

/* Message layers. */
.hrab-msg {
  position: absolute; inset: 0; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  gap: 14px; padding: 0 64px;
  opacity: 0; pointer-events: none;
  transition: opacity 600ms ease;
}
.hrab-msg.is-active { opacity: 1; pointer-events: auto; }
.hrab-msg__body {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: inline-block; max-width: 100%; letter-spacing: 0.2px;
}
.hrab-bar.is-expanded .hrab-msg__body { white-space: normal; }
.hrab-msg__link { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 14px; }
.hrab-msg__link:hover .hrab-msg__body { text-decoration: underline; text-underline-offset: 4px; }

/* Diamond bullets. */
.hrab-diamond {
  width: 8px; height: 8px; flex-shrink: 0;
  background: linear-gradient(135deg, #00C9DB, #9B59B6, #FF6B9D);
  transform: rotate(45deg); border-radius: 1px; opacity: 0.65;
}
@media (max-width: 480px) { .hrab-diamond { display: none; } }

/* Buttons — expand chevron + dismiss ×. */
.hrab-expand, .hrab-dismiss {
  position: absolute; top: 50%; transform: translateY(-50%);
  z-index: 2;
  background: transparent; border: 0;
  width: 32px; height: 32px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: rgba(230, 223, 245, 0.75);
  cursor: pointer; padding: 0;
  transition: background-color 150ms ease, color 150ms ease, transform 200ms ease;
}
.hrab-expand:hover, .hrab-dismiss:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.hrab-expand:focus-visible, .hrab-dismiss:focus-visible { outline: 2px solid #00C9DB; outline-offset: 2px; }
.hrab-expand { right: 44px; }
.hrab-dismiss { right: 8px; }
.hrab-bar:not(.has-overflow) .hrab-expand { display: none; }
.hrab-bar.is-expanded .hrab-expand { transform: translateY(-50%) rotate(180deg); }
.hrab-bar:not(:has(.hrab-dismiss)) .hrab-expand { right: 8px; }
.hrab-bar.has-overflow .hrab-msg,
.hrab-bar.has-overflow.is-expanded .hrab-msg.is-active { padding-right: 92px; }

/* Mobile sizing. */
@media (max-width: 782px) {
  .hrab-bar { height: 34px; font-size: 12.5px; }
  .hrab-msg { gap: 10px; padding: 0 56px; }
  .hrab-bar.has-overflow .hrab-msg,
  .hrab-bar.has-overflow.is-expanded .hrab-msg.is-active { padding-right: 84px; }
}

/* Reduced motion — pause keyframes, shorten transitions. */
@media (prefers-reduced-motion: reduce) {
  .hrab-bar, .hrab-msg { transition-duration: 200ms !important; }
  .hrab-bar *, .hrab-bar *::before, .hrab-bar *::after { animation-play-state: paused !important; }
}

/* Bar theme — Subtle Glow (default).
   Animated brand-gradient hairlines top + bottom with breathing halo. */
.hrab-bar[data-theme="subtle-glow"] {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.02), transparent 30%),
    linear-gradient(90deg, rgba(18,6,31,0.96), rgba(36,24,72,0.96), rgba(18,6,31,0.96));
}
.hrab-bar[data-theme="subtle-glow"]::before,
.hrab-bar[data-theme="subtle-glow"]::after {
  content: ''; position: absolute; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, rgba(0,201,219,0.65), rgba(155,89,182,0.85), rgba(255,107,157,0.65));
  pointer-events: none;
  opacity: var(--hr-accent-mult, 1);
  animation: hrab-sg-glow 3.4s ease-in-out infinite;
}
.hrab-bar[data-theme="subtle-glow"]::before { top: 0; }
.hrab-bar[data-theme="subtle-glow"]::after  { bottom: 0; }

@keyframes hrab-sg-glow {
  0%, 100% { box-shadow: 0 0 6px 1px rgba(0,201,219,0.45), 0 0 14px 2px rgba(155,89,182,0.30), 0 0 28px 4px rgba(255,107,157,0.10); }
  50%      { box-shadow: 0 0 10px 2px rgba(0,201,219,0.65), 0 0 22px 4px rgba(155,89,182,0.45), 0 0 40px 8px rgba(255,107,157,0.18); }
}

/* Bar theme — Holographic Sweep. */
.hrab-bar[data-theme="holographic-sweep"] {
  background: linear-gradient(90deg, rgba(18,6,31,0.96), rgba(36,24,72,0.96), rgba(18,6,31,0.96));
}
.hrab-bar[data-theme="holographic-sweep"]::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,0.10) 48%, rgba(255,255,255,0.18) 50%, rgba(255,255,255,0.10) 52%, transparent 65%);
  background-size: 250% 100%;
  animation: hrab-hs-sweep 6s ease-in-out infinite;
  pointer-events: none; mix-blend-mode: screen;
  opacity: var(--hr-accent-mult, 1);
}
.hrab-bar[data-theme="holographic-sweep"]::after {
  content: ''; position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 120 120' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='hsd'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='2.5' numOctaves='4' seed='9'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncR type='discrete' tableValues='0 0 0 0 0 0 0 0 1'/%3E%3CfeFuncG type='discrete' tableValues='0 0 0 0 0 0 0 0 1'/%3E%3CfeFuncB type='discrete' tableValues='0 0 0 0 0 0 0 0 1'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23hsd)' opacity='0.28'/%3E%3C/svg%3E");
  background-size: 80px;
  mix-blend-mode: overlay; pointer-events: none; opacity: var(--hr-accent-mult, 1);
}

@keyframes hrab-hs-sweep {
  0%   { background-position: 250% 0; }
  100% { background-position: -150% 0; }
}

/* Bar theme — Conic Aurora.
   Drifting brand-color blobs with mix-blend-mode: screen so colors brighten
   where they overlap (real-aurora behavior). Two pseudo-element layers move
   in opposite directions to create flowing, undulating bands. */
.hrab-bar[data-theme="conic-aurora"] {
  background: linear-gradient(180deg, #12061f, #1a0a30);
}

/* Layer 1 — cool bands (teal + icy-teal + violet), drift left → right. */
.hrab-bar[data-theme="conic-aurora"]::before {
  content: ''; position: absolute; inset: -50% -15%;
  background:
    radial-gradient(ellipse 22% 120% at 12% 50%, rgba(0,201,219,0.75), transparent 65%),
    radial-gradient(ellipse 28% 130% at 38% 50%, rgba(92,200,215,0.6), transparent 65%),
    radial-gradient(ellipse 24% 120% at 62% 50%, rgba(155,89,182,0.7), transparent 65%),
    radial-gradient(ellipse 22% 110% at 88% 50%, rgba(0,201,219,0.55), transparent 65%);
  filter: blur(7px);
  animation: hrab-ca-drift-a 18s ease-in-out infinite alternate;
  mix-blend-mode: screen;
  pointer-events: none;
  opacity: var(--hr-accent-mult, 1);
}

/* Layer 2 — warm bands (rose + warm-rose), drift right → left. */
.hrab-bar[data-theme="conic-aurora"]::after {
  content: ''; position: absolute; inset: -50% -15%;
  background:
    radial-gradient(ellipse 30% 130% at 25% 50%, rgba(255,107,157,0.65), transparent 65%),
    radial-gradient(ellipse 28% 120% at 70% 50%, rgba(232,130,155,0.55), transparent 65%);
  filter: blur(6px);
  animation: hrab-ca-drift-b 24s ease-in-out infinite alternate;
  mix-blend-mode: screen;
  pointer-events: none;
  opacity: var(--hr-accent-mult, 1);
}

@keyframes hrab-ca-drift-a {
  from { transform: translateX(-12%); }
  to   { transform: translateX(12%); }
}
@keyframes hrab-ca-drift-b {
  from { transform: translateX(14%); }
  to   { transform: translateX(-14%); }
}

/* Bar theme — Scanline Neon.
   Visible CRT-style scanlines that slowly scroll vertically, plus pulsing
   teal/rose neon edges and a subtle phosphor glow at the center. */
.hrab-bar[data-theme="scanline-neon"] {
  background: linear-gradient(90deg, rgba(18,6,31,0.96), rgba(36,24,72,0.96), rgba(18,6,31,0.96));
  box-shadow:
    inset 0 1px 0 rgba(0,201,219,0.6), inset 0 -1px 0 rgba(255,107,157,0.6),
    0 0 24px rgba(0,201,219,0.18), 0 0 38px rgba(255,107,157,0.10);
  animation: hrab-sn-bloom 2.4s ease-in-out infinite;
}

/* Scanlines layer — visible, scrolling. Inset 2px so it doesn't dilute the
   neon top/bottom edges (which are inset box-shadows on the bar). Uses screen
   blend (additive — brightens beneath) instead of overlay (which barely
   registered against the dark bar). */
.hrab-bar[data-theme="scanline-neon"]::before {
  content: ''; position: absolute; inset: 2px 0;
  background: repeating-linear-gradient(
    0deg,
    transparent 0px, transparent 2px,
    rgba(255,255,255,0.22) 2px, rgba(255,255,255,0.22) 3px
  );
  background-size: 100% 6px;
  animation: hrab-sn-scroll 6s linear infinite;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: var(--hr-accent-mult, 1);
}

/* Center phosphor glow — adds a CRT-screen tint. */
.hrab-bar[data-theme="scanline-neon"]::after {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 80% 200% at 30% 50%, rgba(0,201,219,0.18), transparent 60%),
    radial-gradient(ellipse 80% 200% at 70% 50%, rgba(255,107,157,0.15), transparent 60%);
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: var(--hr-accent-mult, 1);
}

@keyframes hrab-sn-scroll {
  from { background-position: 0 0; }
  to   { background-position: 0 6px; }
}

@keyframes hrab-sn-bloom {
  0%, 100% {
    box-shadow:
      inset 0 1px 0 rgba(0,201,219,0.5), inset 0 -1px 0 rgba(255,107,157,0.5),
      0 0 18px rgba(0,201,219,0.14), 0 0 30px rgba(255,107,157,0.08);
  }
  50% {
    box-shadow:
      inset 0 1px 0 rgba(0,201,219,0.85), inset 0 -1px 0 rgba(255,107,157,0.85),
      0 0 30px rgba(0,201,219,0.30), 0 0 50px rgba(255,107,157,0.18);
  }
}

/* Inline effect — shimmer. Animated brand-gradient text via background-clip. */
.hrfx--shimmer {
  background: linear-gradient(135deg, #00C9DB, #9B59B6, #FF6B9D, #00C9DB);
  background-size: 300% 300%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  font-weight: 700;
  animation: hrfx-shimmer 5s ease infinite;
}
.hrfx--shimmer[data-gradient="teal-violet"] {
  background: linear-gradient(135deg, #00C9DB, #9B59B6, #00C9DB);
  background-size: 300% 300%;
  -webkit-background-clip: text; background-clip: text;
}
.hrfx--shimmer[data-gradient="wide"] {
  background: linear-gradient(135deg, #00C9DB 0%, #5CC8D7 25%, #9B59B6 50%, #E8829B 75%, #FF6B9D 100%);
  background-size: 300% 300%;
  -webkit-background-clip: text; background-clip: text;
}
.hrfx--shimmer[data-speed="slow"] { animation-duration: 8s; }
.hrfx--shimmer[data-speed="fast"] { animation-duration: 2.5s; }

@keyframes hrfx-shimmer {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Inline effect — glow. */
.hrfx--glow {
  font-weight: 700; color: #00C9DB;
  text-shadow: 0 0 4px rgba(0,201,219,0.85), 0 0 10px rgba(0,201,219,0.55), 0 0 20px rgba(0,201,219,0.30);
}
.hrfx--glow[data-color="violet"] { color: #C39CE0; text-shadow: 0 0 4px rgba(155,89,182,0.85), 0 0 10px rgba(155,89,182,0.55), 0 0 20px rgba(155,89,182,0.30); }
.hrfx--glow[data-color="rose"]   { color: #FF8FB6; text-shadow: 0 0 4px rgba(255,107,157,0.85), 0 0 10px rgba(255,107,157,0.55), 0 0 20px rgba(255,107,157,0.30); }
.hrfx--glow[data-color="brand-cycling"] { animation: hrfx-glow-cycle 6s ease-in-out infinite; }
.hrfx--glow[data-intensity="soft"]   { text-shadow: 0 0 3px rgba(0,201,219,0.55), 0 0 7px rgba(0,201,219,0.30); }
.hrfx--glow[data-intensity="strong"] { text-shadow: 0 0 6px rgba(0,201,219,0.95), 0 0 16px rgba(0,201,219,0.70), 0 0 30px rgba(0,201,219,0.40); }
.hrfx--glow[data-color="violet"][data-intensity="strong"] { text-shadow: 0 0 6px rgba(155,89,182,0.95), 0 0 16px rgba(155,89,182,0.70), 0 0 30px rgba(155,89,182,0.40); }
.hrfx--glow[data-color="rose"][data-intensity="strong"]   { text-shadow: 0 0 6px rgba(255,107,157,0.95), 0 0 16px rgba(255,107,157,0.70), 0 0 30px rgba(255,107,157,0.40); }

@keyframes hrfx-glow-cycle {
  0%   { color: #00C9DB; text-shadow: 0 0 4px rgba(0,201,219,0.85), 0 0 12px rgba(0,201,219,0.50); }
  33%  { color: #C39CE0; text-shadow: 0 0 4px rgba(155,89,182,0.85), 0 0 12px rgba(155,89,182,0.50); }
  66%  { color: #FF8FB6; text-shadow: 0 0 4px rgba(255,107,157,0.85), 0 0 12px rgba(255,107,157,0.50); }
  100% { color: #00C9DB; text-shadow: 0 0 4px rgba(0,201,219,0.85), 0 0 12px rgba(0,201,219,0.50); }
}

/* Inline effect — pulse. */
.hrfx--pulse { font-weight: 700; color: #FF8FB6; animation: hrfx-pulse-rose 1.6s ease-in-out infinite; }
.hrfx--pulse[data-color="teal"]   { color: #00C9DB; animation-name: hrfx-pulse-teal; }
.hrfx--pulse[data-color="violet"] { color: #C39CE0; animation-name: hrfx-pulse-violet; }
.hrfx--pulse[data-speed="slow"] { animation-duration: 2.6s; }
.hrfx--pulse[data-speed="fast"] { animation-duration: 1s; }

@keyframes hrfx-pulse-rose {
  0%, 100% { opacity: 0.7; text-shadow: 0 0 4px rgba(255,107,157,0.45); }
  50%      { opacity: 1;   text-shadow: 0 0 10px rgba(255,107,157,0.85), 0 0 22px rgba(255,107,157,0.45); }
}
@keyframes hrfx-pulse-teal {
  0%, 100% { opacity: 0.7; text-shadow: 0 0 4px rgba(0,201,219,0.45); }
  50%      { opacity: 1;   text-shadow: 0 0 10px rgba(0,201,219,0.85), 0 0 22px rgba(0,201,219,0.45); }
}
@keyframes hrfx-pulse-violet {
  0%, 100% { opacity: 0.7; text-shadow: 0 0 4px rgba(155,89,182,0.45); }
  50%      { opacity: 1;   text-shadow: 0 0 10px rgba(155,89,182,0.85), 0 0 22px rgba(155,89,182,0.45); }
}

/* Inline effect — sparkle.
   Each sparkle is a real DOM element (<span class="hrfx-star">) injected by
   alert-bar.js with randomized size/position/color/timing — mirrors the
   site's existing newsletter-button sparkle (.nl-star). Per-star DOM means
   each star can scale + rotate in place around its own center, which
   CSS-only multi-background layers cannot do. */

.hrfx--sparkle {
  position: relative;
  display: inline-block;
  font-weight: 700;
  /* Vertical padding sized to roughly the bar's interior so stars can
     distribute top-to-bottom across the bar instead of being confined
     to the text's vertical bounds (~17px). Bar is 38px desktop / 34px
     mobile; text ~14–17px; padding sized to push the wrapper close to
     full bar height so star positions at top: 5–95% span the bar. */
  padding: 11px 6px;
  /* Negative margin offsets the padding's contribution to the surrounding
     line height so the bar's vertical centering stays correct when the
     sparkle is mid-message (e.g. "Save [sparkle]20%[/sparkle] today"). */
  margin: -11px 0;
}

@media (max-width: 782px) {
  .hrfx--sparkle { padding: 9px 6px; margin: -9px 0; }
}

.hrfx--sparkle .hrfx-star {
  position: absolute;
  pointer-events: none;
  animation: hrfx-star-twinkle 3.5s ease-in-out infinite;
  /* backwards fill so positive animation-delay holds the star at the
     keyframe's 0% state (invisible) before the cycle begins — otherwise
     stars show their default styles (visible) during the delay window. */
  animation-fill-mode: backwards;
  filter: drop-shadow(0 0 3px currentColor);
  z-index: 2;
}
.hrfx--sparkle .hrfx-star svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Color variants — only affect the wrapper's text color; the star colors
   are randomized in JS (different palettes per data-color). */
.hrfx--sparkle[data-color="teal"]    { color: #00C9DB; }
.hrfx--sparkle[data-color="violet"]  { color: #C39CE0; }
.hrfx--sparkle[data-color="rose"]    { color: #FF8FB6; }

/* Twinkle — mirrors the theme's newsletter-button nl-star-twinkle so bar
   sparkles read with the same visual language as button sparkles. */
@keyframes hrfx-star-twinkle {
  0%   { opacity: 0;   transform: scale(0)   rotate(0deg); }
  5%   { opacity: 0.7; transform: scale(0.5) rotate(15deg); }
  12%  { opacity: 1;   transform: scale(1)   scaleX(1.4) rotate(30deg); }
  20%  { opacity: 1;   transform: scale(1.1) scaleY(1.3) rotate(55deg); }
  28%  { opacity: 0.8; transform: scale(0.8) rotate(80deg); }
  35%  { opacity: 0.4; transform: scale(0.2) rotate(95deg); }
  42%, 100% { opacity: 0; transform: scale(0) rotate(110deg); }
}

/* @property registration so the conic gradient's `from` angle is a true
   interpolatable angle (default CSS custom properties are tokens, not animatable).
   Lets us rotate the gradient seamlessly from 0deg to 360deg. */
@property --hrfx-holo-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

/* Inline effect — holo. Rainbow conic gradient + scanline texture, masked to text.
   Animates the gradient's `from` angle so 0deg and 360deg are visually identical —
   no abrupt color jump at the loop boundary. */
.hrfx--holo {
  font-weight: 700;
  background:
    repeating-linear-gradient(0deg, transparent 0 1px, rgba(255,255,255,0.18) 1px 2px),
    conic-gradient(from var(--hrfx-holo-angle, 0deg) at 50% 50%, #00C9DB, #FFD86B, #9B59B6, #FF6B9D, #5CC8D7, #00C9DB);
  background-size: 100% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: hrfx-holo-spin 8s linear infinite;
}
.hrfx--holo[data-speed="slow"] { animation-duration: 14s; }
.hrfx--holo[data-speed="fast"] { animation-duration: 4s; }

@keyframes hrfx-holo-spin {
  0%   { --hrfx-holo-angle: 0deg; }
  100% { --hrfx-holo-angle: 360deg; }
}

/* Gradient-text effects (shimmer, holo) set -webkit-text-fill-color and
   color to transparent so a background gradient shows through the glyphs.
   Both properties cascade — any nested .hrfx inside them would inherit the
   transparent fill and disappear. Reset on inner .hrfx so layered effects
   stay visible. The trade-off: the parent's gradient does not show through
   the child's glyphs (background-clip:text only clips an element's own text),
   so shimmer-or-holo + another effect renders the inner effect alone. */
.hrfx--shimmer .hrfx,
.hrfx--holo .hrfx {
  -webkit-text-fill-color: currentColor;
}

/* Inline effect — underline. Animated brand-gradient underline with neon glow. */
.hrfx--underline {
  position: relative; display: inline-block; font-weight: 600;
  padding-bottom: 3px;
}
.hrfx--underline::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0;
  height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, #00C9DB, #9B59B6, #FF6B9D, #9B59B6, #00C9DB);
  background-size: 200% 100%;
  animation: hrfx-underline-flow 3s ease infinite, hrfx-underline-glow 2.5s ease-in-out infinite;
}
.hrfx--underline[data-color="teal"]::after   { background: linear-gradient(90deg, #00C9DB, #5CC8D7, #00C9DB); background-size: 200% 100%; }
.hrfx--underline[data-color="violet"]::after { background: linear-gradient(90deg, #9B59B6, #C39CE0, #9B59B6); background-size: 200% 100%; }
.hrfx--underline[data-color="rose"]::after   { background: linear-gradient(90deg, #FF6B9D, #E8829B, #FF6B9D); background-size: 200% 100%; }
.hrfx--underline[data-thickness="thin"]::after  { height: 1px; }
.hrfx--underline[data-thickness="thick"]::after { height: 3px; }

@keyframes hrfx-underline-flow {
  0%   { background-position: 0% 0; }
  100% { background-position: 200% 0; }
}
@keyframes hrfx-underline-glow {
  0%, 100% { box-shadow: 0 0 6px 1px rgba(0,201,219,0.45), 0 0 14px 2px rgba(155,89,182,0.30); }
  50%      { box-shadow: 0 0 10px 2px rgba(0,201,219,0.70), 0 0 22px 4px rgba(155,89,182,0.45); }
}

/* Inline effect — glitch. Subtle RGB-split chromatic aberration on a slow loop. */
.hrfx--glitch {
  position: relative; display: inline-block; font-weight: 700; color: #fff;
  animation: hrfx-glitch-base 4s steps(1, end) infinite;
}
.hrfx--glitch::before, .hrfx--glitch::after {
  content: attr(data-text);
  position: absolute; inset: 0; pointer-events: none;
  mix-blend-mode: screen; opacity: 0.85;
}
.hrfx--glitch::before { color: #00C9DB; animation: hrfx-glitch-r 4s steps(1, end) infinite; }
.hrfx--glitch::after  { color: #FF6B9D; animation: hrfx-glitch-l 4s steps(1, end) infinite; }
.hrfx--glitch[data-intensity="subtle"]::before, .hrfx--glitch[data-intensity="subtle"]::after { opacity: 0.55; }
.hrfx--glitch[data-intensity="strong"]::before, .hrfx--glitch[data-intensity="strong"]::after { opacity: 1; }

@keyframes hrfx-glitch-base {
  0%, 92%, 100% { transform: translate(0,0); }
  93% { transform: translate(0.5px,0); }
  95% { transform: translate(-0.5px,0); }
  97% { transform: translate(0.5px,0); }
}
@keyframes hrfx-glitch-r {
  0%, 92%, 100% { transform: translate(0,0); clip-path: inset(0 0 0 0); }
  93% { transform: translate(2px,0);  clip-path: inset(40% 0 30% 0); }
  95% { transform: translate(-2px,0); clip-path: inset(20% 0 60% 0); }
  97% { transform: translate(1.5px,0); clip-path: inset(70% 0 0   0); }
}
@keyframes hrfx-glitch-l {
  0%, 92%, 100% { transform: translate(0,0); clip-path: inset(0 0 0 0); }
  93% { transform: translate(-2px,0); clip-path: inset(0   0 60% 0); }
  95% { transform: translate(2px,0);  clip-path: inset(50% 0 10% 0); }
  97% { transform: translate(-1.5px,0); clip-path: inset(20% 0 40% 0); }
}

/* Inline effect — flicker. Neon-sign behavior: mostly steady glow, with a
   periodic flicker burst (like a slightly faulty sign). The flicker keyframes
   compress all the action into the first ~12-17% of the cycle; the remaining
   time is steady at full opacity. */
.hrfx--flicker {
  font-weight: 700; color: #00C9DB;
  text-shadow: 0 0 4px rgba(0,201,219,0.85), 0 0 10px rgba(0,201,219,0.55);
  animation: hrfx-flicker-2 8s steps(1, end) infinite;
}
.hrfx--flicker[data-color="violet"] {
  color: #C39CE0;
  text-shadow: 0 0 4px rgba(155,89,182,0.85), 0 0 10px rgba(155,89,182,0.55);
}
.hrfx--flicker[data-color="rose"] {
  color: #FF8FB6;
  text-shadow: 0 0 4px rgba(255,107,157,0.85), 0 0 10px rgba(255,107,157,0.55);
}
.hrfx--flicker[data-flickers="1"] { animation-name: hrfx-flicker-1; animation-duration: 6s; }
.hrfx--flicker[data-flickers="3"] { animation-name: hrfx-flicker-3; animation-duration: 10s; }

@keyframes hrfx-flicker-1 {
  0%, 100% { opacity: 1; }
  3%       { opacity: 0.2; }
  6%       { opacity: 1; }
}
@keyframes hrfx-flicker-2 {
  0%, 100% { opacity: 1; }
  2%       { opacity: 0.2; }
  5%       { opacity: 1; }
  9%       { opacity: 0.3; }
  12%      { opacity: 1; }
}
@keyframes hrfx-flicker-3 {
  0%, 100% { opacity: 1; }
  2%       { opacity: 0.2; }
  4%       { opacity: 1; }
  7%       { opacity: 0.3; }
  10%      { opacity: 1; }
  14%      { opacity: 0.4; }
  17%      { opacity: 1; }
}

/* Per-message rotation transitions. Layered on entering message via .is-entering.
   The bar's data-transition attribute is set by the JS rotation engine each
   cycle (per-message override > global). */

/* Sweep-in. */
.hrab-bar[data-transition="sweep-in"] .hrab-msg.is-active.is-entering {
  position: absolute; overflow: visible;
}
.hrab-bar[data-transition="sweep-in"] .hrab-msg.is-active.is-entering::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(105deg,
    transparent 25%,
    rgba(255,255,255,0.22) 48%, rgba(255,255,255,0.36) 50%, rgba(255,255,255,0.22) 52%,
    transparent 75%);
  background-size: 250% 100%;
  animation: hrab-sweep-pass 600ms ease forwards;
  pointer-events: none; mix-blend-mode: screen;
}
@keyframes hrab-sweep-pass {
  from { background-position: 250% 0; }
  to   { background-position: -150% 0; }
}

/* Sparkle-burst — JS-injected mini stars, scattered across the BAR (not
   any single message layer). Stars are <span class="hrab-burst-star">
   elements added directly to .hrab-bar by the rotation engine when
   data-transition is sparkle-burst; same SVG path as the inline sparkle
   effect. Selectors stay un-scoped so the rules apply regardless of
   parent (bar today, possibly preview/wizard later). */
.hrab-burst-star {
  position: absolute;
  pointer-events: none;
  filter: drop-shadow(0 0 3px currentColor);
  animation: hrab-burst-star 620ms ease-out forwards;
  z-index: 3;
}
.hrab-burst-star svg {
  width: 100%; height: 100%; display: block;
}
@keyframes hrab-burst-star {
  0%   { opacity: 0; transform: scale(0)   rotate(0deg); }
  25%  { opacity: 1; transform: scale(1.1) rotate(20deg); }
  60%  { opacity: 1; transform: scale(1)   rotate(45deg); }
  100% { opacity: 0; transform: scale(0.6) rotate(70deg); }
}

/* Hologram-flicker — opacity flicker on the layer itself, plus visible
   CRT scanlines + slight chromatic-tint via pseudo-elements during the
   transition window. Scanlines use mix-blend-mode: overlay so they
   register on the dark bar without washing out text. */
.hrab-bar[data-transition="hologram-flicker"] .hrab-msg.is-active.is-entering {
  animation: hrab-hf-flicker 600ms steps(1, end) forwards;
}
.hrab-bar[data-transition="hologram-flicker"] .hrab-msg.is-active.is-entering::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent 0px, transparent 2px,
    rgba(255,255,255,0.22) 2px, rgba(255,255,255,0.22) 3px
  );
  mix-blend-mode: overlay;
  animation: hrab-hf-scan 600ms ease-out forwards;
  z-index: 1;
}
.hrab-bar[data-transition="hologram-flicker"] .hrab-msg.is-active.is-entering::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0,201,219,0.10) 0%, transparent 35%, transparent 65%, rgba(255,107,157,0.10) 100%);
  mix-blend-mode: screen;
  animation: hrab-hf-scan 600ms ease-out forwards;
  z-index: 1;
}
@keyframes hrab-hf-flicker {
  0%, 100% { opacity: 1; }
  10% { opacity: 0.2; } 20% { opacity: 1; }
  35% { opacity: 0.4; } 45% { opacity: 1; }
  60% { opacity: 0.7; } 70% { opacity: 1; }
}
@keyframes hrab-hf-scan {
  0%   { opacity: 0; }
  15%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { opacity: 0; }
}

/* Help-tab live previews — dark backdrop so brand-color effects read on
   the white admin page. Only used inside the ACF settings Help tab. */
.hrab-help-preview {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  padding: 6px 12px;
  background: linear-gradient(90deg, rgba(18,6,31,0.96), rgba(36,24,72,0.96), rgba(18,6,31,0.96));
  border-radius: 6px;
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  color: #e6dff5;
  line-height: 1.2;
}
