/* Community page (/community/ and /fr/communaute/). Colours, type and radii
   come from theme-minimal.css tokens, so dark mode follows the site. Project
   renders sit on a light studio grey in both themes, like the app's own cards. */

.cm { --cm-studio: #f2f3f5; --cm-gap: clamp(48px, 7vw, 104px); }
.cm-eyebrow { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }
.lp-main .cm-display { margin: 0; font-size: clamp(2.5rem, 6.2vw, 5rem); font-weight: 600; line-height: 1.02; letter-spacing: -0.045em; text-wrap: balance; }
.lp-main .cm-display > span { display: block; color: var(--ink-3); }
.lp-main .cm-display--h2 { font-size: clamp(2rem, 4.4vw, 3.5rem); line-height: 1.06; }
.cm-sub { max-width: 60ch; margin: 14px 0 0; color: var(--ink-2); font-size: 1.05rem; line-height: 1.6; }
.cm-note { margin: 16px 0 0; color: var(--ink-3); font-size: 0.8rem; line-height: 1.5; }

/* ------------------------------------------------------------ hero */
.cm-hero { padding-top: clamp(12px, 3vw, 36px); overflow: hidden; }
.cm-hero__copy { display: flex; flex-direction: column; align-items: center; text-align: center; }
.cm-hero__copy .lp-lead { max-width: 64ch; margin-inline: auto; }
.cm-hero__copy .lp-actions { justify-content: center; }
/* A small live dot: the community is open now. */
.cm-pulse { position: relative; width: 8px; height: 8px; border-radius: 50%; background: #22a35a; }
.cm-pulse::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid #22a35a; opacity: 0; animation: cm-pulse 2.4s ease-out infinite; }
@keyframes cm-pulse { 0% { transform: scale(0.5); opacity: 0.7; } 100% { transform: scale(1.6); opacity: 0; } }

/* Two rows of every public project, drifting in opposite directions
   (community-page.js doubles each row for a seamless loop). */
.cm-marquee-wrap { position: relative; margin-top: clamp(40px, 6vw, 64px); }
.cm-marquee { display: grid; gap: 12px; -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); }
.cm-marquee__row { display: flex; gap: 12px; width: max-content; margin: 0; padding: 0; list-style: none; }
.cm-marquee__row--rev { margin-left: -140px; }
.cm-marquee.is-moving .cm-marquee__row { animation: cm-slide 90s linear infinite; }
.cm-marquee.is-moving .cm-marquee__row--rev { margin-left: 0; animation-direction: reverse; animation-duration: 104s; }
.cm-marquee.is-paused .cm-marquee__row { animation-play-state: paused; }
@keyframes cm-slide { to { transform: translateX(calc(-50% - 6px)); } }
.cm-tile { display: flex; align-items: center; gap: 12px; padding: 7px 18px 7px 7px; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); white-space: nowrap; }
.cm-tile img { flex: none; width: 60px; height: 60px; border-radius: 12px; background: var(--cm-studio); object-fit: contain; }
.cm-tile > span { display: grid; gap: 2px; }
.cm-tile b { color: var(--ink); font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.cm-tile span span { color: var(--ink-3); font-size: 13px; }
.cm-marquee__pause { position: absolute; right: max(16px, clamp(24px, 6vw, 64px)); bottom: -46px; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--paper); color: var(--ink-2); cursor: pointer; }
.cm-marquee__pause:hover { border-color: var(--ink); color: var(--ink); }
.cm-marquee__pause:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cm-marquee__pause svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cm-marquee__pause .cm-icon-play { display: none; fill: currentColor; stroke: none; }
.cm-marquee__pause[aria-pressed="true"] .cm-icon-pause { display: none; }
.cm-marquee__pause[aria-pressed="true"] .cm-icon-play { display: inline; }

