:root {
  --brand-500: #39b54a;
  --brand-600: #009245;
  --ink: #040714;
  --ring-full: 9999px;
}

body {
  background: var(--ink);
}

body.modal-open {
  overflow: hidden;
}

#networkCanvas {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.scan-frame {
  position: absolute;
  top: 20%;
  left: 22%;
  width: 56%;
  height: 58%;
  border: 2px solid var(--brand-500);
  border-radius: 14px;
  box-shadow: 0 0 0 1px rgba(57, 181, 74, 0.35);
}

.scan-line {
  position: absolute;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--brand-500);
  box-shadow: 0 0 14px rgba(57, 181, 74, 0.8);
  animation: scanMove 3.4s ease-in-out infinite;
}

@keyframes scanMove {
  0%,
  100% {
    top: 0%;
    opacity: 0.5;
  }
  50% {
    top: calc(100% - 3px);
    opacity: 1;
  }
}

.float-card {
  animation: floatCard 8s ease-in-out infinite;
}

.mode-chip.active {
  background: var(--brand-500);
  border-color: var(--brand-500);
  color: var(--ink);
}

.result-card {
  transition: opacity 280ms ease, transform 280ms ease;
}

.result-card.hidden-card {
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  position: absolute;
  inset: 0;
}

.demo-modal-content {
  position: relative;
  overflow: hidden;
  animation: demoModalIn 280ms ease-out;
}

.demo-modal-content::before {
  content: "";
  position: absolute;
  width: 320px;
  height: 320px;
  top: -180px;
  right: -120px;
  border-radius: var(--ring-full);
  background: radial-gradient(circle, rgba(57, 181, 74, 0.22) 0%, rgba(57, 181, 74, 0) 68%);
  pointer-events: none;
}

.demo-modal-content::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.demo-signal {
  position: relative;
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  border-radius: var(--ring-full);
  border: 1px solid rgba(57, 181, 74, 0.24);
  background: radial-gradient(circle, rgba(57, 181, 74, 0.1) 0%, rgba(57, 181, 74, 0.02) 55%, rgba(57, 181, 74, 0) 100%);
  overflow: hidden;
}

.demo-scan-sweep {
  position: absolute;
  inset: -2px;
  border-radius: var(--ring-full);
  background: conic-gradient(
    from 0deg,
    rgba(57, 181, 74, 0) 0deg,
    rgba(57, 181, 74, 0) 285deg,
    rgba(123, 242, 138, 0.85) 338deg,
    rgba(57, 181, 74, 0) 360deg
  );
  animation: radarSweep 2.2s linear infinite;
  filter: blur(0.2px);
  transform-origin: 50% 50%;
}

.demo-signal-orbit {
  position: absolute;
  inset: 4px;
  border-radius: var(--ring-full);
  border: 2px solid rgba(57, 181, 74, 0.42);
  box-shadow: 0 0 22px rgba(57, 181, 74, 0.22);
  animation: signalOrbit 2.6s ease-in-out infinite;
}

.demo-signal-orbit.delay {
  inset: 12px;
  border-color: rgba(57, 181, 74, 0.32);
  animation-duration: 2s;
}

.demo-signal-core {
  width: 20px;
  height: 20px;
  border-radius: var(--ring-full);
  background: radial-gradient(circle at 30% 30%, #7bf28a 0%, var(--brand-500) 40%, #1c7f36 100%);
  box-shadow: 0 0 0 10px rgba(57, 181, 74, 0.12), 0 0 24px rgba(57, 181, 74, 0.72);
  animation: signalCore 1.3s ease-in-out infinite;
}

.demo-pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--ring-full);
  background: var(--brand-500);
  box-shadow: 0 0 12px rgba(57, 181, 74, 0.95);
  animation: dotBlink 1.2s ease-in-out infinite;
}

@keyframes signalOrbit {
  0%,
  100% {
    opacity: 0.38;
  }
  50% {
    opacity: 0.95;
  }
}

@keyframes signalCore {
  0%,
  100% {
    transform: scale(0.9);
  }
  50% {
    transform: scale(1.08);
  }
}

@keyframes radarSweep {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes dotBlink {
  0%,
  100% {
    opacity: 0.45;
  }
  50% {
    opacity: 1;
  }
}

@keyframes demoModalIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes floatCard {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-8px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .scan-line,
  .float-card,
  .demo-scan-sweep,
  .demo-signal-orbit,
  .demo-signal-core,
  .demo-pulse-dot,
  .demo-modal-content {
    animation: none !important;
  }
}
