:root {
  --bg: #0d0f12;
  --bg-elevated: #161a20;
  --border: #2a313c;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --accent: #f59e0b;
  --accent-dim: #d97706;
  --success: #22c55e;
  --radius: 10px;
  --font-sans: 'DM Sans', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Glow orbs */
.glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
}
.glow-1 { width: 400px; height: 400px; background: var(--accent); top: -100px; right: -100px; animation: float 12s ease-in-out infinite; }
.glow-2 { width: 300px; height: 300px; background: var(--accent-dim); bottom: 20%; left: -80px; animation: float 10s ease-in-out infinite reverse; }
@keyframes float { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(20px, 20px); } }

.page-width { max-width: 720px; margin: 0 auto; padding: 0 1.5rem; position: relative; z-index: 1; }

/* Hero */
.hero {
  text-align: center;
  padding: 3rem 1.5rem 4rem;
  position: relative;
  z-index: 1;
}
.hero-diagram {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}
.diagram-node {
  padding: 0.6rem 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  animation: node-pop 0.5s ease-out backwards;
}
.diagram-node.node-a { animation-delay: 0.1s; }
.diagram-node.node-b { animation-delay: 0.3s; }
.diagram-node.node-c { animation-delay: 0.5s; }
.diagram-arrow {
  width: 24px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-dim));
  opacity: 0.7;
  animation: arrow-pulse 1.5s ease-in-out infinite;
}
.diagram-arrow.a-b { animation-delay: 0.2s; }
.diagram-arrow.b-c { animation-delay: 0.4s; }
@keyframes node-pop { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }
@keyframes arrow-pulse { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }

