/* ═══════════════════════════════════════════════
   PROJECTS — Compact repo-list layout
   Uses gallery design tokens (Inter, JetBrains Mono, HSL palette)
   ═══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --bg-page: hsl(40, 30%, 97%);
    --bg-white: hsl(0, 0%, 100%);
    --bg-warm: hsl(35, 40%, 95%);
    --bg-soft: hsl(30, 20%, 93%);
    --border: hsl(30, 15%, 88%);
    --border-hover: hsl(30, 20%, 78%);
    --text-0: hsl(220, 20%, 16%);
    --text-1: hsl(220, 10%, 38%);
    --text-2: hsl(220, 8%, 55%);
    --text-3: hsl(220, 6%, 68%);
    --accent: hsl(100, 40%, 38%);
    --accent-light: hsl(100, 45%, 45%);
    --accent-bg: hsl(100, 40%, 95%);
    --accent-border: hsl(100, 35%, 82%);
    --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --mono: 'JetBrains Mono', 'Fira Code', monospace;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-pill: 100px;
    --transition: 200ms ease;
    --shadow-sm: 0 1px 3px hsla(220, 20%, 16%, 0.05);
    --shadow-md: 0 4px 16px hsla(220, 20%, 16%, 0.07);
    --shadow-lg: 0 8px 32px hsla(220, 20%, 16%, 0.1);
}

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

html {
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    scroll-behavior: smooth;
}

body {
    font-family: var(--sans);
    background: var(--bg-page);
    color: var(--text-0);
    min-height: 100vh;
    overflow-x: hidden;
}

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

/* ─── Main Container ─── */
.proj-main {
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    padding: 40px 32px 60px;
}

/* ─── Intro ─── */
.proj-intro {
    text-align: center;
    margin-bottom: 32px;
}

.section-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    margin-bottom: 8px;
}

.section-title {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 10px;
    color: var(--text-0);
}

.section-subtitle {
    font-size: 0.95rem;
    color: var(--text-2);
    max-width: 480px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ─── Category Filter ─── */
.proj-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 36px;
}

.filter-chip {
    padding: 7px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    background: var(--bg-white);
    font-family: var(--sans);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-1);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.filter-chip:hover {
    background: var(--accent-bg);
    border-color: var(--accent-border);
    color: var(--accent);
}

.filter-chip.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    font-weight: 600;
}

/* ─── Category Group ─── */
.category-group {
    margin-bottom: 32px;
}

.category-group.hidden {
    display: none;
}

.category-heading {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-2);
    padding-left: 14px;
    border-left: 3px solid var(--accent);
    margin-bottom: 12px;
}

/* ─── Repo List ─── */
.repo-list {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-white);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.repo-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    cursor: pointer;
    transition: background var(--transition);
    border-bottom: 1px solid var(--border);
}

.repo-row:last-child {
    border-bottom: none;
}

.repo-row:hover {
    background: var(--bg-warm);
}

/* ─── Repo Icon ─── */
.repo-icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-soft);
    border: 1px solid var(--border);
}

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

/* ─── Repo Info ─── */
.repo-info {
    flex: 1;
    min-width: 0;
}

.repo-name-line {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.repo-name {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--accent);
    white-space: nowrap;
}

