body { display: flex; flex-direction: column; align-items: center; }

.header {
    text-align: center;
    padding: 48px 24px 32px;
    max-width: var(--content-width);
    width: 100%;
}

h1 {
    font-size: clamp(2.2rem, 5vw, 2.8rem);
    font-weight: 400;
    font-family: var(--font-display);
    letter-spacing: -0.015em;
    margin: 16px 0 10px;
    color: var(--text-strong);
}
.subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

.content {
    max-width: var(--content-width);
    padding: 0 24px 40px;
    width: 100%;
}

/* ─── Category pill nav ───────────────────────────────────────────────────── */

.categories-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 40px;
    justify-content: center;
}
.cat-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    font-size: 0.8rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    background: var(--surface);
    transition: border-color 0.2s var(--ease), color 0.2s var(--ease), background 0.2s var(--ease);
}
.cat-pill:hover {
    border-color: var(--border-green);
    color: var(--accent);
    background: var(--accent-dim);
}
.cat-pill span {
    font-family: var(--font-mono);
    color: var(--text-dim);
    font-size: 0.72rem;
    padding: 1px 6px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 4px;
}
.cat-pill:hover span { color: var(--accent); background: rgba(0, 255, 65, 0.08); }

/* ─── Instant search ──────────────────────────────────────────────────────── */

.svc-search { max-width: 520px; margin: 0 auto; }
.svc-search-input {
    width: 100%;
    padding: 12px 18px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-pill);
    color: var(--text-strong);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    letter-spacing: 0.01em;
    transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.svc-search-input::placeholder { color: var(--text-dim); }
/* No outline reset here: the global :focus-visible accent ring (shared.css)
   must paint on keyboard focus, same as every other control. The border tint
   + background shift are an extra flourish on top, not the sole focus cue. */
.svc-search-input:focus {
    border-color: var(--border-green);
    background: var(--accent-dim);
}
.svc-search-empty {
    margin-top: 18px;
    text-align: center;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.85rem;
}
/* The live region ships empty and is filled only when a query matches nothing
   (services-filter.js). Collapse it while blank so it occupies no space. */
.svc-search-empty:empty { display: none; }

/* Rows / sections removed by the live filter. The class beats the
   .service flex / .category block display without needing !important. */
.service.filtered-out,
.category.filtered-out { display: none; }

/* ─── Bento category sections ─────────────────────────────────────────────── */

.sections {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
.category {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    overflow: hidden;
    transition: border-color 0.3s var(--ease);
}
.category:hover { border-color: var(--border-strong); }
.category h2 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 400;
    color: var(--accent-warm);
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(255, 153, 38, 0.04), transparent);
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    letter-spacing: 0.01em;
}
.category h2 a { color: inherit; }
.category h2 a:hover { color: var(--accent); }
.category h2::before {
    content: '';
    width: 6px;
    height: 14px;
    background: var(--accent-warm);
    border-radius: 1px;
    flex-shrink: 0;
}
.category h2 .count {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-left: auto;
    padding: 2px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    background: rgba(0, 0, 0, 0.4);
    font-weight: 400;
}

.service {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    border-bottom: 1px solid var(--border-soft);
    position: relative;
    transition: background 0.15s var(--ease);
}
.service::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--accent);
    opacity: 0;
    transition: opacity 0.15s var(--ease);
}
.service:hover { background: var(--accent-dim); }
.service:hover::before { opacity: 1; }
.service:last-child { border-bottom: none; }

.service-favicon {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    flex-shrink: 0;
}
.service-name {
    font-size: 0.92rem;
    font-weight: 500;
    flex: 1;
    min-width: 0;
    color: var(--text);
}
.service-name a { color: inherit; display: block; }
.service:hover .service-name a { color: var(--text-strong); }

.service-links { display: flex; gap: 6px; flex-shrink: 0; }
.service-links a {
    font-size: 0.7rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    padding: 3px 8px;
    border: 1px solid var(--border-strong);
    border-radius: 4px;
    white-space: nowrap;
    transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.service-links a:hover {
    color: var(--accent-warm);
    border-color: var(--accent-warm);
}

@media (max-width: 760px) {
    .sections { grid-template-columns: 1fr; }
}
@media (max-width: 500px) {
    .service { flex-wrap: wrap; gap: 8px; padding: 10px 16px; }
    .service-links { width: 100%; padding-left: 34px; }
    .category h2 { padding: 12px 16px; }
}
