/* ============================================================
   SKILL MARKETPLACE — styles.css
   Dark, sober theme. CSS custom properties throughout.
   ============================================================ */

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Colour tokens */
  --bg:            #0a0a0a;
  --surface:       #141414;
  --surface-2:     #1c1c1c;
  --surface-3:     #222222;
  --border:        #2a2a2a;
  --border-focus:  #555555;
  --text:          #ededed;
  --text-muted:    #9b9b9b;
  --text-faint:    #555555;
  --accent:        #e6e6e6;
  --accent-strong: #ffffff;
  --tag-bg:        #1c1c1c;
  --tag-border:    #333333;

  /* Category colours (subtle) */
  --cat-development:     #2a3a2a;
  --cat-design:          #2a2a3a;
  --cat-data:            #3a2a2a;
  --cat-marketing:       #3a3a2a;
  --cat-agent-workflows: #2a3a3a;
  --cat-devops:          #33282a;
  --cat-quality:         #302a3a;

  /* Spacing */
  --space-1:  4px;
  --space-2:  8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* Typography */
  --font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, "Cascadia Code", "Fira Code", monospace;

  /* Geometry */
  --radius:    10px;
  --radius-sm:  6px;
  --radius-lg: 14px;

  /* Transitions */
  --transition: 120ms ease;

  /* Layout */
  --header-h: 56px;
  --sidebar-w: 220px;
  --content-max: 1160px;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Focus rings ──────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ── Typography helpers ───────────────────────────────────── */
h1, h2, h3, h4 {
  line-height: 1.25;
  font-weight: 600;
  color: var(--accent-strong);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

code, kbd, samp, pre {
  font-family: var(--font-mono);
}

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 var(--space-6);
  gap: var(--space-6);
}

/* Groups the social links and the scope toggle so they move together as one
   unit — e.g. reflowing to their own row on small screens (see 09-responsive.css).
   Pushes both to the right edge: on browse/detail the search field (flex:1)
   fills the space; on home it's hidden, so this keeps the group right-aligned
   there too. */
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
  margin-left: auto;
}

/* Contact icons in the header — persistent, always visible (home + browse).
   Icon-only, sitting in the right corner next to the scope toggle. */
.header-social {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex-shrink: 0;
}

.header-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: color var(--transition), background var(--transition);
}

.header-social a:hover {
  color: var(--text);
  background: var(--surface-2);
  text-decoration: none;
}

.header-social a:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 1px;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  flex-shrink: 0;
}

.header-logo .logo-mark {
  width: 28px;
  height: 28px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-strong);
  letter-spacing: -0.03em;
}

.header-logo .logo-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--accent-strong);
  letter-spacing: -0.01em;
}

.header-logo:hover .logo-name {
  text-decoration: none;
}

.header-search-wrap {
  flex: 1;
  max-width: 520px;
  position: relative;
}

.header-search-wrap[hidden] {
  display: none;
}

.header-search-wrap .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  pointer-events: none;
  display: flex;
}

.header-search-input {
  width: 100%;
  height: 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  padding: 0 36px 0 36px;
  transition: border-color var(--transition);
}

.header-search-input::placeholder {
  color: var(--text-faint);
}

.header-search-input:focus {
  outline: none;
  border-color: var(--border-focus);
}

.header-search-kbd {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  pointer-events: none;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

.header-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}

.header-nav a:hover,
.header-nav a.active {
  color: var(--text);
  text-decoration: none;
  background: var(--surface-2);
}

.header-nav a:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 1px;
}

/* Scope toggle (Skills / Blog / Both) — segmented control.
   Reads clearly as a switch: a pill-shaped, slightly inset container, an
   elevated/highlighted active segment, and a visible hover fill — all kept
   within the grayscale theme so it stays sober. */
