/* ============================================================
   SENTINEL HERO ANIMATION — Precision Grid Scanner
   Tactical verification grid with scanning line
   Distinct from Obsidian constellation
   ============================================================ */

.sentinel-hero-animation {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
}

/* Show only when Sentinel version active */
body[data-version="sentinel"] .sentinel-hero-animation {
  opacity: 1;
}

/* Hide Obsidian animation when Sentinel active */
body[data-version="sentinel"] .hero-animation canvas {
  opacity: 0;
}

/* Hide Lab animation when Sentinel active */
body[data-version="sentinel"] .lab-hero-animation {
  opacity: 0 !important;
  visibility: hidden;
}

/* ============================================================
   GRID LINES — Subtle tactical background
   ============================================================ */

.sentinel-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(0deg, rgba(20, 184, 166, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 184, 166, 0.03) 1px, transparent 1px);
  background-size: 80px 80px;
  opacity: 0.4;
  animation: gridPulse 8s ease-in-out infinite;
}

@keyframes gridPulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.5; }
}

/* ============================================================
   CORNER BRACKETS — Targeting reticle
   ============================================================ */

.sentinel-brackets {
  position: absolute;
  inset: 20px;
  pointer-events: none;
}

.sentinel-bracket {
  position: absolute;
  width: 60px;
  height: 60px;
  border: 2px solid rgba(20, 184, 166, 0.6);
  animation: bracketPulse 4s ease-in-out infinite;
}

.sentinel-bracket::before,
.sentinel-bracket::after {
  content: '';
  position: absolute;
  background: rgba(20, 184, 166, 0.8);
}

/* Top-left bracket */
.sentinel-bracket.tl {
  top: 0;
  left: 0;
  border-right: none;
  border-bottom: none;
  animation-delay: 0s;
}

/* Top-right bracket */
.sentinel-bracket.tr {
  top: 0;
  right: 0;
  border-left: none;
  border-bottom: none;
  animation-delay: 0.2s;
}

/* Bottom-left bracket */
.sentinel-bracket.bl {
  bottom: 0;
  left: 0;
  border-right: none;
  border-top: none;
  animation-delay: 0.4s;
}

/* Bottom-right bracket */
.sentinel-bracket.br {
  bottom: 0;
  right: 0;
  border-left: none;
  border-top: none;
  animation-delay: 0.6s;
}

@keyframes bracketPulse {
  0%, 100% {
    opacity: 0.4;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.05);
  }
}

/* ============================================================
   SCANNING LINE — Horizontal sweep
   ============================================================ */

.sentinel-scanner {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(20, 184, 166, 0) 20%,
    rgba(20, 184, 166, 0.8) 50%,
    rgba(20, 184, 166, 0) 80%,
    transparent 100%
  );
  box-shadow: 0 0 20px rgba(20, 184, 166, 0.6);
  animation: scan 6s linear infinite;
}

@keyframes scan {
  0% {
    top: 0;
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    top: 100%;
    opacity: 0;
  }
}

/* ============================================================
   GLOW NODES — Intersection points
   ============================================================ */

.sentinel-nodes {
  position: absolute;
  inset: 0;
}

.sentinel-node {
  position: absolute;
  width: 8px;
  height: 8px;
  background: rgba(20, 184, 166, 0.8);
  border-radius: 50%;
  box-shadow:
    0 0 10px rgba(20, 184, 166, 0.6),
    0 0 20px rgba(20, 184, 166, 0.3);
  animation: nodePulse 3s ease-in-out infinite;
}

.sentinel-node:nth-child(1) { top: 25%; left: 20%; animation-delay: 0s; }
.sentinel-node:nth-child(2) { top: 25%; left: 50%; animation-delay: 0.3s; }
.sentinel-node:nth-child(3) { top: 25%; left: 80%; animation-delay: 0.6s; }
.sentinel-node:nth-child(4) { top: 50%; left: 35%; animation-delay: 0.9s; }
.sentinel-node:nth-child(5) { top: 50%; left: 65%; animation-delay: 1.2s; }
.sentinel-node:nth-child(6) { top: 75%; left: 20%; animation-delay: 1.5s; }
.sentinel-node:nth-child(7) { top: 75%; left: 50%; animation-delay: 1.8s; }
.sentinel-node:nth-child(8) { top: 75%; left: 80%; animation-delay: 2.1s; }

@keyframes nodePulse {
  0%, 100% {
    opacity: 0.3;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.3);
  }
}

/* ============================================================
   LIGHT MODE ADJUSTMENTS
   ============================================================ */

body[data-theme="light"] .sentinel-grid {
  background-image:
    linear-gradient(0deg, rgba(20, 184, 166, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 184, 166, 0.08) 1px, transparent 1px);
  opacity: 0.6;
}

body[data-theme="light"] .sentinel-bracket {
  border-color: rgba(20, 184, 166, 0.8);
}

body[data-theme="light"] .sentinel-scanner {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(20, 184, 166, 0) 20%,
    rgba(20, 184, 166, 1) 50%,
    rgba(20, 184, 166, 0) 80%,
    transparent 100%
  );
  box-shadow: 0 0 30px rgba(20, 184, 166, 0.8);
}

body[data-theme="light"] .sentinel-node {
  background: rgba(20, 184, 166, 1);
  box-shadow:
    0 0 15px rgba(20, 184, 166, 0.8),
    0 0 30px rgba(20, 184, 166, 0.5);
}

/* ============================================================
   MOBILE ADJUSTMENTS
   ============================================================ */

@media (max-width: 768px) {
  .sentinel-grid {
    background-size: 60px 60px;
  }

  .sentinel-bracket {
    width: 40px;
    height: 40px;
  }

  .sentinel-node {
    width: 6px;
    height: 6px;
  }
}

@media (max-width: 480px) {
  .sentinel-grid {
    background-size: 40px 40px;
  }

  .sentinel-bracket {
    width: 30px;
    height: 30px;
  }

  .sentinel-node {
    width: 5px;
    height: 5px;
  }
}

/* ============================================================
   REDUCED MOTION — Disable animations
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  .sentinel-grid,
  .sentinel-bracket,
  .sentinel-scanner,
  .sentinel-node {
    animation: none;
  }

  .sentinel-scanner {
    display: none;
  }

  .sentinel-grid {
    opacity: 0.3;
  }

  .sentinel-bracket {
    opacity: 0.5;
  }

  .sentinel-node {
    opacity: 0.4;
  }
}
