:root {
    --primary: #1a2530;
    --bg-light: #f4f4f5;
    --bg-dark: #0f172a;
    --surface-light: #ffffff;
    --surface-dark: #1e293b;
    --text-light-primary: #1f2937;
    --text-light-secondary: #4b5563;
    --text-dark-primary: #f3f4f6;
    --text-dark-secondary: #9ca3af;
    --border-light: #e5e7eb;
    --border-dark: #334155;
    --landing-bg: #f9f9f9;

    --bg: var(--bg-light);
    --surface: var(--surface-light);
    --text-primary: var(--text-light-primary);
    --text-secondary: var(--text-light-secondary);
    --border: var(--border-light);
    --nav-bg: rgba(255, 255, 255, 0.8);
    --shadow-color: rgba(0, 0, 0, 0.05);
}

html.dark {
    --bg: var(--bg-dark);
    --surface: var(--surface-dark);
    --text-primary: var(--text-dark-primary);
    --text-secondary: var(--text-dark-secondary);
    --border: var(--border-dark);
    --nav-bg: rgba(30, 41, 59, 0.8);
    --shadow-color: rgba(0, 0, 0, 0.2);
    --landing-bg: #0f172a;
    --primary: #e2e8f0;
}

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

html {
    overflow-x: hidden;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg);
    color: var(--text-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s, color 0.3s;
    overflow-x: hidden;
    width: 100%;
}

