/* =========================================================
   style.css — Velo Docs
   Tema oscuro inspirado en GitHub + Docusaurus
   ========================================================= */

:root {
  --bg:           #0d1117;
  --surface:      #161b22;
  --surface2:     #21262d;
  --border:       #30363d;
  --border2:      #21262d;
  --text:         #c9d1d9;
  --muted:        #8b949e;
  --heading:      #f0f6fc;
  --accent:       #58a6ff;
  --accent-dim:   #1f6feb;
  --green:        #3fb950;
  --green-bg:     #1a4731;
  --green-border: #2ea043;
  --orange:       #d29922;
  --red:          #f85149;
  --purple:       #d2a8ff;
  --yellow:       #e3b341;
  --sidebar-w:    260px;
  --topbar-h:     56px;
  --radius:       8px;
  --mono:         'Cascadia Code', 'Fira Code', 'JetBrains Mono', monospace;
}

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar-h) + 24px); }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.7;
}

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

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ═══════════════════════════════════════ TOPBAR */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  gap: 1rem;
  z-index: 100;
}

.topbar-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1rem;
  color: var(--heading);
  white-space: nowrap;
  text-decoration: none;
}

.topbar-logo:hover { text-decoration: none; }

.topbar-logo-dot {
  width: 10px; height: 10px;
  background: var(--accent);
  border-radius: 50%;
  display: inline-block;
}

.topbar-version {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  font-size: 0.72rem;
  color: var(--muted);
  font-family: var(--mono);
}

.topbar-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.topbar-nav a {
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  color: var(--muted);
  transition: color 0.15s, background 0.15s;
}

.topbar-nav a:hover,
.topbar-nav a.active {
  color: var(--heading);
  background: var(--surface2);
  text-decoration: none;
}

.topbar-nav a.active { color: var(--accent); }

.menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: 0.4rem;
  border-radius: var(--radius);
  margin-left: auto;
}

.menu-btn:hover { color: var(--heading); background: var(--surface2); }

.menu-btn svg { display: block; }

/* ═══════════════════════════════════════ LAYOUT */
.layout {
  display: flex;
  min-height: 100vh;
  padding-top: var(--topbar-h);
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  position: fixed;
  top: var(--topbar-h);
  bottom: 0;
  left: 0;
  overflow-y: auto;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 1.5rem 0 2rem;
  z-index: 90;
  transition: transform 0.25s ease;
}

.sidebar-section {
  padding: 0 0.75rem;
  margin-bottom: 1.5rem;
}

.sidebar-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  padding: 0 0.5rem;
  margin-bottom: 0.4rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--muted);
  transition: color 0.15s, background 0.15s;
  text-decoration: none;
}

.sidebar-link:hover {
  color: var(--heading);
  background: var(--surface2);
  text-decoration: none;
}

.sidebar-link.active {
  color: var(--accent);
  background: #1f6feb1a;
  font-weight: 500;
}

.sidebar-link .icon {
  font-size: 0.85rem;
  width: 16px;
  text-align: center;
  flex-shrink: 0;
}

/* ── Main ── */
.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
}

.content {
  max-width: 860px;
  margin: 0 auto;
  padding: 2.5rem 2rem 5rem;
}

/* ═══════════════════════════════════════ HERO */
.hero {
  text-align: center;
  padding: 3.5rem 0 3rem;
  border-bottom: 1px solid var(--border2);
  margin-bottom: 3rem;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #1f6feb1a;
  border: 1px solid var(--accent-dim);
  border-radius: 999px;
  padding: 0.3rem 1rem 0.3rem 0.6rem;
  font-size: 0.78rem;
  color: var(--accent);
  font-family: var(--mono);
  margin-bottom: 1.5rem;
}

.hero-eyebrow-dot {
  width: 7px; height: 7px;
  background: var(--accent);
  border-radius: 50%;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--heading);
  line-height: 1.15;
  margin-bottom: 1rem;
}

.hero h1 span { color: var(--accent); }

