
:root {
    --bg-primary: #0c0f0a;
    --bg-secondary: #141a10;
    --bg-card: #141a10;
    --bg-card-hover: #1e2618;
    --bg-input: #0c0f0a;
    --text-primary: #d4d4c8;
    --text-secondary: #b0b0a0;
    --text-muted: #8a9370;
    --accent: #8aac6a;
    --accent-glow: rgba(138, 172, 106, 0.3);
    --border: #2a3520;
    --border-light: #1e2618;
    --radius: 10px;
    --shadow: 0 2px 8px rgba(0,0,0,0.4);
    --dep-bg: #0e140a;
    --dep-border: #3a5025;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: #c8dea8; }

.header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 1.5rem 2rem;
    text-align: center;
}
.header h1 { font-size: 2rem; font-weight: 700; letter-spacing: -0.5px; margin-bottom: 0.25rem; }
.header h1 span { color: var(--accent); }
.header p { color: var(--text-secondary); font-size: 0.95rem; }
.header-stats {
    display: flex; justify-content: center; gap: 2rem;
    margin-top: 1rem; flex-wrap: wrap;
}
.stat { text-align: center; }
.stat-value { font-size: 1.5rem; font-weight: 700; color: var(--accent); }
.stat-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }

.nav {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 2rem;
    display: flex; align-items: center; gap: 1rem;
}
.nav a { color: var(--text-secondary); font-size: 0.85rem; padding: 0.25rem 0.5rem; border-radius: 4px; transition: all 0.2s; }
.nav a:hover { color: var(--text-primary); background: var(--bg-card); }
.nav .sep { color: var(--text-muted); }

.search-container {
    max-width: 600px; margin: 2rem auto; padding: 0 1.5rem; position: relative;
}
.search-input {
    width: 100%; padding: 0.85rem 1.2rem 0.85rem 3rem;
    background: var(--bg-input); border: 1px solid var(--border);
    border-radius: var(--radius); color: var(--text-primary);
    font-size: 1rem; outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.search-input::placeholder { color: var(--text-muted); }
.search-icon {
    position: absolute; left: 2.5rem; top: 50%;
    transform: translateY(-50%); color: var(--text-muted); pointer-events: none;
}
.search-results { margin-top: 1rem; display: none; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.75rem; max-height: 500px; overflow-y: auto; }
.search-results.active { display: block; }
.search-result-group { margin-bottom: 0.75rem; }
.search-result-group h3 {
    font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase;
    letter-spacing: 1px; padding: 0.5rem 0; border-bottom: 1px solid var(--border-light);
    margin-bottom: 0.25rem;
}
.search-result-item {
    padding: 0.5rem 0.75rem; border-radius: 6px; cursor: pointer;
    transition: background 0.15s; display: flex; justify-content: space-between; align-items: center;
}
.search-result-item:hover { background: var(--bg-card); }
.search-result-item .name { color: var(--text-primary); }
.search-result-item .classname { color: var(--text-muted); font-size: 0.8rem; font-family: monospace; }

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

.category-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem;
}
.category-card {
    background: rgba(20, 26, 16, 0.85); border: 1px solid #2a3520;
    border-radius: var(--radius); padding: 1.25rem;
    transition: all 0.2s; display: flex; flex-direction: column;
    align-items: center; text-align: center; text-decoration: none; color: var(--text-primary);
}
.category-card:hover {
    background: var(--bg-card-hover); border-color: var(--border);
    transform: translateY(-2px); box-shadow: var(--shadow); color: var(--text-primary);
}
.category-icon { width: 56px; height: 56px; margin-bottom: 0.75rem; }
.category-card h3 { font-size: 0.9rem; font-weight: 600; margin-bottom: 0.25rem; line-height: 1.3; }
.category-card .count { font-size: 0.75rem; color: var(--text-muted); }

