/* ═══════════════════════════════════════════════════════════════════════
   /commands - page-specific styles
   ───────────────────────────────────────────────────────────────────────
   Loaded on top of style.css (which defines the design tokens + navbar +
   support widget). Only adds what the commands page needs: hero, search
   toolbar, category chips, command rows. Dark theme inherited.
   ═══════════════════════════════════════════════════════════════════════ */


.commands-page main { padding-top: 0; }

.commands-main {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 clamp(20px, 3vw, 48px) 80px;
}


/* ─── Hero ───────────────────────────────────────────────────────────── */

.commands-hero {
  padding: 60px 0 40px;
  text-align: center;
}
.commands-hero-inner {
  display: grid;
  gap: 16px;
  justify-items: center;
}
.commands-eyebrow {
  font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
  font-size: .9rem;
  color: var(--accent-blue);
  letter-spacing: .04em;
}
.commands-title {
  font-family: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  font-size: clamp(2.2rem, 5vw + .5rem, 4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.commands-subtitle {
  font-size: var(--type-lead);
  color: var(--text-mute);
  max-width: 640px;
}


/* ─── Toolbar (search + count) ───────────────────────────────────────── */

.commands-toolbar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 580px;
  margin-top: 8px;
  padding: 4px 14px 4px 44px;
  background: var(--bg-card);
  border: 1px solid var(--bg-line);
  border-radius: 999px;
  transition: border-color .15s;
}
.commands-toolbar:focus-within {
  border-color: var(--accent-blue);
}
.commands-search-icon {
  position: absolute;
  left: 18px;
  color: var(--text-mute);
}
.commands-search {
  flex: 1;
  background: transparent;
  border: 0;
  outline: none;
  padding: 12px 0;
  color: var(--text);
  font: 500 1rem inherit;
}
.commands-search::placeholder { color: var(--text-soft); }
.commands-count {
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--bg-card-hi);
  color: var(--text-mute);
  font-size: .85rem;
  font-variant-numeric: tabular-nums;
}


/* ─── Rules (collapsible <details>) ──────────────────────────────────── */

.commands-rules {
  width: 100%;
  max-width: 700px;
  text-align: left;
  margin-top: 8px;
  border: 1px solid var(--bg-line);
  border-radius: var(--radius);
  background: color-mix(in oklab, var(--bg-card) 50%, transparent);
}
.commands-rules > summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 18px;
  font-weight: 600;
  font-size: .95rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}
.commands-rules > summary::-webkit-details-marker { display: none; }
.commands-rules > summary::after {
  content: '▾';
  margin-left: auto;
  color: var(--text-mute);
  transition: transform .2s;
}
.commands-rules[open] > summary::after { transform: rotate(180deg); }
.commands-rules > summary > i { color: var(--accent-blue); }
.commands-rules ul {
  list-style: disc;
  margin: 0;
  padding: 0 18px 18px 38px;
  color: var(--text-mute);
  font-size: .92rem;
  line-height: 1.6;
}
.commands-rules li + li { margin-top: 6px; }


/* ─── Category chips ─────────────────────────────────────────────────── */

.commands-chips {
  position: sticky;
  top: 64px;  /* below sticky navbar (~64px tall) */
  z-index: 50;
  margin: 24px -28px 28px;
  padding: 12px 28px;
  background: color-mix(in oklab, var(--bg-base) 85%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--bg-line);
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.commands-chips::-webkit-scrollbar { height: 6px; }
.commands-chips::-webkit-scrollbar-thumb { background: var(--bg-line); border-radius: 3px; }
.commands-chip {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--bg-line);
  color: var(--text-mute);
  font-size: .88rem;
  font-weight: 500;
  cursor: pointer;
  transition: color .15s, background .15s, border-color .15s;
  white-space: nowrap;
}
.commands-chip:hover {
  color: var(--text);
  border-color: var(--accent-blue);
}
.commands-chip.active {
  color: var(--bg-base);
  background: var(--accent-blue);
  border-color: var(--accent-blue);
}
.commands-chip-count {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .25);
  font-size: .75rem;
  font-variant-numeric: tabular-nums;
}


/* ─── Command list ───────────────────────────────────────────────────── */

.commands-list {
  display: grid;
  gap: 28px;
}
.commands-loading {
  text-align: center;
  color: var(--text-mute);
  padding: 60px 0;
}

.commands-category {
  scroll-margin-top: 120px;  /* navbar + sticky chips offset */
}
.commands-category-title {
  font-family: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.commands-category-title .commands-category-count {
  font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
  font-size: .9rem;
  color: var(--text-mute);
  font-weight: 400;
}

.commands-rows {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.command-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 2fr;
  gap: 16px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--bg-line);
  border-radius: 12px;
  align-items: start;
  transition: border-color .15s, background .15s;
}
.command-row:hover {
  border-color: color-mix(in oklab, var(--accent-blue) 50%, var(--bg-line));
  background: color-mix(in oklab, var(--bg-card) 90%, var(--bg-card-hi));
}
.command-row.no-match { display: none; }

.command-syntax {
  font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
  font-size: .95rem;
  color: var(--accent-blue);
  font-weight: 600;
  word-break: break-word;
}
.command-aliases {
  display: block;
  margin-top: 4px;
  font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
  font-size: .82rem;
  color: var(--text-soft);
  font-weight: 400;
}
.command-aliases::before {
  content: 'alias: ';
  color: var(--text-mute);
  font-style: italic;
}

/* Yellow inline warning block for commands whose syntax contains a
   <placeholder>. Matches the .command-note style above (orange-left-
   border, faint tint) but in yellow so it reads as a usage caution
   distinct from a contextual note. Same structural placement: inline
   in the description cell, below the description text. */
.command-warning {
  font-size: .85rem;
  color: var(--text-mute);
  padding: 8px 12px;
  border-left: 3px solid var(--accent-yellow);
  background: color-mix(in oklab, var(--accent-yellow) 8%, transparent);
  border-radius: 6px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.command-warning > i {
  color: var(--accent-yellow);
  margin-top: 2px;
  flex-shrink: 0;
}
.command-text {
  display: grid;
  gap: 8px;
  color: var(--text);
  font-size: .95rem;
  line-height: 1.55;
}
.command-note {
  font-size: .85rem;
  color: var(--text-mute);
  padding: 8px 12px;
  border-left: 3px solid var(--accent-orange);
  background: color-mix(in oklab, var(--accent-orange) 8%, transparent);
  border-radius: 6px;
}

.commands-empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-mute);
  border: 1px dashed var(--bg-line);
  border-radius: var(--radius);
}

.commands-source {
  margin-top: 60px;
  text-align: center;
  color: var(--text-soft);
  font-size: .82rem;
}


/* ─── Mobile ─────────────────────────────────────────────────────────── */

@media (max-width: 720px) {
  .command-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .commands-chips {
    top: 56px;
    margin: 18px -18px 22px;
    padding: 10px 18px;
  }
  .commands-main {
    padding: 0 18px 60px;
  }
}
