:root {
  color-scheme: light;
  --bg: #f8fafc;
  --panel: #ffffff;
  --text: #172033;
  --muted: #5e6b80;
  --line: #e3e8f0;
  --tag: #f0f2f5;
  --primary: #3858f6;
  --shadow: 0 16px 36px rgba(31, 41, 55, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 18% 18%, rgba(56, 88, 246, 0.08), transparent 26rem),
    radial-gradient(circle at 86% 72%, rgba(29, 185, 129, 0.06), transparent 24rem),
    var(--bg);
}

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

.site-header {
  height: 82px;
  padding: 0 clamp(20px, 5vw, 64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(16px);
}

.brand,
.github-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
}

.brand {
  font-size: 21px;
}

.brand-icon {
  color: var(--primary);
  font-size: 30px;
  line-height: 1;
  letter-spacing: 0;
}

.header-links {
  display: inline-flex;
  align-items: center;
  gap: 22px;
}

.header-link {
  color: #253146;
  font-size: 17px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.header-link img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex: 0 0 auto;
}

main {
  width: min(1380px, calc(100% - 48px));
  margin: 0 auto;
}

.hero {
  padding: 42px 0 32px;
  text-align: center;
}

.hero h1 {
  margin: 0;
  font-size: clamp(38px, 5vw, 56px);
  line-height: 1.16;
  letter-spacing: 0;
}

.hero h1 span {
  color: var(--primary);
}

.hero p {
  margin: 18px auto 28px;
  max-width: 760px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

.filters {
  display: flex;
  justify-content: center;
  gap: 10px;
  overflow-x: auto;
  padding: 0 0 2px;
  scrollbar-width: none;
}

.filters::-webkit-scrollbar {
  display: none;
}

.filter-button {
  border: 1px solid #d8dee8;
  border-radius: 999px;
  padding: 10px 22px;
  color: #536176;
  background: rgba(255, 255, 255, 0.75);
  font: inherit;
  font-size: 16px;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: 0.18s ease;
}

.filter-button:hover,
.filter-button:focus-visible {
  border-color: rgba(56, 88, 246, 0.45);
  color: var(--primary);
  outline: none;
}

.filter-button.is-active {
  border-color: var(--primary);
  color: #fff;
  background: var(--primary);
  box-shadow: 0 10px 22px rgba(56, 88, 246, 0.28);
}

.templates {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px 26px;
}

.template-card {
  min-height: 264px;
  padding: 28px 26px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.template-card:hover {
  transform: translateY(-3px);
  border-color: rgba(56, 88, 246, 0.24);
  box-shadow: 0 20px 44px rgba(31, 41, 55, 0.12);
}

.card-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  align-items: center;
}

.logo {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  overflow: hidden;
  flex: 0 0 auto;
}

.logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.logo.image-logo {
  padding: 3px;
  background: transparent;
}

.logo.vui-logo {
  width: 58px;
  height: 58px;
  margin: -6px;
  padding: 0;
  border-radius: 0;
  overflow: visible;
}

.logo.ts {
  color: #fff;
  background: linear-gradient(135deg, #1d6df0, #4668f4);
  font-weight: 800;
  font-size: 22px;
}

.logo.js {
  align-items: end;
  justify-items: end;
  padding: 6px;
  color: #111827;
  background: #ffd316;
  font-weight: 900;
  font-size: 23px;
}

.logo.vue {
  position: relative;
  background: transparent;
}

.logo.vue::before {
  content: "";
  width: 44px;
  height: 39px;
  background: linear-gradient(120deg, #41b883 0 36%, #35495e 36% 64%, #41b883 64%);
  clip-path: polygon(0 0, 50% 100%, 100% 0, 74% 0, 50% 48%, 26% 0);
}

.logo.react {
  color: #18bdf3;
  background: transparent;
}

.logo.react svg {
  width: 48px;
  height: 48px;
  stroke: currentColor;
  fill: none;
}

.template-title {
  min-width: 0;
  margin: 0;
  font-size: 21px;
  line-height: 1.25;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.open-link {
  width: 24px;
  height: 24px;
  color: #526173;
}

.open-link svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.repo-links {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.repo-link {
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  border-radius: 6px;
  transition: 0.18s ease;
}

.repo-link:hover,
.repo-link:focus-visible {
  background: #f0f4ff;
  outline: none;
  transform: translateY(-1px);
}

.repo-link img {
  width: 21px;
  height: 21px;
  object-fit: contain;
}

.template-desc {
  margin: 22px 0 18px;
  min-height: 58px;
  color: #445168;
  font-size: 16px;
  line-height: 1.65;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
}

.tag-list li {
  max-width: 100%;
  padding: 6px 12px;
  border-radius: 6px;
  color: #4f5c70;
  background: var(--tag);
  font-size: 14px;
  line-height: 1;
  overflow-wrap: anywhere;
}

.meta {
  display: flex;
  align-items: center;
  gap: 28px;
  color: #4f5c70;
  font-size: 15px;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--dot, #3858f6);
}

.meta svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: #46546a;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.friend-links {
  width: min(1380px, calc(100% - 48px));
  margin: 36px auto 0;
}

.friend-links-inner {
  padding: 24px 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
}

.friend-links h2 {
  margin: 0 0 18px;
  font-size: 18px;
  line-height: 1.3;
}

.friend-links-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.friend-link {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid #dfe5ee;
  border-radius: 999px;
  color: #536176;
  background: #fff;
  font-size: 14px;
  line-height: 1;
  transition: 0.18s ease;
}

.friend-link:hover,
.friend-link:focus-visible {
  border-color: rgba(56, 88, 246, 0.42);
  color: var(--primary);
  outline: none;
  transform: translateY(-1px);
}

.friend-link img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex: 0 0 auto;
}

.site-footer {
  padding: 52px 20px 30px;
  color: #59677b;
  text-align: center;
  font-size: 16px;
}

.site-footer p {
  margin: 0 0 16px;
}

@media (max-width: 1100px) {
  .templates {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .site-header {
    height: 66px;
    padding: 0 18px;
  }

  .brand {
    font-size: 18px;
    gap: 9px;
  }

  .brand-icon {
    font-size: 24px;
  }

  .header-links {
    gap: 12px;
  }

  .header-link span {
    display: none;
  }

  main {
    width: min(100% - 28px, 560px);
  }

  .hero {
    padding: 34px 0 24px;
  }

  .hero p {
    margin-top: 14px;
    font-size: 15px;
  }

  .filters {
    justify-content: flex-start;
    margin: 0 -14px;
    padding: 0 14px 4px;
  }

  .filter-button {
    padding: 9px 18px;
    font-size: 14px;
  }

  .templates {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .template-card {
    min-height: 0;
    padding: 22px 20px;
  }

  .card-head {
    grid-template-columns: auto 1fr;
    gap: 14px;
  }

  .repo-links {
    grid-column: 2;
    justify-self: start;
  }

  .template-title {
    font-size: 19px;
  }

  .template-desc {
    min-height: 0;
    margin: 18px 0 16px;
    font-size: 15px;
  }

  .meta {
    gap: 20px;
    flex-wrap: wrap;
  }

  .friend-links {
    width: min(100% - 28px, 560px);
    margin-top: 28px;
  }

  .friend-links-inner {
    padding: 20px;
  }

  .friend-links-list {
    gap: 10px;
  }

  .friend-link {
    max-width: 100%;
  }

  .site-footer {
    padding-top: 36px;
    font-size: 14px;
  }
}
