:root {
    --bg: #0f1117;
    --surface: #1a1d27;
    --card: #1e2235;
    --border: #2a2f45;
    --accent: #6c63ff;
    --gold: #f5a623;
    --green: #2ecc71;
    --red: #e74c3c;
    --text: #e2e8f0;
    --muted: #8892a4;
    --radius: 12px;
}

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

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Segoe UI', system-ui, sans-serif;
    line-height: 1.6;
}

/* ── NAV ── */
nav {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--accent);
}

.logo span {
    color: var(--text);
}

.logo-sub {
    color: var(--muted);
    font-weight: 400;
    font-size: 0.95rem;
}

.nav-links a {
    color: var(--muted);
    text-decoration: none;
    margin-left: 1.5rem;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--text);
}

/* ── ADS ── */
.ad-banner {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 2rem;
    text-align: center;
    min-height: 90px;
}

.ad-mid {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
    min-height: 250px;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

/* ── HERO ── */
.hero-wrap {
    background: linear-gradient(160deg, #1a1d27 0%, #0f1117 100%);
    border-bottom: 1px solid var(--border);
}

.hero {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.hero-label {
    font-size: 0.75rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.75rem;
}

.hero h1 {
    font-size: 2.4rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    line-height: 1.2;
}

.hero h1 a {
    color: var(--text);
    text-decoration: none;
    transition: color 0.2s;
}

.hero h1 a:hover {
    color: var(--accent);
}

.hero-meta {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.badge {
    background: var(--accent);
    color: #fff;
    padding: 0.2rem 0.75rem;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-lang {
    background: #2d3561;
}

.badge-muted {
    background: var(--border);
    color: var(--muted);
}

.hero-desc {
    color: var(--muted);
    font-size: 1.05rem;
    max-width: 700px;
    margin-bottom: 2rem;
}

.hero-stats {
    display: flex;
    gap: 2.5rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat-val {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--gold);
}

.stat-lbl {
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 0.1rem;
}

.trend-up {
    color: var(--green) !important;
}

.trend-down {
    color: var(--red) !important;
}

.curator-box {
    background: rgba(108, 99, 255, 0.08);
    border-left: 3px solid var(--accent);
    padding: 1rem 1.25rem;
    border-radius: 0 var(--radius) var(--radius) 0;
    max-width: 700px;
    margin-bottom: 1rem;
}

.curator-label {
    font-size: 0.7rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.4rem;
}

.curator-box p {
    color: var(--muted);
    font-style: italic;
    font-size: 0.95rem;
}

.use-case-box {
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 1rem;
}

.use-case-label {
    color: var(--text);
    font-weight: 600;
    margin-right: 0.4rem;
}

.hero-topics {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.topic-tag {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--muted);
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
}

/* ── CHARTS ── */
.hero-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-top: 1rem;
}

.chart-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.chart-title {
    font-size: 0.8rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

/* ── FILTERS ── */
.filters-wrap {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 57px;
    z-index: 90;
}

.filters {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.filters input,
.filters select {
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.filters input {
    flex: 1;
    min-width: 200px;
}

.filters input:focus,
.filters select:focus {
    border-color: var(--accent);
}

/* ── SECTION ── */
.section {
    max-width: 1200px;
    margin: 2.5rem auto;
    padding: 0 2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.75rem;
}

.section-title {
    font-size: 0.8rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.section-count {
    font-size: 0.8rem;
    color: var(--muted);
}

/* ── GRID ── */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.25rem;
}

/* ── CARD ── */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.2s;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.card.featured {
    border-color: var(--gold);
}

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.card-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text);
}

.card-name a {
    color: inherit;
    text-decoration: none;
}

.card-date {
    font-size: 0.72rem;
    color: var(--muted);
}

.card-desc {
    font-size: 0.85rem;
    color: var(--muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-note {
    font-size: 0.8rem;
    color: var(--accent);
    font-style: italic;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.82rem;
    color: var(--muted);
    flex-wrap: wrap;
}

.card-stat-val {
    color: var(--text);
    font-weight: 600;
}

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

.card-category {
    font-size: 0.72rem;
    color: var(--accent);
    background: rgba(108, 99, 255, 0.12);
    padding: 0.15rem 0.6rem;
    border-radius: 99px;
}

.card-trending {
    font-size: 0.72rem;
    color: var(--green);
    background: rgba(46, 204, 113, 0.1);
    padding: 0.15rem 0.6rem;
    border-radius: 99px;
}

.card-trending.down {
    color: var(--red);
    background: rgba(231, 76, 60, 0.1);
}

/* ── CHANGELOG ── */
.changelog-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
}

.changelog-date {
    color: var(--muted);
    min-width: 100px;
    font-size: 0.8rem;
}

.changelog-type {
    padding: 0.1rem 0.5rem;
    border-radius: 99px;
    font-size: 0.7rem;
    font-weight: 600;
    min-width: 80px;
    text-align: center;
}

.type-published {
    background: rgba(108, 99, 255, 0.2);
    color: var(--accent);
}

.type-milestone {
    background: rgba(245, 166, 35, 0.2);
    color: var(--gold);
}

.type-added {
    background: rgba(46, 204, 113, 0.2);
    color: var(--green);
}

/* ── MODAL ── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 200;
    overflow-y: auto;
    padding: 2rem;
}

.modal-overlay.active {
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    max-width: 780px;
    width: 100%;
    position: relative;
    margin: auto;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--muted);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--text);
    border-color: var(--accent);
}

/* ── FOOTER ── */
footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 2rem;
    margin-top: 4rem;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    gap: 2rem;
    align-items: center;
    flex-wrap: wrap;
}

.footer-logo {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--accent);
}

.footer-logo span {
    color: var(--text);
}

.footer-text {
    font-size: 0.85rem;
    color: var(--muted);
}

.footer-text a {
    color: var(--accent);
    text-decoration: none;
}

/* ── EMPTY STATE ── */
.empty {
    text-align: center;
    padding: 3rem;
    color: var(--muted);
    font-size: 0.9rem;
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 1.6rem;
    }

    .hero-stats {
        gap: 1.5rem;
    }

    .hero-charts {
        grid-template-columns: 1fr;
    }

    .grid {
        grid-template-columns: 1fr;
    }

    .filters {
        flex-direction: column;
    }

    nav {
        padding: 1rem;
    }

    .nav-links a {
        margin-left: 1rem;
    }
}