/* Red Pen documentation - shared stylesheet.
   Palette + typography mirror the marketing landing page (landing.html) so the
   docs read as part of the same site. Dark-first; --red is the locked brand red. */
:root {
  --red: #D32F2F; --red-2: #ff5a4d; --bg: #15171a; --bg-2: #1c1f23; --panel: #23272b;
  --line: #31363c; --text: #e8ebee; --muted: #9aa3ac; --ok: #4caf78; --warn: #e0a341;
  --code-bg: #11131600; --sidebar-w: 256px;
}
* { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--red-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -.01em; }

/* ---- Top bar ---- */
.topbar { position: sticky; top: 0; z-index: 50; background: rgba(21, 23, 26, .9); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); height: 56px; display: flex; align-items: center; padding: 0 1.1rem; gap: 1rem; }
.topbar .logo { display: flex; align-items: center; gap: .5rem; font-weight: 800; font-size: 1.05rem; color: var(--text); }
.topbar .logo .dot { width: 13px; height: 13px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 4px rgba(211, 47, 47, .2); }
.topbar .logo span.d { color: var(--muted); font-weight: 600; }
.topbar .right { margin-left: auto; display: flex; gap: 1.1rem; align-items: center; font-size: .9rem; }
.topbar .right a { color: var(--muted); }
.topbar .right a:hover { color: var(--text); text-decoration: none; }
.menu-btn { display: none; background: transparent; border: 1px solid var(--line); color: var(--text); border-radius: 7px; padding: .35rem .6rem; cursor: pointer; font-size: 1.1rem; }

