/* 5000words.org (apex) · shared v3 tokens */
:root {
  --bg: #f3f6f5;
  --bg-2: #e8efec;
  --rail: #e4ece9;
  --ink: #142018;
  --muted: #5f726c;
  --soft: #8a9c95;
  --line: #c5d0cb;
  --paper: #fafcfb;
  --accent: #3d6b63;
  --sage: #9aada5;
  --serif: "Noto Serif SC", "Songti SC", "STSong", serif;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; background: var(--bg); }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
::selection { background: #cfe0da; color: var(--ink); }

.page { display: grid; grid-template-columns: 72px minmax(0,1fr) 72px; min-height: 100vh; }
.rail {
  position: sticky; top: 0; height: 100vh; background: var(--rail);
  border-right: 1px solid var(--line); display: grid; place-items: center;
  color: var(--soft); font-size: 10px; letter-spacing: .22em; text-transform: uppercase;
  writing-mode: vertical-rl; z-index: 5;
}
.rail.right { border-right: 0; border-left: 1px solid var(--line); }
.main { min-width: 0; }

.top {
  height: 64px; position: sticky; top: 0; z-index: 20;
  background: rgba(243,246,245,.88); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(20px,4vw,44px); gap: 16px;
}
.brand {
  font-family: var(--serif); font-size: 18px; font-weight: 900; letter-spacing: -.04em;
  white-space: nowrap;
}
.nav {
  display: flex; flex-wrap: wrap; justify-content: flex-end;
  gap: 14px 18px; color: var(--muted);
  font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
}
.nav a:hover { color: var(--ink); }

.hero {
  padding: 72px clamp(24px,6vw,80px) 56px;
  display: grid; align-items: center;
  background: linear-gradient(180deg, #f7faf9 0%, #e8efec 100%);
}
.eyebrow { font-size: 10px; letter-spacing: .22em; text-transform: uppercase; color: var(--soft); margin-bottom: 28px; }
.type-line {
  font-family: var(--serif); font-weight: 900;
  font-size: clamp(28px,4.4vw,56px); line-height: 1.08; letter-spacing: -.02em; margin: 0;
}
.slot { display: block; width: min(14em, 100%); border-bottom: 2px dashed var(--ink); margin: 16px 0 0; }
.tagline {
  font-family: var(--serif);
  font-size: clamp(18px,2.4vw,28px); line-height: 1.4; color: var(--muted); margin: 28px 0 0; max-width: 36em;
}
.cta { display: flex; gap: 12px; margin-top: 36px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; height: 40px; padding: 0 18px;
  font-size: 13px; border: none; background: transparent; color: var(--ink);
  text-decoration: underline; text-underline-offset: 4px; cursor: pointer;
}
.btn-fill {
  background: var(--accent); color: #f3f6f5; border: none;
  text-decoration: none; border-radius: 2px;
}
.btn-fill:hover { filter: brightness(1.05); }

.section { border-top: 1px solid var(--line); padding: clamp(48px,6vw,72px) clamp(24px,6vw,80px); }
.section.alt { background: var(--bg-2); }
.section-kicker { font-size: 10px; letter-spacing: .22em; text-transform: uppercase; color: var(--soft); margin-bottom: 10px; }
.section-title {
  font-family: var(--serif); font-weight: 900;
  font-size: clamp(28px,4vw,48px); letter-spacing: -.06em; margin: 0 0 12px;
}
.section-desc { font-size: 15px; line-height: 1.75; color: var(--muted); margin: 0 0 28px; max-width: 640px; }

.rows { display: grid; gap: 0; }
.row {
  min-height: 72px; background: transparent;
  display: grid; grid-template-columns: 72px minmax(0,1fr) 110px; align-items: center;
  border-bottom: 1px solid var(--line); padding: 14px 0;
}
.row:hover h3 { color: var(--accent); }
.idx {
  display: grid; place-items: center; height: auto;
  font-size: 11px; letter-spacing: .16em; color: var(--soft);
}
.row h3 {
  font-family: var(--serif); font-size: 20px; letter-spacing: -.04em;
  margin: 0; padding: 0 18px; font-weight: 700;
}
.row p { font-size: 12px; color: var(--muted); line-height: 1.5; margin: 2px 18px 0; }
.tag {
  display: grid; place-items: center; height: auto; justify-items: end;
  font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--soft); text-align: right; padding: 0 8px;
}

.paper-list { list-style: none; border-top: 1px solid var(--line); }
.paper-list li {
  display: grid; grid-template-columns: 1fr auto; gap: 8px 20px;
  padding: 18px 0; border-bottom: 1px solid var(--line);
}
.paper-list strong { font-family: var(--serif); font-size: 17px; font-weight: 700; letter-spacing: -.03em; }
.paper-list .meta { color: var(--soft); font-size: 11px; letter-spacing: .12em; }
.paper-list .blurb { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }

.games { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 32px; }
.game {
  background: transparent; padding: 12px 0; border-bottom: 1px solid var(--line);
  display: block;
}
.game:hover strong { color: var(--accent); }
.game strong { display: block; font-family: var(--serif); font-size: 16px; margin-bottom: 4px; font-weight: 700; }
.game span { font-size: 12px; color: var(--muted); }

.files {
  background: transparent;
  display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 20px; align-items: center;
  padding: 8px 0; border-bottom: 1px solid var(--line);
}
.files h3 { font-family: var(--serif); font-size: 20px; margin-bottom: 4px; font-weight: 700; }
.files p { font-size: 13px; color: var(--muted); }

footer.contact {
  border-top: 1px solid var(--line); background: #dce6e2;
  padding: clamp(48px,6vw,72px) clamp(24px,6vw,80px);
  display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 32px; align-items: end;
}
footer .note { font-size: 12px; color: var(--muted); margin-top: 12px; }

/* inner pages */
.inner {
  padding: clamp(40px,5vw,64px) clamp(24px,6vw,80px) clamp(64px,8vw,96px);
  max-width: 820px;
}
.inner h1 {
  font-family: var(--serif); font-weight: 900;
  font-size: clamp(28px,4vw,44px); letter-spacing: -.04em; margin: 8px 0 16px;
}
.inner .lead { font-size: 16px; line-height: 1.75; color: var(--muted); max-width: 36em; }
.inner .meta-line {
  font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--soft); margin-bottom: 8px;
}
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 24px; }
.crumb a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.placeholder-box {
  margin-top: 32px; padding: 28px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  color: var(--muted); font-size: 14px; line-height: 1.7;
}
.back-row { margin-top: 36px; }
.list-plain { list-style: none; border-top: 1px solid var(--line); margin-top: 28px; }
.list-plain a {
  display: grid; grid-template-columns: 48px 1fr auto;
  gap: 12px; align-items: baseline;
  padding: 18px 0; border-bottom: 1px solid var(--line);
}
.list-plain a:hover .name { color: var(--accent); }
.list-plain .num { font-size: 11px; letter-spacing: .16em; color: var(--soft); }
.list-plain .name { font-family: var(--serif); font-size: 20px; font-weight: 700; }
.list-plain .desc { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; font-weight: 400; font-family: var(--sans); }
.list-plain .go { font-size: 12px; color: var(--soft); }

