:root {
  --mxm-black-blue: #000c17;
  --mxm-blue: #092947;
  --mxm-blue-wm: #03629c;
  --mxm-blue-soft: #e7ebff;
  --mxm-blue-hover: #e2e9ed;
  --gray-plus-3: #6a6c72;
  --gray-plus-2: #8c9aa9;
  --gray-plus-1: #a5a8b0;
  --gray: #dfdfdf;
  --gray-minus-1: #f0efed;
  --gray-minus-2: #f5f5f5;
  --white: #ffffff;
  --radius-input: 6px;
  --radius-card: 10px;
  --radius-pill: 35px;
  --shadow-card: 0 1px 4px rgba(0, 12, 23, 0.06);
  --shadow-button: 0 2px 6px rgba(3, 98, 156, 0.2);
  --shadow-button-hover: 0 4px 12px rgba(3, 98, 156, 0.3);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 14px;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Poppins", system-ui, -apple-system, sans-serif;
  color: var(--gray-plus-3);
  background: var(--gray-minus-2);
}

button,
input {
  font: inherit;
}

.page-shell {
  min-height: 100vh;
}

.content {
  width: min(1280px, calc(100% - 48px));
  margin: 0 auto;
}

.content {
  padding: 2rem 0;
}

.page-header {
  margin-bottom: 1.5rem;
}

.page-title {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  color: var(--mxm-black-blue);
}

.catalog {
  display: grid;
  gap: 1.5rem;
}

.category {
  padding: 20px;
  border: 1px solid var(--gray-minus-1);
  border-radius: var(--radius-card);
  background: var(--white);
  box-shadow: var(--shadow-card);
}

.category__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.category__title {
  margin: 4px 0 0;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 600;
  color: var(--mxm-black-blue);
}

.category__count {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 3px 10px;
  border: 1px solid rgba(3, 98, 156, 0.16);
  border-radius: 999px;
  background: rgba(3, 98, 156, 0.08);
  color: var(--mxm-blue-wm);
  font-size: 12px;
  font-weight: 600;
}

.category__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 260px));
  gap: 18px;
  align-items: start;
  justify-content: start;
}

.app-card__link {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--gray-minus-1);
  border-radius: var(--radius-card);
  text-decoration: none;
  color: inherit;
  background: var(--white);
  box-shadow: var(--shadow-card);
  transition:
    background-color 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.app-card__link:hover,
.app-card__link:focus-visible {
  border-color: rgba(3, 98, 156, 0.25);
  background: #fbfcfe;
  box-shadow: 0 4px 12px rgba(0, 12, 23, 0.08);
}

.app-card__link:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(3, 98, 156, 0.15);
}

.app-card__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--mxm-blue-wm);
  background: rgba(3, 98, 156, 0.08);
  overflow: hidden;
}

.app-card__icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.app-card__body {
  display: grid;
  gap: 4px;
}

.app-card__title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--mxm-black-blue);
}

.app-card__description {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--gray-plus-3);
}

.app-card__footer {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  flex-direction: column;
  gap: 8px;
  padding-top: 4px;
}

.app-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--gray-plus-2);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}

.app-card__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  height: 36px;
  padding: 0 16px;
  border-radius: var(--radius-pill);
  background: var(--mxm-blue-wm);
  color: var(--white);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-button);
  transition: box-shadow 180ms ease, background-color 180ms ease;
}

.app-card__link:hover .app-card__cta,
.app-card__link:focus-visible .app-card__cta {
  background: var(--mxm-blue);
  box-shadow: var(--shadow-button-hover);
}

.status-card {
  padding: 24px;
  border: 1px solid var(--gray-minus-1);
  border-radius: var(--radius-card);
  background: var(--white);
  color: var(--gray-plus-3);
  box-shadow: var(--shadow-card);
}

.status-card strong {
  display: block;
  margin-bottom: 8px;
  color: var(--mxm-black-blue);
}

@media (prefers-color-scheme: dark) {
  :root {
    --mxm-black-blue: #f3f7fb;
    --mxm-blue: #111821;
    --mxm-blue-wm: #4da3dc;
    --mxm-blue-soft: #16324b;
    --mxm-blue-hover: #1b2733;
    --gray-plus-3: #c6d0da;
    --gray-plus-2: #96a5b5;
    --gray-plus-1: #788696;
    --gray: #2e3945;
    --gray-minus-1: #24303b;
    --gray-minus-2: #111821;
    --white: #17212b;
    --shadow-card: 0 1px 4px rgba(0, 0, 0, 0.28);
    --shadow-button: 0 2px 6px rgba(77, 163, 220, 0.24);
    --shadow-button-hover: 0 4px 12px rgba(77, 163, 220, 0.34);
    color-scheme: dark;
  }

  body {
    background: var(--gray-minus-2);
  }

  .category__count {
    border-color: rgba(77, 163, 220, 0.2);
    background: rgba(77, 163, 220, 0.12);
    color: var(--mxm-blue-wm);
  }

  .app-card__link:hover,
  .app-card__link:focus-visible {
    border-color: rgba(77, 163, 220, 0.35);
    background: #1a2530;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  }

  .app-card__icon {
    background: rgba(77, 163, 220, 0.14);
    color: var(--mxm-blue-wm);
  }

  .app-card__link:focus-visible {
    box-shadow: 0 0 0 2px rgba(77, 163, 220, 0.2);
  }

  .app-card__link:hover .app-card__cta,
  .app-card__link:focus-visible .app-card__cta {
    background: #2e77a8;
  }
}

@media (max-width: 640px) {
  .content {
    width: min(100% - 24px, 1280px);
    padding: 1rem 0;
  }

  .category {
    padding: 16px;
  }

  .category__header,
  .app-card__footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .category__title {
    font-size: 20px;
  }

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

  .app-card__link {
    padding: 16px;
  }

  .app-card__cta {
    width: 100%;
  }
}
