/* ==========================================================================
   Hero Visual — Morphing blob with AI agent authorization flow
   ========================================================================== */

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  align-items: center;
}

@media (min-width: 960px) {
  .hero-grid {
    grid-template-columns: 1fr 1fr;
    gap: 64px;
  }
}

/* ---- Agent Scene Container ---- */
.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.agent-scene {
  position: relative;
  width: 100%;
  max-width: 520px;
  aspect-ratio: 1;
  overflow: visible;
}

/* ---- Morphing Blob ---- */
.morph-blob {
  position: absolute;
  inset: -15%;
  width: 130%;
  height: 130%;
  overflow: visible;
  filter: drop-shadow(0 20px 60px rgba(0, 0, 0, 0.25));
}

.blob-path {
  transform-origin: center;
}

/* ---- Agent Flow (content inside blob) ---- */
.agent-flow {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- Shield Ring around Agent ---- */
.shield-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 120px;
  height: 120px;
  transform: translate(-50%, -50%);
  z-index: 9;
  pointer-events: none;
}

.shield-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.shield-track {
  fill: none;
  stroke: rgba(212, 245, 51, 0.08);
  stroke-width: 2;
}

.shield-arc {
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 60 270;
}

.shield-arc-1 {
  stroke: rgba(16, 185, 129, 0.6);
  animation: shieldSpin1 4s linear infinite;
}

.shield-arc-2 {
  stroke: rgba(239, 68, 68, 0.5);
  animation: shieldSpin2 5s linear infinite reverse;
}

@keyframes shieldSpin1 {
  0%   { stroke-dashoffset: 0;   stroke: rgba(16, 185, 129, 0.6); }
  40%  { stroke: rgba(16, 185, 129, 0.8); }
  50%  { stroke: rgba(239, 68, 68, 0.7); }
  60%  { stroke: rgba(16, 185, 129, 0.6); }
  100% { stroke-dashoffset: -330; stroke: rgba(16, 185, 129, 0.6); }
}

@keyframes shieldSpin2 {
  0%   { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -330; }
}

/* ---- Central Agent Node ---- */
.central-agent {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 10;
}

.agent-icon {
  width: 64px;
  height: 64px;
  background: var(--lime);
  color: var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  animation: agentPulse 3s ease-in-out infinite;
  box-shadow: 0 0 30px rgba(212, 245, 51, 0.4);
}

.agent-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.6);
  padding: 2px 10px;
  border-radius: 4px;
  white-space: nowrap;
}

@keyframes agentPulse {
  0%, 100% {
    box-shadow: 0 0 20px rgba(212, 245, 51, 0.3);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 40px rgba(212, 245, 51, 0.6);
    transform: scale(1.05);
  }
}

/* ---- Orbit Ring ---- */
.orbit-ring {
  position: absolute;
  inset: 0;
  animation: orbitSpin 30s linear infinite;
}

/* ---- Orbit Nodes (resources) ---- */
.orbit-node {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  animation: orbitCounterSpin 30s linear infinite;
}

.orbit-node span {
  font-size: 0.625rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.resource-icon {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.25);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  backdrop-filter: blur(4px);
  transition: background 0.3s, border-color 0.3s;
}

.orbit-node:hover .resource-icon {
  background: rgba(212, 245, 51, 0.15);
  border-color: var(--lime);
}

/* ---- Human Oversight Node (top-left) ---- */
.human-node {
  position: absolute;
  top: 5%;
  left: 15%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  z-index: 12;
  animation: humanFloat 7s ease-in-out infinite;
}

.human-icon {
  width: 44px;
  height: 44px;
  background: rgba(129, 140, 248, 0.2);
  border: 2px solid rgba(129, 140, 248, 0.5);
  color: #a5b4fc;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  backdrop-filter: blur(4px);
}

.human-label {
  font-size: 0.625rem;
  font-weight: 700;
  color: #a5b4fc;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.human-sub {
  font-size: 0.5rem;
  color: rgba(165, 180, 252, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: -2px;
}

@keyframes humanFloat {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-5px, -6px); }
}

/* ---- Position nodes scattered randomly around the blob ---- */

.node-1 {
  top: 2%;
  left: 52%;
}

