:root {
  --bg: #0B1120;
  --bg-2: #111827;
  --bg-3: #1C2333;
  --fg: #E6EDF3;
  --fg-2: #8B949E;
  --fg-3: #6E7681;
  --accent: #3FB950;
  --accent-2: #22D3EE;
  --accent-dim: rgba(63, 185, 80, 0.12);
  --accent-2-dim: rgba(34, 211, 238, 0.12);
  --border: rgba(139, 148, 158, 0.15);
  --card-bg: #131B2E;
  --card-border: rgba(139, 148, 158, 0.1);
}

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

body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  line-height: 1.15;
}

/* NAV */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 17, 32, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.logo-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--accent);
  border-radius: 8px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 13px;
  color: #0B1120;
  letter-spacing: -0.5px;
}
.logo-text {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 16px;
  color: var(--fg);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}
.nav-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--fg-2);
  text-decoration: none;
  transition: color 0.15s;
}
.nav-link:hover { color: var(--fg); }
.nav-link-cta {
  padding: 8px 16px;
  background: var(--accent);
  color: #0B1120 !important;
  border-radius: 8px;
  font-weight: 600;
}
.nav-link-cta:hover { opacity: 0.9; }

/* HERO */
.hero {
  padding: 80px 0 60px;
  background: radial-gradient(ellipse 80% 50% at 50% -10%, rgba(63, 185, 80, 0.08) 0%, transparent 70%);
}
.hero-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 24px;
}
.eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.hero-headline {
  font-size: clamp(40px, 5vw, 64px);
  margin-bottom: 20px;
  letter-spacing: -0.03em;
}
.headline-accent { color: var(--accent); }
.hero-sub {
  font-size: 18px;
  color: var(--fg-2);
  line-height: 1.65;
  max-width: 440px;
}

/* HERO CARD */
.hero-card-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.tool-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4), 0 0 0 1px rgba(63,185,80,0.08);
}
.tool-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.tool-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-dim);
  flex-shrink: 0;
}
.tool-info { flex: 1; }
.tool-name { display: block; font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 16px; }
.tool-category { display: block; font-size: 12px; color: var(--fg-3); }
.tool-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--accent-dim);
  color: var(--accent);
  letter-spacing: 0.03em;
}
.tool-desc { font-size: 14px; color: var(--fg-2); line-height: 1.5; margin-bottom: 16px; }
.tool-meta {
  display: flex;
  gap: 20px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--fg);
  font-weight: 500;
}
.meta-item svg { opacity: 0.7; }
.tool-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--bg-3);
  color: var(--fg-2);
  border: 1px solid var(--border);
}
.hero-search-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--fg-3);
  justify-content: center;
  padding: 12px 16px;
  background: var(--bg-2);
  border-radius: 10px;
  border: 1px solid var(--border);
}

/* STATS */
.stats {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
}
.stats-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 36px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 48px;
}
.stat-item { text-align: center; }
.stat-value {
  display: block;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 32px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
}
.stat-label { font-size: 14px; color: var(--fg-2); }
.stat-divider {
  width: 1px;
  height: 40px;
  background: var(--border);
}

/* SECTIONS */
.section-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}
.section-header {
  text-align: center;
  margin-bottom: 60px;
}
.section-eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}
.section-title {
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: -0.025em;
  margin-bottom: 16px;
}
.section-sub {
  font-size: 18px;
  color: var(--fg-2);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.65;
}

/* HOW IT WORKS */
.how-it-works { padding: 100px 0; }
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.step-card {
  padding: 32px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  transition: border-color 0.2s;
}
.step-card:hover { border-color: rgba(63, 185, 80, 0.3); }
.step-num {
  display: block;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 48px;
  font-weight: 700;
  color: var(--accent);
  opacity: 0.3;
  margin-bottom: 20px;
}
.step-title {
  font-size: 20px;
  margin-bottom: 12px;
}
.step-desc { font-size: 15px; color: var(--fg-2); line-height: 1.65; }

