/* 09 · Community — "Stay in the loop." (scoped to #community / .cm-) */
#community {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
}

/* big blurred streak glow, centred on the section */
#community .cm-bg {
  position: absolute;
  z-index: -1;
  top: 50%;
  left: 50%;
  width: clamp(680px, 32vw + 561px, 818px);
  max-width: none;
  height: auto;
  transform: translate(-50%, -50%);
  opacity: 0.72;
  pointer-events: none;
}

/* ---------- title + social cards ---------- */
#community .cm-socials {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas: "title title" "slack twitter";
  gap: var(--s-7) var(--s-5);
  justify-content: center;
  width: 948px;
  max-width: 100%;
  padding: 0 var(--s-3);
  margin-bottom: 120px;
}
#community .cm-title {
  grid-area: title;
  max-width: 486px;
  margin: 0 auto;
}
#community .cm-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  gap: var(--s-2);
  max-width: 454px;
  padding: var(--s-3);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--r-lg);
  background: linear-gradient(137deg, rgba(17, 18, 20, 0.75) 4.87%, rgba(12, 13, 15, 0.9) 75.88%);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.15);
  overflow: hidden;
}
#community .cm-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: transparent;
  transition: background 0.3s;
  pointer-events: none;
}
#community .cm-card:hover::after { background: rgba(255, 255, 255, 0.04); }
#community .cm-card-head {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  width: 100%;
}
#community .cm-logo { width: 24px; height: 24px; flex: none; }
#community .cm-card h3 {
  flex-grow: 1;
  margin: 0;
  color: #fff;
  font-size: 20px;
  font-weight: 500;
  line-height: normal;
  letter-spacing: 0.2px;
}
#community .cm-count,
#community .cm-card p {
  color: var(--grey-200);
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.25);
  font-size: 14px;
  font-weight: 500;
  line-height: 160%;
}
#community .cm-count { font-family: var(--mono-geist); letter-spacing: 0.3px; white-space: nowrap; }
#community .cm-card p { letter-spacing: 0.2px; }
#community .cm-join {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  line-height: normal;
}
#community .cm-join svg { width: 16px; height: 16px; transition: transform 0.3s; }
#community .cm-card:hover .cm-join svg { transform: translateX(2px); }

/* ---------- YouTube ticker ---------- */
#community .cm-youtube {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
}
#community .cm-ticker {
  width: 100%;
  max-width: var(--container);
  padding: 48px 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 15% 85%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 15% 85%, transparent);
}
#community .cm-track {
  position: relative;
  height: 185px; /* thumb 129 + 16 + two 14px/1.4 title lines */
}
#community .cm-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 230px;
  will-change: transform;
}
#community .cm-slide p {
  margin-top: var(--s-2);
  color: #fff;
  opacity: 0.8;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  transition: opacity 0.2s;
}
#community .cm-slide:hover p { opacity: 1; }

/* thumbnails: original tiles */
#community .cm-thumb {
  --a: 200, 60, 60;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 230px;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-lg);
  overflow: hidden;
  background:
    radial-gradient(60% 85% at 55% 48%, rgba(var(--a), 0.55), transparent 72%),
    radial-gradient(70% 90% at 0% 100%, rgba(var(--a), 0.35), transparent 70%),
    radial-gradient(50% 60% at 100% 0%, rgba(255, 255, 255, 0.06), transparent 70%),
    linear-gradient(160deg, #1c1d22, #09090b);
  box-shadow: 0 0 20px 5px rgba(215, 201, 175, 0.05), 0 0 16px -7px rgba(215, 201, 175, 0.05);
  filter: grayscale(0.3);
  transition: transform 0.3s, box-shadow 0.3s, filter 0.3s;
}
#community .cm-slide .cm-thumb { --a: inherit; }
#community .cm-thumb::after {
  /* thin top-lit border */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
}
#community .cm-slide:hover .cm-thumb {
  transform: scale(1.04);
  filter: grayscale(0);
  box-shadow: 0 0 16px -7px rgba(154, 170, 255, 0.05), 0 2px 40px 10px rgba(154, 170, 255, 0.05);
}

