/* Inbound hero world: a van delivering around a tiny planet. The box crops the square stage: a little empty
   sky off the top, the fading foreground off the bottom (the box ends where the ground has faded out). */
.hw {
  --hw-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  position: relative;
  width: 100%;
  aspect-ratio: 1 / .74;
  overflow: hidden;
  border-radius: 28px;
  touch-action: pan-y pinch-zoom;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}
.hw:focus-visible { box-shadow: inset 0 0 0 3px #3354F2; }

.hw-stage {
  position: absolute;
  left: 0; top: -6%; /* of the box height (a % top resolves against the box height, not the width) */
  width: 100%;
  aspect-ratio: 1 / 1;
}
/* soft sky glow above the horizon; the chips float in it (the planet's top sits ~36% down the stage) */
.hw-stage::before {
  content: "";
  position: absolute;
  left: 8%; right: 8%; top: 8%; height: 56%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(51, 84, 242, .1), rgba(51, 84, 242, 0));
  pointer-events: none;
}

.hw-poster,
.hw-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}
/* the world fades out at the sides and toward the bottom of the box instead of being cut off. The stage sits
   6% of the box height (0.0444 of its width) above the box, so the box bottom falls at ~78.4% of the stage:
   the bottom fade must reach transparent by then, or the box clips a faint shelf of ground. */
.hw-poster,
.hw-canvas {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 11%, #000 89%, transparent), linear-gradient(#000 58%, transparent 78%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent, #000 11%, #000 89%, transparent), linear-gradient(#000 58%, transparent 78%);
  mask-composite: intersect;
}
.hw-canvas { opacity: 0; transition: opacity .6s ease; }
.hw-poster { transition: opacity .2s ease; } /* back at once if the live view is lost (GPU context loss) */
.hw.is-live .hw-canvas { opacity: 1; }
/* the live hand-off: the poster leaves only once the canvas has faded in over it */
.hw.is-live .hw-poster { opacity: 0; visibility: hidden; transition: opacity .3s ease .6s, visibility 0s linear .9s; }

/* Only the planet captures drags. On touch, vertical swipes still scroll the page and pinch still zooms;
   sideways swipes turn the world. */
.hw-hit {
  position: absolute;
  border-radius: 50%;
  touch-action: pan-y pinch-zoom;
  cursor: grab;
}
.hw-hit.is-dragging { cursor: grabbing; }

/* Status chips */
.hw-chips {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity .6s ease .2s;
}
.hw.is-live .hw-chips, .hw.is-static .hw-chips { opacity: 1; }
.hw-chip {
  position: absolute;
  left: 0; top: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .8);
  -webkit-backdrop-filter: blur(12px) saturate(1.6);
  backdrop-filter: blur(12px) saturate(1.6);
  box-shadow: 0 0 0 1px rgba(13, 19, 51, .07), 0 1px 2px rgba(13, 19, 51, .06), 0 8px 20px -8px rgba(13, 19, 51, .28);
  color: #1D1D1F;
  font: 600 11.5px/1.25 var(--hw-font);
  letter-spacing: -0.005em;
  white-space: nowrap;
  opacity: 0;
  transform-origin: 50% 100%;
}
.hw-chip::after { /* stem down to the house (slides when the pill is kept inside the box) */
  content: "";
  position: absolute;
  left: calc(50% + var(--hw-stem, 0px)); top: 100%;
  width: 1px; height: var(--hw-stem-h, 9px);
  background: linear-gradient(rgba(13, 19, 51, .22), rgba(13, 19, 51, 0));
}
.hw-chip i {
  flex: none;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--dot);
  box-shadow: 0 0 0 3px var(--ring);
}
.hw-chip--green { --dot: #30A46C; --ring: #E8F6ED; }
.hw-chip--blue  { --dot: #3354F2; --ring: #EEF1FE; }
.hw-chip--grey  { --dot: #9BA0AC; --ring: #F0F1F4; }
.hw-chip--red   { --dot: #E5484D; --ring: #FDEDEC; color: #C8322F; }
/* Address issue: red like the app and the dashboard (critical), but no red text or pulse, which stay unique to Delivery failed · Urgent. */
.hw-chip--rose  { --dot: #E5484D; --ring: #FDEDEC; }
.hw-chip--red i { animation: hw-pulse 1.8s ease-out infinite; }
.hw.is-paused .hw-chip--red i, .hw.is-offscreen .hw-chip--red i { animation-play-state: paused; }
@keyframes hw-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(229, 72, 77, .45); }
  70%  { box-shadow: 0 0 0 7px rgba(229, 72, 77, 0); }
  100% { box-shadow: 0 0 0 0 rgba(229, 72, 77, 0); }
}

/* Pause toggle */
.hw-pause {
  position: absolute;
  right: 14px; bottom: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 12px 0 10px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .82);
  -webkit-backdrop-filter: blur(12px) saturate(1.6);
  backdrop-filter: blur(12px) saturate(1.6);
  box-shadow: 0 0 0 1px rgba(13, 19, 51, .08), 0 6px 16px -8px rgba(13, 19, 51, .3);
  color: #3A3A40;
  font: 500 12.5px/1 var(--hw-font);
  cursor: pointer;
  /* only once the world is live (it fades in with the chips): on the poster alone there is nothing to pause */
  opacity: 0;
  visibility: hidden;
  transition: opacity .6s ease .2s, visibility 0s linear .2s;
}
.hw.is-live .hw-pause { opacity: 1; visibility: visible; }
.hw-pause:hover { color: #3354F2; }
.hw.is-static .hw-pause { display: none; } /* no WebGL: a still poster, nothing to pause */
.hw-pause:focus-visible { outline: 3px solid #3354F2; outline-offset: 2px; }
.hw-pause svg { width: 12px; height: 12px; fill: currentColor; }
/* reads Pause while playing, Play when paused; the accessible name follows (see hero.js) */
.hw-pause .hw-i-play,
.hw-pause .hw-l-play,
.hw.is-paused .hw-pause .hw-i-pause,
.hw.is-paused .hw-pause .hw-l-pause { display: none; }
.hw.is-paused .hw-pause .hw-i-play { display: block; }
.hw.is-paused .hw-pause .hw-l-play { display: inline; }

.hw-sr {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* low-end devices: flat glass instead of a live blur over the moving canvas */
.hw.is-low .hw-chip, .hw.is-low .hw-pause {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  background: rgba(255, 255, 255, .92);
}

@media (max-width: 860px) {
  .hw-chip { font-size: 10.5px; padding: 4px 8px 4px 7px; gap: 5px; }
}
/* phones: a quiet round icon button, so the status chips stay the loudest thing in the box
   (the accessible name still reads Pause animation / Play animation) */
@media (max-width: 559px) {
  .hw-pause { width: 36px; min-height: 36px; padding: 0; justify-content: center; right: 10px; bottom: 10px; }
  .hw .hw-pause .hw-l, .hw.is-paused .hw-pause .hw-l-play { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .hw-chip--red i { animation: none; }
  .hw-canvas, .hw-poster, .hw.is-live .hw-poster, .hw-chips, .hw-pause { transition: none; }
}
