:root {
  /* paper-black + creamy ink + single ochre */
  --bg:        #100E0B;
  --bg-soft:   #161310;
  --line:      rgba(237, 231, 219, 0.08);
  --line-strong: rgba(237, 231, 219, 0.16);

  /* ink scale — single hue, opacity steps */
  --ink:        #EDE7DB;
  --ink-strong: rgba(237, 231, 219, 1.00);  /* answers */
  --ink:        rgba(237, 231, 219, 0.92);  /* questions / live input */
  --ink-soft:   rgba(237, 231, 219, 0.62);  /* system voice */
  --ink-quiet:  rgba(237, 231, 219, 0.38);  /* meta, kbd, hints */
  --ink-faint:  rgba(237, 231, 219, 0.22);  /* dividers, prompts off-state */

  /* legacy aliases used throughout the codebase — remapped to the ink scale
     so the redesign doesn't require renaming every selector */
  --text:       var(--ink-strong);
  --text-dim:   var(--ink-soft);
  --text-faint: var(--ink-quiet);
  --text-quiet: var(--ink-faint);

  /* one accent — ochre. used ONLY for the cursor + active state. */
  --accent:    oklch(0.78 0.115 72);
  --accent-soft: oklch(0.78 0.115 72 / 0.14);
  --accent-line: oklch(0.78 0.115 72 / 0.40);

  /* git palette — used ONLY in boot sequence + git/shell command output.
     terminal-green for success, cyan for paths/branches, soft red for diff-removals. */
  --git-green: #8FB573;
  --git-cyan:  #6FAFB5;
  --git-amber: #C9A66B;
  --git-dim:   rgba(237, 231, 219, 0.50);

  --sys:       var(--ink-soft);
  --sys-dim:   var(--ink-quiet);
  --green:     var(--git-green);

  --font-mono:  "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --font-read:  "Source Serif 4", "Newsreader", "Iowan Old Style", Charter, Georgia, serif;

  /* baseline sizes — bumped for iTerm-comfortable reading */
  --sz-mono:   16px;     /* system voice: prompt, commands, git, labels */
  --sz-read:   18px;     /* Ash's voice: answers, asides, follow-ups */
  --sz-meta:   13px;     /* tiny mono: kbd, hints, captions, header chip */
  --lh-mono:   1.55;
  --lh-read:   1.6;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: var(--sz-mono);
  line-height: var(--lh-mono);
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "calt" 1, "ss01" 1;
}

#root, .term {
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* ─── status bar removed in cleanup pass ──────────────────── */

/* ─── header (slim, real-terminal-style) ──────────────────── */
.term-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 18px;
  border-bottom: 1px solid var(--line);
  font-size: var(--sz-meta);
  letter-spacing: 0.02em;
  color: var(--text-dim);
  background: rgba(12,12,12,0.8);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  flex-shrink: 0;
  transition: opacity 600ms ease 80ms,
              border-color 600ms ease 80ms,
              padding 600ms ease 80ms,
              max-height 600ms ease 80ms;
  overflow: hidden;
  max-height: 40px;
}
.term-header.th-empty {
  opacity: 0;
  border-bottom-color: transparent;
  pointer-events: none;
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
}
.th-left, .th-right { display: inline-flex; align-items: center; gap: 8px; }
.th-mid { color: var(--text-faint); }
.th-dim { color: var(--text-faint); }
.th-name { color: var(--text); }
.th-sep { color: var(--text-faint); }
.th-role { color: var(--text-dim); }

/* progressive identity — header label hides during welcome,
   fades in once the user has submitted their first message */
.th-fade {
  opacity: 1;
  transition: opacity 600ms ease 80ms;
}
.term-header.th-empty .th-fade {
  opacity: 0;
  pointer-events: none;
}
.th-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--git-green);
  box-shadow: 0 0 6px var(--git-green);
}
@media (max-width: 640px) {
  .th-mid { display: none; }
  .term-header { padding: 8px 12px; font-size: 10px; }
}

/* ─── body — split when preview is open ────────────────────── */
.term-body {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr;
  min-height: 0;
}
.term.has-preview .term-body {
  grid-template-columns: 1fr 360px;
}

