/* CorvinOS Handbook — shared stylesheet */
:root {
  --hb-bg:        #0b0f1a;
  --hb-surface:   #111827;
  --hb-border:    #1f2d3d;
  --hb-text:      #e8e4d8;
  --hb-muted:     #8a9ab5;
  --hb-accent:    #c8922a;
  --hb-accent-lo: rgba(200,146,42,.12);
  --hb-green:     #2ecc71;
  --hb-nav-w:     260px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--hb-bg);
  color: var(--hb-text);
  line-height: 1.7;
  min-height: 100vh;
}

/* ── Top bar ─────────────────────────────────────────────────── */
.hb-topbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 1rem;
  padding: .75rem 2rem;
  background: rgba(11,15,26,.92);
  border-bottom: 1px solid var(--hb-border);
  backdrop-filter: blur(12px);
}
.hb-logo { display: flex; align-items: center; gap: .6rem; text-decoration: none; }
.hb-logo svg { width: 28px; height: 28px; }
.hb-logo-text { font-size: 1.05rem; font-weight: 700; color: var(--hb-text); letter-spacing: -.3px; }
.hb-logo-sub  { font-size: .7rem; color: var(--hb-muted); text-transform: uppercase; letter-spacing: .12em; }
.hb-topbar-links { margin-left: auto; display: flex; gap: 1.5rem; align-items: center; }
.hb-topbar-links a { color: var(--hb-muted); text-decoration: none; font-size: .875rem; transition: color .2s; }
.hb-topbar-links a:hover { color: var(--hb-text); }
.hb-topbar-links a.active { color: var(--hb-accent); }

/* ── Two-column layout ───────────────────────────────────────── */
.hb-layout { display: flex; min-height: calc(100vh - 52px); }

/* ── Sidebar nav ─────────────────────────────────────────────── */
.hb-sidenav {
  width: var(--hb-nav-w);
  flex-shrink: 0;
  position: sticky; top: 52px;
  height: calc(100vh - 52px);
  overflow-y: auto;
  padding: 1.5rem 0;
  border-right: 1px solid var(--hb-border);
  background: var(--hb-surface);
}
.hb-sidenav-section { margin-bottom: 1.5rem; }
.hb-sidenav-label {
  padding: .25rem 1.5rem;
  font-size: .68rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .12em;
  color: var(--hb-muted);
}
.hb-sidenav a {
  display: block;
  padding: .45rem 1.5rem;
  font-size: .875rem;
  color: var(--hb-muted);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: all .15s;
}
.hb-sidenav a:hover { color: var(--hb-text); background: rgba(255,255,255,.04); }
.hb-sidenav a.active {
  color: var(--hb-accent);
  border-left-color: var(--hb-accent);
  background: var(--hb-accent-lo);
}

/* ── Main content ────────────────────────────────────────────── */
.hb-content {
  flex: 1;
  min-width: 0;
  padding: 3rem 4rem;
  max-width: 960px;
}

/* ── Page header ─────────────────────────────────────────────── */
.hb-page-header { margin-bottom: 2.5rem; border-bottom: 1px solid var(--hb-border); padding-bottom: 2rem; }
.hb-breadcrumb { font-size: .8rem; color: var(--hb-muted); margin-bottom: .75rem; }
.hb-breadcrumb a { color: var(--hb-muted); text-decoration: none; }
.hb-breadcrumb a:hover { color: var(--hb-accent); }
.hb-breadcrumb span { margin: 0 .4rem; }
.hb-page-header h1 {
  font-size: 2rem; font-weight: 700; letter-spacing: -.5px;
  color: var(--hb-text); margin-bottom: .5rem;
  font-family: Georgia, serif;
}
.hb-page-header p { color: var(--hb-muted); font-size: 1.05rem; }

/* ── Section headings ────────────────────────────────────────── */
.hb-section { margin-bottom: 3.5rem; }
.hb-section h2 {
  font-size: 1.3rem; font-weight: 700;
  color: var(--hb-text); margin-bottom: .75rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--hb-border);
}
.hb-section h3 { font-size: 1rem; font-weight: 600; color: var(--hb-accent); margin: 1.5rem 0 .5rem; }
.hb-section p { color: var(--hb-muted); margin-bottom: .75rem; }
.hb-section ul, .hb-section ol { color: var(--hb-muted); padding-left: 1.5rem; margin-bottom: .75rem; }
.hb-section li { margin-bottom: .35rem; }
.hb-section strong { color: var(--hb-text); }