.node-2 {
  top: 12%;
  right: 8%;
}

.node-3 {
  top: 55%;
  right: 3%;
}

.node-4 {
  bottom: 5%;
  right: 22%;
}

.node-5 {
  bottom: 8%;
  left: 22%;
}

.node-6 {
  bottom: 28%;
  left: 2%;
}

.node-7 {
  top: 22%;
  left: 3%;
}

/* Remove orbit spin — use floating instead for organic look */
.orbit-ring {
  animation: none;
}

/* Float animations — each node has a unique rhythm */
.node-1 { animation: nodeFloat1 6s ease-in-out infinite; }
.node-2 { animation: nodeFloat2 7s ease-in-out infinite; }
.node-3 { animation: nodeFloat3 5.5s ease-in-out infinite; }
.node-4 { animation: nodeFloat4 6.5s ease-in-out infinite; }
.node-5 { animation: nodeFloat5 7.5s ease-in-out infinite; }
.node-6 { animation: nodeFloat6 5s ease-in-out infinite; }
.node-7 { animation: nodeFloat7 8s ease-in-out infinite; }

@keyframes nodeFloat1 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(3px, -9px); }
}

@keyframes nodeFloat2 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(7px, -4px); }
}

@keyframes nodeFloat3 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(6px, 5px); }
}

@keyframes nodeFloat4 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-4px, 7px); }
}

@keyframes nodeFloat5 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-6px, 5px); }
}

@keyframes nodeFloat6 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-7px, -3px); }
}

@keyframes nodeFloat7 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-5px, 6px); }
}

/* ---- Connection Lines ---- */
.connection-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.conn-line {
  stroke: rgba(212, 245, 51, 0.3);
  stroke-width: 1.5;
  stroke-dasharray: 6 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: dashFlow 2s linear infinite;
}

.line-1 { animation-delay: 0s; }
.line-2 { animation-delay: 0.3s; }
.line-3 { animation-delay: 0.6s; }
.line-4 { animation-delay: 0.9s; }
.line-5 { animation-delay: 1.2s; }
.line-6 { animation-delay: 1.5s; }
.line-7 { animation-delay: 1.8s; }

.line-human {
  stroke: rgba(129, 140, 248, 0.4);
  animation-delay: 0.4s;
}

@keyframes dashFlow {
  from { stroke-dashoffset: 0; }
  to { stroke-dashoffset: -20; }
}

/* ---- Live Decision Feed ---- */
.decision-feed {
  position: absolute;
  bottom: -40px;
  left: 50%;
  transform: translateX(-50%);
  width: 240px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 20;
  pointer-events: none;
}

.feed-line {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.5625rem;
  line-height: 1.4;
  padding: 3px 8px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  color: rgba(255, 255, 255, 0.7);
  white-space: nowrap;
  overflow: hidden;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.feed-line.visible {
  opacity: 1;
  transform: translateY(0);
}

.feed-line .feed-permit {
  color: #34d399;
  font-weight: 700;
}

.feed-line .feed-deny {
  color: #f87171;
  font-weight: 700;
}

.feed-line .feed-agent {
  color: #a5b4fc;
}

.feed-line .feed-arrow {
  color: rgba(255, 255, 255, 0.3);
}

/* ---- Dotted background in hero ---- */
.hero-dots {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, var(--black) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.08;
  pointer-events: none;
}

/* ---- Responsive adjustments ---- */
@media (max-width: 959px) {
  .hero-visual {
    order: 0;
    margin-bottom: 56px;
  }

  .agent-scene {
    max-width: 400px;
    margin: 0 auto;
  }
}

@media (max-width: 480px) {
  .agent-scene {
    max-width: 300px;
  }

  .agent-icon {
    width: 44px;
    height: 44px;
  }

  .resource-icon {
    width: 32px;
    height: 32px;
  }

  .human-icon {
    width: 36px;
    height: 36px;
  }

  .shield-ring {
    width: 90px;
    height: 90px;
  }

  .decision-feed {
    width: 200px;
    bottom: -50px;
  }

  .feed-line {
    font-size: 0.5rem;
  }
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  .hero-visual *,
  .hero-visual *::before,
  .hero-visual *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
