/* =========================================================================
   3D Figurki — voice agent surface
   Two homes for the same orb: the dock capsule that follows you around the
   site, and the console that opens when you talk to it.
   ========================================================================= */

.vx {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 90;
  font-family: var(--font-body);
}

/* ------------------------------------------------------------------ dock */

.vx__dock {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 20px 9px 9px;
  border: 1px solid var(--ember-edge, rgba(255, 107, 44, 0.35));
  border-radius: 999px;
  background: rgba(16, 17, 21, 0.86);
  backdrop-filter: blur(14px);
  color: var(--fog-100);
  cursor: pointer;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5), 0 0 0 0 rgba(255, 107, 44, 0.4);
  transition: transform 0.24s var(--ease-out), border-color 0.24s, box-shadow 0.4s;
  animation: vx-beacon 3.6s ease-in-out infinite;
}

.vx__dock:hover {
  transform: translateY(-2px);
  border-color: var(--ember, #ff6b2c);
}

.vx__dock.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.88);
}

/* A slow ring that pushes outward — enough to catch the eye on a page the
   visitor is already reading, without the jitter of a constant pulse. */
@keyframes vx-beacon {
  0%, 72%  { box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5), 0 0 0 0 rgba(255, 107, 44, 0.45); }
  88%      { box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5), 0 0 0 16px rgba(255, 107, 44, 0); }
  100%     { box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5), 0 0 0 0 rgba(255, 107, 44, 0); }
}

.vx__dock-orb {
  width: 42px;
  height: 42px;
  flex: none;
  display: block;
}

.vx__dock-text {
  display: grid;
  text-align: left;
  line-height: 1.25;
}

.vx__dock-text b {
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.vx__dock-text i {
  font-style: normal;
  font-size: 0.7rem;
  color: var(--fog-400);
}

/* --------------------------------------------------------------- console */

.vx__panel {
  width: min(390px, calc(100vw - 32px));
  border: 1px solid var(--line, rgba(255, 255, 255, 0.09));
  border-radius: 22px;
  background: rgba(13, 14, 18, 0.94);
  backdrop-filter: blur(22px);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.66);
  overflow: hidden;
  animation: vx-in 0.36s var(--ease-out) both;
}

@keyframes vx-in {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}

.vx__head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 14px 14px 12px 18px;
  border-bottom: 1px solid var(--line, rgba(255, 255, 255, 0.07));
}

.vx__head strong {
  flex: 1;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--fog-300, #b6b9c2);
}

.vx__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--fog-400, #7d8189);
  flex: none;
  transition: background 0.3s;
}

