:root {
    color-scheme: light;
    --bg: #f7f8fb;
    --surface: #ffffff;
    --surface-2: #eef2f7;
    --text: #151922;
    --muted: #647084;
    --line: #dbe1ea;
    --brand: #1f7a5c;
    --brand-strong: #155c46;
    --accent: #c43b57;
    --gold: #b88a2f;
    --shadow: 0 18px 48px rgba(21, 25, 34, 0.10);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

.topbar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 72px;
    padding: 12px clamp(16px, 4vw, 48px);
    border-bottom: 1px solid rgba(219, 225, 234, 0.9);
    background: rgba(247, 248, 251, 0.92);
    backdrop-filter: blur(16px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.brand-mark,
.avatar {
    display: inline-grid;
    flex: 0 0 auto;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
}

.brand-mark {
    background: var(--text);
    color: white;
    font-weight: 800;
}

.brand strong,
.brand small {
    display: block;
    line-height: 1.1;
}

.brand small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.76rem;
}

.language-form {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 0.9rem;
}

select {
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    padding: 0 34px 0 12px;
    font: inherit;
}

.shell {
    display: grid;
    grid-template-columns: minmax(260px, 360px) minmax(0, 640px);
    gap: clamp(24px, 5vw, 64px);
    align-items: start;
    max-width: 1120px;
    margin: 0 auto;
    padding: 32px 20px 56px;
}

.rail {
    position: sticky;
    top: 104px;
}

.panel {
    padding: 4px 0 24px;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--brand);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1 {
    margin: 0;
    max-width: 12ch;
    font-size: clamp(2.25rem, 5vw, 4.9rem);
    line-height: 0.95;
}

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

.tab {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    padding: 0 12px;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
}

.tab.is-active {
    border-color: var(--brand);
    background: var(--brand);
    color: white;
}

.feed {
    display: grid;
    gap: 22px;
}

.feed-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: 0.88rem;
}

.repo-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.repo-header,
.actions,
.stats {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
}

.repo-header {
    border-bottom: 1px solid var(--line);
}

.avatar {
    object-fit: cover;
    background: var(--surface-2);
    color: var(--brand-strong);
    font-weight: 800;
}

.repo-title {
    min-width: 0;
}

.repo-title a,
.repo-name {
    font-weight: 850;
}

.repo-title a {
    display: block;
    overflow-wrap: anywhere;
}

.repo-title span {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.86rem;
}

.repo-preview {
    min-height: 250px;
    display: grid;
    align-items: end;
    padding: clamp(18px, 5vw, 34px);
    background:
        linear-gradient(135deg, rgba(31, 122, 92, 0.12), rgba(196, 59, 87, 0.10)),
        radial-gradient(circle at 80% 12%, rgba(184, 138, 47, 0.22), transparent 34%),
        var(--surface-2);
}

.repo-name {
    margin: 0 0 8px;
    font-size: clamp(1.7rem, 4vw, 3rem);
    overflow-wrap: anywhere;
}

.repo-description {
    max-width: 34rem;
    margin: 0;
    color: #3c4656;
    font-size: 1rem;
    line-height: 1.55;
}

.actions {
    border-top: 1px solid var(--line);
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    padding: 0 12px;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 800;
    cursor: pointer;
}

.icon-button:hover {
    border-color: var(--brand);
    color: var(--brand-strong);
}

.save-button.is-saved {
    border-color: rgba(196, 59, 87, 0.35);
    background: rgba(196, 59, 87, 0.08);
    color: var(--accent);
}

.stats {
    flex-wrap: wrap;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.93rem;
}

.stats strong {
    color: var(--text);
}

@media (max-width: 860px) {
    .shell {
        grid-template-columns: 1fr;
    }

    .rail {
        position: static;
    }

    h1 {
        max-width: 13ch;
    }
}

@media (max-width: 560px) {
    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .language-form,
    .language-form select {
        width: 100%;
    }

    .feed-meta {
        flex-direction: column;
    }

    .repo-preview {
        min-height: 210px;
    }
}