#community .cm-sq {
  --s: 60, 60, 70;
  width: 56px;
  height: 56px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 26px;
  font-weight: 600;
  background: linear-gradient(150deg, rgba(var(--s), 1), rgba(var(--s), 0.55));
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.35), inset 0 -2px 6px rgba(0, 0, 0, 0.35), 0 10px 24px rgba(0, 0, 0, 0.5);
  transform: rotate(-8deg);
}
#community .cm-sq-lg { width: 68px; height: 68px; border-radius: 18px; font-size: 32px; }
#community .cm-sq svg { width: 38px; height: 38px; }
#community .cm-serif { font-family: Georgia, "Times New Roman", serif; font-style: italic; color: #e6d7d7; }
#community .cm-mono { font-family: var(--mono); font-size: 22px; color: #ffe08a; }
#community .cm-glyph { font-family: var(--emoji); font-size: 50px; line-height: 1; filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.55)); transform: rotate(-6deg); }
#community .cm-glyph-sm { font-size: 30px; transform: rotate(8deg) translateY(12px); }
#community .cm-word {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}
#community .cm-pill {
  position: absolute;
  left: 22px;
  top: 58px;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 7px;
  color: var(--grey-100);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
#community .t-icon .cm-pill + .cm-sq { margin-left: 40px; }

/* lens tile */
#community .t-lens .cm-sq { width: 64px; height: 64px; font-size: 30px; transform: none; border-radius: 18px; }
#community .cm-lens {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 92px;
  height: 92px;
  margin: -52px 0 0 -58px;
  border-radius: 50%;
  border: 5px solid rgba(20, 20, 24, 0.9);
  box-shadow: inset 0 0 18px rgba(255, 255, 255, 0.15), 0 8px 18px rgba(0, 0, 0, 0.5);
}
#community .cm-lens::after {
  content: "";
  position: absolute;
  right: -30px;
  bottom: -18px;
  width: 38px;
  height: 9px;
  border-radius: 4px;
  background: #151518;
  transform: rotate(40deg);
}

/* extension picks grid tile */
#community .t-grid {
  display: grid;
  grid-template-columns: repeat(3, 26px);
  grid-auto-rows: 26px;
  gap: 8px;
  place-content: center;
}
#community .cm-mini {
  --s: 90, 90, 100;
  display: grid;
  place-items: center;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(150deg, rgba(var(--s), 1), rgba(var(--s), 0.6));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 4px 10px rgba(0, 0, 0, 0.4);
}
#community .cm-mini:nth-child(n+6) { filter: blur(1.2px); opacity: 0.8; }

/* window layout tile */
#community .t-win { gap: 0; }
#community .cm-w { position: absolute; border-radius: 5px; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.18); }
#community .cm-w.a { left: 18px; top: 18px; width: 92px; bottom: 18px; background: rgba(var(--a), 0.35); }
#community .cm-w.b { right: 18px; top: 18px; width: 92px; height: 42px; }
#community .cm-w.c { right: 18px; bottom: 18px; width: 92px; height: 42px; }
#community .cm-vs { position: relative; z-index: 1; font-size: 18px; font-weight: 700; font-style: italic; color: #fff; padding: 2px 8px; border-radius: 6px; background: rgba(0, 0, 0, 0.55); }

/* big number tile */
#community .t-num { flex-direction: column; gap: 0; }
#community .t-num b {
  font-size: 50px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -2px;
  color: #fff;
  background: linear-gradient(180deg, #fff, rgba(var(--a), 1));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.5));
}
#community .t-num small { margin-top: 4px; font-size: 11px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: rgba(255, 255, 255, 0.7); }

/* ---------- footer ---------- */
#community .cm-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 29px;
  max-width: 360px;
  padding: 0 var(--s-3);
}
#community .cm-footer p {
  color: var(--grey-200);
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  line-height: 160%;
  letter-spacing: 0.2px;
}
#community .cm-yt {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--grey-200);
  transition: color 0.3s;
}
#community .cm-yt:hover { color: #fff; }
#community .cm-yt-mark svg { width: 34px; height: 24px; }
#community .cm-yt-word {
  margin-left: 2px;
  color: #fff;
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -1.4px;
  line-height: 1;
  transform: scaleX(0.86);
  transform-origin: 0 50%;
  margin-right: -10px;
}
#community .cm-yt-arrow { width: 16px; height: 16px; transition: transform 0.3s; }
#community .cm-yt:hover .cm-yt-arrow { transform: translateX(2px); }

/* ---------- responsive ---------- */
@media (max-width: 719px) {
  #community .cm-socials {
    grid-template-columns: 1fr;
    grid-template-areas: "title" "slack" "twitter";
    gap: var(--s-4);
    margin-bottom: 72px;
  }
  #community .cm-title { margin-bottom: var(--s-3); }
  #community .cm-card { padding: var(--s-2); }
  #community .cm-ticker { -webkit-mask-image: linear-gradient(90deg, transparent, #000 8% 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8% 92%, transparent); }
}

@media (prefers-reduced-motion: reduce) {
  #community .cm-thumb,
  #community .cm-slide:hover .cm-thumb { transition: none; transform: none; }
}
