/* ==========================================================================
   HB Telecom · Globo animado da seção "Confira a disponibilidade"
   Tudo escopado em .hb-globo para não interferir no resto do site.
   ========================================================================== */

@property --hb-onda {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 0%;
}

.hb-globo {
  --hb-ciclo: 4.2s;                 /* uma onda de sinal a cada ciclo */
  --hb-vermelho: #ff2a1f;
  position: relative;
  width: 100%;
  aspect-ratio: 1412 / 1114;
  /* sem isolation/perspective aqui: o palco precisa se misturar com o fundo da seção */
}

/* O palco inteiro (imagem + onda + luzes) se mistura com o fundo da seção:
   o preto da imagem some e a borda se dissolve, então nunca aparece retângulo. */
.hb-globo-palco {
  position: absolute; inset: 0;
  mix-blend-mode: lighten;
  -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 82%, transparent 100%);
          mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 82%, transparent 100%);
}

.hb-globo .hb-globo-img {
  position: absolute; inset: 0; width: 100%; height: 100%; max-width: none;
  display: block; user-select: none; pointer-events: none;
  animation: hb-respira 6s ease-in-out infinite;
}

/* Onda de sinal: a própria imagem, mais brilhante, revelada por um anel que
   nasce no ponto central e se espalha. Por ser a mesma imagem, a luz corre
   exatamente pelos arcos e ruas desenhados. */
.hb-globo .hb-globo-onda {
  position: absolute; inset: 0; width: 100%; height: 100%;
  display: block; pointer-events: none;
  mix-blend-mode: screen;
  filter: brightness(1.9) saturate(1.25);
  -webkit-mask-image: radial-gradient(ellipse 78% 100% at 57.2% 36.8%,
    transparent 0, transparent calc(var(--hb-onda) - 16%), #000 var(--hb-onda), transparent calc(var(--hb-onda) + 3%));
          mask-image: radial-gradient(ellipse 78% 100% at 57.2% 36.8%,
    transparent 0, transparent calc(var(--hb-onda) - 16%), #000 var(--hb-onda), transparent calc(var(--hb-onda) + 3%));
  animation: hb-onda var(--hb-ciclo) cubic-bezier(.3, .1, .4, 1) infinite;
}

/* Luzes por cima (SVG com as mesmas coordenadas da imagem) */
.hb-globo-luzes {
  position: absolute; inset: 0; width: 100%; height: 100%;
  overflow: visible; pointer-events: none;
  mix-blend-mode: screen;
}
.hb-globo-luzes circle { transform-box: fill-box; transform-origin: center; }
.hb-no .hb-halo  { fill: url(#hb-grad-halo); opacity: 0; animation: hb-halo var(--hb-ciclo) ease-out infinite; animation-delay: var(--d, 0s); }
.hb-no .hb-anel  { fill: none; stroke: var(--hb-vermelho); stroke-width: 2.5; opacity: 0; animation: hb-anel var(--hb-ciclo) ease-out infinite; animation-delay: var(--d, 0s); }
.hb-no .hb-nucleo { fill: #fff; opacity: .0; animation: hb-nucleo var(--hb-ciclo) ease-out infinite; animation-delay: var(--d, 0s); }

/* Ponto central: dispara a onda */
.hb-centro .hb-halo  { animation-name: hb-halo-centro; }
.hb-centro .hb-anel  { stroke-width: 3; animation-name: hb-anel-centro; }

/* Pausa quando a seção sai da tela (economiza CPU/bateria) */
.hb-globo.hb-pausado *,
.hb-globo.hb-pausado { animation-play-state: paused !important; }

/* Entrada ao rolar até a seção */
.hb-globo.hb-entrada .hb-globo-palco { opacity: 0; }
.hb-globo.hb-entrada.hb-visto .hb-globo-palco { opacity: 1; transition: opacity 1.2s ease; }

@keyframes hb-onda {
  0%   { --hb-onda: 0%; }
  100% { --hb-onda: 118%; }
}
@keyframes hb-respira {
  0%, 100% { filter: brightness(1); }
  50%      { filter: brightness(1.12); }
}
@keyframes hb-halo {
  0%   { opacity: 0;  transform: scale(.4); }
  8%   { opacity: .95; transform: scale(1.15); }
  40%  { opacity: .25; transform: scale(1); }
  100% { opacity: 0;  transform: scale(.8); }
}
@keyframes hb-anel {
  0%   { opacity: 0;  transform: scale(.6); }
  6%   { opacity: .9; transform: scale(1); }
  45%  { opacity: 0;  transform: scale(3.4); }
  100% { opacity: 0;  transform: scale(3.4); }
}
@keyframes hb-nucleo {
  0%, 100% { opacity: .0; }
  6%       { opacity: 1; }
  35%      { opacity: .35; }
}
@keyframes hb-halo-centro {
  0%   { opacity: .5; transform: scale(.8); }
  5%   { opacity: 1;  transform: scale(1.5); }
  50%  { opacity: .45; transform: scale(1); }
  100% { opacity: .5; transform: scale(.8); }
}
@keyframes hb-anel-centro {
  0%   { opacity: 1; transform: scale(1); }
  55%  { opacity: 0; transform: scale(9); }
  100% { opacity: 0; transform: scale(9); }
}

@media (prefers-reduced-motion: reduce) {
  .hb-globo *, .hb-globo-palco { animation: none !important; transition: none !important; }
  .hb-globo-onda, .hb-globo-luzes { display: none; }
}