/* ── Screenshot ──────────────────────────────────────────────── */
.hb-screenshot {
  margin: 1.5rem 0 2rem;
  border: 1px solid var(--hb-border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
}
.hb-screenshot img { display: block; width: 100%; height: auto; }
.hb-screenshot figcaption {
  padding: .6rem 1rem;
  font-size: .8rem;
  color: var(--hb-muted);
  background: var(--hb-surface);
  border-top: 1px solid var(--hb-border);
}

/* ── Callout box ─────────────────────────────────────────────── */
.hb-callout {
  display: flex; gap: .75rem;
  padding: 1rem 1.25rem;
  border-radius: 8px;
  margin: 1.25rem 0;
  border: 1px solid;
}
.hb-callout.info { background: rgba(59,130,246,.08); border-color: rgba(59,130,246,.25); }
.hb-callout.tip  { background: var(--hb-accent-lo); border-color: rgba(200,146,42,.3); }
.hb-callout.warn { background: rgba(245,158,11,.08); border-color: rgba(245,158,11,.25); }
.hb-callout-icon { font-size: 1.1rem; flex-shrink: 0; line-height: 1.6; }
.hb-callout p    { margin: 0; font-size: .9rem; }
.hb-callout.info p { color: #93c5fd; }
.hb-callout.tip  p { color: var(--hb-accent); }
.hb-callout.warn p { color: #fcd34d; }

/* ── Inline code ─────────────────────────────────────────────── */
code {
  background: rgba(255,255,255,.07);
  border: 1px solid var(--hb-border);
  border-radius: 4px;
  padding: .1em .35em;
  font-size: .85em;
  font-family: 'SF Mono', 'Fira Code', monospace;
  color: #c8d8f0;
}

/* ── Step list ───────────────────────────────────────────────── */
.hb-steps { list-style: none; padding: 0; counter-reset: step; }
.hb-steps li {
  counter-increment: step;
  display: flex; gap: 1rem;
  padding: .75rem 0;
  border-bottom: 1px solid var(--hb-border);
  color: var(--hb-muted);
  font-size: .9rem;
}
.hb-steps li:last-child { border-bottom: none; }
.hb-steps li::before {
  content: counter(step);
  display: flex; align-items: center; justify-content: center;
  min-width: 26px; height: 26px;
  background: var(--hb-accent-lo);
  border: 1px solid var(--hb-accent);
  border-radius: 50%;
  font-size: .75rem; font-weight: 700;
  color: var(--hb-accent);
  flex-shrink: 0;
}

/* ── Feature grid ────────────────────────────────────────────── */
.hb-feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1.25rem 0;
}
.hb-feature-card {
  background: var(--hb-surface);
  border: 1px solid var(--hb-border);
  border-radius: 8px;
  padding: 1.1rem 1.25rem;
}
.hb-feature-card .icon { font-size: 1.4rem; margin-bottom: .5rem; }
.hb-feature-card h4 { font-size: .9rem; font-weight: 600; color: var(--hb-text); margin-bottom: .3rem; }
.hb-feature-card p  { font-size: .82rem; color: var(--hb-muted); margin: 0; }

/* ── Next / Prev navigation ──────────────────────────────────── */
.hb-page-nav {
  display: flex; justify-content: space-between;
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--hb-border);
}
.hb-page-nav a {
  display: flex; flex-direction: column;
  text-decoration: none; padding: 1rem 1.25rem;
  border: 1px solid var(--hb-border);
  border-radius: 8px;
  transition: border-color .2s, background .2s;
  max-width: 45%;
}
.hb-page-nav a:hover { border-color: var(--hb-accent); background: var(--hb-accent-lo); }
.hb-page-nav .dir { font-size: .75rem; color: var(--hb-muted); margin-bottom: .25rem; }
.hb-page-nav .title { font-size: .95rem; font-weight: 600; color: var(--hb-text); }
.hb-page-nav .next { align-items: flex-end; margin-left: auto; }

/* ── Index card grid ─────────────────────────────────────────── */
.hb-index-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}
.hb-index-card {
  background: var(--hb-surface);
  border: 1px solid var(--hb-border);
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none;
  transition: border-color .2s, transform .2s;
  display: flex; flex-direction: column;
}
.hb-index-card:hover { border-color: var(--hb-accent); transform: translateY(-2px); }
.hb-index-card-thumb img { width: 100%; height: auto; display: block; }
.hb-index-card-body { padding: 1rem 1.25rem; flex: 1; }
.hb-index-card-body h3 { font-size: 1rem; font-weight: 700; color: var(--hb-text); margin-bottom: .3rem; }
.hb-index-card-body p  { font-size: .82rem; color: var(--hb-muted); margin: 0; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  .hb-sidenav { display: none; }
  .hb-content { padding: 2rem 1.5rem; }
}
