:root {
  color-scheme: light;
  --bg: #f7f8f5;
  --surface: #ffffff;
  --ink: #14221b;
  --muted: #66736c;
  --line: #dfe6df;
  --green: #128c55;
  --green-dark: #0d6f45;
  --mint: #dff5e9;
  --amber: #ffbf69;
  --indigo: #3646a8;
  --shadow: 0 18px 50px rgba(22, 39, 31, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(223, 245, 233, 0.72), transparent 360px),
    var(--bg);
  color: var(--ink);
  font-family:
    Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

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

button,
input,
select {
  font: inherit;
}

.site-header,
main,
.site-footer {
  width: min(1120px, calc(100% - 32px));
  margin-inline: auto;
}

.site-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 16px 0 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  min-width: 0;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1;
  min-width: 0;
}

.brand-title {
  display: block;
  font-weight: 800;
  white-space: nowrap;
}

.brand-subtitle {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  background: var(--green);
  color: white;
  box-shadow: 0 10px 24px rgba(18, 140, 85, 0.24);
}

.site-menu {
  position: relative;
  z-index: 100;
  justify-self: end;
}

.menu-button {
  -webkit-appearance: none;
  appearance: none;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(20, 34, 27, 0.1);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 24px rgba(22, 39, 31, 0.08);
}

.menu-button[aria-expanded="true"] {
  background: var(--ink);
}

.menu-panel {
  position: absolute;
  z-index: 101;
  top: calc(100% + 12px);
  right: 0;
  min-width: 210px;
  border: 1px solid rgba(20, 34, 27, 0.1);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
  padding: 8px;
}

.menu-panel a {
  min-height: 42px;
  display: flex;
  align-items: center;
  border-radius: 8px;
  color: var(--ink);
  padding: 0 12px;
  font-weight: 800;
}

.menu-panel a:hover {
  background: #f1f4f2;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--green-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h2,
p {
  margin-top: 0;
}

h2 {
  margin-bottom: 10px;
  font-size: 1.35rem;
  letter-spacing: 0;
}

.sidebar {
  border: 1px solid rgba(20, 34, 27, 0.08);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
}

.select-label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

input,
select {
  width: 100%;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  outline: none;
}

input {
  padding: 0 14px;
}

select {
  padding: 0 12px;
}

input:focus,
select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(18, 140, 85, 0.12);
}

button {
  border: 0;
  border-radius: 8px;
  background: var(--green);
  color: white;
  cursor: pointer;
  font-weight: 800;
  transition:
    transform 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
}

button:hover {
  background: var(--green-dark);
  transform: translateY(-1px);
}

.site-menu .menu-button {
  width: 48px;
  height: 48px;
  border: 2px solid var(--ink);
  background: #ffffff;
  box-shadow: 0 14px 30px rgba(22, 39, 31, 0.18);
}

.site-menu .menu-button:hover,
.site-menu .menu-button[aria-expanded="true"] {
  background: var(--ink);
}

.site-menu .menu-button span {
  background: transparent;
}

.menu-icon {
  display: block;
  color: var(--ink);
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
  transform: translateY(-1px);
}

.site-menu .menu-button:hover .menu-icon,
.site-menu .menu-button[aria-expanded="true"] .menu-icon {
  color: white;
}

.category-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 14px 0 24px;
  scrollbar-width: none;
}

.category-strip::-webkit-scrollbar {
  display: none;
}

.category-button {
  flex: 0 0 auto;
  min-height: 42px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  padding: 0 15px;
  white-space: nowrap;
}

.category-button:hover,
.category-button.active {
  border-color: rgba(18, 140, 85, 0.28);
  background: var(--green);
  color: white;
}

.content-grid {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  padding-bottom: 44px;
}

.sidebar {
  position: sticky;
  top: 18px;
  border-radius: 8px;
  padding: 18px;
}

.filter-block + .filter-block {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.filter-block p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.55;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-heading h2 {
  margin-bottom: 0;
  font-size: 1.55rem;
}

#resultLabel {
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 700;
}

.group-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.group-card {
  display: grid;
  min-height: 238px;
  border: 1px solid rgba(20, 34, 27, 0.08);
  border-radius: 8px;
  background: var(--surface);
  padding: 18px;
  box-shadow: 0 12px 28px rgba(22, 39, 31, 0.07);
}

.group-top {
  display: flex;
  align-items: start;
  gap: 12px;
}

.group-avatar {
  flex: 0 0 auto;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 8px;
  background: var(--mint);
  color: var(--green-dark);
  font-weight: 800;
}

.group-card:nth-child(3n + 2) .group-avatar {
  background: #e8e8ff;
  color: var(--indigo);
}

.group-card:nth-child(3n) .group-avatar {
  background: #fff0d4;
  color: #9a5a00;
}

.group-card h3 {
  margin: 0 0 6px;
  font-size: 1.04rem;
}

.group-meta {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.group-description {
  margin: 16px 0;
  color: var(--muted);
  line-height: 1.55;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.tag {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  background: #f1f4f2;
  color: var(--muted);
  padding: 0 9px;
  font-size: 0.8rem;
  font-weight: 700;
}

.group-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}

.status {
  color: var(--green-dark);
  font-size: 0.86rem;
  font-weight: 800;
}

.join-link {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  padding: 0 14px;
  font-size: 0.9rem;
  font-weight: 800;
}

.join-link:hover {
  background: var(--green-dark);
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
  padding: 22px 0 32px;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 860px) {
  .content-grid,
  .group-list {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

}

@media (max-width: 620px) {
  .site-header,
  main,
  .site-footer {
    width: min(100% - 22px, 1120px);
  }

  .site-footer,
  .section-heading {
    align-items: start;
    flex-direction: column;
  }

  .site-header {
    align-items: center;
  }

  .group-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .join-link {
    width: 100%;
  }
}
