/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0a0c0f;
  --bg2: #0f1115;
  --bg3: #14171d;
  --border: rgba(255,255,255,0.07);
  --border-bright: rgba(255,255,255,0.14);
  --accent: #00e5a0;
  --accent2: #0095ff;
  --accent-dim: rgba(0,229,160,0.12);
  --accent2-dim: rgba(0,149,255,0.1);
  --text: #e8eaed;
  --text2: #8b909a;
  --text3: #555b66;
  --red: #ff4d4d;
  --yellow: #ffd700;
  --green: #00e5a0;
  --font-mono: 'JetBrains Mono', monospace;
  --font-display: 'Syne', sans-serif;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 8px 40px rgba(0,0,0,0.5);
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== HEADER ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10,12,15,0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
}
.logo-bracket { color: var(--accent); }
.logo-text { color: var(--text); letter-spacing: 0.05em; }
.logo-sub { color: var(--accent2); font-size: 11px; margin: 0 2px; }
.logo-tag {
  color: var(--text3);
  font-size: 11px;
  margin-left: 10px;
  font-weight: 300;
  display: none;
}
@media(min-width:600px){ .logo-tag { display: inline; } }
.nav { display: flex; align-items: center; gap: 12px; }
.nav-badge {
  font-size: 11px;
  background: var(--accent-dim);
  border: 1px solid rgba(0,229,160,0.25);
  color: var(--accent);
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.04em;
}
.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.85); }
}
.status-text { color: var(--text2); font-size: 12px; }

/* ===== HERO ===== */
.hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 24px 60px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  position: relative;
}
@media(min-width:900px){
  .hero { grid-template-columns: 1fr 1fr; align-items: center; padding: 100px 24px 80px; }
}
.hero-grid-bg {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,229,160,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,229,160,0.025) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}
.hero-content { position: relative; z-index: 1; }
.hero-eyebrow {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.1em;
  margin-bottom: 16px;
  font-weight: 400;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 800;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}
.hero-accent {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-desc {
  color: var(--text2);
  font-size: 14px;
  line-height: 1.75;
  max-width: 480px;
  margin-bottom: 24px;
  font-family: var(--font-mono);
  font-weight: 300;
}
.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
}
.chip {
  font-size: 11px;
  font-family: var(--font-mono);
  background: var(--bg3);
  border: 1px solid var(--border-bright);
  color: var(--text2);
  padding: 4px 12px;
  border-radius: 4px;
  letter-spacing: 0.03em;
}
.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #0a0c0f;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  padding: 12px 24px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: all 0.2s;
}
.cta-btn:hover {
  background: #00ffb0;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0,229,160,0.3);
}

/* ===== TERMINAL ===== */
.hero-terminal {
  position: relative;
  z-index: 1;
  background: var(--bg2);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow), 0 0 0 1px rgba(0,229,160,0.05);
}
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
}
.dot {
  width: 10px; height: 10px;
  border-radius: 50%;
}
.dot.red { background: #ff5f57; }
.dot.yellow { background: #febc2e; }
.dot.green { background: #28c840; }
.terminal-title {
  margin-left: 8px;
  color: var(--text3);
  font-size: 11px;
  font-family: var(--font-mono);
}
.terminal-body {
  padding: 20px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.8;
  min-height: 220px;
  color: var(--text2);
}
.t-line { margin: 2px 0; opacity: 0; animation: fadeIn 0.3s forwards; }
.t-prompt { color: var(--accent); }
.t-cmd { color: var(--text); }
.t-out { color: var(--text2); padding-left: 16px; }
.t-ok { color: var(--accent); padding-left: 16px; }
.t-warn { color: var(--yellow); padding-left: 16px; }
.t-cursor {
  display: inline-block;
  width: 8px; height: 14px;
  background: var(--accent);
  animation: blink 1s infinite;
  vertical-align: text-bottom;
}
@keyframes blink { 0%,49% { opacity: 1; } 50%,100% { opacity: 0; } }
@keyframes fadeIn { to { opacity: 1; } }

/* ===== QUICK TOPICS ===== */
.quick-topics {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 60px;
}
.section-label {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 11px;
  letter-spacing: 0.1em;
  margin-bottom: 20px;
}
.topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.topic-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
}
.topic-card:hover {
  border-color: var(--accent);
  background: var(--bg3);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0,229,160,0.08);
}
.topic-icon {
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}
.topic-title {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 4px;
}
.topic-level {
  font-size: 10px;
  color: var(--text3);
  letter-spacing: 0.05em;
}

/* ===== CHAT SECTION ===== */
.chat-section {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px 80px;
}
.chat-container {
  background: var(--bg2);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
}
.chat-header-left { display: flex; align-items: center; gap: 12px; }
.ai-avatar {
  width: 36px; height: 36px;
  background: var(--accent-dim);
  border: 1px solid rgba(0,229,160,0.3);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}
.chat-ai-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
}
.chat-ai-sub { font-size: 11px; color: var(--text3); font-family: var(--font-mono); }
.clear-btn {
  display: flex; align-items: center; gap: 6px;
  background: none;
  border: 1px solid var(--border);
  color: var(--text3);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}
