/* Capnet landing — academic, industrial, minimal */

:root {
  --bg: #f8f7f4;
  --bg-alt: #eeedeb;
  --text: #1a1a1a;
  --text-muted: #4a4a4a;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --border: #e5e4e0;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "DM Sans", system-ui, sans-serif;
  --wrap: min(90vw, 720px);
  --space: 1.5rem;
  --space-lg: 3rem;
  --space-xl: 5rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--space);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(248, 247, 244, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space);
  padding-bottom: var(--space);
  gap: var(--space);
}

.logo {
  flex-shrink: 0;
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1.5rem;
  flex-wrap: wrap;
  min-width: 0;
}

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

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

.nav-docs { margin-right: 0.25rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.25rem;
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.btn-primary:hover {
  background: var(--text-muted);
  border-color: var(--text-muted);
  color: var(--bg);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  border-color: var(--text-muted);
  color: var(--text);
}

.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover { color: var(--text-muted); }
.btn-lg { padding: 0.85rem 1.75rem; font-size: 1rem; }

.hero {
  padding: var(--space-xl) 0;
  text-align: center;
}

.hero-title {
  font-family: var(--serif);
  font-size: clamp(2.5rem, 8vw, 4rem);
  font-weight: 400;
  margin: 0 0 0.5rem;
  letter-spacing: -0.03em;
  color: var(--text);
}

.hero-tagline {
  font-size: 1.35rem;
  color: var(--text);
  margin: 0 0 0.75rem;
  font-weight: 500;
}

.hero-desc {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 36ch;
  margin: 0 auto 2rem;
  line-height: 1.65;
}

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

.value-strip {
  background: var(--text);
  color: var(--bg);
  padding: var(--space) 0;
}

.strip-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
}

.value-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.value-label {
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.9;
}

.value-product {
  font-family: var(--serif);
  font-size: 1.1rem;
}

.value-divider {
  width: 1px;
  height: 2rem;
  background: rgba(255, 255, 255, 0.3);
  flex-shrink: 0;
}

.section { padding: var(--space-xl) 0; }
.section-alt { background: var(--bg-alt); }

.section-title {
  font-family: var(--serif);
  font-size: 1.75rem;
  font-weight: 400;
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
}

.section-lead {
  font-size: 1.15rem;
  font-weight: 500;
  margin: 0 0 0.75rem;
  color: var(--text);
}

.section-body {
  margin: 0;
  color: var(--text-muted);
  max-width: 60ch;
}

.solution-lead { font-size: 1.25rem; }

.problem-list {
  margin: 1.5rem 0 0;
  padding-left: 1.5rem;
  max-width: 50ch;
}

.problem-list li { margin-bottom: 0.6rem; color: var(--text-muted); }

.steps {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  counter-reset: step;
}

.step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.25rem;
  align-items: start;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
  counter-increment: step;
}

.step:last-child { border-bottom: 0; }

.step-num {
  font-family: var(--serif);
  font-size: 1.5rem;
  color: var(--text-muted);
  line-height: 1;
}

.step-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
}

.step-content p {
  margin: 0;
  color: var(--text-muted);
  max-width: 55ch;
}

.arch-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 0.75rem;
  margin: 2rem 0 0;
  padding: 1.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
}

.arch-node { font-weight: 500; color: var(--text); }
.arch-arrow { color: var(--text-muted); font-weight: 300; }

.arch-caption {
  margin: 1rem 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  text-align: center;
}

