:root {
  --bg: #0d1117;
  --bg2: #10151f;
  --panel: #161b26;
  --panel2: #1f2733;
  --border: #2b3442;
  --text: #e6edf3;
  --muted: #8b949e;
  --green: #3fb950;
  --green2: #2ea043;
  --blue: #58a6ff;
  --yellow: #d29922;
  --red: #f85149;
  --mono: "SF Mono", "JetBrains Mono", "Fira Code", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  overflow-x: hidden;
}

.bg-grid {
  position: fixed; inset: 0; z-index: -2;
  background-image:
    linear-gradient(rgba(139, 148, 158, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 148, 158, 0.05) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, black 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, black 40%, transparent 100%);
}

.bg-glow {
  position: fixed; z-index: -1;
  top: -300px; left: 50%; transform: translateX(-50%);
  width: 900px; height: 600px;
  background: radial-gradient(closest-side, rgba(63, 185, 80, 0.14), transparent);
  pointer-events: none;
}

/* ---------- Nav ---------- */
.nav {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1100px; margin: 0 auto; padding: 22px 24px;
}

.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-weight: 700; font-size: 1.15rem;
  color: var(--text); text-decoration: none;
}

.nav nav { display: flex; align-items: center; gap: 26px; }

.nav nav a {
  color: var(--muted); text-decoration: none; font-size: 0.95rem;
  transition: color 0.2s;
}
.nav nav a:hover { color: var(--text); }

.nav .gh {
  display: flex; align-items: center; gap: 8px;
  background: var(--panel); border: 1px solid var(--border);
  padding: 8px 16px; border-radius: 10px; color: var(--text);
}
.nav .gh:hover { border-color: var(--green); }

/* ---------- Hero ---------- */
.hero {
  max-width: 1100px; margin: 0 auto; padding: 70px 24px 40px;
  text-align: center;
}

.badge {
  display: inline-block; font-family: var(--mono); font-size: 0.8rem;
  color: var(--green); background: rgba(63, 185, 80, 0.1);
  border: 1px solid rgba(63, 185, 80, 0.3);
  padding: 6px 16px; border-radius: 999px; margin-bottom: 28px;
}

h1 {
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  line-height: 1.1; letter-spacing: -0.03em; font-weight: 800;
}

