@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

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

:root {
  --bg: #0f1117;
  --bg2: #161b25;
  --bg3: #1e2535;
  --surface: #242d3f;
  --border: #2e3a50;
  --text: #e2e8f0;
  --text2: #94a3b8;
  --text3: #64748b;
  --accent: #6366f1;
  --accent2: #818cf8;
  --done: #10b981;
  --done-bg: #0d2e22;
  --soon: #f59e0b;
  --soon-bg: #2d1e06;
  --radius: 10px;
  --mono: 'JetBrains Mono', monospace;
  --sans: 'Inter', sans-serif;
}

html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Layout ── */
.page-wrap { max-width: 980px; margin: 0 auto; padding: 0 24px 80px; }

/* ── Top Nav ── */
nav {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  padding: 0 24px;
}
.nav-inner {
  max-width: 980px; margin: 0 auto;
  display: flex; align-items: center; gap: 24px;
  height: 56px;
}
.nav-logo {
  font-weight: 700; font-size: 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  text-decoration: none; white-space: nowrap;
}
.nav-links { display: flex; gap: 2px; flex-wrap: wrap; }
.nav-links a {
  color: var(--text2); text-decoration: none;
  font-size: 13px; font-weight: 500;
  padding: 5px 10px; border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}
.nav-links a:hover, .nav-links a.active { background: var(--surface); color: var(--text); }
.nav-back { color: var(--text3); font-size: 13px; text-decoration: none; }
.nav-back:hover { color: var(--text2); }

/* ── Global Search ── */
.nav-search { position: relative; width: 260px; margin-left: auto; margin-right: 16px; }
.nav-search input {
  width: 100%; background: rgba(0,0,0,0.2); border: 1px solid var(--border);
  color: var(--text); border-radius: 6px; padding: 6px 12px 6px 32px;
  font-size: 13px; outline: none; transition: border-color 0.15s, background 0.15s;
  font-family: var(--sans);
}
.nav-search input:focus { border-color: var(--accent); background: rgba(0,0,0,0.4); }
.nav-search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: 12px; pointer-events: none; }
.search-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 6px; box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  max-height: 400px; overflow-y: auto; display: none; z-index: 1000;
}
.search-result-item {
  display: flex; flex-direction: column; padding: 10px 14px;
  text-decoration: none; color: var(--text); border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--surface); }
.search-result-title { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.search-result-title strong { font-family: var(--mono); font-size: 14px; color: #a5b4fc; }
.search-result-title small { font-size: 11px; color: var(--text3); font-family: var(--mono); }
.search-result-desc { font-size: 12px; color: var(--text2); line-height: 1.4; }
.search-no-results { padding: 16px; font-size: 13px; color: var(--text3); text-align: center; }

/* Highlight target anchor */
.cmd-card.highlighted { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(99,102,241,0.3); transition: all 0.3s; }


/* ── Hero ── */
.hero { padding: 52px 0 40px; }
.hero h1 {
  font-size: clamp(26px, 4vw, 38px); font-weight: 700; line-height: 1.2;
  background: linear-gradient(135deg, #fff 0%, var(--accent2) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  margin-bottom: 12px;
}
.hero p { color: var(--text2); font-size: 16px; max-width: 600px; }
.hero-meta { display: flex; gap: 16px; margin-top: 18px; flex-wrap: wrap; }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 99px; font-size: 13px; font-weight: 600;
}
.badge-done { background: var(--done-bg); color: var(--done); border: 1px solid #1a5c3e; }
.badge-soon { background: var(--soon-bg); color: var(--soon); border: 1px solid #5c3a0a; }

/* ── Progress Bar ── */
.progress-bar { height: 6px; background: var(--surface); border-radius: 99px; overflow: hidden; margin: 8px 0 20px; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--done)); border-radius: 99px; transition: width 0.8s; }

/* ── Category Cards (index) ── */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-top: 32px; }
.cat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
  display: block;
}
.cat-card:hover {
  border-color: var(--accent); transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(99,102,241,0.12);
}
.cat-icon { font-size: 28px; margin-bottom: 12px; }
.cat-card h3 { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.cat-card p { color: var(--text2); font-size: 13px; margin-bottom: 14px; line-height: 1.5; }
.cat-progress { display: flex; align-items: center; gap: 10px; }
.cat-pct { font-size: 22px; font-weight: 700; color: var(--accent2); }
.cat-label { font-size: 12px; color: var(--text3); }

/* ── Search ── */
.search-wrap { position: relative; max-width: 500px; margin: 24px 0; }
.search-wrap input {
  width: 100%; background: var(--bg2); border: 1px solid var(--border);
  color: var(--text); border-radius: 8px; padding: 10px 16px 10px 40px;
  font-size: 14px; outline: none; font-family: var(--sans);
  transition: border-color 0.15s;
}
.search-wrap input:focus { border-color: var(--accent); }
.search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text3); }

/* ── Section ── */
.section { margin-top: 48px; }
.section-title {
  font-size: 13px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text3);
  border-bottom: 1px solid var(--border); padding-bottom: 10px; margin-bottom: 20px;
  display: flex; align-items: center; gap: 8px;
}
.section-title .dot-done { width: 8px; height: 8px; border-radius: 50%; background: var(--done); }
.section-title .dot-soon { width: 8px; height: 8px; border-radius: 50%; background: var(--soon); }

/* ── Command Cards ── */
.cmd-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 14px;
  overflow: hidden;
  transition: border-color 0.15s;
}
.cmd-card:hover { border-color: var(--accent); }
.cmd-card.done { border-left: 3px solid var(--done); }
.cmd-card.soon { border-left: 3px solid var(--soon); opacity: 0.8; }
.cmd-header {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 16px 20px; cursor: pointer;
}
.cmd-name {
  font-family: var(--mono); font-size: 15px; font-weight: 600;
  color: #a5b4fc; flex: 1;
}
.cmd-aliases { font-size: 12px; color: var(--text3); font-family: var(--mono); margin-top: 2px; }
.cmd-status {
  font-size: 11px; font-weight: 600; padding: 3px 10px;
  border-radius: 99px; white-space: nowrap; flex-shrink: 0; margin-top: 2px;
}
.status-done { background: var(--done-bg); color: var(--done); }
.status-soon { background: var(--soon-bg); color: var(--soon); }
.cmd-body { padding: 0 20px 18px; border-top: 1px solid var(--border); }
.cmd-desc { color: var(--text2); font-size: 14px; margin: 14px 0 10px; }
.cmd-syntax { margin-bottom: 10px; }
.cmd-syntax .label { font-size: 11px; color: var(--text3); text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 6px; }
pre {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 6px; padding: 12px 16px; overflow-x: auto;
  font-family: var(--mono); font-size: 13px; color: #c4b5fd; line-height: 1.7;
}
code { font-family: var(--mono); font-size: 13px; color: #c4b5fd; }
.result { color: #34d399; }
.comment { color: var(--text3); }
.cmd-params { margin-top: 10px; }
.param-row { display: flex; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.param-row:last-child { border-bottom: none; }
.param-name { font-family: var(--mono); color: #93c5fd; flex-shrink: 0; min-width: 120px; }
.param-desc { color: var(--text2); }
.param-opt { color: var(--text3); font-style: italic; }

/* ── Footer ── */
footer { border-top: 1px solid var(--border); padding: 24px 0; margin-top: 60px; color: var(--text3); font-size: 13px; text-align: center; }

/* ── Responsive ── */
@media (max-width: 640px) {
  .card-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
}