.clear-btn:hover { border-color: var(--red); color: var(--red); }

/* ===== CHAT MESSAGES ===== */
.chat-messages {
  height: 520px;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 4px; }

.msg { display: flex; gap: 12px; max-width: 100%; animation: msgIn 0.25s ease; }
@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.msg.user { flex-direction: row-reverse; }
.msg-avatar {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.msg.ai .msg-avatar { background: var(--accent-dim); border: 1px solid rgba(0,229,160,0.2); color: var(--accent); }
.msg.user .msg-avatar { background: var(--accent2-dim); border: 1px solid rgba(0,149,255,0.2); color: var(--accent2); }
.msg-bubble {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.7;
}
.msg.ai .msg-bubble {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  border-top-left-radius: 4px;
}
.msg.user .msg-bubble {
  background: var(--accent2-dim);
  border: 1px solid rgba(0,149,255,0.2);
  color: var(--text);
  border-top-right-radius: 4px;
}

/* Markdown-like formatting in AI messages */
.msg-bubble h3 {
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--accent);
  margin: 12px 0 6px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.msg-bubble h3:first-child { margin-top: 0; }
.msg-bubble p { margin-bottom: 8px; }
.msg-bubble p:last-child { margin-bottom: 0; }
.msg-bubble ul, .msg-bubble ol {
  padding-left: 18px;
  margin-bottom: 8px;
}
.msg-bubble li { margin-bottom: 4px; }
.msg-bubble code {
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--border-bright);
  border-radius: 4px;
  padding: 1px 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent2);
}
.msg-bubble pre {
  background: rgba(0,0,0,0.5);
  border: 1px solid var(--border-bright);
  border-radius: 8px;
  padding: 12px;
  overflow-x: auto;
  margin: 10px 0;
}
.msg-bubble pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--text2);
  font-size: 12px;
}
.msg-bubble strong { color: var(--text); font-weight: 700; }
.msg-bubble .step-badge {
  display: inline-block;
  background: var(--accent);
  color: #0a0c0f;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  margin-right: 6px;
  font-family: var(--font-mono);
}
.msg-bubble .level-tag {
  display: inline-block;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 4px;
  margin: 0 4px 4px 0;
  font-weight: 700;
  letter-spacing: 0.05em;
}
.level-tag.l1 { background: rgba(0,229,160,0.15); color: var(--accent); border: 1px solid rgba(0,229,160,0.3); }
.level-tag.l2 { background: rgba(0,149,255,0.15); color: var(--accent2); border: 1px solid rgba(0,149,255,0.3); }
.level-tag.l3 { background: rgba(255,77,77,0.1); color: #ff7070; border: 1px solid rgba(255,77,77,0.3); }
.msg-bubble hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 10px 0;
}

/* Typing indicator */
.typing-indicator { display: flex; gap: 4px; padding: 4px 0; align-items: center; }
.typing-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: typingBounce 1.2s infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
  0%,60%,100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-5px); opacity: 1; }
}

/* ===== INPUT AREA ===== */
.chat-input-area {
  padding: 16px 20px;
  background: var(--bg3);
  border-top: 1px solid var(--border);
}
.input-wrapper {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  background: var(--bg);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  padding: 12px 14px;
  transition: border-color 0.2s;
}
.input-wrapper:focus-within {
  border-color: rgba(0,229,160,0.4);
  box-shadow: 0 0 0 3px rgba(0,229,160,0.06);
}
#userInput {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  resize: none;
  max-height: 160px;
  overflow-y: auto;
}
#userInput::placeholder { color: var(--text3); }
.send-btn {
  width: 34px; height: 34px;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #0a0c0f;
  flex-shrink: 0;
  transition: all 0.2s;
}
.send-btn:hover { background: #00ffb0; transform: scale(1.05); }
.send-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.input-hint {
  margin-top: 8px;
  font-size: 10px;
  color: var(--text3);
  font-family: var(--font-mono);
}
.input-hint kbd {
  background: var(--bg3);
  border: 1px solid var(--border-bright);
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 10px;
  font-family: var(--font-mono);
}

/* ===== FOOTER ===== */
.footer {
  border-top: 1px solid var(--border);
  padding: 24px;
  text-align: center;
}
.footer-inner { max-width: 900px; margin: 0 auto; }
.footer-logo {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 8px;
}
.footer-meta { font-size: 11px; color: var(--text3); margin-bottom: 4px; }
.footer-note { font-size: 10px; color: var(--text3); font-style: italic; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 4px; }
