:root {
    --bg: #030303;
    --surface: #0a0a0a;
    --surface-2: #121212;
    --border: rgba(255, 255, 255, 0.08);
    --text: #fafafa;
    --muted: #a1a1aa;
    --dim: #71717a;
    --accent: #06b6d4;
    --accent-2: #3b82f6;
    --green: #22c55e;
    --font-sans: 'Inter', system-ui, sans-serif;
    --font-heading: 'Outfit', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --sidebar-width: 280px;
    --nav-height: 64px;
    --glow: rgba(6, 182, 212, 0.15);
  }

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

  html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-height) + 32px);
  }

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

  /* Background Ambient Glows */
  body::before {
    content: '';
    position: fixed;
    top: -10%;
    right: -10%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, var(--glow) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
  }

  body::after {
    content: '';
    position: fixed;
    bottom: -10%;
    left: -10%;
    width: 50%;
    height: 50%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.1) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
  }

  /* ── Nav ─────────────────────────────────── */
  .nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: rgba(9, 9, 11, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 100;
  }

  .nav-left {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -0.02em;
  }

  .nav-logo-img {
    width: 28px;
    height: 28px;
    object-fit: contain;
  }

  .nav-logo span {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }

  .nav-links {
    display: flex;
    align-items: center;
    gap: 24px;
  }

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

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

  .hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--muted);
  }

  .hamburger svg {
    width: 24px;
    height: 24px;
  }

  /* ── Layout ──────────────────────────────── */
  .layout {
    display: flex;
    padding-top: var(--nav-height);
    min-height: 100vh;
  }

  /* ── Sidebar ─────────────────────────────── */
  .sidebar {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--surface);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    padding: 20px 0;
    z-index: 50;
    transition: transform 0.3s ease;
  }

  .sidebar::-webkit-scrollbar {
    width: 4px;
  }

  .sidebar::-webkit-scrollbar-track {
    background: transparent;
  }

  .sidebar::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
  }

  .sidebar-section {
    padding: 0 16px;
    margin-bottom: 8px;
  }

  .sidebar-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--dim);
    padding: 8px 8px 4px;
  }

  .sidebar a {
    display: block;
    padding: 6px 12px;
    color: var(--muted);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 450;
    border-radius: 6px;
    transition: all 0.15s;
    line-height: 1.5;
  }

  .sidebar a:hover {
    color: var(--text);
    background: var(--surface-2);
  }

  .sidebar a.active {
    color: var(--accent);
    background: rgba(6, 182, 212, 0.08);
  }

  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 40;
  }

  /* ── Content ─────────────────────────────── */
  .content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-width: 0;
    padding: 40px 48px 80px;
    max-width: 900px;
  }

  .content > *:first-child {
    margin-top: 0;
  }

  /* ── Typography ──────────────────────────── */
  h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.2;
    margin: 48px 0 16px;
    color: var(--text);
  }

  h1:first-child {
    margin-top: 0;
  }

  h2 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.3;
    margin: 48px 0 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
  }

  h3 {
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.4;
    margin: 32px 0 12px;
    color: var(--text);
  }

  p {
    margin: 12px 0;
    color: var(--text);
  }

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

  a:hover {
    color: var(--accent-2);
    text-decoration: underline;
  }

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

  hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 40px 0;
  }

  ul, ol {
    margin: 12px 0;
    padding-left: 24px;
  }

  li {
    margin: 6px 0;
    color: var(--text);
  }

  li::marker {
    color: var(--dim);
  }

  /* ── Code ────────────────────────────────── */
  code {
    font-family: var(--font-mono);
    font-size: 0.88em;
    background: var(--surface-2);
    border: 1px solid var(--border);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--accent);
  }

  pre {
    margin: 16px 0;
    padding: 16px 20px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow-x: auto;
    line-height: 1.6;
  }

  pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: 13px;
    color: var(--muted);
  }

  /* ── Tables ──────────────────────────────── */
  .table-wrap {
    overflow-x: auto;
    margin: 16px 0;
    border-radius: 8px;
    border: 1px solid var(--border);
  }

  table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
  }

  thead th {
    background: var(--surface-2);
    padding: 10px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--border);
  }

  tbody td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
  }

  tbody tr:last-child td {
    border-bottom: none;
  }

  tbody tr:nth-child(even) {
    background: rgba(255,255,255,0.015);
  }

  tbody tr:hover {
    background: rgba(6, 182, 212, 0.04);
  }

  /* ── kbd ─────────────────────────────────── */
  kbd {
    font-family: var(--font-mono);
    font-size: 0.82em;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-bottom-width: 2px;
    padding: 2px 7px;
    border-radius: 4px;
    color: var(--text);
    white-space: nowrap;
  }

  /* ── Agent badges ────────────────────────── */
  .agent-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0;
  }

  .agent-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    gap: 6px;
  }

  .agent-badge::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
  }

  /* ── Intro hero ──────────────────────────── */
  .intro-hero {
    margin-bottom: 32px;
  }

  .hero-logo-img {
    width: 64px;
    height: 64px;
    margin-bottom: 20px;
    object-fit: contain;
    filter: drop-shadow(0 0 20px var(--glow));
  }

  .intro-hero h1 {
    font-size: 2.2rem;
    margin-bottom: 12px;
  }

  .intro-hero p {
    font-size: 16px;
    color: var(--muted);
    line-height: 1.7;
    max-width: 640px;
  }

  .waitlist-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding: 10px 24px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    border-radius: 8px;
    text-decoration: none;
    transition: opacity 0.2s;
  }

  .waitlist-cta:hover {
    opacity: 0.9;
    text-decoration: none;
    color: #fff;
  }

  .beta-note {
    margin-top: 12px;
    font-size: 13px;
    color: var(--dim);
  }

  /* ── Concepts Grid ───────────────────────── */
  .concepts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 24px;
  }

  .concept-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    transition: transform 0.2s, border-color 0.2s;
  }

  .concept-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
  }

  .concept-icon {
    font-size: 24px;
    margin-bottom: 16px;
  }

  .concept-card h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: var(--text);
  }

  .concept-card p {
    font-size: 14px;
    color: var(--muted);
    margin: 0;
    line-height: 1.6;
  }

  /* ── Articles grid ───────────────────────── */
  .articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin: 16px 0;
  }

  .article-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    transition: border-color 0.2s;
  }

  .article-card:hover {
    border-color: var(--accent);
  }

  .article-card h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
  }

  .article-card .for {
    font-size: 12px;
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 8px;
  }

  .article-card p {
    font-size: 13px;
    color: var(--muted);
    margin: 0;
    line-height: 1.5;
  }

  /* ── Use case diagrams ───────────────────── */
  .use-case {
    margin: 24px 0;
  }

  /* ── Version table highlight ─────────────── */
  .version-badge {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(6, 182, 212, 0.12);
    color: var(--accent);
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-mono);
  }

  /* ── Responsive ──────────────────────────── */
  @media (max-width: 900px) {
    .content {
      padding: 32px 24px 60px;
    }
  }

  @media (max-width: 768px) {
    .hamburger {
      display: block;
    }

    .nav-links {
      display: none;
    }

    .nav-links.show {
      display: flex;
      position: absolute;
      top: var(--nav-height);
      right: 0;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 0 0 8px 8px;
      flex-direction: column;
      padding: 12px 20px;
      gap: 12px;
    }

    .sidebar {
      transform: translateX(-100%);
    }

    .sidebar.open {
      transform: translateX(0);
    }

    .sidebar-overlay.show {
      display: block;
    }

    .content {
      margin-left: 0;
      padding: 24px 16px 60px;
    }

    h1 { font-size: 1.6rem; }
    h2 { font-size: 1.25rem; }

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

  /* ── Copy Button ─────────────────────────── */
  .copy-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    opacity: 0;
  }

  pre:hover .copy-btn {
    opacity: 1;
  }

  .copy-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.2);
  }

  .copy-btn.copied {
    background: rgba(34, 197, 94, 0.15);
    color: var(--green);
    border-color: rgba(34, 197, 94, 0.4);
  }

  .copy-btn svg {
    stroke-width: 2.5;
  }