.community-page {
  min-height: 100vh;
}

.community-shell {
  width: min(1160px, calc(100% - 3rem));
  margin-inline: auto;
}

.community-hero {
  position: relative;
  z-index: 1;
  padding: 9.5rem 0 4.5rem;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 18% 20%, rgba(11, 171, 245, 0.13), transparent 38%),
    linear-gradient(180deg, rgba(18, 18, 20, 0.12), var(--bg-dark));
}

.community-hero-content {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 5rem;
}

.community-hero-copy {
  max-width: 650px;
}

.community-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--accent-light);
  font-size: 0.88rem;
  font-weight: 700;
}

.community-eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px var(--accent);
}

.community-hero h1 {
  margin: 1rem 0;
  font-size: clamp(2.6rem, 5.2vw, 4.6rem);
  line-height: 1.22;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.community-hero h1 span {
  display: block;
  color: var(--accent);
}

.community-hero-copy > p {
  max-width: 560px;
  color: var(--text-secondary);
  font-size: 1.08rem;
}

.community-hero-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-top: 1.8rem;
}

.community-button,
.community-new-post {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  padding: 0.85rem 1.3rem;
  border: 1px solid transparent;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.community-button:hover,
.community-new-post:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(11, 171, 245, 0.25);
}

.community-text-link {
  color: var(--text-primary);
  font-weight: 600;
  text-decoration: none;
}

.community-proof {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-top: 2.3rem;
}

.community-proof-avatars {
  display: flex;
  direction: ltr;
}

.community-proof-avatars span,
.post-avatar,
.member-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  font-weight: 800;
}

.community-proof-avatars span {
  width: 36px;
  height: 36px;
  margin-left: -8px;
  border: 2px solid var(--bg-dark);
  background: var(--bg-elevated);
  color: var(--accent-light);
}

.community-proof-avatars span:nth-child(2) {
  background: #2d2452;
  color: #c4b5fd;
}

.community-proof-avatars span:nth-child(3) {
  background: #164e63;
  color: #a5f3fc;
}

.community-proof-avatars span:nth-child(4) {
  background: var(--accent);
  color: #fff;
}

.community-proof p {
  color: var(--text-secondary);
  font-size: 0.78rem;
  line-height: 1.5;
}

.community-proof strong {
  color: var(--text-primary);
  font-size: 0.88rem;
}

.community-hero-card,
.sidebar-card,
.community-post {
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-card) 92%, transparent);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.16);
}

.community-hero-card {
  position: relative;
  padding: 1.6rem;
  border-radius: 22px;
  overflow: hidden;
}

.community-hero-card::before {
  position: absolute;
  top: -100px;
  left: -80px;
  width: 230px;
  height: 230px;
  border-radius: 50%;
  background: rgba(11, 171, 245, 0.13);
  filter: blur(40px);
  content: "";
}

.community-card-topline,
.community-card-bottom {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-secondary);
  font-size: 0.82rem;
}

.community-live {
  margin-inline-start: auto;
  padding: 0.2rem 0.6rem;
  border: 1px solid rgba(34, 197, 94, 0.22);
  border-radius: 20px;
  background: rgba(34, 197, 94, 0.1);
  color: #4ade80;
  font-size: 0.72rem;
}

.community-online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 12px #22c55e;
}

.community-stat {
  display: grid;
  gap: 0.15rem;
  margin: 2.4rem 0 2rem;
}

.community-stat strong {
  color: var(--text-primary);
  font-family: "Space Grotesk", sans-serif;
  font-size: 3.5rem;
  line-height: 1;
}

.community-stat span {
  color: var(--text-secondary);
}

.community-mini-code {
  padding: 1.1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-dark);
  color: var(--text-primary);
  font-family: "Space Grotesk", monospace;
  font-size: 0.87rem;
}

.code-prompt,
.code-blue {
  color: #38bdf8;
}

.code-string {
  color: #86efac;
}

