/* FlowKit site — shared design system. Page-specific rules live in each page. */

:root {
  --bg: #0b0c0f;
  --bg-2: #101115;
  --surface: #14161b;
  --surface-2: #1b1d24;
  --border: #272a32;
  --border-2: #3b3e48;
  --text: #f0f0f3;
  --text-2: #bfc0c8;
  --dim: #999ca8;
  --faint: #898c99;
  --accent: #b9a2ff;
  --accent-2: #c084fc;
  --pink: #f5a0ee;
  --blue: #8f83f3;
  --amber: #f0a832;
  --green: #4ade80;
  --gradient: linear-gradient(90deg, #f5a0ee 0%, #c084fc 50%, #8f83f3 100%);
  --radius: 14px;
  --font: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Consolas, monospace;
  --nav-h: 64px;
  --container: 1280px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
/* dotted canvas ground + lilac vignette */
.ground {
  background-image:
    radial-gradient(700px 420px at 85% -5%, rgba(124, 58, 237, 0.16), transparent 60%),
    radial-gradient(600px 380px at 5% 10%, rgba(219, 39, 119, 0.07), transparent 60%),
    radial-gradient(rgba(167, 139, 250, 0.16) 1px, transparent 1.2px);
  background-size: auto, auto, 28px 28px;
  background-attachment: fixed, fixed, scroll;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }
h1, h2, h3, h4 { margin: 0; line-height: 1.12; letter-spacing: -0.02em; text-wrap: balance; font-weight: 700; }
p { margin: 0; }
code, pre, kbd { font-family: var(--mono); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
img, svg { max-width: 100%; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }

.container { max-width: var(--container); margin: 0 auto; padding: 0 32px; }
.grad { background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}
.lead { font-size: 19px; color: var(--text-2); line-height: 1.55; max-width: 60ch; }
.muted { color: var(--dim); }

/* ---- nav ---- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  background: rgba(10, 9, 16, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav .container { height: 100%; display: flex; align-items: center; gap: 36px; }
.nav .logo { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 18px; letter-spacing: -0.01em; }
.nav .logo svg { width: 28px; height: 28px; }
.nav .links { display: flex; gap: 26px; }
.nav .links a { color: var(--text-2); font-size: 14.5px; font-weight: 500; padding: 6px 0; }
.nav .links a:hover, .nav .links a.active { color: var(--text); }
.nav .links a.active { position: relative; }
.nav .links a.active::after { content: ''; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; border-radius: 2px; background: var(--gradient); }
.nav .right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.pill {
  font-family: var(--mono);
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-2);
  color: var(--dim);
}

/* ---- buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 46px;
  padding: 0 22px;
  border-radius: 12px;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, background 0.2s, border-color 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}
.btn svg { width: 17px; height: 17px; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #0a0910; box-shadow: 0 8px 28px rgba(167, 139, 250, 0.28); }
.btn-primary:hover { background: #b9a3ff; color: #0a0910; }
.btn-ghost { background: rgba(255, 255, 255, 0.02); color: var(--text); border-color: var(--border-2); }
.btn-ghost:hover { border-color: var(--accent); color: var(--text); }
.btn-sm { height: 36px; padding: 0 14px; font-size: 13.5px; border-radius: 9px; }

/* ---- sections ---- */
.section { padding: 96px 0; }
.section-head { max-width: 640px; margin-bottom: 44px; display: flex; flex-direction: column; gap: 14px; }
.section-head h2 { font-size: 40px; }
.section-head p { color: var(--text-2); font-size: 17px; }

/* ---- cards ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
}
.card.glow { box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(167, 139, 250, 0.06) inset; }

/* ---- stats row ---- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }
.stat b { display: block; font-size: 44px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
.stat span { display: block; margin-top: 10px; color: var(--dim); font-size: 14.5px; }

/* ---- code ---- */
.code {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  font-size: 13.5px;
}
.code .code-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
  color: var(--dim);
  font-family: var(--mono);
  font-size: 12px;
}
.code .code-bar .dots { display: flex; gap: 6px; }
.code .code-bar .dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--border-2); }
.code .code-bar .copy { margin-left: auto; background: none; border: 1px solid var(--border-2); color: var(--dim); border-radius: 7px; height: 26px; padding: 0 10px; font-family: var(--mono); font-size: 11.5px; cursor: pointer; }
.code .code-bar .copy:hover { color: var(--text); border-color: var(--accent); }
.code pre { margin: 0; padding: 18px 20px; overflow-x: auto; line-height: 1.65; color: var(--text-2); }
.code code { font-family: var(--mono); }
.tk-kw { color: var(--accent-2); }
.tk-str { color: var(--pink); }
.tk-num { color: #8fb8fd; }
.tk-cm { color: var(--faint); font-style: italic; }
.tk-fn { color: var(--accent); }
.tk-tag { color: #8fb8fd; }
.tk-attr { color: var(--pink); }
.tk-punct { color: var(--dim); }
code.inline {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 6px;
  font-size: 0.88em;
  color: var(--pink);
}

/* ---- tabs ---- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); }
.tabs button {
  background: none;
  border: none;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 13px;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tabs button.active { color: var(--text); border-bottom-color: var(--accent); }
.tabs button:hover { color: var(--text); }

/* ---- docs layout ---- */
.docs { display: grid; grid-template-columns: 250px minmax(0, 1fr) 210px; gap: 56px; padding: 40px 0 96px; }
.docs .side { position: sticky; top: calc(var(--nav-h) + 24px); align-self: start; max-height: calc(100vh - var(--nav-h) - 48px); overflow-y: auto; }
.side .group { margin-bottom: 22px; }
.side .group > b { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.side a { display: block; font-size: 14px; color: var(--dim); padding: 5px 10px; border-radius: 7px; }
.side a:hover { color: var(--text); background: var(--surface); }
.side a.active { color: var(--accent); background: rgba(167, 139, 250, 0.09); }
.docs-menu-toggle { display: none; }
@media(max-width: 960px) {
  .docs-menu-toggle { display: block; width: 100%; min-height: 44px; padding: 10px 14px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; text-align: left; cursor: pointer; font: inherit; }
  .docs-menu-toggle::after { content: '+'; float: right; }
  .docs-menu-toggle[aria-expanded="true"]::after { content: '−'; }
  .docs-collapsible:not(.is-open) #docs-menu-content { display: none; }
  .docs-collapsible.is-open #docs-menu-content { padding: 20px 8px 0; }
}
.toc { position: sticky; top: calc(var(--nav-h) + 24px); align-self: start; font-size: 13px; }
.toc b { display: block; font-weight: 600; margin-bottom: 10px; font-size: 13px; }
.toc a { display: block; color: var(--dim); padding: 4px 0; }
.toc a:hover { color: var(--text); }
.crumbs { display: flex; gap: 8px; align-items: center; font-size: 13.5px; color: var(--dim); margin-bottom: 14px; }
.crumbs a { color: var(--dim); }
.crumbs b { color: var(--text); font-weight: 500; }
.prose { max-width: 760px; }
.prose h1 { font-size: 40px; margin-bottom: 14px; }
.prose h2 { font-size: 26px; margin: 48px 0 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.prose h3 { font-size: 19px; margin: 32px 0 10px; }
.prose p { color: var(--text-2); margin: 12px 0; font-size: 16px; }
.prose ul, .prose ol { color: var(--text-2); padding-left: 22px; margin: 12px 0; }
.prose li { margin: 6px 0; }
.prose .code { margin: 18px 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 18px 0; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose th { color: var(--dim); font-weight: 500; font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; }
.prose td:first-child { font-family: var(--mono); color: var(--pink); font-size: 13px; white-space: nowrap; }
.callout {
  border: 1px solid rgba(167, 139, 250, 0.5);
  background: rgba(167, 139, 250, 0.07);
  border-radius: 12px;
  padding: 16px 18px;
  margin: 18px 0;
  color: var(--text-2);
  font-size: 15px;
}
.callout b { color: var(--accent); display: block; margin-bottom: 4px; font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; }

/* ---- gallery ---- */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
/* scaled embeds keep their 1600px intrinsic width; without min-width:0 a grid
 * or flex item sizes to that and blows out of its track */
.ex-card, .ex-thumb, .fk-embed { min-width: 0; }
.ex-card { display: flex; flex-direction: column; gap: 12px; color: var(--text); }
.ex-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color 0.2s, transform 0.2s;
}
.ex-card:hover .ex-thumb { border-color: var(--accent); transform: translateY(-2px); }
.ex-thumb .fk-embed { border-radius: 0; pointer-events: none; }
.ex-card .eyebrow { margin-top: 6px; }
.ex-card h3 { font-size: 18px; }
.ex-card p { color: var(--dim); font-size: 14.5px; }
.ex-card .more { font-size: 14px; font-weight: 500; }

/* ---- footer ---- */
.footer { border-top: 1px solid var(--border); padding: 40px 0; color: var(--dim); font-size: 14px; }
.footer .container { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.footer .links { display: flex; gap: 22px; margin-left: auto; }
.footer a { color: var(--dim); }
.footer a:hover { color: var(--text); }

@media (max-width: 960px) {
  .container { padding: 0 20px; }
  .nav .links { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .docs { grid-template-columns: 1fr; gap: 28px; }
  .docs .side, .toc { position: static; max-height: none; }
  .gallery { grid-template-columns: 1fr; }
  .section { padding: 64px 0; }
  .section-head h2 { font-size: 32px; }
}
/* Shared navigation and reading surfaces. Keep the canvas texture inside demos. */
.ground { background-image: none; }
html { scrollbar-gutter: stable; }
.nav { background: rgba(11,12,15,.96); height: 72px; backdrop-filter: blur(18px); }
.nav .container { gap: 38px; }
.nav .logo { font-size: 20px; letter-spacing: -.7px; }
.nav .links { gap: 25px; }
.nav .links a { font-size: 13px; color: var(--dim); }
.nav .links a.active::after { background: var(--text); height: 1px; bottom: -24px; }
.nav .right { gap: 23px; }
.agent-link { font-size: 13px; color: var(--text-2); white-space: nowrap; }
.btn { border-radius: 7px; box-shadow: none; font-size: 14px; font-weight: 500; }
.btn-primary { background: #e4d9ff; color: #211c2c; box-shadow: none; }
.btn-primary:hover { background: #eee8ff; color: #211c2c; }
.btn-ghost { background: #14161b; }
.nav .btn-sm { height: 35px; font-size: 12px; padding: 0 13px; }
.nav-toggle { display: none; background: transparent; color: var(--text); border: 1px solid var(--border); border-radius: 6px; height: 36px; width: 36px; font-size: 20px; }
.skip-link { position: fixed; top: -80px; left: 20px; z-index: 1000; background: var(--text); color: var(--bg); padding: 10px 16px; }
.skip-link:focus { top: 12px; }
.footer { padding: 30px 0; font-size: 12px; }
.footer b { color: var(--text); font-size: 15px; }
.footer-note { margin-left: 18px; }
.footer .links { gap: 20px; flex-wrap: wrap; }
.prose { min-width: 0; }
.prose h1 { font-size: clamp(32px,4vw,48px); letter-spacing: -1.5px; }
.prose p { max-width: 70ch; }
.prose pre, .code pre { max-width: 100%; overflow-x: auto; tab-size: 2; }
.prose table { display: block; overflow-x: auto; max-width: 100%; }
.prose code.inline { white-space: normal !important; overflow-wrap: anywhere; }
.side a { line-height: 1.5; }
.code { min-width: 0; }
body[data-page="playground"] { --nav-h: 72px; }
body[data-page="playground"] .pg-canvas { background-image: radial-gradient(#30323c 1px, transparent 1px); background-size: 24px 24px; }
@media(max-width: 960px) {
  .nav .links { display: none; }
  .nav-toggle { display: block; }
  .nav .container { gap: 16px; }
  .nav .right { gap: 12px; }
  .nav.nav-open .links { position: absolute; display: flex; top: 71px; left: 0; right: 0; flex-direction: column; gap: 0; padding: 12px 24px; background: #101115; border-bottom: 1px solid var(--border); }
  .nav.nav-open .links a { padding: 12px 0; }
  .nav .links a.active::after { display: none; }
}
@media(max-width: 600px) {
  .container { padding-left: 20px; padding-right: 20px; }
  .nav .logo { font-size: 18px; gap: 7px; }
  .agent-link { display: none; }
  .footer-note { display: block; margin: 7px 0 0; }
  .footer .links { margin-left: 0; }
  .footer .container { gap: 20px; }
}
@media(prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation-iteration-count: 1 !important; } }
.pg-editor-note { font-size: 11px; color: var(--dim); margin: 0 0 10px; line-height: 1.6; }
@media(max-width: 860px) { body[data-page="playground"] .pg-canvas { min-height: 450px; padding: 70px 12px 25px; } .pg-panel { width: 100% !important; } .pg-editor { min-height: 280px; } .pg-toolbar { top: 16px; right: 15px; gap: 8px; } .pg-toolbar .btn { font-size: 11px; padding: 0 10px; } }