.hero-tagline {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto 2rem;
  line-height: 1.6;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  color: var(--muted);
  font-family: var(--mono);
}

.badge.green { background: var(--green-bg); border-color: var(--green-border); color: var(--green); }
.badge.blue  { background: #1f6feb1a; border-color: var(--accent-dim); color: var(--accent); }

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.3rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, filter 0.15s;
  text-decoration: none;
}

.btn:hover { filter: brightness(1.1); text-decoration: none; }

.btn-primary { background: var(--accent-dim); color: #fff; }
.btn-secondary { background: var(--surface2); border: 1px solid var(--border); color: var(--heading); }

/* ═══════════════════════════════════════ TYPOGRAPHY */
.content h1, .content h2, .content h3, .content h4 {
  color: var(--heading);
  font-weight: 700;
  line-height: 1.35;
}

.content h1 { font-size: 2rem; margin: 2.5rem 0 1rem; }
.content h2 { font-size: 1.4rem; margin: 3rem 0 0.75rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border2); }
.content h3 { font-size: 1.1rem; margin: 2rem 0 0.5rem; }
.content h4 { font-size: 0.95rem; margin: 1.5rem 0 0.4rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }

.content p { margin-bottom: 1rem; }

.content ul, .content ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.content li { margin-bottom: 0.35rem; }

.content strong { color: var(--heading); font-weight: 600; }

.content code {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1em 0.4em;
  font-family: var(--mono);
  font-size: 0.85em;
  color: #e6edf3;
}

/* ═══════════════════════════════════════ CODE BLOCKS */
.code-block {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 1rem 0 1.5rem;
  overflow: hidden;
}

.code-block-header {
  display: flex;
  align-items: center;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--border2);
  background: var(--surface2);
  gap: 0.5rem;
}