.community-card-bottom {
  justify-content: space-between;
  gap: 0.4rem;
  margin-top: 1.2rem;
  font-size: 0.7rem;
}

.community-main {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  align-items: start;
  gap: 2rem;
  padding-top: 2rem;
  padding-bottom: 6rem;
}

.community-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.community-section-heading h2 {
  margin-top: 0.35rem;
  font-size: 1.8rem;
}

.community-section-heading p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.community-new-post {
  flex: 0 0 auto;
  padding: 0.65rem 0.9rem;
  border-color: var(--border);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 0.85rem;
}

.community-new-post:hover {
  border-color: var(--accent);
  color: var(--accent-light);
  box-shadow: none;
}

.community-search {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  height: 50px;
  padding: 0 0.9rem;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--bg-card);
  color: var(--text-muted);
}

.community-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(11, 171, 245, 0.1);
}

.community-search > span {
  font-size: 1.5rem;
  line-height: 1;
}

.community-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: 0.88rem;
}

.community-search input::placeholder {
  color: var(--text-muted);
}

.community-search kbd {
  min-width: 24px;
  padding: 0.05rem 0.35rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text-muted);
  text-align: center;
  font: inherit;
  font-size: 0.75rem;
}

.community-filters {
  display: flex;
  gap: 0.5rem;
  margin: 1.1rem 0;
  overflow-x: auto;
}

.community-filters button {
  flex: 0 0 auto;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  transition: 0.2s ease;
}

.community-filters button:hover,
.community-filters button.is-active {
  border-color: rgba(11, 171, 245, 0.45);
  background: rgba(11, 171, 245, 0.1);
  color: var(--accent-light);
}

.community-post-list {
  display: grid;
  gap: 1rem;
}

.community-post {
  padding: 1.35rem;
  border-radius: 14px;
}

