/* ─── Reset & Base ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:         #0d0d1a;
  --bg-card:    #13131f;
  --bg-card2:   #1a1a2e;
  --border:     rgba(255,255,255,0.08);
  --border-glow:rgba(108,99,255,0.4);
  --primary:    #6c63ff;
  --primary-lt: #a78bfa;
  --accent:     #00d4aa;
  --danger:     #ff6b6b;
  --text:       #e2e2f0;
  --text-dim:   #7a7a9a;
  --text-code:  #a78bfa;
  --green:      #22c55e;
  --red:        #ef4444;
  --radius:     12px;
  --radius-lg:  20px;
  --shadow:     0 4px 32px rgba(0,0,0,0.5);
  --font:       'Inter', system-ui, sans-serif;
  --font-mono:  'JetBrains Mono', 'Fira Code', monospace;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary-lt); text-decoration: none; }
a:hover { color: var(--primary); }

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: rgba(108,99,255,0.15);
  color: var(--text-code);
  padding: 2px 6px;
  border-radius: 4px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ─── Header ───────────────────────────────────────────────────────────── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13,13,26,0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
}

.logo-icon { font-size: 1.4rem; }
.logo-accent { color: var(--primary-lt); }

.wab-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  background: rgba(108,99,255,0.2);
  color: var(--primary-lt);
  border: 1px solid rgba(108,99,255,0.4);
  letter-spacing: 0.04em;
}

.nav { display: flex; align-items: center; gap: 4px; }

.nav-link {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-dim);
  transition: all 0.2s;
}
.nav-link:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.nav-link--code {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--primary-lt);
  background: rgba(108,99,255,0.1);
  border: 1px solid rgba(108,99,255,0.2);
}
.nav-link--code:hover { background: rgba(108,99,255,0.2); color: var(--primary-lt); }

/* ─── Buttons ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
  white-space: nowrap;
}

.btn--primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 0 20px rgba(108,99,255,0.4);
}
.btn--primary:hover {
  background: #7c73ff;
  box-shadow: 0 0 32px rgba(108,99,255,0.6);
  transform: translateY(-1px);
  color: #fff;
}

.btn--ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn--ghost:hover {
  border-color: var(--primary);
  color: var(--primary-lt);
  background: rgba(108,99,255,0.08);
}

.btn--lg { padding: 14px 28px; font-size: 1rem; }
.btn--sm { padding: 6px 14px; font-size: 0.8rem; }

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ─── Hero ─────────────────────────────────────────────────────────────── */
.hero {
  padding: 100px 0 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -200px; left: 50%;
  transform: translateX(-50%);
  width: 800px; height: 600px;
  background: radial-gradient(ellipse, rgba(108,99,255,0.15) 0%, transparent 70%);
  pointer-events: none;
}

.hero-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 20px;
  background: rgba(108,99,255,0.15);
  border: 1px solid rgba(108,99,255,0.3);
  color: var(--primary-lt);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 24px;
  letter-spacing: 0.04em;
}

.hero-title {
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

.gradient-text {
  background: linear-gradient(135deg, var(--primary-lt), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-dim);
  max-width: 560px;
  margin: 0 auto 36px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 48px;
  flex-wrap: wrap;
}

.hero-code {
  display: inline-block;
  text-align: left;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 28px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.8;
  color: var(--text-dim);
  max-width: 600px;
  width: 100%;
}

.code-keyword { color: #c792ea; }
.code-string  { color: #c3e88d; }
.code-comment { color: #546e7a; font-style: italic; }

/* ─── Sections ─────────────────────────────────────────────────────────── */
.section { padding: 80px 0; }
.section--dark { background: rgba(0,0,0,0.3); }

.section-header {
  text-align: center;
  margin-bottom: 56px;
}

.section-title {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 800;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.section-subtitle {
  font-size: 1rem;
  color: var(--text-dim);
  max-width: 480px;
  margin: 0 auto;
}

/* ─── Compare Grid ─────────────────────────────────────────────────────── */
.compare-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 768px) {
  .compare-grid { grid-template-columns: 1fr; }
  .compare-divider { text-align: center; }
}

.compare-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 32px;
  border: 1px solid var(--border);
}

.compare-card--bad  { border-color: rgba(239,68,68,0.2); }
.compare-card--good { border-color: rgba(108,99,255,0.3); box-shadow: 0 0 40px rgba(108,99,255,0.08); }

.compare-card__header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.compare-icon { font-size: 1.8rem; }
.compare-card__header h3 { font-size: 1.1rem; font-weight: 700; }

.compare-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-dim);
  padding-top: 80px;
}

.compare-list { list-style: none; display: flex; flex-direction: column; gap: 12px; }

.compare-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9rem;
  line-height: 1.5;
}

.compare-list li.bad::before  { content: '✗'; color: var(--red); font-weight: 700; flex-shrink: 0; margin-top: 1px; }
.compare-list li.good::before { content: '✓'; color: var(--green); font-weight: 700; flex-shrink: 0; margin-top: 1px; }

/* ─── Products Grid ────────────────────────────────────────────────────── */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.25s;
  cursor: pointer;
}

.product-card:hover {
  border-color: var(--border-glow);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(108,99,255,0.15);
}

