:root {
  --paper: #f1ede2;
  --paper-2: #e9e3d5;
  --ink: #171610;
  --ink-2: #2a2820;
  --muted: #6f6a5e;
  --line: #d5cdbc;
  --accent: #c94d2b;
  --accent-2: #a93a1e;
  --lime: #d8f36a;
  --dark: #171610;
  --white: #fffdf7;
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", "Noto Serif SC", Georgia, serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --max: 1180px;
  --pad: clamp(20px, 4vw, 48px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 12% -10%, rgba(201, 77, 43, 0.08), transparent 30rem),
    radial-gradient(circle at 88% 0%, rgba(216, 243, 106, 0.12), transparent 26rem),
    var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--lime);
  color: var(--ink);
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button,
input {
  font: inherit;
}

.wrap {
  width: min(var(--max), calc(100% - var(--pad) * 2));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 10px;
  z-index: 99;
  background: var(--ink);
  color: var(--paper);
  padding: 8px 14px;
}

.skip-link:focus {
  left: 10px;
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(14px);
}

.header-inner {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: -0.08em;
  transform: translateY(3px);
}

.brand-name {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.brand-sub {
  display: none;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.4vw, 30px);
  font-size: 14px;
}

.site-nav a {
  text-decoration: none;
  color: var(--muted);
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--ink);
}

.site-nav .nav-ext {
  padding: 7px 12px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.02em;
}

/* ---------- shared type ---------- */

.eyebrow {
  margin: 0 0 18px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow .dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: 1px;
}

h1,
h2,
h3,
h4 {
  margin-top: 0;
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.page-title {
  margin-bottom: 20px;
  font-size: clamp(42px, 8vw, 92px);
  line-height: 0.98;
  text-wrap: balance;
}

.lede {
  max-width: 640px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(16px, 2vw, 19px);
  line-height: 1.8;
}

.mono {
  font-family: var(--mono);
}

.label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-decoration: none;
  white-space: nowrap;
}

a.pill:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 10px 20px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font-size: 14px;
  text-decoration: none;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--white);
  transform: translateY(-2px);
}

.btn.secondary {
  background: transparent;
  color: var(--ink);
}

.btn.secondary:hover {
  background: var(--ink);
  color: var(--paper);
}

/* ---------- home ---------- */

.hero {
  padding: clamp(52px, 9vw, 108px) 0 48px;
  border-bottom: 1px solid var(--line);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, 0.65fr);
  gap: clamp(28px, 6vw, 80px);
  align-items: end;
}

.hero h1 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(48px, 8.4vw, 106px);
  line-height: 0.93;
  letter-spacing: -0.065em;
  overflow-wrap: break-word;
}

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

.hero h1 .thin {
  font-weight: 400;
}

.hero .lede {
  margin-top: 30px;
  padding-left: 18px;
  border-left: 2px solid var(--accent);
}

.hero-aside {
  position: relative;
  padding: 24px;
  background: var(--dark);
  color: var(--paper);
  overflow: hidden;
}

.hero-aside::after {
  content: "17";
  position: absolute;
  right: -8px;
  bottom: -42px;
  color: rgba(241, 237, 226, 0.06);
  font-family: var(--serif);
  font-size: 170px;
  line-height: 1;
  pointer-events: none;
}

.hero-aside .label {
  color: var(--lime);
}

.now-list {
  position: relative;
  z-index: 1;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.now-list li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-top: 1px solid rgba(241, 237, 226, 0.16);
  font-size: 13px;
}

.now-list span:last-child {
  color: rgba(241, 237, 226, 0.55);
  font-family: var(--mono);
  font-size: 10px;
  text-align: right;
}

.home-section {
  padding: clamp(48px, 7vw, 86px) 0;
  border-bottom: 1px solid var(--line);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 44px);
}

.section-head a {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  text-decoration: none;
}

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

.featured-post {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  border: 1px solid var(--ink);
  text-decoration: none;
  background: var(--white);
  transition: background 180ms ease;
}

.featured-post:hover {
  color: var(--ink);
  background: var(--paper-2);
}

.featured-copy {
  padding: clamp(26px, 4vw, 52px);
}

.featured-copy h3 {
  max-width: 720px;
  margin: 20px 0;
  font-size: clamp(30px, 4.2vw, 58px);
  line-height: 1.06;
}

.featured-copy p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
}

.featured-visual {
  position: relative;
  min-height: 320px;
  border-left: 1px solid var(--ink);
  background:
    linear-gradient(135deg, transparent 49.5%, rgba(23, 22, 16, 0.22) 50%, transparent 50.5%),
    linear-gradient(45deg, transparent 49.5%, rgba(23, 22, 16, 0.16) 50%, transparent 50.5%),
    var(--lime);
  overflow: hidden;
}

.featured-visual .visual-index {
  position: absolute;
  right: 20px;
  bottom: 12px;
  color: rgba(23, 22, 16, 0.8);
  font-family: var(--serif);
  font-size: clamp(90px, 14vw, 180px);
  line-height: 1;
}

