/* The community (paavya.com/community/), laid out like a product community:
   a sidebar of places at the left, the newest update leading the middle,
   and a welcome, the feeds and "Start here" at the right. Loaded only by
   community/ pages (tools/build-site.mjs), after docs.css, whose screenshot
   frame (.shot) and pager it reuses. Every color is one of site.css's
   tokens, so light and dark follow the site (D-574). */

.cm {
  --cm-side: 232px;
  --cm-rail: 320px;
  width: 100%;
  max-width: calc(var(--cm-side) + 760px + var(--cm-rail) + 64px + var(--gutter) * 2);
  margin: 0 auto;
  padding: 24px var(--gutter) 96px;
  display: grid;
  gap: 24px;
}
.cm > * { min-width: 0; }
@media (min-width: 1000px) {
  .cm { grid-template-columns: var(--cm-side) minmax(0, 1fr); column-gap: 40px; row-gap: 32px; padding-top: 32px; }
  .cm-rail { grid-column: 2; }
}
@media (min-width: 1240px) {
  .cm { grid-template-columns: var(--cm-side) minmax(0, 1fr) var(--cm-rail); column-gap: 32px; }
  .cm-rail { grid-column: 3; grid-row: 1; }
}

/* ── The sidebar ──────────────────────────────────────────────── */
.cm-side { display: none; }
@media (min-width: 1000px) {
  .cm-side { display: block; grid-row: 1 / span 2; }
  .cm-nav { position: sticky; top: 88px; max-height: calc(100vh - 104px); overflow-y: auto; padding-bottom: 24px; scrollbar-width: thin; }
}
.cm-group + .cm-group { margin-top: 20px; }
.cm-group-h { margin: 0 0 4px; padding: 0 12px; font-size: 13px; font-weight: 600; color: var(--h-ink); }
.cm-link { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 40px; padding: 8px 12px; border: 0; border-radius: 10px; background: none; font: inherit; font-size: 15px; line-height: 1.3; text-align: left; color: var(--h-ink-2); cursor: pointer; transition: background-color var(--dur-ctl) ease, color var(--dur-ctl) ease; }
.cm-link:hover { background: var(--h-well); color: var(--h-ink); }
.cm-link[aria-current="page"] { background: var(--h-surface); color: var(--h-ink); font-weight: 600; box-shadow: inset 0 0 0 1px var(--h-line), var(--shadow-soft); }
.cm-link[aria-current="page"] .cm-ic { color: var(--h-brand); }
.cm-ic { width: 18px; height: 18px; flex: none; color: var(--h-muted); }
.cm-link:hover .cm-ic { color: var(--h-ink); }

/* Below 1000px the sidebar folds into one disclosure above the page. */
.cm-fold { border: 1px solid var(--h-line); border-radius: 12px; background: var(--h-surface); }
@media (min-width: 1000px) { .cm-fold { display: none; } }
.cm-fold summary { display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 0 16px; font-size: 15px; font-weight: 600; color: var(--h-ink); cursor: pointer; list-style: none; }
.cm-fold summary::-webkit-details-marker { display: none; }
.cm-fold summary::after { content: ""; width: 8px; height: 8px; border-right: 1.6px solid var(--h-muted); border-bottom: 1.6px solid var(--h-muted); transform: rotate(45deg) translateY(-2px); transition: transform var(--dur-ctl) var(--ease-out); }
.cm-fold[open] summary::after { transform: rotate(-135deg) translateY(-2px); }
.cm-fold nav { padding: 8px 8px 16px; border-top: 1px solid var(--h-line-soft); }
.cm-fold .cm-link { min-height: 44px; }

/* ── The middle column ────────────────────────────────────────── */
.cm-head { padding-bottom: 8px; }
.cm-head .crumbs { font-size: 13px; gap: 2px 8px; }
.cm-kicker { font-size: 13px; font-weight: 600; color: var(--h-brand); }
.cm-head h1 { margin-top: 6px; font-size: clamp(30px, 3.4vw, 40px); line-height: 1.12; letter-spacing: -0.022em; }
.cm-dek { margin-top: 10px; font-size: 17px; line-height: 1.55; color: var(--h-muted); max-width: 62ch; }
.cm-head .cm-eyebrow { margin-top: 8px; }

