/* Radar HUD */
.hero-radar {
  position: relative;
  width: min(500px, 100%);
  aspect-ratio: 1;
  margin: 0 auto;
  overflow: visible;
}

.hero-radar::before {
  content: '';
  position: absolute;
  inset: 4%;
  border-radius: 50%;
  border: 1px solid rgba(56, 189, 248, 0.45);
  box-shadow:
    inset 0 0 40px rgba(124, 138, 255, 0.1),
    0 0 24px rgba(56, 189, 248, 0.08);
  pointer-events: none;
  z-index: 1;
}

.hero-radar__hud {
  position: absolute;
  inset: 4%;
  width: 92%;
  height: 92%;
  left: 4%;
  top: 4%;
}

.hero-radar__ring {
  fill: none;
  stroke: rgba(124, 138, 255, 0.42);
  stroke-width: 1.1;
}

.hero-radar__ring--inner {
  stroke: rgba(56, 189, 248, 0.35);
  stroke-dasharray: 4 6;
}

.hero-radar__spoke {
  stroke: rgba(124, 138, 255, 0.12);
  stroke-width: 0.75;
}

.hero-radar__deg {
  fill: rgba(139, 146, 168, 0.55);
  font-family: var(--font-body);
  font-size: 7px;
  font-weight: 500;
}

.hero-radar {
  --sweep-period: 5s;
}

.hero-radar__sweep {
  position: absolute;
  inset: 4%;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    transparent 284deg,
    rgba(56, 189, 248, 0.12) 304deg,
    rgba(124, 138, 255, 0.38) 332deg,
    rgba(56, 189, 248, 0.65) 360deg
  );
  animation: radarSweep var(--sweep-period) linear infinite;
  mask-image: radial-gradient(circle, #000 62%, transparent 64%);
  -webkit-mask-image: radial-gradient(circle, #000 62%, transparent 64%);
  z-index: 2;
  pointer-events: none;
}

@keyframes radarSweep {
  to { transform: rotate(360deg); }
}

.hero-radar__core {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18%;
  height: 18%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  z-index: 4;
}

.hero-radar__blips {
  list-style: none;
  margin: 0;
  padding: 0;
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

.hero-radar__blip {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}

/* Point d'ancrage = le dot sur l'anneau ; étiquette vers le centre */
.hero-radar__blip[data-pos="bottom"] {
  transform: translate(-50%, 0);
}

.hero-radar__blip[data-pos="top"] {
  flex-direction: column-reverse;
  transform: translate(-50%, -100%);
}

.hero-radar__blip[data-pos="left"] {
  flex-direction: row-reverse;
  align-items: center;
  transform: translate(-100%, -50%);
}

.hero-radar__blip[data-pos="right"] {
  flex-direction: row;
  align-items: center;
  transform: translate(0, -50%);
}

.hero-radar__blip[data-pos="left"] .hero-radar__label,
.hero-radar__blip[data-pos="right"] .hero-radar__label {
  max-width: none;
  white-space: nowrap;
  font-size: 0.64rem;
}

.hero-radar__dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.55);
  flex-shrink: 0;
  animation: blipDotLit var(--sweep-period) linear infinite;
  animation-delay: calc(var(--blip-angle) / 360 * var(--sweep-period));
}

.hero-radar__label {
  padding: 5px 9px;
  border-radius: 8px;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.01em;
  color: #fff;
  background: rgba(10, 12, 18, 0.92);
  border: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.1);
  white-space: nowrap;
  animation: blipLabelLit var(--sweep-period) linear infinite;
  animation-delay: calc(var(--blip-angle) / 360 * var(--sweep-period));
}

/* Flash au passage du faisceau (sens horaire, angle 0 = haut) */
@keyframes blipDotLit {
  0%, 92%, 100% {
    transform: scale(1);
    background: var(--accent-2);
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.55);
  }
  2%, 6% {
    transform: scale(1.5);
    background: #fff;
    box-shadow:
      0 0 14px rgba(255, 255, 255, 0.95),
      0 0 24px rgba(56, 189, 248, 0.85),
      0 0 36px rgba(124, 138, 255, 0.5);
  }
}

@keyframes blipLabelLit {
  0%, 92%, 100% {
    border-color: rgba(56, 189, 248, 0.35);
    background: rgba(10, 12, 18, 0.92);
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.1);
    color: #fff;
  }
  2%, 6% {
    border-color: rgba(56, 189, 248, 0.9);
    background: rgba(56, 189, 248, 0.22);
    box-shadow: 0 0 18px rgba(56, 189, 248, 0.45);
    color: #fff;
  }
}

@media (max-width: 720px) {
  .hero-radar { width: min(360px, 100%); }
  .hero-radar__label { font-size: 0.6rem; padding: 4px 7px; }
  .hero-radar__dot { width: 9px; height: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-radar__sweep { animation: none; }
  .hero-radar__dot,
  .hero-radar__label { animation: none; }
}