/* The numbers: the number above its label (dd before dt visually). */
.cm-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: clamp(56px, 7vw, 88px) 0 0; border-top: 1px solid var(--line); }
.cm-stats > div { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 8px; padding: 24px 20px 0 0; }
.cm-stats > div + div { padding-left: 24px; border-left: 1px solid var(--line); }
.cm-stats dd { margin: 0; color: var(--ink); font-size: clamp(2.4rem, 4.8vw, 3.75rem); font-weight: 600; line-height: 1; letter-spacing: -0.045em; font-variant-numeric: tabular-nums; }
.cm-stats dt { max-width: 24ch; color: var(--ink-2); font-size: 0.95rem; line-height: 1.45; }

/* ------------------------------------------------------------ the common goal */
.cm-why { margin-top: var(--cm-gap); padding-block: var(--cm-gap); background: var(--paper-2); }
.cm-why__inner { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 28px clamp(32px, 6vw, 88px); align-items: end; }
.cm-why__lead { margin: 0; color: var(--ink-2); font-size: 1.15rem; line-height: 1.65; }
.cm-pillars { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin: clamp(16px, 3vw, 32px) 0 0; padding: 0; counter-reset: cm-pillar; }
.cm-pillars li { counter-increment: cm-pillar; padding-top: 18px; border-top: 1px solid var(--ink); list-style: none; }
.cm-pillars li::before { content: "0" counter(cm-pillar); display: block; margin-bottom: 10px; color: var(--accent); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.lp-main .cm-pillars h3 { font-size: 1.2rem; }
.cm-pillars p { margin: 8px 0 0; color: var(--ink-2); }

/* ------------------------------------------------------------ the library */
.cm-lib { padding-block: var(--cm-gap); scroll-margin-top: 72px; }
.cm-lib__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px 40px; margin-bottom: clamp(24px, 3vw, 36px); }
.cm-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.cm-filters[hidden] { display: none; }
.cm-filters button { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--paper); color: var(--ink); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; transition: border-color 0.15s ease, background-color 0.15s ease; }
.cm-filters button span { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.cm-filters button:hover { border-color: var(--ink); }
.cm-filters button[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--on-fill); }
.cm-filters button[aria-pressed="true"] span { color: inherit; opacity: 0.7; }
.cm-filters button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cm-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.cm-card[hidden] { display: none; }
/* The whole card opens the project: the title's link covers it, and the
   few controls inside (more guides, the credit's link) sit above that. */
