/* Vector scene: the entity canvas and everything written into the world around it. */
.vector {
  position: fixed;
  inset: 0;
  z-index: var(--z-scene);
}

.vector__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.vector__arm {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.vector__layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Intro and answers: short thoughts floating in the world */
.vector-message {
  position: absolute;
  max-width: 26rem;
  color: var(--ink);
  font-size: 1.35rem;
  font-weight: 500;
  line-height: 1.35;
  text-wrap: pretty;
}

.vector-message--intro {
  width: max-content;
  max-width: 22rem;
  translate: -50% 0;
  text-align: center;
  text-wrap: balance;
}

.fragment {
  display: inline-block;
}

.vector-thinking {
  position: absolute;
  color: var(--ink-muted);
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  translate: -50% -100%;
}

/* Input written straight into the world: a small Vector mark and a blinking caret */
.vector-input {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  translate: 0 -50%;
  pointer-events: auto;
}

.vector-input__mark {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 55% 45% 50% 50%;
  background: var(--ink);
  animation: vector-mark 2.4s ease-in-out infinite;
}

@keyframes vector-mark {
  50% { scale: 1.2; border-radius: 45% 55% 50% 50%; }
}

.vector-input__field {
  min-width: 14ch;
  max-width: min(26rem, 60vw);
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  caret-color: var(--ink);
  font: inherit;
  font-size: 1.35rem;
  font-weight: 500;
  field-sizing: content;
}

.vector-input__field::placeholder {
  color: var(--ink-muted);
  opacity: 0.55;
}

@media (prefers-reduced-motion: reduce) {
  .vector-input__mark {
    animation: none;
  }
}

/* What Vector shows with its arm: a small preview window at the tip (js/systems/vector-arm.js) */
.arm-preview {
  position: absolute;
  width: 220px;
  padding: 10px;
  border-radius: 16px;
  background: var(--preview-surface, var(--surface-white));
  box-shadow: 0 10px 30px rgb(17 17 17 / 0.1);
  color: var(--preview-text, var(--ink));
  pointer-events: auto;
}

.arm-preview--card {
  padding: 16px;
}

.arm-preview__shot {
  display: block;
  aspect-ratio: 16 / 10;
  margin-bottom: 8px;
  border-radius: 10px;
  background: var(--shot-a);
  box-shadow: inset -40px -24px 0 -12px var(--shot-b);
}

.arm-preview__meta {
  font-size: 0.72rem;
  font-weight: 500;
  opacity: 0.7;
}

.arm-preview__title {
  margin-top: 2px;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
  text-wrap: balance;
}

.arm-preview__action {
  display: inline-block;
  margin-top: 10px;
  padding: 0.4rem 0.8rem;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 0.78rem;
  font-weight: 600;
}

/* Let a preview go: its arm retracts */
.arm-preview__close {
  position: absolute;
  top: 6px;
  right: 6px;
  display: grid;
  place-items: center;
  width: 22px;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: color-mix(in srgb, var(--ink) 75%, transparent);
  color: var(--bg);
}

.arm-preview__close svg {
  width: 10px;
  height: 10px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
}

.arm-preview__close:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.arm-preview__action:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
