:root {
  --bg: #0a0a12;
  --bg-elev: #111120;
  --bg-card: rgba(22, 22, 38, 0.6);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #e6e8ef;
  --text-dim: #9aa0b4;
  --text-faint: #6b7088;
  --accent: #8b9eff;
  --accent-2: #7ce0ff;
  --accent-glow: rgba(139, 158, 255, 0.35);
  --silver: #c8cbd9;
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --maxw: 1120px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
  overflow-x: hidden;
}

a { color: var(--text); text-decoration: none; transition: color 160ms ease; }
a:hover { color: var(--accent-2); }

button { font-family: inherit; cursor: pointer; }

/* Background ambience */
.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 30%, transparent 75%);
          mask-image: radial-gradient(ellipse at 50% 0%, #000 30%, transparent 75%);
  z-index: -2;
  pointer-events: none;
}
.bg-glow {
  position: fixed;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 1200px;
  height: 800px;
  background:
    radial-gradient(ellipse at 30% 40%, rgba(139, 158, 255, 0.18), transparent 60%),
    radial-gradient(ellipse at 70% 60%, rgba(124, 224, 255, 0.12), transparent 65%);
  filter: blur(40px);
  z-index: -1;
  pointer-events: none;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px 28px;
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
}
.site-header::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(10,10,18,0.7), rgba(10,10,18,0.0));
  z-index: -1;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.brand img {
  border-radius: 7px;
  background: rgba(255,255,255,0.03);
  padding: 2px;
}

.desktop-nav {
  display: flex;
  gap: 6px;
  align-items: center;
}
.desktop-nav a {
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 14px;
  color: var(--text-dim);
  font-weight: 500;
}
.desktop-nav a:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text);
}

.burger {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 40px;
  height: 40px;
  padding: 10px;
  flex-direction: column;
  justify-content: space-between;
}
.burger span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 200ms ease, opacity 200ms ease;
}
.burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav {
  position: fixed;
  top: 0;
  right: -300px;
  width: 280px;
  height: 100vh;
  background: var(--bg-elev);
  border-left: 1px solid var(--border);
  padding: 80px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: right 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 40;
}
.mobile-nav.open { right: 0; }
.mobile-nav a {
  padding: 12px 14px;
  border-radius: 10px;
  color: var(--text-dim);
  font-weight: 500;
}
.mobile-nav a:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
  z-index: 30;
}
.mobile-overlay.open { opacity: 1; pointer-events: auto; }

