/* =========================================================================
   Catalogue page — companion to the Tool Wall
   --------------------------------------------------------------------------
   Reuses the wall's palette, paper texture, fonts, and back-link/masthead
   classes from style.css. Adds a denser, non-rotated card grid and a small
   filter toolbar. The first 7 categories use the same tints as the wall's
   .cat-pill so a card here looks like a card there.
   ========================================================================= */

:root {
  /* Extra category tints not in style.css */
  --cat-audio:        #b8e0d2;
  --cat-video:        #ffb4a2;
  --cat-agents:       #f4d35e;
  --cat-data:         #c9d6df;
  --cat-it:           #1f4040;
  --cat-it-text:      #c7db5c;
}

/* Catalogue page padding tweaks */
.cat-page { max-width: 1280px; }

.cat-page .lede { max-width: 620px; }

/* ---------- toolbar ---------- */

.cat-toolbar {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px 24px;
  align-items: center;
  background: #ffffff;
  border: 1px solid rgba(31, 64, 64, 0.18);
  border-radius: 6px;
  padding: 16px 20px;
  margin-bottom: 32px;
  box-shadow: 0 12px 24px -16px rgba(31, 64, 64, 0.25),
              0 1px 0 rgba(31, 64, 64, 0.04);
}

.cat-filter-label {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--green-dark);
}

.cat-filter {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--green-dark);
  background: var(--paper);
  border: 1px solid rgba(31, 64, 64, 0.22);
  border-radius: 4px;
  padding: 8px 12px;
  cursor: pointer;
  outline: none;
  min-width: 220px;
}

.cat-filter:focus {
  border-color: var(--green-dark);
  box-shadow: 0 0 0 3px var(--green-hero);
}

.cat-conventions {
  grid-column: 1 / -1;
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  line-height: 1.5;
  color: var(--grey-body);
  padding-top: 12px;
  border-top: 1px dashed rgba(31, 64, 64, 0.18);
}

.cat-conventions strong {
  font-style: normal;
  color: var(--green-dark);
}

@media (max-width: 720px) {
  .cat-toolbar { grid-template-columns: 1fr; }
}

/* ---------- sections ---------- */

.cat-section {
  margin-bottom: 48px;
}

.cat-section-title {
  font-family: var(--serif);
  font-size: clamp(28px, 3.4vw, 40px);
  font-weight: 700;
  color: var(--green-dark);
  letter-spacing: -0.01em;
  margin-bottom: 18px;
  padding-bottom: 8px;
  border-bottom: 1px dashed rgba(31, 64, 64, 0.25);
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.cat-count {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--grey-body);
  background: var(--green-hero);
  padding: 3px 10px;
  border-radius: 999px;
}

.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

/* ---------- cards (no rotation, denser than the wall) ---------- */

.cat-card {
  position: relative;
  background: #ffffff;
  border: 1px solid rgba(31, 64, 64, 0.16);
  border-radius: 4px;
  padding: 16px 18px 14px;
  box-shadow: 0 1px 0 rgba(31, 64, 64, 0.04),
              0 6px 16px -10px rgba(31, 64, 64, 0.22);
  display: flex;
  flex-direction: column;
  transition: transform 0.18s cubic-bezier(0.2, 0.7, 0.2, 1),
              box-shadow 0.18s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.cat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 1px 0 rgba(31, 64, 64, 0.04),
              0 14px 26px -12px rgba(31, 64, 64, 0.30);
}

/* Pin in top-right */
.cat-card::before {
  content: "";
  position: absolute;
  top: -5px;
  right: 16px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffffff 0%, var(--green-hero) 55%, var(--green-dark) 90%);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35),
              inset -1px -1px 1px rgba(0, 0, 0, 0.15);
  z-index: 3;
}

.cat-card .cat-pill {
  align-self: flex-start;
  margin-bottom: 10px;
}

/* Category-specific pill tints */
.cat-pill--study        { background: var(--cat-study); }
.cat-pill--writing      { background: var(--cat-writing); }
.cat-pill--coding       { background: var(--cat-coding); color: var(--cat-coding-text); }
.cat-pill--research     { background: var(--cat-research); }
.cat-pill--creative     { background: var(--cat-creative); color: var(--cat-creative-text); }
.cat-pill--productivity { background: var(--cat-productivity); }
.cat-pill--other        { background: var(--cat-other); }
.cat-pill--audio        { background: var(--cat-audio); }
.cat-pill--video        { background: var(--cat-video); }
.cat-pill--agents       { background: var(--cat-agents); }
.cat-pill--data         { background: var(--cat-data); }
.cat-pill--it           { background: var(--cat-it); color: var(--cat-it-text); }

.cat-card-name {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.15;
  color: var(--green-dark);
  margin-bottom: 6px;
  word-break: break-word;
}

.cat-card-tagline {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  line-height: 1.45;
  color: var(--grey-body);
  margin-bottom: 10px;
}

.cat-card-usecase {
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1.5;
  color: var(--grey-body);
  padding-top: 8px;
  border-top: 1px dashed rgba(31, 64, 64, 0.18);
  margin-bottom: 8px;
}

.cat-card-usecase::before {
  content: "used for ";
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 10px;
  color: var(--green-dark);
}

.cat-card-pricing {
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1.5;
  color: var(--grey-body);
  margin-bottom: 8px;
}

.cat-card-pricing::before {
  content: "pricing ";
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 10px;
  color: var(--green-dark);
}

.cat-card-pricing strong {
  color: var(--green-dark);
  font-weight: 700;
}

.cat-card .cat-link {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--green-dark);
  text-decoration: none;
  word-break: break-all;
  margin-top: auto;
  padding: 2px 0;
  border-bottom: 1px solid var(--green-hero);
  transition: background 0.15s;
}

.cat-card .cat-link:hover {
  background: var(--green-hero);
}

.cat-url-note {
  font-family: var(--sans);
  font-size: 11px;
  font-style: italic;
  color: var(--grey-body);
}

/* ---------- footer additions ---------- */

.cat-verified {
  font-family: var(--serif);
  font-style: italic;
  font-size: 12px;
  color: var(--grey-body);
}

.cat-verified strong {
  font-style: normal;
  color: var(--green-dark);
}

/* The "For the IT-curious" section gets a subtle visual differentiation */
.cat-section[data-category="it"] {
  margin-top: 64px;
  padding-top: 32px;
  border-top: 2px solid var(--green-dark);
}

.cat-section[data-category="it"] .cat-section-title {
  color: var(--green-dark);
}

.cat-section[data-category="it"] .cat-section-title::before {
  content: "// ";
  font-family: var(--mono);
  color: var(--grey-body);
  font-weight: 400;
}

@media (prefers-reduced-motion: reduce) {
  .cat-card { transition: none; }
}