.post-author {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.post-avatar {
  width: 42px;
  height: 42px;
  color: white;
}

.avatar-purple {
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
}

.avatar-cyan {
  background: linear-gradient(135deg, #06b6d4, #0369a1);
}

.avatar-orange {
  background: linear-gradient(135deg, #fb923c, #ea580c);
}

.post-author > div:nth-child(2) {
  display: grid;
  line-height: 1.45;
}

.post-author strong,
.active-member strong {
  color: var(--text-primary);
  font-size: 0.86rem;
}

.post-author > div:nth-child(2) span,
.active-member small {
  color: var(--text-muted);
  font-size: 0.74rem;
}

.post-tag {
  margin-inline-start: auto;
  padding: 0.2rem 0.65rem;
  border-radius: 20px;
  font-size: 0.72rem;
}

.tag-question {
  background: rgba(139, 92, 246, 0.13);
  color: #c4b5fd;
}

.tag-project {
  background: rgba(6, 182, 212, 0.13);
  color: #67e8f9;
}

.tag-discussion {
  background: rgba(251, 146, 60, 0.13);
  color: #fdba74;
}

.community-post h3 {
  margin-top: 1.05rem;
  font-size: 1.08rem;
}

.community-post > p {
  margin-top: 0.45rem;
  color: var(--text-secondary);
  font-size: 0.87rem;
  line-height: 1.85;
}

.post-code {
  margin-top: 0.8rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-dark);
  color: #e2e8f0;
  font-family: "Space Grotesk", monospace;
  font-size: 0.83rem;
}

.project-preview {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  height: 66px;
  margin-top: 0.8rem;
  padding: 0 1rem;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: linear-gradient(110deg, var(--bg-dark), rgba(11, 171, 245, 0.12));
  color: var(--text-secondary);
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.75rem;
}

.preview-window-dots {
  color: #fb7185;
  font-size: 0.65rem;
  letter-spacing: 0.08rem;
}

.preview-window-mark {
  margin-inline-start: auto;
  color: var(--accent-light);
  font-size: 2rem;
}

.post-actions {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-top: 1rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.78rem;
}

.post-actions button {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.post-actions .post-like[aria-pressed="true"] {
  color: #fb7185;
}

.post-share {
  margin-inline-start: auto;
}

.post-share:hover,
.sidebar-link:hover {
  color: var(--accent-light);
}

.community-empty {
  padding: 2rem 1rem;
  color: var(--text-secondary);
  text-align: center;
}

.community-sidebar {
  display: grid;
  gap: 1rem;
}

.sidebar-card {
  padding: 1.1rem;
  border-radius: 13px;
}

.sidebar-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.sidebar-card-heading h3 {
  font-size: 0.95rem;
}

.active-member {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
}

.member-rank {
  width: 20px;
  color: var(--text-muted);
  text-align: center;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
}

.rank-gold {
  color: #fbbf24;
}

.rank-silver {
  color: #cbd5e1;
}

.rank-bronze {
  color: #fb923c;
}

.member-avatar {
  width: 35px;
  height: 35px;
  color: white;
}

.member-one {
  background: linear-gradient(135deg, #f59e0b, #b45309);
}

.member-two {
  background: linear-gradient(135deg, #ec4899, #9d174d);
}

.member-three {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.active-member > div {
  display: grid;
  line-height: 1.35;
}

.member-streak {
  margin-inline-start: auto;
  color: var(--text-secondary);
  font-size: 0.74rem;
}

.sidebar-link {
  display: block;
  margin-top: 0.85rem;
  color: var(--accent-light);
  font-size: 0.79rem;
  font-weight: 700;
  text-decoration: none;
}

.topics-card > a {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 0.8rem;
  text-decoration: none;
}

.topics-card > a:last-child {
  border-bottom: 0;
}

.topics-card > a span {
  color: var(--accent);
}

.topics-card > a small {
  margin-inline-start: auto;
  color: var(--text-muted);
  font-size: 0.68rem;
}

.topics-card > a:hover {
  color: var(--accent-light);
}

.community-guidelines {
  display: flex;
  gap: 0.7rem;
  padding: 1rem;
  border: 1px solid rgba(11, 171, 245, 0.2);
  border-radius: 12px;
  background: rgba(11, 171, 245, 0.07);
}

.community-guidelines > span {
  font-size: 1.15rem;
}

.community-guidelines strong {
  font-size: 0.82rem;
}

.community-guidelines p {
  margin-top: 0.2rem;
  color: var(--text-secondary);
  font-size: 0.75rem;
}

.community-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-card);
}

.community-footer > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.5rem;
}

.community-footer p,
.community-footer > div > a:last-child {
  color: var(--text-secondary);
  font-size: 0.82rem;
  text-decoration: none;
}

@media (max-width: 900px) {
  .community-hero-content {
    gap: 2.5rem;
  }

  .community-main {
    grid-template-columns: minmax(0, 1fr) 270px;
    gap: 1.25rem;
  }
}

@media (max-width: 768px) {
  .community-shell {
    width: min(100% - 2rem, 600px);
  }

  .community-hero {
    padding-top: 8rem;
  }

  .community-hero-content,
  .community-main {
    grid-template-columns: 1fr;
  }

  .community-hero-content {
    gap: 2.5rem;
  }

  .community-hero-card {
    max-width: 500px;
  }

  .community-main {
    padding-top: 0.5rem;
  }

  .community-sidebar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .community-guidelines {
    grid-column: 1 / -1;
  }
}

@media (max-width: 520px) {
  .community-hero {
    padding-bottom: 3rem;
  }

  .community-hero-actions {
    align-items: flex-start;
    flex-direction: column;
    gap: 1rem;
  }

  .community-stat strong {
    font-size: 2.8rem;
  }

  .community-card-bottom {
    flex-wrap: wrap;
  }

  .community-section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .community-post {
    padding: 1rem;
  }

  .post-actions {
    gap: 0.75rem;
    font-size: 0.72rem;
  }

  .community-sidebar {
    grid-template-columns: 1fr;
  }

  .community-guidelines {
    grid-column: auto;
  }

  .community-footer > div {
    align-items: flex-start;
    flex-direction: column;
  }
}
