:root {
  --bg: #0b0c10;
  --panel: #111217;
  --muted: #9aa3af;
  --text: #e6e9ef;
  --accent: #3b82f6;
  --accent-2: #22d3ee;
  --border: #1f2430;
  --success: #22c55e;
  --danger: #ef4444;
}

* { box-sizing: border-box; }
html, body, #app { height: 100%; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, Apple Color Emoji, Segoe UI Emoji, Noto Color Emoji, "Inter";
  background: radial-gradient(1200px 800px at 50% -10%, #10121a 0%, var(--bg) 60%);
  color: var(--text);
}

button {
  font-family: inherit;
}

.hidden { display: none; }

/* Landing */
.landing {
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  padding: 24px;
}

.brand { text-align: center; }
.logo {
  font-weight: 700;
  font-size: 48px;
  letter-spacing: 0.5px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.tag {
  margin-top: 8px;
  color: var(--muted);
}

.landing-form {
  width: min(720px, 92vw);
  display: flex;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}
.landing-input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: none;
  color: var(--text);
  font-size: 18px;
  padding: 10px 14px;
}
.landing-submit {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border: none;
  color: white;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
}
.examples { 
  display: flex; 
  gap: 12px; 
  flex-wrap: wrap; 
  justify-content: center;
  max-width: 720px;
}
.example {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
}
.example:hover { border-color: #2a3140; color: #c6cbd6; }

/* Chat */
.chat {
  height: 100%;
  display: grid;
  grid-template-rows: 1fr auto;
}
.messages {
  padding: 16px 12px 40px;
  overflow-y: auto;
  display: grid;
  justify-content: center;
  gap: 8px;
}

.message {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 14px;
  align-items: flex-start;
  margin: 8px 0;
  width: min(880px, 94vw);
}
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 600; font-size: 14px;
  background: linear-gradient(135deg, #1e293b, #334155);
  color: #e2e8f0;
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.bubble {
  background: #0f1419;
  border: 1px solid #1e2936;
  border-radius: 18px;
  padding: 16px 20px;
  line-height: 1.35;
  white-space: pre-wrap;
  font-size: 15px;
}
.bubble h1,.bubble h2,.bubble h3,.bubble h4,.bubble h5,.bubble h6{margin:0px 0 0px 0;font-weight:600;color:#f1f5f9;line-height:1.1}
.bubble p{margin:0px 0 0px 0}
.bubble ul,.bubble ol{margin:0px 0 0px 20px;padding:0}
.bubble li{margin:0px 0;line-height:1.15;padding:0}
.bubble h1+ul,.bubble h2+ul,.bubble h3+ul,.bubble h4+ul,.bubble h5+ul,.bubble h6+ul,.bubble h1+ol,.bubble h2+ol,.bubble h3+ol,.bubble h4+ol,.bubble h5+ol,.bubble h6+ol{margin-top:-4px}
.bubble h1+p,.bubble h2+p,.bubble h3+p,.bubble h4+p,.bubble h5+p,.bubble h6+p{margin-top:-2px}
.bubble code{background:#1a202c;border:1px solid #2d3748;padding:3px 6px;border-radius:6px;font-size:14px}
.bubble pre{background:#0d1117;border:1px solid #21262d;padding:14px;border-radius:10px;overflow:auto;font-size:14px}
.message.user .bubble { background: #1a1f2e; border-color: #2a3441; }

.composer {
  position: sticky;
  bottom: 0;
  background: linear-gradient(180deg, rgba(11,12,16,0.0), rgba(11,12,16,0.8) 30%), var(--bg);
  padding: 20px 16px;
  border-top: 1px solid #1e2936;
}
.composer-inner {
  width: min(880px, 94vw);
  margin: 0 auto;
}
.composer-box {
  display: grid;
  grid-template-columns: 44px 1fr 52px;
  align-items: end;
  gap: 12px;
  background: #0f1419;
  border: 2px solid #1e2936;
  border-radius: 20px;
  padding: 12px 14px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.composer-left, .composer-right { display: grid; align-items: center; }
.icon-btn {
  background: transparent;
  border: 1px solid #2a3441;
  color: var(--muted);
  width: 40px; height: 40px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.icon-btn:hover { border-color: #3b4a5c; background: #1a1f2e; }
.icon-btn.primary { 
  background: linear-gradient(90deg, var(--accent), var(--accent-2)); 
  color: white; 
  border: none; 
  width: 44px; 
  height: 44px;
  font-size: 18px;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}
.composer-input {
  background: transparent;
  color: var(--text);
  border: none;
  outline: none;
  padding: 14px 8px;
  resize: none;
  max-height: 30vh;
  font-size: 16px;
  line-height: 1.4;
}
.composer-send { align-self: end; }

.typing-caret {
  display: inline-block;
  width: 8px;
  background: currentColor;
  margin-left: 2px;
  animation: blink 1s steps(1, end) infinite;
}
@keyframes blink {
  0%, 50% { opacity: 1; }
  50.1%, 100% { opacity: 0; }
}

/* Utilities */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 640px) {
  .logo { font-size: 36px; }
  .landing-form { width: 92vw; }
}
