:root {
  --bg: #0a0e14;
  --bg-secondary: #12171f;
  --bg-card: #151b24;
  --text: #c9d1d9;
  --text-muted: #6e7681;
  --accent: #58a6ff;
  --accent2: #7ee787;
  --accent3: #d2a8ff;
  --warn: #ffbd2e;
  --border: #21262d;
  --glow: rgba(88, 166, 255, 0.15);
  --font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', Consolas, monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.7;
  padding-top: 52px;
  overflow-x: hidden;
}

/* --- Navbar --- */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(10, 14, 20, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
}
.nav-inner {
  max-width: 920px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 52px;
}
.nav-logo { font-size: 1.1rem; font-weight: 700; color: var(--accent); text-decoration: none; }
.nav-toggle {
  display: none; background: none; border: none; color: var(--text-muted);
  font-size: 1.4rem; cursor: pointer; padding: 4px 8px;
}
.nav-links { display: flex; gap: 20px; }
.nav-links a { color: var(--text-muted); font-size: 0.85rem; text-decoration: none; transition: color 0.2s; }
.nav-links a:hover { color: var(--text); }

/* Skip link (accessibility) */
.skip-link {
  position: absolute; top: -100%; left: 16px;
  background: var(--accent); color: var(--bg); padding: 8px 16px;
  border-radius: 6px; font-size: 0.85rem; z-index: 200;
  transition: top 0.2s;
}
.skip-link:focus { top: 8px; }

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

.container { max-width: 920px; margin: 0 auto; padding: 0 24px; }

/* --- Hero --- */
.hero {
  text-align: center;
  padding: 120px 0 80px;
  position: relative;
}
.hero::before {
  content: '';
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 600px; height: 400px;
  background: radial-gradient(ellipse at center, rgba(88,166,255,0.08) 0%, transparent 70%);
  pointer-events: none;
}
.hero h1 {
  font-size: 4.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
  line-height: 1.1;
}
.hero h1 .gradient {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent3) 50%, var(--accent2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero .tagline {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 36px;
  font-family: var(--font-sans);
  font-weight: 400;
}
.hero .badges { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 32px; }

/* Animated install command (hero) */
.install-cmd {
  display: inline-block;
  position: relative;
  background: var(--bg-secondary);
  border-radius: 10px;
  padding: 14px 28px;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--accent2);
  cursor: pointer;
  transition: transform 0.2s;
  z-index: 1;
}
.install-cmd::before { content: '$ '; color: var(--text-muted); }
.install-cmd::after {
  content: '';
  position: absolute; inset: -1px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--accent), var(--accent3), var(--accent2), var(--accent));
  background-size: 300% 300%;
  animation: border-glow 4s ease infinite;
  z-index: -1;
  opacity: 0.6;
}
.install-cmd:hover { transform: translateY(-1px); }
.install-cmd:hover::after { opacity: 1; }
.install-cmd:hover .install-tooltip,
.install-tooltip.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.install-tooltip {
  position: absolute; bottom: -36px; left: 50%; transform: translateX(-50%) translateY(-4px);
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 6px;
  padding: 4px 12px; font-size: 0.75rem; color: var(--text-muted); white-space: nowrap;
  opacity: 0; transition: opacity 0.2s, transform 0.2s; pointer-events: none;
  font-family: var(--font-sans);
}

@keyframes border-glow {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* --- Section base --- */
section {
  padding: 80px 0;
  border-bottom: 1px solid var(--border);
}
section:last-of-type { border-bottom: none; }
section h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 32px;
  color: #f0f6fc;
}
section h2 .dim { color: var(--text-muted); font-weight: 400; }

