/* Demo page — extends ../style.css with demo-specific components */

.demo-main {
  max-width: 1040px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

.demo-main header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--rule);
}

.demo-main header h1 {
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 0.35rem;
}

.demo-main .tagline {
  font-size: 1.05rem;
  color: var(--muted);
  margin: 0;
}

.disclaimer {
  font-size: 0.9rem;
  color: var(--muted);
  background: rgba(26, 74, 138, 0.04);
  border-left: 3px solid var(--accent);
  padding: 0.75rem 1rem;
  border-radius: 0 4px 4px 0;
  margin: 1.5rem 0 2rem;
}

@media (prefers-color-scheme: dark) {
  .disclaimer { background: rgba(123, 169, 224, 0.06); }
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* Two-column shell */
.demo-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 1fr);
  gap: 1.5rem;
  margin: 1.5rem 0 3rem;
}

@media (max-width: 760px) {
  .demo-shell { grid-template-columns: 1fr; }
}

/* Chat column */
.demo-chat {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 420px;
}

.conversation {
  flex: 1;
  min-height: 280px;
  background: var(--code-bg);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 1rem;
  overflow-y: auto;
  font-size: 0.95rem;
  line-height: 1.55;
}

.conversation .turn {
  margin: 0 0 1.25rem;
  padding: 0 0 1rem;
  border-bottom: 1px dashed var(--rule);
}
.conversation .turn:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.conversation .turn .role {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
  font-weight: 600;
}

.conversation .turn.user .role { color: var(--accent); }
.conversation .turn .body { white-space: pre-wrap; word-wrap: break-word; }

.conversation .empty {
  color: var(--muted);
  font-style: italic;
  padding: 2rem 0;
  text-align: center;
}

/* Input form */
.chat-form {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.chat-form textarea {
  font: inherit;
  font-size: 0.95rem;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0.65rem 0.75rem;
  resize: vertical;
  min-height: 72px;
}

.chat-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(26, 74, 138, 0.15);
}

.chat-controls {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.chat-controls button {
  font: inherit;
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  border: 1px solid var(--accent);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

#send-btn {
  background: var(--accent);
  color: white;
}
#send-btn:hover { background: #1a4a8ade; }
#send-btn:disabled { opacity: 0.5; cursor: not-allowed; }

#fire-routine-btn {
  background: transparent;
  color: var(--accent);
}
#fire-routine-btn:hover {
  background: var(--accent);
  color: white;
}
#fire-routine-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Thought stream */
.thought-stream {
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 1rem 1.1rem 1.25rem;
  font-size: 0.88rem;
}

.thought-stream h2 {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin: 0 0 0.35rem;
  color: var(--muted);
}

.ts-explainer {
  color: var(--muted);
  font-size: 0.82rem;
  margin: 0 0 1rem;
}

.stream-log {
  list-style: none;
  padding: 0;
  margin: 0;
}

.stream-log li {
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--rule);
  margin: 0;
}
.stream-log li:last-child { border-bottom: none; }

.stream-log .layer {
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.stream-log .layer-membrane { color: #b45309; }
.stream-log .layer-memory { color: #0e7490; }
.stream-log .layer-attention { color: #6d28d9; }
.stream-log .layer-response { color: var(--accent); }
.stream-log .layer-error { color: #b91c1c; }

@media (prefers-color-scheme: dark) {
  .stream-log .layer-membrane { color: #fbbf24; }
  .stream-log .layer-memory { color: #22d3ee; }
  .stream-log .layer-attention { color: #a78bfa; }
  .stream-log .layer-error { color: #fca5a5; }
}

.stream-log .detail {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.45;
}

.stream-log .empty {
  color: var(--muted);
  font-style: italic;
  font-size: 0.85rem;
}

.demo-architecture {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
}

.demo-architecture h2 {
  margin-top: 0;
}
