/* Keep the static companion visible until the first 3D frame, including when WebGL is unavailable. */
.is-sentinel { position: relative; }
.sentinel-stage { position: absolute; inset: 0; display: block; }
.sentinel-full .sentinel-stage { bottom: 94px; }
.sentinel-fallback { display: block; width: 100%; height: 100%; object-fit: contain; }
.is-sentinel-ready .sentinel-fallback { display: none; }
.sentinel-stage .sentinel-fallback { position: absolute; inset: 0; }
.sentinel-canvas { display: block; width: 100%; height: 100%; }
.is-sentinel:not(.is-sentinel-ready) .sentinel-canvas { visibility: hidden; }
.sentinel-canvas:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; border-radius: var(--r-md); }

.sentinel-canvas[role="button"] { cursor: pointer; }
.sentinel-speech {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 16px);
  text-align: center;
  pointer-events: none;
  animation: sentinel-greeting var(--dur-4) var(--ease-out) both;
}
.sentinel-speech-line {
  position: relative;
  display: block;
  padding: 8px 14px;
  border: 1px solid var(--glass-edge-strong);
  border-radius: var(--r-xl);
  background: var(--surface-raised);
  box-shadow: var(--glass-light), var(--el-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
}
.sentinel-speech-line::before {
  content: '';
  position: absolute;
  top: -5px;
  left: calc(50% - 4px);
  width: 8px;
  height: 8px;
  transform: rotate(45deg);
  background: var(--surface-raised);
  border-top: 1px solid var(--glass-edge-strong);
  border-left: 1px solid var(--glass-edge-strong);
}
.sentinel-hint {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}
.is-sentinel:not(.is-sentinel-ready) .sentinel-hint { visibility: hidden; }
.sentinel-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 6px;
  min-height: 28px;
  padding: 4px 12px;
  font-size: 12px;
  pointer-events: auto;
}
.sentinel-action[hidden] { display: none; }
.sentinel-action:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; }
@keyframes sentinel-greeting {
  from { opacity: 0; translate: 0 6px; }
  to { opacity: 1; translate: 0 0; }
}
body.motion-off .sentinel-speech { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .sentinel-speech { animation: none; }
}

.messages-empty-mark[data-sentinel] { position: relative; width: min(100%, 300px); height: 300px; }

/* The robot in flight (a copy of its pixels, steered by sentinel-mount.js) and the slot it is flying to, which stays
   hidden until it lands so there is never a second robot. */
.sentinel-flyer { position: fixed; z-index: 1000; display: block; max-width: none; pointer-events: none; }
.is-arriving .sentinel-stage, .is-arriving > .sentinel-fallback { visibility: hidden; }

.reply-avatar { position: relative; display: inline-block; width: 48px; height: 48px; margin-right: 8px; vertical-align: middle; }

.agent-status-sentinel { display: inline-block; width: 56px; height: 56px; flex: none; margin: -14px 0; }
.agent-status-sentinel.is-sentinel + .agent-status-icon { display: none; }

.agents-hero, .home-page .hero { position: relative; }
.hero-sentinel {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 18px;
  width: clamp(240px, 28vw, 380px);
  pointer-events: none;
}
.hero-sentinel canvas { pointer-events: auto; }
.hero-sentinel .sentinel-stage { bottom: 72px; }
@media (max-width: 1100px) {
  .home-page .hero, .agents-hero { display: grid; grid-template-columns: minmax(0, 1fr) 180px; column-gap: 16px; }
  .hero-sentinel { position: relative; grid-column: 2; grid-row: 1 / span 4; width: 180px; height: 220px; align-self: center; bottom: auto; }
  .home-page .hero > :not(.hero-sentinel), .agents-hero > :not(.hero-sentinel) { grid-column: 1; }
  .hero-sentinel .sentinel-speech-line { font-size: 12px; }
}
@media (max-width: 700px) {
  .sentinel-action { min-height: 44px; }
  .sentinel-full .sentinel-stage { bottom: 110px; }
  .home-page .hero, .agents-hero { display: flex; flex-direction: column; min-height: 0; }
  .hero-sentinel { order: 1; width: 100%; height: 112px; margin-top: 8px; }
  .hero-sentinel .sentinel-stage { width: 104px; bottom: 0; }
  .hero-sentinel .sentinel-speech { left: 112px; top: 50%; bottom: auto; transform: translateY(-50%); max-width: calc(100% - 112px); }
  .hero-sentinel > .sentinel-fallback { width: 104px; }
}