.cm-eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 13px; color: var(--h-muted); }
.cm-tag { display: inline-flex; align-items: center; min-height: 24px; padding: 0 10px; border-radius: var(--radius-pill); background: var(--h-tint); border: 1px solid var(--h-tint-line); font-size: 12px; font-weight: 600; color: var(--h-brand); }

/* The lead update: a deep stage with its headline and the app rising
   out of the bottom edge, then its words and three acts. */
.cm-lead { margin-top: 24px; border: 1px solid var(--h-line); border-radius: var(--radius-win); background: var(--h-surface); overflow: hidden; box-shadow: var(--shadow-soft); }
.cm-stage { position: relative; isolation: isolate; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 36px 24px 0; overflow: hidden; background: var(--h-deep); text-align: center; color: #fff; }
.cm-stage::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(60% 55% at 50% 72%, rgba(89, 211, 206, .30), transparent 70%); }
.cm-stage-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--h-haze); }
.cm-stage-eyebrow i { width: 7px; height: 7px; border-radius: 50%; background: #59D3CE; }
.cm-stage-title { max-width: 20ch; font-size: clamp(28px, 4.2vw, 48px); line-height: 1.06; font-weight: 600; letter-spacing: -0.03em; text-wrap: balance; }
.cm-stage-win { display: block; width: min(100%, 680px); margin-top: 18px; max-height: 300px; overflow: hidden; border: 1px solid rgba(255, 255, 255, .14); border-bottom: 0; border-radius: 12px 12px 0 0; box-shadow: 0 -20px 60px -20px rgba(0, 0, 0, .5); transition: transform var(--dur-in) var(--ease-out); }
.cm-stage-win img { width: 100%; height: auto; }
.cm-stage:hover .cm-stage-win { transform: translateY(-4px); }
.cm-lead-body { padding: 24px; }
.cm-lead-body h2 { margin-top: 10px; font-size: clamp(20px, 2vw, 24px); line-height: 1.3; }
.cm-lead-body h2 a:hover, .cm-up h3 a:hover, .cm-posts h3 a:hover { text-decoration: underline; text-underline-offset: 4px; }
.cm-lead-body > p:not(.cm-eyebrow) { margin-top: 10px; color: var(--h-muted); }
.cm-acts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 24px; }
.cm-act { min-height: 48px; padding: 0 18px; font-size: 15px; }
.cm-act .cm-ic { color: currentColor; }

.cm-sec { margin-top: 56px; scroll-margin-top: 96px; }
.cm-sec-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; margin-bottom: 18px; }
.cm-sec-head h2 { font-size: clamp(22px, 2.2vw, 26px); line-height: 1.2; letter-spacing: -0.015em; }
.cm-all { margin-top: 8px; }

/* Recent updates: one row of cards that scrolls sideways, snapping. */
.cm-row-scroll { list-style: none; display: flex; gap: 16px; margin: 0 calc(var(--gutter) * -1); padding: 4px var(--gutter) 12px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 var(--gutter); overscroll-behavior-x: contain; scrollbar-width: thin; }
@media (min-width: 1000px) { .cm-row-scroll { margin: 0; padding: 4px 0 12px; scroll-padding: 0; } }
.cm-row-scroll > .cm-up { flex: 0 0 min(84%, 320px); scroll-snap-align: start; }
.cm-arrows { display: flex; gap: 8px; }
.cm-arrows[hidden] { display: none; }
.cm-arrow { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--h-line); border-radius: var(--radius-pill); background: var(--h-surface); color: var(--h-ink); cursor: pointer; transition: border-color var(--dur-ctl) ease, opacity var(--dur-ctl) ease; }
.cm-arrow:hover { border-color: var(--control); }
.cm-arrow:disabled { opacity: .4; cursor: default; }
.cm-arrow .cm-ic { color: currentColor; }

