:root {
    --bg: #0d1117;
    --surface: #161b22;
    --text-primary: #c9d1d9;
    --text-secondary: #8b949e;
    --text-tertiary: #6e7681;
    --link: #58a6ff;
    --link-hover: #79c0ff;
    --border: #30363d;
    --border-subtle: #21262d;
    --header-bg: #010409;

    /* Language colors */
    --html: #e44c27;
    --css: #663398;
    --javascript: #f1e15a;
    --kotlin: #a97bff;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text-primary);
    line-height: 1.5;
}

.profile-container {
    max-width: 1280px;
    margin: 60px auto 40px;
    padding: 0 32px;
    display: flex;
    gap: 64px;
}

/* Sidebar */
.profile-sidebar {
    width: 260px;
    flex-shrink: 0;
}

.avatar {
    width: 230px;
    height: 230px;
    border-radius: 50%;
    border: 1px solid var(--border);
    overflow: hidden;
    margin: 0 auto;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.name {
    font-size: 26px;
    font-weight: 600;
    text-align: center;
    margin: 20px 0 4px;
    color: var(--text-primary);
}

.location {
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 16px;
}

.bio {
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
    margin: 0 0 20px;
    padding: 0 12px;
}

.bio p {
    margin-bottom: 12px;
}

.stats {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin: 24px 0;
    font-size: 14px;
}

.stats a {
    color: var(--text-primary);
    text-decoration: none;
}

.stats a:hover {
    text-decoration: underline;
}

.stats span {
    font-weight: 600;
}

/* Main content */
.profile-main {
    flex: 1;
    min-width: 0;
}

.pinned-header {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 24px;
    padding-bottom: 12px;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}

.pinned-header a {
    text-decoration: none;
    color: inherit;
}

.pinned-header a:hover {
    text-decoration: underline;
}

.repos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
    align-items: start;
}

.repo-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
    background: var(--surface);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.repo-card:hover {
    border-color: var(--link);
    box-shadow: 0 0 0 1px var(--link);
}

.repo-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--link);
    margin-bottom: 8px;
}

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

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

.repo-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-clamp: 3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
}

.repo-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 13px;
    color: var(--text-secondary);
}

.lang-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.lang-dot.html { background: var(--html); }
.lang-dot.css { background: var(--css); }
.lang-dot.javascript { background: var(--javascript); }
.lang-dot.kotlin { background: var(--kotlin); }

.repo-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Contact */
.contact-row {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin: 20px 0 24px;
    flex-wrap: wrap;
}

.contact-link {
    color: var(--link);
    text-decoration: none;
    font-size: 14px;
}

.contact-link:hover {
    color: var(--link-hover);
    text-decoration: none;
}

/* Footer */
footer {
    text-align: center;
    padding: 60px 20px 40px;
    color: var(--text-tertiary);
    font-size: 13px;
    border-top: 1px solid var(--border);
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.no-js-icon {
    width: 100px;
    height: 100px;
}

.no-js-icon:hover {
    opacity: 1.0;
    transition: opacity 0.2s;
}

/* Repositories list */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.category-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.category-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-subtle);
}

/* Responsive rules */
@media (max-width: 900px) {
    .profile-container {
        flex-direction: column;
        gap: 48px;
        padding: 0 20px;
        margin: 40px auto 60px;
    }

    .profile-sidebar {
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
    }

    .avatar {
        width: 180px;
        height: 180px;
    }

    .pinned-header {
        justify-content: center;
    }

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

    .repo-card {
        max-width: 100%;
    }

    .repo-desc {
        -webkit-line-clamp: 4;
        line-clamp: 4;
    }

    .categories-grid {
        grid-template-columns: 1fr;
        gap: 48px;
    }

    .category-column {
        width: 100%;
    }

    .profile-sidebar {
        max-width: 400px;
        margin: 0 auto;
    }

    .avatar {
        width: 180px;
        height: 180px;
    }
}