.title {
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  font-weight: 700;
  margin: 0 0 0.75rem;
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.title-brand { color: var(--accent); }
.tagline {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 28rem;
  margin: 0 auto;
  line-height: 1.65;
}

.section-title {
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0 0 1rem;
}

/* Demo terminal */
.demo, .product-preview, .install, .features, .docs-cta {
  padding: 2.5rem 0;
  border-top: 1px solid var(--border);
}

.hidden { display: none !important; }

.demo-terminal {
  background: #0a0c0f;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  height: 320px;
  display: flex;
  flex-direction: column;
}
.terminal-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.demo-terminal .terminal-body-inner {
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  min-height: 0;
  padding: 1rem 1.25rem;
  scroll-behavior: smooth;
}
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}
.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
}
.terminal-dot:first-child { background: #ef4444; }
.terminal-dot:nth-child(2) { background: #f59e0b; }
.terminal-dot:nth-child(3) { background: #22c55e; }
.terminal-title { margin-left: 0.5rem; font-size: 0.8rem; color: var(--text-muted); }
.terminal-body { padding: 1rem 1.25rem; }
.terminal-line { font-family: var(--font-mono); font-size: 0.85rem; }
.terminal-line .prompt { color: var(--text-muted); margin-right: 0.5rem; }
.terminal-line .typed { color: var(--accent); }
.terminal-line .cursor { display: inline-block; width: 2px; height: 1em; background: var(--accent); margin-left: 2px; animation: blink 0.8s step-end infinite; vertical-align: text-bottom; }
@keyframes blink { 50% { opacity: 0; } }
.terminal-line.output { margin-top: 0.75rem; opacity: 0; }
.terminal-line.output.visible { opacity: 1; transition: opacity 0.4s; }
.terminal-line .success { color: var(--success); }
.terminal-line.workflow-label { color: var(--text-muted); font-size: 0.9rem; margin-top: 1rem; }

.workflow-steps { margin-top: 1rem; }
.step-row { margin-top: 0.75rem; }
.step-call { font-size: 0.85rem; margin-bottom: 0.35rem; }
.step-badge {
  display: inline-block;
  width: 1.2em;
  height: 1.2em;
  line-height: 1.2em;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 600;
  background: var(--accent);
  color: var(--bg);
  border-radius: 4px;
  margin-right: 0.5rem;
}
.step-call code { color: var(--accent); font-size: 0.8rem; }
.step-args { color: var(--text-muted); font-size: 0.8rem; }
.step-output {
  margin-left: 1.7rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-left: 2px solid var(--border);
  padding-left: 0.75rem;
  opacity: 0;
}
.step-output.visible { opacity: 1; }
.output-line { padding: 0.15rem 0; }
.step-flow {
  margin: 0.5rem 0 0.5rem 1.7rem;
  font-size: 0.78rem;
  color: var(--accent);
  opacity: 0;
  max-width: 100%;
}
.step-flow.visible {
  opacity: 1;
  animation: step-flow-in 0.4s ease-out;
}
@keyframes step-flow-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

.demo-caption { font-size: 0.9rem; color: var(--text-muted); margin-top: 1rem; margin-bottom: 0; }

/* Workflow code - removed, now in demo */
.workflow-code {
  background: #0a0c0f;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--text);
}
.workflow-code code { color: var(--text); }
.workflow-code .str { color: #7ee787; }
.workflow-code .key { color: #79c0ff; }
.workflow-code .num { color: #79c0ff; }
.workflow-code .hl { color: var(--accent); font-weight: 500; }

/* UI tabs section */
.ui-intro { color: var(--text-muted); margin-bottom: 1.5rem; font-size: 1rem; }
.ui-tabs-wrap {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.ui-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.35rem;
  padding: 1rem 1.25rem;
  background: rgba(0,0,0,0.25);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.ui-tab {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1rem;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text-muted);
  background: none;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}
.ui-tab:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.ui-tab.active { color: var(--accent); background: rgba(245, 158, 11, 0.14); font-weight: 500; }
.ui-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ui-tab-icon { opacity: 0.85; font-size: 0.8em; }
.ui-panels { padding: 1.75rem 1.5rem; min-height: 140px; }
.ui-panel { display: none; }
.ui-panel.active { display: block; animation: panel-fade 0.25s ease-out; }
@keyframes panel-fade { from { opacity: 0; } to { opacity: 1; } }
.ui-panel-lead { color: var(--text); font-size: 1rem; margin: 0 0 1rem; line-height: 1.5; }
.ui-panel p { color: var(--text-muted); margin: 0 0 0.75rem; font-size: 0.95rem; line-height: 1.65; }
.ui-panel p:last-child { margin-bottom: 0; }
.ui-panel-note { font-size: 0.9rem; color: var(--text-muted); opacity: 0.9; }
.ui-panel code { font-size: 0.88em; color: var(--accent); background: rgba(0,0,0,0.35); padding: 0.2rem 0.45rem; border-radius: 5px; font-family: var(--font-mono); }
.ui-panel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.ui-panel-card {
  padding: 1.25rem;
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.ui-panel-card-title { font-weight: 600; color: var(--text); font-size: 0.95rem; margin-bottom: 0.5rem; }
.ui-panel-card p { margin: 0; font-size: 0.9rem; }
.ui-panel-highlight {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 8px;
  margin: 1rem 0;
}
.highlight-label { font-size: 0.8rem; font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-right: 0.25rem; }
.ui-panel-highlight code { background: rgba(0,0,0,0.3); }
.ui-panel-list { margin: 1rem 0 0; padding-left: 1.25rem; color: var(--text-muted); font-size: 0.95rem; }
.ui-panel-list li { margin-bottom: 0.4rem; }

/* Install */
.install-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.install-platform {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  background: rgba(0,0,0,0.2);
  font-size: 0.875rem;
  color: var(--text-muted);
}
.platform-badge { font-weight: 500; color: var(--text); }
.platform-switch {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  font-size: 1rem;
  opacity: 0.8;
}
.platform-switch:hover { color: var(--accent); opacity: 1; }
.install-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
}
.install-code {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text);
  overflow-x: auto;
  white-space: nowrap;
}
.btn-copy {
  flex-shrink: 0;
  padding: 0.4rem 0.75rem;
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
}
.btn-copy:hover { background: var(--accent-dim); }
.btn-copy.copied { background: var(--success); }
.install-hint {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0.75rem 0 0;
}

/* Features */
.features-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.features-list li {
  padding: 0.6rem 0;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.features-list li:last-child { border-bottom: none; }
.features-list strong { color: var(--text); }

.docs-cta p { color: var(--text-muted); margin-bottom: 1rem; }
.btn-primary {
  display: inline-block;
  padding: 0.6rem 1.25rem;
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.btn-primary:hover { background: var(--accent-dim); }

.footer {
  padding: 3rem 1.5rem 2rem;
  border-top: 1px solid var(--border);
  text-align: center;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem 1.5rem;
  margin-bottom: 1rem;
}
.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
}
.footer-links a:hover { color: var(--accent); }
.footer-copy {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
}
.footer-copy a { color: var(--text-muted); }
.footer-copy a:hover { color: var(--accent); }
