/*
 * Aiden UI · voice-orb — el CSS module de Arc Pro (voice-orb.module.css) traducido a clases planas
 * `aui-vo-*`, con sus MISMAS variables de foundation. La fuente está en
 * direccion/diseno/arc-fuente/voice-orb/. No se reconstruye de memoria: se traduce de ahí.
 */

.aui-vo-caja { position: relative; display: grid; place-items: center; }
.aui-vo-orbe { display: block; flex: none; }
/* La cara va centrada sobre el lienzo; el componente le escribe la escala en cada fotograma. */
.aui-vo-cara { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); pointer-events: none; }

/* Transcripción: dos líneas de alto, pegada abajo, para que las viejas se levanten al entrar las nuevas. */
.aui-vo-trans {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end;
  width: 100%; max-width: 30rem; height: calc(2em * var(--leading-body, 1.55)); overflow: hidden;
  font-family: var(--font-body, inherit); font-size: var(--text-base, 16px);
  line-height: var(--leading-body, 1.55); text-align: center;
  -webkit-mask-image: linear-gradient(to bottom, transparent, black 40%);
  mask-image: linear-gradient(to bottom, transparent, black 40%);
}
.aui-vo-linea { margin: 0; color: var(--foreground, #141414); text-wrap: balance; }
.aui-vo-linea[data-speaker="user"] { color: var(--text-secondary, #555); }
.aui-vo-linea[data-speaker="system"] { color: var(--text-muted, #8a8a8a); font-size: var(--text-sm, 14px); }

/* Cada palabra entra desde un desenfoque suave; las de Lunnar, además, con el degradado de la
   marca recorriéndolas, igual que en su chat. El desfase (28 ms) lo pone el JS. */
.aui-vo-palabra { display: inline-block; animation: aui-vo-palabra .42s cubic-bezier(.16,1,.3,1) both; }
@keyframes aui-vo-palabra {
  from { opacity: 0; filter: blur(4px); }
  to   { opacity: 1; filter: blur(0); }
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .aui-vo-linea[data-speaker="assistant"] .aui-vo-palabra {
    background-image: linear-gradient(180deg, var(--ia-1, #8E7FC9) 0%, var(--ia-2, #574A87) 100%);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
    animation: aui-vo-palabra-ia .74s cubic-bezier(.16,1,.3,1) forwards;
  }
  @keyframes aui-vo-palabra-ia {
    0%   { opacity: 0; filter: blur(4px); -webkit-text-fill-color: transparent; }
    40%  { opacity: 1; filter: blur(0);   -webkit-text-fill-color: transparent; }
    100% { opacity: 1; filter: blur(0);   -webkit-text-fill-color: var(--foreground, #141414); }
  }
}

/* Controles: una píldora que se estira entre «hablar» y los controles de la llamada. */
.aui-vo-ctrl {
  position: relative; display: flex; justify-content: center; box-sizing: content-box;
  height: calc(var(--control-height-lg, 48px) - 2px); overflow: hidden;
  border: 1px solid var(--border, #e5e5e5); border-radius: var(--radius-pill, 999px);
  background: var(--surface-raised, #fff); box-shadow: var(--shadow-resting, 0 1px 2px rgba(15,27,24,.06));
  font-family: var(--font-body, inherit);
}
.aui-vo-reposo, .aui-vo-vivo { display: flex; flex: none; align-items: center; height: 100%; }
.aui-vo-vivo { gap: 4px; padding: 0 4px; }
.aui-vo-iniciar {
  display: inline-flex; align-items: center; gap: 8px; height: 100%; padding: 0 20px 0 16px; border: 0;
  background: transparent; color: var(--foreground, #141414); font: inherit; font-size: var(--text-sm, 14px);
  font-weight: 500; white-space: nowrap; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.aui-vo-redondo, .aui-vo-fin {
  display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0;
  border-radius: var(--radius-pill, 999px); background: transparent; color: var(--foreground, #141414);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: background-color 160ms var(--ease-standard, cubic-bezier(.22,1,.36,1)),
              color 160ms var(--ease-standard, cubic-bezier(.22,1,.36,1)),
              transform 90ms var(--ease-standard, cubic-bezier(.22,1,.36,1));
}
.aui-vo-redondo[aria-pressed="true"] { background: var(--foreground, #141414); color: var(--background, #fff); }
.aui-vo-fin { background: color-mix(in oklab, var(--danger, #d8543f) 12%, transparent); color: var(--danger, #d8543f); }
.aui-vo-redondo:active, .aui-vo-fin:active { transform: scale(.96); }
.aui-vo-reloj {
  min-width: 4.5ch; padding: 0 8px; color: var(--text-secondary, #555);
  font-size: var(--text-sm, 14px); font-variant-numeric: tabular-nums; text-align: center;
}

.aui-vo-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; margin: 0; }

@media (hover: hover) and (pointer: fine) {
  .aui-vo-iniciar:hover { background: var(--surface-muted, #f5f5f5); }
  .aui-vo-redondo:not([aria-pressed="true"]):hover { background: var(--surface-muted, #f5f5f5); }
  .aui-vo-fin:hover { background: color-mix(in oklab, var(--danger, #d8543f) 18%, transparent); }
}

/* El anillo de foco solo con teclado, como en todo el kit. */
.aui-vo-iniciar:focus-visible, .aui-vo-redondo:focus-visible, .aui-vo-fin:focus-visible {
  outline: 2px solid var(--accent, #13967e); outline-offset: -2px;
}

@media (prefers-reduced-motion: reduce) {
  /* Sin animación se quedaría en el 0 %, que es transparente: hay que devolver el color a mano. */
  .aui-vo-palabra { animation: none; opacity: 1; filter: none; background-image: none;
    -webkit-text-fill-color: var(--foreground, #141414); }
  .aui-vo-redondo, .aui-vo-fin { transition: none; }
}
