/* =========================================================================
   ATLAS — el orbe de marca, animado. Componente compartido del proyecto.
   Implementación tomada de agm.vstelecom.cl para que se vea idéntico.

   Dos modos, misma caja y mismo tamaño:

   1) CSS PURO (por defecto) — sin imagen, sin peticiones, escala infinita.
      <span class="atlas-orb" style="--atlas-size:44px" role="img" aria-label="Atlas">
        <span class="atlas-orb__rings"></span>
        <span class="atlas-orb__rings atlas-orb__rings--outer"></span>
        <span class="atlas-orb__core"></span>
      </span>

   2) SPRITE — reproduce tu atlas de 6 fotogramas (rejilla 3x2) a 4,8 fps.
      <span class="atlas-orb atlas-orb--sprite"
            style="--atlas-size:44px; --atlas-src:url('/brand/atlas.png')"
            role="img" aria-label="Atlas"></span>

      El atlas DEBE ser 3 columnas x 2 filas y tener FONDO TRANSPARENTE:
      sobre --color-bg un PNG con fondo blanco se ve como un cuadro blanco.
   ========================================================================= */

.atlas-orb {
  --atlas-size: 40px;
  inline-size: var(--atlas-size);
  block-size: var(--atlas-size);
  display: inline-block;
  position: relative;
  flex: none;
  border-radius: 50%;
  isolation: isolate;
}

/* Halo que late por detrás de todo */
.atlas-orb::after {
  content: "";
  position: absolute;
  inset: -22%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(circle, #38bdf866, #0000 68%);
  animation: atlas-pulse 3.4s ease-in-out infinite;
}

/* Anillo interior: un arco cónico recortado a corona por la máscara */
.atlas-orb__rings {
  position: absolute;
  inset: -6%;
  border-radius: 50%;
  background: conic-gradient(#0000 0deg, #7dd3fcf2 22deg, #0000 66deg 175deg,
                             #38bdf899 205deg, #0000 255deg 360deg);
  -webkit-mask: radial-gradient(circle, #0000 60%, #000 62% 71%, #0000 73%);
          mask: radial-gradient(circle, #0000 60%, #000 62% 71%, #0000 73%);
  animation: atlas-spin 7s linear infinite;
}

/* Anillo exterior: más lento, en sentido contrario */
.atlas-orb__rings--outer {
  inset: -16%;
  opacity: .75;
  background: conic-gradient(from 120deg, #0000 0deg, #67e8f98c 30deg, #0000 90deg 360deg);
  -webkit-mask: radial-gradient(circle, #0000 76%, #000 78% 84%, #0000 86%);
          mask: radial-gradient(circle, #0000 76%, #000 78% 84%, #0000 86%);
  animation: atlas-spin 11s linear infinite reverse;
}

/* El núcleo: brillo azul arriba-izquierda, rescoldo ámbar abajo, cuerpo azul noche */
.atlas-orb__core {
  position: absolute;
  inset: 14%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 28%, #dbeafef2 0 5%, #60a5fa8c 16%, #0000 38%),
    radial-gradient(circle at 56% 86%, #fbbf24e6 0 7%, #f59e0b66 24%, #0000 46%),
    radial-gradient(circle at 50% 46%, #0d3f6e 0 38%, #072745 72%, #041526 100%);
  box-shadow: inset 0 0 10px #020814b3, 0 0 18px -3px #38bdf899;
  animation: atlas-bob 3.4s ease-in-out infinite;
}

/* --- Modo sprite: recorre la rejilla 3x2 con saltos secos --- */
.atlas-orb--sprite {
  background-image: var(--atlas-src);
  background-repeat: no-repeat;
  background-size: 300% 200%;
  animation: atlas-sprite 1.25s step-end infinite;
}
.atlas-orb--sprite > * { display: none; }  /* el sprite sustituye a las capas CSS */

@keyframes atlas-sprite {
    0%    { background-position:   0%   0%; }
   16.66% { background-position:  50%   0%; }
   33.33% { background-position: 100%   0%; }
   50%    { background-position:   0% 100%; }
   66.66% { background-position:  50% 100%; }
   83.33% { background-position: 100% 100%; }
}

@keyframes atlas-spin  { to { transform: rotate(360deg); } }
@keyframes atlas-pulse { 0%, to { opacity: .45; transform: scale(1); }
                         50%    { opacity: .85; transform: scale(1.14); } }
@keyframes atlas-bob   { 0%, to { filter: brightness(1); }
                         50%    { filter: brightness(1.12); } }

/* Variante estática, para favicons, impresión o movimiento reducido */
.atlas-orb--still,
.atlas-orb--still * { animation: none !important; }

@media (prefers-reduced-motion: reduce) {
  .atlas-orb::after,
  .atlas-orb__rings,
  .atlas-orb__core,
  .atlas-orb--sprite { animation: none !important; }
  /* En sprite congelamos el primer fotograma, no un estado a medias. */
  .atlas-orb--sprite { background-position: 0% 0%; }
}
