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

:root {
  --bg: #0a0a0a;
  --bg-elevated: #111111;
  --bg-card: #161616;
  --border: #222222;
  --text: #e0e0e0;
  --text-muted: #777777;
  --text-dim: #555555;
  --accent: #00d672;
  --accent-hover: #00ff88;
  --accent-dim: rgba(0, 214, 114, 0.1);
  --code-bg: #0d0d0d;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--accent-hover);
}

code {
  font-family: var(--font-mono);
  background: var(--bg-card);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.88em;
  color: var(--accent);
}

strong {
  color: var(--text);
  font-weight: 600;
}

/* ===== Layout ===== */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 120px 0;
}

.section-dark {
  background: var(--bg-elevated);
}

/* ===== Nav ===== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
}

.logo:hover {
  color: var(--accent);
}

.nav-cta {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 6px 16px;
  border-radius: 6px;
  transition: all 0.2s;
}

.nav-cta:hover {
  background: var(--accent);
  color: var(--bg);
}

/* ===== Hero ===== */
.hero {
  position: relative;
  padding: 180px 0 140px;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero .container {
  position: relative;
  z-index: 2;
}

.hero-headline {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  max-width: 820px;
  margin-bottom: 24px;
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 640px;
  margin-bottom: 40px;
  line-height: 1.7;
}

.hero-graph {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  opacity: 0.3;
  pointer-events: none;
}

#graph-canvas {
  width: 100%;
  height: 100%;
}

/* ===== Waitlist Form ===== */
.waitlist-form {
  display: flex;
  gap: 10px;
  max-width: 460px;
}

.waitlist-form input[type="email"] {
  flex: 1;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.waitlist-form input[type="email"]::placeholder {
  color: var(--text-dim);
}

.waitlist-form input[type="email"]:focus {
  border-color: var(--accent);
}

.waitlist-form button {
  padding: 12px 24px;
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.waitlist-form button:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.waitlist-form button:active {
  transform: translateY(0);
}

.waitlist-form.submitted input,
.waitlist-form.submitted button {
  pointer-events: none;
}

.waitlist-form.submitted button {
  background: var(--text-dim);
}

.waitlist-note {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 12px;
}

/* ===== Section Titles ===== */
.section-title {
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
  max-width: 720px;
}

.section-intro {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 700px;
  line-height: 1.7;
  margin-bottom: 48px;
}

.section-body {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 640px;
  line-height: 1.7;
  margin-bottom: 16px;
}

.section-body.muted {
  color: var(--text-dim);
}

.subsection-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 20px;
  margin-top: 48px;
}

/* ===== Cards ===== */
.card-grid {
  display: grid;
  gap: 20px;
}

.card-grid.three-col {
  grid-template-columns: repeat(3, 1fr);
}

.card-grid.two-col {
  grid-template-columns: repeat(2, 1fr);
}

.card-grid.five-col {
  grid-template-columns: repeat(6, 1fr);
}

.card-grid.five-col > .card:nth-child(1),
.card-grid.five-col > .card:nth-child(2),
.card-grid.five-col > .card:nth-child(3) {
  grid-column: span 2;
}

.card-grid.five-col > .card:nth-child(4) {
  grid-column: 2 / span 2;
}

.card-grid.five-col > .card:nth-child(5) {
  grid-column: 4 / span 2;
}

.card-grid.feature-grid {
  grid-template-columns: repeat(6, 1fr);
}

.card-grid.feature-grid > .card:nth-child(1),
.card-grid.feature-grid > .card:nth-child(2),
.card-grid.feature-grid > .card:nth-child(3) {
  grid-column: span 2;
}

.card-grid.feature-grid > .card:nth-child(4) {
  grid-column: 2 / span 2;
}

.card-grid.feature-grid > .card:nth-child(5) {
  grid-column: 4 / span 2;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  transition: border-color 0.3s;
}

.card:hover {
  border-color: #333;
}

.card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.card p {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.65;
}

.card-icon {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  color: var(--accent);
  margin-bottom: 16px;
  font-weight: 700;
}

.card-code {
  margin-top: 20px;
}

.card-code pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  overflow-x: auto;
  font-size: 0.82rem;
  line-height: 1.6;
}

.card-code code {
  background: none;
  padding: 0;
  color: var(--text);
  font-size: inherit;
}

/* ===== Code Blocks ===== */
.code-hero {
  margin-bottom: 40px;
}

.code-block {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.code-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border);
}

