:root {
  --bg:      #0f1117;
  --surface: #1a1d27;
  --border:  #2a2d3a;
  --accent:  #6366f1;
  --text:    #e2e8f0;
  --muted:   #94a3b8;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.header .logo {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.header nav a {
  font-size: 0.9rem;
  color: var(--muted);
}

.header nav a:hover { color: var(--text); text-decoration: none; }

/* Hero */
.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4rem 0 2rem;
}

.hero h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.hero p {
  color: var(--muted);
  max-width: 480px;
  margin-bottom: 2.5rem;
}

/* Card */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  max-width: 360px;
  transition: border-color 0.15s;
}

.card:hover { border-color: var(--accent); }

.card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.card p {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
}

/* Button */
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s;
}

.btn:hover { opacity: 0.85; text-decoration: none; }
.btn:focus { outline: none; box-shadow: 0 0 0 3px rgba(99,102,241,0.4); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* Footer */
footer {
  padding: 1.25rem 0;
  font-size: 0.8rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  margin-top: auto;
}

/* Chat layout */
.chat-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.chat-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 1rem 0 0;
}

.chat-body h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.chat-body .subtitle {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.chat-window {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.5rem 0 1rem;
}

/* Messages */
.message {
  display: flex;
  max-width: 75%;
}

.message.user    { align-self: flex-end; justify-content: flex-end; }
.message.assistant { align-self: flex-start; }

.message .text {
  padding: 0.65rem 1rem;
  border-radius: 12px;
  font-size: 0.9rem;
  white-space: pre-wrap;
  line-height: 1.5;
}

.message.user .text {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.message.assistant .text {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

/* Input bar */
.input-bar {
  display: flex;
  gap: 0.5rem;
  padding: 1rem 0;
  border-top: 1px solid var(--border);
}

.input-bar input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 1rem;
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s;
}

.input-bar input:focus { border-color: var(--accent); }
.input-bar input::placeholder { color: var(--muted); }

@media (max-width: 600px) {
  .hero h1 { font-size: 1.5rem; }
  .message { max-width: 90%; }
}