/* REPO METRICS */
.repo-metrics { padding: 100px 0; background: var(--bg-2); }
.features-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 24px;
}
.feature-card {
  padding: 36px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
}
.feature-card-lg {
  grid-row: span 2;
  padding: 40px;
}
.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}
.feature-title {
  font-size: 20px;
  margin-bottom: 12px;
}
.feature-desc { font-size: 15px; color: var(--fg-2); line-height: 1.65; }
.feature-example {
  margin-top: 24px;
  background: var(--bg);
  border-radius: 12px;
  padding: 20px;
}
.example-row {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-family: 'Space Grotesk', monospace;
}
.example-row:last-child { border-bottom: none; }
.ex-name { flex: 1; color: var(--fg); font-weight: 600; }
.ex-stars { width: 80px; text-align: right; color: var(--accent); }
.ex-commit { width: 90px; text-align: right; color: var(--fg-2); }
.ex-issues { width: 80px; text-align: right; color: var(--fg-3); }

/* CLOSING */
.closing {
  padding: 120px 0;
  background: radial-gradient(ellipse 60% 40% at 50% 100%, rgba(63, 185, 80, 0.1) 0%, transparent 70%);
}
.closing-inner { max-width: 900px; margin: 0 auto; text-align: center; padding: 0 24px; }
.closing-title {
  font-size: clamp(32px, 5vw, 56px);
  letter-spacing: -0.03em;
  margin-bottom: 20px;
  line-height: 1.1;
}
.closing-sub { font-size: 20px; color: var(--fg-2); line-height: 1.6; margin-bottom: 60px; }
.closing-visual { display: flex; justify-content: center; }
.closing-card {
  background: var(--card-bg);
  border: 1px solid rgba(63, 185, 80, 0.2);
  border-radius: 20px;
  padding: 40px 48px;
  text-align: left;
  width: 100%;
  max-width: 540px;
  box-shadow: 0 0 80px rgba(63, 185, 80, 0.06);
}
.closing-card-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 28px;
}
.closing-metrics { display: flex; flex-direction: column; gap: 16px; }
.cm-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.cm-item:last-child { border-bottom: none; }
.cm-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 18px;
  font-weight: 600;
}
.cm-hint { font-size: 14px; color: var(--fg-3); }

/* FOOTER */
.footer {
  border-top: 1px solid var(--border);
  padding: 48px 0;
}
.footer-inner { max-width: 1140px; margin: 0 auto; padding: 0 24px; text-align: center; }
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.footer-name {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 16px;
}
.footer-tagline { font-size: 14px; color: var(--fg-2); margin-bottom: 4px; }
.footer-copy { font-size: 13px; color: var(--fg-3); }

/* RESPONSIVE */
@media (max-width: 768px) {
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .hero-card-wrap { order: -1; }
  .steps-grid { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr; }
  .feature-card-lg { grid-row: auto; }
  .stats-inner { flex-direction: column; gap: 24px; }
  .stat-divider { display: none; }
  .nav-links { display: none; }
}

/* ── Category Cards ── */
.categories-section { padding: 80px 0; }
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.category-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  text-decoration: none;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  position: relative;
}
.category-card:hover {
  border-color: rgba(63, 185, 80, 0.35);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}
.cat-emoji { font-size: 32px; line-height: 1; margin-bottom: 4px; }
.cat-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--fg);
  line-height: 1.3;
}
.cat-count { font-size: 12px; color: var(--fg-3); }
.cat-arrow {
  position: absolute;
  bottom: 20px;
  right: 20px;
  color: var(--fg-3);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.2s, transform 0.2s;
}
.category-card:hover .cat-arrow { opacity: 1; transform: translateX(0); }