.repo-tagline {
    font-size: 0.8rem;
    color: var(--text-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

/* ─── Language Dots ─── */
.lang-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.lang-dot.python {
    background: hsl(210, 60%, 50%);
}

.lang-dot.typescript {
    background: hsl(225, 60%, 48%);
}

.lang-dot.javascript {
    background: hsl(48, 85%, 50%);
}

.lang-dot.markdown {
    background: hsl(30, 30%, 55%);
}

.lang-label {
    font-size: 0.7rem;
    color: var(--text-3);
    font-weight: 500;
    margin-right: 8px;
}

/* ─── Tags ─── */
.repo-tags {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.tag {
    font-size: 0.62rem;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    background: var(--bg-soft);
    color: var(--text-2);
    border: 1px solid var(--border);
    white-space: nowrap;
}

/* ─── New Badge ─── */
.badge-new {
    display: inline-flex;
    align-items: center;
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    background: hsl(150, 60%, 42%);
    color: #fff;
    white-space: nowrap;
    animation: badge-pulse 2s ease-in-out infinite;
    box-shadow: 0 0 6px hsla(150, 60%, 42%, 0.35);
}

@keyframes badge-pulse {

    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 6px hsla(150, 60%, 42%, 0.35);
    }

    50% {
        opacity: 0.85;
        box-shadow: 0 0 12px hsla(150, 60%, 42%, 0.5);
    }
}

/* ─── Updated Badge ─── */
.badge-updated {
    display: inline-flex;
    align-items: center;
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    background: hsl(36, 85%, 50%);
    color: #fff;
    white-space: nowrap;
    animation: badge-updated-pulse 2s ease-in-out infinite;
    box-shadow: 0 0 6px hsla(36, 85%, 50%, 0.35);
}

@keyframes badge-updated-pulse {

    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 6px hsla(36, 85%, 50%, 0.35);
    }

    50% {
        opacity: 0.85;
        box-shadow: 0 0 12px hsla(36, 85%, 50%, 0.5);
    }
}

/* ─── What's New Callout ─── */
.whats-new-callout {
    background: hsla(36, 85%, 50%, 0.08);
    border: 1px solid hsla(36, 85%, 50%, 0.3);
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 20px;
}

.whats-new-header {
    font-size: 0.85rem;
    font-weight: 700;
    color: hsl(36, 85%, 55%);
    margin-bottom: 8px;
}

.whats-new-date {
    font-weight: 400;
    opacity: 0.7;
    margin-left: 6px;
    font-size: 0.78rem;
}

.whats-new-list {
    margin: 0;
    padding-left: 18px;
    list-style: disc;
}

.whats-new-list li {
    font-size: 0.82rem;
    color: var(--text-1, #ccc);
    line-height: 1.5;
    margin-bottom: 2px;
}

/* ─── Repo Actions ─── */
.repo-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.dl-count {
    font-size: 0.7rem;
    color: var(--text-3);
    font-weight: 500;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-3);
}

.status-dot.active {
    background: hsl(120, 50%, 50%);
    box-shadow: 0 0 4px hsla(120, 50%, 50%, 0.4);
}

.btn-bp {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 6px;
    background: var(--accent-bg);
    border: 1px solid var(--accent-border);
    color: var(--accent);
    transition: all var(--transition);
    white-space: nowrap;
}

.btn-bp:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.btn-scaffold {
    background: hsl(245, 58%, 56%) !important;
    border-color: hsl(245, 58%, 56%) !important;
    color: white !important;
}

.btn-scaffold:hover {
    background: hsl(245, 58%, 48%) !important;
    border-color: hsl(245, 58%, 48%) !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px hsla(245, 58%, 56%, 0.3);
}

/* ─── Community Banner ─── */
.community-banner {
    margin-top: 12px;
}

.community-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: var(--accent-bg);
    border: 1px solid var(--accent-border);
    border-radius: var(--radius-lg);
}

.community-text {
    display: flex;
    align-items: center;
    gap: 14px;
}

.community-icon {
    font-size: 24px;
}

.community-text h3 {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-0);
    margin-bottom: 2px;
}

.community-text p {
    font-size: 0.75rem;
    color: var(--text-2);
}

.community-link {
    display: inline-flex;
    align-items: center;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 9px 20px;
    border-radius: var(--radius);
    background: var(--text-0);
    color: #fff;
    transition: all var(--transition);
    white-space: nowrap;
}

.community-link:hover {
    background: hsl(220, 20%, 10%);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* ═══════════════════════════════════════════════
   MODAL — Detail view on row click
   ═══════════════════════════════════════════════ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: hsla(220, 20%, 10%, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.modal-overlay.open {
    opacity: 1;
}

.modal-content {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    max-width: 640px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 28px;
    position: relative;
    box-shadow: var(--shadow-lg);
    transform: translateY(16px);
    transition: transform 0.25s ease;
}

.modal-overlay.open .modal-content {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 30px;
    height: 30px;
    border: 1px solid var(--border);
    background: var(--bg-page);
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-2);
    transition: all var(--transition);
}

.modal-close:hover {
    background: var(--bg-soft);
    color: var(--text-0);
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-right: 36px;
}

.modal-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-soft);
    border: 1px solid var(--border);
}

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

.modal-header h2 {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-0);
    margin: 0;
    line-height: 1.25;
}

.modal-tagline {
    font-size: 0.78rem;
    color: var(--text-2);
    display: block;
    margin-top: 2px;
}

.modal-lang {
    margin-left: auto;
    flex-shrink: 0;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 6px;
    letter-spacing: 0.04em;
}

.modal-lang.python {
    background: hsl(210, 50%, 94%);
    color: hsl(210, 60%, 40%);
}

.modal-lang.typescript {
    background: hsl(225, 50%, 94%);
    color: hsl(225, 60%, 40%);
}

.modal-lang.javascript {
    background: hsl(48, 70%, 92%);
    color: hsl(38, 60%, 35%);
}

.modal-lang.markdown {
    background: hsl(30, 25%, 92%);
    color: hsl(30, 30%, 40%);
}

.modal-desc {
    font-size: 0.88rem;
    line-height: 1.65;
    color: var(--text-1);
    margin-bottom: 20px;
}

