<!doctype html>
<html>
<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <title>Mastermind — Docs</title>
  <style>
    body{font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;margin:0;background:#0b0f14;color:#e8eef7}
    header{background:#111824;border-bottom:1px solid #233043;padding:14px 16px;position:sticky;top:0}
    main{max-width:1100px;margin:0 auto;padding:16px}
    .card{background:#111824;border:1px solid #233043;border-radius:12px;padding:14px;margin:12px 0}
    a{color:#7cc4ff;text-decoration:none}
    .muted{color:#a9b7c6}
    .grid{display:grid;grid-template-columns:repeat(12,1fr);gap:12px}
    .nav{grid-column:span 12}
    .content{grid-column:span 12}
    @media(min-width:900px){.nav{grid-column:span 3}.content{grid-column:span 9}}
    .nav a{display:block;padding:10px;border:1px solid #233043;border-radius:10px;margin-bottom:8px;background:#0e1520}
    .doc{background:#0e1520;border:1px solid #233043;border-radius:10px;padding:14px;overflow:auto}
    .doc h1,.doc h2,.doc h3{color:#e8eef7}
    .doc p,.doc li{color:#a9b7c6;line-height:1.45}
    .doc code,.doc pre{font-family:ui-monospace,Menlo,Consolas,monospace}
    .doc pre{background:#0b0f14;border:1px solid #233043;border-radius:10px;padding:12px;color:#d6e3f3;overflow:auto}
  </style>
</head>
<body>
<header>
  <div style="display:flex;justify-content:space-between;align-items:center;gap:10px">
    <div style="font-weight:700">Docs</div>
    <div style="display:flex;gap:10px">
      <a href="/">Dashboard</a>
      <a href="/logout">Logout</a>
    </div>
  </div>
</header>

<main>
  <div class="grid">
    <div class="nav">
      <div class="card">
        <% docs.forEach(d => { %>
          <a href="/docs/<%= d.slug %>"><%= d.title %></a>
        <% }) %>
      </div>
    </div>

    <div class="content">
      <div class="card">
        <div class="muted">Viewing: <b><%= current.title %></b></div>
        <div class="muted">Source file: <code><%= current.path %></code></div>
      </div>
      <div class="doc">
        <%- html %>
      </div>
    </div>
  </div>
</main>
</body>
</html>