.featured-visual .visual-mark {
  position: absolute;
  top: 22px;
  left: 22px;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  font-family: var(--mono);
  font-size: 11px;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.post-card {
  display: flex;
  flex-direction: column;
  min-height: 300px;
  padding: clamp(22px, 3vw, 34px);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  background: rgba(255, 253, 247, 0.28);
  transition: background 180ms ease;
}

.post-card:hover {
  color: var(--ink);
  background: var(--white);
}

.post-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: auto;
}

.post-card h3 {
  margin: 34px 0 12px;
  font-size: clamp(24px, 2.8vw, 34px);
  line-height: 1.18;
}

.post-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.post-card .card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 26px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
}

.arrow {
  font-size: 18px;
  transition: transform 160ms ease;
}

a:hover .arrow {
  transform: translate(3px, -3px);
}

/* ---------- projects strip ---------- */

.project-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.project-card {
  min-height: 210px;
  padding: 22px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  background: rgba(255, 253, 247, 0.3);
  transition: background 160ms ease;
}

.project-card:hover {
  color: var(--ink);
  background: var(--white);
}

.project-card .label {
  margin-bottom: 38px;
}

.project-card h3 {
  margin: 0 0 7px;
  font-size: 25px;
}

.project-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.project-card .project-url {
  display: inline-block;
  margin-top: 16px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10px;
}

/* ---------- manifest / about ---------- */

.manifest {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid var(--ink);
}

.manifest-intro {
  padding: clamp(26px, 4vw, 48px);
  background: var(--dark);
  color: var(--paper);
}

.manifest-intro h2 {
  margin: 18px 0;
  font-size: clamp(34px, 4vw, 56px);
  color: var(--paper);
}

.manifest-intro p {
  color: rgba(241, 237, 226, 0.62);
}

.manifest-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 0;
  padding: 0;
  list-style: none;
}

.manifest-list li {
  min-height: 150px;
  padding: 24px;
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.manifest-list li:nth-child(odd) {
  border-left: 0;
}

.manifest-list li:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.manifest-list b {
  display: block;
  margin-bottom: 9px;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
}

.manifest-list span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

/* ---------- footer ---------- */

.site-footer {
  padding: 42px 0 54px;
}

.footer-grid {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.footer-brand {
  font-family: var(--serif);
  font-size: 30px;
  letter-spacing: -0.04em;
}

.footer-note {
  max-width: 390px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-family: var(--mono);
  font-size: 10px;
}

.footer-links a {
  text-decoration: none;
  color: var(--muted);
}

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

/* ---------- listing pages ---------- */

.listing-head {
  padding: clamp(48px, 8vw, 92px) 0 36px;
  border-bottom: 1px solid var(--line);
}

.listing-head .page-title {
  max-width: 900px;
}

.listing-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.listing-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 150px;
  gap: 24px;
  align-items: baseline;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}

.listing-row:hover {
  color: var(--ink);
}

.listing-row .num {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
}

.listing-row h2 {
  margin: 0 0 7px;
  font-size: clamp(24px, 3vw, 34px);
}

.listing-row p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.listing-date {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  text-align: right;
}

/* ---------- article ---------- */

.article-head {
  padding: clamp(46px, 7vw, 84px) 0 30px;
  border-bottom: 1px solid var(--line);
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
}

.article-head h1 {
  max-width: 980px;
  margin: 24px 0;
  font-size: clamp(38px, 6vw, 76px);
  line-height: 1.02;
  text-wrap: balance;
}

.article-deck {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(16px, 2vw, 19px);
}

.article-shell {
  display: grid;
  grid-template-columns: minmax(0, 760px) minmax(180px, 1fr);
  gap: clamp(28px, 7vw, 100px);
  align-items: start;
  padding: 42px 0 56px;
}

.article-body {
  min-width: 0;
}

.article-body p,
.article-body li {
  font-size: 16px;
  line-height: 1.95;
}

.article-body p {
  margin: 0 0 1.35em;
}

.article-body h2 {
  margin: 2.2em 0 0.7em;
  padding-top: 0.7em;
  border-top: 1px solid var(--line);
  font-size: clamp(27px, 3vw, 36px);
}

.article-body h2:first-child {
  margin-top: 0;
}

.article-body h3 {
  margin: 1.8em 0 0.6em;
  font-size: 23px;
}

.article-body ul,
.article-body ol {
  margin: 0 0 1.4em;
  padding-left: 1.3em;
}

.article-body li {
  margin-bottom: 0.4em;
}

.article-body blockquote {
  margin: 1.8em 0;
  padding: 4px 0 4px 22px;
  border-left: 3px solid var(--accent);
  color: var(--ink-2);
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.6;
}

.article-body blockquote p {
  margin-bottom: 0;
  font-size: inherit;
}

.article-body code {
  padding: 0.1em 0.35em;
  background: var(--paper-2);
  font-family: var(--mono);
  font-size: 0.86em;
}

.article-body pre {
  margin: 1.8em 0;
  padding: 18px;
  overflow-x: auto;
  border: 1px solid var(--line);
  background: var(--white);
  font-size: 13px;
  line-height: 1.7;
}

.article-body pre code {
  padding: 0;
  background: transparent;
}

.article-body a {
  color: var(--accent-2);
}

.article-body hr {
  height: 1px;
  margin: 2.4em 0;
  border: 0;
  background: var(--line);
}

.article-aside {
  position: sticky;
  top: 108px;
  padding-top: 8px;
}

.aside-block {
  margin-bottom: 28px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.aside-block h2 {
  margin: 0 0 10px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.aside-block p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.aside-block a {
  color: var(--accent);
}

.article-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 48px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 10px;
}

.article-footer a {
  text-decoration: none;
}

.project-note {
  margin: 2.2em 0;
  padding: 20px 22px;
  border: 1px solid var(--ink);
  background: var(--lime);
}

.project-note .label {
  color: var(--ink);
}

.project-note a {
  display: inline-block;
  margin-top: 8px;
  font-family: var(--serif);
  font-size: 25px;
  line-height: 1.2;
  text-decoration: none;
}

/* ---------- about / projects ---------- */

.plain-page {
  padding: clamp(52px, 8vw, 100px) 0 60px;
}

.plain-page .page-title {
  margin-bottom: 28px;
}

.plain-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr);
  gap: clamp(30px, 6vw, 90px);
  align-items: start;
}

