/* GitHub Repo Stats */

:root {
    --rs-bg: #0d1117;
    --rs-surface: #161b22;
    --rs-surface-alt: #1c2129;
    --rs-border: #30363d;
    --rs-text: #c9d1d9;
    --rs-muted: #8b949e;
    --rs-blue: #58a6ff;
    --rs-green: #1b8329;
    --rs-red: #f85149;
    --rs-yellow: #d29922;
}

* {
    box-sizing: border-box;
}

body.rs-body {
    margin: 0;
    background: var(--rs-bg);
    color: var(--rs-text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    line-height: 1.5;
}

.rs-site {
    max-width: 880px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    color: var(--rs-blue);
}

/* ==========================
   Masthead
========================== */

.rs-masthead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 22px 0;
    border-bottom: 1px solid var(--rs-border);
}

.rs-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Courier New', monospace;
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--rs-text);
    text-decoration: none;
}

.rs-logo-icon {
    width: 22px;
    height: 22px;
    filter: invert(1);
}

.rs-logo-blink {
    color: var(--rs-green);
}

@keyframes rs-blink {
    50% { opacity: 0; }
}

.rs-back-badge {
    font-family: -apple-system, sans-serif;
    font-size: .8rem;
    color: var(--rs-muted);
    text-decoration: none;
    border: 1px solid var(--rs-border);
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--rs-surface);
}

.rs-back-badge:hover {
    color: var(--rs-blue);
    border-color: var(--rs-blue);
}

/* ==========================
   Layout
========================== */

.rs-layout {
    padding: 28px 0 40px;
}

.rs-intro p {
    color: var(--rs-muted);
}

.rs-stat-row {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin: 18px 0 24px;
}

.rs-stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--rs-surface);
    border: 1px solid var(--rs-border);
    border-radius: 999px;
    font-size: .85rem;
    color: var(--rs-muted);
}

.rs-stat-pill strong {
    color: var(--rs-text);
}

.rs-stat-pill--empty strong {
    color: var(--rs-red);
}

/* ==========================
   Lookup form
========================== */

.rs-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.rs-form input[type="text"] {
    flex: 1;
    min-width: 220px;
    padding: 12px 14px;
    background: var(--rs-surface);
    border: 1px solid var(--rs-border);
    border-radius: 6px;
    color: var(--rs-text);
    font-family: 'Courier New', monospace;
    font-size: .95rem;
}

.rs-form input[type="text"]::placeholder {
    color: var(--rs-muted);
}

.rs-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: -apple-system, sans-serif;
    font-size: .9rem;
    font-weight: 600;
    padding: 11px 20px;
    border: 1px solid var(--rs-green);
    border-radius: 6px;
    background: var(--rs-green);
    color: #0d1117;
    cursor: pointer;
    text-decoration: none;
}

.rs-btn:hover {
    filter: brightness(1.1);
}

.rs-btn:disabled {
    background: var(--rs-surface-alt);
    border-color: var(--rs-border);
    color: var(--rs-muted);
    cursor: not-allowed;
}

.rs-btn-secondary {
    background: var(--rs-surface);
    color: var(--rs-text);
    border-color: var(--rs-border);
}

.rs-btn-secondary:hover {
    border-color: var(--rs-blue);
    filter: none;
}

.rs-form-hint {
    font-size: .78rem;
    color: var(--rs-muted);
    margin: 0 0 20px;
}

/* ==========================
   Messages
========================== */

.rs-message {
    padding: 12px 14px;
    margin-bottom: 18px;
    border-left: 4px solid var(--rs-blue);
    background: var(--rs-surface);
    border-radius: 4px;
    font-size: .9rem;
}

.rs-message-error {
    border-left-color: var(--rs-red);
}

.rs-message-success {
    border-left-color: var(--rs-green);
}

/* ==========================
   Profile card / stats
========================== */

.rs-profile-card {
    display: flex;
    gap: 20px;
    padding: 24px;
    background: var(--rs-surface);
    border: 1px solid var(--rs-border);
    border-radius: 8px;
    margin-bottom: 24px;
}

.rs-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 1px solid var(--rs-border);
    flex-shrink: 0;
}

.rs-profile-name {
    margin: 0 0 2px;
    font-size: 1.3rem;
}

.rs-profile-username {
    color: var(--rs-muted);
    font-family: 'Courier New', monospace;
    margin: 0 0 10px;
}

.rs-profile-bio {
    margin: 0 0 10px;
    color: var(--rs-text);
}

.rs-profile-updated {
    font-size: .78rem;
    color: var(--rs-muted);
}

.rs-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 14px;
    margin-bottom: 28px;
}

.rs-metric-card {
    padding: 16px;
    background: var(--rs-surface);
    border: 1px solid var(--rs-border);
    border-radius: 8px;
    text-align: center;
}

.rs-metric-value {
    display: block;
    font-size: 1.6rem;
    font-weight: bold;
    color: var(--rs-text);
}

.rs-metric-label {
    font-size: .78rem;
    color: var(--rs-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* ==========================
   Language chart
========================== */

.rs-lang-section h3 {
    margin-bottom: 4px;
}

.rs-lang-note {
    font-size: .8rem;
    color: var(--rs-muted);
    margin: 0 0 16px;
}

.rs-lang-bar {
    display: flex;
    height: 10px;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 18px;
    background: var(--rs-surface-alt);
}

.rs-lang-segment {
    height: 100%;
}

.rs-lang-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
}

.rs-lang-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .85rem;
}

.rs-lang-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.rs-lang-pct {
    color: var(--rs-muted);
    margin-left: auto;
    font-family: 'Courier New', monospace;
}

.rs-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 28px;
}

/* ==========================
   Footer
========================== */

.rs-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 18px 0 30px;
    border-top: 1px solid var(--rs-border);
    font-size: .78rem;
    color: var(--rs-muted);
}

.rs-hit-counter {
    display: flex;
    align-items: center;
    gap: 6px;
}

.rs-hit-icon {
    width: 14px;
    height: 14px;
    opacity: .6;
    filter: invert(1);
}

.rs-footer-copy a {
    color: var(--rs-muted);
    text-decoration: underline;
}

.hp-field {
    position: absolute;
    left: -9999px;
    top: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.external-link-icon,
.btn-icon {
    width: 14px;
    height: 14px;
    vertical-align: middle;
    filter: invert(1);
    opacity: .7;
}

@media (max-width: 640px) {
    .rs-masthead {
        flex-direction: column;
        align-items: flex-start;
    }

    .rs-profile-card {
        flex-direction: column;
        text-align: center;
    }

    .rs-profile-card .rs-avatar {
        margin: 0 auto;
    }
}