/*
 * /tools landing page. Rebuilt from scratch 2026-08-18.
 *
 * The previous page was a hero, a pill bar and a flat grid of near-empty cards, which
 * read as a stub next to the firm pages. This is namespaced .th-* and is the ONLY
 * stylesheet the page loads, so nothing inherits from the old tools.css.
 *
 * Designed to look deliberate at 2 tools as well as at 200: the catalogue is genuinely
 * small right now and a layout that only works when full would look broken for months.
 */

.th {
    --th-ink:      #0f172a;
    --th-body:     #475569;
    --th-mute:     #94a3b8;
    --th-line:     #e6e8f2;
    --th-accent:   #4f46e5;
    --th-accent-2: #8b5cf6;
    --th-soft:     #eef2ff;
    --th-card:     #ffffff;

    max-width: 1180px;
    margin: 0 auto;
    padding: 22px 20px 80px;
    color: var(--th-body);
}

/* ================================================================== hero */
.th-hero {
    background: var(--th-card);
    border: 1px solid var(--th-line);
    border-radius: 22px;
    padding: 46px 44px 38px;
    margin-bottom: 18px;
    position: relative;
    overflow: hidden;
}
/* A single restrained accent, rather than a full gradient panel that would fight the
   card grid below it for attention. */
.th-hero::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--th-accent), var(--th-accent-2));
}
.th-hero__inner { max-width: 780px; }
.th-hero__kicker {
    font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
    color: var(--th-accent); margin: 0 0 12px;
}
.th-hero__title {
    font-size: clamp(30px, 4.2vw, 46px);
    line-height: 1.1;
    letter-spacing: -.025em;
    font-weight: 800;
    color: var(--th-ink);
    margin: 0 0 16px;
}
.th-hero__lede { font-size: 17px; line-height: 1.65; margin: 0; max-width: 68ch; }

.th-stats {
    display: flex; flex-wrap: wrap; gap: 38px;
    margin: 32px 0 0; padding: 26px 0 0;
    border-top: 1px solid var(--th-line);
}
.th-stats div { display: flex; flex-direction: column-reverse; gap: 3px; }
.th-stats dt { font-size: 12.5px; color: var(--th-mute); font-weight: 600; }
.th-stats dd {
    margin: 0; font-size: 30px; font-weight: 800; color: var(--th-ink);
    letter-spacing: -.02em; line-height: 1;
}

