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

:root {
    --bg: #050a12;
    --surface: #0d1520;
    --surface-hover: #141f2e;
    --border: #1a2535;
    --border-hover: #2a3a50;
    --text: #e8ecf2;
    --text-secondary: #7a8a9e;
    --accent: #2245b6;
    --accent-soft: rgba(34, 69, 182, 0.15);
    --mint: #23dbb0;
    --mint-soft: rgba(35, 219, 176, 0.12);
    --purple: #6624fa;
    --radius: 12px;
    --radius-sm: 6px;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', system-ui, sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.page {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 24px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Header ── */

.header {
    padding: 64px 0 32px;
}

.logo {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text);
}

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

.subtitle {
    margin-top: 8px;
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* ── Tabs ── */

.tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 40px;
    width: fit-content;
}

.tab {
    padding: 8px 20px;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.tab:hover {
    color: var(--text);
}

.tab--active {
    background: var(--accent);
    color: #fff;
}

/* ── Tab panels ── */

.tab-panel {
    display: none;
}

.tab-panel--active {
    display: flex;
    flex-direction: column;
    gap: 48px;
}

/* ── Catalog ── */

.catalog {
    flex: 1;
    padding-bottom: 64px;
}

.category-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    margin-bottom: 16px;
    padding-left: 4px;
}

.category-hint {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: -8px 0 20px 4px;
    line-height: 1.5;
}

.grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

/* ── Cards ── */

.card {
    display: flex;
    gap: 16px;
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

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

.card--plugin {
    cursor: default;
}

.card-icon {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--accent-soft);
    border-radius: var(--radius-sm);
}

.card--plugin .card-icon {
    background: var(--mint-soft);
}

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

.card-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.card-body h3 {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.card-body p {
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

/* ── Version badge ── */

.version {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 1px 7px;
    background: var(--mint-soft);
    color: var(--mint);
    border-radius: 100px;
    white-space: nowrap;
}

/* ── Tags ── */

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    font-size: 0.65rem;
    font-weight: 500;
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 100px;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* ── Card wrap (for beta links) ── */

.card-wrap {
    position: relative;
}
.card-wrap .card-beta {
    position: absolute;
    bottom: 12px;
    right: 12px;
}

/* ── Beta link ── */

.card-beta {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 500;
    padding: 3px 10px;
    background: rgba(255, 180, 0, 0.12);
    border: 1px solid rgba(255, 180, 0, 0.3);
    border-radius: 100px;
    color: #ffb400;
    text-decoration: none;
    transition: all 0.15s;
    z-index: 2;
}
.card-beta:hover {
    background: rgba(255, 180, 0, 0.22);
    border-color: rgba(255, 180, 0, 0.5);
}

/* ── Plugin download buttons ── */

.card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: inherit;
    color: #fff;
    background: var(--accent);
    border: 1px solid var(--accent);
    border-radius: var(--radius-sm);
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn:hover {
    opacity: 0.85;
}

.btn--ghost {
    background: transparent;
    border-color: var(--border);
    color: var(--text-secondary);
}

.btn--ghost:hover {
    border-color: var(--border-hover);
    color: var(--text);
    opacity: 1;
}

/* ── Footer ── */

.footer {
    padding: 32px 0;
    border-top: 1px solid var(--border);
}

.footer p {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* ── Sub-page helpers ── */

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    margin-bottom: 24px;
    text-decoration: none;
    color: var(--text-secondary);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    transition: background 0.2s, border-color 0.2s;
}

.back-button:hover {
    background: var(--surface-hover);
    border-color: var(--border-hover);
    color: var(--text);
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 48px 24px;
}

.container h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.container h2 {
    font-size: 1.1rem;
    font-weight: 500;
    margin-top: 16px;
}

.container h2 a {
    color: var(--mint);
    text-decoration: none;
    transition: opacity 0.2s;
}

.container h2 a:hover {
    opacity: 0.8;
}

/* ── Responsive ── */

@media (max-width: 640px) {
    .header {
        padding: 40px 0 24px;
    }

    .logo {
        font-size: 1.5rem;
    }

    .tabs {
        width: 100%;
    }

    .tab {
        flex: 1;
        text-align: center;
    }

    .tab-panel--active {
        gap: 36px;
    }

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

    .card {
        padding: 16px;
    }
}
