:root {
    --bg: #050816;
    --bg-soft: #0b1120;
    --panel: rgba(11, 18, 32, 0.72);
    --panel-strong: rgba(15, 23, 42, 0.88);
    --line: rgba(148, 163, 184, 0.18);
    --text: #e2e8f0;
    --muted: #94a3b8;
    --primary: #7c3aed;
    --secondary: #22d3ee;
    --accent: #f472b6;
    --success: #34d399;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 15% 20%, rgba(124, 58, 237, 0.20) 0, transparent 26%),
        radial-gradient(circle at 85% 18%, rgba(34, 211, 238, 0.18) 0, transparent 26%),
        radial-gradient(circle at 55% 82%, rgba(244, 114, 182, 0.18) 0, transparent 22%),
        linear-gradient(180deg, #050816 0%, #070d1d 50%, #040714 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    color: inherit;
}

.aurora-bg {
    position: fixed;
    inset: 0;
    z-index: -2;
    overflow: hidden;
    pointer-events: none;
}

.aurora-bg::before,
.aurora-bg::after {
    content: "";
    position: absolute;
    width: 40rem;
    height: 40rem;
    filter: blur(90px);
    opacity: 0.28;
    border-radius: 999px;
    animation: floatGlow 16s ease-in-out infinite alternate;
}

.aurora-bg::before {
    top: -8rem;
    left: -8rem;
    background: #7c3aed;
}

.aurora-bg::after {
    right: -10rem;
    top: 10rem;
    background: #06b6d4;
    animation-delay: 2s;
}

.grid-overlay {
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(rgba(148, 163, 184, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.08) 1px, transparent 1px);
    background-size: 70px 70px;
    mask-image: linear-gradient(180deg, rgba(255, 255, 255, 0.55), transparent 90%);
    pointer-events: none;
}

.glass-panel {
    background: var(--panel);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    border: 1px solid var(--line);
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.28);
}

.hero-shell {
    position: relative;
    overflow: hidden;
}

.hero-shell::before {
    content: "";
    position: absolute;
    inset: auto -10% -55% 30%;
    height: 20rem;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.28), transparent 60%);
    filter: blur(28px);
    pointer-events: none;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.6rem 0.95rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(15, 23, 42, 0.56);
    color: #cbd5e1;
    font-size: 0.9rem;
}

.hero-badge .dot {
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--secondary), var(--accent));
    box-shadow: 0 0 18px rgba(34, 211, 238, 0.9);
}

.neon-text {
    background: linear-gradient(90deg, #ffffff 0%, #bfdbfe 20%, #c4b5fd 55%, #67e8f9 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.primary-btn,
.ghost-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 0.95rem 1.3rem;
    border-radius: 1rem;
    font-weight: 700;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.primary-btn {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.95), rgba(34, 211, 238, 0.92));
    color: white;
    box-shadow: 0 15px 35px rgba(76, 29, 149, 0.38);
}

.ghost-btn {
    border: 1px solid rgba(148, 163, 184, 0.24);
    background: rgba(15, 23, 42, 0.52);
    color: #dbeafe;
}

.primary-btn:hover,
.ghost-btn:hover,
.tab-btn:hover,
.sub-tab-btn:hover,
.tool-card:hover,
.spotlight-card:hover {
    transform: translateY(-2px);
}

.metric-card,
.spotlight-card,
.tool-card,
.filter-shell,
.search-shell {
    border-radius: 1.5rem;
}

.metric-card {
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.74), rgba(15, 23, 42, 0.54));
    border: 1px solid rgba(148, 163, 184, 0.16);
}

.metric-card::after {
    content: "";
    position: absolute;
    inset: auto -20% -40% auto;
    width: 10rem;
    height: 10rem;
    background: radial-gradient(circle, rgba(34, 211, 238, 0.22), transparent 60%);
}

.search-shell {
    position: relative;
    display: flex;
    align-items: stretch;
    gap: 0;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 1.1rem;
    box-shadow: 0 10px 35px rgba(15, 23, 42, 0.18);
    overflow: hidden;
}

.search-icon {
    display: flex;
    align-items: center;
    padding: 0 0.35rem 0 1rem;
    font-size: 1.05rem;
    opacity: 0.9;
}

