/* ── A category page: neorgon.com/<id>/ ───────────────────────────────────────
   Written by tools/build-categories.py. One category's tools as a list of
   cards: name, one line, what it works with, and the link. The page shares the
   hub's stylesheet (tokens, the void, the card icon masks) and adds only this.
   No script beyond the header and footer kits. */

.cat-page {
  padding-top: clamp(18px, 3vw, 30px);
}

/* The crumb is the Parts Kit's (css/neorgon-parts.css); these keep the
   hub's look: smaller, muted, no underline until hover, the page's accent on
   focus. */
.cat-page {
  --neo-crumb-wrap: nowrap;
  --neo-crumb-gap: 8px;
  --neo-crumb-size: .8125rem;
  --neo-crumb-leading: normal;
  --neo-crumb-ink: var(--text-muted);
  --neo-crumb-sep-ink: var(--text-muted);
  --neo-crumb-link-ink: var(--text-secondary);
  --neo-crumb-target: 24px;
  --neo-crumb-radius: 4px;
  --neo-crumb-line: none;
  --neo-crumb-line-color: currentColor;
  --neo-crumb-line-offset: auto;
  --neo-crumb-hover-line-offset: 3px;
  --neo-crumb-focus: var(--cat-accent, #c084fc);
  --neo-crumb-focus-offset: 2px;
}
.cat-page > .neo-crumb { margin-bottom: 18px; }

/* The category says itself once: its icon and its definition. The name is
   the page's h1, in the header. */
.cat-mast {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 28px;
}
.cat-mast__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: 18px;
  color: var(--cat-accent);
  background: color-mix(in oklch, var(--cat-accent) 13%, rgba(0, 12, 24, .82));
  border: 1px solid color-mix(in oklch, var(--cat-accent) 38%, transparent);
  box-shadow: var(--shadow-card);
}
.cat-mast__svg { width: 32px; height: 32px; }
.cat-mast__def {
  max-width: 60ch;
  font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
  line-height: 1.55;
  color: var(--text-primary);
  text-wrap: pretty;
}

