/* =============================================================
   Calik X · GitHub Projects Overlay (Work Scene)
   Floats over the underlying WebGL "work" scene · zero impact
   ============================================================= */

.cx-gh {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 360px;
    max-width: calc(100vw - 56px);
    max-height: 56vh;
    z-index: 999955;
    font-family: var(--cx-font);
    color: var(--cx-fg);
    pointer-events: none;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s var(--cx-easing), transform 0.8s var(--cx-easing);
}
.cx-gh.is-visible { opacity: 1; transform: translateY(0); pointer-events: auto; }

.cx-gh__panel {
    background: rgba(12, 12, 14, 0.62);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    box-shadow: 0 30px 70px -20px rgba(0,0,0,0.7);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: inherit;
}

.cx-gh__head {
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}
.cx-gh__avatar {
    width: 28px; height: 28px; border-radius: 50%;
    background: linear-gradient(135deg, #0a84ff, #bf5af2);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 11px; font-weight: 700;
    flex-shrink: 0;
}
.cx-gh__avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.cx-gh__head__main { flex: 1; min-width: 0; }
.cx-gh__head__title {
    font-size: 12px; font-weight: 600;
    letter-spacing: 0.04em;
    margin: 0;
    color: var(--cx-fg);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cx-gh__head__sub {
    font-size: 10px; color: var(--cx-fg-mute);
    letter-spacing: 0.18em; text-transform: uppercase;
    margin-top: 2px;
}
.cx-gh__head__chev {
    width: 18px; height: 18px;
    color: var(--cx-fg-mute);
    transition: transform 0.4s var(--cx-easing);
}
.cx-gh.is-collapsed .cx-gh__head__chev { transform: rotate(-180deg); }

.cx-gh__body {
    overflow-y: auto;
    padding: 6px 0 8px;
    transition: max-height 0.5s var(--cx-easing), opacity 0.3s ease;
    max-height: 60vh;
}
.cx-gh.is-collapsed .cx-gh__body { max-height: 0; opacity: 0; padding: 0; pointer-events: none; }

.cx-gh__body::-webkit-scrollbar { width: 6px; }
.cx-gh__body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 6px; }

.cx-gh__item {
    display: block;
    padding: 12px 18px;
    text-decoration: none;
    color: var(--cx-fg);
    border-left: 2px solid transparent;
    transition: background 0.25s ease, border-color 0.25s ease, padding 0.25s ease;
}
.cx-gh__item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-left-color: var(--cx-accent);
    padding-left: 22px;
}
.cx-gh__item__name {
    font-size: 13px; font-weight: 600;
    letter-spacing: -0.01em;
    margin: 0 0 4px;
    color: var(--cx-fg);
    display: flex; align-items: center; gap: 8px;
}
.cx-gh__item__lang {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--lc, #888);
    flex-shrink: 0;
}
.cx-gh__item__desc {
    font-size: 11px; line-height: 1.45;
    color: var(--cx-fg-dim);
    margin: 0 0 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.cx-gh__item__meta {
    display: flex; gap: 14px; align-items: center;
    font-size: 10px; color: var(--cx-fg-mute);
    letter-spacing: 0.04em;
}
.cx-gh__item__meta svg { width: 11px; height: 11px; vertical-align: -1px; margin-right: 3px; fill: currentColor; }

.cx-gh__loading, .cx-gh__error {
    padding: 24px; text-align: center;
    font-size: 12px; color: var(--cx-fg-mute);
}
.cx-gh__loading::after {
    content: "";
    display: inline-block; margin-left: 8px;
    width: 12px; height: 12px;
    border: 1.5px solid var(--cx-line-2);
    border-top-color: var(--cx-accent);
    border-radius: 50%;
    animation: cxSpin 0.9s linear infinite;
    vertical-align: -2px;
}
@keyframes cxSpin { to { transform: rotate(360deg); } }

.cx-gh__foot {
    padding: 10px 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 10px;
    color: var(--cx-fg-mute);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    display: flex; justify-content: space-between; align-items: center;
}
.cx-gh__foot a {
    color: var(--cx-accent);
    text-decoration: none;
    transition: color 0.2s ease;
}
.cx-gh__foot a:hover { color: #4d9fff; }

@media (max-width: 720px) {
    .cx-gh { width: calc(100vw - 32px); right: 16px; bottom: 16px; max-height: 50vh; }
}

/* ── Inline variant (inside projects page, bottom-right) ── */
.cx-gh-proj-wrap {
    display: flex;
    justify-content: flex-end;
    padding: 32px 0 48px;
}

.cx-gh--inline {
    position: static;
    opacity: 1;
    transform: none;
    pointer-events: auto;
    width: 380px;
    max-width: 100%;
    max-height: none;
}

.cx-gh--inline .cx-gh__panel {
    max-height: none;
}

.cx-gh--inline .cx-gh__body {
    max-height: 420px;
    transition: max-height 0.45s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, padding 0.3s ease;
}

.cx-gh--inline.is-collapsed .cx-gh__body {
    max-height: 0;
    opacity: 0;
    padding: 0;
    pointer-events: none;
}

.cx-gh--inline.is-collapsed .cx-gh__foot {
    display: none;
}

.cx-gh--inline .cx-gh__head__chev {
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.cx-gh--inline.is-collapsed .cx-gh__head__chev {
    transform: rotate(-180deg);
}

@media (max-width: 720px) {
    .cx-gh--inline { width: 100%; }
    .cx-gh-proj-wrap { padding: 24px 0 40px; }
}