.modal-section {
    margin-bottom: 20px;
}

.modal-section h3 {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    margin-bottom: 10px;
}

.modal-features,
.modal-reqs {
    list-style: none;
    padding: 0;
}

.modal-features li,
.modal-reqs li {
    font-size: 0.82rem;
    line-height: 1.55;
    color: var(--text-1);
    padding: 5px 0 5px 18px;
    position: relative;
    border-bottom: 1px solid var(--bg-soft);
}

.modal-features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: 700;
    font-size: 0.72rem;
}

.modal-reqs li::before {
    content: '•';
    position: absolute;
    left: 4px;
    color: var(--text-3);
}

.modal-code {
    background: hsl(225, 18%, 12%);
    color: hsl(100, 30%, 75%);
    padding: 16px;
    border-radius: 8px;
    font-family: var(--mono);
    font-size: 0.76rem;
    line-height: 1.7;
    overflow-x: auto;
    white-space: pre;
}

.modal-actions {
    padding-top: 16px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: center;
    gap: 10px;
}

.btn-download-lg {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 10px 24px;
    border-radius: var(--radius);
    background: var(--accent);
    color: #fff;
    transition: all var(--transition);
}

.btn-download-lg:hover {
    background: var(--accent-light);
    box-shadow: 0 4px 16px hsla(100, 40%, 38%, 0.25);
    transform: translateY(-1px);
}

.btn-share {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: var(--radius);
    background: var(--bg-white);
    color: var(--text-0);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all var(--transition);
}

.btn-share:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-1px);
}

/* ─── Modal Scrollbar ─── */
.modal-content::-webkit-scrollbar {
    width: 5px;
}

.modal-content::-webkit-scrollbar-track {
    background: transparent;
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--bg-soft);
    border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-3);
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
    .proj-main {
        padding: 24px 16px 40px;
    }

    .section-title {
        font-size: 1.6rem;
    }

    .repo-row {
        flex-wrap: wrap;
        gap: 10px;
        padding: 14px 16px;
    }

    .repo-tagline {
        display: none;
    }

    .repo-tags {
        display: none;
    }

    .community-inner {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .community-text {
        flex-direction: column;
    }

    .modal-content {
        padding: 20px;
        max-height: 90vh;
    }

    .modal-header {
        flex-wrap: wrap;
    }
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--bg-soft);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-3);
}

/* ═══════════════════════════════════════════════
   TIER COMPARISON — Free vs Pro card
   ═══════════════════════════════════════════════ */

.tier-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.tier-card {
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-white);
    overflow: hidden;
}

.tier-card.tier-pro {
    border-color: var(--accent-border);
    background: var(--accent-bg);
    box-shadow: 0 0 0 1px var(--accent-border), var(--shadow-sm);
}

.tier-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.tier-pro .tier-header {
    border-bottom-color: var(--accent-border);
}

.tier-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-0);
}

.tier-price {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-2);
    font-family: var(--mono);
}

.tier-price-model {
    font-size: 0.6rem;
    font-weight: 400;
    color: var(--text-3);
    font-family: var(--sans);
}

.tier-badge {
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    background: var(--accent);
    color: #fff;
}

.tier-badge.coming-soon {
    background: hsl(36, 85%, 50%);
    animation: badge-updated-pulse 2s ease-in-out infinite;
    box-shadow: 0 0 6px hsla(36, 85%, 50%, 0.35);
}

.tier-coming-soon .tier-features {
    opacity: 0.65;
}

.tier-badge.unavailable {
    background: hsl(0, 55%, 50%);
    box-shadow: 0 0 6px hsla(0, 55%, 50%, 0.35);
}

.tier-unavailable .tier-features {
    opacity: 0.55;
}

.tier-unavailable.tier-pro {
    border-color: hsla(0, 55%, 50%, 0.3);
    background: hsla(0, 55%, 50%, 0.06);
    box-shadow: 0 0 0 1px hsla(0, 55%, 50%, 0.15);
}

.tier-buy-btn {
    width: 100%;
    padding: 0.55rem;
    margin-top: 0.75rem;
    border: none;
    border-radius: 6px;
    background: var(--accent);
    color: var(--bg-1);
    font-weight: 700;
    font-size: 0.78rem;
    font-family: var(--sans);
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}

.tier-buy-btn:hover {
    background: var(--accent-hover, var(--accent));
    transform: translateY(-1px);
}

.tier-buy-btn:active {
    transform: translateY(0);
}

.tier-features {
    list-style: none;
    padding: 10px 16px 14px;
    margin: 0;
}

.tier-features li {
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--text-1);
    padding: 4px 0;
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.tier-check {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-3);
    flex-shrink: 0;
}

.tier-check.pro {
    color: var(--accent);
}

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