:root {
  --bg: #f3f6fb;
  --card: #ffffff;
  --text: #172033;
  --muted: #6b7280;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --dark: #111827;
  --border: #e5e7eb;
  --soft: #eef4ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, .12), transparent 32%),
    radial-gradient(circle at top right, rgba(16, 185, 129, .09), transparent 30%),
    var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
.btn,
.btn-small {
  border: 0;
  background: var(--primary);
  color: #fff;
  padding: 13px 18px;
  border-radius: 15px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

button:hover,
.btn:hover,
.btn-small:hover {
  background: var(--primary-dark);
}

.btn.secondary,
.btn-small.dark {
  background: var(--dark);
}

.full {
  width: 100%;
  margin-top: 12px;
}

.topbar {
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding: 14px 5%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  background: var(--primary);
  color: white;
  font-weight: 900;
  border-radius: 15px;
  padding: 13px;
  letter-spacing: 1px;
}

.brand span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

nav {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

nav a {
  color: #374151;
  font-weight: 700;
}

.container {
  width: min(1100px, 94%);
  margin: 30px auto;
}

.hero {
  background: linear-gradient(135deg, #fff, #eef5ff);
  border: 1px solid var(--border);
  border-radius: 32px;
  padding: 46px;
  box-shadow: 0 20px 70px rgba(15, 23, 42, .08);
}

.badge {
  display: inline-block;
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 900;
  border-radius: 999px;
  padding: 8px 14px;
  margin-bottom: 14px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(34px, 6vw, 64px);
  line-height: .96;
  max-width: 800px;
}

.hero p {
  color: var(--muted);
  font-size: 20px;
  max-width: 680px;
  line-height: 1.55;
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.card,
.post,
.side-card,
.member-card,
.group-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 22px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, .06);
}

.card,
.post {
  margin-bottom: 20px;
}

.auth {
  max-width: 520px;
  margin: 0 auto;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--border);
  background: #fbfdff;
  border-radius: 15px;
  padding: 14px;
  margin: 8px 0 14px;
  font: inherit;
}

textarea {
  min-height: 125px;
  resize: vertical;
}

label {
  font-weight: 800;
  color: #374151;
}

.grid {
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 22px;
  align-items: start;
}

.welcome,
.page-title,
.profile-header,
.group-header {
  background: rgba(255,255,255,.86);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 24px;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.profile-mini,
.post-author {
  display: flex;
  align-items: center;
  gap: 13px;
}

.welcome h1,
.page-title h1,
.profile-header h1,
.group-header h1 {
  margin: 0 0 6px;
}

.welcome p,
.page-title p,
.profile-header p,
.group-header p {
  color: var(--muted);
  margin: 0;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: linear-gradient(135deg, #2563eb, #1e40af);
  color: white;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.avatar.big {
  width: 66px;
  height: 66px;
  border-radius: 22px;
  font-size: 22px;
}

.avatar.huge {
  width: 110px;
  height: 110px;
  border-radius: 34px;
  font-size: 34px;
}

.avatar.mini {
  width: 32px;
  height: 32px;
  border-radius: 11px;
  font-size: 12px;
}

.side-card h3 {
  margin-top: 0;
}

.side-link {
  display: block;
  padding: 12px;
  background: #f8fafc;
  border-radius: 14px;
  margin-bottom: 8px;
  font-weight: 800;
}

.post-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.post-author span,
.group-card span,
.member-card span,
.group-header span,
.profile-header span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.group-pill {
  background: var(--soft);
  color: #1d4ed8;
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 900;
  font-size: 13px;
}

.group-pill.muted,
.muted {
  color: var(--muted);
}

.post-content {
  font-size: 17px;
  line-height: 1.58;
  margin: 18px 0;
}

.post-actions {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
  display: flex;
  gap: 18px;
  color: var(--muted);
  font-weight: 800;
}

.link-btn {
  background: transparent;
  color: var(--primary);
  padding: 0;
  border-radius: 0;
}

.link-btn:hover {
  background: transparent;
  color: var(--primary-dark);
}

.comments {
  margin-top: 14px;
}

.comment {
  display: flex;
  gap: 10px;
  background: #f8fafc;
  border-radius: 16px;
  padding: 10px;
  margin-top: 8px;
}

.comment strong {
  display: block;
  font-size: 13px;
}

.comment span {
  color: #374151;
}

.comment-form {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.comment-form input {
  margin: 0;
}

.comment-form button {
  width: 110px;
}

.cards {
  display: grid;
  gap: 16px;
}

.member-card {
  display: flex;
  gap: 15px;
  align-items: center;
}

.member-card p {
  margin: 5px 0 0;
  color: var(--muted);
}

.group-card {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.group-card h2 {
  margin: 10px 0 8px;
}

.group-card p {
  color: var(--muted);
  margin: 0 0 10px;
}

.group-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 130px;
}

.group-icon {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, #111827, #374151);
  color: white;
  border-radius: 18px;
  font-size: 28px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.big-icon {
  width: 88px;
  height: 88px;
  border-radius: 28px;
  font-size: 46px;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 26px;
}

footer {
  color: var(--muted);
  text-align: center;
  padding: 40px 20px;
}

@media (max-width: 820px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  nav {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
  }

  nav a {
    white-space: nowrap;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .welcome,
  .page-title,
  .profile-header,
  .group-header,
  .group-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .group-actions {
    width: 100%;
  }

  .group-actions .btn,
  .group-actions button {
    width: 100%;
  }

  .comment-form {
    flex-direction: column;
  }

  .comment-form button {
    width: 100%;
  }

  .hero {
    padding: 30px;
  }
}