.scroller {
  overflow-y: auto;
  padding: 28px 32px 28px 32px;
  scroll-behavior: smooth;
}
.scroller::-webkit-scrollbar { width: 8px; }
.scroller::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 4px; }
.scroller::-webkit-scrollbar-track { background: transparent; }

/* ─── boot sequence ────────────────────────────────────────── */
.boot {
  margin-bottom: 28px;
}
.boot-line {
  white-space: pre-wrap;
  word-break: break-word;
  letter-spacing: 0.005em;
  color: var(--git-dim);
  opacity: 0;
  animation: line-in 0.18s ease forwards;
  font-size: var(--sz-mono);
}
.boot-cmd    { color: var(--ink-strong); }
.boot-cmd .boot-prompt { color: var(--git-green); }
.boot-sys    { color: var(--git-dim); }
/* light-up specific tokens inside boot lines if we ever add spans;
   for now: rely on whole-line color + the green prompt glyph. */
.boot-blank  { line-height: 0.4; }

/* git token coloring \u2014 used by App() to colorize boot lines */
.tok-git-verb   { color: var(--git-cyan); }
.tok-git-prefix { color: var(--git-cyan); }
.tok-git-pct    { color: var(--git-amber); }
.tok-git-done   { color: var(--git-green); }
.boot-cursor {
  display: inline-block;
  width: 7px;
  height: 1em;
  background: var(--text);
  vertical-align: text-bottom;
  margin-left: 1px;
  animation: blink 1.05s steps(2, start) infinite;
}

