/* Black Node Systems — Animations & Transitions */

/* Scroll Reveal Classes */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

[data-reveal].is-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delays */
[data-reveal-delay="100"] {
  transition-delay: 100ms;
}

[data-reveal-delay="200"] {
  transition-delay: 200ms;
}

[data-reveal-delay="300"] {
  transition-delay: 300ms;
}

[data-reveal-delay="400"] {
  transition-delay: 400ms;
}

/* Vector Network Signal Trace Animation */
@keyframes signalFlow {
  0% {
    stroke-dashoffset: 100;
  }
  100% {
    stroke-dashoffset: 0;
  }
}

.anim-trace {
  stroke-dasharray: 8 16;
  animation: signalFlow 20s linear infinite;
}

.anim-trace-reverse {
  stroke-dasharray: 8 16;
  animation: signalFlow 25s linear infinite reverse;
}

/* Dynamic Node Pulse (Micro-illumination on active cluster) */
@keyframes subtleNodeGlow {
  0%, 100% {
    opacity: 0.3;
  }
  50% {
    opacity: 0.8;
  }
}

.anim-node-pulse {
  animation: subtleNodeGlow 4s ease-in-out infinite;
}

/* Animated Image Frame Motion */
@keyframes bnImageFrameGlow {
  0%, 100% {
    border-color: rgba(84, 214, 160, 0.28);
    box-shadow:
      0 0 0 1px rgba(84, 214, 160, 0.08),
      0 8px 24px rgba(0, 0, 0, 0.28);
  }
  50% {
    border-color: rgba(84, 214, 160, 0.72);
    box-shadow:
      0 0 0 1px rgba(84, 214, 160, 0.22),
      0 0 22px rgba(84, 214, 160, 0.16),
      0 12px 28px rgba(0, 0, 0, 0.36);
  }
}

@keyframes bnScanSweep {
  0% {
    transform: translateX(-130%) skewX(-18deg);
  }
  60%, 100% {
    transform: translateX(240%) skewX(-18deg);
  }
}

.img-motion-frame,
.article-image,
.article-cover,
.article-prose img {
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  border: 1px solid rgba(84, 214, 160, 0.32);
  background: rgba(8, 10, 13, 0.65);
  animation: bnImageFrameGlow 4.2s ease-in-out infinite;
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.img-motion-frame::after,
.article-cover::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 45%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(84, 214, 160, 0.12),
    transparent
  );
  animation: bnScanSweep 6.5s ease-in-out infinite;
  pointer-events: none;
}

.article-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.article-cover {
  padding: 6px;
}

.article-cover img {
  width: 100%;
  max-height: 440px;
  object-fit: cover;
  display: block;
  border: none;
  animation: none;
  border-radius: 4px;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.article-prose img {
  max-width: 100%;
  height: auto;
  padding: 4px;
  display: block;
  margin-inline: auto;
}

.img-motion-frame:hover,
.article-card:hover .article-image,
.article-cover:hover,
.article-prose img:hover {
  border-color: #54D6A0;
  box-shadow: 0 0 24px rgba(84, 214, 160, 0.22);
}

.article-card:hover .article-image,
.article-cover:hover img,
.article-prose img:hover {
  transform: scale(1.02);
}


/* 360° Rotating Light Border */
@keyframes bnOrbitSpin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.border-orbit-360 {
  position: relative;
  border-radius: 12px;
  padding: 2px; 
  background: #54D6A0;
  overflow: hidden;
  isolation: isolate;
}

.border-orbit-360::before {
  content: "";
  position: absolute;
  inset: -150%; 
  z-index: 0;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    transparent 270deg,
    rgba(255, 255, 255, 0.25) 315deg,
    #54D6A0 345deg,
    rgba(255, 255, 255, 0.85) 356deg,
    transparent 360deg
  );
  animation: bnOrbitSpin 3.5s linear infinite;
  will-change: transform;
  pointer-events: none;
}

.border-orbit-360 > * {
  position: relative;
  z-index: 1;
  border-radius: 10px; 
  background: #080d12;
}

/* Respect user's motion preferences */

@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .anim-trace,
  .anim-trace-reverse,
  .anim-node-pulse,
  .img-motion-frame,
  .article-image,
  .article-cover,
  .article-cover img,
  .article-prose img,
  .img-motion-frame::after,
  .article-cover::after {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
}


@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
  }
}