.scope-toggle {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35); /* faint inset → "track" feel */
  /* Drag-to-select: suppress text selection and let the track own the drag
     gesture instead of the page scrolling underneath it. */
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.scope-toggle button {
  font-size: 13px;
  line-height: 1;
  color: var(--text);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px 14px;
  border-radius: 999px;
  font-family: var(--font-sans);
  transition: background var(--transition), box-shadow var(--transition);
}

.scope-toggle button:hover {
  background: var(--surface-3);
}

.scope-toggle button.active {
  background: var(--surface-3);
  font-weight: 700;
  /* lifted off the track: soft drop shadow + a hairline ring */
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.45), inset 0 0 0 1px var(--border-focus);
}

.scope-toggle button:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 1px;
}

/* ============================================================
   MAIN CONTENT WRAPPER
   ============================================================ */
.site-main {
  min-height: calc(100vh - var(--header-h));
}

/* ============================================================
   VIEW SYSTEM  (each view is hidden/shown via JS)
   ============================================================ */
.view {
  display: none;
}
.view.active {
  display: block;
}

/* ============================================================
   HOME VIEW
   ============================================================ */
.home-hero {
  max-width: 640px;
  margin: 0 auto;
  padding: var(--space-16) var(--space-6) var(--space-10);
  text-align: center;
}

.home-hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-4);
  color: var(--accent-strong);
}

.home-hero .hero-sub {
  font-size: 17px;
  color: var(--text-muted);
  margin-bottom: var(--space-8);
  line-height: 1.55;
}

.home-search-wrap {
  position: relative;
  margin-bottom: var(--space-5);
}

.home-search-wrap .search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  pointer-events: none;
  display: flex;
}

.home-search-input {
  width: 100%;
  height: 54px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  padding: 0 52px 0 48px;
  transition: border-color var(--transition), background var(--transition);
}

.home-search-input::placeholder {
  color: var(--text-faint);
}

.home-search-input:focus {
  outline: none;
  border-color: var(--border-focus);
  background: var(--surface-2);
}

.home-search-kbd {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 2px 7px;
  pointer-events: none;
}

/* Inline live-search dropdown (shared by home hero + header search) */
.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  max-height: 380px;
  overflow-y: auto;
  padding: 6px;
  text-align: left;
}

.search-result {
  display: block;
  width: 100%;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  cursor: pointer;
  text-align: left;
  color: var(--text);
  font-family: var(--font-sans);
}

.search-result:hover,
.search-result:focus {
  background: var(--surface-2);
  outline: none;
}

.search-result-main {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.search-result-title {
  font-size: 14px;
  font-weight: 600;
}

.search-result-cat {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  white-space: nowrap;
}

.search-result-summary {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-all {
  margin-top: 4px;
  border-top: 1px solid var(--border);
  border-radius: 0;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
}

.search-results-hint {
  margin: 0;
  padding: 12px;
  font-size: 13px;
  color: var(--text-muted);
}

.skill-count {
  font-size: 13px;
  color: var(--text-faint);
  margin-bottom: var(--space-8);
}

.skill-count strong {
  color: var(--text-muted);
  font-weight: 500;
}

/* Category chips */
.category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: center;
  margin-bottom: var(--space-10);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
  white-space: nowrap;
  min-height: 32px;
  text-decoration: none;
}

.chip:hover {
  background: var(--surface-2);
  border-color: var(--border-focus);
  color: var(--text);
  text-decoration: none;
}

.chip.active {
  background: var(--surface-3);
  border-color: var(--text-faint);
  color: var(--accent-strong);
}

.chip-count {
  font-size: 11px;
  color: var(--text-faint);
}

/* Featured strip — wider than the site's normal content column so up to
   6 cards (at their normal ~260px size) can share a single row on large
   screens. See the 09-responsive.css breakpoints for the 6/3/2/1-column
   steps that keep this at 1, 2, or 3 rows as the screen narrows. */
.featured-section {
  max-width: 1680px;
  margin: 0 auto;
  padding: 0 var(--space-6) var(--space-16);
}

.featured-section h2 {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-faint);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-bottom: var(--space-4);
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--space-3);
}

