:root {
  color-scheme: light;
  --ink: #1f2328;
  --muted: #626a73;
  --line: #d8dee4;
  --panel: #ffffff;
  --bg: #f6f8fa;
  --blue: #0969da;
  --green: #1a7f37;
  --amber: #9a6700;
  --red: #cf222e;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
}

a {
  color: var(--blue);
}

.wrap {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

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

.hero {
  padding: 44px 0 28px;
}

.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(2.1rem, 5vw, 4.8rem);
  line-height: 1;
  letter-spacing: 0;
}

.hero p {
  max-width: 780px;
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 0 0 18px;
}

.stat {
  min-height: 86px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.stat strong {
  display: block;
  font-size: 1.6rem;
  line-height: 1.1;
}

.stat span {
  color: var(--muted);
  font-size: .9rem;
}

.toolbar {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 12px 0;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filters button {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
}

.filters button[aria-pressed="true"] {
  border-color: var(--blue);
  color: var(--blue);
  background: #ddf4ff;
}

main {
  padding: 24px 0 54px;
}

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

.section-head h2 {
  margin: 0;
  font-size: 1.35rem;
}

.section-head p {
  margin: 0;
  color: var(--muted);
}

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

.work-card {
  display: grid;
  grid-template-rows: 180px 1fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.work-thumb {
  display: grid;
  place-items: center;
  padding: 16px;
  color: var(--muted);
  background:
    linear-gradient(135deg, rgba(9, 105, 218, .11), rgba(26, 127, 55, .08)),
    #eef2f7;
  font-weight: 700;
}

.work-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.work-body {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.work-meta {
  color: var(--muted);
  font-size: .86rem;
}

.work-body h3 {
  margin: 0;
  font-size: 1.12rem;
}

.work-body p {
  margin: 0;
  color: var(--muted);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 26px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef2f7;
  color: var(--muted);
  font-size: .8rem;
}

.work-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.work-actions a,
.local-note {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #fff;
  text-decoration: none;
  font-size: .88rem;
}

.local-note {
  color: var(--amber);
  background: #fff8c5;
}

.empty-state {
  padding: 32px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  text-align: center;
}

.architecture {
  margin-top: 34px;
}

.architecture-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.arch-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.arch-card h3 {
  margin: 0 0 8px;
}

.arch-card p {
  margin: 0;
  color: var(--muted);
}

.site-footer {
  padding: 22px 0;
  border-top: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: .9rem;
}

@media (max-width: 900px) {
  .stats,
  .works-grid,
  .architecture-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .wrap {
    width: min(100% - 20px, 1180px);
  }

  .hero {
    padding: 32px 0 22px;
  }

  .stats,
  .works-grid,
  .architecture-grid {
    grid-template-columns: 1fr;
  }

  .section-head {
    align-items: start;
    flex-direction: column;
  }
}
