:root {
  --primary: #1a56db;
  --primary-dark: #1e40af;
  --primary-light: #e8effc;
  --accent: #059669;
  --accent-light: #d1fae5;
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --text: #1f2937;
  --text-light: #6b7280;
  --text-lighter: #9ca3af;
  --border: #e5e7eb;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.1);
  --radius: 10px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans SC', 'PingFang SC', Roboto, sans-serif;
  --mono: 'SF Mono', 'Fira Code', 'JetBrains Mono', Consolas, monospace;
}

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

html { scroll-behavior: smooth; }

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

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

/* ===== Hero ===== */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 50%, #3730a3 100%);
  color: white;
  padding: 80px 24px 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle at 30% 70%, rgba(255,255,255,0.08) 0%, transparent 50%),
              radial-gradient(circle at 70% 30%, rgba(255,255,255,0.06) 0%, transparent 50%);
  animation: float 20s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(-2%, 2%) rotate(3deg); }
}
.hero-content { position: relative; z-index: 1; max-width: 720px; margin: 0 auto; }
.hero h1 { font-size: 48px; font-weight: 800; margin-bottom: 12px; letter-spacing: -1px; }
.hero .subtitle { font-size: 18px; opacity: 0.9; margin-bottom: 32px; font-weight: 400; }
.hero .badges { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 28px; }
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(255,255,255,0.15); backdrop-filter: blur(8px);
  padding: 5px 14px; border-radius: 20px; font-size: 13px;
  border: 1px solid rgba(255,255,255,0.2);
}
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 24px; border-radius: 8px; font-weight: 600;
  font-size: 14px; transition: all 0.2s; cursor: pointer; border: none;
}
.btn-primary { background: white; color: var(--primary); }
.btn-primary:hover { background: #f1f5f9; text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.btn-outline { background: transparent; color: white; border: 1.5px solid rgba(255,255,255,0.4); }
.btn-outline:hover { background: rgba(255,255,255,0.1); text-decoration: none; }

/* ===== Search Bar ===== */
.search-section { max-width: 600px; margin: -28px auto 0; padding: 0 24px; position: relative; z-index: 2; }
.search-box {
  display: flex; align-items: center;
  background: white; border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 6px 6px 6px 18px;
  border: 1px solid var(--border);
}
.search-box .icon { color: var(--text-lighter); font-size: 18px; margin-right: 10px; }
.search-box input {
  flex: 1; border: none; outline: none; font-size: 15px;
  font-family: var(--font); color: var(--text);
  padding: 10px 0; background: transparent;
}
.search-box input::placeholder { color: var(--text-lighter); }
.search-box .btn-search {
  background: var(--primary); color: white; border: none;
  padding: 10px 20px; border-radius: 8px; font-weight: 600;
  font-size: 13px; cursor: pointer; font-family: var(--font);
  transition: background 0.2s;
}
.search-box .btn-search:hover { background: var(--primary-dark); }

/* ===== Container ===== */
.container { max-width: 960px; margin: 0 auto; padding: 48px 24px; }

/* ===== Section ===== */
.section-title {
  font-size: 22px; font-weight: 700; margin-bottom: 8px;
  display: flex; align-items: center; gap: 8px;
}
.section-desc { color: var(--text-light); margin-bottom: 28px; font-size: 14px; }

/* ===== How it works ===== */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 48px; }
.step {
  background: var(--card-bg); border-radius: var(--radius);
  padding: 24px 20px; border: 1px solid var(--border);
  box-shadow: var(--shadow); text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}
.step:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.step-num {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--primary-light); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px; margin: 0 auto 14px;
}
.step h3 { font-size: 15px; margin-bottom: 6px; }
.step p { font-size: 13px; color: var(--text-light); line-height: 1.5; }
.step code {
  background: var(--primary-light); color: var(--primary-dark);
  padding: 2px 8px; border-radius: 4px; font-family: var(--mono);
  font-size: 12px; font-weight: 600; display: inline-block; margin-top: 6px;
}

/* ===== Features ===== */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-bottom: 48px; }
.feature {
  background: var(--card-bg); border-radius: var(--radius);
  padding: 20px; border: 1px solid var(--border); box-shadow: var(--shadow);
}
.feature-icon { font-size: 24px; margin-bottom: 10px; }
.feature h3 { font-size: 15px; margin-bottom: 6px; }
.feature p { font-size: 13px; color: var(--text-light); line-height: 1.5; }

/* ===== Cheatsheet List ===== */
.list-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}
.list-count { font-size: 13px; color: var(--text-light); }
.cheatsheet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.cheatsheet-card {
  background: var(--card-bg); border-radius: var(--radius);
  padding: 18px; border: 1px solid var(--border);
  box-shadow: var(--shadow); text-decoration: none; color: var(--text);
  transition: all 0.2s; display: block;
}
.cheatsheet-card:hover {
  transform: translateY(-2px); box-shadow: var(--shadow-lg);
  border-color: var(--primary); text-decoration: none;
}
.card-repo {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 13px; color: var(--text-light);
  margin-bottom: 8px;
}
.card-name { font-size: 16px; font-weight: 700; margin-bottom: 6px; color: var(--text); }
.card-desc { font-size: 13px; color: var(--text-light); line-height: 1.5; margin-bottom: 12px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.card-type {
  background: var(--primary-light); color: var(--primary);
  padding: 2px 8px; border-radius: 4px; font-weight: 600; font-size: 11px;
}
.card-date { color: var(--text-lighter); }

.empty-state {
  text-align: center; padding: 60px 20px; color: var(--text-light);
}
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* ===== Code example ===== */
.example-box {
  background: #1e293b; color: #e2e8f0; border-radius: var(--radius);
  padding: 20px 24px; font-family: var(--mono); font-size: 13px;
  line-height: 1.7; margin: 20px 0; overflow-x: auto;
}
.example-box .comment { color: #64748b; }
.example-box .cmd { color: #7dd3fc; }
.example-box .hl { color: #fbbf24; }

/* ===== Footer ===== */
.footer {
  text-align: center; padding: 32px 24px; font-size: 13px;
  color: var(--text-lighter); border-top: 1px solid var(--border);
  margin-top: 48px;
}
.footer a { color: var(--text-light); }

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .hero { padding: 60px 20px 50px; }
  .hero h1 { font-size: 32px; }
  .hero .subtitle { font-size: 15px; }
  .container { padding: 32px 16px; }
  .steps { grid-template-columns: 1fr; }
  .features { grid-template-columns: 1fr; }
  .cheatsheet-grid { grid-template-columns: 1fr; }
}

/* ===== Type badge colors ===== */
.type-lib { background: #dbeafe; color: #1d4ed8; }
.type-cli { background: #fef3c7; color: #92400e; }
.type-web { background: #d1fae5; color: #065f46; }
.type-middleware { background: #fce7f3; color: #9d174d; }
.type-ai { background: #e9d5ff; color: #6b21a8; }
.type-script { background: #f3f4f6; color: #374151; }