/* ─── intro (post-boot greeting) ───────────────────────────── */
/* ─── intro card (minimal: mark + identity) ──────────────── */
.intro-card {
  display: flex;
  align-items: center;
  gap: 36px;
  padding: 0;
  margin-bottom: 56px;
  max-width: 760px;
  animation: fade-in 0.5s ease 0.1s both;
}
.ic-mark {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 80px;
}
.ic-mark {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.05;
  color: var(--ink-strong);
  white-space: pre;
  letter-spacing: 0;
  flex-shrink: 0;
  font-weight: 500;
  background: rgba(237, 231, 219, 0.04);
  border: 1px solid rgba(237, 231, 219, 0.06);
  border-radius: 6px;
  padding: 14px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ic-glasses {
  margin: 0;
  font: inherit;
  color: inherit;
  letter-spacing: 0.04em;
}
.ic-eye {
  display: inline-block;
  color: var(--accent);
  transform-origin: center;
  animation: ic-blink 3s ease-in-out infinite;
}
.ic-eye:nth-of-type(2) { animation-delay: 0.04s; }

@keyframes ic-blink {
  0%, 88%, 100% { transform: scaleY(1); opacity: 1; }
  92%           { transform: scaleY(0.1); opacity: 0.7; }
  96%           { transform: scaleY(1); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .ic-eye { animation: none; }
}
.ic-id {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ic-id-title {
  font-family: var(--font-mono);
  font-size: var(--sz-mono);
  color: var(--ink-strong);
  font-weight: 600;
  margin-bottom: 4px;
  letter-spacing: 0.005em;
}
.ic-id-line {
  font-family: var(--font-mono);
  font-size: var(--sz-mono);
  color: var(--ink);
  line-height: 1.55;
}
.ic-id-dim { color: var(--ink-soft); }

@media (max-width: 640px) {
  .intro-card { flex-direction: column; align-items: flex-start; gap: 16px; }
}
  margin-bottom: 56px;
  animation: fade-in 0.5s ease 0.1s both;
  max-width: 56ch;
}
.intro-line {
  font-family: var(--font-mono);
  font-size: var(--sz-mono);
  line-height: var(--lh-mono);
  letter-spacing: 0.005em;
  color: var(--ink-strong);
  font-weight: 400;
}
.intro-line + .intro-line { margin-top: 14px; }
.intro-line:last-child {
  font-family: var(--font-mono);
  font-size: var(--sz-meta);
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  margin-top: 28px;
  text-transform: lowercase;
}

/* ─── bottom spacer (lets last block / intro sit at top of viewport) */
.bottom-spacer {
  height: 95vh;
}

@keyframes line-in {
  from { opacity: 0; transform: translateY(2px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ─── prompt ───────────────────────────────────────────────── */
.prompt-row, .block-cmd-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0;
}
.prompt {
  white-space: pre;
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: var(--sz-mono);
  letter-spacing: 0.01em;
}
/* terminal-flavored prompt parts — system identity stays colorful */
.prompt-user  { color: var(--git-green); }
.prompt-at    { color: var(--ink-faint); }
.prompt-host  { color: var(--git-cyan); }
.prompt-sigil { color: var(--ink-quiet); }

/* the part the user "owns" — ask-me + their typed question — reads white & medium */
.prompt-path {
  color: var(--ink-strong);
  font-weight: 500;
}

.prompt-input-row {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
}
.prompt-input {
  font-family: var(--font-mono);
  font-size: var(--sz-mono);
  color: var(--ink-strong);
  font-weight: 500;
  white-space: pre-wrap;
  word-break: break-word;
  flex: 1;
  min-width: 0;
}
.block-cmd {
  font-family: var(--font-mono);
  font-size: var(--sz-mono);
  color: var(--ink-strong);
  white-space: pre-wrap;
  word-break: break-word;
}

/* ─── cursor ───────────────────────────────────────────────── */
/* the cursor is the only ochre on the page — the heartbeat. */
.cursor-block {
  display: inline-block;
  width: 8px;
  height: 1.1em;
  background: var(--accent);
  vertical-align: text-bottom;
  margin-left: 2px;
  animation: blink 1.05s steps(2, start) infinite;
  border-radius: 1px;
}
@keyframes blink {
  0%, 50%   { opacity: 1; }
  50.01%, 100% { opacity: 0; }
}

.cursor-pulse {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: 0.05em;
  margin-left: 4px;
  animation: pulse-soft 1.4s ease-in-out infinite;
}
@keyframes pulse-soft {
  0%, 100% { opacity: 0.25; transform: scale(0.85); }
  50%      { opacity: 1;    transform: scale(1.0); }
}

/* ─── thinking line ────────────────────────────────────────── */
.thinking {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  color: var(--text-faint);
  font-size: 12px;
  animation: fade-in 0.2s ease;
}
.th-glyph .spinner { color: var(--accent); }
.th-text {
  position: relative;
}
.th-text::after {
  content: "";
  display: inline-block;
  width: 1em;
  text-align: left;
  animation: dots 1.2s steps(4) infinite;
}
@keyframes dots {
  0%   { content: ""; }
  25%  { content: "."; }
  50%  { content: ".."; }
  75%  { content: "..."; }
  100% { content: ""; }
}

/* ─── command blocks ───────────────────────────────────────── */
.block {
  margin-bottom: 56px;
}
.block-cmd-row { margin-bottom: 14px; opacity: 0.55; }
.block-out {
  animation: line-in 0.2s ease;
}

/* ─── output line variants ─────────────────────────────────── */
.out {
  white-space: pre-wrap;
  word-break: break-word;
  letter-spacing: 0.005em;
}
.out-raw     { color: var(--ink-strong); }
.out-pending { color: var(--ink-soft); margin-top: 10px; font-size: var(--sz-mono); font-weight: 500; line-height: 1.45; letter-spacing: -0.005em; padding: 4px 0; }
.out-blank   { height: 0.8em; }
.out-h       { color: var(--ink-strong); margin: 6px 0; font-weight: 500; letter-spacing: 0.02em; text-transform: uppercase; font-size: 11px; }
.out-h2      { color: var(--ink); margin: 8px 0 2px; }
.out-li      { color: var(--ink-strong); }
.out-p       { color: var(--ink-strong); margin-bottom: 6px; max-width: 64ch; }

/* Ash's voice — uniform color across all line kinds */
.out-answer,
.out-example,
.out-aside {
  font-family: var(--font-mono);
  font-size: var(--sz-mono);
  line-height: 1.55;
  letter-spacing: 0.005em;
  color: var(--ink-strong);
  max-width: min(68ch, 100%);
  word-wrap: break-word;
  overflow-wrap: break-word;
  font-weight: 500;
}
.out-answer  { margin-top: 6px; }
.out-example { margin-top: 16px; font-weight: 500; }
.out-aside   { margin-top: 16px; font-weight: 500; }

/* drop the heavy ❯ glyph — handled in JSX, but soften any residual */

/* ─── suggestions ──────────────────────────────────────────── */
.suggestions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-top: 28px;
  opacity: 0;
  animation: fade-in 0.5s ease 0.3s forwards;
}
.sugg {
  font-family: var(--font-mono);
  font-size: var(--sz-mono);
  line-height: 1.45;
  background: transparent;
  border: none;
  color: var(--ink-soft);
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  text-align: left;
  transition: background-color 0.18s ease, color 0.18s ease;
  letter-spacing: -0.005em;
  position: relative;
  text-decoration: none;
}
.sugg::before {
  content: "→ ";
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-faint);
  margin-right: 4px;
}
.sugg:hover, .sugg.is-tab, .sugg:focus-visible {
  color: var(--ink-strong);
  background: var(--accent-soft);
  outline: none;
}
.sugg.is-tab::before,
.sugg:hover::before,
.sugg:focus-visible::before { color: var(--accent); }
.sugg-hint {
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-quiet);
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.sugg-hint kbd {
  display: inline-block;
  font-family: inherit;
  font-size: 10px;
  padding: 1px 6px;
  border: 1px solid var(--ink-faint);
  border-radius: 3px;
  color: var(--ink-quiet);
  background: var(--bg-soft);
}

/* ─── follow-up / digress ──────────────────────────────────── */
.next-up {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin: 28px 0 0;
  padding-left: 0;
  animation: fade-in 0.5s ease 0.2s both;
}
.nu-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.nu-label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-quiet);
  letter-spacing: 0.04em;
  text-transform: lowercase;
}
.nu-chips {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ─── preview pane ─────────────────────────────────────────── */
.preview-pane {
  border-left: 1px solid var(--line);
  background: var(--bg-soft);
  display: flex;
  flex-direction: column;
  animation: slide-in 0.25s ease;
}
@keyframes slide-in {
  from { opacity: 0; transform: translateX(8px); }
  to   { opacity: 1; transform: translateX(0); }
}
.pp-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}
.pp-mono { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint); }
.pp-close {
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--text-faint);
  font-family: inherit;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 3px;
  cursor: pointer;
}
.pp-close:hover { color: var(--text); border-color: var(--accent-line); }
.pp-frame {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.pp-frame img { max-width: 100%; max-height: 100%; border-radius: 4px; }
.pp-placeholder {
  width: 100%;
  aspect-ratio: 16/10;
  border-radius: 4px;
  background:
    repeating-linear-gradient(
      45deg,
      transparent 0 8px,
      var(--line) 8px 9px
    ),
    var(--bg);
  border: 1px solid var(--line);
}
.pp-cap {
  padding: 0 14px 14px;
  color: var(--text-faint);
  font-size: 11px;
}

/* ─── invisible input ──────────────────────────────────────── */
.hidden-input {
  position: fixed;
  top: -9999px;
  left: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
}

/* ─── send button (visible on mobile / when input has text) ─── */
.send-btn {
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  border: none;
  border-radius: 4px;
  width: 28px;
  height: 22px;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: 8px;
  opacity: 0.9;
}
.send-btn svg { display: block; }
@media (max-width: 720px) {
  .send-btn { display: flex; }
}

/* ─── small screens ────────────────────────────────────────── */
@media (max-width: 720px) {
  body { font-size: 12px; }
  .scroller { padding: 16px 14px 100px; }
  .term.has-preview .term-body { grid-template-columns: 1fr; grid-template-rows: 1fr 200px; }
  .preview-pane { border-left: none; border-top: 1px solid var(--line); }
  .intro-card { gap: 20px; margin-bottom: 36px; }
  .out-answer, .out-example, .out-aside { max-width: 100%; }
  .out-p, .out-li, .out-raw { max-width: 100%; }
  /* stack prompt label above input row */
  .prompt-row { flex-direction: column; align-items: stretch; }
  .prompt-input-row { width: 100%; }
  /* ensure suggestions never overflow */
  .suggestions, .next-up { width: 100%; box-sizing: border-box; }
  .sugg { max-width: 100%; white-space: normal; word-break: break-word; }
}