.cat-shelf {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 12px;
  font-size: .75rem;
  font-weight: 650;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.cat-shelf::after {
  content: '';
  flex: 1;
  height: 1px;
  background: color-mix(in oklch, var(--cat-accent, #94a3b8) 16%, transparent);
}

.cat-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
  margin: 0 0 32px;
  padding: 0;
}
.cat-item__link {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  column-gap: 14px;
  row-gap: 8px;
  align-content: start;
  height: 100%;
  padding: 16px;
  border-radius: 14px;
  color: var(--text-primary);
  text-decoration: none;
  background:
    linear-gradient(165deg, rgba(255,255,255,.04), rgba(255,255,255,0) 42%),
    rgba(0, 12, 24, .82);
  border: 1px solid color-mix(in oklch, var(--card-accent, #818cf8) 18%, rgba(255,255,255,.07));
  box-shadow: var(--shadow-card);
  transition: border-color .2s, box-shadow .25s;
  --card-ink: color-mix(in oklch, var(--card-accent, #818cf8) 62%, #fff);
}
@supports (color: oklch(from #000 l c h)) {
  .cat-item__link { --card-ink: oklch(from var(--card-accent, #818cf8) max(l, .74) c h); }
}
a.cat-item__link:hover {
  border-color: color-mix(in oklch, var(--card-accent, #818cf8) 55%, transparent);
  box-shadow: var(--shadow-card-hover);
}
a.cat-item__link:hover .cat-item__name { text-decoration: underline; text-underline-offset: 3px; }
a.cat-item__link:focus-visible { outline: 2px solid var(--card-accent, #818cf8); outline-offset: 2px; }
.cat-item--soon .cat-item__link { border-style: dashed; box-shadow: none; }

.cat-item__icon {
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(145deg, color-mix(in srgb, var(--card-accent, #818cf8) 16%, transparent), rgba(255,255,255,.03));
  border: 1px solid color-mix(in srgb, var(--card-accent, #818cf8) 22%, rgba(255,255,255,.06));
}
.cat-item__icon .card-site-icon { width: 26px; height: 26px; }
.cat-item__icon img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* A third-party mark keeps its own drawing, at the size the hub shows it. */
.cat-item__icon img[src*="/assets/icons/"] { width: 26px; height: 26px; object-fit: contain; }

.cat-item__text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cat-item__head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.cat-item__name { font-size: 1rem; font-weight: 650; line-height: 1.3; }
.cat-item__line { font-size: .875rem; line-height: 1.5; color: var(--text-secondary); }
/* Soon and Archived are Parts Kit pills; these keep the hub's square,
   outlined, uppercase look. */
.cat-item__head {
  --neo-pill-display: block;
  --neo-pill-align: normal;
  --neo-pill-gap: normal;
  --neo-pill-space: normal;
  --neo-pill-h: auto;
  --neo-pill-pad: 1px 8px;
  --neo-pill-radius: 6px;
  --neo-pill-weight: 700;
  --neo-pill-tracking: .06em;
  --neo-pill-case: uppercase;
  --neo-pill-border-w: 1px;
  --neo-pill-border-style: solid;
  --neo-pill-border: rgba(255,255,255,.18);
  --neo-pill-archived-ink: var(--text-secondary);
  --neo-pill-archived-bg: transparent;
  --neo-pill-soon-ink: var(--card-ink);
  --neo-pill-soon-bg: transparent;
  --neo-pill-soon-border: color-mix(in srgb, var(--card-accent, #818cf8) 40%, transparent);
}
.cat-item__facets {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 6px;
}
/* Each facet is a Parts Kit chip (--facet), outlined in the card's accent. */
.cat-item__facets {
  --neo-chip-position: static;
  --neo-chip-display: block;
  --neo-chip-align: normal;
  --neo-chip-gap: normal;
  --neo-chip-space: normal;
  --neo-chip-h: auto;
  --neo-chip-pad: 1px 8px;
  --neo-chip-size: .75rem;
  --neo-chip-ink: var(--card-ink);
  --neo-chip-bg: transparent;
  --neo-chip-border-w: 1px;
  --neo-chip-border-style: solid;
  --neo-chip-border: color-mix(in srgb, var(--card-accent, #818cf8) 30%, transparent);
  --neo-chip-facet-cursor: auto;
}
a.cat-item__link .cat-item__facets { --neo-chip-facet-cursor: pointer; }

/* The other categories, as links: one page per category, so each is a
   shareable address and every category reaches every other. */
.cat-others {
  margin-top: 8px;
  padding-top: 22px;
  border-top: 1px solid rgba(255,255,255,.07);
}
.cat-others ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
}
/* Each link is a Parts Kit chip (--category). Its accent comes from its own
   [data-cat], so everything that reads --cat-accent is set on the link. */
.cat-others .neo-chip {
  --neo-chip-position: static;
  --neo-chip-gap: 8px;
  --neo-chip-space: normal;
  --neo-chip-h: 36px;
  --neo-chip-pad: 5px 13px 5px 11px;
  --neo-chip-size: .8125rem;
  --neo-chip-ink: var(--text-secondary);
  --neo-chip-bg: rgba(0, 12, 24, .6);
  --neo-chip-border-w: 1px;
  --neo-chip-border-style: solid;
  --neo-chip-border: rgba(255,255,255,.1);
  --neo-chip-icon: 15px;
  --neo-chip-hover-ink: var(--text-primary);
  --neo-chip-hover-bg: rgba(0, 12, 24, .6);
  --neo-chip-hover-border: color-mix(in oklch, var(--cat-accent) 45%, transparent);
  --neo-chip-hover-line: none;
  --neo-chip-hover-line-offset: auto;
  --neo-chip-on-ink: var(--text-primary);
  --neo-chip-on-border: var(--cat-accent);
  --neo-chip-on-shadow: inset 0 0 0 1px var(--cat-accent);
  --neo-chip-on-bg: color-mix(in oklch, var(--cat-accent) 12%, rgba(0, 12, 24, .7));
  --neo-chip-focus: var(--cat-accent);
}
.cat-others .neo-chip__icon { background: var(--cat-accent); }

@media (max-width: 700px) {
  .cat-mast { align-items: flex-start; gap: 14px; }
  .cat-mast__icon { width: 52px; height: 52px; border-radius: 15px; }
  .cat-mast__svg { width: 26px; height: 26px; }
  .cat-list { grid-template-columns: 1fr; }
}
@media (pointer: coarse) {
  .cat-others .neo-chip { --neo-chip-h: 44px; --neo-chip-hit: none; }
}
@media (prefers-reduced-motion: reduce) {
  .cat-item__link { transition: none; }
}