html,
body {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
    display: none;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

input {
    font-family: inherit;
    border: none;
    outline: none;
    background: transparent;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.hidden {
    display: none !important;
}

.page {
    display: none;
    min-height: 100vh;
    flex-direction: column;
}

.page.active {
    display: flex;
}

.navbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: background-color 0.3s, border-color 0.3s;
}

.navbar-landing {
    background: transparent;
    padding: 1.5rem 2rem;
}

.navbar-main {
    background: var(--nav-bg);
    border-bottom: 1px solid var(--border);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.nav-icon-box {
    width: 2rem;
    height: 2rem;
    background-color: var(--primary);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-icon-box .material-symbols-outlined {
    font-size: 1.125rem;
    color: var(--bg);
}

.nav-title {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    font-size: 1.25rem;
    letter-spacing: 0.02em;
    color: var(--text-primary);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.icon-btn {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: background-color 0.2s, color 0.2s;
}

.icon-btn:hover {
    background-color: var(--border);
    color: var(--text-primary);
}

.theme-icon-light {
    display: none;
}

html.dark .theme-icon-dark {
    display: none;
}

html.dark .theme-icon-light {
    display: block;
}

.nav-search-bar {
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    background: var(--surface);
    gap: 0.5rem;
    max-width: 400px;
    flex: 1;
    margin: 0 1rem;
    transition: border-color 0.3s;
}

.nav-search-bar:focus-within {
    border-color: var(--primary);
}

.search-icon-nav {
    color: var(--text-secondary);
    font-size: 1.25rem;
}

.nav-search-input {
    flex: 1;
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 0.875rem;
    color: var(--text-primary);
    background: transparent;
}

.nav-search-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.page-landing {
    background-color: var(--landing-bg);
}

.landing-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
}

.landing-content {
    text-align: center;
    max-width: 56rem;
    width: 100%;
}

.landing-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(3rem, 10vw, 7rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: 1rem;
    line-height: 1;
}

.landing-title-sub {
    font-weight: 400;
    font-style: italic;
}

.landing-subtitle {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    font-weight: 500;
}

.landing-search-wrapper {
    max-width: 32rem;
    margin: 0 auto 4rem;
    display: flex;
    align-items: stretch;
}

.landing-input-group {
    position: relative;
    flex: 1;
    display: flex;
    align-items: stretch;
}

.landing-search-icon {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    padding-left: 1rem;
    display: flex;
    align-items: center;
    pointer-events: none;
    color: var(--text-secondary);
}

.landing-search-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-right: none;
    color: var(--text-primary);
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.landing-search-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
    font-size: 0.875rem;
}

.landing-search-input:focus {
    border-color: var(--primary);
}

.landing-explore-btn {
    padding: 1rem 2rem;
    background-color: var(--primary);
    color: var(--bg);
    font-family: 'Playfair Display', serif;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    border: 1px solid var(--primary);
    border-bottom-width: 4px;
    transition: transform 0.1s, border-bottom-width 0.1s;
}

.landing-explore-btn:hover {
    opacity: 0.95;
}

.landing-explore-btn:active {
    border-bottom-width: 1px;
    transform: translateY(3px);
}

.popular-section {
    margin-bottom: 4rem;
}

.section-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.dev-cards {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}

.dev-card {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 1.25rem;
    width: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: border-color 0.3s, transform 0.2s;
}

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

.dev-avatar {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--border);
}

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

.dev-info {
    text-align: center;
    width: 100%;
    min-width: 0;
}

.dev-name {
    font-family: 'Playfair Display', serif;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.125rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dev-role {
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.features-section {
    max-width: 900px;
    margin: 0 auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.feature-card {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 1.5rem;
    text-align: left;
    transition: border-color 0.3s;
}

.feature-card:hover {
    border-color: var(--primary);
}

.feature-icon-box {
    width: 2.5rem;
    height: 2.5rem;
    background: var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.feature-icon-box .material-symbols-outlined {
    font-size: 1.25rem;
    color: var(--text-primary);
}

.feature-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.feature-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.profile-main {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    padding: 2rem 1.5rem;
}

.profile-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 1024px) {
    .profile-grid {
        grid-template-columns: 300px 1fr;
    }
}

.profile-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 100%;
    overflow: hidden;
}

.profile-card,
.stats-card,
.details-card {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 1.5rem;
    transition: border-color 0.3s;
    max-width: 100%;
    overflow: hidden;
}

.profile-card {
    text-align: center;
}

.profile-avatar-container {
    position: relative;
    display: inline-block;
    margin-bottom: 1rem;
}

.profile-avatar {
    width: 8rem;
    height: 8rem;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--border);
}

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

.online-indicator {
    position: absolute;
    bottom: 0.5rem;
    right: 0.25rem;
    width: 1.25rem;
    height: 1.25rem;
    background-color: #22c55e;
    border-radius: 50%;
    border: 3px solid var(--surface);
}

.profile-name {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

.profile-username {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--primary);
    margin-bottom: 1rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

.profile-bio {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

.profile-actions {
    display: flex;
    gap: 0.5rem;
}

.follow-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1rem;
    background-color: var(--primary);
    color: var(--bg);
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border: 1px solid var(--primary);
    border-bottom-width: 4px;
    transition: transform 0.1s, border-bottom-width 0.1s;
}

.follow-btn:hover {
    opacity: 0.95;
}

.follow-btn:active {
    border-bottom-width: 1px;
    transform: translateY(3px);
}

.follow-btn .material-symbols-outlined {
    font-size: 1rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.stat-item {
    text-align: center;
    padding: 0.5rem;
    min-width: 0;
}

.stat-item:not(:last-child) {
    border-right: 1px solid var(--border);
}

.stat-value {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.stat-label {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
}

.details-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
    min-width: 0;
    max-width: 100%;
}

.detail-item .material-symbols-outlined {
    font-size: 1.125rem;
    color: var(--primary);
    flex-shrink: 0;
}

.detail-text {
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1;
}

.detail-link {
    transition: color 0.2s;
}

.detail-link:hover {
    color: var(--primary);
}

.profile-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 100%;
    overflow: hidden;
}

.repos-header {
    margin-bottom: 1rem;
}

.repos-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.repos-title .material-symbols-outlined {
    color: var(--primary);
}

.repos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.repo-card {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 1.25rem;
    transition: border-color 0.3s;
    display: block;
    max-width: 100%;
    overflow: hidden;
}

.repo-card:hover {
    border-color: var(--primary);
}

.repo-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    gap: 0.5rem;
    min-width: 0;
    max-width: 100%;
}

.repo-title-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    flex: 1;
    max-width: 100%;
    overflow: hidden;
}

.repo-icon {
    flex-shrink: 0;
    color: var(--primary);
}

.repo-name {
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1;
}

.repo-badge {
    font-size: 0.55rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    flex-shrink: 0;
    white-space: nowrap;
}

.repo-description {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-wrap: break-word;
}

.repo-stats {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.repo-stat {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.repo-stat .material-symbols-outlined {
    font-size: 0.875rem;
}

.lang-dot {
    width: 0.625rem;
    height: 0.625rem;
}

.lang-javascript { background-color: #f1e05a; }
.lang-typescript { background-color: #3178c6; }
.lang-python { background-color: #3572A5; }
.lang-java { background-color: #b07219; }
.lang-c { background-color: #555555; }
.lang-cpp { background-color: #f34b7d; }
.lang-csharp { background-color: #178600; }
.lang-go { background-color: #00ADD8; }
.lang-rust { background-color: #dea584; }
.lang-ruby { background-color: #701516; }
.lang-php { background-color: #4F5D95; }
.lang-swift { background-color: #F05138; }
.lang-kotlin { background-color: #A97BFF; }
.lang-html { background-color: #e34c26; }
.lang-css { background-color: #563d7c; }
.lang-scss { background-color: #c6538c; }
.lang-shell { background-color: #89e051; }
.lang-vue { background-color: #41b883; }
.lang-default { background-color: #6b7280; }

.error-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    position: relative;
}

.error-bg-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0.05;
}

html.dark .error-bg-icon {
    opacity: 0.1;
}

.error-bg-icon .material-symbols-outlined {
    font-size: clamp(15rem, 40vw, 30rem);
    color: var(--text-primary);
}

.error-content {
    position: relative;
    z-index: 10;
    text-align: center;
    max-width: 32rem;
}

.error-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 6vw, 3.5rem);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.error-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.error-detail {
    font-size: 0.8rem;
    font-style: italic;
    color: var(--text-secondary);
    opacity: 0.7;
    margin-bottom: 2rem;
}

.error-actions {
    display: flex;
    justify-content: center;
}

.error-btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background-color: var(--primary);
    color: var(--bg);
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border: 1px solid var(--primary);
    border-bottom-width: 4px;
    transition: transform 0.1s, border-bottom-width 0.1s;
}

.error-btn-primary:hover {
    opacity: 0.95;
}

.error-btn-primary:active {
    border-bottom-width: 1px;
    transform: translateY(3px);
}

.error-btn-primary .material-symbols-outlined {
    font-size: 1.125rem;
}

.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-spinner {
    text-align: center;
    background: var(--surface);
    padding: 2.5rem 3rem;
    border: 1px solid var(--border);
}

.loading-icon {
    font-size: 2.5rem;
    color: var(--primary);
    animation: spin 1s linear infinite;
    display: block;
    margin-bottom: 1rem;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.loading-text {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.app-footer {
    border-top: 1px solid var(--border);
    padding: 1.5rem;
    text-align: center;
    font-size: 0.65rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    background: var(--bg);
    transition: background-color 0.3s, border-color 0.3s;
}

@media (max-width: 600px) {
    .navbar {
        padding: 1rem;
    }

    .navbar-main {
        flex-wrap: wrap;
    }

    .nav-search-bar {
        order: 3;
        max-width: none;
        flex: none;
        width: 100%;
        margin: 0.75rem 0 0;
    }

    .landing-search-wrapper {
        flex-direction: column;
    }

    .landing-search-input {
        border-right: 1px solid var(--border);
    }

    .landing-explore-btn {
        width: 100%;
    }

    .dev-card {
        width: 120px;
        padding: 1rem;
    }

    .dev-avatar {
        width: 3rem;
        height: 3rem;
    }

    .profile-main {
        padding: 1.5rem 1rem;
    }

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

    .repo-name {
        font-size: 0.9rem;
    }

    .profile-name {
        font-size: 1.25rem;
    }

    .profile-bio {
        max-height: 6em;
        overflow-y: auto;
    }

    .detail-item {
        overflow: hidden;
    }
}