:root {
  --bg: #fffdf7;
  --surface: #ffffff;
  --surface-2: #fbf6e9;
  --text: #24211b;
  --muted: #6b6457;
  --border: #ece4d2;
  --accent: #e8a100;
  --accent-strong: #b97a00;
  --accent-soft: #fff3d1;
  --link: #9a5b00;
  --code-bg: #f6f1e4;
  --shadow: 0 1px 2px rgba(60, 45, 10, .06), 0 6px 24px rgba(60, 45, 10, .06);
  --radius: 14px;
  --max: 1080px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15130f;
    --surface: #1d1a15;
    --surface-2: #221f18;
    --text: #ede7da;
    --muted: #a89f8c;
    --border: #332e24;
    --accent: #f5b301;
    --accent-strong: #ffc93a;
    --accent-soft: #2b2414;
    --link: #ffc65a;
    --code-bg: #26221a;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.75 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
        "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--link); text-underline-offset: 3px; }
img { max-width: 100%; height: auto; }
code {
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: .88em;
  background: var(--code-bg);
  border-radius: 5px;
  padding: .1em .35em;
  overflow-wrap: anywhere;
}
pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  overflow-x: auto;
  line-height: 1.55;
}
pre code { background: none; padding: 0; font-size: .86em; overflow-wrap: normal; }
.muted { color: var(--muted); }

/* header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.bar {
  max-width: var(--max); margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; color: var(--text); text-decoration: none; }
.logo { font-size: 22px; }
.site-nav { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.site-nav a {
  color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 8px; font-size: 15px;
}
.site-nav a:hover { color: var(--text); background: var(--surface-2); }
.site-nav a[aria-current="page"] { color: var(--text); background: var(--accent-soft); font-weight: 600; }

main { max-width: var(--max); margin: 0 auto; padding: 24px 16px 56px; }

/* buttons */
.btn {
  display: inline-block; padding: 10px 18px; border-radius: 999px; font-weight: 600;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #1d1606; }
.btn.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn.ghost { background: transparent; }

/* home */
.hero {
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 36px; align-items: center; padding: 28px 0 40px;
}
.eyebrow { color: var(--accent-strong); font-weight: 600; font-size: 14px; letter-spacing: .04em; margin: 0 0 6px; }
.hero h1 { font-size: clamp(40px, 7vw, 64px); line-height: 1.05; margin: 0 0 14px; letter-spacing: -.02em; }
.tagline { font-size: clamp(19px, 2.4vw, 23px); font-weight: 600; margin: 0 0 10px; line-height: 1.5; }
.sub { color: var(--muted); margin: 0 0 22px; }
.cta { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-media { margin: 0; }
.hero-media img {
  width: 100%; border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); display: block;
}
.hero-media figcaption { color: var(--muted); font-size: 14px; margin-top: 8px; }

.home .content { max-width: none; }
.home .content h2 { font-size: 26px; margin: 0 0 16px; padding: 0; border: 0; }
.home .content h3 { margin: 0 0 6px; font-size: 18px; }
.home section { padding: 36px 0; border-top: 1px solid var(--border); }
.home section.hero { border-top: 0; }
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.features article, .card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 18px 6px; box-shadow: var(--shadow);
}
.features h3, .card h3 { margin: 0 0 6px; font-size: 18px; }
.features p, .card p { margin: 0 0 12px; color: var(--muted); }
.card p:last-child a:only-child { font-weight: 600; }
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }

.content .path { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; counter-reset: step; }
.path li { counter-increment: step; }
.path a {
  display: block; height: 100%; text-decoration: none; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px;
  box-shadow: var(--shadow);
}
.path a:hover { border-color: var(--accent); }
.path a::before {
  content: counter(step); display: inline-grid; place-items: center; width: 28px; height: 28px;
  border-radius: 50%; background: var(--accent-soft); color: var(--accent-strong); font-weight: 700; margin-bottom: 8px;
}
.path b { display: block; font-size: 17px; }
.path span { display: block; color: var(--muted); font-size: 14px; line-height: 1.6; margin-top: 4px; }