/* --- Feature grid --- */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.feature {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 24px;
  transition: border-color 0.3s, transform 0.2s;
}
.feature:hover { border-color: var(--accent); transform: translateY(-2px); }
.feature-icon {
  font-size: 1.5rem;
  margin-bottom: 12px;
  display: inline-block;
  width: 40px; height: 40px;
  line-height: 40px;
  text-align: center;
  background: rgba(88,166,255,0.08);
  border-radius: 8px;
}
.feature h3 { font-size: 0.95rem; color: #f0f6fc; margin-bottom: 6px; }
.feature p { color: var(--text-muted); font-size: 0.82rem; line-height: 1.5; font-family: var(--font-sans); }

/* --- Terminal demos --- */
.terminal-demos { display: flex; flex-direction: column; gap: 24px; }
.terminal-window {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #0d1117;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.terminal-header {
  background: #161b22;
  padding: 12px 16px;
  display: flex; align-items: center; gap: 8px;
}
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.dot.red { background: #ff5f57; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #28c840; }
.terminal-title { color: var(--text-muted); font-size: 0.8rem; margin-left: 8px; }
.terminal-body { padding: 20px 24px; overflow-x: auto; }
.terminal-body pre {
  background: none; border: none; padding: 0; margin: 0;
  font-size: 0.85rem; line-height: 1.6;
}
.t-prompt { color: #28c840; font-weight: bold; }
.t-cmd { color: #f0f6fc; }
.t-border { color: #444; }
.t-header { color: #ccc; font-weight: bold; }
.t-key { color: var(--accent); }
.t-str { color: var(--accent2); }
.t-num { color: var(--warn); }
.t-type { color: var(--accent3); }
.t-meta { color: var(--text-muted); }
.t-flag { color: var(--accent); }
.t-added { color: var(--accent2); }
.t-removed { color: #ff7b72; }
.t-changed { color: var(--warn); }

/* Typing animation */
.typing-cmd {
  display: inline-block; overflow: hidden; white-space: nowrap;
  border-right: 2px solid var(--accent2);
  width: 0;
  animation: typing 1.2s steps(24) 0.5s forwards, blink-caret 0.6s step-end 4;
}
.typing-output { opacity: 0; animation: fade-in 0.4s ease 2s forwards; }
@keyframes typing { from { width: 0; } to { width: 24ch; border-right-color: transparent; } }
@keyframes blink-caret { 50% { border-right-color: transparent; } }
@keyframes fade-in { to { opacity: 1; } }

/* --- Code blocks --- */
pre {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  overflow-x: auto;
  margin: 16px 0;
  font-size: 0.88rem;
  position: relative;
}
code { font-family: var(--font-mono); background: var(--bg-card); padding: 2px 6px; border-radius: 4px; font-size: 0.9em; }
pre code { background: none; padding: 0; }
.comment { color: var(--text-muted); }
.cmd { color: var(--accent2); }
.flag { color: var(--accent); }

/* --- Examples grid --- */
.examples { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.example-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  transition: border-color 0.3s;
}
.example-card:hover { border-color: var(--accent); }
.example-card h3 {
  font-size: 0.82rem; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 12px;
}
.example-card pre { margin: 0; border: none; background: none; padding: 0; }

/* --- Table --- */
table { width: 100%; border-collapse: collapse; margin: 16px 0; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border); }
th { color: var(--accent); font-weight: 600; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; }
tr:hover { background: var(--bg-secondary); }

/* --- Tabs --- */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 0; }
.tab-btn {
  background: none; border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-mono); font-size: 0.88rem;
  padding: 10px 20px; cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* --- Copy btn --- */
.copy-btn {
  position: absolute; top: 10px; right: 10px;
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text-muted);
  cursor: pointer; font-size: 0.75rem; padding: 4px 8px;
  opacity: 0; transition: opacity 0.2s;
  font-family: var(--font-sans);
}
pre:hover .copy-btn { opacity: 1; }
.copy-btn:hover { color: var(--text); border-color: var(--accent); }
.copy-btn.copied { color: var(--accent2); border-color: var(--accent2); }

/* Focus-visible styles for keyboard navigation */
*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.tab-btn:focus-visible { outline-offset: -2px; }
.install-cmd:focus-visible { outline-offset: 4px; border-radius: 10px; }

/* --- Scroll fade-in --- */
.fade-up {
  opacity: 0; transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-up.visible { opacity: 1; transform: translateY(0); }

/* --- Footer --- */
footer { text-align: center; padding: 48px 0; color: var(--text-muted); font-size: 0.85rem; }
.footer-links { display: flex; gap: 20px; justify-content: center; margin-top: 12px; }
.footer-links a { color: var(--text-muted); font-size: 0.8rem; }
.footer-links a:hover { color: var(--accent); }

/* --- Responsive --- */
@media (max-width: 960px) {
  .features { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .hero h1 { font-size: 2.5rem; }
  .hero { padding: 80px 0 60px; }
  .features { grid-template-columns: 1fr; }
  .examples { grid-template-columns: 1fr; }
  section { padding: 48px 0; }
  .tab-btn { padding: 8px 14px; font-size: 0.82rem; }
  .nav-toggle { display: block; }
  .nav-links {
    display: none; position: absolute; top: 52px; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: rgba(10, 14, 20, 0.98); border-bottom: 1px solid var(--border);
    padding: 8px 0;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 10px 24px; font-size: 0.88rem; }
  .nav-links a:hover { background: var(--bg-secondary); }
  table { font-size: 0.82rem; }
  th, td { padding: 8px 10px; }
}
