/* ─────────────────────────────────────────────────────────
   demo screen frame + animation keyframes for self-contained demos
   ───────────────────────────────────────────────────────── */
.demo-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  min-height: 420px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: var(--surface);
  border: 1px solid var(--border);
}

.demo-screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
}
.demo-screen-bar {
  height: 32px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.demo-screen-bar .dots {
  display: flex;
  gap: 5px;
}
.demo-screen-bar .dots span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: oklch(0.85 0.005 260);
}
[data-theme="dark"] .demo-screen-bar .dots span { background: oklch(0.4 0.012 260); }
.demo-screen-bar .addr {
  flex: 1;
  height: 20px;
  border-radius: 5px;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
}
.demo-screen-bar .addr::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 1.5px;
  background: var(--accent);
  margin-right: 6px;
}
.demo-screen-body {
  flex: 1;
  min-height: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  overflow: hidden;
}

/* ─── shared keyframes used inline by demos.jsx ─── */
@keyframes kc-pulse {
  0% { box-shadow: 0 0 0 0 oklch(from var(--accent) l c h / 0.5); }
  70% { box-shadow: 0 0 0 8px oklch(from var(--accent) l c h / 0); }
  100% { box-shadow: 0 0 0 0 oklch(from var(--accent) l c h / 0); }
}

@keyframes av-pulse {
  0%, 100% { box-shadow: 0 0 0 0 oklch(from var(--accent) l c h / 0.4); }
  50% { box-shadow: 0 0 0 6px oklch(from var(--accent) l c h / 0); }
}

@keyframes av-spin {
  to { transform: rotate(360deg); }
}

@keyframes av-in {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: none; }
}

@keyframes msg-in {
  from { opacity: 0; transform: translateY(8px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* typing indicator dots */
.td {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  animation: td-bounce 1s ease-in-out infinite;
  display: inline-block;
}
@keyframes td-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-3px); opacity: 1; }
}

/* typing caret in chat */
.caret {
  display: inline-block;
  width: 1px;
  margin-left: 1px;
  background: var(--accent);
  color: transparent;
  animation: caret-blink 0.8s steps(2) infinite;
}
@keyframes caret-blink {
  50% { opacity: 0; }
}

/* helper bg tokens used inline */
:root {
  --accent-bg: oklch(from var(--accent) l c h / 0.12);
  --amber-ink: oklch(0.45 0.15 75);
  --amber-bg: oklch(from var(--amber) l c h / 0.18);
  --violet-bg: oklch(from var(--violet) l c h / 0.15);
}
[data-theme="dark"] {
  --accent-bg: oklch(from var(--accent) l c h / 0.18);
  --amber-bg: oklch(from var(--amber) l c h / 0.22);
  --violet-bg: oklch(from var(--violet) l c h / 0.22);
  --amber-ink: oklch(0.78 0.13 75);
}