.vx[data-state='listening'] .vx__dot { background: #35d07f; animation: vx-blink 1.9s infinite; }
.vx[data-state='speaking']  .vx__dot { background: var(--ember, #ff6b2c); }
.vx[data-state='connecting'] .vx__dot,
.vx[data-state='thinking']  .vx__dot { background: var(--gold, #ffc46b); animation: vx-blink 1s infinite; }

.vx[data-state='offline'] .vx__dot { background: var(--rose, #f2555a); }
/* No microphone, so a mute toggle is a button that does nothing. */
.vx[data-state='offline'] #vx-mute,
.vx[data-state='offline'] #vx-type { display: none; }

@keyframes vx-blink { 50% { opacity: 0.3; } }

.vx__icon {
  color: var(--fog-400);
  padding: 5px;
  border-radius: 8px;
  background: none;
  border: 0;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.vx__icon:hover { color: var(--pure, #fff); background: rgba(255, 255, 255, 0.07); }

/* ----------------------------------------------------------------- stage */

.vx__stage {
  display: grid;
  place-items: center;
  padding: 10px 0 2px;
}

.vx__stage-orb {
  width: 186px;
  height: 186px;
  display: block;
}

/* -------------------------------------------------------------- captions */

.vx__caps {
  max-height: 176px;
  overflow-y: auto;
  padding: 6px 18px 12px;
  display: grid;
  gap: 8px;
  align-content: start;
  scrollbar-width: thin;
}

.vx__cap {
  margin: 0;
  font-size: 0.87rem;
  line-height: 1.5;
  animation: vx-cap 0.3s var(--ease-out) both;
}

@keyframes vx-cap {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: none; }
}

.vx__cap--model { color: var(--fog-100, #eceef2); }
.vx__cap--user  { color: var(--fog-400, #7d8189); text-align: right; }
.vx__cap[data-pending] { opacity: 0.6; }

/* Chips announcing what the agent just did to the page. */
.vx__acts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 18px;
}

.vx__act {
  font-size: 0.68rem;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--ember-edge, rgba(255, 107, 44, 0.3));
  color: var(--ember, #ff6b2c);
  background: rgba(255, 107, 44, 0.08);
  transition: opacity 0.4s;
  animation: vx-cap 0.3s var(--ease-out) both;
}

/* --------------------------------------------------------------- footer */

.vx__foot {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 14px 18px 16px;
}

.vx__btn {
  height: 38px;
  min-width: 38px;
  padding: 0 12px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  border: 1px solid var(--line, rgba(255, 255, 255, 0.1));
  background: transparent;
  color: var(--fog-300, #b6b9c2);
  font-family: inherit;
  font-size: 0.83rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.vx__btn:hover { color: var(--pure, #fff); border-color: var(--fog-400, #7d8189); }

.vx__btn--stop {
  flex: 1;
  border-color: var(--ember-edge, rgba(255, 107, 44, 0.3));
  color: var(--ember, #ff6b2c);
}
.vx__btn--stop:hover {
  background: var(--ember, #ff6b2c);
  border-color: var(--ember, #ff6b2c);
  color: var(--ink-950, #0a0b0d);
}

#vx-mute.is-off {
  color: #ff5f56;
  border-color: rgba(255, 95, 86, 0.4);
  background: rgba(255, 95, 86, 0.08);
}

.vx__type {
  display: flex;
  gap: 8px;
  padding: 0 18px 16px;
}

.vx__input {
  flex: 1;
  height: 38px;
  padding: 0 13px;
  border-radius: 11px;
  border: 1px solid var(--line, rgba(255, 255, 255, 0.1));
  background: rgba(255, 255, 255, 0.03);
  color: var(--fog-100, #eceef2);
  font-family: inherit;
  font-size: 0.86rem;
}
.vx__input:focus { outline: none; border-color: var(--ember, #ff6b2c); }

.vx__btn--send {
  background: var(--ember, #ff6b2c);
  border-color: var(--ember, #ff6b2c);
  color: var(--ink-950, #0a0b0d);
}
.vx__btn--send:hover { color: var(--ink-950, #0a0b0d); }

/* ------------------------------------------------------- spotlight a card */

.is-spotlit {
  animation: vx-spot 2.6s var(--ease-out);
  border-radius: var(--r-md, 14px);
}

@keyframes vx-spot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 107, 44, 0); }
  18%      { box-shadow: 0 0 0 3px rgba(255, 107, 44, 0.75), 0 0 46px rgba(255, 107, 44, 0.3); }
  70%      { box-shadow: 0 0 0 3px rgba(255, 107, 44, 0.5), 0 0 40px rgba(255, 107, 44, 0.2); }
}

/* ====================================================== homepage AI hero */

.ai-hero {
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--line, rgba(255, 255, 255, 0.07));
  border-bottom: 1px solid var(--line, rgba(255, 255, 255, 0.07));
  padding: clamp(56px, 8vw, 104px) 0;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(255, 107, 44, 0.12), transparent 62%),
    var(--ink-900, #101116);
}

.ai-hero__inner {
  display: grid;
  gap: clamp(30px, 5vw, 58px);
  grid-template-columns: 1fr;
  align-items: center;
  text-align: center;
  justify-items: center;
}

.ai-hero__orb-wrap {
  position: relative;
  display: grid;
  place-items: center;
  cursor: pointer;
  border: 0;
  background: none;
  padding: 0;
}

.ai-hero__orb {
  width: clamp(230px, 34vw, 330px);
  height: clamp(230px, 34vw, 330px);
  display: block;
  transition: transform 0.4s var(--ease-out);
}

.ai-hero__orb-wrap:hover .ai-hero__orb { transform: scale(1.045); }

/* The "press me" ring, drawn outside the canvas so it never fights the
   orb's own motion. */
.ai-hero__ring {
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  border: 1px solid rgba(255, 107, 44, 0.24);
  animation: vx-ring 4.4s ease-out infinite;
  pointer-events: none;
}
.ai-hero__ring:nth-of-type(2) { animation-delay: 1.45s; }
.ai-hero__ring:nth-of-type(3) { animation-delay: 2.9s; }

@keyframes vx-ring {
  0%   { transform: scale(0.82); opacity: 0; }
  22%  { opacity: 0.8; }
  100% { transform: scale(1.38); opacity: 0; }
}

.ai-hero__cta {
  position: absolute;
  bottom: -6px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 999px;
  background: var(--ember, #ff6b2c);
  color: var(--ink-950, #0a0b0d);
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  box-shadow: 0 10px 34px rgba(255, 107, 44, 0.34);
  pointer-events: none;
}

.ai-hero__says {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  justify-content: center;
  margin-top: 26px;
}

.ai-hero__say {
  font-size: 0.82rem;
  padding: 8px 15px;
  border-radius: 999px;
  border: 1px solid var(--line, rgba(255, 255, 255, 0.1));
  color: var(--fog-300, #b6b9c2);
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.2s, color 0.2s, transform 0.2s;
}

.ai-hero__say:hover {
  color: var(--pure, #fff);
  border-color: var(--ember, #ff6b2c);
  transform: translateY(-1px);
}

@media (min-width: 900px) {
  .ai-hero__inner {
    grid-template-columns: 1.05fr 0.95fr;
    text-align: left;
    justify-items: start;
  }
  .ai-hero__says { justify-content: flex-start; }
  .ai-hero__orb-wrap { justify-self: center; }
}

/* ---------------------------------------------------------------- mobile */

@media (max-width: 520px) {
  /* The dock keeps its slot in the flow even while faded out, so it must not
     be a flex sibling of the panel — it would steal half the width. */
  .vx { right: 12px; bottom: 12px; left: 12px; }
  .vx__dock { width: fit-content; margin-left: auto; }
  .vx__panel { width: 100%; }
  .vx__stage-orb { width: 152px; height: 152px; }
  .vx__caps { max-height: 30vh; }
  .vx__dock-text i { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .vx__dock { animation: none; }
  .ai-hero__ring { animation: none; opacity: 0.35; }
  .vx__panel, .vx__cap, .vx__act { animation: none; }
  .is-spotlit { animation: none; box-shadow: 0 0 0 3px rgba(255, 107, 44, 0.7); }
}
