/* Presentation site — layered over Flowbite's prebuilt stylesheet.
   Every colour is a token so the page keeps one visual language. */

:root {
  --bg: #0b0f1a;
  --bg-soft: #111827;
  --panel: #0f172a;
  --line: #1f2937;
  --line-soft: #1b2433;
  --text: #e6edf6;
  --muted: #94a3b8;
  --dim: #64748b;
  --accent: #38bdf8;
  --accent-strong: #0ea5e9;
  --ok: #34d399;
  --warn: #fbbf24;
  --radius: 14px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(1100px 520px at 78% -8%, rgba(56, 189, 248, 0.14), transparent 60%),
    radial-gradient(900px 480px at 8% 0%, rgba(129, 140, 248, 0.1), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
code, pre { font-family: var(--mono); }
p { color: var(--muted); line-height: 1.7; }
h1, h2, h3, h4 { color: var(--text); letter-spacing: -0.02em; line-height: 1.15; }
h1 { font-size: clamp(2.1rem, 4.4vw, 3.5rem); margin: 0 0 1rem; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); margin: 0 0 0.9rem; }
h3 { font-size: 1.05rem; margin: 0 0 0.5rem; }
ul { color: var(--muted); line-height: 1.8; padding-left: 1.15rem; }

.wrap { width: min(1140px, 92vw); margin: 0 auto; }

/* ── Header ─────────────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(14px);
  background: rgba(11, 15, 26, 0.82);
  border-bottom: 1px solid var(--line-soft);
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.85rem 0; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; font-weight: 700; font-size: 1.05rem; letter-spacing: 0.08em; color: var(--text); }
.brand img { border-radius: 8px; }
.nav-links { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.nav-link { color: var(--muted); font-size: 0.9rem; }
.nav-link:hover, .nav-link-active { color: var(--text); }
.nav-link-active { position: relative; }
.nav-link-active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px; background: var(--accent); border-radius: 2px; }
@media (max-width: 760px) {
  .nav { align-items: flex-start; flex-direction: column; }
  .nav-links { gap: 0.9rem; }
}

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border-radius: 10px;
  border: 1px solid transparent;
  padding: 0.55rem 1.05rem;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.2;
  transition: background 120ms ease, border-color 120ms ease, transform 120ms ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent-strong); color: #051018; border-color: var(--accent-strong); }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); color: #051018; }
.btn-ghost { background: transparent; color: var(--text); border-color: #2b3a50; }
.btn-ghost:hover { border-color: var(--accent); color: var(--text); }
.btn-lg { padding: 0.75rem 1.35rem; font-size: 0.98rem; }
.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.8rem; }

/* ── Hero ───────────────────────────────────────────────────────────────── */
.hero { padding: clamp(3rem, 7vw, 5.5rem) 0 2rem; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }
.eyebrow { text-transform: uppercase; letter-spacing: 0.16em; font-size: 0.72rem; font-weight: 700; color: var(--accent); margin: 0 0 0.9rem; }
.lede { font-size: 1.06rem; max-width: 34rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin: 1.6rem 0 1rem; }
.fine { font-size: 0.82rem; color: var(--dim); }
.fine a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }

.hero-panel, .window {
  background: linear-gradient(180deg, #101827, #0c1320);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}
.panel-head { display: flex; align-items: center; gap: 0.4rem; padding: 0.65rem 0.9rem; border-bottom: 1px solid var(--line-soft); background: rgba(255, 255, 255, 0.02); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot-red { background: #f87171; } .dot-amber { background: #fbbf24; } .dot-green { background: #34d399; }
.panel-title { margin-left: 0.6rem; font-size: 0.76rem; color: var(--dim); font-family: var(--mono); }

.code { margin: 0; padding: 1.15rem 1.25rem; font-size: 0.82rem; line-height: 1.75; color: #cbd5e1; overflow-x: auto; white-space: pre; }
.code code { font-size: inherit; }
.c-dim { color: #64748b; } .c-acc { color: var(--accent); } .c-str { color: #a7f3d0; } .c-ok { color: var(--ok); } .c-tool { color: var(--warn); }

.stat-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin: 2.5rem auto 0; background: var(--line-soft); border: 1px solid var(--line-soft); border-radius: var(--radius); overflow: hidden; }
.stat-strip div { background: rgba(15, 23, 42, 0.75); padding: 1rem 1.2rem; }
.stat-strip strong { display: block; font-size: 1.5rem; color: var(--text); }
.stat-strip span { font-size: 0.78rem; color: var(--dim); }
@media (max-width: 700px) { .stat-strip { grid-template-columns: repeat(2, 1fr); } }

/* ── Sections ───────────────────────────────────────────────────────────── */
.section { padding: clamp(2.8rem, 6vw, 4.6rem) 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1.8rem; }
.sub { max-width: 42rem; margin: 0.2rem 0 0; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; margin-top: 1.8rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.1rem; }
@media (max-width: 960px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: rgba(17, 24, 39, 0.62);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 1.35rem 1.3rem;
  transition: border-color 140ms ease, transform 140ms ease;
}
.card:hover { border-color: #31435c; transform: translateY(-2px); }
.card p { margin: 0; font-size: 0.9rem; }
.card code, .docs code { color: #bae6fd; background: rgba(56, 189, 248, 0.08); padding: 0.08em 0.35em; border-radius: 5px; font-size: 0.85em; }
.card-icon { display: inline-flex; width: 2.4rem; height: 2.4rem; align-items: center; justify-content: center; font-size: 1.15rem; background: rgba(56, 189, 248, 0.09); border: 1px solid rgba(56, 189, 248, 0.18); border-radius: 10px; margin-bottom: 0.85rem; }

/* ── Screenshot/preview frames ──────────────────────────────────────────── */
.shots { display: grid; grid-template-columns: 1.25fr 0.75fr; gap: 1.2rem; }
@media (max-width: 980px) { .shots { grid-template-columns: 1fr; } }
.shot { margin: 0; }
.shot figcaption { margin-top: 0.7rem; font-size: 0.8rem; color: var(--dim); line-height: 1.5; }

.chat { padding: 1rem; display: flex; flex-direction: column; gap: 0.75rem; background: radial-gradient(600px 240px at 90% 0%, rgba(56, 189, 248, 0.06), transparent 60%); }
.chat-msg { border-radius: 10px; padding: 0.7rem 0.85rem; font-size: 0.82rem; line-height: 1.6; }
.chat-msg.user { align-self: flex-end; background: #1d4ed8; color: #eff6ff; max-width: 85%; }
.chat-msg.assistant { background: rgba(2, 6, 23, 0.55); border: 1px solid var(--line-soft); color: #cbd5e1; }
.chat-msg p { margin: 0.45rem 0; color: #cbd5e1; font-size: 0.82rem; }
.tag { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.68rem; font-weight: 600; padding: 0.16rem 0.45rem; border-radius: 999px; font-family: var(--mono); }
.tag-reason { background: rgba(129, 140, 248, 0.14); color: #c7d2fe; }
.tag-tool { background: rgba(251, 191, 36, 0.12); color: #fde68a; margin-right: 0.35rem; }
.tag-done { background: rgba(52, 211, 153, 0.14); color: #6ee7b7; float: right; }
.tag-run { background: rgba(56, 189, 248, 0.14); color: #7dd3fc; float: right; }
.tool { display: flex; align-items: center; gap: 0.4rem; border: 1px solid var(--line-soft); background: rgba(15, 23, 42, 0.7); border-radius: 8px; padding: 0.4rem 0.55rem; margin: 0.45rem 0; font-size: 0.76rem; }
.tool code { color: #e2e8f0; }
.streaming { color: #e2e8f0 !important; }
.caret { display: inline-block; width: 7px; height: 1em; background: var(--accent); margin-left: 2px; vertical-align: -2px; animation: blink 1.1s steps(2, start) infinite; }
@keyframes blink { to { visibility: hidden; } }
.composer { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; margin: 0 1rem 1rem; padding: 0.55rem 0.7rem 0.55rem 0.9rem; border: 1px solid #2b3a50; border-radius: 10px; color: var(--dim); font-size: 0.82rem; }
.send { display: inline-flex; align-items: center; justify-content: center; width: 1.7rem; height: 1.7rem; border-radius: 8px; background: var(--accent-strong); color: #051018; font-weight: 700; }
.tui { font-size: 0.72rem; line-height: 1.7; min-height: 100%; }

/* ── Split / CTA ────────────────────────────────────────────────────────── */
.split { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 2.2rem; align-items: center; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }
.cta {
  display: flex; align-items: center; justify-content: space-between; gap: 1.6rem; flex-wrap: wrap;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(120deg, rgba(14, 165, 233, 0.12), rgba(99, 102, 241, 0.08));
  padding: clamp(1.5rem, 4vw, 2.4rem);
  margin: 2rem auto;
}
.cta h2 { margin-bottom: 0.4rem; }
.cta p { margin: 0; max-width: 40rem; }

/* ── Docs ───────────────────────────────────────────────────────────────── */
.page-head { padding: clamp(2.6rem, 6vw, 4rem) 0 1rem; }
.docs-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 2.4rem; padding: 2rem 0 4rem; align-items: start; }
@media (max-width: 900px) { .docs-layout { grid-template-columns: 1fr; } .toc { display: none; } }
.toc { position: sticky; top: 90px; display: flex; flex-direction: column; gap: 0.15rem; border-left: 1px solid var(--line-soft); padding-left: 1rem; max-height: calc(100vh - 110px); overflow-y: auto; }
.toc a { color: var(--dim); font-size: 0.85rem; padding: 0.3rem 0; }
.toc a:hover { color: var(--accent); }
.docs section { padding-bottom: 2.2rem; border-bottom: 1px solid var(--line-soft); margin-bottom: 2.2rem; }
.docs section:last-child { border-bottom: 0; margin-bottom: 0; }
.docs p { font-size: 0.92rem; }
.docs .code { background: var(--panel); border: 1px solid var(--line-soft); border-radius: 10px; margin: 1rem 0; font-size: 0.78rem; }
/* The inline-code chip must not leak into the `code` wrapper of a block:
   left inline it paints a tinted band and padding on every line. */
.docs .code code { display: block; color: inherit; background: none; padding: 0; border-radius: 0; font-size: inherit; }
/* Inside a preview window the block is the window body, not a nested card. */
.window .code { margin: 0; border: 0; border-radius: 0; background: transparent; }
.docs .grid-2 > div { border: 1px solid var(--line-soft); border-radius: 10px; padding: 1rem 1.1rem; background: rgba(17, 24, 39, 0.5); }
.docs .grid-2 p { margin: 0.2rem 0 0; font-size: 0.84rem; }

/* ── Tables ─────────────────────────────────────────────────────────────── */
/* ── Accounts ───────────────────────────────────────────────────────────── */
.auth-wrap { width: min(540px, 92vw); padding: clamp(2.6rem, 6vw, 4rem) 0; }
.auth-card { background: rgba(17, 24, 39, 0.72); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.5rem, 4vw, 2.2rem); box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28); }
.auth-card h1 { font-size: clamp(1.8rem, 3.4vw, 2.45rem); margin-bottom: 0.55rem; }
.auth-card .sub { margin: 0 0 1.3rem; }
.auth-form { display: flex; flex-direction: column; gap: 0.95rem; }
.field { display: flex; flex-direction: column; gap: 0.35rem; }
.field label { color: var(--text); font-size: 0.82rem; font-weight: 600; }
.field input { width: 100%; box-sizing: border-box; background: rgba(2, 6, 23, 0.55); border: 1px solid #2b3a50; border-radius: 9px; color: var(--text); font: inherit; font-size: 0.95rem; padding: 0.62rem 0.72rem; }
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.14); }
.field-hint { color: var(--dim); font-size: 0.75rem; }
.form-error, .form-notice { border-radius: 9px; font-size: 0.84rem; line-height: 1.55; margin: 0; padding: 0.65rem 0.8rem; }
.form-error { background: rgba(248, 113, 113, 0.1); border: 1px solid rgba(248, 113, 113, 0.28); color: #fecaca; }
.form-notice { background: rgba(52, 211, 153, 0.09); border: 1px solid rgba(52, 211, 153, 0.24); color: #a7f3d0; }
.auth-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.6rem 1rem; border-top: 1px solid var(--line-soft); margin-top: 0.2rem; padding-top: 0.95rem; }
.auth-links a { color: var(--muted); font-size: 0.82rem; text-decoration: underline; text-underline-offset: 3px; }
.auth-links a:hover { color: var(--accent); }
.auth-alt { border-top: 1px solid var(--line-soft); margin-top: 1rem; padding-top: 1rem; }
.btn-block { width: 100%; }
.download-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.download-head > div:first-child { flex: 1 1 32rem; }
.signed-in { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; padding-bottom: 0.35rem; }
.signed-in strong { color: var(--text); font-weight: 600; }
.inline-form { display: inline-flex; margin: 0; }

/* ── Tables ─────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border: 1px solid var(--line-soft); border-radius: 10px; margin: 1.1rem 0; }
table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
th { text-align: left; font-weight: 600; color: var(--dim); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; background: rgba(15, 23, 42, 0.85); padding: 0.7rem 0.9rem; }
td { padding: 0.7rem 0.9rem; border-top: 1px solid var(--line-soft); color: var(--muted); }
td code { color: #e2e8f0; font-size: 0.82rem; }
.notice { border: 1px dashed #31435c; border-radius: 10px; padding: 1rem 1.1rem; background: rgba(15, 23, 42, 0.5); }

/* ── Footer ─────────────────────────────────────────────────────────────── */
.site-footer { border-top: 1px solid var(--line-soft); margin-top: 3rem; padding: 2.4rem 0; background: rgba(8, 12, 20, 0.6); }
.footer-grid { display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; align-items: flex-start; }
.footer-links { display: flex; gap: 1.4rem; flex-wrap: wrap; }
.footer-links a { color: var(--muted); font-size: 0.85rem; }
.fine p { margin: 0.6rem 0 0; }

/* ── Documentation home ─────────────────────────────────────────────────── */
.hero-shot { margin: 0; }
.docs .shots { margin: 1.5rem 0 0; }
.docs .shot .window { height: 100%; }
.docs figure.shot { margin-left: 0; margin-right: 0; }

/* Mocked marketplace listing */
.mock { padding: 0.9rem; display: flex; flex-direction: column; gap: 0.4rem; }
.mock-row { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; border: 1px solid var(--line-soft); background: rgba(15, 23, 42, 0.7); border-radius: 8px; padding: 0.42rem 0.6rem; font-size: 0.76rem; color: var(--muted); }
.mock-row code { color: #e2e8f0; font-size: 0.76rem; }
.mock-row .tag { float: none; }

/* Mocked web workspace (sessions sidebar + chat) */
.ws { display: grid; grid-template-columns: 148px minmax(0, 1fr); }
.ws-side { border-right: 1px solid var(--line-soft); background: rgba(2, 6, 23, 0.35); padding: 0.7rem 0.6rem; display: flex; flex-direction: column; gap: 0.15rem; }
.ws-title { margin: 0.55rem 0 0.25rem; text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.58rem; color: var(--dim); }
.ws-title:first-child { margin-top: 0; }
.ws-item { color: var(--muted); font-size: 0.74rem; padding: 0.28rem 0.4rem; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-item-active { background: rgba(56, 189, 248, 0.12); color: var(--text); }
.ws-main { padding: 0.85rem; display: flex; flex-direction: column; gap: 0.6rem; min-width: 0; }
.ws-main .composer { margin: 0; }
@media (max-width: 640px) { .ws { grid-template-columns: 1fr; } .ws-side { display: none; } }
