/* css/orb.css: the openbot logo as a live orb (the look of img/logo.webp, drawn with gradients so it can move).
   A navy sphere lit from one side by a warm orange light, a soft highlight on the far side, a glow around it, and
   two cream eyes that look where you point and blink now and then. js/lib/orb.js sets --lx/--ly (where the light
   comes from, -1..1) and --ex/--ey (where the eyes look) for every [data-orb]; without the script it rests in the
   pose of the logo picture. The element's own width and height set its size. */

.orb {
  --lx: .78; --ly: .12; --ex: 0; --ey: 0;
  position: relative; display: inline-block; flex: none; border-radius: 50%; isolation: isolate;
  aspect-ratio: 1; contain: layout style;
}
/* the sphere itself (its own layer, so the glow can sit behind it) */
.orb-body {
  position: absolute; inset: 0; z-index: 0; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at calc(50% - var(--lx) * 18%) calc(50% - var(--ly) * 18%), #0c2252 0%, #071a44 45%, #05153a 75%, #04102e 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .04);
}
/* the warm light: an orange rim on the side the light comes from */
.orb::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%; z-index: 1; pointer-events: none;
  background: radial-gradient(circle at calc(50% + var(--lx) * 62%) calc(50% + var(--ly) * 62%),
    #ffc29c 0%, #ff6a24 16%, rgba(244, 71, 0, .9) 34%, rgba(244, 71, 0, .35) 56%, rgba(244, 71, 0, 0) 74%);
  -webkit-mask: radial-gradient(circle closest-side, transparent 76%, rgba(0, 0, 0, .5) 90%, #000 100%);
  mask: radial-gradient(circle closest-side, transparent 76%, rgba(0, 0, 0, .5) 90%, #000 100%);
}
/* the soft highlight on the far edge */
.orb::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; z-index: 1; pointer-events: none;
  background: radial-gradient(circle at calc(50% - var(--lx) * 62%) calc(50% - var(--ly) * 62%),
    rgba(255, 232, 205, .85) 0%, rgba(255, 214, 178, .3) 16%, rgba(255, 214, 178, 0) 34%);
  -webkit-mask: radial-gradient(circle closest-side, transparent 78%, rgba(0, 0, 0, .7) 92%, #000 100%);
  mask: radial-gradient(circle closest-side, transparent 78%, rgba(0, 0, 0, .7) 92%, #000 100%);
}
/* the glow: its own layer, so the pulse is only opacity and scale */
.orb-glow {
  position: absolute; inset: -30%; z-index: -1; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at calc(50% + var(--lx) * 12%) calc(50% + var(--ly) * 12%), rgba(255, 98, 30, .42) 0%, rgba(244, 71, 0, .16) 36%, rgba(244, 71, 0, 0) 64%);
  animation: orb-glow 3.6s ease-in-out infinite;
  will-change: opacity, transform;
}
.orb-eyes {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  transform: translate(calc(var(--ex) * 9%), calc(var(--ey) * 7%));
  transition: transform .25s cubic-bezier(.2, .8, .3, 1);
}
.orb-eyes b {
  position: absolute; width: 7.4%; height: 20.5%; border-radius: 999px; background: #f2eee3;
  box-shadow: 0 0 calc(.04em) rgba(255, 240, 220, .5);
  transform: rotate(15deg); transform-origin: 50% 50%;
  animation: orb-blink 5.2s infinite;
}
.orb-eyes b:first-child { left: 41.8%; top: 29.4%; }
.orb-eyes b:last-child { left: 55.4%; top: 32%; }
.orb-eyes b:last-child { animation-delay: .04s; }
@keyframes orb-glow { 0%, 100% { opacity: .75; transform: scale(.96); } 50% { opacity: 1; transform: scale(1.04); } }
@keyframes orb-blink { 0%, 93%, 100% { scale: 1 1; } 95.5% { scale: 1 .12; } }

/* small orbs (headers): a lighter glow, no blur cost */
.orb.sm .orb-glow { inset: -30%; }
/* on the day header the glow stays soft */
[data-tone="day"] .orb .orb-glow { opacity: .55; animation: none; }

@media (prefers-reduced-motion: reduce) {
  .orb-glow, .orb-eyes b { animation: none; }
  .orb-eyes { transition: none; }
}
