/* Shared UI enhancements: animated terminal, copy buttons, count-up, typed code.
   Relies on the page's existing CSS vars (--surface, --accent, --green, etc.). */

/* ── Animated terminal ── */
.ax-terminal {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 48px rgba(0,0,0,.4), 0 0 0 1px rgba(255,255,255,.03);
  max-width: 560px;
}
.ax-term-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 11px 16px; background: var(--surface2);
  border-bottom: 1px solid var(--border);
}
.ax-dot { width: 10px; height: 10px; border-radius: 50%; }
.ax-dot.r { background: #ff5f57; } .ax-dot.y { background: #ffbd2e; } .ax-dot.g { background: #28c840; }
.ax-term-label { margin-left: 8px; font-size: 12px; color: var(--muted); font-family: "SF Mono","Fira Code",Consolas,monospace; }
.ax-term-body {
  padding: 20px 24px 24px;
  font-family: "SF Mono","Fira Code",Consolas,monospace;
  font-size: 13px; line-height: 1.75; min-height: 240px;
}
.ax-line { display: flex; gap: 8px; }
.ax-prompt { color: var(--accent); flex-shrink: 0; }
.ax-cmd { color: var(--text); }
.ax-out { color: var(--muted2); }
.ax-green { color: var(--green); }
.ax-dim { color: var(--muted); }
.ax-cursor {
  display: inline-block; width: 8px; height: 14px;
  background: var(--accent); vertical-align: middle;
  animation: ax-blink 1s step-end infinite; margin-left: 1px;
}
@keyframes ax-blink { 0%,100%{opacity:1} 50%{opacity:0} }

/* ── Copy button on code blocks ── */
.ax-code-wrap { position: relative; }
.ax-copy-btn {
  position: absolute; top: 8px; right: 8px;
  padding: 4px 10px; border-radius: 5px;
  font-size: 11px; font-weight: 600; font-family: inherit;
  background: var(--surface2); color: var(--muted2);
  border: 1px solid var(--border2); cursor: pointer;
  opacity: 0; transition: opacity .15s, color .15s, background .15s;
}
.ax-code-wrap:hover .ax-copy-btn { opacity: 1; }
.ax-copy-btn:hover { color: var(--text); background: var(--border2); }
.ax-copy-btn.copied { color: var(--green); border-color: var(--green); opacity: 1; }

/* ── Typed code blocks keep height stable while typing ── */
.ax-code-wrap [data-type] { white-space: pre; }
