:root {
  color-scheme: light;
  --page: #f6f8f7;
  --surface: #ffffff;
  --ink: #20302d;
  --muted: #62736f;
  --line: #dce5e1;
  --green: #1f705b;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 280px;
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

.container {
  width: min(1120px, calc(100% - 48px));
  margin-inline: auto;
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.site-header__inner {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.wordmark {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 11px;
  font-size: 17px;
  font-weight: 700;
  text-decoration: none;
}

.wordmark__symbol {
  display: grid;
  width: 24px;
  height: 24px;
  grid-template-columns: repeat(2, 10px);
  grid-template-rows: repeat(2, 10px);
  gap: 3px;
}

.wordmark__symbol span {
  border-radius: 2px;
  background: var(--green);
}

.wordmark__symbol span:nth-child(2) {
  background: #d4644b;
}

.wordmark__symbol span:nth-child(3) {
  background: #a4b8a7;
}

.wordmark__symbol span:nth-child(4) {
  background: #8064ae;
}

.site-header__count {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.site-main {
  padding-block: 68px 104px;
}

.page-heading {
  padding-bottom: 48px;
}

.page-heading__label {
  margin: 0 0 12px;
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: 44px;
  font-weight: 700;
  line-height: 1.18;
}

.catalog__heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.catalog__heading h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 650;
  line-height: 1.4;
}

.catalog__heading span {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.tool-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  text-decoration: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.tool-card:hover {
  transform: translateY(-3px);
  border-color: #b9cac2;
  box-shadow: 0 14px 32px rgba(31, 58, 49, 0.09);
}

.tool-card:focus-visible,
.wordmark:focus-visible {
  outline: 3px solid #317e69;
  outline-offset: 4px;
}

.tool-card__preview {
  display: flex;
  height: 328px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 18px 24px;
}

.tool-card__preview--poetry {
  background: #e7f0ea;
  color: #225a4c;
}

.tool-card__preview--craft {
  background: #efebf8;
  color: #694fa3;
}

.tool-card__preview--default {
  background: #e9edf0;
  color: #415a68;
}

.tool-card__image {
  display: block;
  width: auto;
  max-width: 100%;
  height: 100%;
  object-fit: contain;
  border: 1px solid rgba(28, 44, 41, 0.1);
  border-radius: 6px;
  box-shadow: 0 10px 24px rgba(26, 43, 37, 0.12);
}

.tool-card__placeholder {
  display: flex;
  max-width: 100%;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.tool-card__placeholder-mark {
  display: grid;
  width: 78px;
  height: 78px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 8px;
  font-size: 26px;
  font-weight: 700;
}

.tool-card__placeholder-name {
  max-width: 100%;
  font-size: 17px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.tool-card__content {
  display: flex;
  min-height: 225px;
  flex: 1;
  flex-direction: column;
  padding: 25px 28px 28px;
}

.tool-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tool-card__category {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.tool-card__external {
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
}

.tool-card__title {
  margin: 13px 0 8px;
  font-size: 23px;
  font-weight: 700;
  line-height: 1.35;
}

.tool-card__description {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.tool-card__action {
  margin-top: auto;
  padding-top: 22px;
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
}

.tool-card:hover .tool-card__action {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.catalog__empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 28px 0;
  color: var(--muted);
}

@media (max-width: 720px) {
  .container {
    width: min(100% - 32px, 540px);
  }

  .site-header__inner {
    min-height: 64px;
  }

  .site-main {
    padding-block: 48px 72px;
  }

  .page-heading {
    padding-bottom: 40px;
  }

  h1 {
    font-size: 36px;
  }

  .tool-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  .tool-card__preview {
    height: 292px;
  }

  .tool-card__content {
    min-height: 210px;
    padding: 22px 23px 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tool-card {
    transition: none;
  }

  .tool-card:hover {
    transform: none;
  }
}