.cm-card { position: relative; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg, 20px); background: var(--paper); transition: border-color 0.2s ease, transform 0.2s ease; }
.cm-card:hover { border-color: var(--ink); transform: translateY(-2px); }
.cm-card:focus-within { border-color: var(--ink); }
.cm-card__media { display: grid; place-items: center; aspect-ratio: 16 / 10; background: var(--cm-studio); }
.cm-card__media img { width: auto; height: 86%; max-width: 70%; object-fit: contain; }
.cm-card__body { display: flex; flex: 1; flex-direction: column; gap: 10px; padding: 18px 20px 20px; }
.lp-main .cm-card h3 { font-size: 1.2rem; line-height: 1.25; letter-spacing: -0.015em; }
.cm-card h3 a:not(#tw-noop) { color: var(--ink); text-decoration: none; }
.cm-card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.cm-card h3 a:focus-visible { outline: none; }
.cm-card h3 a:focus-visible::after { outline: 2px solid var(--accent); outline-offset: -2px; }
.cm-card h3 a span { color: var(--ink-3); font-weight: 500; }
.cm-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin: -2px 0 0; color: var(--ink-2); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.cm-card__meta > span:first-child { color: var(--ink); font-weight: 600; }
.cm-rating { color: var(--ink); font-weight: 500; }
.cm-rating > span[aria-hidden] { color: #f5a623; }
.cm-guides { display: grid; margin: 4px 0 0; padding: 0; }
.cm-guides li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 0.9rem; list-style: none; }
.cm-guides li span:first-child { color: var(--ink); }
.cm-guides li span:last-child { flex: none; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.cm-more { position: relative; z-index: 1; }
.cm-more summary { display: inline-flex; align-items: center; gap: 6px; padding: 6px 0 0; color: var(--accent); font-size: 0.9rem; font-weight: 500; cursor: pointer; list-style: none; }
.cm-more summary::-webkit-details-marker { display: none; }
.cm-more summary::after { content: "+"; font-weight: 600; }
.cm-more[open] summary::after { content: "−"; }
.cm-more .cm-guides { margin-top: 8px; }
.cm-card__credit { position: relative; z-index: 1; margin: auto 0 0; padding-top: 6px; color: var(--ink-3); font-size: 0.82rem; line-height: 1.5; }
.cm-card__credit a:not(#tw-noop) { color: var(--ink-2); }
.cm-lib__more { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 18px; margin: clamp(28px, 4vw, 40px) 0 0; color: var(--ink-3); font-size: 0.95rem; }

/* ------------------------------------------------------------ spotlight */
.cm-spot { padding-bottom: var(--cm-gap); }
.cm-spot .lp-feature__body .cm-eyebrow { margin-bottom: -4px; }

/* ------------------------------------------------------------ recently updated */
.cm-feed { padding-block: var(--cm-gap); background: var(--paper-2); }
.cm-feed__inner { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr); gap: 32px clamp(32px, 6vw, 88px); align-items: start; }
.cm-feed__head { position: sticky; top: 100px; }
.cm-feed__list { display: grid; margin: 0; padding: 0; }
.cm-feed__list li { position: relative; display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line-strong); list-style: none; }
.cm-feed__list li:last-child { border-bottom: 1px solid var(--line-strong); }
.cm-feed__list img { width: 56px; height: 56px; border-radius: 12px; background: var(--cm-studio); object-fit: contain; }
.cm-feed__list a:not(#tw-noop) { color: var(--ink); font-weight: 600; text-decoration: none; }
.cm-feed__list a::after { content: ""; position: absolute; inset: 0; }
.cm-feed__list li:hover a { text-decoration: underline; }
.cm-feed__list div p { margin: 2px 0 0; color: var(--ink-2); font-size: 0.95rem; }
.cm-feed__meta { display: grid; justify-items: end; gap: 2px; margin: 0; color: var(--ink-3); font-size: 0.85rem; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cm-feed__meta span { color: var(--ink-2); }

/* ------------------------------------------------------------ credits */
.cm-credits { padding-block: var(--cm-gap); }
.cm-credits__list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: clamp(28px, 4vw, 44px) 0 0; padding: 0; }
.cm-credits__list li { list-style: none; }
.cm-credits__list li > a:not(#tw-noop), .cm-credits__list li > div { display: flex; flex-direction: column; gap: 6px; height: 100%; box-sizing: border-box; padding: 20px; border: 1px solid var(--line); border-radius: 16px; color: var(--ink); text-decoration: none; }
.cm-credits__list li > a:not(#tw-noop):hover { border-color: var(--ink); }
.cm-credits__list strong { font-size: 1.05rem; line-height: 1.3; letter-spacing: -0.01em; }
.cm-credits__list span { color: var(--ink-2); font-size: 0.92rem; }
.cm-credits__list em { margin-top: auto; padding-top: 8px; color: var(--ink); font-size: 0.9rem; font-style: normal; font-weight: 600; font-variant-numeric: tabular-nums; }
.cm-credits__list em::before { content: "★ "; color: #f5a623; }

/* ------------------------------------------------------------ who it's for */
.cm-who { padding-block: var(--cm-gap); background: var(--surface-inverse, #0a0a0b); color: var(--on-surface-inverse, #fff); }
.cm-who .cm-eyebrow { color: var(--on-surface-inverse-2, #a3a3ac); }
.lp-main .cm-who .cm-display { color: inherit; }
.lp-main .cm-who .cm-display > span { color: var(--on-surface-inverse-2, #a3a3ac); }
.cm-who__list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; margin: clamp(32px, 5vw, 56px) 0 0; padding: 0; }
.cm-who__list li { padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, 0.35); list-style: none; }
.lp-main .cm-who__list h3 { color: inherit; font-size: 1.15rem; }
.cm-who__list p { margin: 8px 0 0; color: var(--on-surface-inverse-2, #a3a3ac); }

/* ------------------------------------------------------------ join in */
.cm-join { padding-block: var(--cm-gap) 0; }
/* Ways to take part, not steps: no numbers (the publish steps below have them). */
.cm-join__list { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin: clamp(24px, 4vw, 40px) 0 0; padding: 0; }
.cm-join__list li { padding: 22px; border-top: 3px solid var(--accent); border-radius: 4px 4px 16px 16px; background: var(--paper-2); list-style: none; }
.lp-main .cm-join__list h3 { font-size: 1.1rem; }
.cm-join__list p { margin: 6px 0 0; color: var(--ink-2); font-size: 0.95rem; }
.cm-publish { padding-block: clamp(40px, 6vw, 72px) var(--cm-gap); }
.cm-faq { padding-top: var(--cm-gap); border-top: 1px solid var(--line); }

/* ------------------------------------------------------------ smaller screens */
@media (max-width: 1080px) {
  .cm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cm-credits__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cm-who__list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 24px; }
}
@media (max-width: 900px) {
  .cm-why__inner, .cm-feed__inner { grid-template-columns: minmax(0, 1fr); }
  .cm-feed__head { position: static; }
  .cm-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cm-stats > div:nth-child(3) { padding-left: 0; border-left: 0; }
  .cm-stats > div:nth-child(n+3) { margin-top: 24px; border-top: 1px solid var(--line); }
}
@media (max-width: 640px) {
  .cm-hero__copy { align-items: flex-start; text-align: left; }
  .cm-hero__copy .lp-lead { margin-inline: 0; }
  .cm-hero__copy .lp-actions { justify-content: flex-start; }
  .cm-grid, .cm-pillars, .cm-who__list { grid-template-columns: minmax(0, 1fr); }
  .cm-credits__list { gap: 8px; }
  .cm-credits__list li > a:not(#tw-noop), .cm-credits__list li > div { padding: 14px; }
  .cm-credits__list strong { font-size: 0.95rem; }
  .cm-credits__list span, .cm-credits__list em { font-size: 0.82rem; }
  /* Cards: a small render beside the title instead of a full-width one. */
  .cm-card__media { position: absolute; top: 16px; right: 16px; width: 76px; height: 76px; aspect-ratio: auto; border-radius: 14px; }
  .cm-card__media img { width: 100%; height: 100%; max-width: none; }
  .cm-card__body { min-height: 76px; padding: 16px; }
  .cm-card__body > .lp-chips, .cm-card h3, .cm-card__meta { padding-right: 88px; }
  .cm-tile img { width: 48px; height: 48px; }
  .cm-tile b { font-size: 14px; }
  .cm-stats > div { padding-right: 12px; }
  .cm-stats > div + div { padding-left: 16px; }
  .cm-stats > div:nth-child(3) { padding-left: 0; }
  .cm-feed__list li { grid-template-columns: 48px minmax(0, 1fr); }
  .cm-feed__list img { width: 48px; height: 48px; }
  .cm-feed__meta { grid-column: 2; display: flex; flex-wrap: wrap; gap: 0 12px; margin-top: -8px; text-align: left; white-space: normal; }
  .cm-lib__head { display: block; }
  .cm-filters { flex-wrap: nowrap; margin-top: 20px; margin-inline:calc(-1 * max(16px, clamp(24px, 6vw, 64px))); padding-inline: max(16px, clamp(24px, 6vw, 64px)); overflow-x: auto; scrollbar-width: none; }
  .cm-filters::-webkit-scrollbar { display: none; }
  .cm-filters button { flex: none; }
  .cm-marquee__pause { bottom: -44px; }
}
@media (prefers-reduced-motion: reduce) {
  .cm-pulse::after { animation: none; }
  .cm-card { transition: none; }
  .cm-card:hover { transform: none; }
}