.arch figure { margin: 16px 0 0; }
.arch img { border-radius: var(--radius); border: 1px solid var(--border); background: #fff; display: block; }
.community-body { display: flex; gap: 24px; align-items: center; }
.community-body img { border-radius: 12px; border: 1px solid var(--border); flex: none; }

/* docs */
.doc { display: block; }
.doc.has-toc { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 40px; align-items: start; }
.toc {
  position: sticky; top: 76px; font-size: 14px; max-height: calc(100vh - 96px); overflow-y: auto;
  border-left: 2px solid var(--border); padding-left: 14px;
}
.toc p { margin: 0 0 6px; font-weight: 700; color: var(--muted); }
.toc ol { list-style: none; padding: 0; margin: 0; }
.toc li { margin: 2px 0; }
.toc a { color: var(--muted); text-decoration: none; line-height: 1.5; display: block; padding: 2px 0; }
.toc a:hover { color: var(--text); }
.content { min-width: 0; max-width: 820px; }
.content h1 { font-size: clamp(28px, 4.4vw, 38px); line-height: 1.25; margin: 8px 0 18px; }
.content h2 {
  font-size: 24px; margin: 44px 0 12px; padding-top: 8px; border-top: 1px solid var(--border); line-height: 1.4;
}
.content h3 { font-size: 19px; margin: 28px 0 8px; }
.content li { margin: 4px 0; }
.content li > p { margin: 6px 0; }
.content ol, .content ul { padding-left: 1.5em; }
.content strong { color: var(--text); }

.photo { margin: 16px 0 22px; }
.photo img { display: block; width: 100%; border-radius: 12px; border: 1px solid var(--border); }
.photo figcaption { color: var(--muted); font-size: 14px; margin-top: 6px; line-height: 1.6; }
.photos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.photos .photo { margin: 8px 0; }
.photos:has(> .photo:only-child) { grid-template-columns: minmax(0, 360px); }
/* a photo with numbered markers on it (left/top in % of the picture), and the same number in its table */
.annot-img { position: relative; }
.mark, .num {
  display: inline-grid; place-items: center; border-radius: 50%; font-weight: 700; line-height: 1;
  background: var(--accent); color: #1d1606;
}
.mark {
  position: absolute; transform: translate(-50%, -50%); width: 28px; height: 28px; font-size: 15px;
  border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .5);
}
.num { width: 22px; height: 22px; font-size: 13px; }

.table-wrap { overflow-x: auto; margin: 14px 0 20px; border: 1px solid var(--border); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: 15px; background: var(--surface); }
th, td { text-align: left; vertical-align: top; padding: 9px 12px; border-bottom: 1px solid var(--border); }
th { background: var(--surface-2); font-weight: 600; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td:first-child { white-space: nowrap; }

.site-footer {
  border-top: 1px solid var(--border); text-align: center; padding: 22px 16px 32px; font-size: 14px; color: var(--muted);
}
.site-footer p { margin: 4px 0; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 24px; padding-top: 8px; }
  .features { grid-template-columns: repeat(2, 1fr); }
  .path { grid-template-columns: 1fr; }
  .doc.has-toc { grid-template-columns: 1fr; gap: 0; }
  .toc { position: static; max-height: none; border-left: 0; padding: 12px 14px; margin-bottom: 8px;
         background: var(--surface-2); border-radius: 10px; }
  .toc ol { columns: 2; column-gap: 16px; }
}
@media (max-width: 560px) {
  body { font-size: 15.5px; }
  .features, .cards { grid-template-columns: 1fr; }
  .community-body { flex-direction: column; align-items: flex-start; }
  .toc ol { columns: 1; }
  .brand { font-size: 16px; }
  .site-nav a { padding: 6px 7px; font-size: 14px; }
  .site-nav a.gh { display: none; }
  td:first-child { white-space: normal; }
  .mark { width: 22px; height: 22px; font-size: 13px; border-width: 1.5px; }
}