/* Hero */
.hero {
  max-width: var(--maxw);
  margin: 60px auto 0;
  padding: 40px 28px 100px;
  text-align: center;
}
.eyebrow {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(255,255,255,0.02);
  margin-bottom: 28px;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hero h1 {
  font-size: clamp(44px, 11vw, 112px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  margin: 0 0 24px;
  background: linear-gradient(180deg, #ffffff 0%, var(--silver) 60%, #8a90a8 100%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero .tagline {
  font-size: clamp(17px, 2.2vw, 21px);
  color: var(--text-dim);
  max-width: 620px;
  margin: 0 auto 44px;
  line-height: 1.5;
}

/* Install box */
.install {
  max-width: 720px;
  width: 100%;
  margin: 0 auto 40px;
}
.install-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 10px 10px 18px;
  width: 100%;
  min-width: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow:
    0 0 0 1px rgba(139, 158, 255, 0.04),
    0 30px 80px -20px rgba(0, 0, 0, 0.6),
    0 0 80px -20px var(--accent-glow);
}
.install-box .prompt {
  color: var(--accent);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 15px;
  font-weight: 500;
  user-select: none;
}
.install-box input {
  flex: 1 1 0;
  width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px;
  padding: 8px 4px;
  min-width: 0;
  text-overflow: ellipsis;
}
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(139, 158, 255, 0.12);
  border: 1px solid rgba(139, 158, 255, 0.25);
  color: var(--text);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  transition: background 160ms ease, transform 80ms ease;
}
.copy-btn:hover { background: rgba(139, 158, 255, 0.2); }
.copy-btn:active { transform: scale(0.97); }
.copy-btn.copied { background: rgba(124, 224, 255, 0.18); border-color: rgba(124, 224, 255, 0.4); }

.mirrors {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  padding: 0;
  margin: 16px 0 0;
}
.mirrors li button {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: all 160ms ease;
}
.mirrors li button:hover { color: var(--text); border-color: var(--border-strong); }
.mirrors li.current button {
  background: rgba(255,255,255,0.06);
  border-color: var(--border-strong);
  color: var(--text);
}

/* GitHub badges */
.github-info {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
.gh-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  transition: all 160ms ease;
}
.gh-btn:hover { color: var(--text); border-color: var(--border-strong); }
.gh-count {
  padding-left: 10px;
  margin-left: 4px;
  border-left: 1px solid var(--border);
  color: var(--text);
  font-variant-numeric: tabular-nums;
  display: none;
}
.gh-count.loaded { display: inline; }

/* Features */
.features {
  max-width: var(--maxw);
  margin: 40px auto;
  padding: 60px 28px;
  scroll-margin-top: 80px;
}
.section-head {
  text-align: center;
  margin-bottom: 56px;
}
.section-head h2 {
  font-size: clamp(32px, 4.5vw, 44px);
  font-weight: 600;
  letter-spacing: -0.025em;
  margin: 0 0 12px;
}
.section-head p {
  color: var(--text-dim);
  font-size: 17px;
  margin: 0;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.feature {
  position: relative;
  padding: 32px 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform 220ms ease, border-color 220ms ease, background 220ms ease;
}
.feature:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  background: rgba(28, 28, 46, 0.7);
}
.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(139, 158, 255, 0.18), rgba(124, 224, 255, 0.10));
  border: 1px solid rgba(139, 158, 255, 0.2);
  color: var(--accent-2);
  margin-bottom: 22px;
}
.feature h3 {
  font-size: 19px;
  font-weight: 600;
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}
.feature p {
  color: var(--text-dim);
  font-size: 15px;
  margin: 0;
  line-height: 1.6;
}

/* CTA */
.cta {
  max-width: var(--maxw);
  margin: 20px auto 80px;
  padding: 0 28px;
}
.cta-card {
  position: relative;
  padding: 56px 40px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(139, 158, 255, 0.15), transparent 70%),
    var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow: hidden;
}
.cta-card h2 {
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 600;
  letter-spacing: -0.025em;
  margin: 0 0 12px;
}
.cta-card p {
  color: var(--text-dim);
  max-width: 540px;
  margin: 0 auto 32px;
}
.cta-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.btn-primary, .btn-ghost {
  display: inline-flex;
  align-items: center;
  padding: 11px 22px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  transition: all 160ms ease;
}
.btn-primary {
  background: var(--text);
  color: #0a0a12;
}
.btn-primary:hover { background: #fff; color: #0a0a12; }
.btn-ghost {
  border: 1px solid var(--border-strong);
  color: var(--text);
}
.btn-ghost:hover { background: rgba(255,255,255,0.05); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  background: rgba(8, 8, 14, 0.6);
}
.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: var(--text-faint);
}
.footer-meta a { color: var(--text-dim); }
.footer-meta a:hover { color: var(--accent-2); }

/* Responsive */
@media (max-width: 820px) {
  .desktop-nav { display: none; }
  .burger { display: flex; }
  .feature-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 20px; padding-bottom: 60px; }
  .install-box { padding-left: 14px; }
  .copy-label { display: none; }
  .copy-btn { padding: 10px 12px; }
  .cta-card { padding: 40px 24px; }
}

@media (max-width: 480px) {
  .site-header { padding: 14px 18px; }
  .hero { padding-left: 18px; padding-right: 18px; }
  .features, .cta { padding-left: 18px; padding-right: 18px; }
  .install-box input { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
