/* ============================================================
   Botdox Homepage — Dual-Audience Styles
   ============================================================ */

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

:root {
  /* Human mode */
  --h-primary: #2563eb;
  --h-primary-hover: #1d4ed8;
  --h-bg: #ffffff;
  --h-bg-alt: #f8fafc;
  --h-text: #1e293b;
  --h-text-muted: #64748b;
  --h-border: #e2e8f0;
  --h-card-bg: #ffffff;

  /* Agent mode */
  --a-bg: #0f172a;
  --a-bg-alt: #1e293b;
  --a-primary: #10b981;
  --a-primary-hover: #059669;
  --a-text: #e2e8f0;
  --a-text-muted: #94a3b8;
  --a-border: #334155;
  --a-card-bg: #1e293b;

  --transition: 0.3s ease;
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  transition: background-color var(--transition), color var(--transition);
}

/* --- Mode: Human (default) --- */
body.mode-human {
  background: var(--h-bg);
  color: var(--h-text);
}

body.mode-human .agent-view { display: none; }
body.mode-human .human-view { display: block; }

/* --- Mode: Agent --- */
body.mode-agent {
  background: var(--a-bg);
  color: var(--a-text);
}

body.mode-agent .human-view { display: none; }
body.mode-agent .agent-view { display: block; }

/* --- Container --- */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ============================================================
   Toggle Bar (sticky)
   ============================================================ */
.toggle-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  padding: 0.75rem 1rem;
  transition: background-color var(--transition);
}