.code-block-lang {
  font-size: 0.72rem;
  color: var(--muted);
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.copy-btn {
  margin-left: auto;
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.2rem 0.55rem;
  font-size: 0.72rem;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}

.copy-btn:hover { background: var(--surface2); color: var(--heading); }
.copy-btn.copied { color: var(--green); border-color: var(--green-border); }

.code-block pre {
  padding: 1.1rem 1.25rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.83rem;
  line-height: 1.65;
  color: #e6edf3;
}

/* Sintaxis manual */
.code-block .kw  { color: #ff7b72; }   /* keywords */
.code-block .fn  { color: #d2a8ff; }   /* functions */
.code-block .str { color: #a5d6ff; }   /* strings */
.code-block .cm  { color: #8b949e; font-style: italic; } /* comments */
.code-block .num { color: #79c0ff; }   /* numbers */
.code-block .var { color: #ffa657; }   /* variables */
.code-block .op  { color: #c9d1d9; }   /* operators */
.code-block .prompt { color: var(--green); user-select: none; }
.code-block .resp-ok     { color: var(--green); }
.code-block .resp-err    { color: var(--red); }
.code-block .resp-int    { color: var(--yellow); }
.code-block .resp-nil    { color: var(--muted); }
.code-block .resp-str    { color: #a5d6ff; }
.code-block .resp-muted  { color: var(--muted); }

/* ═══════════════════════════════════════ TABLES */
.content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: 0.875rem;
}

.content th {
  text-align: left;
  padding: 0.6rem 1rem;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}

.content td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border2);
  vertical-align: top;
}

.content tr:last-child td { border-bottom: none; }
.content tr:hover td { background: #ffffff05; }

/* ═══════════════════════════════════════ CARDS Y COMPONENTS */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: border-color 0.15s;
}

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

.card-icon { font-size: 1.5rem; margin-bottom: 0.6rem; }
.card-title { font-weight: 600; color: var(--heading); margin-bottom: 0.4rem; font-size: 0.95rem; }
.card-desc { font-size: 0.83rem; color: var(--muted); line-height: 1.6; }

/* Callouts */
.callout {
  display: flex;
  gap: 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin: 1rem 0 1.5rem;
}

.callout.info   { border-left: 3px solid var(--accent); background: #1f6feb0d; }
.callout.tip    { border-left: 3px solid var(--green); background: #1a47310d; }
.callout.warn   { border-left: 3px solid var(--orange); background: #d299220d; }

.callout-icon { font-size: 1rem; flex-shrink: 0; margin-top: 0.15rem; }
.callout-body { font-size: 0.875rem; line-height: 1.65; }
.callout-body strong { display: block; margin-bottom: 0.2rem; }

/* Badges inline */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
}

.tag.done   { background: var(--green-bg); color: var(--green); border: 1px solid var(--green-border); }
.tag.todo   { background: var(--surface2); color: var(--muted); border: 1px solid var(--border); }
.tag.soon   { background: #d29922; color: #0d1117; }
.tag.note   { background: #1f6feb1a; color: var(--accent); border: 1px solid var(--accent-dim); }

/* Comando chips */
.cmd-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.4rem 0;
}

.cmd {
  background: var(--surface2);
  border: 1px solid #374151;
  color: #93c5fd;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 0.75rem;
}

/* Comando detail block */
.cmd-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 2.5rem;
  overflow: hidden;
}

.cmd-block-header {
  padding: 0.85rem 1.25rem;
  background: var(--surface2);
  border-bottom: 1px solid var(--border2);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.cmd-name {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1rem;
  color: var(--heading);
}

.cmd-syntax {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
}

.cmd-body { padding: 1rem 1.25rem; }
.cmd-body p { margin-bottom: 0.6rem; font-size: 0.9rem; }

/* Diagrama / imagen fullwidth */
.diagram {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 1.5rem 0;
  background: var(--surface);
}

.diagram img {
  width: 100%;
  height: auto;
  display: block;
}

.diagram-caption {
  padding: 0.5rem 0.85rem;
  font-size: 0.75rem;
  color: var(--muted);
  border-top: 1px solid var(--border2);
  background: var(--surface2);
  text-align: center;
}

/* Steps */
.steps { counter-reset: step; margin: 1rem 0 1.5rem; }

.step {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.step::before {
  counter-increment: step;
  content: counter(step);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 50%;
  background: var(--accent-dim);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  margin-top: 0.25rem;
}

.step-body { flex: 1; }
.step-body strong { display: block; color: var(--heading); margin-bottom: 0.25rem; }
.step-body p { font-size: 0.875rem; margin: 0; }

/* Phase row */
.phase-row {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--border2);
}

.phase-row:last-child { border-bottom: none; }

.phase-num {
  min-width: 40px;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--accent);
  font-family: var(--mono);
  padding-top: 0.1rem;
}

.phase-info { flex: 1; }
.phase-title { font-weight: 600; color: var(--heading); margin-bottom: 0.25rem; }
.phase-desc { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.5rem; }

/* Footer */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
  margin-left: var(--sidebar-w);
}

.site-footer a { color: var(--accent); }

/* Divider */
.divider { border: none; border-top: 1px solid var(--border2); margin: 2.5rem 0; }

/* ═══════════════════════════════════════ RESPONSIVE */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 20px rgba(0,0,0,0.5);
  }

  .main { margin-left: 0; }
  .site-footer { margin-left: 0; }
  .menu-btn { display: flex; }
  .topbar-nav { display: none; }
  .content { padding: 1.5rem 1.25rem 4rem; }
  .hero h1 { font-size: 2.1rem; }
}

@media (max-width: 540px) {
  .hero h1 { font-size: 1.7rem; }
  .hero-tagline { font-size: 0.95rem; }
}

/* ═══════════════════════════════════════ UTILITIES */
.text-muted { color: var(--muted); }
.text-accent { color: var(--accent); }
.mt-0 { margin-top: 0; }
.mb-sm { margin-bottom: 0.5rem; }
.mb-0 { margin-bottom: 0; }
.mono { font-family: var(--mono); }
