/* VI1 orb. WebGL sphere with a CSS gradient fallback. */
@import "./palettes.css";
@property --o1 { syntax: "<color>"; inherits: true; initial-value: #355779; }
@property --o2 { syntax: "<color>"; inherits: true; initial-value: #6587cb; }
@property --o3 { syntax: "<color>"; inherits: true; initial-value: #eaf5ff; }
@property --oa { syntax: "<color>"; inherits: true; initial-value: #64c9e8; }
@property --op { syntax: "<color>"; inherits: true; initial-value: #8eafec; }
/* ---------- Orb ---------- */
.orb-stage { position: relative; isolation: isolate; aspect-ratio: 1; border-radius: var(--radius-lg); overflow: hidden; --lvl: 0; transition: --o1 .8s, --o2 .8s, --o3 .8s; background: radial-gradient(60% 60% at 50% 46%, color-mix(in srgb, var(--o1) 10%, #fff) 0%, #f7f7f8 62%, #f1f1f3 100%); border: 1px solid var(--line); }
.orb-xl { border-radius: 40px; box-shadow: 0 40px 90px -40px color-mix(in srgb, var(--o1) 60%, transparent); }
.orb-glow { position: absolute; left: 50%; top: 47%; width: 78%; aspect-ratio: 1; border-radius: 50%; transform: translate(-50%, -50%) scale(calc(.95 + var(--lvl) * .25)); background: radial-gradient(circle, color-mix(in srgb, var(--o2) 45%, transparent), color-mix(in srgb, var(--o1) 20%, transparent) 45%, transparent 70%); filter: blur(30px); opacity: .55; z-index: -1; transition: opacity .6s; }
.orb-stage[data-state="speaking"] .orb-glow, .orb-stage[data-state="listening"] .orb-glow { opacity: .95; }
.orb-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.orb-gl .orb-css, .orb-fallback .orb-canvas { display: none; }
.orb-css { position: absolute; left: 50%; top: 50%; width: 64%; aspect-ratio: 1; border-radius: 50%; overflow: hidden; transform: translate(-50%, -50%) scale(calc(1 + var(--lvl) * .14)); background: radial-gradient(circle at 32% 26%, color-mix(in srgb, var(--o3) 90%, #fff) 0 8%, transparent 38%), radial-gradient(circle at 72% 78%, var(--o2) 0, transparent 62%), radial-gradient(circle at 40% 60%, var(--o1), var(--o2) 85%); box-shadow: 0 0 calc(50px + var(--lvl) * 90px) color-mix(in srgb, var(--o1) 45%, transparent), inset -18px -24px 60px color-mix(in srgb, var(--o1) 60%, #000 10%), inset 14px 18px 40px color-mix(in srgb, var(--o3) 70%, transparent); animation: breathe 5.5s ease-in-out infinite; }
.orb-css i { position: absolute; inset: -25%; border-radius: 42%; mix-blend-mode: screen; opacity: .55; filter: blur(22px); animation: spin 14s linear infinite; background: conic-gradient(from 0deg, transparent 0 20%, color-mix(in srgb, var(--o3) 70%, transparent) 30%, transparent 45% 70%, color-mix(in srgb, var(--o2) 60%, transparent) 82%, transparent); }
.orb-css i:nth-child(2) { animation-duration: 21s; animation-direction: reverse; opacity: .4; inset: -35%; }
.orb-css i:nth-child(3) { animation-duration: 9s; opacity: .25; filter: blur(14px); }
@keyframes breathe { 0%, 100% { scale: 1; } 50% { scale: 1.035; } }
@keyframes spin { to { transform: rotate(1turn); } }
.orb-foot { position: absolute; left: 16px; right: 16px; bottom: 16px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.orb-state { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: 999px; font: 600 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); background: rgba(255, 255, 255, .72); border: 1px solid rgba(10, 10, 11, .06); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.orb-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); transition: background .3s, box-shadow .3s; }
[data-state="speaking"] .orb-state, [data-state="listening"] .orb-state { color: var(--ink); }
[data-state="speaking"] .orb-state::before { background: var(--o2); box-shadow: 0 0 0 4px color-mix(in srgb, var(--o2) 25%, transparent); }
[data-state="listening"] .orb-state::before { background: #ef4444; box-shadow: 0 0 0 4px rgba(239, 68, 68, .2); }
/* Full-screen call use: a round luminous sphere. Width and height stay equal. */
.orb-call {
  --line: transparent;
  --radius-lg: 50%;
  width: min(272px, 62vw, 42vh);
  height: min(272px, 62vw, 42vh);
  aspect-ratio: 1;
  flex: none;
  align-self: center;
  min-width: 0;
  min-height: 0;
  background: transparent;
  border: 0;
  border-radius: 50%;
  overflow: visible;
  box-shadow: none;
}
.orb-call .orb-foot { display: none; }
.orb-call.orb-gl .orb-glow { opacity: 0; }
.orb-call .orb-glow {
  width: 88%;
  height: 88%;
  aspect-ratio: 1;
  top: 50%;
  opacity: 1;
  z-index: 0;
  filter: blur(22px);
  background: radial-gradient(circle, color-mix(in srgb, var(--oa) 55%, transparent) 0%, color-mix(in srgb, var(--o2) 28%, transparent) 36%, transparent 64%);
}
.orb-call .orb-css {
  width: 62%;
  height: 62%;
  aspect-ratio: 1;
  border-radius: 50%;
  animation: orb-breathe 3.6s ease-in-out infinite;
  background:
    radial-gradient(circle at 30% 28%, color-mix(in srgb, var(--o3) 88%, #fff) 0 2.5%, var(--oa) 7%, transparent 16%),
    radial-gradient(circle at 42% 40%, var(--op) 0%, transparent 28%),
    radial-gradient(circle at 50% 54%, var(--o2) 0%, color-mix(in srgb, var(--o1) 58%, var(--o2)) 46%, var(--o1) 100%);
  box-shadow:
    inset -16px -20px 28px color-mix(in srgb, var(--o1) 55%, #000),
    inset 6px 8px 14px color-mix(in srgb, var(--oa) 35%, transparent),
    0 0 20px 6px color-mix(in srgb, var(--oa) 55%, transparent),
    0 0 54px 16px color-mix(in srgb, var(--o2) 42%, transparent);
}
.orb-call .orb-css i {
  inset: 18%;
  border-radius: 50%;
  filter: blur(8px);
  opacity: 0.55;
  mix-blend-mode: soft-light;
  background: radial-gradient(circle at 28% 26%, var(--oa), transparent 46%);
}
.orb-call .orb-css i:nth-child(2) {
  inset: 22%;
  opacity: 0.4;
  animation-duration: 16s;
  background: radial-gradient(circle at 70% 64%, var(--op), transparent 58%);
}
.orb-call .orb-css i:nth-child(3) {
  inset: 10%;
  opacity: 0.28;
  filter: blur(5px);
  animation-duration: 11s;
  background: conic-gradient(from 20deg, transparent 0 68%, color-mix(in srgb, var(--oa) 75%, transparent) 78%, transparent 88%);
}
.orb-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; margin: 4px 0 8px; }
.orb-pick button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 96px; padding: 10px 6px 12px; border-radius: 18px;
  background: var(--panel, #fff); color: var(--ink, #293a53);
  border: 1px solid var(--line, #d5e3f3); box-shadow: none;
  font-weight: 500; font-size: 0.82em; line-height: 1.2;
}
.orb-pick button.on { border-color: var(--focus, #6587cb); box-shadow: 0 0 0 2px color-mix(in srgb, var(--focus, #6587cb) 55%, transparent); }
.orb-swatch {
  width: 46px; height: 46px; border-radius: 50%; flex: none; display: block;
  background:
    radial-gradient(circle at 32% 28%, color-mix(in srgb, var(--o3) 75%, #fff) 0 7%, var(--oa, var(--o2)) 18%, transparent 36%),
    radial-gradient(circle at 50% 58%, var(--o2) 0%, var(--o1) 80%);
  box-shadow: inset -6px -8px 10px color-mix(in srgb, var(--o1) 45%, #000), 0 0 12px 2px color-mix(in srgb, var(--oa, var(--o2)) 50%, transparent);
  animation: orb-breathe 3.6s ease-in-out infinite;
}
@keyframes orb-breathe { 0%, 100% { scale: 1; } 50% { scale: 1.045; } }
@media (prefers-reduced-motion: reduce) {
  .orb-call .orb-css, .orb-swatch { animation: none; }
  .orb-css, .orb-glow, .orb-mini { transform: translate(-50%, -50%); }
  .orb-mini { transform: none; }
  .orb-stage[data-state="speaking"] .orb-css { box-shadow: 0 0 0 6px color-mix(in srgb, var(--o2) 35%, transparent), 0 0 80px color-mix(in srgb, var(--o1) 55%, transparent); }
}
