/* ── Variables ── */
:root {
  --bg: #0f1117;
  --bg2: #1a1d27;
  --bg3: #22263a;
  --border: #2e3350;
  --text: #e2e8f0;
  --muted: #8892a4;
  --accent: #6c8cff;
  --accent2: #a78bfa;
  --green: #4ade80;
  --red: #f87171;
  --yellow: #fbbf24;
  --teal: #2dd4bf;
  --tag-bg: #1e2240;
  --nav-width: 240px;
  --code-color: #7dd3fc;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.7;
  display: flex;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
code {
  background: var(--tag-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.85em;
  color: var(--code-color);
}
pre {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  overflow-x: auto;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 13px;
  color: var(--code-color);
  line-height: 1.6;
  margin: 12px 0;
}
pre code { background: none; border: none; padding: 0; font-size: inherit; }

/* ── Sidebar Nav ── */
#nav {
  width: var(--nav-width);
  background: var(--bg2);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  z-index: 200;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease;
}
.nav-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}
.nav-logo a {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
}
.nav-logo a:hover { text-decoration: none; }
.nav-logo span { font-size: 22px; }
.nav-tagline {
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
}
.nav-section {
  padding: 10px 12px 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--muted);
  text-transform: uppercase;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 14px;
  color: var(--muted);
  border-radius: 0;
  transition: background 0.15s, color 0.15s;
  position: relative;
}
.nav-link:hover { background: var(--bg3); color: var(--text); text-decoration: none; }
.nav-link.active { color: var(--accent); background: rgba(108,140,255,0.08); }
.nav-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 4px; bottom: 4px;
  width: 3px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}
.nav-link .nav-icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
.nav-footer {
  margin-top: auto;
  padding: 16px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--muted);
}
.nav-footer a { color: var(--muted); }
.nav-footer a:hover { color: var(--accent); }

/* ── Mobile header ── */
#mobile-header {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 52px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  z-index: 300;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
}
.hamburger {
  background: none;
  border: none;
  color: var(--text);
  font-size: 22px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}
.mobile-logo {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}
#overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 190;
}
#overlay.open { display: block; }

/* ── Main Content ── */
#main {
  margin-left: var(--nav-width);
  flex: 1;
  min-width: 0;
}
.page {
  max-width: 860px;
  padding: 48px 40px 80px;
}

/* ── Page Hero ── */
.page-hero {
  margin-bottom: 40px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}
.page-hero h1 {
  font-size: 32px;
  font-weight: 700;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
  line-height: 1.2;
}
.page-hero p {
  font-size: 16px;
  color: var(--muted);
  max-width: 600px;
}

/* ── Section headings ── */
h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin: 36px 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
h2::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
  margin-left: 8px;
}
h3 { font-size: 16px; font-weight: 600; color: var(--text); margin: 24px 0 8px; }

/* ── Callout boxes ── */
.callout {
  border-radius: 8px;
  padding: 12px 16px;
  margin: 16px 0;
  font-size: 14px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border-left: 3px solid;
}
.callout-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.callout.info { background: rgba(108,140,255,0.08); border-color: var(--accent); color: var(--text); }
.callout.warn { background: rgba(251,191,36,0.08); border-color: var(--yellow); color: var(--text); }
.callout.tip { background: rgba(74,222,128,0.08); border-color: var(--green); color: var(--text); }
.callout.danger { background: rgba(248,113,113,0.08); border-color: var(--red); color: var(--text); }

/* ── Steps ── */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 16px 0; }
.steps li {
  counter-increment: step;
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  align-items: flex-start;
}
.steps li::before {
  content: counter(step);
  width: 28px; height: 28px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.step-body { flex: 1; padding-top: 3px; font-size: 14px; line-height: 1.6; }
.step-body strong { color: var(--text); }

/* ── Command block ── */
.cmd-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--code-color);
  margin: 10px 0;
  overflow-x: auto;
  white-space: pre;
}

/* ── Badge / pill ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
}
.badge-enabled { background: #166534; color: #4ade80; border: 1px solid #166534; }
.badge-disabled { background: #3d2020; color: #f87171; border: 1px solid #7f1d1d; }
.badge-builtin { background: var(--tag-bg); color: var(--muted); border: 1px solid var(--border); }
.badge-official { background: #2d1b69; color: #a78bfa; border: 1px solid #4c1d95; }
.badge-local { background: #1a2d1a; color: #4ade80; border: 1px solid #166534; }
.cat-badge { background: var(--tag-bg); color: var(--accent); border: 1px solid var(--border); font-size: 11px; border-radius: 4px; padding: 2px 8px; font-weight: 500; }

/* ── Tag list ── */
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.tag {
  background: var(--tag-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 9px;
  font-size: 12px;
  color: var(--muted);
}

/* ── Cards (index page) ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 24px;
}
.index-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  transition: border-color 0.2s, transform 0.15s;
  text-decoration: none;
  display: block;
  color: var(--text);
}
.index-card:hover { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
.index-card .icon { font-size: 28px; margin-bottom: 10px; display: block; }
.index-card h3 { font-size: 15px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.index-card p { font-size: 13px; color: var(--muted); line-height: 1.5; }

/* ── Hero (index only) ── */
.hero {
  background: linear-gradient(135deg, #1a1d27 0%, #0f1117 60%, #141025 100%);
  border-bottom: 1px solid var(--border);
  padding: 60px 40px 48px;
  text-align: center;
}
.hero h1 {
  font-size: 40px;
  font-weight: 800;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 12px;
}
.hero .subtitle { font-size: 17px; color: var(--muted); max-width: 560px; margin: 0 auto 28px; }
.hero-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 11px 24px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-primary:hover { opacity: 0.88; text-decoration: none; color: #fff; }
.btn-secondary {
  background: var(--bg3);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 11px 24px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: border-color 0.2s;
}
.btn-secondary:hover { border-color: var(--accent); text-decoration: none; color: var(--text); }

/* ── Table ── */
table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 14px; }
th { background: var(--bg3); color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg3); }

/* ── Breadcrumb ── */
.breadcrumb { font-size: 13px; color: var(--muted); margin-bottom: 20px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { color: var(--border); }

/* ── Skill detail specific ── */
.skill-header { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 24px; }
.skill-icon-lg {
  width: 56px; height: 56px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
}
.skill-header-meta { flex: 1; }
.skill-header-meta h1 { font-size: 26px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.skill-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.skill-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; }
.skill-nav-btn {
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.skill-nav-btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.setup-steps { list-style: none; padding: 0; margin: 12px 0; counter-reset: setup-step; }
.setup-steps li {
  counter-increment: setup-step;
  display: flex;
  gap: 14px;
  margin-bottom: 14px;
  align-items: flex-start;
  font-size: 14px;
  line-height: 1.6;
}
.setup-steps li::before {
  content: counter(setup-step);
  min-width: 24px; height: 24px;
  background: rgba(108,140,255,0.15);
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  #nav { transform: translateX(-100%); }
  #nav.open { transform: translateX(0); }
  #mobile-header { display: flex; }
  #main { margin-left: 0; padding-top: 52px; }
  .page { padding: 24px 16px 60px; }
  .hero { padding: 40px 20px 36px; }
  .hero h1 { font-size: 28px; }
  .hero .subtitle { font-size: 15px; }
  .card-grid { grid-template-columns: 1fr; }
  h2 { font-size: 18px; }
  .skill-header { flex-direction: column; gap: 12px; }
  table { font-size: 13px; }
}
