:root {
  --bg: #0d0c0b;
  --bg-glow: #17140f;
  --panel: #161512;
  --panel-raised: #201d19;
  --border: #2c2822;
  --text: #f0ece4;
  --text-dim: #a89e91;
  --text-dim2: #726b60;
  --accent: #e8935a;
  --accent-2: #c14e3a;
  --user-bubble: #2c2016;
  --radius-lg: 18px;
  --radius-sm: 6px;
  --font-display: "Space Grotesk", -apple-system, sans-serif;
  --font-body: "Inter", -apple-system, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
}

.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-width: 760px;
  margin: 0 auto;
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  flex-shrink: 0;
}

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

.brand-logo {
  position: relative;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-logo::before {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 147, 90, 0.4), transparent 70%);
  animation: breathe 3.2s ease-in-out infinite;
}

.logo-svg {
  position: relative;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 6px rgba(193, 78, 58, 0.4));
}

.arch-path {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: draw-arch 1.1s cubic-bezier(0.4, 0, 0.2, 1) 0.15s forwards;
}

@keyframes draw-arch {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes breathe {
  0%, 100% { transform: scale(0.92); opacity: 0.7; }
  50% { transform: scale(1.08); opacity: 1; }
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: 0.2px;
}

.model-switch {
  display: flex;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}

.model-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.model-btn:hover {
  color: var(--text);
}

.model-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
}

/* Chat window */
.chat-window {
  flex: 1;
  overflow-y: auto;
  padding: 8px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Hero / empty state */
.hero {
  margin: auto;
  max-width: 480px;
  text-align: center;
  padding: 32px 0;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 600;
  margin: 0 0 10px;
  letter-spacing: -0.3px;
}

.hero p {
  color: var(--text-dim);
  font-size: 14.5px;
  line-height: 1.6;
  margin: 0 0 24px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.chip {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 13px;
  padding: 9px 14px;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.chip:hover {
  border-color: var(--accent);
  color: var(--text);
  transform: translateY(-1px);
}

/* Messages */
.message {
  max-width: 78%;
  padding: 12px 16px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-wrap: break-word;
  animation: rise 0.28s ease both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.message.user {
  align-self: flex-end;
  background: var(--user-bubble);
  border-radius: var(--radius-lg) var(--radius-lg) var(--radius-sm) var(--radius-lg);
}

.message.assistant {
  align-self: flex-start;
  background: var(--panel-raised);
  border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) var(--radius-sm);
}

.message.error {
  align-self: center;
  background: transparent;
  border: 1px solid #6b3636;
  color: #e5978f;
  font-size: 13px;
  border-radius: var(--radius-sm);
}

/* Typing indicator */
.typing {
  align-self: flex-start;
  background: var(--panel-raised);
  border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) var(--radius-sm);
  padding: 14px 18px;
  display: flex;
  gap: 4px;
  animation: rise 0.28s ease both;
}

.typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-dim);
  animation: bounce 1.1s infinite ease-in-out;
}

.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* Input bar */
.chat-form {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 14px 24px 22px;
  flex-shrink: 0;
}

.chat-input {
  flex: 1;
  resize: none;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text);
  padding: 13px 16px;
  font-family: var(--font-body);
  font-size: 15px;
  max-height: 140px;
  transition: border-color 0.18s ease;
}

.chat-input:focus {
  outline: none;
  border-color: var(--accent);
}

.send-btn {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: none;
  color: #fff;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.send-btn:hover:not(:disabled) {
  transform: scale(1.05);
}

@media (max-width: 480px) {
  .hero h1 { font-size: 24px; }
  .app-header { padding: 16px 16px 12px; }
  .chat-window { padding: 8px 16px 16px; }
  .chat-form { padding: 12px 16px 18px; }
}