/* ================================================================ routes */
.th-routes {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(272px, 1fr));
    gap: 12px; margin-bottom: 34px;
}
.th-route {
    display: flex; align-items: center; gap: 14px;
    background: var(--th-card); border: 1px solid var(--th-line); border-radius: 15px;
    padding: 17px 18px; text-decoration: none;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.th-route:hover {
    border-color: #c7d2fe; transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(79, 70, 229, .1);
}
.th-route__ic {
    flex: 0 0 42px; width: 42px; height: 42px; border-radius: 12px;
    background: var(--th-soft); color: var(--th-accent);
    display: flex; align-items: center; justify-content: center; font-size: 21px;
}
.th-route__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.th-route__t { font-size: 15px; font-weight: 700; color: var(--th-ink); }
.th-route__d { font-size: 12.8px; color: var(--th-mute); line-height: 1.45; }
.th-route__n { font-size: 19px; font-weight: 800; color: var(--th-accent); }

/* =============================================================== sections */
.th-sec { margin-bottom: 40px; }
.th-sec__head {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 16px; margin-bottom: 15px;
}
.th-sec__head h2 {
    font-size: 21px; font-weight: 800; color: var(--th-ink);
    letter-spacing: -.015em; margin: 0;
}
.th-count {
    display: inline-block; margin-left: 8px; font-size: 12.5px; font-weight: 700;
    color: var(--th-accent); background: var(--th-soft); border-radius: 999px; padding: 3px 10px;
    vertical-align: middle;
}
.th-clear { font-size: 13px; font-weight: 700; color: var(--th-accent); text-decoration: none; }
.th-clear:hover { text-decoration: underline; }

/* ============================================================= categories */
.th-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 10px; }
.th-cat {
    display: flex; flex-direction: column; align-items: flex-start; gap: 7px;
    background: var(--th-card); border: 1px solid var(--th-line); border-radius: 14px;
    padding: 16px; text-decoration: none;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.th-cat:hover { border-color: #c7d2fe; transform: translateY(-2px); box-shadow: 0 8px 22px rgba(79,70,229,.09); }
.th-cat.is-active { border-color: var(--th-accent); background: var(--th-soft); }
.th-cat__ic {
    width: 34px; height: 34px; border-radius: 10px; background: var(--th-soft);
    color: var(--th-accent); display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.th-cat.is-active .th-cat__ic { background: var(--th-accent); color: #fff; }
.th-cat__t { font-size: 14.5px; font-weight: 700; color: var(--th-ink); line-height: 1.3; }
.th-cat__n { font-size: 12px; color: var(--th-mute); font-weight: 600; }

/* =============================================================== controls */
.th-controls {
    display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
    margin-bottom: 16px;
}
.th-search {
    flex: 1 1 300px; position: relative;
    display: flex; align-items: center;
}
.th-search i {
    position: absolute; left: 14px; color: var(--th-mute); font-size: 18px; pointer-events: none;
}
.th-search input {
    width: 100%; border: 1px solid var(--th-line); border-radius: 12px;
    padding: 12px 14px 12px 42px; font-size: 14.5px; color: var(--th-ink);
    background: var(--th-card); outline: none;
    transition: border-color .16s ease, box-shadow .16s ease;
}
.th-search input:focus { border-color: var(--th-accent); box-shadow: 0 0 0 3px rgba(79,70,229,.12); }
.th-sorts { display: flex; flex-wrap: wrap; gap: 6px; }
.th-sort {
    border: 1px solid var(--th-line); background: var(--th-card); color: var(--th-body);
    border-radius: 999px; padding: 9px 15px; font-size: 13px; font-weight: 600;
    cursor: pointer; transition: all .16s ease;
}
.th-sort:hover { border-color: #c7d2fe; color: var(--th-accent); }
.th-sort.is-active { background: var(--th-accent); border-color: var(--th-accent); color: #fff; }

/* ================================================================== cards */
/* auto-fill, not auto-fit: with 2 tools auto-fit would stretch each card to half the
   viewport and look like a mistake. Fixed-width tracks keep a sparse catalogue tidy. */
.th-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 360px)); gap: 14px; }

.th-card {
    position: relative;
    display: flex; flex-direction: column; gap: 12px;
    background: var(--th-card); border: 1px solid var(--th-line); border-radius: 17px;
    padding: 18px;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.th-card:hover { border-color: #c7d2fe; transform: translateY(-3px); box-shadow: 0 14px 32px rgba(79,70,229,.11); }
/* Whole-card hit area, with the real buttons layered above it. */
.th-card__hit { position: absolute; inset: 0; z-index: 1; border-radius: 17px; }
.th-card__top, .th-card__desc, .th-card__chips, .th-card__foot { position: relative; z-index: 2; pointer-events: none; }
.th-card__foot a, .th-card__chips li { pointer-events: auto; }

.th-card__top { display: flex; align-items: flex-start; gap: 13px; }
.th-card__logo {
    flex: 0 0 48px; width: 48px; height: 48px; border-radius: 13px; overflow: hidden;
    background: #f8fafc; border: 1px solid var(--th-line);
    display: flex; align-items: center; justify-content: center;
}
.th-card__logo img { width: 100%; height: 100%; object-fit: contain; padding: 5px; }
.th-card__mono {
    width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--th-accent), var(--th-accent-2));
    color: #fff; font-weight: 800; font-size: 21px;
}
.th-card__id { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.th-card__name { font-size: 16.5px; font-weight: 700; color: var(--th-ink); line-height: 1.25; }
.th-card__cat {
    font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
    color: var(--th-accent);
}
.th-card__score {
    flex: 0 0 auto; font-size: 14px; font-weight: 800; color: var(--th-accent);
    background: var(--th-soft); border-radius: 10px; padding: 6px 11px; cursor: help;
}
.th-card__desc { font-size: 13.8px; line-height: 1.55; color: var(--th-body); margin: 0; }

.th-card__chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.th-chip {
    display: inline-flex; align-items: baseline; gap: 5px;
    background: #f8fafc; border: 1px solid var(--th-line); border-radius: 9px; padding: 5px 9px;
}
.th-chip__k { font-size: 11px; color: var(--th-mute); font-weight: 600; }
.th-chip__v { font-size: 12.5px; color: var(--th-ink); font-weight: 700; }

.th-card__foot {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    flex-wrap: wrap; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--th-line);
}
.th-card__price { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.th-price { font-size: 13px; font-weight: 700; color: var(--th-ink); }
.th-card__acts { display: flex; gap: 7px; }

/* =================================================================== bits */
.th-tag {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 11.5px; font-weight: 700; border-radius: 8px; padding: 4px 8px;
    background: #f1f5f9; color: var(--th-body);
}
.th-tag--free { background: #ecfdf5; color: #047857; }
.th-tag--star { background: #fffbeb; color: #b45309; }
.th-tag--own  { background: var(--th-soft); color: #4338ca; margin-left: 6px; font-size: 10.5px; }

.th-btn {
    display: inline-block; font-size: 13px; font-weight: 700; text-decoration: none;
    background: var(--th-accent); color: #fff; border-radius: 10px; padding: 8px 15px;
    transition: background .16s ease;
}
.th-btn:hover { background: #4338ca; color: #fff; }
.th-btn--ghost { background: transparent; color: var(--th-accent); border: 1px solid var(--th-line); }
.th-btn--ghost:hover { background: var(--th-soft); color: var(--th-accent); border-color: #c7d2fe; }

.th-empty {
    background: var(--th-card); border: 1px dashed #cbd5e1; border-radius: 17px;
    padding: 50px 30px; text-align: center;
}
.th-empty h3 { margin: 0 0 8px; font-size: 18px; font-weight: 700; color: var(--th-ink); }
.th-empty p { margin: 0 auto 18px; max-width: 52ch; font-size: 14.5px; line-height: 1.6; }

.th-note {
    display: flex; align-items: flex-start; gap: 9px;
    margin: 20px 0 0; padding: 14px 16px;
    background: var(--th-soft); border-radius: 13px;
    font-size: 13.3px; line-height: 1.6; color: #4338ca;
}
.th-note i { font-size: 17px; flex: 0 0 auto; margin-top: 1px; }
.th-pager { margin-top: 26px; }

/* ================================================================= method */
.th-method {
    background: var(--th-card); border: 1px solid var(--th-line);
    border-radius: 20px; padding: 34px;
}
.th-method h2 { margin: 0 0 22px; font-size: 20px; font-weight: 800; color: var(--th-ink); }
.th-method__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.th-method__grid h3 {
    margin: 0 0 6px; font-size: 14.5px; font-weight: 700; color: var(--th-ink);
    padding-left: 12px; border-left: 3px solid var(--th-accent);
}
.th-method__grid p { margin: 0; font-size: 13.5px; line-height: 1.6; padding-left: 15px; }

/* ================================================================= mobile */
@media (max-width: 720px) {
    .th { padding: 16px 14px 60px; }
    .th-hero { padding: 32px 22px 28px; border-radius: 18px; }
    .th-stats { gap: 24px; }
    .th-stats dd { font-size: 25px; }
    .th-grid { grid-template-columns: 1fr; }
    .th-method { padding: 24px 20px; }
}

/* ---------------------------------------------------- spacing + chip row
   The search row sat flush against the first card. margin-bottom on the form was
   being flattened by the global form reset, so the gap lives on the grid and the
   empty state instead, where nothing else can override it. */
.th-controls { margin-bottom: 0; }
.th-grid,
.th-empty { margin-top: 22px; }

/* Compact category filter. Full cards pushed the actual tools a screen down. */
.th-chiprow {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin: 0 0 18px;
}
.th-fchip {
    display: inline-flex; align-items: center; gap: 7px;
    background: var(--th-card); border: 1px solid var(--th-line); border-radius: 999px;
    padding: 8px 15px; font-size: 13.5px; font-weight: 650; color: var(--th-body);
    text-decoration: none; transition: all .16s ease; white-space: nowrap;
}
.th-fchip i { font-size: 16px; color: var(--th-accent); }
.th-fchip:hover { border-color: #c7d2fe; color: var(--th-accent); }
.th-fchip.is-active { background: var(--th-accent); border-color: var(--th-accent); color: #fff; }
.th-fchip.is-active i { color: #fff; }
.th-fchip__n {
    font-size: 11.5px; font-weight: 700; background: var(--th-soft); color: var(--th-accent);
    border-radius: 999px; padding: 1px 7px;
}
.th-fchip.is-active .th-fchip__n { background: rgba(255,255,255,.22); color: #fff; }

/* Tighter hero so the catalogue starts higher up the page. */
.th-hero { padding: 34px 36px 28px; margin-bottom: 22px; }
.th-hero__title { font-size: clamp(26px, 3.4vw, 36px); margin-bottom: 12px; }
.th-hero__lede { font-size: 15.5px; }
.th-stats { margin-top: 22px; padding-top: 20px; gap: 32px; }
.th-stats dd { font-size: 25px; }

/* These moved below the catalogue, so they need their own separation. */
.th-routes { margin-top: 46px; margin-bottom: 26px; }

@media (max-width: 720px) {
    .th-hero { padding: 26px 20px 22px; }
    .th-chiprow { gap: 6px; }
    .th-fchip { padding: 7px 12px; font-size: 12.5px; }
}

/* ------------------------------------------------- verified-spec count on cards
   Replaced a bare 0-10 score. Next to a product name a lone number reads as a
   quality rating, and this one measures our documentation, not the software. */
.th-card__verified {
    flex: 0 0 auto; display: inline-flex; align-items: baseline; gap: 4px;
    background: #ecfdf5; color: #047857; border-radius: 10px; padding: 5px 9px;
    cursor: help; white-space: nowrap;
}
.th-card__verified i { font-size: 13px; align-self: center; }
.th-card__verified-n { font-size: 14px; font-weight: 800; }
.th-card__verified-l { font-size: 10.5px; font-weight: 700; letter-spacing: .02em; }
.tm-podium__score { background: #ecfdf5; color: #047857; }