#globalSearch {
    flex: 1;
    min-width: 0;
    padding: 0.95rem 0.75rem;
    border: none;
    background: transparent;
    color: #f8fafc;
    outline: none;
}

#globalSearch::placeholder {
    color: #64748b;
}

.search-btn {
    flex-shrink: 0;
    margin: 0.35rem 0.35rem 0.35rem 0;
    padding: 0 1.15rem;
    border: none;
    border-radius: 0.85rem;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.95), rgba(8, 145, 178, 0.9));
    color: #fff;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: filter 0.2s, transform 0.15s;
}

.search-btn:hover {
    filter: brightness(1.08);
}

.search-btn:active {
    transform: scale(0.98);
}

.tab-btn,
.sub-tab-btn {
    position: relative;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(15, 23, 42, 0.66);
    color: #cbd5e1;
    transition: all 0.25s ease;
}

.tab-btn {
    padding: 0.95rem 1.15rem;
    border-radius: 1.2rem;
    min-width: 10rem;
    text-align: left;
}

.sub-tab-btn {
    padding: 0.68rem 1rem;
    border-radius: 999px;
    font-size: 0.92rem;
}

.tab-btn .count,
.sub-tab-btn .count {
    color: #67e8f9;
}

.tab-active,
.sub-tab-active {
    color: white !important;
    border-color: rgba(125, 211, 252, 0.45) !important;
    background: linear-gradient(135deg, rgba(91, 33, 182, 0.88), rgba(8, 145, 178, 0.74)) !important;
    box-shadow: 0 16px 38px rgba(76, 29, 149, 0.35);
}

.tab-muted {
    opacity: 0.82;
}

.tool-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    background: linear-gradient(180deg, rgba(11, 18, 32, 0.86), rgba(8, 14, 29, 0.72));
    border: 1px solid rgba(148, 163, 184, 0.16);
    overflow: hidden;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.tool-card::before {
    content: "";
    position: absolute;
    inset: -1px;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.16), rgba(34, 211, 238, 0.12), transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tool-card:hover::before {
    opacity: 1;
}

.tool-card:hover {
    border-color: rgba(103, 232, 249, 0.34);
    box-shadow: 0 26px 48px rgba(2, 6, 23, 0.42);
}

.tool-card > * {
    position: relative;
    z-index: 1;
}

.tag-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(15, 23, 42, 0.72);
    color: #cbd5e1;
    padding: 0.35rem 0.75rem;
    font-size: 0.74rem;
    letter-spacing: 0.06em;
}

.seo-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 999px;
    padding: 0.38rem 0.8rem;
    background: rgba(124, 58, 237, 0.16);
    border: 1px solid rgba(167, 139, 250, 0.24);
    color: #d8b4fe;
    font-size: 0.76rem;
    font-weight: 700;
}

.tool-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: auto;
    padding: 0.95rem 1rem;
    border-radius: 1rem;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.88));
    border: 1px solid rgba(148, 163, 184, 0.16);
    color: white;
    font-weight: 800;
    transition: all 0.25s ease;
}

.tool-link:hover {
    border-color: rgba(34, 211, 238, 0.46);
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.95), rgba(8, 145, 178, 0.92));
    box-shadow: 0 18px 30px rgba(14, 116, 144, 0.2);
}

.spotlight-card {
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.82), rgba(15, 23, 42, 0.60));
    border: 1px solid rgba(148, 163, 184, 0.14);
}

.spotlight-card::after {
    content: "";
    position: absolute;
    inset: auto -15% -35% auto;
    width: 11rem;
    height: 11rem;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.18), transparent 65%);
}

.section-title {
    font-size: clamp(1.55rem, 2vw, 2rem);
    font-weight: 800;
    color: #f8fafc;
    letter-spacing: -0.04em;
}

.section-desc {
    color: var(--muted);
    line-height: 1.8;
}

.empty-state {
    border: 1px dashed rgba(148, 163, 184, 0.18);
    background: rgba(15, 23, 42, 0.5);
    border-radius: 1.5rem;
}

