/* Everything below the hero, plus the download page. Tokens come from sample.css. */
:root {
  --surface-tint: #F5F7FB;
  --border-strong: rgba(0, 0, 0, 0.1);
  --ink-secondary: #3F3F46;
  --brand-tint: rgba(0, 90, 224, 0.08);
  --success: #15803D;
  --success-tint: rgba(34, 197, 94, 0.1);
  --error: #B91C1C;
  --error-tint: rgba(239, 68, 68, 0.08);
  --card-shadow: 0 1px 2px rgba(9, 9, 11, 0.04), 0 8px 24px -12px rgba(9, 9, 11, 0.08);
  --card-shadow-hover: 0 2px 4px rgba(9, 9, 11, 0.05), 0 16px 32px -16px rgba(0, 90, 224, 0.25);
  --radius-card: 16px;
  --radius-control: 12px;
}

/* Component display rules must never override the hidden attribute. */
[hidden] { display: none !important; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Section shell ---------- */

.section { padding: 112px 24px; background: var(--paper); }
.section--tint { background: var(--surface-tint); }
.section__inner { max-width: 1200px; margin: 0 auto; }
.section__header { max-width: 640px; margin-bottom: 48px; }

.section__header--split {
  max-width: none;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.section__header--split > div { max-width: 600px; }

.eyebrow {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand-blue);
}

.section__title {
  margin: 0 0 12px;
  font-size: clamp(26px, 4vw, 48px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.section__lead { margin: 0; font-size: 17px; color: var(--ink-muted); text-wrap: pretty; }

/* ---------- Buttons ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  font: 600 14px/1.2 var(--font-brand);
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out);
}

.button svg { width: 18px; height: 18px; }
.button--primary { background: var(--brand-blue); color: var(--ink-light); }
.button--primary:hover { background: var(--brand-blue-hover); }
.button--primary:disabled { opacity: 0.6; cursor: progress; }
.button--ghost { background: transparent; border-color: var(--border-strong); color: var(--ink-dark); }
.button--ghost:hover { background: var(--surface-tint); }
.button--large { min-height: 52px; padding: 0 28px; font-size: 15px; }

:where(a, button, input, textarea):focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 2px;
}

/* ---------- Search + filters ---------- */

.search { position: relative; width: min(100%, 340px); }

.search__icon {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  color: var(--ink-muted);
  pointer-events: none;
}

.search__input {
  width: 100%;
  min-height: 48px;
  padding: 0 44px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-control);
  background: var(--paper);
  color: var(--ink-dark);
  font: 400 15px/1.2 var(--font-brand);
  transition: border-color var(--duration-fast) var(--ease-out);
}

.search__input::-webkit-search-cancel-button { display: none; }
.search__input:focus { border-color: var(--brand-blue); outline: none; }

.search__clear {
  position: absolute;
  right: 2px;
  top: 2px;
  width: 44px;
  height: 44px;
  border: 0;
  background: none;
  color: var(--ink-muted);
  cursor: pointer;
}

.filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 40px 0 24px;
}

/* One quiet track with a raised white "thumb" for the active filter, like a native
   segmented control. It scrolls sideways on phones instead of wrapping into a ragged block. */
.filters__chips {
  display: flex;
  gap: 4px;
  min-width: 0;
  padding: 4px;
  border-radius: 999px;
  background: var(--surface-tint);
  border: 1px solid var(--border-hairline);
  overflow-x: auto;
  scrollbar-width: none;
}

.filters__chips::-webkit-scrollbar { display: none; }

.filter-chip {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-muted);
  font: 500 14px/1.2 var(--font-brand);
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out);
}

.filter-chip__icon { width: 15px; height: 15px; }
.filter-chip:hover { color: var(--ink-dark); }

.filter-chip[aria-pressed="true"] {
  background: var(--paper);
  color: var(--ink-dark);
  box-shadow: 0 1px 2px rgba(9, 9, 11, 0.08), 0 2px 8px -2px rgba(9, 9, 11, 0.08);
}

.filter-chip[aria-pressed="true"] svg { color: var(--brand-blue); }

.filter-chip__count {
  font-size: 12px;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

.filters__count { flex-shrink: 0; margin: 0; font-size: 13px; color: var(--ink-muted); font-variant-numeric: tabular-nums; }

/* ---------- Tool cards ---------- */

/* Compact on purpose: the catalog grows toward 100 tools, so four small cards per row
   keep the list scannable instead of a wall of tall tiles. */
.tool-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 12px;
}

.tool-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 16px;
  border: 1px solid var(--border-hairline);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: 0 1px 2px rgba(9, 9, 11, 0.04);
  transition: box-shadow var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out);
}

.tool-card:hover {
  border-color: rgba(0, 90, 224, 0.25);
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-2px);
}

.tool-card__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }

.tool-card__icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--brand-tint);
  color: var(--brand-blue);
}

.tool-card__category { font-size: 12px; font-weight: 500; color: var(--ink-muted); }
.tool-card__name { margin: 0 0 4px; font-size: 16px; font-weight: 700; line-height: 1.3; letter-spacing: -0.01em; }

.tool-card__description {
  display: -webkit-box;
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-muted);
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.tool-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border-hairline);
}

.tool-card__formats {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: var(--ink-muted);
}

.tool-card__badge {
  flex-shrink: 0;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--success-tint);
  color: var(--success);
  font-size: 11px;
  font-weight: 600;
}

.tool-card[hidden] { display: none; }
.tool-card__link { color: inherit; text-decoration: none; }
.tool-card__link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.tool-card:has(.tool-card__link:focus-visible) { outline: 2px solid var(--brand-blue); outline-offset: 2px; }
.tool-card__link:focus-visible { outline: none; }

.empty { padding: 64px 16px; text-align: center; }
.empty__title { margin: 0 0 8px; font-size: 20px; font-weight: 700; }
.empty__text { margin: 0 auto 24px; max-width: 420px; color: var(--ink-muted); }

.note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-top: 32px;
  padding: 16px 20px;
  border-radius: var(--radius-control);
  background: var(--surface-tint);
  font-size: 15px;
  color: var(--ink-muted);
}

.note p { margin: 0; }
.note strong { color: var(--ink-dark); font-weight: 600; }

.note__link {
  min-height: 44px;
  border: 0;
  background: none;
  color: var(--brand-blue);
  font: 600 14px/1.2 var(--font-brand);
  cursor: pointer;
}
