:root {
  color-scheme: light;
  --paper: #faf9f6;
  --surface: #fffefa;
  --surface-soft: #f3f1ed;
  --ink: #1d1d1b;
  --muted: #65635e;
  --line: #e4e1db;
  --accent: #d97757;
  --accent-dark: #ad5237;
  --max-width: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}

body.home-page,
body.community-page {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.75 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

body.profile-page {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.85 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

.profile-page a {
  color: var(--accent-dark);
}

.profile-page nav {
  border-bottom-color: var(--line);
}

.profile-page header .eyebrow {
  color: var(--muted);
}

.profile-page h1,
.profile-page h2,
.profile-page h3 {
  color: var(--ink);
}

.profile-page main {
  background: var(--surface);
  border-color: var(--line);
}

.profile-page h2,
.profile-page .bio-table td,
.profile-page .bio-table th {
  border-color: var(--line);
}

.profile-page code {
  background: var(--surface-soft);
  color: var(--ink);
}

.profile-page footer {
  color: var(--muted);
}

.home-page a,
.community-page a {
  color: inherit;
  text-decoration-color: var(--accent);
  text-underline-offset: 4px;
}

.home-page a:hover,
.community-page a:hover {
  color: var(--accent-dark);
}

.home-page .skip,
.community-page .skip {
  position: absolute;
  left: -999px;
  z-index: 10;
  background: var(--surface);
  padding: 8px 12px;
}

.home-page .skip:focus,
.community-page .skip:focus {
  left: 12px;
  top: 12px;
}

.home-page main,
.community-page main {
  width: min(100% - 48px, var(--max-width));
  margin: 0 auto;
  padding: 0 0 80px;
}

.home-page .hero,
.community-page .hero {
  position: relative;
  display: grid;
  align-items: center;
  gap: clamp(32px, 7vw, 88px);
  padding: clamp(64px, 10vw, 128px) 0 76px;
  border-bottom: 1px solid var(--line);
}

.home-page .hero {
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr);
}

.community-page .hero {
  grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.1fr);
}

.home-page .hero:before,
.community-page .hero:before {
  display: none;
}

.home-page .eyebrow,
.community-page .eyebrow,
.home-page .tag,
.community-page .tag {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.home-page .eyebrow,
.community-page .eyebrow {
  margin: 0 0 20px;
}

.home-page h1,
.community-page h1 {
  max-width: 760px;
  margin: 0 0 22px;
  font-size: clamp(2.6rem, 6vw, 5rem);
  font-weight: 600;
  letter-spacing: -0.055em;
  line-height: 1.08;
}

.home-page .lead,
.community-page .lead {
  max-width: 660px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  line-height: 1.8;
}

.home-page .hero-mark,
.community-page .plan-logo {
  display: block;
  width: min(100%, 470px);
  height: auto;
  margin: 0 auto;
}

.home-page .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: center;
  margin-top: 30px;
}

.home-page .btn,
.community-page .btn {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 10px 19px;
  border: 1px solid var(--ink);
  border-radius: 3px;
  background: var(--ink);
  color: var(--surface);
  font-weight: 600;
  text-decoration: none;
}

.home-page .btn:hover,
.community-page .btn:hover {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
  color: #fff;
}

.home-page .btn.secondary,
.community-page .btn.secondary {
  background: transparent;
  color: var(--ink);
}

.home-page .projects,
.community-page .projects,
.community-page .block {
  margin-top: 64px;
  padding: clamp(24px, 4vw, 42px);
  border: 1px solid var(--line);
  background: var(--surface);
}

.home-page .projects h2,
.community-page .projects h2,
.community-page .block h2 {
  margin: 0 0 14px;
  color: var(--ink);
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.035em;
}

.home-page .projects-intro,
.community-page .projects-intro,
.community-page .block > p {
  max-width: 760px;
  color: var(--muted);
}

.home-page .project-card,
.community-page .project-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px 36px;
  align-items: center;
  margin-top: 28px;
  padding: 24px 0 4px;
  border-top: 1px solid var(--line);
}

.home-page .project-card + .project-card,
.community-page .project-card + .project-card {
  margin-top: 8px;
}

.home-page .project-card h3,
.community-page .project-card h3 {
  margin: 5px 0 8px;
  color: var(--ink);
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -0.035em;
}

