:root {
  color-scheme: light dark;
  --bg: light-dark(#fcfcfc, #171717);
  --ink: light-dark(#1a1a1a, #f2f2f2);
  --body: light-dark(#494949, #c9c9c9);
  --muted: light-dark(#626262, #aaa);
  --line: light-dark(#e2e2e2, #373737);
  --soft: light-dark(#f3f3f3, #242424);
  --link: light-dark(#096baa, #82caff);
  --gutter: clamp(1rem, 4vw, 1.375rem);
  --measure: 45rem;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font: 1rem/1.65 system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
}
a { color: var(--link); text-underline-offset: .19em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; }
[id] { scroll-margin-top: 5rem; }
p, h1, h2, h3 { margin: 0; }
h1, h2, h3 { line-height: 1.3; font-weight: 650; text-wrap: pretty; }
img { display: block; }

.skip { position: fixed; z-index: 3; left: 1rem; top: .5rem; padding: .5rem 1rem; background: var(--bg); transform: translateY(-150%); }
.skip:focus { transform: none; }
.topbar { position: sticky; z-index: 2; top: 0; background: var(--bg); border-bottom: 1px solid var(--line); }
.topbar-inner, main, .site-footer { width: min(100% - 2 * var(--gutter), var(--measure)); margin-inline: auto; }
.topbar-inner { min-height: 3.75rem; padding-block: .375rem; display: flex; align-items: center; gap: clamp(.25rem, 2vw, 1rem); }
.brand { display: flex; align-items: center; gap: .55rem; margin-right: auto; color: var(--ink); font-size: .9rem; font-weight: 650; text-decoration: none; line-height: 1.25; }
.brand img { flex: none; }
.languages { display: flex; align-items: center; }
.languages a, .nav-library, .theme { color: var(--muted); text-decoration: none; }
.nav-library { font-size: .875rem; white-space: nowrap; }
.languages a { display: grid; min-height: 2.5rem; place-items: center; padding-inline: .375rem; white-space: nowrap; font-size: .8125rem; }
.languages a[aria-current] { color: var(--ink); font-weight: 650; }
.languages a + a { position: relative; }
.languages a + a::before { content: ""; position: absolute; inset: calc(50% - .4rem) auto auto 0; height: .8rem; border-left: 1px solid var(--line); }
.languages a:hover, .nav-library:hover, .theme:hover { color: var(--link); }
.theme { width: 2.5rem; height: 2.5rem; flex: none; padding: 0; border: 0; background: transparent; cursor: pointer; }
.theme:not([hidden]) { display: grid; place-items: center; }
.sun, [data-theme="dark"] .moon { display: none; }
[data-theme="dark"] .sun { display: inline; }

main { flex: 1; padding-top: clamp(2rem, 5vw, 3.375rem); }
.intro h1 { font-size: clamp(1.4rem, 3.8vw, 1.75rem); letter-spacing: -.02em; }
.lede { margin-top: .75rem; color: var(--body); }
.home section + section { margin-top: 2rem; }
.home h2 { font-size: 1.125rem; }
.entries { list-style: none; padding: 0; margin: .7rem 0 0; border-top: 1px solid var(--line); }
.entries li { display: grid; grid-template-columns: 1.7rem minmax(0, 1fr); gap: .6rem; padding-block: .95rem; border-bottom: 1px solid var(--line); }
.entry-number { padding-top: .14rem; color: var(--muted); font: .75rem/1.65 ui-monospace, monospace; }
.entries h3 { font-size: 1.0625rem; }
.summary { margin-top: .375rem; color: var(--body); font-size: .9375rem; }
.entry-type, .eyebrow { color: var(--muted); font-size: .8125rem; }
.entry-type { margin-top: .35rem; }
.reading p, .outlook p { margin-top: .5rem; color: var(--body); }
.reading > a { display: inline-block; margin-top: .35rem; }

.back { display: inline-block; margin-bottom: 1rem; font-size: .875rem; }
.eyebrow { margin-bottom: .35rem; }
.article-header h1 { font-size: clamp(1.5rem, 4.5vw, 2.25rem); letter-spacing: -.026em; overflow-wrap: anywhere; }
.source { margin-top: 1rem; font-size: .875rem; }
.source p { margin-bottom: .2rem; color: var(--muted); }
.toc { margin-block: 1.5rem; padding-block: .75rem; border-block: 1px solid var(--line); }
.toc p { font-size: .875rem; font-weight: 650; }
.toc ul { margin: .35rem 0 0; padding-left: 1.125rem; }
.toc li { font-size: .875rem; }
.toc-h3, .toc-h4, .toc-h5, .toc-h6 { margin-left: 1em; }
.prose { color: var(--body); line-height: 1.75; overflow-wrap: anywhere; }
.prose > * { margin-block: 0 1rem; }
.prose h2, .prose h3, .prose strong, .prose th { color: var(--ink); }
.prose h2 { margin-top: 2.125rem; font-size: clamp(1.25rem, 3.5vw, 1.5rem); }
.prose h3 { margin-top: 1.5rem; font-size: 1.125rem; }
.prose :target { outline: 1px solid var(--line); outline-offset: 4px; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li + li { margin-top: .5rem; }
.prose blockquote { border-left: 2px solid var(--line); margin-inline: 0; padding-left: 1rem; }
.table-scroll { max-width: 100%; overflow-x: auto; border-block: 1px solid var(--line); }
.prose table { width: 100%; min-width: 41rem; border-collapse: collapse; font-size: .875rem; line-height: 1.6; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: .65rem .7rem; border-bottom: 1px solid var(--line); }
.prose th { background: var(--soft); }
.prose th:first-child { width: 22%; }
.prose tbody tr:last-child td { border-bottom: 0; }
.footnotes { color: var(--muted); font-size: .9em; }
.site-footer { margin-top: 2.5rem; padding-block: 1rem 1.5rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .8125rem; }

@media (max-width: 26rem) {
  .nav-library { display: none; }
  .brand { font-size: .8125rem; gap: .45rem; }
  .brand img { width: 28px; height: 28px; }
  .entries li { grid-template-columns: 1.25rem minmax(0, 1fr); }
}
