/* garnet-companion.css — Ghost companion overlay */

.gc-root {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 9990;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: #f0f0f0;
  pointer-events: none;
}

.gc-root > * { pointer-events: auto; }

/* Bubble */
.gc-bubble {
  position: relative;
  width: 64px;
  height: 64px;
  padding: 0;
  border: 2px solid rgba(170, 26, 51, 0.6);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(214, 58, 82, 0.25), rgba(5, 5, 5, 0.95));
  cursor: pointer;
  transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 0 0 rgba(170, 26, 51, 0);
}
.gc-bubble:hover {
  transform: scale(1.05);
  border-color: rgba(214, 58, 82, 0.9);
  box-shadow: 0 4px 28px rgba(0, 0, 0, 0.5), 0 0 0 4px rgba(170, 26, 51, 0.15);
}
.gc-bubble-canvas {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: block;
}
/* Fallback shown on low-end devices in place of the 3D Ghost */
.gc-bubble-fallback {
  width: 70%;
  height: 70%;
  margin: 15%;
  display: block;
  filter: drop-shadow(0 0 8px rgba(170,26,51,0.5));
}
.gc-bubble-pulse {
  position: absolute;
  inset: -4px;
  border: 2px solid rgba(170, 26, 51, 0.4);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}
.gc-bubble.gc-pulsing .gc-bubble-pulse {
  animation: gc-pulse 2.4s ease-out infinite;
}
@keyframes gc-pulse {
  0% { opacity: 0.6; transform: scale(1); }
  70% { opacity: 0; transform: scale(1.6); }
  100% { opacity: 0; transform: scale(1.6); }
}

/* Drawer */
.gc-drawer {
  position: absolute;
  right: 0;
  bottom: 80px;
  width: 320px;
  max-height: 480px;
  display: flex;
  flex-direction: column;
  background: rgba(10, 10, 10, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(170, 26, 51, 0.4);
  border-radius: 12px;
  overflow: hidden;
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  pointer-events: none;
  /* visibility:hidden when collapsed removes children from the tab
   * order — fixes the aria-hidden-focus WCAG violation that axe-core
   * flagged on /pricing (focusable input + buttons inside an
   * aria-hidden parent). Visibility transitions instantly when
   * opening, lags behind opacity by 220ms when closing so the
   * fade-out plays before children disappear from a11y tree. */
  visibility: hidden;
  transition: opacity 220ms ease, transform 220ms ease, visibility 0s linear 220ms;
}
.gc-expanded .gc-drawer {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  visibility: visible;
  transition: opacity 220ms ease, transform 220ms ease, visibility 0s linear 0s;
}

.gc-drawer-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.gc-drawer-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.95rem;
  color: #fff;
  font-weight: 600;
}
.gc-drawer-sub {
  flex: 1;
  font-size: 0.72rem;
  color: rgba(240, 240, 240, 0.5);
}
.gc-voice-toggle, .gc-close {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(240, 240, 240, 0.7);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  transition: all 150ms ease;
}
.gc-voice-toggle:hover, .gc-close:hover {
  border-color: rgba(170, 26, 51, 0.5);
  color: #fff;
}
.gc-voice-toggle svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}
.gc-voice-toggle[data-on="1"] {
  background: rgba(170, 26, 51, 0.2);
  color: #d63a52;
  border-color: rgba(214, 58, 82, 0.6);
}

.gc-thread {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 320px;
}
.gc-thread::-webkit-scrollbar { width: 4px; }
.gc-thread::-webkit-scrollbar-thumb { background: rgba(170, 26, 51, 0.3); border-radius: 2px; }

.gc-msg {
  font-size: 0.85rem;
  line-height: 1.4;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  max-width: 85%;
  word-wrap: break-word;
}
.gc-msg-ghost {
  background: rgba(40, 40, 40, 0.6);
  color: rgba(240, 240, 240, 0.92);
  align-self: flex-start;
  border-bottom-left-radius: 2px;
}
.gc-msg-user {
  background: rgba(170, 26, 51, 0.85);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 2px;
}
.gc-typing { font-style: italic; opacity: 0.6; }

.gc-form {
  display: flex;
  gap: 0.4rem;
  padding: 0.5rem 0.75rem 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.gc-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  color: #f0f0f0;
  font-family: inherit;
  outline: none;
  transition: border-color 150ms ease;
}
.gc-input:focus { border-color: rgba(214, 58, 82, 0.6); }
.gc-send {
  background: rgba(170, 26, 51, 0.85);
  border: none;
  border-radius: 8px;
  width: 36px;
  height: 36px;
  color: #fff;
  cursor: pointer;
  font-size: 0.95rem;
  transition: background 150ms ease;
}
.gc-send:hover { background: #aa1a33; }

/* Highlight target (directive) */
.gc-highlight {
  outline: 2px solid #d63a52;
  outline-offset: 4px;
  animation: gc-flash 1.5s ease-out;
}
@keyframes gc-flash {
  0%, 100% { outline-color: rgba(214, 58, 82, 0); }
  20% { outline-color: rgba(214, 58, 82, 1); }
}

/* Mobile */
@media (max-width: 767px) {
  .gc-root { right: 1rem; bottom: 1rem; }
  .gc-drawer {
    width: calc(100vw - 2rem);
    max-width: 360px;
    bottom: 76px;
  }
  .gc-bubble { width: 56px; height: 56px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .gc-bubble, .gc-drawer, .gc-bubble-pulse {
    animation: none !important;
    transition: opacity 100ms linear !important;
  }
}

/* Hide companion on operator pages by default — JS also gates */
body[data-companion="off"] .gc-root { display: none !important; }

/* ─────────────────────────────────────────────────────────────────
   .design-signature — global footer-link treatment.
   Sitewide marker for the "founder/design-signature" link in the
   footer (links to architect.html). Subtle by default; rotates a
   diamond + animates an underline gradient on hover. Styles ship
   with garnet-companion.css since both are auto-loaded on every
   public page that mounts the Companion.
   ───────────────────────────────────────────────────────────────── */
a.design-signature {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  text-decoration: none;
  color: inherit;
  transition: color 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
a.design-signature::before {
  content: '◆';
  font-size: 0.7em;
  color: hsl(348, 83%, 60%);
  opacity: 0.6;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
  display: inline-block;
}
a.design-signature::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, hsl(348, 83%, 60%) 50%, transparent 100%);
  background-size: 200% 100%;
  background-position: 200% 0;
  opacity: 0.4;
  transition: opacity 0.3s ease, background-position 1.2s linear;
}
a.design-signature:hover { color: hsl(348, 83%, 70%); }
a.design-signature:hover::before { transform: rotate(180deg); opacity: 1; }
a.design-signature:hover::after { opacity: 1; background-position: -200% 0; }
a.design-signature.is-current::before {
  opacity: 1;
  filter: drop-shadow(0 0 4px hsla(348, 83%, 60%, 0.6));
}
@media (prefers-reduced-motion: reduce) {
  a.design-signature::before,
  a.design-signature::after { transition: none !important; }
  a.design-signature:hover::before { transform: none; }
}