.prose-shell {
    background: rgba(8, 14, 29, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 2rem;
}

.prose h2 {
    color: #f8fafc;
    font-weight: 800;
    letter-spacing: -0.03em;
    border-left: 4px solid var(--secondary);
    padding-left: 1rem;
    margin-top: 2rem;
}

.prose p {
    line-height: 1.95;
    margin-bottom: 1.3rem;
    color: #94a3b8;
}

.footer-line {
    background: linear-gradient(90deg, transparent, rgba(148, 163, 184, 0.3), transparent);
    height: 1px;
}

/* —— Directory layout (tools first, 4×4 grid, pagination) —— */
.site-hero .hero-kicker {
    margin: 0 0 0.75rem;
    font-size: 0.8rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #94a3b8;
}

.site-hero .hero-title {
    margin: 0;
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.15;
    color: #f8fafc;
}

.site-hero .hero-accent {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.92em;
    font-weight: 700;
    color: #a5b4fc;
}

.site-hero .hero-lead {
    margin: 0.85rem 0 0;
    max-width: 46rem;
    font-size: 1.05rem;
    line-height: 1.7;
    color: #cbd5e1;
}

.hero-benefits {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.1rem;
}

.hero-benefit-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #e2e8f0;
    background: rgba(30, 41, 59, 0.75);
    border: 1px solid rgba(103, 232, 249, 0.22);
}

.site-stat {
    margin: 1rem 0 0;
    font-size: 0.88rem;
    color: #64748b;
}

.tools-hub {
    margin-top: 0.25rem;
}

.tools-toolbar {
    border-radius: 1.25rem;
    padding: 1rem 1.15rem 1.1rem;
    margin-bottom: 1.25rem;
}

.tools-toolbar-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.75rem 1.25rem;
    margin-bottom: 0.85rem;
}

.tools-heading {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    color: #f8fafc;
}

.tools-subline {
    margin: 0.35rem 0 0;
    font-size: 0.88rem;
    color: #94a3b8;
}

.tools-filter-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-scroll {
    overflow-x: auto;
    padding-bottom: 0.35rem;
    margin-bottom: 0.5rem;
    scrollbar-width: thin;
}

.filter-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.5rem;
    min-width: min-content;
}

.filter-pill,
.filter-chip {
    flex: 0 0 auto;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(15, 23, 42, 0.55);
    color: #cbd5e1;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.filter-pill {
    padding: 0.5rem 0.9rem;
    border-radius: 0.65rem;
    font-size: 0.88rem;
    font-weight: 600;
}

.filter-chip {
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8rem;
}

.filter-pill .count,
.filter-chip .count {
    margin-left: 0.35rem;
    color: #67e8f9;
    font-weight: 700;
}

.filter-pill.is-active,
.filter-chip.is-active {
    color: #fff;
    border-color: rgba(129, 140, 248, 0.5);
    background: rgba(79, 70, 229, 0.35);
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.tool-card-hit {
    display: flex;
    gap: 0.85rem;
    text-decoration: none;
    color: inherit;
    align-items: flex-start;
}

.tool-card-figure {
    position: relative;
    flex-shrink: 0;
    margin: 0;
    padding: 0;
    width: 80px;
    height: 80px;
}

.tool-card-glyph {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    color: #67e8f9;
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.95), rgba(8, 14, 29, 0.88));
    border: 1px solid rgba(103, 232, 249, 0.25);
    border-radius: 1rem;
    z-index: 0;
}

.tool-card-figure img.tool-card-img {
    position: relative;
    z-index: 1;
    display: block;
    width: 80px;
    height: 80px;
    border-radius: 1rem;
    border: 1px solid rgba(103, 232, 249, 0.28);
    background: rgba(6, 16, 18, 0.9);
    object-fit: cover;
}

.tool-card-figure img.tool-card-img.is-hidden {
    display: none;
}

.tool-card-body {
    flex: 1;
    min-width: 0;
}

.tool-kw-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0.5rem 0 0;
    padding: 0;
    list-style: none;
}

.tool-kw-chips li span {
    display: inline-block;
    font-size: 0.65rem;
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 999px;
    padding: 0.15rem 0.45rem;
}

