:root {
  --bg: #ffffff;
  --text: #2b2a28;
  --muted: #7a776f;
  --line: #e9e7e2;
  --card: #f7f6f3;
  --link: #2b2a28;
  --accent: #b5652b;
  --gray: #8f8b83;
  --max: 720px;
  --serif: "Lyon-Text", Georgia, "Iowan Old Style", "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #191919;
    --text: #e8e6e1;
    --muted: #9b978f;
    --line: #2f2e2b;
    --card: #232321;
    --link: #e8e6e1;
    --accent: #e0995f;
    --gray: #9b978f;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.6;
  overflow-x: hidden;
}
a { color: var(--link); text-decoration: underline; text-decoration-color: var(--muted); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); text-decoration-color: var(--accent); }
img { max-width: 100%; height: auto; }

.site-nav { border-bottom: 1px solid var(--line); font-family: var(--sans); font-size: 14px; }
.site-nav nav { max-width: var(--max); margin: 0 auto; padding: 14px 16px; display: flex; flex-wrap: wrap; gap: 6px 20px; }
.site-nav a { text-decoration: none; color: var(--muted); }
.site-nav a[aria-current="page"], .site-nav a:hover { color: var(--text); }

main { max-width: var(--max); margin: 0 auto; padding: 48px 16px 64px; }
.page-icon img.icon { width: 112px; height: 112px; border-radius: 50%; object-fit: cover; display: block; }
.page-icon span.icon { font-size: 72px; line-height: 1; display: block; }
h1 { font-size: 40px; line-height: 1.2; margin: 20px 0 24px; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 28px; line-height: 1.3; margin: 40px 0 8px; }
h3 { font-size: 22px; line-height: 1.3; margin: 32px 0 6px; }
p { margin: 4px 0; overflow-wrap: anywhere; }
p.spacer { height: 0.8em; margin: 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
ul, ol { margin: 4px 0; padding-left: 1.5em; }
li { margin: 4px 0; overflow-wrap: anywhere; }
blockquote { overflow-wrap: anywhere; margin: 12px 0; padding: 2px 0 2px 16px; border-left: 3px solid var(--text); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.82em; background: var(--card); padding: 2px 5px; border-radius: 4px; overflow-wrap: anywhere; }
pre { background: var(--card); padding: 16px; border-radius: 6px; overflow-x: auto; }
.indent { padding-left: 1.5em; }

.callout { display: flex; gap: 12px; align-items: flex-start; background: var(--card); border-radius: 6px; padding: 14px 16px; margin: 8px 0; }
.callout .icon { font-size: 20px; line-height: 1.4; flex: none; }
.callout img.icon { width: 22px; height: 22px; border-radius: 4px; }
.callout > div { min-width: 0; overflow-wrap: anywhere; }

details { margin: 8px 0; }
summary { cursor: pointer; }
details > :not(summary) { margin-left: 1.3em; }

.subpage { margin: 2px 0; }
.subpage a { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; border-bottom: 1px solid var(--line); }
.subpage .icon { font-size: 1.1em; }
.subpage img.icon { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }
.mention { font-weight: 600; }

.columns { display: flex; gap: 32px; margin: 12px 0; }
.column { flex: 1; min-width: 0; }
figure { margin: 12px 0; }
figure img { display: block; border-radius: 4px; }
figcaption { font-size: 14px; color: var(--muted); margin-top: 6px; }

.toc { display: flex; flex-direction: column; gap: 2px; margin: 8px 0 16px; font-size: 16px; }
.toc a { text-decoration: none; color: var(--muted); }
.toc a.l3 { padding-left: 0; }
.toc a:hover { color: var(--text); }

.bookmark { display: flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; margin: 8px 0; text-decoration: none; color: var(--text); font-family: var(--sans); min-height: 104px; }
.bookmark:hover { background: var(--card); color: var(--text); }
.bm-text { flex: 1 1 auto; min-width: 0; padding: 12px 14px; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.bm-title { font-size: 15px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bm-desc { font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bm-url { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.bm-url img { width: 16px; height: 16px; flex: none; }
.bm-cover { flex: 0 0 32%; max-width: 240px; }
.bm-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

.c-gray { color: var(--gray); }
.c-brown { color: #9f6b53; } .c-orange { color: #d9730d; } .c-yellow { color: #cb912f; }
.c-green { color: #448361; } .c-blue { color: #337ea9; } .c-purple { color: #9065b0; }
.c-pink { color: #c14c8a; } .c-red { color: #d44c47; }

footer { border-top: 1px solid var(--line); font-family: var(--sans); font-size: 14px; color: var(--muted); }
footer p { max-width: var(--max); margin: 0 auto; padding: 20px 16px 40px; }
footer a { color: var(--muted); }

@media (max-width: 640px) {
  body { font-size: 17px; }
  main { padding-top: 32px; }
  h1 { font-size: 32px; }
  h2 { font-size: 24px; }
  .columns { flex-direction: column; gap: 8px; }
  .page-icon img.icon { width: 88px; height: 88px; }
  .bm-cover { display: none; }
  .bm-title { white-space: normal; }
}
