/* ============================================================
   BizFirstAI — Agentic AI Introduction
   Matches BizFirstAI design language (shared.css extended)
   ============================================================ */

:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface2: #22263a;
  --border: #2e3250;
  --accent: #6c8cff;
  --accent2: #a78bfa;
  --accent3: #34d399;
  --accent4: #fbbf24;
  --accent5: #f87171;
  --cyan: #00c8ff;
  --text: #e2e8f0;
  --text-muted: #8892b0;
  --text-dim: #4a5568;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Segoe UI', system-ui, sans-serif; background: var(--bg); color: var(--text); line-height: 1.65; font-size: 15px; padding-top: 40px; }

/* ── Topbar ── */
.bfai-topbar { position: fixed; top: 0; left: 0; right: 0; z-index: 200; background: #1e2736; border-bottom: 1px solid #2d3a4a; height: 40px; display: flex; align-items: center; padding: 0 20px; }
.bfai-topbar-logo img { height: 26px; display: block; }
.bfai-topbar-right { margin-left: auto; display: flex; gap: 6px; }
.bfai-topbar-right a { font-size: 12px; color: #b0c4d8; text-decoration: none; padding: 4px 12px; border-radius: 5px; display: flex; align-items: center; gap: 6px; transition: background 0.15s, color 0.15s; }
.bfai-topbar-right a:hover { background: rgba(255,255,255,0.08); color: #fff; }

/* ── Layout ── */
.layout { display: flex; min-height: calc(100vh - 40px); }

/* ── Sidebar ── */
.sidebar { width: 240px; flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--border); padding: 24px 0; position: sticky; top: 40px; height: calc(100vh - 40px); overflow-y: auto; }
.logo { padding: 0 20px 20px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.logo h2 { font-size: 0.7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.logo h1 { font-size: 0.95rem; font-weight: 700; color: var(--text); }
.sidebar .section-label { font-size: 0.65rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--text-dim); padding: 12px 20px 5px; display: block; }
.sidebar a { display: block; padding: 7px 20px; color: var(--text-muted); text-decoration: none; font-size: 0.855rem; border-left: 3px solid transparent; transition: all .15s; }
.sidebar a:hover { color: var(--text); background: var(--surface2); }
.sidebar a.active { color: var(--accent); border-left-color: var(--accent); background: rgba(108,140,255,.08); }

/* ── Main Content ── */
.content { flex: 1; max-width: 900px; padding: 48px 52px; }
.page-header { margin-bottom: 40px; }
.page-header .tag { display: inline-block; font-size: 0.7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; padding: 3px 10px; border-radius: 20px; background: rgba(108,140,255,.15); color: var(--accent); margin-bottom: 12px; }
.page-header h1 { font-size: 1.9rem; font-weight: 700; color: var(--text); margin-bottom: 12px; line-height: 1.2; }
.lead { font-size: 1rem; color: var(--text-muted); line-height: 1.7; max-width: 680px; }

h2 { font-size: 1.2rem; font-weight: 700; color: var(--text); margin: 38px 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
h3 { font-size: 0.95rem; font-weight: 700; color: var(--accent2); margin: 24px 0 10px; }
h4 { font-size: 0.9rem; font-weight: 700; color: var(--text); margin: 18px 0 8px; }
p { color: var(--text-muted); margin-bottom: 14px; }
ul, ol { color: var(--text-muted); padding-left: 22px; margin-bottom: 14px; }
li { margin-bottom: 5px; }
strong { color: var(--text); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: 'Cascadia Code', 'Fira Code', monospace; font-size: 0.84em; background: var(--surface2); color: #93c5fd; padding: 2px 5px; border-radius: 4px; }

/* ── Tables ── */
table { width: 100%; border-collapse: collapse; margin: 16px 0 28px; font-size: 0.875rem; }
th { background: var(--surface2); color: var(--text); font-weight: 600; text-align: left; padding: 10px 14px; border-bottom: 2px solid var(--border); }
td { padding: 9px 14px; border-bottom: 1px solid var(--border); color: var(--text-muted); vertical-align: top; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,.02); }

/* ── Callouts ── */
.callout { border-radius: 8px; padding: 14px 18px; margin: 20px 0; border-left: 4px solid; }
.callout p, .callout ul { margin-bottom: 0; }
.callout strong { display: block; margin-bottom: 4px; }
.callout.info { background: rgba(96,165,250,.08); border-color: #60a5fa; }
.callout.info strong { color: #60a5fa; }
.callout.success { background: rgba(52,211,153,.08); border-color: #34d399; }
.callout.success strong { color: #34d399; }
.callout.tip { background: rgba(108,140,255,.08); border-color: var(--accent); }
.callout.tip strong { color: var(--accent); }

/* ── Pipeline Steps ── */
.pipeline { margin: 20px 0 32px; }
.pipeline-step { display: flex; gap: 16px; margin-bottom: 4px; }
.connector { display: flex; flex-direction: column; align-items: center; flex-shrink: 0; }
.dot { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; font-weight: 700; flex-shrink: 0; }
.dot.green  { background: var(--accent3); color: #000; }
.dot.purple { background: var(--accent2); color: #000; }
.dot.amber  { background: var(--accent4); color: #000; }
.dot.red    { background: var(--accent5); }
.dot.cyan   { background: var(--cyan); color: #000; }
.dot.muted  { background: var(--surface2); border: 1px solid var(--border); color: var(--text-muted); }
.line { width: 2px; background: var(--border); flex: 1; min-height: 16px; margin: 3px 0; }
.pipeline-step .body { padding-bottom: 24px; flex: 1; }
.pipeline-step .body h4 { margin: 4px 0 6px; font-size: 0.9rem; font-weight: 700; color: var(--text); }
.pipeline-step .body p { margin: 0; font-size: 0.875rem; }

/* ── Page Nav ── */
.page-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 60px; padding-top: 24px; border-top: 1px solid var(--border); gap: 12px; }
.page-nav a { color: var(--accent); text-decoration: none; font-size: 0.875rem; font-weight: 600; padding: 8px 14px; border: 1px solid var(--border); border-radius: 6px; transition: all .15s; display: flex; align-items: center; gap: 6px; }
.page-nav a:hover { background: var(--surface2); text-decoration: none; }
.spacer { flex: 1; }

/* ── Mermaid Diagram ── */
.diagram-box { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 28px 20px; margin: 24px 0 32px; overflow-x: auto; }
.diagram-label { font-size: 0.68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 16px; }
.mermaid { display: flex; justify-content: center; min-height: 80px; }

@keyframes edgeFlow { to { stroke-dashoffset: -24; } }

/* ── Screenshot ── */
.screenshot-box { margin: 24px 0 32px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; box-shadow: 0 4px 32px rgba(0,0,0,0.5); }
.screenshot-img { width: 100%; display: block; cursor: zoom-in; transition: filter 0.2s; }
.screenshot-img:hover { filter: brightness(1.06); }
.screenshot-caption { background: var(--surface); border-top: 1px solid var(--border); padding: 10px 16px; font-size: 0.78rem; color: var(--text-dim); display: flex; align-items: center; gap: 8px; }

/* ── Port Cards ── */
.port-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin: 20px 0 32px; }
.port-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 18px; transition: border-color .15s; }
.port-card:hover { border-color: rgba(108,140,255,0.4); }
.port-badge { display: inline-block; font-size: 0.65rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 2px 8px; border-radius: 20px; margin-bottom: 10px; }
.port-badge.runtime { background: rgba(52,211,153,.15); color: var(--accent3); border: 1px solid rgba(52,211,153,.25); }
.port-badge.static  { background: rgba(167,139,250,.15); color: var(--accent2); border: 1px solid rgba(167,139,250,.25); }
.port-icon { margin-bottom: 10px; }
.port-icon svg { width: 20px; height: 20px; }
.port-card h4 { font-size: 0.9rem; font-weight: 700; color: var(--text); margin: 0 0 6px; }
.port-card p { font-size: 0.83rem; margin: 0; }

/* ── Agent Hierarchy Cards ── */
.agent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin: 20px 0 32px; }
.agent-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 20px; border-top: 3px solid; transition: box-shadow .15s; }
.agent-card:hover { box-shadow: 0 4px 24px rgba(0,0,0,0.35); }
.agent-card.base         { border-top-color: var(--accent2); }
.agent-card.orchestrator { border-top-color: var(--accent); }
.agent-card.participant  { border-top-color: var(--accent3); }
.agent-card .role { font-size: 0.68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 8px; }
.agent-card.base         .role { color: var(--accent2); }
.agent-card.orchestrator .role { color: var(--accent); }
.agent-card.participant  .role { color: var(--accent3); }
.agent-card h4 { font-size: 0.95rem; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.agent-card p { font-size: 0.83rem; margin: 0; }

/* ── Layer Cards ── */
.layer-list { display: flex; flex-direction: column; gap: 12px; margin: 20px 0 32px; }
.layer-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 18px 20px; display: flex; gap: 16px; align-items: flex-start; }
.layer-num { font-size: 0.75rem; font-weight: 700; color: var(--accent); background: rgba(108,140,255,.12); border: 1px solid rgba(108,140,255,.25); border-radius: 5px; padding: 3px 10px; white-space: nowrap; margin-top: 2px; }
.layer-card h4 { font-size: 0.9rem; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.layer-card p { font-size: 0.83rem; margin: 0; }

/* ── Node Tags ── */
.node-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 28px; }
.node-tag { background: var(--surface2); border: 1px solid var(--border); border-radius: 6px; padding: 5px 12px; font-size: 0.8rem; color: var(--text-muted); display: flex; align-items: center; gap: 8px; }
.node-tag::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }

/* ── Intro Cards (index page) ── */
.intro-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin: 24px 0 40px; }
.intro-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 24px; text-decoration: none; display: block; color: inherit; transition: border-color .2s, transform .2s, box-shadow .2s; }
.intro-card:hover { border-color: rgba(108,140,255,0.4); transform: translateY(-2px); box-shadow: 0 8px 32px rgba(0,0,0,0.3); text-decoration: none; }
.intro-card-num { font-size: 0.68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
.intro-card-icon { width: 44px; height: 44px; background: rgba(108,140,255,.1); border: 1px solid rgba(108,140,255,.2); border-radius: 10px; display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.intro-card-icon svg { width: 22px; height: 22px; color: var(--accent); }
.intro-card h3 { font-size: 1rem; font-weight: 700; color: var(--text); margin: 0 0 10px; }
.intro-card p { font-size: 0.85rem; margin: 0; line-height: 1.6; }
.intro-card .arrow { display: flex; align-items: center; gap: 6px; margin-top: 18px; font-size: 0.82rem; font-weight: 600; color: var(--accent); }

/* ── Lightbox ── */
.lightbox { position: fixed; inset: 0; z-index: 500; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 0.25s ease; }
.lightbox.open { opacity: 1; pointer-events: all; }
.lb-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.94); }
.lb-content { position: relative; z-index: 1; max-width: 96vw; max-height: 96vh; transform: scale(0.88); transition: transform 0.25s ease; display: flex; flex-direction: column; align-items: flex-end; }
.lightbox.open .lb-content { transform: scale(1); }
.lb-content img { max-width: 100%; max-height: 88vh; display: block; border-radius: 8px; box-shadow: 0 0 80px rgba(0,0,0,0.8); }
.lb-close { margin-bottom: 8px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.2); color: #e2e8f0; width: 30px; height: 30px; border-radius: 5px; cursor: pointer; font-size: 1rem; display: flex; align-items: center; justify-content: center; transition: background .15s; }
.lb-close:hover { background: rgba(255,255,255,.18); }

/* ── Shared script helper ── */
.hint { font-size: 0.75rem; color: var(--text-dim); font-style: italic; }
