/* /community (templates/community.html): centred hero, a featured Discord
   panel, then the other channels in one row. Cards come from
   css/shared/dashboard.css; colours from the theme tokens (theme.css), so it
   works in light and dark. Font sizes stay on css/base/type-scale.css. */
.prism-theme body.page-community { overflow: auto !important; height: auto !important; }

.cm {
  position: relative; z-index: 1;
  max-width: 1080px; margin: 0 auto; padding: 40px 24px 48px;
  color: var(--pt-text);
}

/* ── Backdrop: a faint system diagram and floating channel logos ─────── */
.cm-backdrop { position: absolute; inset: 0 0 auto 0; height: 560px; overflow: hidden; pointer-events: none; z-index: 0;
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent);
          mask-image: linear-gradient(to bottom, #000 55%, transparent); }
.cm-graph { position: absolute; inset: 0; width: 100%; height: 100%; }
.cm-graph-links path { fill: none; stroke: var(--pt-primary); stroke-width: 1.4; opacity: 0.16; stroke-dasharray: 6 8;
  animation: cm-flow 18s linear infinite; }
.cm-graph-nodes circle { fill: var(--pt-primary); opacity: 0.22; transform-box: fill-box; transform-origin: center;
  animation: cm-blink 4s ease-in-out infinite; }
.cm-graph-nodes circle:nth-child(3n)   { animation-delay: 1.3s; }
.cm-graph-nodes circle:nth-child(3n+1) { animation-delay: 2.6s; }

.cm-float {
  --brand: var(--pt-primary);
  position: absolute; display: grid; place-items: center; width: 58px; height: 58px; border-radius: 18px;
  color: var(--brand); background: var(--pt-surface); border: 1px solid var(--pt-border);
  box-shadow: 0 16px 32px -16px color-mix(in srgb, var(--brand) 60%, transparent);
  animation: cm-float 7s ease-in-out infinite;
}
.cm-float svg { width: 28px; height: 28px; }
.cm-float--discord   { --brand: #5865f2; }
.cm-float--linkedin  { --brand: #0a66c2; }
.cm-float--instagram { --brand: #e1306c; }
.cm-float--youtube   { --brand: #ff0000; }
.cm-float--1 { left: 7%;  top: 60px;  transform: rotate(-10deg); }
.cm-float--2 { right: 8%; top: 44px;  transform: rotate(8deg);   animation-delay: -2s; }
.cm-float--3 { left: 13%; top: 230px; transform: rotate(6deg);   animation-delay: -4s; width: 48px; height: 48px; }
.cm-float--4 { right: 13%; top: 218px; transform: rotate(-6deg); animation-delay: -1s; width: 48px; height: 48px; }
.cm-float--3 svg, .cm-float--4 svg { width: 22px; height: 22px; }

/* ── Hero ─────────────────────────────────────────────────────────────── */
/* A soft clearing behind the copy, so the diagram never crosses the text. */
.cm-hero::before { content: ""; position: absolute; inset: -24px -80px; z-index: -1;
  background: radial-gradient(closest-side, var(--pt-bg) 62%, transparent); }
.cm-hero { position: relative; z-index: 1; text-align: center; max-width: 720px; margin: 0 auto 36px; animation: cm-rise 0.4s ease-out both; }
.cm-eyebrow {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px;
  font-size: var(--t-caption); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--pt-primary); background: color-mix(in srgb, var(--pt-primary) 12%, transparent);
}
.cm-title { margin: 14px 0 0; font-size: var(--t-display); font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; color: var(--pt-text); }
.cm-accent {
  background: linear-gradient(90deg, var(--pt-primary), #8b5cf6);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.cm-sub { margin: 12px auto 0; font-size: var(--t-heading); line-height: 1.6; color: var(--pt-text-2); }
.cm-perks { list-style: none; margin: 20px 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.cm-perks li {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
  font-size: var(--t-small); font-weight: 600; color: var(--pt-text);
  background: var(--pt-surface); border: 1px solid var(--pt-border);
}
.cm-perks svg { color: var(--pt-primary); }

/* ── Featured Discord panel ───────────────────────────────────────────── */
.cm-feature {
  --brand: #5865f2;
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(220px, 1fr); align-items: center; gap: 24px;
  padding: 32px 36px; border-radius: 20px; color: #ffffff;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(255, 255, 255, 0.18), transparent 55%),
    linear-gradient(135deg, var(--brand), #7c3aed);
  box-shadow: 0 24px 48px -24px color-mix(in srgb, var(--brand) 70%, transparent);
  animation: cm-rise 0.45s ease-out both;
}
.cm-feature-badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: var(--t-caption); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  background: rgba(255, 255, 255, 0.18); color: #ffffff;
}
.cm-feature-title { margin: 12px 0 0; font-size: var(--t-metric); font-weight: 800; letter-spacing: -0.01em; color: #ffffff; }
.cm-feature-text { margin: 8px 0 0; max-width: 520px; font-size: var(--t-body); line-height: 1.6; color: rgba(255, 255, 255, 0.86); }
.cm-checks { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; }
.cm-checks li { display: flex; align-items: flex-start; gap: 8px; font-size: var(--t-small); font-weight: 600; color: #ffffff; }
.cm-checks svg { flex: none; margin-top: 1px; padding: 2px; border-radius: 50%; background: rgba(255, 255, 255, 0.2); }
.cm-feature-cta {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 24px; padding: 12px 22px; border-radius: 12px;
  font-size: var(--t-body); font-weight: 700; text-decoration: none;
  color: var(--brand); background: #ffffff;
  box-shadow: 0 10px 24px -10px rgba(15, 23, 42, 0.45);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.cm-feature-cta:hover { transform: translateY(-2px); box-shadow: 0 14px 28px -10px rgba(15, 23, 42, 0.5); }
.cm-feature-cta:focus-visible { outline: 3px solid #ffffff; outline-offset: 3px; }
.cm-feature > * { position: relative; z-index: 1; }
.cm-feature-dots { position: absolute !important; inset: 0; width: 100%; height: 100%; z-index: 0 !important; fill: #ffffff; opacity: 0.09; }
.cm-feature-art { position: relative; display: grid; place-items: center; min-height: 240px; }
.cm-feature-logo { position: relative; width: 110px; height: 110px; color: #ffffff; filter: drop-shadow(0 12px 24px rgba(15, 23, 42, 0.3)); }
.cm-orbit { position: absolute; border-radius: 50%; border: 1.5px dashed rgba(255, 255, 255, 0.35); animation: cm-spin 26s linear infinite; }
.cm-orbit--a { width: 220px; height: 220px; }
.cm-orbit--b { width: 150px; height: 150px; animation-duration: 18s; animation-direction: reverse; }
.cm-orbit i { position: absolute; width: 14px; height: 14px; margin: -7px; border-radius: 50%; background: #ffffff;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.18); }
.cm-orbit--a i:nth-child(1) { left: 50%; top: 0; }
.cm-orbit--a i:nth-child(2) { left: 93%; top: 75%; background: #fde68a; }
.cm-orbit--a i:nth-child(3) { left: 7%;  top: 75%; background: #a7f3d0; }
.cm-orbit--b i:nth-child(1) { left: 100%; top: 50%; width: 10px; height: 10px; margin: -5px; background: #fbcfe8; }
.cm-orbit--b i:nth-child(2) { left: 0;    top: 50%; width: 10px; height: 10px; margin: -5px; }
.cm-feature-ring {
  position: absolute; width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.04) 65%, transparent 70%);
  animation: cm-pulse 3.2s ease-in-out infinite;
}

/* ── Other channels ───────────────────────────────────────────────────── */
.cm-section-title { margin: 40px 0 14px; font-size: var(--t-title); font-weight: 700; color: var(--pt-text); }
.cm-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.cm-grid > li { display: flex; }
.cm-card {
  position: relative; overflow: hidden; flex: 1;
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  padding: 24px 22px 22px; text-decoration: none; color: inherit;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  animation: cm-rise 0.5s ease-out both;
}
.cm-grid .cm-card {
  background:
    radial-gradient(120% 90% at 100% 100%, color-mix(in srgb, var(--brand) 12%, transparent), transparent 60%),
    var(--pt-surface);
}
.cm-watermark {
  position: absolute; right: -22px; bottom: -26px; width: 132px; height: 132px;
  color: var(--brand); opacity: 0.08; transform: rotate(-14deg);
  transition: opacity 0.2s ease, transform 0.25s ease; pointer-events: none;
}
.cm-card:hover .cm-watermark { opacity: 0.14; transform: rotate(-6deg) scale(1.06); }
.cm-card > :not(.cm-watermark) { position: relative; z-index: 1; }
.cm-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--brand) 45%, transparent);
  box-shadow: 0 18px 36px -18px color-mix(in srgb, var(--brand) 55%, transparent); }
.cm-card:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.cm-card--linkedin  { --brand: #0a66c2; }
.cm-card--instagram { --brand: #e1306c; }
.cm-card--youtube   { --brand: #ff0000; }
.cm-card--discord   { --brand: #5865f2; }

.cm-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border-radius: 12px; color: var(--brand);
  background: color-mix(in srgb, var(--brand) 12%, transparent);
}
.cm-name { margin-top: 6px; font-size: var(--t-subtitle); font-weight: 700; color: var(--pt-text); }
.cm-blurb { flex: 1; font-size: var(--t-small); line-height: 1.55; color: var(--pt-text-2); }
.cm-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: var(--t-small); font-weight: 700; color: var(--brand); }
.cm-card:hover .cm-link svg { transform: translate(2px, -2px); }
.cm-link svg { transition: transform 0.15s ease; }

.cm-note { margin: 28px 0 0; text-align: center; font-size: var(--t-small); color: var(--pt-text-2); }
.cm-note a { color: var(--pt-primary); }

@keyframes cm-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes cm-flow  { to { stroke-dashoffset: -280; } }
@keyframes cm-blink { 0%, 100% { opacity: 0.16; transform: scale(1); } 50% { opacity: 0.4; transform: scale(1.35); } }
@keyframes cm-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -12px; } }
@keyframes cm-spin  { to { transform: rotate(360deg); } }
@keyframes cm-pulse { 0%, 100% { transform: scale(0.94); opacity: 0.8; } 50% { transform: scale(1.04); opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .cm-hero, .cm-feature, .cm-card { animation: none; }
  .cm-feature-ring, .cm-orbit, .cm-float, .cm-graph-links path, .cm-graph-nodes circle { animation: none; }
}

@media (max-width: 860px) {
  .cm-float--3, .cm-float--4 { display: none; }
  .cm-float--1 { left: 3%; top: 18px; width: 44px; height: 44px; }
  .cm-float--2 { right: 3%; top: 18px; width: 44px; height: 44px; }
  .cm-float--1 svg, .cm-float--2 svg { width: 20px; height: 20px; }
  .cm-grid { grid-template-columns: 1fr; }
  .cm-feature { grid-template-columns: 1fr; padding: 26px 22px; }
  .cm-feature-art { display: none; }
}
@media (max-width: 520px) {
  .cm { padding: 26px 16px 40px; }
  .cm-checks { grid-template-columns: 1fr; }
  .cm-feature-cta { width: 100%; justify-content: center; }
}

/* ── Level 2: chat bubbles, steps, card previews, spotlight, band ─────── */

/* Abstract chat bubbles around the Discord logo (shapes only). */
.cm-bubble {
  position: absolute; z-index: 2; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 14px;
  background: rgba(255, 255, 255, 0.95); box-shadow: 0 12px 24px -10px rgba(15, 23, 42, 0.45);
  animation: cm-float 6s ease-in-out infinite;
}
.cm-bubble--a { top: 22px; left: 0; border-bottom-left-radius: 4px; }
.cm-bubble--b { top: 108px; right: -6px; border-bottom-right-radius: 4px; animation-delay: -2s; }
.cm-bubble--c { bottom: 14px; left: 22px; border-bottom-left-radius: 4px; animation-delay: -4s; }
.cm-avatar { flex: none; width: 22px; height: 22px; border-radius: 50%; background: linear-gradient(135deg, #a5b4fc, #f0abfc); }
.cm-bubble--c .cm-avatar { background: linear-gradient(135deg, #6ee7b7, #93c5fd); }
.cm-lines { display: grid; gap: 5px; }
.cm-lines b { display: block; width: 74px; height: 6px; border-radius: 4px; background: #e2e8f0; }
.cm-lines b + b { width: 48px; }
.cm-typing { display: inline-flex; gap: 4px; padding: 2px 4px; }
.cm-typing b { width: 7px; height: 7px; border-radius: 50%; background: #5865f2; animation: cm-typing 1.2s ease-in-out infinite; }
.cm-typing b:nth-child(2) { animation-delay: 0.15s; }
.cm-typing b:nth-child(3) { animation-delay: 0.3s; }

/* How it works: three steps joined by a line. */
.cm-steps { margin-top: 44px; }
.cm-step-list { position: relative; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.cm-step-list::before {
  content: ""; position: absolute; top: 46px; left: 16%; right: 16%; height: 2px; z-index: 0;
  background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--pt-primary) 45%, transparent) 0 8px, transparent 8px 16px);
  background-size: 32px 2px; animation: cm-march 1.6s linear infinite;
}
.cm-step {
  position: relative; z-index: 1; padding: 22px; border-radius: 16px; text-align: center;
  background: var(--pt-surface); border: 1px solid var(--pt-border);
}
.cm-step-icon {
  display: inline-grid; place-items: center; width: 50px; height: 50px; border-radius: 50%; color: #ffffff;
  background: linear-gradient(135deg, var(--pt-primary), #8b5cf6);
  box-shadow: 0 0 0 6px var(--pt-surface), 0 12px 24px -12px var(--pt-primary);
}
.cm-step-num { display: block; margin-top: 12px; font-size: var(--t-caption); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--pt-primary); }
.cm-step-title { margin: 4px 0 0; font-size: var(--t-heading); font-weight: 700; color: var(--pt-text); }
.cm-step-text { margin: 6px 0 0; font-size: var(--t-small); line-height: 1.55; color: var(--pt-text-2); }

/* Mini preview in the top-right of each channel card. */
.cm-preview { position: absolute !important; top: 18px; right: 18px; width: 128px; height: 78px; pointer-events: none; }
.cm-post {
  position: absolute; inset: 0 0 auto 0; display: flex; align-items: center; gap: 8px; padding: 8px;
  border-radius: 10px 10px 0 0; background: var(--pt-surface); border: 1px solid var(--pt-border); border-bottom: 0;
}
.cm-post .cm-lines b { width: 64px; background: color-mix(in srgb, var(--pt-text-3) 25%, transparent); }
.cm-post .cm-lines b + b { width: 40px; }
.cm-post-media {
  position: absolute; inset: 38px 0 0 0; padding: 4px 8px; border-radius: 0 0 10px 10px;
  color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, var(--pt-surface)); border: 1px solid var(--pt-border); border-top: 0;
}
.cm-post-media svg { width: 100%; height: 100%; }
.cm-post-media path { stroke-dasharray: 140; stroke-dashoffset: 140; animation: cm-draw 2.8s ease-out infinite; }
.cm-phone {
  position: absolute; right: 28px; top: -4px; width: 46px; height: 82px; border-radius: 10px; padding: 4px;
  background: #0f172a; box-shadow: 0 10px 20px -10px rgba(15, 23, 42, 0.6); transform: rotate(8deg);
}
.cm-phone--back { right: 64px; top: 6px; z-index: -1; transform: rotate(-10deg); opacity: 0.5;
  background: linear-gradient(160deg, #f59e0b, #e1306c 55%, #8b5cf6); }
.cm-reel { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 7px; color: #ffffff;
  background: linear-gradient(160deg, #f59e0b, #e1306c 55%, #8b5cf6); }
.cm-reel svg { animation: cm-beat 2s ease-in-out infinite; }
.cm-player {
  position: absolute; inset: 4px 0 0 0; display: grid; place-items: center; border-radius: 10px;
  background: linear-gradient(135deg, #1e293b, #0f172a); box-shadow: 0 10px 20px -12px rgba(15, 23, 42, 0.7);
}
.cm-play { color: #ffffff; padding: 6px; border-radius: 10px; background: #ff0000; width: 38px; height: 28px; }
.cm-progress { position: absolute; left: 8px; right: 8px; bottom: 7px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.25); overflow: hidden; }
.cm-progress b { display: block; height: 100%; width: 40%; background: #ff0000; animation: cm-progress 4s ease-in-out infinite; }

/* Spotlight that follows the pointer (set by the page's script). */
.cm-card::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.2s ease;
  background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--brand) 16%, transparent), transparent 70%);
}
.cm-card:hover::after { opacity: 1; }

/* Closing band. */
.cm-band {
  --brand: #5865f2;
  position: relative; overflow: hidden; margin-top: 44px; padding: 44px 24px; border-radius: 22px; text-align: center; color: #ffffff;
  background: linear-gradient(135deg, #0f172a, #1e1b4b 55%, #312e81);
}
.cm-band-glow {
  position: absolute; inset: -40% -10% auto; height: 120%; pointer-events: none;
  background: radial-gradient(40% 50% at 30% 50%, rgba(88, 101, 242, 0.45), transparent 70%),
              radial-gradient(35% 45% at 75% 40%, rgba(236, 72, 153, 0.3), transparent 70%);
  animation: cm-drift 12s ease-in-out infinite alternate;
}
.cm-band > :not(.cm-band-glow) { position: relative; }
.cm-band-title { margin: 0 auto; max-width: 640px; font-size: var(--t-metric); font-weight: 800; letter-spacing: -0.01em; color: #ffffff; }
.cm-band-text { margin: 10px auto 0; max-width: 520px; font-size: var(--t-body); line-height: 1.6; color: rgba(255, 255, 255, 0.78); }
.cm-band-cta { margin-top: 22px; }

/* Fade sections in as they scroll into view. */
.cm-reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.cm-reveal.is-in { opacity: 1; transform: none; }

@keyframes cm-typing   { 0%, 60%, 100% { transform: translateY(0); opacity: 0.5; } 30% { transform: translateY(-4px); opacity: 1; } }
@keyframes cm-march    { to { background-position: 32px 0; } }
@keyframes cm-draw     { 0% { stroke-dashoffset: 140; } 60%, 100% { stroke-dashoffset: 0; } }
@keyframes cm-beat     { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.15); } }
@keyframes cm-progress { 0% { width: 8%; } 100% { width: 92%; } }
@keyframes cm-drift    { to { transform: translateX(6%) translateY(4%); } }

@media (prefers-reduced-motion: reduce) {
  .cm-bubble, .cm-typing b, .cm-step-list::before, .cm-post-media path, .cm-reel svg, .cm-progress b, .cm-band-glow { animation: none; }
  .cm-post-media path { stroke-dashoffset: 0; }
  .cm-reveal { opacity: 1; transform: none; transition: none; }
}
@media (max-width: 860px) {
  .cm-step-list { grid-template-columns: 1fr; }
  .cm-step-list::before { top: 16px; bottom: 16px; left: 50%; right: auto; width: 2px; height: auto;
    background: repeating-linear-gradient(180deg, color-mix(in srgb, var(--pt-primary) 45%, transparent) 0 8px, transparent 8px 16px); animation: none; }
  .cm-band { padding: 34px 20px; }
}