/* ============================================================
   BROWSE VIEW
   ============================================================ */
/* Wider than --content-max (matches .featured-section) so the results
   grid can pick up extra columns on large screens instead of capping
   out at 3 no matter how wide the monitor is. */
.browse-layout {
  max-width: 1680px;
  margin: 0 auto;
  padding: var(--space-6);
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  gap: var(--space-6);
  align-items: start;
}

/* Filter rail */
.filter-rail {
  position: sticky;
  top: calc(var(--header-h) + var(--space-4));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-5);
}

.filter-rail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.filter-rail-header h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.clear-filters-btn {
  font-size: 12px;
  color: var(--text-faint);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: var(--radius-sm);
  transition: color var(--transition);
}

.clear-filters-btn:hover {
  color: var(--text);
}

.filter-group {
  margin-bottom: var(--space-5);
}

.filter-group-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-2);
  display: block;
}

.filter-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.filter-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.filter-item input[type="checkbox"] {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  accent-color: var(--text);
  cursor: pointer;
}

.filter-item label {
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  flex: 1;
  transition: color var(--transition);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 0;
  min-height: 28px;
}

.filter-item label:hover {
  color: var(--text);
}

.filter-item input:checked + label {
  color: var(--text);
}

.filter-count {
  font-size: 11px;
  color: var(--text-faint);
}

/* Results area */
.results-area {
  min-height: 60vh;
}

.results-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
}

.results-meta {
  font-size: 13px;
  color: var(--text-muted);
}

.results-meta strong {
  color: var(--text);
  font-weight: 500;
}

.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

.active-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  color: var(--text);
}

.active-filter-pill button {
  background: none;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
  display: flex;
  align-items: center;
  transition: color var(--transition);
  min-width: 16px;
  min-height: 16px;
}

.active-filter-pill button:hover {
  color: var(--text);
}

.sort-select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 13px;
  padding: 6px 10px;
  cursor: pointer;
  transition: border-color var(--transition);
  min-height: 32px;
}

.sort-select:focus {
  outline: none;
  border-color: var(--border-focus);
}

.sort-select option {
  background: var(--surface);
  color: var(--text);
}

/* ── Skill cards ──────────────────────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-3);
}

.skill-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-5);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  text-decoration: none;
  color: inherit;
}

.skill-card:hover {
  border-color: var(--border-focus);
  background: var(--surface-2);
  text-decoration: none;
  color: inherit;
}

.skill-card:focus-visible {
  border-color: var(--border-focus);
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--accent-strong);
  line-height: 1.3;
}

.category-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
  /* Smooth green-aqua — distinct from .tag's neutral grey so Category and Tags read
     as two different kinds of thing at a glance, not duplicates. */
  color: #5cc9b0;
  background: rgba(92, 201, 176, 0.12);
  border: 1px solid rgba(92, 201, 176, 0.34);
}

.card-summary {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Type badge — distinguishes skills from blog posts (esp. in "Both" scope) */
.type-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.type-badge.type-skill {
  color: #d9a273;                          /* muted amber — warm, not loud */
  background: rgba(198, 140, 78, 0.12);
  border-color: rgba(198, 140, 78, 0.34);
}

.type-badge.type-blog {
  color: #b9a6ff;
  background: rgba(130, 125, 189, 0.12);
  border-color: rgba(130, 125, 189, 0.35);
}

.type-badge.type-plugin {
  color: #7aa9d9;
  background: rgba(122, 169, 217, 0.12);
  border-color: rgba(122, 169, 217, 0.34);
}

.skill-count-badge,
.plugin-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: var(--surface-2);
  margin-left: auto;
}

.card-date,
.post-meta {
  font-size: 11px;
  color: var(--text-faint);
  font-family: var(--font-mono);
  white-space: nowrap;
}