.build-card {
  margin-top: 2rem;
  padding: 1.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.build-card:first-of-type { margin-top: 1.5rem; }

.build-card-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.build-card-lead {
  margin: 0 0 0.75rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.build-list {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--text-muted);
}

.build-list li { margin-bottom: 0.4rem; }

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.feature-card {
  padding: 1.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.feature-name {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 400;
  margin: 0 0 0.75rem;
}

.feature-list {
  margin: 0;
  padding-left: 1.15rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.feature-list li { margin-bottom: 0.35rem; }

.features-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.5rem;
}

.use-cases-list {
  margin: 1.5rem 0 0;
  padding-left: 1.5rem;
  max-width: 55ch;
  color: var(--text-muted);
}

.use-cases-list li { margin-bottom: 0.6rem; }

.open-core-lead {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
}

.col-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
}

.col-list {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.col-list li { margin-bottom: 0.4rem; }

.security-list {
  margin: 1.5rem 0 0;
  padding-left: 1.5rem;
  max-width: 55ch;
  color: var(--text-muted);
}

.security-list li { margin-bottom: 0.5rem; }

.cta-section {
  text-align: center;
  padding: var(--space-xl) 0;
}

.cta-title {
  font-family: var(--serif);
  font-size: 1.75rem;
  font-weight: 400;
  margin: 0 0 0.5rem;
}

.cta-sub { color: var(--text-muted); margin: 0 0 1.5rem; }

.cta-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 1rem;
}

.cta-alt {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
  margin: 0;
}

.cta-alt a {
  color: var(--text);
  text-decoration: underline;
}

/* Add Capnet / MCP install */
.mcp-install { margin-top: 1rem; }
.mcp-step { margin: 0.75rem 0 0; color: var(--text-muted); font-size: 0.95rem; }
.mcp-step code { font-size: 0.9em; background: var(--bg-alt); padding: 0.15rem 0.4rem; border-radius: 4px; }
.mcp-code {
  display: block;
  margin: 0.5rem 0 0;
  padding: 1rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.8rem;
  overflow-x: auto;
  white-space: pre;
}

/* Waitlist form */
.waitlist-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: center;
  max-width: 28rem;
  margin: 0 auto 1rem;
}
.waitlist-input {
  flex: 1;
  min-width: 200px;
  padding: 0.6rem 1rem;
  font-family: var(--sans);
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.waitlist-message {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  min-height: 1.5em;
}
.waitlist-message--ok { color: var(--text-muted); }
.waitlist-message--error { color: #b91c1c; }

/* Console */
.console-signin { max-width: 28rem; }
.console-header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.console-meta { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: baseline; }
.metric-label { font-size: 0.85rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-right: 0.25rem; }
.metric-value { font-weight: 600; }
.metric-muted { font-weight: 400; color: var(--text-muted); }
.status-pill {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.status-pill--ok { background: #dcfce7; color: #166534; }
.status-pill--degraded { background: #fef3c7; color: #92400e; }
.status-pill--error { background: #fee2e2; color: #b91c1c; }
.status-pill--pending { background: var(--bg-alt); color: var(--text-muted); }
.console-grid { margin-top: 1.5rem; }
.agent-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.agent-table th, .agent-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.agent-table th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.agent-table tbody tr { cursor: pointer; }
.agent-table tbody tr:hover { background: var(--bg-alt); }
.console-empty { color: var(--text-muted); padding: 1.5rem 0; }
.console-detail-metrics { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; margin-top: 0.5rem; }
.console-detail-metrics .metric { display: flex; flex-direction: column; gap: 0.15rem; }

.site-footer {
  padding: var(--space-lg) 0;
  padding-bottom: calc(var(--space-lg) + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
}

.footer-brand {
  font-family: var(--serif);
  font-size: 1.25rem;
  margin: 0 0 0.25rem;
}

.footer-tagline {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0 0 1.5rem;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
}

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

@media (max-width: 640px) {
  body {
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .site-header .wrap {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  .nav {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
    gap: 1rem;
  }
  .nav a {
    white-space: nowrap;
  }
  .value-divider { display: none; }
  .hero-ctas { flex-direction: column; }
  .hero-ctas .btn { width: 100%; max-width: 280px; }
  .arch-flow { flex-direction: column; align-items: flex-start; }
  .arch-arrow { transform: rotate(90deg); margin-left: 0.5rem; }
  .site-footer {
    padding-bottom: max(2rem, calc(1.5rem + env(safe-area-inset-bottom, 0px)));
  }
}

/* Docs page */
.docs-page .wrap {
  max-width: min(92vw, 900px);
}
.docs-nav-inner {
  position: sticky;
  top: calc(var(--space) * 2 + 1.5rem);
  padding: 1rem 0;
  border-right: 1px solid var(--border);
}
.docs-nav-inner a {
  display: block;
  padding: 0.35rem 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  text-decoration: none;
}
.docs-nav-inner a:hover { color: var(--text); }
.docs-nav-inner a.active { color: var(--text); font-weight: 500; }
.docs-layout {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 2.5rem;
  align-items: start;
}
@media (max-width: 768px) {
  .docs-layout { grid-template-columns: 1fr; }
  .docs-nav-inner { position: static; border-right: 0; border-bottom: 1px solid var(--border); padding-bottom: 1rem; margin-bottom: 1rem; }
}
.docs-content h2 {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 400;
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
  letter-spacing: -0.02em;
}
.docs-content h2:first-child { margin-top: 0; }
.docs-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 1.75rem 0 0.5rem;
}
.docs-content p {
  margin: 0 0 1rem;
  color: var(--text-muted);
  max-width: 65ch;
}
.docs-content ul, .docs-content ol {
  margin: 0 0 1rem;
  padding-left: 1.5rem;
  color: var(--text-muted);
  max-width: 65ch;
}
.docs-content li { margin-bottom: 0.35rem; }
.docs-content code {
  font-size: 0.88em;
  background: var(--bg-alt);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  border: 1px solid var(--border);
}
.docs-content pre {
  margin: 1rem 0;
  padding: 1.25rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.5;
}
.docs-content pre code { background: none; padding: 0; border: 0; }
.docs-table {
  width: 100%;
  max-width: 600px;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.9rem;
}
.docs-table th, .docs-table td {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
}
.docs-table th {
  font-weight: 600;
  color: var(--text);
  background: var(--bg-alt);
}
.docs-table td { color: var(--text-muted); }
.docs-section { margin-bottom: 2rem; }
