/*
  The globe in the Try banner: stores' AI agents talk with customers
  everywhere. Yellow arcs are what a bot was asked and answered, orange
  markers are the stores (their own site is the rule), a red flash is a
  proven error caught. globe.js draws what moves and reads its colours and
  alphas below; the sphere's body and rim light are drawn here, once, since
  they never move. The banner is dark in both themes, so the globe always
  takes its dark look.
*/

.globe-banner {
  /* Sphere radius. The canvas is a square --globe-box radii wide, room for
     arcs that rise off the surface and for the halo; globe.js reads it. */
  --globe-r: clamp(220px, 24vw, 330px);
  --globe-box: 2.68;
}
/* The globe takes the place of the drifting colour behind the banner. */
.globe-banner::before { display: none; }

.globe {
  --globe-dot: var(--ink);
  --globe-dot-a: 0.42;
  --globe-back-a: 0.06;
  --globe-arc: var(--claim-line);
  --globe-arc-a: 1;
  /* On the navy banner orange reads as red, so the stores take amber and only errors are red. */
  --globe-store: var(--amber);
  --globe-error: var(--error);
  --globe-glow-a: 0.26;
  /* The sphere: lit from the upper left, a shade toward the lower right, a warm rim. */
  --globe-lit: color-mix(in srgb, var(--ink) 6%, transparent);
  --globe-dim: color-mix(in srgb, var(--ink) 1.5%, transparent);
  --globe-shade: color-mix(in srgb, #000000 30%, transparent);
  --globe-rim: color-mix(in srgb, var(--amber) 46%, transparent);
  --globe-halo: color-mix(in srgb, var(--amber) 22%, transparent);
  position: absolute; z-index: -1;
  right: calc(var(--globe-r) * -0.55);
  top: 50%;
  width: calc(var(--globe-r) * var(--globe-box));
  aspect-ratio: 1;
  translate: 0 -50%;
  pointer-events: none;
}
/* The sphere is a circle of one radius in the middle of the box, where globe.js puts the dots. */
.globe::before {
  content: ""; position: absolute; inset: calc((1 - 2 / var(--globe-box)) * 50%); border-radius: 50%; pointer-events: none;
  background:
    linear-gradient(145deg, transparent 40%, var(--globe-shade)),
    radial-gradient(circle at 32% 26%, var(--globe-lit), var(--globe-dim) 72%);
  box-shadow:
    inset calc(var(--globe-r) * 0.014) calc(var(--globe-r) * 0.018) calc(var(--globe-r) * 0.045) calc(var(--globe-r) * -0.012) var(--globe-rim),
    inset 0 0 calc(var(--globe-r) * 0.02) var(--globe-halo),
    calc(var(--globe-r) * -0.012) calc(var(--globe-r) * -0.016) calc(var(--globe-r) * 0.09) calc(var(--globe-r) * -0.02) var(--globe-halo);
}

.globe-canvas {
  position: relative;
  width: 100%; height: 100%;
  pointer-events: auto;
  /* A finger turns the globe sideways; scrolling the page stays with the page. */
  touch-action: pan-y;
  user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
}
/* Land and conversations arrive on the sphere once the first frame is drawn, as it comes into view. */
.js .globe-canvas { opacity: 0; transition: opacity 1.4s var(--ease); }
.globe.is-drawn .globe-canvas { opacity: 1; }
.globe[data-globe-state="off"] { visibility: hidden; }
@media (hover: hover) and (pointer: fine) {
  .globe.is-over .globe-canvas { cursor: grab; }
  .globe.is-grabbing .globe-canvas { cursor: grabbing; }
}

/* The words stay above the globe; the banner's own shade keeps them readable. */
.globe-banner > :not(.globe) { position: relative; z-index: 1; }

/* Phones: the globe rises behind the top right corner, quieter, never under the button. */
@media (max-width: 767px) {
  .globe-banner { --globe-r: 150px; }
  .globe { right: calc(var(--globe-r) * -1.05); top: calc(var(--globe-r) * -0.9); translate: none; opacity: 0.6; }
}