.card-date {
  margin-left: auto;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-top: auto;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background: var(--tag-bg);
  border: 1px solid var(--tag-border);
  border-radius: var(--radius-sm);
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  white-space: nowrap;
}

.agent-badges {
  display: flex;
  gap: var(--space-1);
  flex-wrap: wrap;
}

.agent-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 10px;
  color: var(--text-faint);
  font-family: var(--font-mono);
  white-space: nowrap;
}

/* Empty state */
.empty-state {
  padding: var(--space-16) var(--space-6);
  text-align: center;
  color: var(--text-muted);
}

.empty-state h3 {
  font-size: 18px;
  margin-bottom: var(--space-3);
  color: var(--text);
}

.empty-state p {
  font-size: 14px;
  color: var(--text-faint);
}

/* Mobile filter drawer trigger */
.filter-drawer-btn {
  display: none;
  align-items: center;
  gap: var(--space-2);
  padding: 8px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  min-height: 44px;
  transition: border-color var(--transition);
}

.filter-drawer-btn:hover {
  border-color: var(--border-focus);
  color: var(--text);
}

/* ============================================================
   DETAIL VIEW
   ============================================================ */
.detail-layout {
  max-width: 800px;
  margin: 0 auto;
  padding: var(--space-8) var(--space-6) var(--space-16);
}

.detail-back {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 13px;
  color: var(--text-faint);
  margin-bottom: var(--space-6);
  transition: color var(--transition);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

.detail-back:hover {
  color: var(--text);
}

.detail-header {
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--border);
}

.detail-title {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-3);
  color: var(--accent-strong);
}

.detail-summary {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: var(--space-5);
  /* Justify the descriptive prose on skill/plugin/blog detail headers. */
  text-align: justify;
  hyphens: auto;
}

.detail-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.detail-agents {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

.detail-agents-label {
  font-size: 12px;
  color: var(--text-faint);
  margin-right: var(--space-1);
}

/* Install block */
.install-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: var(--space-6);
  overflow: hidden;
}

.install-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-5);
  border-bottom: 1px solid var(--border);
}

.install-block-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 12px;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  min-height: 30px;
}

.copy-btn:hover {
  background: var(--surface-3);
  color: var(--text);
  border-color: var(--border-focus);
}

.copy-btn.copied {
  color: #6fba6f;
  border-color: #3a5a3a;
}

.install-command {
  padding: var(--space-5);
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--accent);
  overflow-x: auto;
  white-space: nowrap;
}

.install-actions {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  margin-bottom: var(--space-8);
  flex-wrap: wrap;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 8px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 14px;
  font-family: var(--font-sans);
  cursor: pointer;
  text-decoration: none;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
  min-height: 44px;
}

.btn-secondary:hover {
  border-color: var(--border-focus);
  color: var(--text);
  background: var(--surface-2);
  text-decoration: none;
}

/* Skill body (rendered markdown) */
.skill-body {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-muted);
  margin-bottom: var(--space-10);
}

/* Lazy-loaded body states (SPLIT-04/05): theme-driven so they stay consistent
   across devices and light/dark. */
.body-loading {
  color: var(--text-faint);
  font-size: 14px;
}

.body-error {
  color: var(--text-faint);
  font-size: 14px;
}

.body-error a {
  color: var(--accent);
}

.skill-body h2 {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin: var(--space-8) 0 var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border);
}

.skill-body h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: var(--space-5) 0 var(--space-2);
}

.skill-body p,
.skill-body li {
  /* Justify body prose; auto-hyphenation avoids wide inter-word gaps (rivers). */
  text-align: justify;
  hyphens: auto;
}

.skill-body p {
  margin-bottom: var(--space-4);
}

.skill-body ul,
.skill-body ol {
  margin: 0 0 var(--space-4) var(--space-5);
}

.skill-body li {
  margin-bottom: var(--space-1);
}

.skill-body img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: var(--space-4) auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.skill-body pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-4) var(--space-5);
  overflow-x: auto;
  margin-bottom: var(--space-4);
}

