:root {
    --bg-dark: #0a0a0b;
    --bg-card: rgba(17, 17, 19, 0.7);
    --accent: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.3);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(59, 130, 246, 0.4);
    --glass: rgba(255, 255, 255, 0.03);
    --danger: #ef4444;
    --warning: #f59e0b;
    --success: #10b981;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    margin-bottom: 3rem;
    text-align: center;
}

h1 {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Filter Bar */
.sticky-nav {
    position: sticky;
    top: 1rem;
    z-index: 100;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.75rem;
    margin-bottom: 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

#filter-bar {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
}

#filter-bar::-webkit-scrollbar {
    height: 4px;
}

.filter-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    font-weight: 500;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    background: var(--glass);
    color: var(--text-primary);
}

.filter-btn.active {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 0 15px var(--accent-glow);
}

.search-wrapper {
    position: relative;
    min-width: 300px;
}

#search-input {
    width: 100%;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    color: #fff;
    font-size: 0.9rem;
}

#search-input:focus {
    outline: none;
    border-color: var(--accent);
}

/* Grid */
#directory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
}

/* Tool Card */
.tool-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.tool-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-hover);
    box-shadow: 0 12px 24px rgba(0,0,0,0.4);
}

.tool-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.tool-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}

.priority-badge {
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 800;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    background: var(--glass);
    border: 1px solid var(--border);
}

.priority-core { background: rgba(16, 185, 129, 0.1); color: #10b981; border-color: rgba(16, 185, 129, 0.2); }
.priority-supporting { background: rgba(59, 130, 246, 0.1); color: #3b82f6; border-color: rgba(59, 130, 246, 0.2); }

.stack-role {
    font-size: 0.9rem;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.layer-tag {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: rgba(0,0,0,0.2);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    display: inline-block;
}

.not-ideal-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--danger);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.not-ideal-list {
    list-style: none;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.not-ideal-list li {
    margin-bottom: 0.4rem;
    position: relative;
    padding-left: 1rem;
}

.not-ideal-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--danger);
}

.tool-footer {
    margin-top: auto;
    padding-top: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.visit-link {
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.visit-link:hover {
    color: var(--accent);
}

.stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    justify-content: center;
}

.stat-item {
    background: var(--glass);
    border: 1px solid var(--border);
    padding: 1rem 2rem;
    border-radius: 12px;
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

@media (max-width: 768px) {
    .sticky-nav {
        flex-direction: column;
        align-items: stretch;
    }
    .search-wrapper {
        min-width: 100%;
    }
}
