/* ═══════════════════════════════════════════════════
   EDGARITO VISUAL EFFECTS
   ═══════════════════════════════════════════════════ */

/* ── Electric Border ────────────────────────────── */

.electric-border {
  --eb-color: var(--accent-gold);
  --eb-light: var(--accent-gold-bright);
  position: relative;
  border-radius: inherit;
  overflow: visible;
  isolation: isolate;
}

.electric-border canvas {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 2;
  display: block;
}

.electric-border .eb-content {
  position: relative;
  border-radius: inherit;
  z-index: 1;
}

/* ── Star Border ────────────────────────────────── */

.star-border {
  display: inline-flex;
  position: relative;
  border-radius: inherit;
  overflow: hidden;
  isolation: isolate;
}

.star-border .sb-glow-top,
.star-border .sb-glow-bottom {
  position: absolute;
  width: 300%;
  height: 50%;
  border-radius: 50%;
  opacity: 0.70;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(
    ellipse at center,
    var(--accent-gold) 0%,
    transparent 70%
  );
}

.star-border .sb-glow-top {
  left: -250%;
  top: -12px;
  animation: sb-move-top 4s linear infinite alternate;
}

.star-border .sb-glow-bottom {
  right: -250%;
  bottom: -12px;
  animation: sb-move-bottom 4s linear infinite alternate;
}

.star-border .sb-inner {
  position: relative;
  z-index: 1;
  display: inline-flex;
  border-radius: inherit;
  overflow: hidden;
}

@keyframes sb-move-top {
  0% { transform: translate(0); opacity: 1; }
  100% { transform: translate(100%); opacity: 0; }
}

@keyframes sb-move-bottom {
  0% { transform: translate(0); opacity: 1; }
  100% { transform: translate(-100%); opacity: 0; }
}

/* ── Glitch Text ────────────────────────────────── */

.glitch {
  display: inline-block;
  position: relative;
  color: inherit;
  font: inherit;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  color: inherit;
  background: transparent;
  overflow: hidden;
  clip-path: inset(0 0 0 0);
  pointer-events: none;
}

.glitch::after {
  left: 4px;
  text-shadow: -4px 0 var(--accent-gold);
  animation: glitch-anim 3s infinite linear alternate-reverse;
}

.glitch::before {
  left: -4px;
  text-shadow: 4px 0 var(--accent-gold-bright);
  animation: glitch-anim 2s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
  0% { clip-path: inset(20% 0 50% 0); }
  5% { clip-path: inset(10% 0 60% 0); }
  10% { clip-path: inset(15% 0 55% 0); }
  15% { clip-path: inset(25% 0 35% 0); }
  20% { clip-path: inset(30% 0 40% 0); }
  25% { clip-path: inset(40% 0 20% 0); }
  30% { clip-path: inset(10% 0 60% 0); }
  35% { clip-path: inset(15% 0 55% 0); }
  40% { clip-path: inset(25% 0 35% 0); }
  45% { clip-path: inset(30% 0 40% 0); }
  50% { clip-path: inset(20% 0 50% 0); }
  55% { clip-path: inset(10% 0 60% 0); }
  60% { clip-path: inset(15% 0 55% 0); }
  65% { clip-path: inset(25% 0 35% 0); }
  70% { clip-path: inset(30% 0 40% 0); }
  75% { clip-path: inset(40% 0 20% 0); }
  80% { clip-path: inset(20% 0 50% 0); }
  85% { clip-path: inset(10% 0 60% 0); }
  90% { clip-path: inset(15% 0 55% 0); }
  95% { clip-path: inset(25% 0 35% 0); }
  100% { clip-path: inset(30% 0 40% 0); }
}

/* ── Decrypt Text ───────────────────────────────── */

.decrypt-wrapper {
  display: inline-block;
  white-space: inherit;
}

.decrypt-revealed {
  color: inherit;
}

.decrypt-encrypted {
  color: var(--accent-gold);
  opacity: 0.75;
  text-shadow: 0 0 14px rgba(200, 164, 78, 0.35);
}

/* ── Gradient Text ─────────────────────────────── */

.gradient-text {
  position: relative;
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  justify-content: flex-start;
}

.gradient-text .gt-content {
  max-width: 100%;
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-bright), var(--accent-gold-dark));
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  font: inherit;
}

/* ── Shiny Text ─────────────────────────────────── */

.shiny-text {
  display: inline-block;
  font: inherit;
  white-space: inherit;
  background: linear-gradient(
    90deg,
    var(--text-primary) 0%,
    var(--accent-gold-bright) 50%,
    var(--text-primary) 100%
  );
  background-size: 200% auto;
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: shiny-scroll 3s ease-in-out infinite;
}

@keyframes shiny-scroll {
  0% { background-position: 0% center; }
  50% { background-position: 100% center; }
  100% { background-position: 0% center; }
}

/* ── Animated Background Pattern ────────────────── */

.bg-pattern {
  position: relative;
}

.bg-pattern::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      135deg,
      rgba(200, 164, 78, 0.018) 0 1px,
      transparent 1px 38px
    );
  pointer-events: none;
  z-index: 0;
}

/* ── Counter Animation ──────────────────────────── */

.counter-animated {
  display: inline-block;
  font-variant-numeric: tabular-nums;
}

/* ── Fade in on scroll ──────────────────────────── */

.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Pulse glow ─────────────────────────────────── */

.pulse-glow {
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 16px rgba(200, 164, 78, 0.15);
  }
  50% {
    box-shadow: 0 0 32px rgba(200, 164, 78, 0.35);
  }
}