.skill-body code {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
}

.skill-body pre code {
  font-size: 13px;
  color: var(--accent);
  background: none;
  padding: 0;
}

.skill-body p code,
.skill-body li code {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 12.5px;
}

/* Related skills */
.related-section {
  border-top: 1px solid var(--border);
  padding-top: var(--space-8);
}

.related-section h2 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: var(--space-4);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-3);
}

/* ============================================================
   SITE FOOTER
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--border);
  padding: var(--space-8) var(--space-6);
  color: var(--text-faint);
  font-size: 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
}

/* Contact / social links — icon + label pills, sober and minimal */
.footer-social {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3);
}

.footer-social .social-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 13px;
  transition: color var(--transition), border-color var(--transition),
              background var(--transition);
}

.footer-social .social-link:hover {
  color: var(--text);
  border-color: var(--border-focus);
  background: var(--surface-2);
  text-decoration: none;
}

.footer-social .social-link svg {
  flex-shrink: 0;
}

.footer-tagline {
  margin: 0;
  color: var(--text-faint);
}

/* ============================================================
   MOBILE DRAWER OVERLAY
   ============================================================ */
.drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 200;
}

.drawer-overlay.open {
  display: block;
}

.filter-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(320px, 90vw);
  background: var(--surface);
  border-right: 1px solid var(--border);
  z-index: 201;
  padding: var(--space-6);
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform 200ms ease;
}

.filter-drawer.open {
  transform: translateX(0);
}

.drawer-close-btn {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: var(--space-4);
  background: none;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  font-size: 20px;
  width: 100%;
  min-height: 44px;
}

.drawer-close-btn:hover {
  color: var(--text);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Featured grid — steps down through divisors of the 6-card max (6/3/2)
   so every row stays fully packed (1, then 2, then 3 rows) as the screen
   narrows. Below 600px even 2 cards no longer fit at their normal size,
   so it falls back to a single column instead of shrinking the cards. */
@media (max-width: 1679px) {
  .featured-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 860px) {
  .featured-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .browse-layout {
    grid-template-columns: 1fr;
  }

  .filter-rail {
    display: none;
  }

  .filter-drawer-btn {
    display: flex;
  }

  /* Row 1 is always nav (left) + actions (right) — that pair alone fits one
     line at phone widths, so it never wraps. The search field (only shown
     on browse/detail — see router.js showView) is reordered onto its own
     full-width row 2 instead of being left in the middle of row 1, where it
     would force .header-actions onto a second row with empty space under
     the nav icons. On home, where search is [hidden], row 2 never forms and
     the header stays a single line. --header-h grows to match whenever row 2
     is present (see 01-base.css and its consumers). */
  :root:has(.header-search-wrap:not([hidden])) {
    --header-h: 96px;
  }

  .site-header {
    height: auto;
    flex-wrap: wrap;
    padding: var(--space-2) var(--space-4);
    row-gap: var(--space-2);
  }

  .header-search-wrap {
    max-width: none;
    order: 3;
    flex: 1 1 100%;
  }

  .header-logo .logo-name {
    display: none;
  }

  .header-actions {
    flex: 0 1 auto;
    margin-left: auto;
  }

  .home-hero {
    padding: var(--space-10) var(--space-4) var(--space-8);
  }

  .home-hero h1 {
    font-size: 1.9rem;
  }

  .home-search-input {
    height: 50px;
    font-size: 15px;
  }

  .detail-layout {
    padding: var(--space-5) var(--space-4) var(--space-10);
  }

  .install-command {
    font-size: 12px;
  }

  .results-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 620px) {
  .cards-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .featured-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .related-grid {
    grid-template-columns: 1fr;
  }

  .home-hero h1 {
    font-size: 1.6rem;
  }
}

/* ============================================================
   LOADING SKELETON (optional progressive enhancement)
   ============================================================ */
.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
