/* intake/style.css — discovery interview chat UI.
   Aesthetic matches the portal it builds: Vollkorn body, Inter Tight headings,
   restrained palette, generous whitespace. */

:root {
  --ink:           #1a1a1a;
  --body:          #2a2a2a;
  --muted:         #5a5a5a;
  --heading:       #0d3a52;
  --heading-deep:  #082a3a;
  --accent:        #b58c4f;
  --accent-deep:   #8e6c39;
  --accent-soft:   #f3e9d5;
  --rule:          #d8d2c4;
  --rule-soft:     #ece7d9;
  --bg:            #fdfcf8;
  --bg-alt:        #f7f2e6;
  --bg-card:       #ffffff;
  --user-bubble:   #f3e9d5;
  --assistant-bubble: #ffffff;
  --shadow-sm: 0 1px 2px rgba(13, 58, 82, 0.04), 0 2px 6px rgba(13, 58, 82, 0.04);
  --shadow-md: 0 4px 12px rgba(13, 58, 82, 0.06), 0 12px 36px rgba(13, 58, 82, 0.06);
  --serif: "Vollkorn", Georgia, Cambria, serif;
  --sans:  "Inter Tight", -apple-system, BlinkMacSystemFont, sans-serif;
  --mono:  "JetBrains Mono", "SF Mono", Menlo, monospace;
  --container: 800px;
  --pad-x: clamp(1.2rem, 3.5vw, 2.5rem);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent); text-decoration: none; border-bottom: 1px dotted currentColor; transition: color 0.15s var(--ease); }
a:hover { color: var(--accent-deep); }

.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--pad-x); }

/* ─── Header ──────────────────────────────────────────────────────── */

.intake-header {
  background: linear-gradient(180deg, var(--bg-alt) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--rule);
  padding: 3rem 0 1.5rem;
}
.intake-header .brand {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.4rem;
}
.intake-header h1 {
  font-family: var(--sans);
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 600;
  color: var(--heading);
  margin: 0 0 0.6rem;
  letter-spacing: -0.01em;
}
.intake-header .lead {
  font-size: 1.05rem;
  max-width: 60ch;
  color: var(--body);
  margin: 0 0 2rem;
}

.section-rail {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.9rem;
  font-family: var(--sans);
  font-size: 0.8rem;
  counter-reset: section;
}
.section-rail li {
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
}
.section-rail li::before {
  counter-increment: section;
  content: counter(section);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
  height: 1.4rem;
  background: var(--rule-soft);
  border-radius: 50%;
  font-weight: 600;
  font-size: 0.72rem;
  color: var(--muted);
}
.section-rail li.done { color: var(--accent-deep); }
.section-rail li.done::before { background: var(--accent-soft); color: var(--accent-deep); }
.section-rail li.current { color: var(--heading); font-weight: 600; border-bottom-color: var(--accent); }
.section-rail li.current::before { background: var(--accent); color: white; }

/* ─── Chat ──────────────────────────────────────────────────────── */

.intake-main { padding: 2rem 0 4rem; }

.chat-shell { display: flex; flex-direction: column; gap: 1.5rem; }

.chat-log {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  min-height: 200px;
}

.msg {
  display: flex;
  flex-direction: column;
  max-width: 88%;
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1.55;
  padding: 1rem 1.2rem;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  animation: msgFade 0.25s var(--ease);
}
@keyframes msgFade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.msg.assistant { align-self: flex-start; background: var(--assistant-bubble); border: 1px solid var(--rule-soft); }
.msg.user      { align-self: flex-end;   background: var(--user-bubble); }

.msg p { margin: 0 0 0.5em; }
.msg p:last-child { margin-bottom: 0; }
.msg strong { font-weight: 600; color: var(--heading); }
.msg code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--bg-alt);
  padding: 0.1em 0.4em;
  border-radius: 3px;
  border: 1px solid var(--rule-soft);
}

.chat-thinking {
  align-self: flex-start;
  display: flex;
  gap: 0.4rem;
  padding: 0.6rem 1rem;
  background: var(--assistant-bubble);
  border: 1px solid var(--rule-soft);
  border-radius: 12px;
  width: fit-content;
}
.chat-thinking span {
  width: 7px;
  height: 7px;
  background: var(--accent);
  border-radius: 50%;
  animation: bounce 1.2s infinite ease-in-out both;
}
.chat-thinking span:nth-child(2) { animation-delay: 0.15s; }
.chat-thinking span:nth-child(3) { animation-delay: 0.3s; }
@keyframes bounce { 0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; } 40% { transform: scale(1); opacity: 1; } }

.chat-input {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: var(--bg-card);
  padding: 1rem;
  border: 1px solid var(--rule);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}
.chat-input textarea {
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1.5;
  border: none;
  outline: none;
  resize: vertical;
  background: transparent;
  color: var(--ink);
}
.chat-input button {
  align-self: flex-end;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.95rem;
  background: var(--heading);
  color: white;
  border: none;
  padding: 0.7rem 1.6rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s var(--ease), transform 0.15s var(--ease);
}
.chat-input button:hover { background: var(--heading-deep); transform: translateY(-1px); }
.chat-input button:disabled { background: var(--muted); cursor: not-allowed; transform: none; }

.chat-hint {
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
  margin: 0;
}

/* ─── Sidebar (captured preview) ────────────────────────────────── */

.intake-sidebar {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  width: 320px;
  max-height: 50vh;
  overflow: auto;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 1rem 1.2rem;
  box-shadow: var(--shadow-md);
  font-family: var(--sans);
  font-size: 0.82rem;
  z-index: 50;
}
.intake-sidebar h3 {
  font-family: var(--sans);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-deep);
  margin: 0 0 0.6rem;
}
.intake-sidebar pre {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--body);
  white-space: pre-wrap;
  word-break: break-word;
}

/* ─── Footer ──────────────────────────────────────────────────────── */

.intake-footer {
  padding: 2rem 0;
  border-top: 1px solid var(--rule);
  background: var(--bg-alt);
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
}

/* ─── Mobile tweaks ──────────────────────────────────────────────── */

@media (max-width: 700px) {
  .intake-header { padding: 2rem 0 1rem; }
  .intake-header h1 { font-size: 1.6rem; }
  .section-rail { font-size: 0.72rem; gap: 0.3rem 0.5rem; }
  .msg { max-width: 100%; font-size: 0.95rem; }
  .intake-sidebar { display: none; } /* hidden on mobile to give the chat room */
}
