/* ===================================================================
   x402 Control Plane — Landing Site Styles
   Palette: navy #172953, red accent #ba2025, light #f4f5f7
   =================================================================== */

:root {
  --navy: #172953;
  --red: #ba2025;
  --bg: #ffffff;
  --bg-alt: #f4f5f7;
  --text: #172953;
  --text-muted: #5a6577;
  --border: #dfe2e7;
  --code-bg: #f0f1f4;
  --card-bg: #ffffff;
  --card-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

@media (prefers-color-scheme: dark) {
  :root {
    --navy: #c5d0e6;
    --red: #e05459;
    --bg: #0f1724;
    --bg-alt: #172338;
    --text: #dfe2ea;
    --text-muted: #8b95a8;
    --border: #2a3650;
    --code-bg: #1a2640;
    --card-bg: #172338;
    --card-shadow: 0 1px 3px rgba(0,0,0,0.3);
  }
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- Nav --- */
.nav {
  position: sticky;
  top: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  z-index: 10;
}
.nav-inner {
  max-width: 48rem;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.nav-links { display: flex; gap: 1.5rem; }
.nav-link {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-decoration: none;
}
.nav-link:hover { color: var(--text); }
.nav-link.active {
  color: var(--text);
  font-weight: 600;
}

/* --- Content --- */
.content {
  flex: 1;
  max-width: 48rem;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  width: 100%;
}

/* --- Router (index) --- */
.router {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1.5rem;
}
.router-wordmark {
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 0.75rem;
}
.router-tagline {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 32rem;
  margin-bottom: 2.5rem;
}
.door-cards {
  display: flex;
  gap: 1.5rem;
}
.door-card {
  display: block;
  text-decoration: none;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem 2rem;
  width: 14rem;
  box-shadow: var(--card-shadow);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.door-card:hover {
  border-color: var(--red);
  box-shadow: 0 2px 8px rgba(186,32,37,0.12);
}
.door-card-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
}
.door-card-sub {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* --- Context bar --- */
.context-bar {
  background: var(--bg-alt);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  margin-bottom: 2.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.context-bar a { color: var(--red); text-decoration: none; }
.context-bar a:hover { text-decoration: underline; }

/* --- Sections --- */
.section { margin-bottom: 3rem; }
.section-heading {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}

/* --- Swimlane --- */
.swimlane-container {
  margin-bottom: 3rem;
  text-align: center;
}
.swimlane-container svg {
  max-width: 100%;
  height: auto;
}

/* --- Services list --- */
.services-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.services-list li {
  padding-left: 1rem;
  border-left: 3px solid var(--red);
}
.services-list strong { display: block; margin-bottom: 0.125rem; }

/* --- Feature grid --- */
.feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.feature-card {
  background: var(--bg-alt);
  border-radius: 6px;
  padding: 1rem 1.25rem;
}
.feature-card strong { display: block; margin-bottom: 0.25rem; }
.feature-card span { font-size: 0.875rem; color: var(--text-muted); }

/* --- Tables --- */
.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.spec-table th {
  text-align: left;
  font-weight: 600;
  padding: 0.5rem 0.75rem;
  border-bottom: 2px solid var(--border);
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.spec-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
}
.spec-table tr:last-child td { border-bottom: none; }
.spec-table code {
  background: var(--code-bg);
  padding: 0.125rem 0.375rem;
  border-radius: 3px;
  font-size: 0.8125rem;
}

/* --- Code blocks --- */
.code-block {
  background: var(--code-bg);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  font-family: "SF Mono", "Fira Code", "Fira Mono", Menlo, Consolas, monospace;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--text);
}

/* --- Ordered steps --- */
.steps-list {
  list-style: none;
  counter-reset: step;
}
.steps-list li {
  counter-increment: step;
  padding: 0.5rem 0 0.5rem 2.5rem;
  position: relative;
}
.steps-list li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  width: 1.75rem;
  height: 1.75rem;
  background: var(--red);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

/* --- Links list --- */
.links-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.links-list a {
  color: var(--red);
  text-decoration: none;
  font-size: 0.9rem;
}
.links-list a:hover { text-decoration: underline; }

/* --- Contact --- */
.contact-section {
  background: var(--bg-alt);
  border-radius: 6px;
  padding: 1.5rem;
  text-align: center;
}
.contact-section a { color: var(--red); text-decoration: none; font-weight: 600; }
.contact-section a:hover { text-decoration: underline; }

/* --- Footer --- */
.footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.footer a { color: var(--text-muted); text-decoration: none; }
.footer a:hover { color: var(--text); }

/* --- Responsive --- */
@media (max-width: 640px) {
  .door-cards { flex-direction: column; }
  .door-card { width: 100%; }
  .feature-grid { grid-template-columns: 1fr; }
  .router-wordmark { font-size: 2.5rem; }
}
