/* ---------- terminal window ---------- */
.terminal {
  width: 100%;
  max-width: var(--maxw);
  height: min(86dvh, 820px);
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--panel) 0%, var(--bg-2) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 40px 90px -30px rgba(0, 0, 0, 0.7),
    0 10px 30px -15px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.titlebar {
  flex: 0 0 auto;
  height: 46px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 14px;
  background: rgba(0, 0, 0, 0.22);
  border-bottom: 1px solid var(--line);
}

.lights { display: flex; gap: 8px; }
.light {
  width: 12px; height: 12px; border-radius: 50%;
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.35) inset;
}
.light-r { background: #e0664f; }
.light-y { background: #e0b04f; }
.light-g { background: #57a05b; }

.titlebar-name {
  flex: 1;
  text-align: center;
  font-size: 12.5px;
  letter-spacing: 0.02em;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.titlebar-links { flex: 0 0 auto; display: flex; gap: 7px; }
.titlebar-links a {
  font-size: 12px;
  color: var(--text-dim);
  text-decoration: none;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  white-space: nowrap;
  transition: color .18s ease, border-color .18s ease, background .18s ease;
}
.titlebar-links a:hover { color: var(--accent-bri); border-color: var(--accent-line); background: var(--accent-soft); }

/* ---------- screen ---------- */
.screen {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: clamp(16px, 2.4vw, 28px);
  font-size: 14px;
  line-height: 1.62;
  scroll-behavior: smooth;
  outline: none;
}
.screen::-webkit-scrollbar { width: 10px; }
.screen::-webkit-scrollbar-track { background: transparent; }
.screen::-webkit-scrollbar-thumb { background: rgba(236,233,224,0.12); border-radius: 8px; border: 3px solid transparent; background-clip: padding-box; }
.screen::-webkit-scrollbar-thumb:hover { background: rgba(236,233,224,0.22); background-clip: padding-box; border: 3px solid transparent; }

/* spacing between exchanges */
.entry { margin-bottom: 22px; }
.entry:last-child { margin-bottom: 6px; }

/* user prompt line */
.cmd-line {
  display: flex;
  gap: 10px;
  align-items: baseline;
  color: var(--text);
  margin-bottom: 10px;
}
.cmd-line .caret { color: var(--accent); flex: 0 0 auto; }
.cmd-line .cmd { color: var(--text); word-break: break-word; }
.cmd-line .cmd .cursor {
  display: inline-block; width: 8px; height: 1.05em;
  background: var(--accent); margin-left: 2px; transform: translateY(2px);
  animation: blink 1.05s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* assistant block */
.resp { padding-left: 2px; }
.resp .sigil { color: var(--accent); margin-right: 8px; }
/* the ✻ marker shows at once; the body is typed out word by word */
.resp .reveal { opacity: 1; }
.resp .reveal > .sigil { display: inline-block; opacity: 0; animation: rise .4s cubic-bezier(0.22,1,0.36,1) both; }
.resp .reveal .w { opacity: 0; animation: wfade .13s ease forwards; }
.resp .reveal .tok-media { opacity: 0; animation: wfade .5s cubic-bezier(0.22,1,0.36,1) forwards; }
@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes wfade { to { opacity: 1; } }

/* thinking indicator */
.thinking { display: flex; align-items: center; gap: 9px; color: var(--text-faint); }
.thinking .sigil { color: var(--accent); }
.thinking .dots span {
  display: inline-block; width: 5px; height: 5px; margin-right: 3px; border-radius: 50%;
  background: var(--text-faint); animation: pulse 1.1s ease-in-out infinite;
}
.thinking .dots span:nth-child(2) { animation-delay: .18s; }
.thinking .dots span:nth-child(3) { animation-delay: .36s; }
@keyframes pulse { 0%, 100% { opacity: .25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }

/* generic text blocks */
.tline { color: var(--text-dim); }
.tline strong { color: var(--text); font-weight: 600; }
.lead { color: var(--text); }
.muted { color: var(--text-faint); }
.accent { color: var(--accent-bri); }
.spacer { height: 9px; }

a.link, .resp a {
  color: var(--accent-bri);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-line);
  transition: color .15s ease, border-color .15s ease;
}
a.link:hover, .resp a:hover { color: var(--text); border-color: var(--text); }

/* section heading inside a response */
.rhead {
  color: var(--text-faint);
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin: 4px 0 10px;
}

/* faux shell prompt lines on boot */
.shell { color: var(--text-dim); margin-bottom: 4px; }
.shell .sp { color: var(--accent); margin-right: 8px; }
.shell .sdir { color: var(--text-faint); margin-right: 8px; }
.shell .scmd { color: var(--text); }
.shell .cursor {
  display: inline-block; width: 8px; height: 1.05em; background: var(--accent);
  margin-left: 2px; transform: translateY(2px); animation: blink 1.05s steps(1) infinite;
}

/* welcome banner, Claude Code style box */
.banner {
  border: 1px solid var(--accent-line);
  background: linear-gradient(180deg, var(--accent-soft), transparent);
  border-radius: 10px;
  padding: 15px 17px;
  margin: 8px 0 22px;
  opacity: 0; transform: translateY(8px);
  animation: rise .55s cubic-bezier(0.22,1,0.36,1) forwards;
  animation-delay: .12s;
}

/* ASCII wordmark on boot — Claude-style drawn intro */
.ascii {
  margin: 2px 0 16px;
  font-size: clamp(6px, 1.55vw, 12px);
  line-height: 1.04;
  font-weight: 700;
  white-space: pre;
  overflow-x: auto;
  background: linear-gradient(100deg, var(--accent) 0%, var(--accent-bri) 52%, #e8b9a3 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  opacity: 0; transform: translateY(8px);
  animation: rise .55s cubic-bezier(0.22,1,0.36,1) forwards;
}
.banner .b-title { color: var(--text); font-size: 15px; }
.banner .b-title .sigil { color: var(--accent); margin-right: 8px; }
.banner .b-sub { color: var(--text-dim); margin-top: 7px; font-size: 13px; line-height: 1.7; }
.banner .b-sub code { color: var(--accent-bri); background: rgba(217,119,87,0.10); padding: 1px 6px; border-radius: 5px; }
.banner .b-cwd { color: var(--text-faint); }

/* Кнопка hire в titlebar — акцентная, чтобы выделялась среди ссылок. */
.titlebar-links a.hire-btn {
  color: var(--accent-bri);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}
.titlebar-links a.hire-btn:hover { filter: brightness(1.15); }