.product-image {
  width: 100%;
  height: 180px;
  background: var(--bg-card2);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.product-image img { width: 100%; height: 100%; object-fit: contain; }

.product-body { padding: 20px; }

.product-category {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary-lt);
  margin-bottom: 6px;
}

.product-name {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.3;
}

.product-desc {
  font-size: 0.83rem;
  color: var(--text-dim);
  margin-bottom: 14px;
  line-height: 1.5;
}

.product-rating {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  font-size: 0.82rem;
  color: var(--text-dim);
}

.stars { color: #fbbf24; }

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.product-price {
  display: flex;
  flex-direction: column;
}

.price-current {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
}

.price-original {
  font-size: 0.8rem;
  color: var(--text-dim);
  text-decoration: line-through;
}

.price-badge {
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(34,197,94,0.15);
  color: var(--green);
  border: 1px solid rgba(34,197,94,0.3);
  padding: 2px 8px;
  border-radius: 20px;
}

.product-id {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.product-skeleton {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  height: 360px;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ─── Agent Panel ──────────────────────────────────────────────────────── */
.agent-layout {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 32px;
  align-items: start;
}

@media (max-width: 900px) {
  .agent-layout { grid-template-columns: 1fr; }
}

/* Scenario */
.agent-scenario {
  background: rgba(108,99,255,0.08);
  border: 1px solid rgba(108,99,255,0.2);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
}

.agent-scenario__title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary-lt);
  margin-bottom: 8px;
}

.agent-scenario__desc {
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.6;
  font-style: italic;
}

/* Steps */
.agent-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

.agent-step {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: all 0.3s;
}

.agent-step.active {
  border-color: var(--primary);
  background: rgba(108,99,255,0.1);
  box-shadow: 0 0 16px rgba(108,99,255,0.15);
}

.agent-step.done {
  border-color: rgba(34,197,94,0.3);
  background: rgba(34,197,94,0.05);
}

.step-icon { font-size: 1.2rem; width: 28px; text-align: center; flex-shrink: 0; }

.step-content { flex: 1; }
.step-title { font-size: 0.88rem; font-weight: 600; }
.step-desc { font-size: 0.78rem; color: var(--text-dim); font-family: var(--font-mono); }

.step-status { font-size: 1rem; flex-shrink: 0; }
.agent-step.active .step-status { animation: spin 1s linear infinite; display: inline-block; }
.agent-step.done .step-status::after { content: '✅'; }

@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* Buttons */
.agent-buttons {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

/* Result */
.agent-result {
  background: rgba(34,197,94,0.08);
  border: 1px solid rgba(34,197,94,0.3);
  border-radius: var(--radius);
  padding: 20px;
}

.agent-result.error {
  background: rgba(239,68,68,0.08);
  border-color: rgba(239,68,68,0.3);
}

.result-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--green);
  margin-bottom: 10px;
}

.result-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.result-item:last-child { border-bottom: none; }
.result-label { color: var(--text-dim); }
.result-value { font-weight: 600; font-family: var(--font-mono); font-size: 0.82rem; }

/* Terminal */
.agent-terminal {
  background: #0a0a14;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  min-height: 500px;
  display: flex;
  flex-direction: column;
}

.terminal-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: rgba(255,255,255,0.04);
  border-bottom: 1px solid var(--border);
}

.terminal-dots { display: flex; gap: 6px; }
.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot--red    { background: #ff5f57; }
.dot--yellow { background: #febc2e; }
.dot--green  { background: #28c840; }

.terminal-title {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  text-align: center;
}

.terminal-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 20px;
  background: rgba(255,255,255,0.08);
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.terminal-badge.running {
  background: rgba(108,99,255,0.2);
  color: var(--primary-lt);
  animation: blink 1s ease-in-out infinite;
}

.terminal-badge.done {
  background: rgba(34,197,94,0.2);
  color: var(--green);
}

@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

.terminal-body {
  flex: 1;
  padding: 20px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.8;
  overflow-y: auto;
  max-height: 560px;
}

.terminal-line { white-space: pre-wrap; word-break: break-all; }
.terminal-line--dim     { color: #546e7a; }
.terminal-line--info    { color: var(--text-dim); }
.terminal-line--ok      { color: var(--green); }
.terminal-line--warn    { color: #fbbf24; }
.terminal-line--error   { color: var(--red); }
.terminal-line--primary { color: var(--primary-lt); }
.terminal-line--bold    { color: var(--text); font-weight: 600; }
.terminal-line--sep     { color: #2d2d44; }

/* ─── WAB JSON Preview ─────────────────────────────────────────────────── */
.wab-preview {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.wab-preview__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border);
}

.wab-preview__url {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--primary-lt);
}

.wab-preview__code {
  padding: 24px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.7;
  color: var(--text-dim);
  overflow-x: auto;
  max-height: 500px;
  overflow-y: auto;
  white-space: pre;
}

/* ─── Footer ───────────────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-brand p {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: 4px;
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  font-size: 0.88rem;
  color: var(--text-dim);
  transition: color 0.2s;
}

.footer-links a:hover { color: var(--primary-lt); }

/* ─── Scrollbar ────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }
