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

:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-light: #e0e7ff;
  --text: #1a1a2e;
  --text-muted: #64648b;
  --bg: #ffffff;
  --bg-alt: #f8f9fc;
  --border: #e2e4ed;
  --radius: 10px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.section-sub {
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  font-size: 1.05rem;
}

/* === Navigation === */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-weight: 700;
  font-size: 1.15rem;
  text-decoration: none;
  color: var(--text);
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

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

/* === Buttons === */
.btn {
  display: inline-block;
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary-light);
}

/* === Hero === */
#hero {
  padding: 8rem 0 5rem;
  text-align: center;
  background: linear-gradient(170deg, var(--bg) 60%, var(--primary-light) 100%);
}

.hero-content h1 {
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1.25rem;
}

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

.hero-content .btn {
  margin: 0 0.4rem;
}

/* === How it Works === */
#how-it-works {
  padding: 5rem 0;
  background: var(--bg-alt);
  text-align: center;
}

/* Hierarchy */
.hierarchy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  margin-bottom: 3rem;
}

.agent-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  width: 220px;
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.agent-card h3 {
  font-size: 1rem;
  margin: 0.4rem 0 0.3rem;
}

.agent-card p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.agent-icon {
  font-size: 1.6rem;
}

.agent-card.ceo {
  border-top: 3px solid #f59e0b;
}

.agent-card.cto {
  border-top: 3px solid var(--primary);
}

.agent-card.engineer {
  border-top: 3px solid #10b981;
}

.hierarchy-line {
  width: 2px;
  height: 28px;
  background: var(--border);
}

.agent-row {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
}

/* Steps */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  text-align: left;
}

.step {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 0.6rem;
}

.step h4 {
  margin-bottom: 0.3rem;
  font-size: 1rem;
}

.step p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* === Use Cases === */
#use-cases {
  padding: 5rem 0;
  text-align: center;
}

.cases-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  text-align: left;
}

.case-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
}

.case-icon {
  font-size: 1.8rem;
  margin-bottom: 0.6rem;
}

.case-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}

.case-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* === Architecture === */
#architecture {
  padding: 5rem 0;
  background: var(--bg-alt);
  text-align: center;
}

.arch-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  text-align: left;
}

.arch-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.arch-block h4 {
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
}

.arch-block p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* === Live Demo === */
#demo {
  padding: 5rem 0;
  text-align: center;
}

.demo-wrapper {
  max-width: 520px;
  margin: 0 auto;
  text-align: left;
}

#task-form {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

#task-input {
  flex: 1;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: inherit;
}

#task-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

#task-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.task-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  background: var(--bg-alt);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.task-item.done .task-title {
  text-decoration: line-through;
  color: #999;
}

.task-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--primary);
}

.task-title {
  flex: 1;
  font-size: 0.95rem;
}

.task-delete {
  background: none;
  border: none;
  color: #bbb;
  cursor: pointer;
  font-size: 1.15rem;
  padding: 0 0.3rem;
  line-height: 1;
  transition: color 0.2s;
}

.task-delete:hover {
  color: #e53e3e;
}

.loading {
  text-align: center;
  color: var(--text-muted);
  padding: 1rem 0;
}

.demo-footer {
  margin-top: 0.75rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* === Site Footer === */
#site-footer {
  padding: 3rem 0;
  text-align: center;
  background: var(--text);
  color: #ccc;
  font-size: 0.9rem;
}

#site-footer .footer-small {
  margin-top: 0.4rem;
  font-size: 0.8rem;
  color: #888;
}

/* === Responsive === */
@media (max-width: 768px) {
  .hero-content h1 {
    font-size: 2rem;
  }

  .nav-links {
    display: none;
  }

  .steps,
  .cases-grid,
  .arch-grid {
    grid-template-columns: 1fr;
  }

  .agent-row {
    flex-direction: column;
    align-items: center;
  }
}