/* ── Tools Grid ── */
.tools-section { padding: 0 0 80px; }
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.tool-grid-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  text-decoration: none;
  transition: border-color 0.2s, transform 0.15s;
}
.tool-grid-card:hover { border-color: rgba(63, 185, 80, 0.3); transform: translateY(-2px); }
.tgc-header { display: flex; align-items: flex-start; gap: 10px; }
.tgc-icon {
  width: 34px; height: 34px;
  border-radius: 8px;
  background: var(--accent-dim);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.tgc-meta { flex: 1; min-width: 0; }
.tgc-name {
  display: block;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 15px;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tgc-cat { display: block; font-size: 11px; color: var(--fg-3); margin-top: 2px; }
.tgc-desc { font-size: 13px; color: var(--fg-2); line-height: 1.5; flex: 1; }
.tgc-stats { display: flex; gap: 12px; flex-wrap: wrap; margin-top: auto; }
.tgc-stat {
  display: flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--fg-2); font-weight: 500;
}
.tgc-stat svg { opacity: 0.7; }
.tgc-lang {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 12px;
  background: var(--bg-3);
  color: var(--fg-3);
  border: 1px solid var(--border);
}
.tgc-issues { color: var(--fg-3); }

/* ── Category Page ── */
.cat-header {
  padding: 48px 0 32px;
  border-bottom: 1px solid var(--border);
}
.cat-header-inner { max-width: 1140px; margin: 0 auto; padding: 0 24px; }
.cat-breadcrumb { display: flex; align-items: center; gap: 8px; margin-bottom: 24px; font-size: 13px; color: var(--fg-3); }
.breadcrumb-link { color: var(--fg-2); text-decoration: none; transition: color 0.15s; }
.breadcrumb-link:hover { color: var(--accent); }
.breadcrumb-sep { color: var(--fg-3); }
.breadcrumb-current { color: var(--fg-3); }
.cat-hero { display: flex; align-items: flex-start; gap: 20px; }
.cat-hero-icon { font-size: 48px; flex-shrink: 0; }
.cat-hero-title { font-size: 36px; letter-spacing: -0.025em; margin-bottom: 8px; }
.cat-hero-desc { font-size: 16px; color: var(--fg-2); max-width: 600px; }

/* Sticky Sort Bar */
.sort-bar-wrap { position: sticky; top: 60px; z-index: 50; }
.sort-bar {
  background: rgba(11, 17, 32, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.sort-bar-inner {
  max-width: 1140px; margin: 0 auto; padding: 0 24px;
  height: 52px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
}
.sort-bar-left { display: flex; align-items: center; gap: 8px; }
.sort-count { font-size: 13px; font-weight: 500; color: var(--fg-2); }
.sort-controls { display: flex; align-items: center; gap: 8px; }
.sort-label { font-size: 13px; color: var(--fg-3); margin-right: 4px; }
.sort-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-2);
  text-decoration: none;
  border: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.sort-btn:hover { color: var(--fg); border-color: var(--card-border); background: var(--bg-2); }
.sort-btn-active { color: var(--accent) !important; border-color: rgba(63, 185, 80, 0.3) !important; background: var(--accent-dim) !important; }

/* Category tool listing */
.cat-tools-section { padding: 40px 0; }
.cat-tools-inner { max-width: 1140px; margin: 0 auto; padding: 0 24px; }
.cat-empty { text-align: center; padding: 80px 24px; color: var(--fg-2); }
.btn-back { color: var(--accent); text-decoration: none; font-size: 15px; }
.btn-back:hover { text-decoration: underline; }

/* Other categories */
.other-cats-section { padding: 40px 0 80px; background: var(--bg-2); }
.other-cats-title { font-size: 20px; margin-bottom: 24px; letter-spacing: -0.02em; }

/* ── Freshness Indicator ── */
.freshness-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-left: auto;
  align-self: flex-start;
  margin-top: 4px;
}
.freshness-fresh { background: #3FB950; box-shadow: 0 0 0 2px rgba(63,185,80,0.25); }
.freshness-aging { background: #D97706; box-shadow: 0 0 0 2px rgba(217,119,6,0.2); }
.freshness-stale { background: #EF4444; box-shadow: 0 0 0 2px rgba(239,68,68,0.2); }

/* 404 page */
.not-found-wrap {
  min-height: 60vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: 80px 24px;
}
.not-found-code {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 120px;
  font-weight: 700;
  color: var(--accent);
  opacity: 0.3;
  line-height: 1;
  margin-bottom: 24px;
}
.not-found-title { font-size: 32px; margin-bottom: 12px; letter-spacing: -0.025em; }
.not-found-sub { font-size: 16px; color: var(--fg-2); margin-bottom: 32px; }
.not-found-cta { color: var(--accent); text-decoration: none; font-size: 15px; }
.not-found-cta:hover { text-decoration: underline; }

/* RESPONSIVE */
@media (max-width: 768px) {
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .hero-card-wrap { order: -1; }
  .steps-grid { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr; }
  .feature-card-lg { grid-row: auto; }
  .stats-inner { flex-direction: column; gap: 24px; }
  .stat-divider { display: none; }
  .nav-links { display: none; }
  .categories-grid { grid-template-columns: 1fr 1fr; }
  .tools-grid { grid-template-columns: 1fr; }
  .cat-hero { flex-direction: column; }
  .sort-bar-inner { flex-wrap: wrap; height: auto; padding: 12px 24px; }
  .sort-controls { flex-wrap: wrap; }
}