/* ---- Layout: sidebar + content ---- */
.shell { display: flex; max-width: 1180px; margin: 0 auto; }
.sidebar { width: var(--sidebar-w); flex: none; border-right: 1px solid var(--line); padding: 1.4rem 0 3rem; position: sticky; top: 56px; height: calc(100vh - 56px); overflow-y: auto; }
.sidebar h4 { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 1.3rem 1.4rem .4rem; }
.sidebar h4:first-child { margin-top: 0; }
.sidebar a { display: block; color: var(--muted); padding: .34rem 1.4rem; font-size: .93rem; border-left: 2px solid transparent; }
.sidebar a:hover { color: var(--text); text-decoration: none; background: var(--bg-2); }
.sidebar a.active { color: var(--red-2); border-left-color: var(--red); background: rgba(211, 47, 47, .07); font-weight: 600; }
.content { flex: 1; min-width: 0; padding: 2.2rem 2.6rem 5rem; }
.content h1 { font-size: 2.1rem; margin-bottom: .5rem; }
.content h2 { font-size: 1.45rem; margin: 2.4rem 0 .8rem; padding-top: .4rem; border-top: 1px solid var(--line); }
.content h2:first-of-type { border-top: none; }
.content h3 { font-size: 1.12rem; margin: 1.6rem 0 .5rem; }
.content p, .content li { color: #d4d9de; }
.content p { margin: .7rem 0; }
.content ul, .content ol { margin: .6rem 0 .6rem 1.3rem; }
.content li { margin: .3rem 0; }
.lede { font-size: 1.15rem; color: var(--muted); margin: .3rem 0 1.4rem; }
.crumb { font-size: .82rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

/* ---- Inline + block code ---- */
code { font-family: "SF Mono", "Cascadia Code", Consolas, monospace; font-size: .88em; background: rgba(255, 255, 255, .07); border: 1px solid var(--line); border-radius: 5px; padding: .08em .38em; color: #f0c8c4; }
pre { background: #0f1114; border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.1rem; overflow-x: auto; margin: 1rem 0; line-height: 1.5; }
pre code { background: none; border: none; padding: 0; color: #d4d9de; font-size: .85rem; }
.tok-c { color: var(--muted); } /* comment */
.tok-k { color: var(--red-2); } /* keyword */
.tok-s { color: #9ece9a; } /* string */

/* ---- Callouts ---- */
.note, .tip, .warn-box { border-radius: 9px; padding: .85rem 1.05rem; margin: 1.1rem 0; border: 1px solid var(--line); font-size: .95rem; }
.note { background: rgba(211, 47, 47, .07); border-color: rgba(211, 47, 47, .3); }
.tip { background: rgba(76, 175, 120, .08); border-color: rgba(76, 175, 120, .3); }
.warn-box { background: rgba(224, 163, 65, .08); border-color: rgba(224, 163, 65, .35); }
.note b, .tip b, .warn-box b { color: var(--text); }
.callout-label { display: block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-bottom: .25rem; }
.note .callout-label { color: var(--red-2); }
.tip .callout-label { color: var(--ok); }
.warn-box .callout-label { color: var(--warn); }

/* ---- Tables ---- */
table.dt { width: 100%; border-collapse: collapse; margin: 1.1rem 0; font-size: .92rem; }
table.dt th, table.dt td { padding: .55rem .75rem; border: 1px solid var(--line); text-align: left; vertical-align: top; }
table.dt th { background: var(--bg-2); color: var(--text); font-weight: 600; }
table.dt td { color: #cfd4d9; }
table.dt td code { white-space: nowrap; }

/* ---- Badges / pills ---- */
.badge { display: inline-block; font-size: .72rem; font-weight: 700; border-radius: 999px; padding: .12rem .6rem; vertical-align: middle; }
.badge.ver { background: rgba(211, 47, 47, .14); color: var(--red-2); border: 1px solid rgba(211, 47, 47, .3); }
.badge.ok { background: rgba(76, 175, 120, .14); color: var(--ok); border: 1px solid rgba(76, 175, 120, .3); }
.badge.wip { background: rgba(224, 163, 65, .14); color: var(--warn); border: 1px solid rgba(224, 163, 65, .35); }
.badge.paused { background: rgba(154, 163, 172, .14); color: var(--muted); border: 1px solid var(--line); }
.badge.pro { background: #2a1416; color: var(--red-2); border: 1px solid var(--red); }

/* ---- Surface cards (home) ---- */
.cardgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1.3rem 0; }
@media (max-width: 720px) { .cardgrid { grid-template-columns: 1fr; } }
.surf { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 1.1rem 1.2rem; display: block; color: inherit; }
.surf:hover { border-color: var(--red); text-decoration: none; transform: translateY(-1px); transition: .12s; }
.surf .tag { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--red-2); }
.surf h3 { margin: .2rem 0 .35rem; font-size: 1.1rem; color: var(--text); }
.surf p { color: var(--muted); font-size: .92rem; margin: 0; }

/* ---- Roadmap-specific ---- */
.phase { border-left: 2px solid var(--line); padding: .2rem 0 .2rem 1.1rem; margin: .3rem 0 1.3rem; }
.phase.done { border-left-color: var(--ok); }
.phase.now { border-left-color: var(--red); }
.phase.next { border-left-color: var(--warn); }
.phase.later { border-left-color: var(--line); }

/* ---- Footer + page nav ---- */
.pagenav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 3rem; padding-top: 1.4rem; border-top: 1px solid var(--line); }
.pagenav a { display: block; padding: .7rem 1rem; border: 1px solid var(--line); border-radius: 9px; font-size: .9rem; color: var(--muted); max-width: 48%; }
.pagenav a:hover { border-color: var(--red); color: var(--text); text-decoration: none; }
.pagenav .lbl { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.pagenav .ttl { color: var(--text); font-weight: 600; }
footer.docfoot { color: var(--muted); font-size: .85rem; padding: 2rem 0; text-align: center; border-top: 1px solid var(--line); margin-top: 2rem; }

/* ---- Responsive sidebar ---- */
@media (max-width: 820px) {
  .menu-btn { display: block; }
  .sidebar { position: fixed; top: 56px; left: 0; background: var(--bg); z-index: 40; transform: translateX(-100%); transition: transform .2s; box-shadow: 4px 0 24px rgba(0,0,0,.4); }
  body.nav-open .sidebar { transform: translateX(0); }
  .content { padding: 1.6rem 1.2rem 4rem; }
}
