:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-solid: #ffffff;
  --text: #1d231f;
  --muted: #5f6a63;
  --line: rgba(29, 35, 31, 0.09);
  --accent: #4f8a65;
  --accent-strong: #356b4b;
  --accent-soft: #e9f2ec;
  --shadow: 0 18px 55px rgba(31, 48, 37, 0.08);
  --radius-lg: 24px;
  --radius-md: 17px;
  --radius-sm: 11px;
  --shell: 1120px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111512;
  --surface: rgba(27, 33, 29, 0.82);
  --surface-solid: #1a201c;
  --text: #edf2ee;
  --muted: #9da79f;
  --line: rgba(236, 243, 238, 0.09);
  --accent: #79b28c;
  --accent-strong: #a5d2b4;
  --accent-soft: #20352a;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 12% 3%, rgba(79,138,101,.10), transparent 30%),
    radial-gradient(circle at 90% 18%, rgba(79,138,101,.06), transparent 26%),
    var(--bg);
  color: var(--text);
  line-height: 1.68;
}

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

.shell {
  width: min(calc(100% - 40px), var(--shell));
  margin-inline: auto;
}

.site-header {
  width: min(calc(100% - 40px), var(--shell));
  min-height: 72px;
  margin: 12px auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 10px;
  z-index: 20;
  padding: 10px 12px 10px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 750;
  letter-spacing: -.01em;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
}

.nav {
  display: flex;
  gap: 8px;
  align-items: center;
}

.nav > a:not(.compact-button) {
  color: var(--muted);
  padding: 7px 9px;
  border-radius: 9px;
  font-size: 14px;
}

.nav > a:not(.compact-button):hover { color: var(--text); background: var(--surface); }

.compact-button, .primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  transition: transform .18s ease, background .18s ease;
}

.compact-button {
  padding: 7px 11px;
  background: var(--text);
  color: var(--bg);
  font-size: 13px;
  font-weight: 700;
}

.primary-button {
  padding: 10px 15px;
  background: var(--accent);
  color: white;
  font-size: 14px;
  font-weight: 750;
}

.compact-button:hover, .primary-button:hover { transform: translateY(-1px); }

.icon-button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, .75fr);
  gap: 42px;
  align-items: center;
  padding-top: 104px;
  padding-bottom: 84px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .15em;
}

.hero h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(42px, 6.5vw, 76px);
  line-height: 1.08;
  letter-spacing: -.055em;
  font-weight: 820;
}

.hero-intro {
  max-width: 700px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: clamp(16px, 2vw, 19px);
}

.hero-actions {
  margin-top: 28px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.text-link {
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.text-link:hover { color: var(--text); }

.hero-card {
  padding: 23px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.avatar {
  width: 66px;
  height: 66px;
  border-radius: 18px;
  object-fit: cover;
  display: block;
  margin-bottom: 15px;
}

.hero-identity strong { font-size: 18px; }
.hero-identity p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }

.hero-stats {
  margin: 20px 0 0;
  display: grid;
  gap: 10px;
}

.hero-stats > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--accent-soft);
}

.hero-stats dt { color: var(--muted); font-size: 12px; }
.hero-stats dd { margin: 0; font-size: 13px; font-weight: 750; }

.section { padding: 68px 0; }

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

.section h2 {
  margin: 0;
  font-size: clamp(29px, 4vw, 42px);
  line-height: 1.15;
  letter-spacing: -.035em;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.filter {
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
}

.filter:hover, .filter.is-active {
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 48%, var(--line));
  background: var(--accent-soft);
}

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

.project-card {
  min-height: 390px;
  display: flex;
  flex-direction: column;
  padding: 25px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(31, 48, 37, 0.035);
  transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
}

.project-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.project-card.featured {
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--accent-soft) 82%, var(--surface-solid)), var(--surface-solid));
}

.project-card.is-hidden { display: none; }

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

.project-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 850;
  overflow: hidden;
}

.project-icon svg {
  width: 22px;
  height: 22px;
  display: block;
}

.project-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.project-meta span, .version {
  padding: 4px 7px;
  border-radius: 7px;
  background: var(--bg);
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.project-card h3 {
  margin: 0 0 10px;
  font-size: 23px;
  letter-spacing: -.025em;
}

.project-summary {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.project-points {
  margin: 18px 0 24px;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
}

.project-points li + li { margin-top: 5px; }

.project-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.project-footer-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.downloads {
  padding: 4px 7px;
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 650;
}

.project-footer a {
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 780;
}

.about {
  display: grid;
  grid-template-columns: .75fr 1.25fr;
  gap: 60px;
  align-items: start;
}

.about-copy {
  color: var(--muted);
  font-size: 17px;
}

.about-copy p { margin: 0; }
.about-copy p + p { margin-top: 15px; }

.site-footer {
  padding: 34px 0 45px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 820px) {
  .site-header { width: min(calc(100% - 24px), var(--shell)); }
  .nav > a:not(.compact-button) { display: none; }
  .shell { width: min(calc(100% - 28px), var(--shell)); }
  .hero {
    grid-template-columns: 1fr;
    padding-top: 72px;
    padding-bottom: 50px;
  }
  .hero-card { max-width: 420px; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .filters { justify-content: flex-start; }
  .project-grid { grid-template-columns: 1fr; }
  .about { grid-template-columns: 1fr; gap: 24px; }
  .site-footer { flex-direction: column; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 43px; }
  .hero { padding-top: 58px; }
  .project-card { min-height: 0; padding: 21px; }
  .hero-card { padding: 20px; }
  .compact-button { display: none; }
}
