/* Attaché landing — Claude Code demo showcase.
 * A reusable, self-mounting component that replays scripted vignettes inside a
 * simulated Claude Code terminal. Palette mirrors Anthropic's Claude Code TUI
 * (warm charcoal screen, ivory text, coral accent) so it reads as authentic
 * while harmonizing with the Attaché landing brand. */

.cc-demo {
  --cc-bg: #262624;
  --cc-bg-soft: #2f2e2b;
  --cc-screen: #1f1e1c;
  --cc-border: #46443f;
  --cc-border-soft: #38363250;
  --cc-text: #ece9df;
  --cc-dim: #a5a196;
  --cc-faint: #6f6c62;
  --cc-coral: #d97757;
  --cc-coral-soft: rgba(217, 119, 87, 0.14);
  --cc-green: #7fb37a;
  --cc-blue: #6fa8dc;
  --cc-violet: #b09ae0;
  --cc-amber: #d9a441;
  --cc-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  display: block;
}

/* ── Layout: scenario chips above, full-width terminal below ── */

.cc-layout {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ── Scenario labels (above the terminal) ───────────────────── */

.cc-scenarios {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cc-chapters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cc-chapter {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-align: left;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-panel);
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.cc-chapter:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.cc-chapter.active {
  border-color: rgba(255, 79, 0, 0.42);
  box-shadow: 0 12px 30px -18px rgba(255, 79, 0, 0.5);
  background: linear-gradient(150deg, var(--accent-soft), transparent 70%), var(--bg-panel);
}

.cc-chapter-idx {
  flex: none;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.cc-chapter.active .cc-chapter-idx {
  color: #fffefb;
  background: linear-gradient(150deg, var(--accent), var(--accent-2));
  border-color: transparent;
}

.cc-chapter-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

/* one-line blurb for the active scenario */
.cc-caption {
  min-height: 1.5em;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-dim);
}

/* thin progress bar that fills while a chapter plays */
.cc-chapter-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.2s linear;
}

/* ── Terminal frame ─────────────────────────────────────────────── */

.cc-frame {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--cc-border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--cc-bg);
  box-shadow:
    0 30px 60px -28px rgba(20, 12, 10, 0.55),
    0 10px 24px -14px rgba(20, 12, 10, 0.4);
}

.cc-titlebar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--cc-bg-soft);
  border-bottom: 1px solid var(--cc-border);
}

.cc-dots {
  display: inline-flex;
  gap: 6px;
  flex: none;
}

.cc-dots i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #4a4842;
}

.cc-dots i:nth-child(1) { background: #ff5f57; }
.cc-dots i:nth-child(2) { background: #febc2e; }
.cc-dots i:nth-child(3) { background: #28c840; }

.cc-title {
  font-family: var(--cc-mono);
  font-size: 12px;
  color: var(--cc-dim);
  margin: 0 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cc-title .cc-star { color: var(--cc-coral); }

.cc-autopilot {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--cc-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--cc-coral);
  padding: 3px 9px;
  border: 1px solid rgba(217, 119, 87, 0.4);
  border-radius: 999px;
  background: var(--cc-coral-soft);
}

.cc-autopilot::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cc-coral);
  box-shadow: 0 0 0 0 rgba(217, 119, 87, 0.5);
  animation: cc-live 2s ease-in-out infinite;
}

.cc-demo[data-paused="true"] .cc-autopilot { color: var(--cc-faint); border-color: var(--cc-border); background: transparent; }
.cc-demo[data-paused="true"] .cc-autopilot::before { background: var(--cc-faint); animation: none; }

@keyframes cc-live {
  0%, 100% { box-shadow: 0 0 0 0 rgba(217, 119, 87, 0.45); }
  50% { box-shadow: 0 0 0 5px rgba(217, 119, 87, 0); }
}

/* ── Screen / transcript ────────────────────────────────────────── */

.cc-screen {
  position: relative;
  height: 440px;
  overflow-y: auto;
  background: var(--cc-screen);
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: #4a4842 transparent;
}

.cc-screen::-webkit-scrollbar { width: 9px; }
.cc-screen::-webkit-scrollbar-thumb { background: #413f3a; border-radius: 6px; border: 2px solid var(--cc-screen); }

.cc-body {
  padding: 18px 20px 8px;
  font-family: var(--cc-mono);
  font-size: 13px;
  line-height: 1.65;
  color: var(--cc-text);
}

.cc-line {
  white-space: pre-wrap;
  word-break: break-word;
  animation: cc-in 0.28s ease both;
}

@keyframes cc-in {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: none; }
}

.cc-spacer { height: 0.7em; }

/* shell command line */
.cc-shell .cc-prompt { color: var(--cc-coral); user-select: none; }
.cc-shell { color: #dfe7df; }

/* welcome box (mimics the Claude Code TUI banner) */
.cc-welcome {
  border: 1px solid var(--cc-border);
  border-radius: 8px;
  padding: 12px 15px;
  margin: 2px 0 6px;
  background: linear-gradient(180deg, rgba(217, 119, 87, 0.05), transparent);
}

.cc-welcome-title { color: var(--cc-text); font-weight: 500; }
.cc-welcome-title .cc-star { color: var(--cc-coral); margin-right: 6px; }
.cc-welcome-row { color: var(--cc-dim); }
.cc-welcome-row .cc-key { color: var(--cc-faint); }
.cc-welcome-row code { color: var(--cc-blue); font-family: inherit; font-size: inherit; }

/* user message (submitted prompt) */
.cc-user { color: var(--cc-text); }
.cc-user .cc-gt { color: var(--cc-dim); user-select: none; margin-right: 4px; }

/* assistant text */
.cc-say { color: var(--cc-text); display: flex; gap: 8px; }
.cc-say .cc-bullet { color: var(--cc-coral); flex: none; }
.cc-say .cc-say-text { min-width: 0; }

/* tool call */
.cc-tool { color: var(--cc-text); display: flex; gap: 8px; }
.cc-tool .cc-bullet { color: var(--cc-coral); flex: none; }
.cc-tool .cc-tool-name { color: var(--cc-text); font-weight: 500; }
.cc-tool .cc-tool-args { color: var(--cc-dim); }

/* continuation / result line */
.cc-out { color: var(--cc-dim); }
.cc-out .cc-elbow { color: var(--cc-faint); user-select: none; margin-right: 4px; }

/* Attaché intervention annotation */
.cc-att { display: flex; gap: 4px; align-items: baseline; }
.cc-att .cc-elbow { color: var(--cc-faint); user-select: none; flex: none; }
.cc-att-tag {
  flex: none;
  font-size: 10.5px;
  letter-spacing: 0.02em;
  color: var(--accent-2);
  background: rgba(255, 79, 0, 0.13);
  border: 1px solid rgba(255, 79, 0, 0.32);
  border-radius: 5px;
  padding: 0 6px;
  margin-right: 3px;
}
.cc-att-text { color: #f0c9ad; }

/* success line */
.cc-ok { color: var(--cc-green); }
.cc-ok .cc-check { margin-right: 6px; }

/* thinking spinner */
.cc-think { color: var(--cc-coral); display: flex; gap: 8px; align-items: center; }
.cc-think .cc-spin { display: inline-block; width: 1ch; color: var(--cc-coral); }
.cc-think .cc-think-meta { color: var(--cc-faint); }

/* metric chip */
.cc-metric {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--cc-green);
  background: rgba(127, 179, 122, 0.12);
  border: 1px solid rgba(127, 179, 122, 0.3);
  border-radius: 6px;
  padding: 3px 10px;
}
.cc-metric::before { content: "↓"; color: var(--cc-green); font-weight: 600; }

/* blinking caret used while typing */
.cc-caret {
  display: inline-block;
  width: 8px;
  height: 1.05em;
  margin-left: 1px;
  vertical-align: text-bottom;
  background: var(--cc-coral);
  animation: cc-blink 1.05s steps(1) infinite;
}

@keyframes cc-blink {
  0%, 55% { opacity: 1; }
  56%, 100% { opacity: 0; }
}

/* ── Input box (bottom, Claude Code style) ──────────────────────── */

.cc-inputwrap {
  padding: 10px 14px 6px;
  border-top: 1px solid var(--cc-border);
  background: var(--cc-bg);
}

.cc-inputbox {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  border: 1px solid var(--cc-border);
  border-radius: 9px;
  background: var(--cc-screen);
  font-family: var(--cc-mono);
  font-size: 13px;
  color: var(--cc-text);
  min-height: 40px;
  transition: border-color 0.2s ease;
}

.cc-demo[data-typing="true"] .cc-inputbox { border-color: rgba(217, 119, 87, 0.5); }

.cc-inputbox .cc-gt { color: var(--cc-coral); flex: none; }
.cc-input-text { min-width: 0; word-break: break-word; }
.cc-input-placeholder { color: var(--cc-faint); }

.cc-statusline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 4px 2px;
  font-family: var(--cc-mono);
  font-size: 11px;
  color: var(--cc-faint);
}

.cc-status-hint { display: inline-flex; gap: 6px; align-items: center; }
.cc-status-mode { color: var(--cc-dim); }

/* ── Controls ───────────────────────────────────────────────────── */

.cc-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cc-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-family: var(--cc-mono);
  font-size: 11px;
  color: var(--cc-dim);
  background: transparent;
  border: 1px solid var(--cc-border);
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.cc-btn:hover { color: var(--cc-text); border-color: #5c5a52; }
.cc-btn svg { width: 12px; height: 12px; }

/* ── Reduced motion ─────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .cc-line { animation: none; }
  .cc-caret { animation: none; }
  .cc-autopilot::before { animation: none; }
  .cc-screen { scroll-behavior: auto; }
}

/* ── Responsive ─────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .cc-layout { gap: 14px; }
  .cc-screen { height: 400px; }
}

@media (max-width: 560px) {
  .cc-body { font-size: 12px; }
  .cc-inputbox { font-size: 12px; }
  .cc-title { display: none; }
  .cc-chapters {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  .cc-chapters::-webkit-scrollbar { display: none; }
  .cc-chapter { flex: 0 0 auto; }
}
