:root {
  --bg: #0a0a0c; --bg2: #141416; --bg3: #1a1a1e;
  --fg: #f0f0f0; --fg2: #d0d0d0; --mid: #888; --dim: #555;
  --line: #2a2a30; --red: #e82020; --red-h: #ff3333;
  --green: #00dd66; --blue: #1535ee; --blue2: #1d42ff;
  --font: 'JetBrains Mono', monospace;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body { min-height: 100vh; background: var(--bg); color: var(--fg); font: 12px/1.55 var(--font); letter-spacing: .3px; -webkit-font-smoothing: antialiased; }
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--dim); }
::selection { background: var(--blue); color: #fff; }

/* ── BAR ── */
.bar { position: sticky; top: 0; z-index: 100; display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; background: var(--bg); border-bottom: 1px solid var(--line); gap: 14px; }
.bar-left { display: flex; align-items: baseline; gap: 0; flex-shrink: 0; }
.bar-right { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.logo { font-weight: 800; font-size: 17px; color: var(--fg); text-decoration: none; letter-spacing: .5px; }
.logo-div { color: var(--dim); font-size: 17px; font-weight: 400; margin: 0 6px; }
.logo-section { font-size: 13px; font-weight: 700; color: var(--blue); letter-spacing: 1px; text-transform: uppercase; }
.b { display: inline-flex; align-items: center; gap: 5px; padding: 8px 14px; border: 1px solid var(--line); background: var(--bg3); color: var(--fg2); font: 700 10px var(--font); letter-spacing: .8px; text-transform: uppercase; cursor: pointer; transition: all .12s; white-space: nowrap; }
.b:hover { border-color: var(--fg); color: var(--fg); }
.hidden { display: none !important; }

/* ── MAIN ── */
.main { max-width: 900px; margin: 0 auto; padding: 0 20px 60px; }

/* ── HERO ── */
.ai-hero { padding: 60px 0 40px; border-bottom: 1px solid var(--line); margin-bottom: 32px; }
.ai-hero-badge {
  display: inline-block; font-size: 9px; font-weight: 800;
  letter-spacing: 2px; color: var(--blue); padding: 4px 10px;
  border: 1px solid var(--blue); margin-bottom: 20px;
}
.ai-hero-title {
  font-size: clamp(28px, 5vw, 48px); font-weight: 800;
  text-transform: uppercase; letter-spacing: 2px;
  line-height: 1.1; color: var(--fg); margin-bottom: 16px;
}
.ai-hero-sub {
  font-size: 13px; color: var(--mid); line-height: 1.7;
  max-width: 600px;
}
.ai-hero-stats {
  display: flex; gap: 24px; margin-top: 28px;
}
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat-num { font-size: 28px; font-weight: 800; color: var(--fg); line-height: 1; }
.stat-label { font-size: 9px; font-weight: 700; color: var(--dim); letter-spacing: 1.5px; }

/* ── INFO SECTIONS ── */
.info-section {
  margin-bottom: 32px; padding: 0;
  border: 1px solid var(--line);
  background: var(--bg2);
  animation: fadeIn .25s ease-out;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.info-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}
.info-title { font-size: 13px; font-weight: 800; letter-spacing: 2px; color: var(--fg); }
.info-close {
  width: 28px; height: 28px; display: grid; place-items: center;
  background: transparent; border: 1px solid var(--line);
  color: var(--fg); font-size: 16px; cursor: pointer; transition: all .12s;
}
.info-close:hover { border-color: var(--red); color: var(--red); }

/* Architecture grid */
.arch-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0; }
.arch-card {
  padding: 20px; border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
}
.arch-card:nth-child(3n) { border-right: none; }
.arch-card:nth-last-child(-n+3) { border-bottom: none; }
.arch-num { font-size: 24px; font-weight: 800; color: var(--blue); line-height: 1; margin-bottom: 8px; }
.arch-label { font-size: 10px; font-weight: 800; letter-spacing: 1.5px; color: var(--fg); margin-bottom: 8px; }
.arch-desc { font-size: 11px; color: var(--mid); line-height: 1.6; }

/* Stack grid */
.stack-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.stack-item {
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
}
.stack-item:nth-child(2n) { border-right: none; }
.stack-item:nth-last-child(-n+2) { border-bottom: none; }
.stack-cat { font-size: 9px; font-weight: 800; letter-spacing: 1.5px; color: var(--dim); margin-bottom: 4px; }
.stack-val { font-size: 11px; color: var(--fg2); font-weight: 700; }

/* ── CHAT ── */
.chat-section {
  border: 2px solid var(--fg);
  background: var(--bg2);
  display: flex; flex-direction: column;
  max-height: 600px;
}
.chat-header {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.chat-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 8px rgba(21, 53, 238, .5);
}
.chat-label { font-size: 10px; font-weight: 800; letter-spacing: 2px; color: var(--mid); }
.chat-mode {
  font-size: 8px; font-weight: 800; letter-spacing: 1px;
  padding: 2px 8px; margin-left: auto;
}
.chat-mode.live { color: var(--green); border: 1px solid var(--green); }
.chat-mode.demo { color: var(--amber, #f0a020); border: 1px solid var(--amber, #f0a020); }

.chat-messages {
  flex: 1; overflow-y: auto;
  padding: 16px 20px;
  display: flex; flex-direction: column; gap: 12px;
  min-height: 250px;
}

/* Messages */
.msg { max-width: 85%; animation: fadeIn .2s ease-out; }
.msg-user { align-self: flex-end; }
.msg-ai { align-self: flex-start; }
.msg-sender { font-size: 8px; font-weight: 800; letter-spacing: 1.5px; color: var(--blue); margin-bottom: 4px; }
.msg-user .msg-text {
  padding: 10px 16px; background: var(--blue); color: #fff;
  font-size: 12px; line-height: 1.6;
  border-radius: 12px 12px 2px 12px;
}
.msg-ai .msg-text {
  padding: 10px 16px; border: 1px solid var(--line);
  font-size: 12px; line-height: 1.6; color: var(--fg2);
  border-radius: 2px 12px 12px 12px;
}

/* Typing indicator */
.typing-dots { display: flex; gap: 4px; padding: 4px 0; }
.typing-dots span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--mid);
  animation: dotPulse 1.2s ease-in-out infinite;
}
.typing-dots span:nth-child(2) { animation-delay: .2s; }
.typing-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes dotPulse { 0%, 80%, 100% { opacity: .3; transform: scale(.8); } 40% { opacity: 1; transform: scale(1.1); } }

/* Quick prompts */
.chat-prompts {
  display: flex; gap: 6px; padding: 8px 20px;
  flex-wrap: wrap; flex-shrink: 0;
  border-top: 1px solid var(--line);
}
.qp {
  padding: 6px 12px; background: transparent;
  border: 1px solid var(--line); color: var(--mid);
  font: 700 9px var(--font); letter-spacing: .5px;
  cursor: pointer; transition: all .12s;
}
.qp:hover { border-color: var(--blue); color: var(--blue); }

/* Input */
.chat-input-row {
  display: flex; gap: 8px; padding: 14px 20px;
  border-top: 1px solid var(--line); flex-shrink: 0;
}
.chat-input {
  flex: 1; background: var(--bg); border: 1px solid var(--line);
  color: var(--fg); font: 12px var(--font); padding: 12px 16px;
  outline: none; transition: border-color .15s;
}
.chat-input::placeholder { color: var(--dim); }
.chat-input:focus { border-color: var(--blue); }
.chat-send {
  width: 44px; background: var(--blue); border: none;
  color: #fff; font-size: 18px; cursor: pointer;
  display: grid; place-items: center; transition: background .15s;
}
.chat-send:hover { background: var(--blue2); }
.chat-send:disabled { opacity: .4; cursor: default; }

/* ── TOAST ── */
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(60px); background: var(--bg2); border: 1px solid var(--line); font: 700 11px var(--font); padding: 10px 20px; z-index: 9000; opacity: 0; transition: all .25s; pointer-events: none; letter-spacing: .5px; color: var(--fg); }
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.error { border-color: var(--red); color: var(--red); }
.toast.success { border-color: var(--green); color: var(--green); }

/* ── RESPONSIVE ── */
@media (max-width: 620px) {
  .bar { flex-direction: column; align-items: stretch; gap: 10px; }
  .ai-hero { padding: 32px 0 24px; }
  .ai-hero-title { font-size: 24px; }
  .ai-hero-stats { gap: 16px; }
  .stat-num { font-size: 22px; }
  .arch-grid { grid-template-columns: 1fr; }
  .arch-card { border-right: none !important; }
  .stack-grid { grid-template-columns: 1fr; }
  .stack-item { border-right: none !important; }
  .chat-section { max-height: none; }
}
