/* Community: gallery, project page, profile page, and the profile editor in the dashboard. */

.cm { padding: 44px 0 90px; }
.cm-head { display: flex; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.cm-head h1 { font-size: clamp(30px, 4.2vw, 44px); font-weight: 650; letter-spacing: -.03em; }
.cm-head p { margin-top: 10px; max-width: 620px; color: var(--text-2); font-size: 16.5px; }
.cm-head .row { margin-left: auto; display: flex; gap: 8px; }

/* ---- filters */
.cm-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 30px; }
.cm-search { position: relative; flex: 1 1 260px; max-width: 380px; }
.cm-search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.cm-search .input { width: 100%; padding-left: 36px; }
.cm select.input { width: auto; min-width: 128px; padding-right: 30px; cursor: pointer; }
.cm-check { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--r); font-size: 14px; color: var(--text-2); cursor: pointer; }
.cm-check:hover { color: var(--text); border-color: var(--line-3); }
.cm-check input { accent-color: var(--accent); }
.cm-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.cm-tag { height: 30px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 999px; background: transparent; color: var(--text-2); font-size: 13px; transition: color .15s, border-color .15s, background .15s; }
.cm-tag:hover { color: var(--text); border-color: var(--line-3); }
.cm-tag[aria-pressed="true"] { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
span.cm-tag, a.cm-tag { display: inline-flex; align-items: center; }

/* ---- grid of projects */
.cm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 22px 18px; margin-top: 26px; }
.cm-card { display: flex; flex-direction: column; min-width: 0; }
.cm-shot { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 10; overflow: hidden; border-radius: var(--r-lg); background: radial-gradient(120% 120% at 50% 0%, #1d1f25, #111216 70%); outline: 1px solid var(--line); outline-offset: -1px; }
.cm-shot img { position: absolute; inset: 0; width: 100%; height: 100%; padding: 16px; object-fit: contain; transition: transform .35s var(--ease); filter: drop-shadow(0 10px 22px rgba(0, 0, 0, .45)); }
.cm-card:hover .cm-shot img { transform: scale(1.025); }
.cm-card:hover .cm-shot { outline-color: var(--line-3); }
.cm-meta { display: flex; align-items: center; gap: 10px; padding: 11px 2px 0; min-width: 0; }
.cm-meta .who { min-width: 0; flex: 1; }
.cm-meta b { display: block; font-size: 14.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-meta .by { display: block; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-meta .by a:hover { color: var(--text); }
.cm-meta .by .pro { margin-left: 4px; color: var(--accent); font: 500 11px var(--mono); }
.cm-counts { display: flex; gap: 12px; color: var(--text-2); font-size: 13px; font-variant-numeric: tabular-nums; }
.cm-counts span { display: inline-flex; align-items: center; gap: 5px; }
.cm-counts .liked { color: #fb7185; }
.cm-counts .liked .kv-ico { fill: currentColor; }
.cm-empty { grid-column: 1 / -1; padding: 60px 20px; text-align: center; color: var(--muted); }
.cm-empty b { display: block; margin-bottom: 6px; color: var(--text); font-size: 17px; }
.cm-empty .btn { margin-top: 18px; }
.cm-pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 36px; color: var(--muted); font-size: 14px; }
.cm-ghost { border-radius: var(--r-lg); aspect-ratio: 16 / 10; background: var(--surface); animation: cmGhost 1.3s ease-in-out infinite alternate; }
@keyframes cmGhost { to { opacity: .45; } }

/* ---- one project */
.cm-back { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 20px; color: var(--text-2); font-size: 14px; }
.cm-back:hover { color: var(--text); }
.cm-back .icon { width: 15px; height: 15px; transform: rotate(180deg); }
.cm-project { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 36px; align-items: start; }
.cm-stage { position: relative; display: grid; place-items: center; min-height: 380px; padding: 28px; overflow: hidden; border-radius: var(--r-lg); background: radial-gradient(120% 120% at 50% 0%, #1d1f25, #0f1013 72%); outline: 1px solid var(--line); outline-offset: -1px; }
.cm-stage > img { max-height: 640px; border-radius: 8px; filter: drop-shadow(0 18px 40px rgba(0, 0, 0, .5)); }
.cm-stage canvas { outline: none; touch-action: none; max-width: none; }
.cm-stage-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; color: var(--muted); font-size: 13.5px; }
.cm-stage-bar .grow { flex: 1; }
.cm-text { margin-top: 30px; max-width: 70ch; color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.cm-side { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 88px; }
.cm-side h1 { font-size: 27px; letter-spacing: -.025em; overflow-wrap: anywhere; }
.cm-by { display: flex; align-items: center; gap: 12px; }
.cm-by b { display: block; font-size: 15px; } .cm-by span.h { font-size: 13px; color: var(--muted); }
.cm-actions { display: flex; flex-direction: column; gap: 8px; }
.cm-actions .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn.like[aria-pressed="true"] { color: #fb7185; border-color: rgba(251, 113, 133, .45); background: rgba(251, 113, 133, .08); }
.btn.like[aria-pressed="true"] .kv-ico { fill: currentColor; }
.cm-hint { color: var(--muted); font-size: 13px; line-height: 1.5; }
.cm-hint a { color: var(--accent); }
.cm-facts { display: grid; grid-template-columns: auto 1fr; gap: 9px 18px; margin: 0; padding-top: 18px; border-top: 1px solid var(--line); font-size: 14px; }
.cm-facts dt { color: var(--muted); } .cm-facts dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.cm-facts a { color: var(--accent); }
.cm-code { margin-top: 30px; }
.cm-code summary { cursor: pointer; color: var(--text-2); font-size: 14.5px; }
.cm-code pre { max-height: 380px; margin: 10px 0 0; padding: 14px; overflow: auto; border-radius: var(--r); background: #08090b; font: 12.5px/1.6 var(--mono); color: #cfd2da; }
.cm-code p { margin-top: 14px; color: var(--muted); font-size: 13px; }
.cm-sub { margin-top: 56px; font-size: 20px; }
.cm-report { align-self: flex-start; border: 0; padding: 0; background: none; color: var(--muted); font-size: 13px; }
.cm-report:hover { color: var(--text); text-decoration: underline; }
@media (max-width: 960px) { .cm-project { grid-template-columns: minmax(0, 1fr); } .cm-side { position: static; } .cm-stage { min-height: 260px; padding: 16px; } }

/* ---- profile page */
.cm-profile { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 44px; align-items: start; }
.cm-profile > div:first-child { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 14px; }
.cm-profile .cm-grid { margin-top: 18px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.cm-profile h2 { font-size: 20px; }
@media (max-width: 960px) { .cm-profile { grid-template-columns: minmax(0, 1fr); } .cm-profile > div:first-child { position: static; } .kv-card { max-width: none; } }

/* ---- dashboard: profile editor and my projects */
.pf { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.pf-form { display: flex; flex-direction: column; gap: 16px; }
.pf-side { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 10px; }
.pf-side > .label { font: 500 11.5px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.pf .two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pf .at { position: relative; } .pf .at::before { content: '@'; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); } .pf .at .input { width: 100%; padding-left: 28px; }
.pf-pics { display: flex; flex-wrap: wrap; gap: 18px 32px; }
.pf-pic { display: flex; align-items: center; gap: 14px; }
.pf-pic .thumb { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; overflow: hidden; background: var(--surface-3); color: var(--muted); font-weight: 600; }
.pf-pic .thumb.wide { width: 150px; height: 56px; border-radius: 8px; }
.pf-pic .thumb img { width: 100%; height: 100%; object-fit: cover; }
.pf-pic .row { display: flex; gap: 6px; margin-top: 6px; }
.pf-pic b { font-size: 14px; } .pf-pic p.hint { color: var(--muted); font-size: 12.5px; max-width: 220px; }
.pf-colors { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pf-color { width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 2px var(--bg-1), 0 0 0 2px var(--bg-1); transition: box-shadow .15s; }
.pf-color[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--bg-1), 0 0 0 5px var(--c); }
.pf-colors input[type="color"] { width: 38px; height: 32px; padding: 2px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface); cursor: pointer; }
.pf-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pf-chips button { height: 32px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--r); background: transparent; color: var(--text-2); font-size: 13.5px; }
.pf-chips button:hover { color: var(--text); border-color: var(--line-3); }
.pf-chips button[aria-pressed="true"] { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.pf-chips button.locked { opacity: .55; }
.pf-socials { display: flex; flex-direction: column; gap: 8px; }
.pf-social { display: grid; grid-template-columns: 170px minmax(0, 1fr) 40px; gap: 8px; align-items: center; }
.pf-lock { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: var(--r); background: var(--accent-soft); color: var(--text-2); font-size: 13.5px; }
.pf-lock a { color: var(--accent); font-weight: 550; white-space: nowrap; margin-left: auto; }
.pf-count { float: right; color: var(--muted); font-size: 12px; font-weight: 400; }
.pf-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.pf-row:last-child { border-bottom: 0; }
.pf-row .cm-shot { border-radius: 8px; } .pf-row .cm-shot img { padding: 6px; }
.pf-row b { font-size: 15px; } .pf-row p { font-size: 13px; color: var(--muted); }
.pf-row .row { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 1080px) { .pf { grid-template-columns: minmax(0, 1fr); } .pf-side { position: static; order: -1; } }
@media (max-width: 640px) { .pf .two { grid-template-columns: 1fr; } .pf-row { grid-template-columns: 84px minmax(0, 1fr); } .pf-row .row { grid-column: 1 / -1; justify-content: flex-start; } .pf-social { grid-template-columns: 1fr; } .cm-filters > * { flex: 1 1 44%; max-width: none; } .cm-filters > .cm-search { flex-basis: 100%; } .cm select.input { min-width: 0; } .cm-head .row { margin-left: 0; } }
@media (prefers-reduced-motion: reduce) { .cm-ghost { animation: none; } .cm-card:hover .cm-shot img { transform: none; } }
.pf .field .label { font: 550 13.5px var(--font); text-transform: none; letter-spacing: 0; color: var(--text); }
.pf-pic label.busy { opacity: .5; pointer-events: none; }
