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

:root {
    --bg: #0f1117;
    --surface: #1a1d27;
    --surface-hover: #222639;
    --border: #2a2e3a;
    --text: #e4e6f0;
    --text-muted: #8b8fa3;
    --accent: #6c63ff;
    --accent-glow: rgba(108, 99, 255, 0.25);
    --private: #f87171;
    --public: #34d399;
    --radius: 12px;
    --radius-sm: 8px;
}

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

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
}

/* Header */
.site-header {
    text-align: center;
    padding: 60px 0 40px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 48px;
}

.site-title {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent), #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.site-subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-top: 8px;
}

/* Grid */
.repos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
    padding-bottom: 60px;
}

/* Card */
.repo-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.repo-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px var(--accent-glow);
    border-color: var(--accent);
}

/* Banner */
.repo-banner {
    position: relative;
    height: 120px;
    background: linear-gradient(135deg, #1e1b4b, #312e81, #4338ca);
    overflow: hidden;
}

.repo-card:nth-child(4n+2) .repo-banner {
    background: linear-gradient(135deg, #1c1917, #292524, #44403c);
}

.repo-card:nth-child(4n+3) .repo-banner {
    background: linear-gradient(135deg, #0f172a, #1e293b, #334155);
}

.repo-card:nth-child(4n+4) .repo-banner {
    background: linear-gradient(135deg, #18181b, #27272a, #3f3f46);
}

.banner-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 16px 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent);
}

.repo-name {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
}

.repo-name a {
    color: #fff;
    text-decoration: none;
}

.repo-name a:hover {
    text-decoration: underline;
}

/* Badge */
.badge {
    align-self: flex-start;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 3px 10px;
    border-radius: 999px;
    margin-bottom: 8px;
}

.badge-public {
    background: var(--public);
    color: #000;
}

.badge-private {
    background: var(--private);
    color: #fff;
}

/* Body */
.repo-body {
    padding: 20px;
}

.repo-description {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 16px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Meta */
.repo-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.meta-item.language {
    position: relative;
    padding-left: 14px;
}

.meta-item.language::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
}

/* Footer link */
.repo-footer {
    border-top: 1px solid var(--border);
    padding-top: 14px;
}

.repo-link {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: color 0.2s;
}

.repo-link:hover {
    color: #a78bfa;
}

.repo-link-disabled {
    color: var(--text-muted);
    cursor: default;
}

/* Empty state */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.empty-state h2 {
    margin-bottom: 8px;
}

/* Footer */
.site-footer {
    text-align: center;
    padding: 32px 0;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: auto;
}

/* Responsive */
@media (max-width: 640px) {
    .repos-grid {
        grid-template-columns: 1fr;
    }
    .site-title {
        font-size: 2rem;
    }
}
