/* N.A.O.M.I. demo chat box. Change the colours here to match your site. */
.nd {
  --nd-bg: #11181c;
  --nd-panel: #1a252c;
  --nd-line: #2d3e4a;
  --nd-text: #e0e0e0;
  --nd-muted: #9aa5ad;
  --nd-accent: #39b8ff;
  --nd-user: #1b3a5c;
  max-width: 560px;
  margin: 0 auto;
  background: var(--nd-bg);
  color: var(--nd-text);
  border: 1px solid var(--nd-line);
  border-radius: 14px;
  padding: 16px;
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  box-sizing: border-box;
}
.nd * { box-sizing: border-box; }
.nd-head { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
/* Hologram face: drifting scanlines, a sweeping light band, and an occasional glitch */
.nd-holo {
  position: relative; width: 96px; height: 96px; flex: none; overflow: hidden;
  border-radius: 12px; border: 1px solid var(--nd-accent); background: #000;
  box-shadow: 0 0 18px rgba(57, 184, 255, .35);
  animation: nd-glow 4s ease-in-out infinite;
}
.nd-face { display: block; width: 100%; height: 100%; animation: nd-flicker 7s infinite; }
.nd-holo::before {            /* scanlines drifting upward */
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background: repeating-linear-gradient(to bottom, rgba(140, 215, 255, .16) 0 1px, transparent 1px 4px);
  background-size: 100% 4px; mix-blend-mode: screen;
  animation: nd-scan 1.6s linear infinite;
}
.nd-holo::after {             /* bright band sweeping up */
  content: ""; position: absolute; left: 0; right: 0; height: 35%; top: 0; pointer-events: none; z-index: 3;
  background: linear-gradient(to bottom, transparent, rgba(90, 200, 255, .28) 45%, rgba(200, 240, 255, .45) 50%, rgba(90, 200, 255, .28) 55%, transparent);
  mix-blend-mode: screen; transform: translateY(300%);
  animation: nd-sweep 4.5s cubic-bezier(.45, 0, .55, 1) infinite;
}
.nd-glitch {                  /* a slice of her face that jumps sideways for a moment */
  position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: 0;
  background-size: cover; background-position: center;
  filter: hue-rotate(-12deg) saturate(1.3) brightness(1.08);
  animation: nd-glitch-a 7s steps(1) infinite;
}
.nd-glitch2 { filter: hue-rotate(25deg) saturate(1.2); animation-name: nd-glitch-b; animation-delay: .05s; }
@keyframes nd-scan { from { background-position: 0 0; } to { background-position: 0 -4px; } }
@keyframes nd-sweep { 0% { transform: translateY(300%); } 70%, 100% { transform: translateY(-110%); } }
@keyframes nd-glow { 0%, 100% { box-shadow: 0 0 14px rgba(57, 184, 255, .30); } 50% { box-shadow: 0 0 24px rgba(57, 184, 255, .55); } }
@keyframes nd-flicker {
  0%, 89%, 100% { opacity: 1; transform: none; }
  90% { opacity: .75; transform: translateX(1px); }
  90.6% { opacity: 1; transform: translateX(-2px) skewX(-4deg); }
  91.2% { opacity: .85; transform: none; }
  95% { opacity: 1; }
  95.4% { opacity: .7; }
  95.8% { opacity: 1; }
}
@keyframes nd-glitch-a {
  0%, 89.9% { opacity: 0; }
  90% { opacity: .75; clip-path: inset(22% 0 58% 0); transform: translateX(-7px); }
  90.6% { opacity: .75; clip-path: inset(61% 0 24% 0); transform: translateX(6px); }
  91.2% { opacity: .65; clip-path: inset(40% 0 47% 0); transform: translateX(-4px); }
  91.8%, 100% { opacity: 0; }
}
@keyframes nd-glitch-b {
  0%, 90.2% { opacity: 0; }
  90.3% { opacity: .7; clip-path: inset(8% 0 80% 0); transform: translateX(5px); }
  90.9% { opacity: .7; clip-path: inset(75% 0 12% 0); transform: translateX(-6px); }
  91.5%, 100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .nd-holo, .nd-face, .nd-holo::before, .nd-holo::after, .nd-glitch { animation: none; }
  .nd-holo::after { display: none; }
}
.nd-name { font-weight: 700; letter-spacing: .08em; color: var(--nd-accent); }
.nd-sub { color: var(--nd-muted); font-size: 13px; }
.nd-status { display: flex; align-items: center; gap: 6px; font-size: 13px; margin-top: 6px; }
.nd-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--nd-muted); }
.nd[data-state="online"] .nd-dot { background: #3ddc84; box-shadow: 0 0 6px #3ddc84; }
.nd[data-state="busy"] .nd-dot { background: #f5b942; }
.nd[data-state="asleep"] .nd-dot { background: #6b7280; }
.nd-log {
  height: 300px; overflow-y: auto; padding: 10px;
  background: var(--nd-panel); border: 1px solid var(--nd-line); border-radius: 10px;
  display: flex; flex-direction: column; gap: 8px;
}
.nd-msg { max-width: 85%; padding: 8px 12px; border-radius: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.nd-naomi { align-self: flex-start; background: #0f2236; border: 1px solid #18406a; }
.nd-user { align-self: flex-end; background: var(--nd-user); }
.nd-wait { color: var(--nd-muted); }
.nd-error { color: #f5b942; border-color: #5a4210; background: #241a08; }
.nd-form { display: flex; gap: 8px; margin-top: 10px; }
.nd-input {
  flex: 1; min-width: 0; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--nd-line); background: var(--nd-panel); color: var(--nd-text); font: inherit;
}
.nd-input:focus { outline: 2px solid var(--nd-accent); outline-offset: 1px; }
.nd-send {
  padding: 10px 16px; border-radius: 10px; border: 0; cursor: pointer;
  background: var(--nd-accent); color: #04121f; font-weight: 700; font: inherit;
}
.nd-send:disabled { opacity: .5; cursor: default; }
.nd-ts:empty { display: none; }
.nd-ts { margin-top: 8px; }
.nd-foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; color: var(--nd-muted); font-size: 12px; }
@media (max-width: 480px) {
  .nd { padding: 12px; }
  .nd-holo { width: 64px; height: 64px; }
  .nd-log { height: 260px; }
}

/* Waiting animation */
.nd-wait { display: flex; align-items: center; gap: 10px; color: var(--nd-muted); font-size: 14px; }
.nd-dots { display: inline-flex; gap: 4px; }
.nd-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--nd-accent); opacity: .3;
             animation: nd-bounce 1.2s infinite ease-in-out; }
.nd-dots i:nth-child(2) { animation-delay: .15s; }
.nd-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes nd-bounce { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-4px); } }
.nd-face { transition: opacity .25s; }
@media (prefers-reduced-motion: reduce) { .nd-dots i { animation: none; opacity: .8; } }
