:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --text: #1b1b1b;
  --muted: #616161;
  --border: #e5e5e5;
  --brand: #0078d4;
  --brand-hover: #106ebe;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111111;
    --surface: #1c1c1c;
    --text: #f3f3f3;
    --muted: #a8a8a8;
    --border: #2e2e2e;
    --brand: #4ca0e8;
    --brand-hover: #6cb2ee;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 16px rgba(0, 0, 0, 0.3);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--text); text-decoration: none; }
.logo { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; width: 18px; height: 18px; }
.logo i:nth-child(1) { background: #f25022; }
.logo i:nth-child(2) { background: #7fba00; }
.logo i:nth-child(3) { background: #00a4ef; }
.logo i:nth-child(4) { background: #ffb900; }
.nav nav { display: flex; gap: 20px; }
.nav nav a { color: var(--muted); text-decoration: none; font-size: 14px; }
.nav nav a:hover { color: var(--text); }

/* Hero */
.hero { padding-top: 72px; text-align: center; }
.eyebrow { margin: 0 0 8px; color: var(--brand); font-weight: 600; font-size: 14px; letter-spacing: 0.04em; text-transform: uppercase; }
.hero h1 { margin: 0; font-size: clamp(32px, 6vw, 56px); line-height: 1.1; font-weight: 600; letter-spacing: -0.02em; }
.lede { max-width: 620px; margin: 16px auto 0; font-size: 18px; color: var(--muted); }
.actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 28px; }
.hero-img {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 48px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }

/* Sections */
.section { padding-top: 80px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.section-head h2 { margin: 0; font-size: 28px; font-weight: 600; }
#filter {
  min-width: 0;
  width: 240px;
  max-width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14px;
}
#filter:focus { outline: 2px solid var(--brand); outline-offset: 1px; }

/* Cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.card {
  display: flex;
  flex-direction: column;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 4px solid var(--accent, var(--brand));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.15s;
}
.card:hover { transform: translateY(-2px); }
.card-top { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.card-top code { color: var(--muted); }
.badge {
  padding: 2px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent, var(--brand)) 14%, transparent);
  color: var(--accent, var(--brand));
  font-weight: 600;
}
.card h3 { margin: 16px 0 4px; font-size: 20px; font-weight: 600; }
.card p { margin: 0 0 20px; color: var(--muted); flex: 1; }
.card-links { display: flex; gap: 8px; flex-wrap: wrap; }

/* README */
.readme { max-width: 760px; }
.readme h2 { font-size: 28px; font-weight: 600; margin: 48px 0 8px; }
.readme h2:first-child { margin-top: 0; }
.readme p, .readme li { color: var(--muted); font-size: 17px; }
.readme img { max-width: 100%; height: auto; border-radius: var(--radius); }
.readme table { width: 100%; border-collapse: collapse; }
.readme th, .readme td { padding: 8px 12px; border-bottom: 1px solid var(--border); text-align: left; }

/* Footer */
.footer { padding-top: 80px; padding-bottom: 40px; font-size: 14px; }

@media (max-width: 560px) {
  .nav nav { gap: 14px; }
  .hero { padding-top: 48px; }
  .section { padding-top: 56px; }
  #filter { width: 100%; }
}