body.mode-human .toggle-bar { background: #f1f5f9; border-bottom: 1px solid var(--h-border); }
body.mode-agent .toggle-bar { background: #020617; border-bottom: 1px solid var(--a-border); }

.toggle-pills {
  display: inline-flex;
  border-radius: 9999px;
  overflow: hidden;
  border: 2px solid transparent;
  transition: border-color var(--transition);
}

body.mode-human .toggle-pills { border-color: var(--h-primary); }
body.mode-agent .toggle-pills { border-color: var(--a-primary); }

.toggle-pill {
  padding: 0.5rem 1.25rem;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background-color var(--transition), color var(--transition);
  background: transparent;
}

/* Human pill states */
body.mode-human .toggle-pill[data-mode="human"] {
  background: var(--h-primary);
  color: #fff;
}
body.mode-human .toggle-pill[data-mode="agent"] {
  background: transparent;
  color: var(--h-primary);
}

/* Agent pill states */
body.mode-agent .toggle-pill[data-mode="agent"] {
  background: var(--a-primary);
  color: #0f172a;
}
body.mode-agent .toggle-pill[data-mode="human"] {
  background: transparent;
  color: var(--a-primary);
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  padding: 5rem 0 4rem;
  text-align: center;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1rem;
}

.hero .subtitle {
  font-size: clamp(1rem, 2.5vw, 1.35rem);
  max-width: 640px;
  margin: 0 auto 2rem;
  line-height: 1.5;
}

body.mode-human .hero .subtitle { color: var(--h-text-muted); }
body.mode-agent .hero .subtitle { color: var(--a-text-muted); }

.hero-ctas {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* --- Buttons --- */
.btn {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

/* Human buttons */
body.mode-human .btn-primary {
  background: var(--h-primary);
  color: #fff;
  border-color: var(--h-primary);
}
body.mode-human .btn-primary:hover { background: var(--h-primary-hover); border-color: var(--h-primary-hover); }

body.mode-human .btn-secondary {
  background: transparent;
  color: var(--h-primary);
  border-color: var(--h-primary);
}
body.mode-human .btn-secondary:hover { background: var(--h-primary); color: #fff; }

body.mode-human .btn-tertiary {
  background: transparent;
  color: var(--h-text-muted);
  border-color: var(--h-border);
}

/* Agent buttons */
body.mode-agent .btn-primary {
  background: var(--a-primary);
  color: #0f172a;
  border-color: var(--a-primary);
}
body.mode-agent .btn-primary:hover { background: var(--a-primary-hover); border-color: var(--a-primary-hover); }

body.mode-agent .btn-secondary {
  background: transparent;
  color: var(--a-primary);
  border-color: var(--a-primary);
}
body.mode-agent .btn-secondary:hover { background: var(--a-primary); color: #0f172a; }

body.mode-agent .btn-tertiary {
  background: transparent;
  color: var(--a-text-muted);
  border-color: var(--a-border);
}

/* ============================================================
   Sections
   ============================================================ */
.section {
  padding: 4rem 0;
}

body.mode-human .section-alt { background: var(--h-bg-alt); }
body.mode-agent .section-alt { background: var(--a-bg-alt); }

.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  text-align: center;
}

.section-sub {
  text-align: center;
  margin-bottom: 2.5rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

body.mode-human .section-sub { color: var(--h-text-muted); }
body.mode-agent .section-sub { color: var(--a-text-muted); }

/* ============================================================
   Problem/Solution Cards
   ============================================================ */
.ps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.ps-card {
  border-radius: 0.75rem;
  padding: 1.75rem;
  transition: background-color var(--transition), border-color var(--transition);
}

body.mode-human .ps-card {
  background: var(--h-card-bg);
  border: 1px solid var(--h-border);
}
body.mode-agent .ps-card {
  background: var(--a-card-bg);
  border: 1px solid var(--a-border);
}

.ps-card .problem {
  font-size: 0.85rem;
  font-style: italic;
  margin-bottom: 0.75rem;
  opacity: 0.7;
}

.ps-card .solution-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

body.mode-human .ps-card .solution-title { color: var(--h-primary); }
body.mode-agent .ps-card .solution-title { color: var(--a-primary); }

.ps-card .solution-desc {
  font-size: 0.95rem;
  line-height: 1.5;
}

/* ============================================================
   How It Works (Steps)
   ============================================================ */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
  counter-reset: step;
}

.step {
  text-align: center;
  padding: 1.5rem;
}

.step-num {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

body.mode-human .step-num { background: var(--h-primary); color: #fff; }
body.mode-agent .step-num { background: var(--a-primary); color: #0f172a; }

.step h3 { margin-bottom: 0.5rem; }

/* ============================================================
   Stats Bar
   ============================================================ */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1.5rem;
  text-align: center;
  padding: 2rem 0;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
}

body.mode-human .stat-value { color: var(--h-primary); }
body.mode-agent .stat-value { color: var(--a-primary); }

.stat-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

body.mode-human .stat-label { color: var(--h-text-muted); }
body.mode-agent .stat-label { color: var(--a-text-muted); }

/* ============================================================
   Dashboard Preview (wireframe placeholder)
   ============================================================ */
.dashboard-preview {
  border-radius: 0.75rem;
  padding: 3rem 2rem;
  text-align: center;
  margin: 2rem 0;
}

body.mode-human .dashboard-preview {
  background: var(--h-bg-alt);
  border: 2px dashed var(--h-border);
}

.dash-wireframe {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 1rem;
  max-width: 700px;
  margin: 0 auto 1.5rem;
  min-height: 200px;
}

.dash-sidebar, .dash-main {
  border-radius: 0.5rem;
  padding: 1rem;
}

body.mode-human .dash-sidebar {
  background: var(--h-primary);
  color: #fff;
  font-size: 0.8rem;
  text-align: left;
}

body.mode-human .dash-main {
  background: #fff;
  border: 1px solid var(--h-border);
  text-align: left;
  font-size: 0.8rem;
}

.dash-caption {
  font-size: 1rem;
  font-weight: 600;
}

/* ============================================================
   Pricing Teaser
   ============================================================ */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  max-width: 700px;
  margin: 0 auto;
}

.pricing-card {
  border-radius: 0.75rem;
  padding: 2rem;
  text-align: center;
}

body.mode-human .pricing-card {
  background: var(--h-card-bg);
  border: 1px solid var(--h-border);
}

.pricing-card h3 { margin-bottom: 0.5rem; }

.pricing-card .price {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

body.mode-human .pricing-card .price { color: var(--h-primary); }

/* ============================================================
   Code Blocks (Agent mode)
   ============================================================ */
pre.code-block {
  border-radius: 0.5rem;
  padding: 1.5rem;
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.6;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
  margin: 1rem 0;
}

body.mode-agent pre.code-block {
  background: #020617;
  color: #e2e8f0;
  border: 1px solid var(--a-border);
}

body.mode-human pre.code-block {
  background: #1e293b;
  color: #e2e8f0;
}

code {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
  font-size: 0.88em;
}

body.mode-human code:not(pre code) {
  background: #f1f5f9;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
}

body.mode-agent code:not(pre code) {
  background: #334155;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  color: var(--a-primary);
}

/* ============================================================
   AX Principles List
   ============================================================ */
.ax-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.ax-item {
  display: flex;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 0.5rem;
  transition: background-color var(--transition);
}

body.mode-agent .ax-item { background: var(--a-card-bg); border: 1px solid var(--a-border); }
body.mode-human .ax-item { background: var(--h-card-bg); border: 1px solid var(--h-border); }

.ax-num {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

body.mode-agent .ax-num { background: var(--a-primary); color: #0f172a; }
body.mode-human .ax-num { background: var(--h-primary); color: #fff; }

.ax-item strong { display: block; margin-bottom: 0.25rem; }
.ax-item span { font-size: 0.9rem; opacity: 0.8; }

/* ============================================================
   Agent Status Badges
   ============================================================ */
.status-list {
  list-style: none;
  max-width: 500px;
  margin: 0 auto;
}

.status-list li {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--a-border);
}

.status-live {
  color: var(--a-primary);
  font-weight: 600;
}

/* ============================================================
   Tool Table (agents.html)
   ============================================================ */
.tool-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.tool-table th, .tool-table td {
  padding: 0.625rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--a-border);
  font-size: 0.9rem;
}

.tool-table th {
  background: var(--a-bg-alt);
  color: var(--a-primary);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.tool-table td code {
  color: var(--a-primary);
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  padding: 3rem 0;
  text-align: center;
  transition: background-color var(--transition), color var(--transition);
}

body.mode-human .site-footer { background: #1e293b; color: #e2e8f0; }
body.mode-agent .site-footer { background: #020617; color: #94a3b8; }

.site-footer a { color: var(--a-primary); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

.footer-links {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  margin-top: 1rem;
  flex-wrap: wrap;
}

/* ============================================================
   Human Escape Hatch (portal banner)
   ============================================================ */
.human-escape-bar {
  background: #f1f5f9;
  color: #64748b;
  font-size: 0.8rem;
  text-align: center;
  padding: 0.35rem 1rem;
  border-bottom: 1px solid #e2e8f0;
}

.human-escape-bar a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 500;
}

.human-escape-bar a:hover { text-decoration: underline; }

/* ============================================================
   Agents.html (standalone agent page)
   ============================================================ */
.agent-page {
  background: #0f172a;
  color: #e2e8f0;
  min-height: 100vh;
}

.agent-page .beacon-bar {
  background: #10b981;
  color: #0f172a;
  text-align: center;
  padding: 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
}

.agent-page .section-title { color: #e2e8f0; }
.agent-page .section-sub { color: #94a3b8; }

.agent-page .section-alt { background: #1e293b; }

.agent-page a { color: #10b981; }

.agent-page .btn-primary {
  background: #10b981;
  color: #0f172a;
  border-color: #10b981;
}
.agent-page .btn-primary:hover {
  background: #059669;
  border-color: #059669;
}

.agent-page .btn-secondary {
  background: transparent;
  color: #10b981;
  border-color: #10b981;
}
.agent-page .btn-secondary:hover {
  background: #10b981;
  color: #0f172a;
}

.agent-page .btn-tertiary {
  background: transparent;
  color: #94a3b8;
  border-color: #334155;
}

.agent-page pre.code-block {
  background: #020617;
  color: #e2e8f0;
  border: 1px solid #334155;
}

.agent-page code:not(pre code) {
  background: #334155;
  color: #10b981;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
}

.agent-page .ax-item {
  background: #1e293b;
  border: 1px solid #334155;
}

.agent-page .ax-num {
  background: #10b981;
  color: #0f172a;
}

.agent-page .tool-table th {
  background: #1e293b;
  color: #10b981;
}

.agent-page .tool-table td {
  border-bottom-color: #334155;
}

.agent-page .ps-card {
  background: #1e293b;
  border: 1px solid #334155;
}

.agent-page .ps-card .solution-title { color: #10b981; }

.agent-page .status-list li { border-bottom-color: #334155; }
.agent-page .status-live { color: #10b981; }

.agent-page .stat-value { color: #10b981; }
.agent-page .stat-label { color: #94a3b8; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 640px) {
  .hero { padding: 3rem 0 2.5rem; }
  .section { padding: 2.5rem 0; }
  .ps-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .dash-wireframe { grid-template-columns: 1fr; }
  .ax-grid { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; }
  .stats-bar { grid-template-columns: repeat(2, 1fr); }
}