.cm-up { position: relative; display: flex; flex-direction: column; border: 1px solid var(--h-line); border-radius: 12px; background: var(--h-surface); overflow: hidden; transition: border-color var(--dur-ctl) ease, box-shadow var(--dur-ctl) ease; }
.cm-up:hover { border-color: var(--control); box-shadow: var(--shadow-soft); }
.cm-up-shot { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--h-well); border-bottom: 1px solid var(--h-line-soft); }
.cm-up-shot img { width: 100%; height: 100%; object-fit: cover; object-position: top left; }
.cm-up-body { padding: 16px; }
.cm-up h3 { margin-top: 10px; font-size: 17px; line-height: 1.3; }
.cm-up h3 a::after { content: ""; position: absolute; inset: 0; }
.cm-up-body > p:last-child { margin-top: 6px; font-size: 14px; line-height: 1.5; color: var(--h-muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cm-grid { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 16px; }
@media (min-width: 720px) { .cm-grid { grid-template-columns: 1fr 1fr; } }

/* The video: home.css's poster and player, drawn here too. */
.cm-videos { display: grid; gap: 28px 20px; }
.cm-video { min-width: 0; }
/* The first video leads full width; the rest sit two across. */
@media (min-width: 720px) { .cm-videos { grid-template-columns: 1fr 1fr; } .cm-videos > :first-child { grid-column: 1 / -1; } }
.cm-video .video { aspect-ratio: 16 / 9; border: 1px solid var(--h-line); border-radius: var(--radius-win); overflow: hidden; background: var(--h-well); box-shadow: var(--shadow-soft); }
.video-poster { position: relative; display: block; width: 100%; height: 100%; border-radius: inherit; }
.video-poster img { display: block; width: 100%; height: 100%; object-fit: cover; }
.video-play { position: absolute; top: 50%; left: 50%; display: grid; place-items: center; width: 68px; height: 68px; margin: -34px 0 0 -34px; border-radius: var(--radius-pill); background: var(--h-fill); color: #fff; box-shadow: var(--shadow-soft); transition: transform var(--dur-ctl) var(--ease-out), background-color var(--dur-ctl) ease; }
.video-play .ic { width: 26px; height: 26px; margin-left: 3px; }
.video-poster:hover .video-play { background: var(--h-fill-hover); transform: scale(1.06); }
.video-poster:focus-visible { outline-offset: -4px; border-radius: inherit; }
.video-frame { display: block; width: 100%; height: 100%; border: 0; }
.cm-video figcaption { margin-top: 12px; font-size: 14px; color: var(--h-muted); }
.cm-video figcaption b { color: var(--h-ink); font-weight: 600; }

/* From the blog: three articles with their drawn covers. */
.cm-posts { list-style: none; margin: 0; padding: 0; display: grid; gap: 24px; }
@media (min-width: 720px) { .cm-posts { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; } }
.cm-posts .cover { aspect-ratio: 16 / 10; }
.cm-posts .cm-eyebrow { margin-top: 12px; }
.cm-posts h3 { margin-top: 8px; font-size: 17px; line-height: 1.3; }

/* The feed: everything published, newest first. */
.cm-filter { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--radius-pill); background: var(--h-well); border: 1px solid var(--h-line-soft); }
.cm-filter[hidden] { display: none; }
.cm-filter button { min-height: 36px; padding: 0 14px; border: 0; border-radius: var(--radius-pill); background: none; font: inherit; font-size: 14px; font-weight: 600; color: var(--h-muted); cursor: pointer; transition: background-color var(--dur-ctl) ease, color var(--dur-ctl) ease; }
.cm-filter button:hover { color: var(--h-ink); }
.cm-filter button[aria-checked="true"] { background: var(--h-raised); color: var(--h-ink); box-shadow: var(--shadow-soft); }
.cm-feed { list-style: none; margin: 0; padding: 0; border: 1px solid var(--h-line); border-radius: 12px; background: var(--h-surface); overflow: hidden; }
.cm-feed li + li { border-top: 1px solid var(--h-line-soft); }
.cm-feed a { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "k t when" "k d when"; align-items: baseline; gap: 2px 14px; padding: 14px 18px; transition: background-color var(--dur-ctl) ease; }
.cm-feed a:hover { background: var(--h-well); }
.cm-feed-k { grid-area: k; align-self: start; min-width: 112px; font-size: 12px; font-weight: 600; letter-spacing: .02em; color: var(--h-muted); padding-top: 2px; }
.cm-k-update { color: var(--h-brand); }
.cm-feed-t { grid-area: t; font-size: 15px; font-weight: 600; line-height: 1.35; color: var(--h-ink); }
.cm-feed-d { grid-area: d; font-size: 14px; line-height: 1.45; color: var(--h-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm-feed time { grid-area: when; font-size: 13px; color: var(--h-muted); white-space: nowrap; }
@media (max-width: 640px) {
  .cm-feed a { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "k when" "t t" "d d"; padding: 14px 16px; }
  .cm-feed-k { min-width: 0; padding-top: 0; }
  .cm-feed-d { white-space: normal; }
}

/* ── The right rail ───────────────────────────────────────────── */
.cm-rail { display: grid; gap: 16px; align-content: start; }
@media (min-width: 1000px) and (max-width: 1239px) { .cm-rail { grid-template-columns: 1fr 1fr; } .cm-rail #start { grid-column: 1 / -1; } }
@media (min-width: 1240px) { .cm-rail { position: sticky; top: 88px; } }
.cm-card { padding: 22px; border: 1px solid var(--h-line); border-radius: 14px; background: var(--h-surface); scroll-margin-top: 96px; }
.cm-card h2 { font-size: 19px; line-height: 1.3; letter-spacing: -0.012em; }
.cm-card > p { margin-top: 8px; font-size: 15px; line-height: 1.55; color: var(--h-ink-2); }
.cm-card > .cm-quiet { margin-top: 16px; font-size: 14px; color: var(--h-muted); }
.cm-wide { width: 100%; margin-top: 10px; min-height: 46px; font-size: 15px; }
.cm-row { display: flex; align-items: center; gap: 10px; min-height: 44px; margin-top: 6px; padding: 0 12px; border-radius: 10px; font-size: 15px; font-weight: 600; color: var(--h-ink); transition: background-color var(--dur-ctl) ease; }
.cm-card > p + .cm-row { margin-top: 12px; }
.cm-row:hover { background: var(--h-well); }
.cm-row .cm-ic { color: var(--h-brand); }

.cm-start { list-style: none; margin: 14px -10px 0; padding: 0; counter-reset: none; }
.cm-start a { display: grid; grid-template-columns: 22px 44px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 56px; padding: 6px 10px; border-radius: 10px; transition: background-color var(--dur-ctl) ease; }
.cm-start a:hover { background: var(--h-well); }
.cm-n { font-size: 15px; font-weight: 600; color: var(--h-muted); text-align: right; font-variant-numeric: tabular-nums; }
.cm-start img { width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--h-line-soft); object-fit: cover; object-position: top left; background: var(--h-well); }
.cm-start-t { font-size: 15px; font-weight: 600; line-height: 1.3; color: var(--h-ink); }
.cm-start-m { font-size: 13px; color: var(--h-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

.cm-mini { list-style: none; margin: 12px -10px 0; padding: 0; }
.cm-mini a { display: grid; gap: 2px; min-height: 44px; padding: 8px 10px; border-radius: 10px; transition: background-color var(--dur-ctl) ease; }
.cm-mini a:hover { background: var(--h-well); }
.cm-mini span { font-size: 14px; font-weight: 600; line-height: 1.35; color: var(--h-ink); }
.cm-mini time { font-size: 12px; color: var(--h-muted); }

/* ── An update's own page ─────────────────────────────────────── */
.cm-hero-shot { margin: 24px 0 8px; }
.cm-guide { display: grid; gap: 4px; margin-top: 36px; padding: 18px 20px; border-radius: 12px; background: var(--h-tint); border: 1px solid var(--h-tint-line); font-size: 15px; line-height: 1.55; color: var(--h-ink-2); }
.cm-guide b { color: var(--h-ink); }
.cm-main > .cm-acts { margin-top: 24px; }

/* A thumb's floor (D-11): every control here clears 44px on a phone,
   where the updates row is swiped, so its arrows are not drawn. */
@media (max-width: 999px) {
  .cm-filter button, .cm-head .crumbs a { min-height: 44px; }
  .cm-arrows { display: none; }
}
@media (max-width: 560px) {
  .cm-acts { grid-template-columns: 1fr 1fr; }
  .cm-acts .btn-primary { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  .cm-stage-win, .video-play, .cm-fold summary::after { transition: none; }
  .cm-stage:hover .cm-stage-win, .video-poster:hover .video-play { transform: none; }
  .cm-row-scroll { scroll-behavior: auto; }
}