.grad {
  background: linear-gradient(90deg, var(--green), var(--blue));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.sub {
  color: var(--muted); font-size: 1.2rem; max-width: 560px;
  margin: 22px auto 36px;
}

.cta-row {
  display: flex; gap: 14px; justify-content: center; flex-wrap: wrap;
  margin-bottom: 60px;
}

.cmd {
  font-family: var(--mono); font-size: 1rem; color: var(--text);
  background: var(--panel); border: 1px solid var(--border);
  padding: 14px 22px; border-radius: 12px; cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  transition: border-color 0.2s, transform 0.15s;
}
.cmd:hover { border-color: var(--green); transform: translateY(-1px); }
.cmd .prompt { color: var(--green); }
.cmd .copy-ic { color: var(--muted); }
.cmd.copied { border-color: var(--green); }
.cmd.copied .copy-ic { color: var(--green); }

.btn {
  display: inline-flex; align-items: center; padding: 14px 24px;
  border-radius: 12px; text-decoration: none; font-weight: 600;
  transition: border-color 0.2s, transform 0.15s;
}
.btn.ghost { color: var(--text); border: 1px solid var(--border); }
.btn.ghost:hover { border-color: var(--blue); transform: translateY(-1px); }

/* ---------- Terminal demo ---------- */
.terminal {
  max-width: 900px; margin: 0 auto; text-align: left;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 14px; overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(63, 185, 80, 0.06);
  font-family: var(--mono); font-size: 0.82rem;
}

.term-bar {
  display: flex; align-items: center; gap: 8px;
  background: var(--panel2); padding: 11px 16px;
  border-bottom: 1px solid var(--border);
}
.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot.red { background: #ff5f57; } .dot.yellow { background: #febc2e; } .dot.green { background: #28c840; }
.term-title { color: var(--muted); font-size: 0.78rem; margin-left: 10px; }

.term-body { padding: 14px 16px 12px; }

.term-header {
  border: 1px solid var(--green2); border-radius: 6px;
  padding: 4px 12px; color: var(--muted); margin-bottom: 10px;
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.status { color: var(--green); }

.term-cols { display: flex; gap: 10px; min-height: 300px; }

.pane {
  border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px;
}
.pane.focused { border-color: var(--green); }
.sidebar { width: 240px; flex-shrink: 0; }
.main-pane { flex: 1; overflow: hidden; }

.pane-title { font-weight: 700; text-decoration: underline; margin-bottom: 4px; }
.muted { color: var(--muted); }
.cyan { color: #39c5cf; }
.green { color: var(--green); }
.yellow { color: var(--yellow); }
.spacer { height: 10px; }

.row { padding: 1px 4px; border-radius: 3px; white-space: nowrap; }
.row.hdr { color: var(--yellow); font-weight: 700; }
.row.sel { background: #1f4fd8; color: #fff; }
.row.sel .green, .row.sel .yellow { color: #fff; }

.graph { line-height: 1.5; overflow: hidden; }
.g1 { color: var(--green); } .g2 { color: var(--blue); }
.hash { color: var(--yellow); }
.ref { color: #39c5cf; } .ref2 { color: var(--blue); }

.view.hidden { display: none; }
.split { display: flex; gap: 10px; }
.status-pane { width: 46%; }
.diff-pane { flex: 1; overflow: hidden; }

.diff { line-height: 1.5; overflow: hidden; }
.hunk { color: #39c5cf; }
.add { color: var(--green); } .del { color: var(--red); }

.input-line {
  border: 1px solid var(--border); border-radius: 4px;
  padding: 2px 8px; min-height: 24px; margin-top: 2px;
}
.caret {
  display: inline-block; width: 8px; height: 15px;
  background: var(--green); vertical-align: text-bottom;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.term-keys { color: var(--muted); margin-top: 10px; font-size: 0.75rem; text-align: center; }

/* ---------- Sections ---------- */
section { max-width: 1100px; margin: 0 auto; padding: 90px 24px 30px; }

h2 {
  font-size: clamp(1.7rem, 4vw, 2.4rem); letter-spacing: -0.02em;
  text-align: center; margin-bottom: 48px;
}

.grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
}

.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 14px; padding: 26px;
  transition: border-color 0.2s, transform 0.2s;
}
.card:hover { border-color: rgba(63, 185, 80, 0.5); transform: translateY(-3px); }
.card .ic { font-size: 1.6rem; margin-bottom: 12px; }
.card h3 { margin-bottom: 8px; font-size: 1.1rem; }
.card p { color: var(--muted); font-size: 0.95rem; }
.card code, .card kbd {
  font-family: var(--mono); font-size: 0.85em;
  background: var(--panel2); padding: 2px 7px; border-radius: 5px;
}

/* ---------- Keys ---------- */
.keys-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}
.keys-col {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 14px; padding: 26px;
}
.keys-col h3 { color: var(--green); font-family: var(--mono); font-size: 1rem; margin-bottom: 16px; }
.keys-col ul { list-style: none; }
.keys-col li {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 0; border-bottom: 1px solid rgba(43, 52, 66, 0.6);
}
.keys-col li:last-child { border-bottom: none; }
.keys-col span { color: var(--muted); margin-left: auto; font-size: 0.92rem; }
kbd {
  font-family: var(--mono); font-size: 0.8rem;
  background: var(--panel2); border: 1px solid var(--border);
  border-bottom-width: 2px; border-radius: 6px; padding: 3px 9px;
  min-width: 30px; text-align: center; display: inline-block;
}

/* ---------- Install ---------- */
.install-box {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}
.install-step {
  display: flex; gap: 16px; background: var(--panel);
  border: 1px solid var(--border); border-radius: 14px; padding: 26px;
}
.step-n {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: rgba(63, 185, 80, 0.12); color: var(--green);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-weight: 700;
}
.install-step p { color: var(--muted); margin-bottom: 10px; font-size: 0.95rem; }
code.block {
  display: block; font-family: var(--mono); font-size: 0.9rem;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 14px; color: var(--green);
}

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--border); margin-top: 90px; }
.foot-inner {
  max-width: 1100px; margin: 0 auto; padding: 30px 24px;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 16px;
}
footer nav { display: flex; gap: 22px; }
footer a { color: var(--muted); text-decoration: none; font-size: 0.92rem; }
footer a:hover { color: var(--text); }

@media (max-width: 720px) {
  .nav nav a:not(.gh) { display: none; }
  .sidebar { display: none; }
  .status-pane { width: 100%; }
  .split { flex-direction: column; }
}
