:root {
  color-scheme: light;
  --paper: #f3f0e8;
  --surface: #e5ded1;
  --ink: #171714;
  --inverse: #faf8f2;
  --muted: #69675f;
  --hairline: rgba(23, 23, 20, 0.32);
  --accent: #315c4c;
  --max: 1280px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --section: clamp(4rem, 9vw, 8rem);
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --display: "Arial Black", "Helvetica Neue", Arial, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 180ms ease, background-color 180ms ease,
    border-color 180ms ease, opacity 180ms ease;
}

a:hover {
  color: var(--accent);
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

.site-header,
main,
.footer-inner {
  width: min(var(--max), 100%);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.site-header {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.brand,
.footer-brand strong {
  font-family: var(--display);
  font-weight: 900;
  letter-spacing: -0.04em;
  font-synthesis: none;
}

.brand {
  font-size: 1.25rem;
}

nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.nav-github {
  padding: 0.45rem 0.75rem;
  border-radius: 6px;
  color: var(--inverse);
  background: var(--ink);
}

.nav-github:hover {
  color: var(--inverse);
  opacity: 0.88;
}

.lang-toggle {
  min-height: 36px;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--ink);
  border-radius: 6px;
  color: var(--ink);
  background: transparent;
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: color 180ms ease, background-color 180ms ease;
}

.lang-toggle:hover {
  color: var(--inverse);
  background: var(--ink);
}

.hero {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: 2rem;
  align-items: start;
  padding-block: var(--section);
}

.hero-title {
  max-width: 14ch;
}

.hero h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(3.6rem, 8vw, 7.5rem);
  font-weight: 900;
  letter-spacing: -0.065em;
  line-height: 0.94;
}

.accent {
  display: inline;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.12em;
}

.hero-details {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding-top: 1rem;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: clamp(0.72rem, 1vw, 0.85rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lede {
  max-width: 32ch;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.2rem, 2vw, 1.65rem);
  line-height: 1.42;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.5rem;
  border: 1px solid var(--ink);
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
}

.button.primary {
  color: var(--inverse);
  background: var(--ink);
}

.button.primary:hover {
  color: var(--inverse);
  opacity: 0.88;
}

.button.secondary:hover {
  color: var(--inverse);
  background: var(--ink);
}

.button.inverse {
  color: var(--ink);
  background: var(--paper);
  border-color: var(--paper);
}

.button.inverse:hover {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--surface);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  margin: 1rem 0 0;
  padding: 2rem 0 0;
  border-top: 1px solid var(--hairline);
}

.stats dt,
.project-meta,
.footer-connect span {
  color: var(--muted);
  font-size: clamp(0.72rem, 1vw, 0.85rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stats dd {
  margin: 0.25rem 0 0;
  font-family: var(--serif);
  font-size: 1.125rem;
}

.content-section {
  padding-block: var(--section);
}

.section-intro {
  max-width: 40ch;
  margin-bottom: 3rem;
}

.section-intro h2 {
  margin: 0 0 1rem;
  font-family: var(--display);
  font-size: 2.25rem;
  font-weight: 900;
  letter-spacing: -0.045em;
  line-height: 1;
}

.section-intro p {
  margin: 0;
  color: var(--muted);
  font-family: var(--serif);
  font-size: clamp(1.2rem, 2vw, 1.65rem);
  line-height: 1.42;
}

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

.project-card {
  min-height: 17rem;
  display: flex;
  flex-direction: column;
  padding: 2rem;
  background: var(--surface);
}

.project-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--hairline);
}

.project-card h3 {
  margin: 0 0 0.75rem;
  font-family: var(--display);
  font-size: 1.5rem;
  letter-spacing: -0.035em;
}

.project-card h3 span {
  display: inline-block;
  margin-left: 0.25rem;
  color: var(--accent);
}

.project-card p {
  flex-grow: 1;
  margin: 0;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.4;
}

.principles-layout {
  display: grid;
  grid-template-columns: 4fr 8fr;
  gap: 2rem;
  align-items: start;
}

.principles-intro {
  max-width: 24ch;
  padding-right: 2rem;
}

.principles-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--hairline);
}

.principles-list li {
  display: grid;
  grid-template-columns: 1fr 3fr;
  gap: 2rem;
  align-items: baseline;
  padding-block: 2rem;
  border-bottom: 1px solid var(--hairline);
}