@media (max-width: 860px) {
  .page { grid-template-columns: 1fr; }
  .rail { display: none; }
  .games { grid-template-columns: 1fr; }
  .row { grid-template-columns: 56px minmax(0,1fr); }
  .row .tag { display: none; }
  .files { grid-template-columns: 1fr; }
  footer.contact { grid-template-columns: 1fr; }
  .nav { gap: 10px 14px; font-size: 9px; letter-spacing: .1em; max-width: 62vw; }
}


/* essays */
.paper-list a.paper-link {
  display: grid; grid-template-columns: 1fr auto; gap: 8px 20px;
  color: inherit; text-decoration: none;
}
.paper-list a.paper-link:hover strong { color: var(--accent); }
.essay-titleband {
  max-width: 36em;
  width: 100%;
  min-height: 4.5rem;
  max-height: 5.5rem;
  margin: 0.75rem 0 1.75rem;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  background-image: url("../assets/context-is-everything-hero.jpg");
  background-size: cover;
  background-position: center;
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}
.essay-titleband::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(20, 32, 24, 0.55) 0%,
    rgba(20, 32, 24, 0.35) 55%,
    rgba(20, 32, 24, 0.25) 100%
  );
  pointer-events: none;
}
.essay-titleband h1 {
  position: relative;
  z-index: 1;
  margin: 0;
  color: #fafcfb;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  font-size: clamp(1.35rem, 2.5vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.25;
  max-width: 100%;
}
@media (max-width: 640px) {
  .essay-titleband { min-height: 5rem; }
}
.essay-body {
  max-width: 36em;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  font-size: 17px;
  line-height: 1.9;
  color: var(--ink);
  letter-spacing: 0.01em;
}
.essay-body p {
  margin: 0 0 1.35em;
}
.essay-body p:last-child {
  margin-bottom: 0;
}

/* about prose — original site fonts (not essay YaHei stack) */
.about-body {
  max-width: 36em;
  margin: 0.5rem 0 0;
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.75;
  color: var(--ink);
}
.about-body p { margin: 0 0 1.1em; }
.about-body p:last-child { margin-bottom: 0; }

.about-more { margin-top: 2.5rem; max-width: 36em; }
/* about headings — same serif, same size as 我是谁？ */
.inner h1.about-heading,
.inner h2.about-heading,
.inner h2.about-heading-sub {
  font-family: var(--serif);
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--ink);
  line-height: 1.25;
  margin: 8px 0 16px;
  font-size: clamp(1.25rem, 2.4vw, 1.55rem);
}
.about-more .about-heading,
.about-more .about-heading-sub {
  margin-top: 0;
}




/* subpage foot · align game/files/lab */
.foot {
  margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--line);
  font-size: 12px; color: var(--muted); line-height: 1.7;
}
.foot a { text-decoration: underline; text-underline-offset: 3px; color: var(--ink); }
