:root {
  --bg-dark: #000000;
  --bg-light: #f5f5f7;
  --text-dark: #1d1d1f;
  --text-light: #ffffff;
  --text-muted: rgba(0, 0, 0, 0.8);
  --text-faint: rgba(255, 255, 255, 0.72);
  --accent: #0071e3;
  --accent-dark: #2997ff;
  --card-dark: #272729;
  --card-light: #ffffff;
  --shadow: rgba(0, 0, 0, 0.22) 3px 5px 30px 0px;
  --radius: 12px;
  --pill: 980px;
  --max: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg-light);
  color: var(--text-dark);
  font-family: "SF Pro Text", "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

a { color: inherit; text-decoration: none; }
pre { white-space: pre-wrap; word-break: break-word; margin: 0; }
summary { cursor: pointer; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(0,0,0,0.8);
  backdrop-filter: saturate(180%) blur(20px);
}
.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  min-height: 48px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: white;
}
.brand { font-size: 17px; font-weight: 600; letter-spacing: -0.374px; }
.nav-note { font-size: 12px; opacity: 0.82; }

.dark-section { background: var(--bg-dark); color: var(--text-light); }
.light-section { background: var(--bg-light); color: var(--text-dark); }
.section-inner, .hero-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 72px 20px;
}
.narrow { max-width: 980px; }
.eyebrow, .section-kicker {
  margin: 0 0 12px;
  color: var(--accent-dark);
  font-size: 14px;
  letter-spacing: -0.224px;
}
.hero h1 {
  margin: 0;
  max-width: 980px;
  font-size: clamp(36px, 6vw, 56px);
  line-height: 1.07;
  letter-spacing: -0.28px;
  font-weight: 600;
}
.hero-copy {
  margin: 20px 0 0;
  max-width: 760px;
  color: var(--text-faint);
  font-size: 21px;
  line-height: 1.35;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: var(--pill);
  font-size: 17px;
  transition: transform 180ms ease, background 180ms ease, color 180ms ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: white; }
.btn-secondary { border: 1px solid white; color: white; }

.stats-grid, .usage-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}
.stat-card, .usage-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}
.usage-card { background: var(--card-dark); color: white; box-shadow: none; }
.stat-label { font-size: 14px; color: rgba(0,0,0,.6); }
.stat-value { margin-top: 10px; font-size: 40px; line-height: 1.1; font-weight: 600; }
.stat-small { font-size: 18px; }
.usage-card h3 { margin: 0 0 10px; font-size: 21px; line-height: 1.19; }
.usage-card pre {
  background: rgba(255,255,255,.08);
  border-radius: 8px;
  padding: 14px;
  color: #fff;
  font-size: 14px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}
.section-head h2, .usage h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.28px;
}
.controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.controls input,
.controls select {
  appearance: none;
  min-height: 44px;
  min-width: 260px;
  border-radius: 11px;
  border: 3px solid rgba(0,0,0,0.04);
  background: #fafafc;
  color: rgba(0,0,0,0.8);
  padding: 0 14px;
  font-size: 16px;
}
.controls input:focus,
.controls select:focus,
.btn:focus,
.mini-btn:focus,
.chip:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 14px;
}
.chip {
  border: 1px solid rgba(0,0,0,.12);
  background: white;
  color: var(--text-dark);
  border-radius: var(--pill);
  min-height: 38px;
  padding: 0 14px;
  cursor: pointer;
  font-size: 14px;
}
.chip.active {
  background: var(--accent);
  color: white;
  border-color: transparent;
}
.results-meta {
  color: rgba(0,0,0,.62);
  margin-bottom: 16px;
  font-size: 14px;
}
.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.skill-card {
  background: var(--card-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.card-top {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 14px;
}
.card-category {
  font-size: 12px;
  color: rgba(0,0,0,.56);
  margin-bottom: 6px;
}
.card-title {
  margin: 0;
  font-size: 24px;
  line-height: 1.12;
  letter-spacing: -0.2px;
}
.card-desc {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  color: rgba(0,0,0,.8);
}
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tag {
  background: #f1f5fb;
  color: #1d1d1f;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
}
.usage-list {
  display: grid;
  gap: 10px;
}
.usage-item {
  border-radius: 8px;
  background: #fafafc;
  border: 1px solid rgba(0,0,0,.06);
  padding: 12px;
}
.usage-label {
  font-size: 12px;
  color: rgba(0,0,0,.56);
  margin-bottom: 6px;
}
.usage-code {
  font-size: 13px;
  line-height: 1.45;
  word-break: break-word;
}
.mini-btn {
  border: 1px solid rgba(0,0,0,.12);
  background: white;
  color: var(--accent);
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  cursor: pointer;
}
.more-box {
  border-top: 1px solid rgba(0,0,0,.08);
  padding-top: 12px;
}
.more-content {
  margin-top: 10px;
  display: grid;
  gap: 8px;
  font-size: 14px;
  color: rgba(0,0,0,.74);
}
.inline-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: #f5f5f7;
  border-radius: 6px;
  padding: 2px 6px;
}
.empty-state {
  background: white;
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
  color: rgba(0,0,0,.72);
}

@media (max-width: 1100px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-grid, .usage-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .section-head { align-items: stretch; flex-direction: column; }
  .controls input, .controls select { min-width: 100%; width: 100%; }
  .cards, .stats-grid, .usage-grid { grid-template-columns: 1fr; }
  .hero-inner, .section-inner { padding: 56px 16px; }
  .nav-inner { padding: 0 16px; }
}