.tool-card {
    display: flex;
    flex-direction: column;
    min-height: 13rem;
    padding: 1rem 1.05rem 1.1rem;
    border-radius: 1rem;
    background: rgba(11, 18, 32, 0.92);
    border: 1px solid rgba(148, 163, 184, 0.14);
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.tool-card:hover {
    transform: translateY(-2px);
    border-color: rgba(103, 232, 249, 0.28);
    box-shadow: 0 12px 28px rgba(2, 6, 23, 0.35);
}

.tool-card::before {
    display: none;
}

.tool-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.tool-cat {
    font-size: 0.7rem;
    font-weight: 600;
    color: #a5b4fc;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tool-id {
    font-size: 0.62rem;
    color: #475569;
    font-family: ui-monospace, Consolas, monospace;
    background: rgba(30, 41, 59, 0.8);
    border-radius: 999px;
    padding: 0.12rem 0.45rem;
    flex-shrink: 0;
}

.tool-card-hit:hover .tool-card-title {
    color: #a5f3fc;
}

.tool-card-title {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.35;
    color: #f1f5f9;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tool-card-desc {
    margin: 0.5rem 0 0;
    flex: 1;
    font-size: 0.78rem;
    line-height: 1.5;
    color: #94a3b8;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tool-card-link {
    margin-top: 0.85rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: #67e8f9;
    text-decoration: none;
}

.tool-card-link:hover {
    color: #a5f3fc;
}

.pagination {
    margin-top: 1.75rem;
}

.pagination.hidden {
    display: none;
}

.crawl-directory {
    border-top: 1px solid rgba(148, 163, 184, 0.15);
    padding-top: 2rem;
}

.crawl-directory h2 {
    font-size: 1.25rem;
    font-weight: 800;
    color: #e2e8f0;
    margin-bottom: 0.5rem;
}

.crawl-directory h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #a5b4fc;
    margin: 1.25rem 0 0.5rem;
}

.crawl-directory ul {
    columns: 2;
    column-gap: 2rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.crawl-directory li {
    break-inside: avoid;
    margin-bottom: 0.35rem;
    font-size: 0.78rem;
    line-height: 1.45;
}

.crawl-directory a {
    color: #67e8f9;
    text-decoration: none;
    font-weight: 600;
}

.crawl-directory a:hover {
    color: #a5f3fc;
}

@media (max-width: 768px) {
    .crawl-directory ul {
        columns: 1;
    }
}

.hub-breadcrumb ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.8rem;
    color: #94a3b8;
}

.hub-breadcrumb a {
    color: #67e8f9;
    text-decoration: none;
    font-weight: 600;
}

.hub-breadcrumb a:hover {
    text-decoration: underline;
}

.hub-featured-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem 1rem;
    list-style: none;
    padding: 0;
    margin: 0.75rem 0 0;
}

.hub-featured-list a {
    color: #a5f3fc;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
}

.hub-featured-list a:hover {
    color: #ecfeff;
}

.hub-faq details {
    border-top: 1px solid rgba(148, 163, 184, 0.2);
    padding: 0.85rem 0;
}

.hub-faq summary {
    cursor: pointer;
    font-weight: 700;
    color: #e2e8f0;
}

.hub-faq p {
    color: #94a3b8;
    line-height: 1.7;
    margin: 0.5rem 0 0;
}

.hub-footer-links a {
    color: #67e8f9;
    text-decoration: none;
    margin: 0 0.15rem;
}

.hub-footer-links a:hover {
    text-decoration: underline;
}

.pagination-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.15rem;
    border-radius: 1rem;
    background: rgba(11, 18, 32, 0.65);
    border: 1px solid rgba(148, 163, 184, 0.14);
}

.page-meta {
    font-size: 0.88rem;
    color: #94a3b8;
}

.page-buttons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.page-btn {
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 0.65rem;
    border-radius: 0.55rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(15, 23, 42, 0.7);
    color: #e2e8f0;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

.page-btn:hover:not(:disabled) {
    border-color: rgba(103, 232, 249, 0.35);
}

.page-btn.is-active {
    background: rgba(79, 70, 229, 0.45);
    border-color: rgba(129, 140, 248, 0.55);
    color: #fff;
}

.page-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.page-nav {
    padding: 0 0.85rem;
}

.page-ellipsis {
    padding: 0 0.25rem;
    color: #64748b;
}

@keyframes floatGlow {
    from {
        transform: translate3d(0, 0, 0) scale(1);
    }
    to {
        transform: translate3d(2rem, 3rem, 0) scale(1.12);
    }
}

@media (max-width: 1100px) {
    .tool-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .tool-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .tool-grid {
        grid-template-columns: 1fr;
    }

    .pagination-inner {
        flex-direction: column;
        align-items: stretch;
    }

    .page-buttons {
        justify-content: center;
    }
}