.item-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 0.75rem;
}
.item-card {
    background: var(--bg-card); border: 1px solid var(--border-light);
    border-radius: var(--radius); padding: 1rem;
    transition: all 0.2s; cursor: pointer;
}
.item-card:hover { background: var(--bg-card-hover); border-color: var(--border); }
.item-card.hidden { display: none; }
.item-top {
    display: flex; align-items: center; gap: 0.75rem;
}
.item-icon { width: 48px; height: 48px; flex-shrink: 0; opacity: 0.8; }
.item-img { width: 80px; height: 52px; flex-shrink: 0; object-fit: contain; border-radius: 4px; background: rgba(255,255,255,0.03); }
.item-info { min-width: 0; flex: 1; }
.item-name { font-size: 0.9rem; font-weight: 600; color: var(--text-primary); }
.item-classname {
    font-size: 0.7rem; color: var(--text-muted);
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.item-desc {
    font-size: 0.78rem; color: var(--text-secondary); margin-top: 0.5rem;
    line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3;
    -webkit-box-orient: vertical; overflow: hidden;
}
.item-deps {
    margin-top: 0.6rem; padding-top: 0.5rem;
    border-top: 1px solid var(--dep-border);
}
.dep-row {
    display: flex; align-items: flex-start; gap: 0.4rem;
    font-size: 0.72rem; margin-bottom: 0.25rem;
}
.dep-label {
    color: var(--accent); font-weight: 600; white-space: nowrap; min-width: 55px;
    text-transform: uppercase; font-size: 0.65rem; letter-spacing: 0.5px; padding-top: 1px;
}
.dep-value { color: var(--text-secondary); line-height: 1.4; }
.dep-tag {
    display: inline-block; background: var(--dep-bg); border: 1px solid var(--dep-border);
    border-radius: 4px; padding: 0.1rem 0.35rem; margin: 0.1rem 0.15rem;
    font-size: 0.68rem; color: var(--text-secondary); white-space: nowrap;
}

.category-header {
    display: flex; align-items: center; gap: 1rem;
    margin-bottom: 1.5rem; padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-light);
}
.category-header-icon { width: 56px; height: 56px; }
.category-header h2 { font-size: 1.5rem; font-weight: 700; }
.category-header .item-count { color: var(--text-muted); font-size: 0.85rem; }

.filter-bar { margin-bottom: 1.25rem; position: relative; }
.filter-input {
    width: 100%; max-width: 400px;
    padding: 0.65rem 1rem 0.65rem 2.5rem;
    background: var(--bg-input); border: 1px solid var(--border);
    border-radius: 8px; color: var(--text-primary);
    font-size: 0.9rem; outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.filter-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.filter-input::placeholder { color: var(--text-muted); }
.filter-icon { position: absolute; left: 0.85rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.no-results { text-align: center; padding: 3rem; color: var(--text-muted); display: none; }
.no-results.active { display: block; }

.footer {
    text-align: center; padding: 2rem; color: var(--text-muted);
    font-size: 0.8rem; border-top: 1px solid var(--border-light); margin-top: 3rem;
}

/* Expanded item detail */
.item-card.expanded .item-desc { -webkit-line-clamp: unset; }

@media (max-width: 768px) {
    .header h1 { font-size: 1.4rem; }
    .category-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
    .item-grid { grid-template-columns: 1fr; }
    .container { padding: 1rem; }
}

/* Home page hero */
.hero-home { width: 100%; position: relative; overflow: hidden; }
.hero-home img { width: 100%; height: 320px; object-fit: cover; object-position: center 55%; display: block; filter: brightness(0.65); }
.hero-home-overlay {
    position: absolute; bottom: 0; left: 0; right: 0; top: 0;
    background: linear-gradient(to bottom, rgba(12,15,10,0) 30%, rgba(12,15,10,0.8) 80%, rgba(12,15,10,1) 100%);
    display: flex; flex-direction: column; justify-content: flex-end; align-items: center; padding-bottom: 2rem;
}
.hero-home-overlay h1 { color: #b8c4a0; font-size: 2.2rem; font-weight: 700; text-shadow: 0 2px 12px rgba(0,0,0,0.8); letter-spacing: 2px; text-transform: uppercase; margin-bottom: 0.3rem; }
.hero-home-overlay .subtitle { color: #8a9370; font-size: 0.95rem; text-shadow: 0 1px 6px rgba(0,0,0,0.8); margin-bottom: 1.2rem; }
.hero-stats { display: flex; gap: 3rem; }
.hero-stat { text-align: center; }
.hero-stat .val { font-size: 1.6rem; font-weight: 700; color: #8aac6a; line-height: 1; }
.hero-stat .lbl { font-size: 0.7rem; color: #8a9370; text-transform: uppercase; letter-spacing: 1.2px; margin-top: 0.2rem; }

/* ── Image-backed category cards ── */
.category-card.card-img {
    background-color: #0c0f0a;
    min-height: 180px;
    justify-content: flex-end;
    padding: 0 0.9rem 0.9rem;
    border-color: #2a3520;
    position: relative;
    overflow: hidden;
}
.category-card.card-img:hover {
    border-color: #6a8a4a;
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.6);
}
.category-card.card-img h3 {
    color: #d4dfc0;
    font-size: 0.95rem;
    text-shadow: 0 1px 4px rgba(0,0,0,0.9);
}
.category-card.card-img .count {
    color: #8aac6a;
    text-shadow: 0 1px 4px rgba(0,0,0,0.9);
}
