:root {
  color-scheme: light;
  --paper: #f8f6ef;
  --ink: #242721;
  --muted: #575e53;
  --green: #254535;
  --accent: #a14330;
  --line: #d9d9ca;
  --wash: #efeee3;
  --serif: "Noto Serif SC", "Songti SC", SimSun, Georgia, serif;
  --sans: "Inter", system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-block-start: 1.5rem; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.75 var(--sans);
}
h1, h2, h3, p, ul { margin-block: 0; }
a { color: var(--green); text-underline-offset: .22em; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 2px; }
img { display: block; max-width: 100%; }
.frame { width: min(100% - 48px, 824px); margin-inline: auto; }
.skip { position: absolute; top: .6rem; left: .6rem; z-index: 1; padding: .45rem .8rem; background: var(--paper); transform: translateY(-160%); }
.skip:focus { transform: translateY(0); }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.site-header { border-bottom: 1px solid var(--line); }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 74px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  color: var(--green);
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -.065em;
  text-decoration: none;
}
.brand-dot { color: var(--accent); }
nav { display: flex; flex-wrap: wrap; align-items: center; gap: .15rem clamp(.65rem, 2.5vw, 1.6rem); }
nav a { padding-block: .5rem; font-size: .88rem; color: var(--muted); text-decoration: none; }
nav a:hover, nav a[aria-current] { color: var(--green); text-decoration: underline; }
nav a[aria-current] { font-weight: 700; }

.home-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(122px, 23vw, 190px);
  align-items: center;
  gap: clamp(1rem, 6vw, 3.75rem);
  padding-block: clamp(2.8rem, 7vw, 4.9rem) clamp(2.6rem, 6vw, 4rem);
}
h1, h2, h3 { font-family: var(--serif); color: var(--green); }
h1 { font-size: clamp(2.35rem, 6.3vw, 4rem); line-height: 1.17; letter-spacing: -.06em; }
.home-intro p { margin-top: 1rem; max-width: 33em; color: var(--muted); font-size: clamp(.98rem, 2vw, 1.08rem); }
.home-intro img { width: 100%; height: auto; }
.home-section + .home-section { margin-top: 2.4rem; }
.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: .65rem;
}
.section-heading h2, .topic-section > h2 { font-size: clamp(1.35rem, 3vw, 1.65rem); }
.section-heading a { flex: none; font-size: .87rem; text-decoration: none; }
.section-heading a:hover, .topics a:hover, .back-link:hover { text-decoration: underline; }
.section-heading a span { margin-left: .22rem; }
.entries, .topics { list-style: none; padding: 0; }
.entries > li { border-bottom: 1px solid var(--line); }
.entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 1rem;
  padding: .75rem .1rem;
  text-decoration: none;
}
.entry:hover { background: var(--wash); }
.entry:hover strong { text-decoration: underline; }
.entry-copy { display: grid; gap: .1rem; }
.entry-copy > span { color: var(--muted); font-size: .875rem; }
.entry time, .entry-type { color: var(--muted); font-size: .79rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.home-business p { margin-top: .8rem; color: var(--muted); font-size: .93rem; }

.page-heading { padding-top: clamp(2.5rem, 7vw, 4.5rem); margin-bottom: 1.65rem; }
.page-heading p { margin-top: .8rem; color: var(--muted); }
.topic-section { margin-top: 3.25rem; }
.topics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 1.75rem; margin-top: .7rem; }
.topics li { padding: 1rem 0; border-top: 1px solid var(--line); }
.topics h3 { font-size: 1.13rem; margin-bottom: .25rem; }
.topics p { color: var(--muted); font-size: .9rem; }
.topics a { display: block; margin-top: .42rem; font-size: .85rem; }

.article { max-width: 680px; }
.article .page-heading h1 { font-size: clamp(2.15rem, 5.5vw, 3.15rem); letter-spacing: -.045em; }
.article .page-heading { margin-bottom: .85rem; }
.back-link { display: inline-block; margin-top: clamp(2.3rem, 6vw, 3.75rem); font-size: .9rem; text-decoration: none; }
.back-link + .page-heading { padding-top: 1rem; }
.article-meta {
  display: flex;
  align-items: baseline;
  gap: .7rem;
  color: var(--muted);
  font-size: .84rem;
  padding-bottom: 1.15rem;
  border-bottom: 1px solid var(--line);
}
.prose { font-size: 1rem; line-height: 1.9; margin-top: 1.7rem; overflow-wrap: anywhere; }
.prose h2, .prose h3 { margin: 1.65rem 0 .45rem; line-height: 1.35; }
.prose h2 { font-size: 1.5rem; }
.prose p + p, .prose p + ul, .prose ul + p { margin-top: 1rem; }
.prose ul { padding-left: 1.25em; }
.prose li + li { margin-top: .35rem; }
.heading-link {
  margin-left: .55em;
  color: var(--accent);
  font: .65em var(--sans);
  text-decoration: none;
  vertical-align: .12em;
}
:target { scroll-margin-top: .5rem; }
textarea {
  display: block;
  width: 100%;
  max-width: 34rem;
  margin-top: .85rem;
  padding: .7rem .85rem;
  background: var(--wash);
  border: 1px solid var(--line);
  color: var(--ink);
  font: inherit;
  line-height: 1.6;
  resize: vertical;
}
.copy-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; margin-top: .7rem; }
.copy-toolbar button { border: 1px solid var(--green); border-radius: 4px; padding: .45rem .8rem; background: var(--green); color: var(--paper); font: inherit; cursor: pointer; }
.copy-toolbar button:hover { background: #346046; }
.copy-toolbar span { color: var(--muted); font-size: .85rem; }

.site-footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .45rem 1.25rem;
  margin-top: clamp(3rem, 7vw, 5rem);
  padding-block: 1rem 2.1rem;
  border-top: 1px solid var(--line);
  font-size: .78rem;
}
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--accent); text-decoration: underline; }
.site-footer div { display: flex; flex-wrap: wrap; gap: .8rem; }

@media (max-width: 540px) {
  .frame { width: calc(100% - 36px); }
  .header-inner { display: grid; align-content: center; gap: .3rem; padding-block: .7rem .4rem; }
  .brand { width: max-content; }
  .brand img { width: 28px; height: 28px; }
  nav { gap: .12rem .9rem; }
  .home-intro { grid-template-columns: minmax(0, 1fr); gap: 1.1rem; }
  .home-intro img { width: 124px; }
  .entry { gap: .28rem; grid-template-columns: 1fr; }
  .topics { grid-template-columns: 1fr; }
}
