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

:root {
  --bg: #ffffff;
  --fg: #09090b;
  --muted: #71717a;
  --border: #e4e4e7;
  --surface: #fafafa;
  --surface-hover: #f4f4f5;
  --code-bg: #18181b;
  --code-fg: #e4e4e7;
  --radius: 6px;
  --radius-lg: 10px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', ui-monospace, monospace;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--fg);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

/* ── NAV ──────────────────────────────────────────────────────────── */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.nav-logo {
  font-size: 15px;
  font-weight: 600;
  color: var(--fg);
  text-decoration: none;
  letter-spacing: -0.01em;
}

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

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.15s;
}

.nav-links a:hover {
  color: var(--fg);
}

.nav-github {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--fg) !important;
  font-size: 14px !important;
  font-weight: 500;
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: var(--radius);
  transition: background 0.15s !important;
}

.nav-github:hover {
  background: var(--surface-hover) !important;
}

/* ── HERO ─────────────────────────────────────────────────────────── */

.hero {
  padding: 96px 0 80px;
  border-bottom: 1px solid var(--border);
}

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 20px;
}

.badge {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 999px;
}

.hero h1 {
  font-size: clamp(40px, 6vw, 64px);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: var(--fg);
}

.hero-sub {
  max-width: 520px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.install-block {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--code-bg);
  border-radius: var(--radius);
  padding: 10px 16px;
  max-width: 100%;
  overflow: hidden;
}

.install-block code {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--code-fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.copy-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #71717a;
  padding: 0 0 0 12px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  transition: color 0.15s;
}

.copy-btn:hover {
  color: #e4e4e7;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.hero-note {
  font-size: 12px;
  color: #a1a1aa;
}

/* ── BUTTONS ──────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: opacity 0.15s, background 0.15s;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--fg);
  color: var(--bg);
}

.btn-primary:hover {
  opacity: 0.85;
}

.btn-outline {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  background: var(--surface-hover);
}

/* ── FEATURES ─────────────────────────────────────────────────────── */

.features {
  padding: 80px 0;
  border-bottom: 1px solid var(--border);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.feature-card {
  background: var(--bg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.feature-icon {
  font-size: 20px;
  line-height: 1;
}

.feature-card h3 {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.feature-card p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}

.feature-card code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: 4px;
}

/* ── COMMANDS ─────────────────────────────────────────────────────── */

.commands-section {
  padding: 80px 0;
  border-bottom: 1px solid var(--border);
}

.section-title {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}

.section-sub {
  color: var(--muted);
  font-size: 15px;
  margin-bottom: 40px;
}

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

.command-group {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
}

.command-group h4 {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 12px;
}

.command-group ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.command-group li {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.command-group code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--fg);
}

/* ── EXAMPLES ─────────────────────────────────────────────────────── */

.examples-section {
  padding: 80px 0;
  border-bottom: 1px solid var(--border);
}

.examples-tabs {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.tab-list {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.tab {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s;
  font-family: var(--font);
}

.tab:hover {
  color: var(--fg);
}

.tab.active {
  color: var(--fg);
  border-bottom-color: var(--fg);
}

.tab-content {
  position: relative;
}

.code-block {
  display: none;
  background: var(--code-bg);
  color: var(--code-fg);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  padding: 24px 28px;
  overflow-x: auto;
  white-space: pre;
  margin: 0;
  border-radius: 0;
}

.code-block.active {
  display: block;
}

.code-block .c {
  color: #52525b;
}

/* ── CODE COPY BUTTON (injected) ──────────────────────────────────── */

.code-copy-wrap {
  position: relative;
}

.code-copy-wrap .code-block,
.code-copy-wrap .code-line {
  display: block; /* override tab hide — wrap manages visibility */
}

.code-copy-wrap .code-block {
  display: none;
}

.code-copy-wrap .code-block.active {
  display: block;
}

.code-copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #27272a;
  border: 1px solid #3f3f46;
  border-radius: var(--radius);
  color: #71717a;
  cursor: pointer;
  padding: 5px 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
  z-index: 10;
}

.code-copy-wrap:hover .code-copy-btn {
  opacity: 1;
}

.code-copy-btn:hover,
.code-copy-btn.copied {
  color: #e4e4e7;
}

/* For .code-line wrappers (light background) */
.code-copy-wrap .code-line ~ .code-copy-btn,
.code-copy-wrap:has(.code-line) .code-copy-btn {
  background: #f4f4f5;
  border-color: var(--border);
  color: var(--muted);
  top: 50%;
  transform: translateY(-50%);
  right: 8px;
}

.code-copy-wrap:has(.code-line) .code-copy-btn:hover,
.code-copy-wrap:has(.code-line) .code-copy-btn.copied {
  color: var(--fg);
}

/* ── INSTALL SECTION ──────────────────────────────────────────────── */

.install-section {
  padding: 80px 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.install-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.install-inner h2 {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.install-inner > p {
  color: var(--muted);
  margin-bottom: 16px;
}

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

.install-option {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.install-option h4 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.install-option p {
  font-size: 14px;
  color: var(--muted);
}

.code-line {
  background: var(--code-bg);
  border-radius: var(--radius);
  padding: 10px 14px;
  overflow-x: auto;
}

.code-line code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--code-fg);
  white-space: nowrap;
}

/* ── FOOTER ───────────────────────────────────────────────────────── */

.footer {
  padding: 32px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-logo {
  font-size: 14px;
  font-weight: 600;
}

.footer-note {
  font-size: 13px;
  color: var(--muted);
}

.footer-github {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}

.footer-github:hover {
  color: var(--fg);
}

/* ── RESPONSIVE ───────────────────────────────────────────────────── */

@media (max-width: 640px) {
  .nav-links a:not(.nav-github):not(:last-child) {
    display: none;
  }

  .hero {
    padding: 64px 0 56px;
  }

  .install-block code {
    font-size: 11px;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}