.principle-number {
  font-size: clamp(0.72rem, 1vw, 0.85rem);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.principles-list strong {
  display: block;
  margin-bottom: 0.5rem;
  font-family: var(--display);
  font-size: 1.25rem;
  letter-spacing: -0.025em;
  line-height: 1.3;
}

.principles-list p {
  margin: 0;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.4;
}

.cta-section {
  padding-block: var(--section);
  padding-bottom: 6rem;
}

.cta-card {
  max-width: 1000px;
  margin-inline: auto;
  padding: clamp(3rem, 7vw, 5rem);
  border-radius: 24px;
  color: var(--inverse);
  background: var(--ink);
  text-align: center;
}

.cta-card h2 {
  max-width: 20ch;
  margin: 0 auto 2rem;
  font-family: var(--serif);
  font-size: clamp(2.3rem, 5vw, 4.5rem);
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 1.04;
}

.cta-card p {
  max-width: 50ch;
  margin: 0 auto 2.5rem;
  color: #a09d94;
  font-size: 1.125rem;
  line-height: 1.65;
}

.site-footer {
  width: 100%;
  color: var(--inverse);
  background: var(--ink);
}

.footer-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 3rem;
  padding-block: 4rem;
  border-top: 1px solid #2a2a26;
}

.footer-brand {
  max-width: 30ch;
}

.footer-brand strong {
  display: block;
  margin-bottom: 1rem;
  font-size: 1.25rem;
}

.footer-brand p {
  margin: 0;
  color: #a09d94;
  font-family: var(--serif);
  line-height: 1.5;
}

.footer-connect {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.footer-connect span {
  margin-bottom: 0.25rem;
  color: #a09d94;
}

.footer-connect a:hover {
  color: var(--paper);
}

html[lang="zh-CN"] body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC",
    "Microsoft YaHei", var(--sans);
}

/* Keep the Latin brand mark identical in both languages. */
html[lang="zh-CN"] .brand,
html[lang="zh-CN"] .footer-brand strong {
  font-family: var(--display);
  font-weight: 900;
  letter-spacing: -0.04em;
}

html[lang="zh-CN"] .section-intro h2,
html[lang="zh-CN"] .project-card h3,
html[lang="zh-CN"] .principles-list strong {
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC",
    "Microsoft YaHei", var(--sans);
  font-weight: 800;
  letter-spacing: -0.02em;
}

html[lang="zh-CN"] .lede,
html[lang="zh-CN"] .stats dd,
html[lang="zh-CN"] .section-intro p,
html[lang="zh-CN"] .project-card p,
html[lang="zh-CN"] .principles-list p,
html[lang="zh-CN"] .cta-card h2,
html[lang="zh-CN"] .footer-brand p {
  font-family: "Songti SC", "Noto Serif SC", "STSong", var(--serif);
}

html[lang="zh-CN"] .hero-title {
  max-width: 8.5em;
}

html[lang="zh-CN"] .hero h1 {
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC",
    "Microsoft YaHei", var(--sans);
  font-size: clamp(3rem, 6.4vw, 5.5rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.06;
  word-break: keep-all;
  overflow-wrap: normal;
}

html[lang="zh-CN"] .hero h1 .accent {
  text-underline-offset: 0.18em;
}

html[lang="zh-CN"] .eyebrow,
html[lang="zh-CN"] .stats dt,
html[lang="zh-CN"] .project-meta,
html[lang="zh-CN"] .footer-connect span {
  letter-spacing: 0.04em;
  text-transform: none;
}

@media (max-width: 1023px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .hero-title {
    max-width: 16ch;
  }

  html[lang="zh-CN"] .hero-title {
    max-width: 10em;
  }

  .hero-details {
    padding-top: 0;
  }

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

  .principles-layout {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .principles-intro {
    max-width: 34ch;
    padding-right: 0;
  }
}

@media (max-width: 640px) {
  .site-header {
    height: auto;
    align-items: flex-start;
    flex-direction: column;
    padding-block: 1.25rem;
  }

  nav {
    width: 100%;
    gap: 0.75rem;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .hero h1 {
    font-size: clamp(3rem, 15vw, 5rem);
  }

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

  .project-card {
    min-height: 15rem;
  }

  .principles-list li {
    grid-template-columns: 2.5rem 1fr;
    gap: 1rem;
  }

  .cta-card {
    border-radius: 16px;
  }

  .footer-inner {
    flex-direction: column;
  }
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