.plain-copy p {
  max-width: 700px;
  color: var(--ink-2);
  font-size: 17px;
  line-height: 1.95;
}

.plain-copy h2 {
  margin: 2em 0 0.6em;
  font-size: clamp(26px, 3vw, 36px);
}

.fact-list {
  margin: 0;
  border-top: 1px solid var(--line);
}

.fact-list div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.fact-list dt {
  color: var(--muted);
}

.fact-list dd {
  margin: 0;
  text-align: right;
}

.project-table {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  margin-top: 36px;
}

.project-table a {
  min-height: 170px;
  padding: 20px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  background: rgba(255, 253, 247, 0.24);
}

.project-table a:hover {
  background: var(--white);
  color: var(--ink);
}

.project-table h3 {
  margin: 0 0 6px;
  font-size: 24px;
}

.project-table p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.project-table .project-url {
  display: inline-block;
  margin-top: 14px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10px;
}

/* ---------- 404 ---------- */

.not-found {
  min-height: 58vh;
  display: grid;
  place-items: center;
  text-align: center;
}

.not-found h1 {
  margin-bottom: 12px;
  font-size: clamp(60px, 16vw, 160px);
}

/* ---------- touch targets（WCAG 2.5.8：链接命中区域 ≥ 24×24） ---------- */

.site-nav a {
  padding: 3px 2px;
}

.article-aside ol a {
  display: inline-block;
  padding: 3px 0;
}

.footer-links a {
  padding: 7px 6px;
}

/* ---------- responsive ---------- */

@media (min-width: 720px) {
  .brand-sub {
    display: inline;
  }
}

@media (max-width: 860px) {
  .hero-grid,
  .featured-post,
  .article-shell,
  .plain-grid {
    grid-template-columns: 1fr;
  }

  .hero-aside {
    max-width: 460px;
  }

  .featured-visual {
    min-height: 220px;
    border-left: 0;
    border-top: 1px solid var(--ink);
  }

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

  .article-aside {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }

  .article-aside .aside-block {
    margin-bottom: 0;
  }

  .listing-row {
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 14px;
  }

  .listing-date {
    grid-column: 2;
    text-align: left;
  }
}

@media (max-width: 620px) {
  .header-inner {
    min-height: 66px;
    flex-wrap: wrap;
    gap: 8px;
    padding-block: 12px;
  }

  .brand-name {
    font-size: 18px;
  }

  .site-nav {
    width: 100%;
    justify-content: flex-end;
    gap: 16px;
    font-size: 13px;
  }

  .site-nav .nav-ext {
    display: none;
  }

  .hero {
    padding-top: 44px;
  }

  .hero h1 {
    font-size: clamp(40px, 11.5vw, 62px);
    letter-spacing: -0.05em;
  }

  .hero .lede {
    margin-top: 22px;
    padding-left: 14px;
  }

  .post-grid,
  .manifest,
  .manifest-list,
  .project-table {
    grid-template-columns: 1fr;
  }

  .manifest-list li {
    border-left: 0;
  }

  .manifest-list li:nth-last-child(2) {
    border-bottom: 1px solid var(--line);
  }

  .manifest-list li:last-child {
    border-bottom: 0;
  }

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

  .post-card {
    min-height: 260px;
  }

  .featured-copy h3 {
    font-size: 32px;
  }

  .article-body p,
  .article-body li {
    font-size: 15px;
  }

  .article-aside {
    grid-template-columns: 1fr;
  }

  .article-footer,
  .footer-grid {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-grid {
    gap: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
