/* =====================================================
   Site extras: assistant (particle orb, light theme, voice input) + helpers
   not in the compiled Tailwind build.
   ===================================================== */
:root {
  --nd-ink: var(--color-secondary, #1a1a1c);
  --nd-ink-60: rgba(26, 26, 28, .6);
  --nd-ink-40: rgba(26, 26, 28, .42);
  --nd-line: var(--color-stroke-1, #dfe4eb);
  --nd-soft: var(--color-background-13, #f2f5fa);
  --nd-paper: #ffffff;
  --nd-violet: var(--color-primary-500, #864ffe);
  --nd-grad: linear-gradient(135deg, #60c4ff 0%, #8b5cf6 40%, #e248aa 72%, #ff9c40 100%);
  --nd-grad-btn: linear-gradient(135deg, #8b5cf6, #e248aa 70%, #ff9c40);
}

.nd-lift { will-change: transform; transition: transform .35s cubic-bezier(.2, .8, .2, 1); }
.nd-lift:hover { transform: translateY(-4px); }
.nd-lift:hover .nd-arrow { transform: translateX(4px); }
.nd-arrow { display: inline-block; transition: transform .3s ease; }

/* An <h1> that keeps the original <h2> look (pages got a real H1 for SEO without a design change) */
h1.nd-as-h2:not([class*="text-heading"]) { font-size: var(--text-heading-5); line-height: var(--text-heading-5--line-height); }
h1.nd-as-h2:not([class*="font-"]) { font-weight: var(--font-weight-normal, 400); }
@media (min-width: 40rem) { h1.nd-as-h2:not([class*="text-heading"]) { font-size: var(--text-heading-4); line-height: var(--text-heading-4--line-height); } }
@media (min-width: 48rem) { h1.nd-as-h2:not([class*="text-heading"]) { font-size: var(--text-heading-3); line-height: var(--text-heading-3--line-height); } }
@media (min-width: 80rem) { h1.nd-as-h2:not([class*="text-heading"]) { font-size: var(--text-heading-2); line-height: var(--text-heading-2--line-height); } }

/* ---------- Launcher ---------- */
.nd-assistant { position: fixed; right: 20px; bottom: 20px; z-index: 60; font-family: var(--font-inter-tight, 'Inter Tight', system-ui, sans-serif); }
.nd-has-prompt-bar .nd-assistant { bottom: 96px; }
@media (min-width: 1024px) { .nd-has-prompt-bar .nd-assistant { bottom: 24px; } }

.nd-orb-btn {
  position: relative; display: flex; align-items: center; gap: 8px; margin-left: auto;
  padding: 4px 18px 4px 4px; border: 1px solid rgba(255, 255, 255, .9); border-radius: 999px;
  background: rgba(255, 255, 255, .88); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); color: var(--nd-ink); cursor: pointer;
  box-shadow: 0 14px 34px -14px rgba(139, 92, 246, .55), 0 2px 8px rgba(16, 24, 40, .06);
  transition: transform .3s cubic-bezier(.2, .8, .2, 1), box-shadow .3s ease, padding .3s ease;
}
.nd-orb-btn::before {
  content: ''; position: absolute; left: -4px; top: 50%; width: 60px; height: 60px; transform: translateY(-50%);
  border-radius: 50%; background: radial-gradient(circle, rgba(226, 72, 170, .28), rgba(96, 196, 255, .16) 45%, transparent 70%);
  filter: blur(6px); animation: nd-halo 3.2s ease-in-out infinite; pointer-events: none;
}
.nd-orb-btn:hover { transform: translateY(-2px); box-shadow: 0 18px 40px -14px rgba(226, 72, 170, .6), 0 2px 8px rgba(16, 24, 40, .06); }
.nd-orb-btn:focus-visible { outline: 2px solid #8b5cf6; outline-offset: 3px; }
.nd-orb-btn__orb { position: relative; display: block; width: 48px; height: 48px; border-radius: 50%; }
.nd-orb-btn__label { position: relative; font-size: 14px; font-weight: 500; letter-spacing: .02em; }
.is-open .nd-orb-btn__label { display: none; }
.is-open .nd-orb-btn { padding: 4px; }
@keyframes nd-halo { 0%, 100% { opacity: .6; transform: translateY(-50%) scale(.9); } 50% { opacity: 1; transform: translateY(-50%) scale(1.15); } }

/* ---------- Panel (light glass, matches the site) ---------- */
.nd-panel {
  position: absolute; right: 0; bottom: calc(100% + 14px);
  width: min(400px, calc(100vw - 32px)); height: min(640px, var(--nd-panel-h, calc(100vh - 130px)));
  display: flex; flex-direction: column; overflow: hidden; color: var(--nd-ink);
  background:
    radial-gradient(90% 40% at 50% 0%, rgba(193, 177, 249, .35), transparent 70%),
    radial-gradient(60% 30% at 100% 100%, rgba(255, 156, 64, .12), transparent 70%),
    rgba(255, 255, 255, .96);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  border-radius: 28px;
  box-shadow: 0 40px 90px -36px rgba(80, 40, 160, .45), 0 10px 30px -12px rgba(16, 24, 40, .14);
  opacity: 0; transform: translateY(16px) scale(.96); transform-origin: bottom right;
  transition: opacity .28s ease, transform .35s cubic-bezier(.2, .9, .25, 1.1);
}
.nd-panel[hidden] { display: none; }
.is-open .nd-panel { opacity: 1; transform: none; }

.nd-panel__border {
  position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; pointer-events: none; z-index: 3;
  background: conic-gradient(from var(--nd-angle, 0deg), var(--nd-line) 0deg, #60c4ff 50deg, #8b5cf6 110deg, #e248aa 170deg, #ff9c40 220deg, var(--nd-line) 280deg, var(--nd-line) 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: nd-border 7s linear infinite;
}
@property --nd-angle { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
@keyframes nd-border { to { --nd-angle: 360deg; } }
.is-thinking .nd-panel__border, .is-speaking .nd-panel__border, .is-recording .nd-panel__border { animation-duration: 1.4s; }

.nd-panel__head { position: relative; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 14px; border-bottom: 1px solid var(--nd-line); }
.nd-panel__mini { display: block; width: 40px; height: 40px; border-radius: 50%; flex: none; opacity: 0; transform: scale(.6); transition: opacity .35s, transform .35s; }
.is-chatting .nd-panel__mini { opacity: 1; transform: none; }
.nd-panel__titles { flex: 1; min-width: 0; }
.nd-panel__title { margin: 0; font-size: 15.5px; line-height: 1.3; font-weight: 500; color: var(--nd-ink); }
.nd-panel__sub { margin: 2px 0 0; font-size: 12px; color: var(--nd-ink-60); display: flex; align-items: center; gap: 6px; }
.nd-dot { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .18); }
.is-thinking .nd-dot, .is-speaking .nd-dot, .is-recording .nd-dot { background: #e248aa; box-shadow: 0 0 0 3px rgba(226, 72, 170, .2); animation: nd-blink 1s infinite; }
@keyframes nd-blink { 50% { opacity: .35; } }
.nd-icon-btn { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--nd-line); border-radius: 50%; background: #fff; color: var(--nd-ink); cursor: pointer; transition: background .2s, transform .2s; }
.nd-icon-btn:hover { background: var(--nd-soft); transform: rotate(-12deg); }

/* welcome stage with the big orb */
.nd-stage { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 0 22px 6px; max-height: 330px; overflow: hidden; transition: max-height .5s cubic-bezier(.2, .8, .2, 1), opacity .35s, padding .4s; }
.nd-stage__orb { display: block; margin: -4px 0 -10px; }
.nd-stage__hello { margin: 0; font-size: 20px; font-weight: 600; background: var(--nd-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nd-stage__sub { margin: 6px 0 0; font-size: 13px; line-height: 1.5; color: var(--nd-ink-60); }
.is-chatting .nd-stage { max-height: 0; opacity: 0; padding-bottom: 0; }

.nd-panel__log { position: relative; z-index: 1; flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; overscroll-behavior: contain; scroll-behavior: smooth; }
.nd-panel__log::-webkit-scrollbar { width: 5px; }
.nd-panel__log::-webkit-scrollbar-thumb { background: #d7dde5; border-radius: 9px; }

/* messages */
.nd-msg { max-width: 90%; font-size: 14px; line-height: 1.6; animation: nd-msg-in .35s cubic-bezier(.2, .8, .2, 1) both; }
.nd-msg p { margin: 0; }
.nd-msg p + p { margin-top: 6px; }
.nd-msg--user { align-self: flex-end; padding: 10px 14px; border-radius: 20px 20px 6px 20px; background: var(--nd-grad-btn); box-shadow: 0 10px 22px -12px rgba(226, 72, 170, .7); }
.nd-msg--user p { color: #fff; }
.nd-msg--bot { align-self: flex-start; position: relative; padding: 12px 15px; border-radius: 20px 20px 20px 6px; background: #fff; border: 1px solid var(--nd-line); box-shadow: 0 6px 18px -14px rgba(40, 30, 90, .35); }
.nd-msg--bot p { color: var(--nd-ink); }
.nd-msg--bot::before { content: ''; position: absolute; left: -1px; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; background: var(--nd-grad); transition: opacity .5s ease; }
.nd-msg--bot.is-done::before { opacity: 0; }
.nd-bullet { position: relative; padding-left: 16px; }
.nd-bullet::before { content: ''; position: absolute; left: 2px; top: .62em; width: 6px; height: 6px; border-radius: 50%; background: var(--nd-grad); }
@keyframes nd-msg-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.nd-w { display: inline; animation: nd-word .5s ease-out both; }
@keyframes nd-word { from { opacity: 0; filter: blur(6px); } to { opacity: 1; filter: blur(0); } }
.nd-caret { display: inline-block; width: 8px; height: 8px; margin-left: 2px; border-radius: 50%; vertical-align: middle; background: var(--nd-grad); box-shadow: 0 0 10px 2px rgba(226, 72, 170, .45); animation: nd-blink .8s ease-in-out infinite; }

.nd-thinking { display: flex; align-items: center; gap: 10px; padding: 4px 2px; animation: nd-msg-in .3s ease both; }
.nd-thinking__spark { width: 18px; height: 18px; border-radius: 50%; background: conic-gradient(#60c4ff, #8b5cf6, #e248aa, #ff9c40, #60c4ff); -webkit-mask: radial-gradient(circle, transparent 5px, #000 6px); mask: radial-gradient(circle, transparent 5px, #000 6px); animation: nd-spin .9s linear infinite; }
@keyframes nd-spin { to { transform: rotate(360deg); } }
.nd-shimmer { font-size: 13.5px; font-weight: 500; background: linear-gradient(90deg, var(--nd-ink-40) 0%, var(--nd-ink-40) 35%, #8b5cf6 50%, var(--nd-ink-40) 65%, var(--nd-ink-40) 100%); background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: nd-shimmer 1.4s linear infinite; }
@keyframes nd-shimmer { from { background-position: 100% 0; } to { background-position: -150% 0; } }

.nd-msg__actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.nd-link, .nd-copy { display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 999px; background: var(--nd-soft); border: 1px solid var(--nd-line); font: inherit; font-size: 12.5px; color: var(--nd-ink); text-decoration: none; cursor: pointer; animation: nd-msg-in .35s ease both; transition: background .2s, border-color .2s, transform .2s; }
.nd-link:hover, .nd-copy:hover { background: #fff; border-color: #c1b1f9; transform: translateY(-1px); color: var(--nd-ink); }
.nd-link--mail { background: var(--nd-grad-btn); border-color: transparent; color: #fff; }
.nd-link--mail:hover { color: #fff; background: var(--nd-grad-btn); filter: brightness(1.05); }
.nd-copy { color: var(--nd-ink-60); background: transparent; }

.nd-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.nd-chip { padding: 8px 13px; border-radius: 999px; border: 1px solid var(--nd-line); background: #fff; font: inherit; font-size: 12.5px; color: var(--nd-ink); cursor: pointer; text-align: left; animation: nd-msg-in .35s ease both; transition: border-color .2s, background .2s, color .2s; }
.nd-chip:hover { border-color: #8b5cf6; color: #6d3fe0; background: #faf8ff; }
.nd-chip:first-child { border-color: transparent; background: linear-gradient(#fff, #fff) padding-box, var(--nd-grad) border-box; border: 1.5px solid transparent; }

/* input row */
.nd-panel__form { position: relative; z-index: 1; display: flex; align-items: center; gap: 8px; padding: 12px 12px 6px; }
.nd-panel__form input { flex: 1; min-width: 0; height: 46px; padding: 0 16px; border: 1px solid var(--nd-line); border-radius: 999px; font: inherit; font-size: 14px; color: var(--nd-ink); background: #fff; transition: border-color .2s, box-shadow .2s; }
.nd-panel__form input::placeholder { color: var(--nd-ink-40); }
.nd-panel__form input:focus { outline: none; border-color: #8b5cf6; box-shadow: 0 0 0 4px rgba(139, 92, 246, .14); }
.nd-mic { position: relative; display: grid; place-items: center; flex: none; width: 46px; height: 46px; border: 1px solid var(--nd-line); border-radius: 50%; background: #fff; color: var(--nd-ink); cursor: pointer; transition: border-color .2s, color .2s, transform .2s; }
.nd-mic:hover { border-color: #e248aa; color: #e248aa; transform: scale(1.05); }
.nd-mic.is-unsupported { opacity: .45; }
.nd-send { display: grid; place-items: center; flex: none; width: 54px; height: 46px; border: 0; border-radius: 999px; background: var(--nd-grad-btn); color: #fff; cursor: pointer; box-shadow: 0 10px 22px -12px rgba(226, 72, 170, .8); transition: transform .2s, box-shadow .2s; }
.nd-send:hover { transform: scale(1.05); }
.nd-panel__form.is-ready .nd-send { animation: nd-ready 1.4s ease-in-out infinite; }
@keyframes nd-ready { 0%, 100% { box-shadow: 0 10px 22px -12px rgba(226, 72, 170, .8); } 50% { box-shadow: 0 0 0 6px rgba(226, 72, 170, .16), 0 10px 22px -12px rgba(226, 72, 170, .8); } }
.nd-panel__foot { position: relative; z-index: 1; margin: 0; padding: 0 18px 12px; font-size: 11.5px; color: var(--nd-ink-40); text-align: center; }
.nd-panel__foot a { color: #c2410c; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Voice recording bar ---------- */
.nd-voice { position: relative; z-index: 2; display: flex; align-items: center; gap: 8px; margin: 10px 12px 0; padding: 8px 8px 8px 8px; border-radius: 999px; background: #fff; border: 1.5px solid transparent; background: linear-gradient(#fff, #fff) padding-box, var(--nd-grad) border-box; box-shadow: 0 14px 30px -18px rgba(226, 72, 170, .7); animation: nd-msg-in .3s ease both; }
.nd-voice[hidden] { display: none; }
.is-recording .nd-panel__form { display: none; }
.nd-voice__cancel { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--nd-soft); color: var(--nd-ink-60); cursor: pointer; }
.nd-voice__cancel:hover { color: #dc2626; background: #fef2f2; }
.nd-voice__main { flex: 1; min-width: 0; }
.nd-voice__wave { display: block; width: 100%; height: 26px; }
.nd-voice__text { margin: 2px 0 0; font-size: 12px; line-height: 1.3; color: var(--nd-ink-60); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nd-voice__time { flex: none; font-size: 12px; font-variant-numeric: tabular-nums; color: #e248aa; font-weight: 600; min-width: 32px; text-align: right; }
.nd-voice__time::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: #ef4444; vertical-align: 1px; animation: nd-blink 1s infinite; }
.nd-voice__stop { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border: 1px solid var(--nd-line); border-radius: 50%; background: #fff; cursor: pointer; transition: transform .2s; }
.nd-voice__stop span { width: 13px; height: 13px; border-radius: 3px; background: var(--nd-ink); }
.nd-voice__stop:hover { transform: scale(1.06); }
.nd-voice .nd-send { width: 46px; height: 40px; }

@media (max-width: 480px) {
  .nd-assistant { right: 16px; bottom: 16px; }
  .nd-has-prompt-bar .nd-assistant { bottom: 98px; }
  .nd-panel { position: fixed; left: 12px; right: 12px; bottom: 84px; width: auto; height: min(620px, calc(100vh - 110px)); }
}

@media (prefers-reduced-motion: reduce) {
  .nd-panel__border, .nd-shimmer, .nd-thinking__spark, .nd-caret, .nd-w, .nd-msg, .nd-chip, .nd-link, .nd-orb-btn::before, .nd-voice { animation: none !important; }
  .nd-panel, .nd-orb-btn, .nd-lift, .nd-stage { transition: none; }
}

/* ---------- live chat inside the assistant ---------- */
.nd-live-btn { position: relative; text-decoration: none; }
.nd-live-btn:hover { color: var(--nd-ink, #1a1a1c); border-color: #c1b1f9; }
.nd-live-badge, .nd-orb-btn__badge { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: linear-gradient(135deg, #8b5cf6, #e248aa 70%, #ff9c40); color: #fff; font: 600 10.5px/18px var(--font-inter-tight, sans-serif); text-align: center; box-shadow: 0 0 0 2px #fff; }
.nd-live-badge[hidden], .nd-orb-btn__badge[hidden] { display: none; }
.nd-orb-btn { position: relative; }
.nd-orb-btn__badge { top: -2px; right: -2px; min-width: 22px; height: 22px; line-height: 22px; font-size: 11.5px; animation: nd-live-pop .5s cubic-bezier(.2, .9, .3, 1.4); }
.nd-assistant.has-live .nd-orb-btn { box-shadow: 0 0 0 4px rgba(226, 72, 170, .18), 0 18px 40px -18px rgba(60, 30, 140, .55); }
@keyframes nd-live-pop { from { transform: scale(.3); } }
.nd-live { position: relative; z-index: 2; display: flex; align-items: center; gap: 10px; margin: 10px 14px 0; padding: 10px 12px; border-radius: 16px; background: #fbf9ff; border: 1px solid #e9e0ff; animation: nd-live-in .35s cubic-bezier(.22, 1, .36, 1) both; }
.nd-live[hidden] { display: none; }
@keyframes nd-live-in { from { opacity: 0; transform: translateY(-6px); } }
.nd-live__av { flex: none; width: 34px; height: 34px; border-radius: 50%; overflow: hidden; background: #1a1a1c; }
.nd-live__av img { width: 100%; height: 100%; }
.nd-live__txt { flex: 1; min-width: 0; }
.nd-live__txt strong { display: block; font-size: 13px; font-weight: 600; color: #1a1a1c; }
.nd-live__txt span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; color: rgba(26, 26, 28, .65); }
.nd-live__open { flex: none; padding: 7px 12px; border-radius: 999px; background: #1a1a1c; color: #fff !important; font-size: 12.5px; font-weight: 500; text-decoration: none; }

/* ---------- draggable assistant ---------- */
.nd-orb-btn { cursor: grab; user-select: none; -webkit-user-select: none; }
.nd-assistant.is-dragging .nd-orb-btn { cursor: grabbing; transform: scale(1.06); box-shadow: 0 26px 50px -18px rgba(134, 79, 254, .7); }
.nd-assistant.is-dragging .nd-orb-btn::before { animation: none; }
.nd-assistant--left .nd-panel { right: auto; left: 0; transform-origin: bottom left; }
.nd-assistant--down .nd-panel { bottom: auto; top: calc(100% + 14px); transform-origin: top right; }
.nd-assistant--left.nd-assistant--down .nd-panel { transform-origin: top left; }
.nd-assistant.is-tucked { opacity: 0; pointer-events: none; transform: translateY(24px); transition: opacity .25s, transform .3s; }
.nd-assistant { transition: opacity .25s, transform .3s; }