.code-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.code-dot.red { background: #ff5f57; }
.code-dot.yellow { background: #febc2e; }
.code-dot.green { background: #28c840; }

.code-filename {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-left: 8px;
}

.code-block pre {
  padding: 24px;
  overflow-x: auto;
  font-size: 0.88rem;
  line-height: 1.7;
}

.code-block code {
  background: none;
  padding: 0;
  color: var(--text);
  font-size: inherit;
}

/* Syntax highlighting */
.kw { color: #c678dd; }
.fn { color: #61afef; }
.str { color: #98c379; }
.cm { color: #5c6370; }
.num { color: #d19a66; }
.mod { color: #e5c07b; }

.annotation-note {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-top: 32px;
  padding-left: 16px;
  border-left: 2px solid var(--accent);
  line-height: 1.65;
}

/* ===== Agent Conversations ===== */
.agent-intro {
  font-size: 1.05rem;
  color: var(--text);
  margin-bottom: 32px;
}

.conversation-stack {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 40px;
}

.conversation {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.conv-user {
  padding: 16px 24px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}

.conv-agent {
  padding: 16px 24px;
}

.conv-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  display: inline-block;
  margin-right: 12px;
  min-width: 80px;
}

.conv-call {
  padding: 6px 0;
  font-size: 0.88rem;
}

.conv-call code {
  font-size: 0.84rem;
}

.conv-result {
  padding: 12px 16px;
  margin: 8px 0;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.conv-arrow {
  color: var(--accent);
  margin-right: 8px;
}

.conv-response {
  padding: 8px 0 4px;
  font-size: 0.92rem;
  color: var(--text);
}

/* ===== Architecture Diagram ===== */
.architecture-diagram {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 40px;
  overflow-x: auto;
  padding: 40px 0;
}

.arch-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 160px;
}

.arch-center {
  align-items: center;
}

.arch-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.arch-node {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 20px;
  font-size: 0.88rem;
  font-family: var(--font-mono);
  text-align: center;
}

.arch-node.accent {
  border-color: rgba(0, 214, 114, 0.3);
  background: var(--accent-dim);
}

.arch-node code {
  background: none;
  padding: 0;
  font-size: inherit;
}

.arch-sub {
  display: block;
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 4px;
}

.arch-arrow {
  color: var(--text-dim);
  flex-shrink: 0;
}

.arch-arrow svg {
  width: 48px;
  height: 24px;
}

.arch-flow {
  display: flex;
  justify-content: center;
}

.arch-flow svg {
  width: 24px;
  height: 24px;
  color: var(--accent);
}

/* ===== Tool Table ===== */
.tool-category {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 16px;
  margin-top: 40px;
  font-family: var(--font-mono);
}

.tool-category:first-of-type {
  margin-top: 24px;
}

.tool-table {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 8px;
}

.tool-row {
  display: grid;
  grid-template-columns: 220px 1fr 1fr;
  border-bottom: 1px solid var(--border);
}

.tool-row:last-child {
  border-bottom: none;
}

.tool-header {
  background: rgba(255, 255, 255, 0.02);
}

.tool-header .tool-name,
.tool-header .tool-desc,
.tool-header .tool-example {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}

.tool-name {
  padding: 12px 16px;
  border-right: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.tool-name code {
  background: none;
  padding: 0;
  color: var(--accent);
  font-size: inherit;
}

.tool-desc {
  padding: 12px 16px;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-right: 1px solid var(--border);
}

.tool-example {
  padding: 12px 16px;
  color: var(--text-dim);
  font-size: 0.82rem;
  font-family: var(--font-mono);
}

.tool-example code {
  background: none;
  padding: 0;
  font-size: inherit;
}

/* ===== Cross-System Sync Demo ===== */
.sync-demo {
  margin: 40px 0;
  max-width: 700px;
}

.safety-note {
  margin-top: 40px;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.safety-note h3 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--accent);
}

.safety-note p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* ===== Connect Table ===== */
.connect-table {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 8px;
}

.connect-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  border-bottom: 1px solid var(--border);
}

.connect-row:last-child {
  border-bottom: none;
}

.connect-header {
  background: rgba(255, 255, 255, 0.02);
}

.connect-header .connect-have,
.connect-header .connect-pass {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}

.connect-have {
  padding: 12px 16px;
  border-right: 1px solid var(--border);
  font-weight: 500;
  font-size: 0.9rem;
}

.connect-pass {
  padding: 12px 16px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.connect-pass code {
  font-size: 0.82rem;
}

/* ===== Domain Grid ===== */
.domain-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.domain-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
}

.domain-name {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 6px;
}

.domain-systems {
  font-size: 0.82rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  margin-bottom: 8px;
}

.domain-connects {
  font-size: 0.85rem;
  color: var(--accent);
  font-family: var(--font-mono);
}

/* ===== Install Block ===== */
.install-block {
  max-width: 400px;
  margin-top: 32px;
}

/* ===== CTA Section ===== */
.section-cta {
  text-align: center;
  padding: 140px 0;
  background: radial-gradient(ellipse at center top, rgba(0, 214, 114, 0.06) 0%, transparent 60%), var(--bg);
}

.section-cta .section-title {
  max-width: none;
}

.section-cta .hero-sub {
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
}

.section-cta .waitlist-form {
  margin: 0 auto;
  justify-content: center;
}

.section-cta .waitlist-note {
  text-align: center;
}

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

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

.footer-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer-tagline {
  font-size: 0.82rem;
  color: var(--text-dim);
}

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

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

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

/* ===== Animations ===== */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .card-grid.three-col,
  .card-grid.five-col,
  .card-grid.feature-grid {
    grid-template-columns: 1fr;
  }

  .card-grid.five-col > .card,
  .card-grid.feature-grid > .card {
    grid-column: auto !important;
  }

  .card-grid.two-col {
    grid-template-columns: 1fr;
  }

  .domain-grid {
    grid-template-columns: 1fr;
  }

  .architecture-diagram {
    flex-direction: column;
    gap: 8px;
  }

  .arch-arrow svg {
    transform: rotate(90deg);
  }

  .tool-row {
    grid-template-columns: 1fr;
  }

  .tool-name {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .tool-desc {
    border-right: none;
  }

  .connect-row {
    grid-template-columns: 1fr;
  }

  .connect-have {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .footer-inner {
    flex-direction: column;
    gap: 24px;
    text-align: center;
  }

  .footer-brand {
    flex-direction: column;
    gap: 8px;
  }
}

@media (max-width: 600px) {
  .section {
    padding: 80px 0;
  }

  .hero {
    padding: 140px 0 100px;
  }

  .waitlist-form {
    flex-direction: column;
  }

  .section-title {
    margin-bottom: 20px;
  }
}