.home-page .project-card p,
.community-page .project-card p {
  max-width: 670px;
  margin: 0;
  color: var(--muted);
}

.home-page .project-label,
.community-page .project-label {
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-page .project-link,
.community-page .project-link {
  font-weight: 600;
  white-space: nowrap;
}

.home-page .plan-link {
  display: inline-block;
  margin-top: 26px;
  font-weight: 600;
}

.community-page .badge {
  display: inline-block;
  margin-top: 22px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

.community-page .block {
  position: relative;
}

.community-page .block:before {
  display: none;
}

.community-page .block h3 {
  margin: 24px 0 8px;
  color: var(--ink);
  font-size: 1.1rem;
}

.community-page .roles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.community-page .roles li,
.community-page .review-points article {
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--muted);
}

.community-page .roles b,
.community-page .review-points b {
  display: block;
  margin-bottom: 5px;
  color: var(--ink);
}

.community-page .flow-figure {
  margin: 28px 0;
  padding: clamp(18px, 3vw, 30px);
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.community-page .review-flow {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.community-page .review-flow li {
  min-height: 145px;
  padding: 15px 13px;
  border-top: 3px solid var(--accent);
  background: var(--surface);
}

.community-page .review-flow .step-number {
  display: block;
  margin-bottom: 18px;
  color: var(--accent-dark);
  font-size: 0.75rem;
  font-weight: 700;
}

.community-page .review-flow b {
  display: block;
  color: var(--ink);
  line-height: 1.4;
}

.community-page .review-flow small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.5;
}

.community-page .flow-figure figcaption,
.community-page .source {
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.9rem;
}

.community-page .review-points {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.community-page .quote {
  margin: 20px 0;
  padding: 16px 20px;
  border-left: 3px solid var(--accent);
  background: var(--surface-soft);
  color: var(--muted);
}

.community-page .flow {
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: f;
}

.community-page .flow li {
  counter-increment: f;
  position: relative;
  margin: 0 0 0 15px;
  padding: 10px 0 18px 44px;
  border-left: 2px solid var(--line);
  color: var(--muted);
}

.community-page .flow li:last-child {
  border-left-color: transparent;
}

.community-page .flow li::before {
  content: counter(f);
  position: absolute;
  left: -16px;
  top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--surface);
  font-size: 0.9rem;
  font-weight: 600;
}

.community-page .flow b {
  color: var(--ink);
}

.community-page .tag-h {
  display: inline-block;
  margin-right: 6px;
  padding: 2px 8px;
  background: var(--surface-soft);
  color: var(--accent-dark);
  font-size: 0.78rem;
}

.community-page .open {
  color: var(--muted);
}

.community-page footer {
  display: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

@media (max-width: 820px) {
  .home-page .hero,
  .community-page .hero {
    grid-template-columns: 1fr;
  }

  .home-page .hero-mark,
  .community-page .plan-logo {
    width: min(100%, 360px);
  }

  .community-page .review-flow {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .home-page main,
  .community-page main {
    width: min(100% - 32px, var(--max-width));
    padding-bottom: 48px;
  }

  .home-page .hero,
  .community-page .hero {
    gap: 28px;
    padding: 56px 0 48px;
  }

  .home-page h1,
  .community-page h1 {
    font-size: clamp(2.45rem, 13vw, 3.4rem);
  }

  .home-page .project-card,
  .community-page .project-card {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .home-page .project-link,
  .community-page .project-link {
    justify-self: start;
  }

  .home-page .projects,
  .community-page .projects,
  .community-page .block {
    margin-top: 34px;
    padding: 22px;
  }

  .community-page .review-flow,
  .community-page .review-points {
    grid-template-columns: 1fr;
  }

  .community-page .review-flow li {
    min-height: 0;
  }

  .community-page .review-flow .step-number {
    margin-bottom: 8px;
  }
}

.site-footer {
  width: min(100% - 48px, var(--max-width));
  margin: 56px auto 0;
  padding: 24px 0 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}

.site-footer a {
  color: var(--ink);
  text-decoration-color: var(--line);
  text-underline-offset: 4px;
}

.site-footer a:hover {
  color: var(--accent-dark);
  text-decoration-color: var(--accent-dark);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
