:root {
  color-scheme: dark;

  --bg: #0b0b0a;
  --text: #e9e6df;
  --muted: #918d87;
  --rule: #282725;
  --accent: #d9912b;
  --blue: #6f9fb5;
  --green: #70a27d;
  --reading-font: "LXGW WenKai Screen", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Hiragino Sans GB", "Noto Sans CJK SC", sans-serif;
  --ui-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Hiragino Sans GB", "Noto Sans CJK SC", Arial, sans-serif;
  --code-font: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--ui-font);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: #3a2b17;
  color: #fff;
}

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

a {
  color: inherit;
}

.site-shell {
  display: flex;
  width: min(100%, 1040px);
  min-height: 100vh;
  margin-inline: auto;
  padding: 54px clamp(28px, 6vw, 68px) 34px;
  flex-direction: column;
}

.site-header {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--rule);
}

.wordmark {
  color: var(--text);
  font-family: var(--ui-font);
  font-size: 26px;
  font-weight: 650;
  letter-spacing: -0.025em;
  line-height: 1;
  text-decoration: none;
}

.site-frame {
  display: grid;
  min-height: 520px;
  padding: 44px 0 58px;
  flex: 1;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: clamp(36px, 7vw, 76px);
}

.side-nav {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 11px;
  font-family: var(--ui-font);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
}

.side-nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  text-decoration: none;
  transition: color 160ms ease;
}

.side-nav a::before {
  width: 8px;
  height: 1px;
  background: var(--rule);
  content: "";
  transition: width 160ms ease, background-color 160ms ease;
}

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

.side-nav a:hover::before,
.side-nav a[aria-current="page"]::before {
  width: 20px;
  background: var(--accent);
}

.site-main {
  min-width: 0;
}

.content-column {
  width: 100%;
  max-width: 35em;
}

.section-header {
  margin-bottom: 32px;
}

.section-title {
  margin: -0.18em 0 32px;
  color: var(--text);
  font-family: var(--ui-font);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.5;
}

.section-header .section-title {
  margin-bottom: 0;
}

.section-intro {
  margin-top: 16px;
  color: var(--muted);
  font-family: var(--reading-font);
  font-size: 16px;
  line-height: 1.8;
}

.section-intro > :first-child {
  margin-top: 0;
}

.section-intro > :last-child {
  margin-bottom: 0;
}

.entry {
  --entry-color: var(--accent);
  padding: 0 0 25px;
}

.entry[data-kind="research"],
.article[data-kind="research"] {
  --entry-color: var(--blue);
}

.entry[data-kind="notes"],
.article[data-kind="notes"] {
  --entry-color: var(--green);
}

.entry + .entry {
  padding-top: 25px;
  border-top: 1px solid var(--rule);
}

.entry-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--muted);
  font-family: var(--ui-font);
  font-size: 11px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  line-height: 1.5;
}

.entry-kind {
  color: var(--entry-color, var(--accent));
}

.entry-meta::after {
  width: 26px;
  height: 1px;
  background: var(--entry-color, var(--accent));
  content: "";
  opacity: 0.75;
}

.entry-title {
  margin: 0;
  font-family: var(--reading-font);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.55;
}

.entry-title a {
  color: var(--text);
  text-decoration-color: transparent;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: color 160ms ease, text-decoration-color 160ms ease;
}

.entry-title a:hover {
  color: var(--entry-color);
  text-decoration-color: currentColor;
}

.entry.is-featured .entry-title a {
  color: var(--entry-color);
}

.entry-summary {
  margin: 9px 0 0;
  color: var(--muted);
  font-family: var(--reading-font);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.75;
}

.entry-summary > :first-child {
  margin-top: 0;
}

.entry-summary > :last-child {
  margin-bottom: 0;
}

.article {
  --entry-color: var(--accent);
}

.article-header {
  padding-bottom: 32px;
  border-bottom: 1px solid var(--rule);
}

.article-title {
  margin: 0;
  color: var(--text);
  font-family: var(--reading-font);
  font-size: clamp(30px, 4.5vw, 44px);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.35;
}

.article-dek {
  margin: 16px 0 0;
  color: var(--muted);
  font-family: var(--reading-font);
  font-size: 17px;
  line-height: 1.8;
}

.prose {
  margin-top: 34px;
  color: var(--text);
  font-family: var(--reading-font);
  font-size: 18px;
  line-height: 1.85;
}

.prose p {
  margin: 0 0 1.25em;
}

.prose h2,
.prose h3,
.prose h4 {
  margin: 2.2em 0 0.8em;
  color: var(--text);
  font-weight: 600;
  line-height: 1.5;
}

.prose h2 {
  font-size: 1.45em;
}

.prose h3 {
  font-size: 1.2em;
}

.prose a {
  color: var(--accent);
  text-decoration-color: color-mix(in srgb, var(--accent), transparent 42%);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.prose a:hover {
  text-decoration-color: currentColor;
}

.prose strong,
.prose b {
  color: #fff;
}

.prose ul,
.prose ol {
  margin: 0 0 1.25em;
  padding-left: 1.4em;
}

.prose li + li {
  margin-top: 0.35em;
}

.prose blockquote {
  margin: 1.8em 0;
  padding-left: 1em;
  border-left: 1px solid var(--accent);
  color: var(--muted);
}

.prose blockquote > :last-child {
  margin-bottom: 0;
}

code,
pre,
table,
figcaption {
  font-family: var(--code-font);
  font-variant-numeric: tabular-nums;
}

code {
  padding: 0.08em 0.25em;
  background: #131311;
  color: var(--text);
  font-size: 0.84em;
}

pre {
  overflow-x: auto;
  margin: 1.8em 0;
  padding: 1em;
  border: 1px solid var(--rule);
  background: #131311;
  color: var(--text);
  font-size: 0.78rem;
  line-height: 1.65;
}

pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}

.prose img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  margin: 2em auto;
}

figcaption {
  margin-top: -1.5em;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.prose table {
  width: 100%;
  margin: 1.8em 0;
  border-collapse: collapse;
  font-size: 0.72rem;
  line-height: 1.55;
}

.prose th,
.prose td {
  padding: 0.55em 0.65em;
  border: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}

.prose th {
  color: var(--accent);
  font-weight: 500;
}

.prose .numeric,
.prose [data-type="number"] {
  text-align: right;
}

.prose hr {
  margin: 2.5em 0;
  border: 0;
  border-top: 1px solid var(--rule);
}

.not-found {
  padding-top: 2px;
}

.error-code {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.not-found h1 {
  margin: 0;
  font-family: var(--reading-font);
  font-size: 28px;
  font-weight: 600;
}

.not-found p:not(.error-code) {
  margin: 12px 0 20px;
  color: var(--muted);
  font-family: var(--reading-font);
}

.not-found a {
  color: var(--accent);
  font-size: 13px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-family: var(--ui-font);
  font-size: 11px;
  line-height: 1.5;
}

@media (max-width: 600px) {
  .site-shell {
    padding: 38px 24px 28px;
  }

  .site-frame {
    min-height: 470px;
    padding: 32px 0 44px;
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .side-nav {
    flex-flow: row wrap;
    gap: 8px 18px;
  }

  .section-title {
    margin-top: 0;
  }

  .article-title {
    font-size: 30px;
  }

  .prose {
    font-size: 17px;
    line-height: 1.82;
  }
}

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