/* ZhiHuman website.
   Only system fonts, so nothing loads from third parties (and nothing stalls where Google Fonts is blocked). */
:root {
  color-scheme: light dark;
  --paper: #f4efe4; --paper-2: #fbf8f1; --paper-3: #ece5d6; --ink: #1b1d23; --ink-2: #555a64; --ink-3: #8a8d93; --rule: #d9cfbc;
  --blue: #1d4f9c; --blue-2: #163d79; --blue-soft: #dfe7f3; --on-blue: #ffffff;
  --ok: #2b7a49; --ok-soft: #dcefe2; --void: #9c4a1f;
  --grain-opacity: .5; --grain-blend: multiply;
  --shadow: 0 1px 0 rgba(60, 45, 20, .06), 0 18px 40px -18px rgba(60, 45, 20, .28);
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", ui-serif, Georgia, serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #10141b; --paper-2: #161b24; --paper-3: #1c222d; --ink: #ece6d8; --ink-2: #aaa596; --ink-3: #787568; --rule: #2b313c;
    --blue: #93b6ff; --blue-2: #b6ceff; --blue-soft: #1b2638; --on-blue: #0b1426;
    --ok: #80d49c; --ok-soft: #17291e; --void: #f0a070;
    --grain-opacity: .22; --grain-blend: soft-light;
    --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 18px 40px -18px rgba(0, 0, 0, .7);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; background: var(--paper); color: var(--ink);
  font: 16px/1.75 var(--sans); font-feature-settings: "palt" 0; -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* Paper grain */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: var(--grain-opacity); mix-blend-mode: var(--grain-blend);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .38 0 0 0 0 .28 0 0 0 .22 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
body > * { position: relative; z-index: 1; }
a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 3px; }
::selection { background: var(--blue-soft); color: var(--ink); }
img { max-width: 100%; height: auto; display: block; }
code { font: .86em/1.4 var(--mono); padding: .12em .4em; border-radius: 4px; background: var(--paper-3); overflow-wrap: anywhere; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--paper) 86%, transparent); backdrop-filter: saturate(1.2) blur(10px); -webkit-backdrop-filter: saturate(1.2) blur(10px); border-bottom: 1px solid var(--rule); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 8px 20px; min-height: 60px; flex-wrap: wrap; padding-top: 6px; padding-bottom: 6px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 600 15px/1 var(--mono); letter-spacing: -.01em; }
.brand img { border-radius: 7px; }
.top nav { display: flex; gap: 2px 18px; flex-wrap: wrap; font-size: 15px; }
.top nav a { position: relative; padding: 6px 0; color: var(--ink-2); text-decoration: none; }
.top nav a:hover { color: var(--ink); }
.top nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.top nav a[aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: 1px; height: 2px; background: var(--ink); border-radius: 1px; }
.top nav .gh::after { content: " ↗"; font-size: .85em; }

/* ---------- type ---------- */
h1, h2, h3 { font-family: var(--serif); font-weight: 900; letter-spacing: -.01em; color: var(--ink); }
h1 { font-size: clamp(34px, 6.4vw, 66px); line-height: 1.12; margin: 0 0 22px; }
h2 { font-size: clamp(26px, 3.6vw, 38px); line-height: 1.2; margin: 0 0 14px; }
h3 { font-size: 20px; line-height: 1.35; margin: 0 0 8px; }
.kicker { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 18px; font: 500 13px/1.4 var(--mono); letter-spacing: .04em; color: var(--ink-2); }
.kicker::before { content: ""; width: 26px; height: 1px; background: currentColor; }
.lead { font-size: clamp(17px, 2vw, 19.5px); line-height: 1.8; color: var(--ink-2); max-width: 36em; margin: 0 0 28px; }
.fine { color: var(--ink-3); font-size: 13.5px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 22px; border: 1.5px solid var(--ink); border-radius: 999px; background: transparent; color: var(--ink); font: 600 15.5px/1 var(--sans); text-decoration: none; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: 3px 3px 0 var(--ink); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: var(--on-blue); }
.btn.primary:hover { box-shadow: 3px 3px 0 var(--ink); }
.btn .arrow { font-family: var(--mono); transition: transform .18s ease; }
.btn:hover .arrow { transform: translateX(3px); }
.cta { display: flex; gap: 12px; flex-wrap: wrap; margin: 0 0 14px; }

/* ---------- installation overview ---------- */
.install-overview { padding-top: clamp(26px, 5vw, 68px); scroll-margin-top: 100px; }
.install-overview h1 { font-size: clamp(28px, 4.8vw, 56px); margin-bottom: 10px; }
.install-overview .lead { margin-bottom: clamp(16px, 2.5vw, 32px); }
.install-grid { display: grid; gap: clamp(10px, 1.6vw, 18px); }
@media (min-width: 640px) { .install-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .install-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.install-card {
  display: flex; flex-direction: column; align-items: flex-start; min-width: 0;
  padding: clamp(14px, 2vw, 23px); border: 1px solid var(--rule); border-radius: 8px;
  background: var(--paper-2); box-shadow: var(--shadow);
}
.install-card h2 {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px;
  margin: 0 0 5px; font-size: clamp(19px, 2.2vw, 25px);
}
.channel-name, .channel-version { color: var(--ink-2); font: 500 12px/1.5 var(--mono); }
.channel-version { padding: 1px 6px; border: 1px solid var(--rule); border-radius: 4px; }
.install-card p { flex: 1; margin: 0 0 11px; color: var(--ink-2); font-size: 14.5px; line-height: 1.6; }
.install-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.install-actions .btn { min-height: 44px; padding: 0 14px; font-size: 14px; }
.install-secondary { margin-top: 6px; font-size: 13.5px; }
.install-note { margin: 12px 0 0; color: var(--ink-2); }
@media (max-width: 540px) {
  .top nav { gap: 2px clamp(6px, 2vw, 10px); font-size: 14px; }
  .install-overview h1 { font-size: clamp(23px, 7vw, 28px); }
  .install-overview .lead { font-size: 16px; }
}

/* page-load reveal */
.rise { animation: rise .8s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--i, 0) * 90ms); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- home: sections ---------- */
.section { padding-top: clamp(56px, 8vw, 96px); }
.section-head { display: grid; gap: 8px 48px; margin-bottom: 32px; }
@media (min-width: 860px) { .section-head { grid-template-columns: 5fr 6fr; align-items: end; } .section-head .lead { margin: 0; } }
.frame { margin: 0; border: 1px solid var(--rule); border-radius: 10px; background: var(--paper-2); box-shadow: var(--shadow); overflow: hidden; }
.policy h2 { margin-top: 44px; }
/* On a phone the whole demo image is too small to read, so show the two browser windows on its right. */
@media (max-width: 600px) { .frame img.demo { aspect-ratio: 1 / 1; object-fit: cover; object-position: 100% 50%; } }
.frame figcaption { padding: 10px 16px; border-top: 1px solid var(--rule); font-size: 13.5px; color: var(--ink-3); }

.split { display: grid; gap: 40px; }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1fr; gap: 64px; } }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 44px 1fr; gap: 14px; padding: 16px 0; border-top: 1px solid var(--rule); }
.steps li:last-child { border-bottom: 1px solid var(--rule); }
.steps li::before { content: counter(step, decimal-leading-zero); font: 600 14px/1.9 var(--mono); color: var(--blue); }
/* ---------- stamp ---------- */
.stamp { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px 4px; border: 2.5px solid var(--ok); border-radius: 6px; color: var(--ok); font: 900 15px/1 var(--serif); letter-spacing: .18em; transform: rotate(-8deg); opacity: .88;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='40'%3E%3Cfilter id='r'%3E%3CfeTurbulence baseFrequency='.7' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -2.2 1.7'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23r)'/%3E%3C/svg%3E");
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='40'%3E%3Cfilter id='r'%3E%3CfeTurbulence baseFrequency='.7' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -2.2 1.7'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23r)'/%3E%3C/svg%3E"); }
.stamp.void { border-color: var(--void); color: var(--void); }

/* ---------- inner pages ---------- */
.page-head { padding-top: clamp(44px, 7vw, 84px); padding-bottom: 12px; }
.page-head h1 { font-size: clamp(34px, 5.4vw, 56px); }
.stats { display: flex; flex-wrap: wrap; gap: 0; margin: 4px 0 28px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.stat { padding: 14px 28px 14px 0; margin-right: 28px; border-right: 1px solid var(--rule); }
.stat:last-child { border-right: 0; margin-right: 0; }
.stat b { display: block; font: 900 30px/1.1 var(--serif); }
.stat span { font: 12px/1.4 var(--mono); color: var(--ink-3); letter-spacing: .04em; }
.stat a { font: 12px/1.4 var(--mono); }

/* installation guides */
.guide-head { padding-top: clamp(28px, 5.4vw, 60px); }
.guide-head h1 { margin-bottom: 12px; }
.guide-head .lead { margin-bottom: 16px; }
.guide-back { display: inline-block; margin-bottom: 14px; font-size: 14px; }
.guide-body h2 { margin-top: 34px; font-size: clamp(23px, 3vw, 32px); }
.guide-body h2[id] { scroll-margin-top: 104px; }
.guide-body ol { padding-left: 1.4em; }
.copy-box { padding: 14px 16px; border: 1px solid var(--rule); border-radius: 8px; background: var(--paper-2); }
.copy-box pre { margin: 0; font: 13px/1.65 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.copy-box code { padding: 0; background: transparent; font: inherit; }
.copy-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; }
.copy-actions .btn { margin-top: 8px; min-height: 40px; padding: 0 13px; font-size: 13.5px; cursor: pointer; }
.copy-actions .btn[hidden] { display: none; }
.copy-status { color: var(--ink-2); font-size: 13.5px; }

/* allowlist */
.filter { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; margin: 36px 0 8px; }
.filter input, .filter select { min-height: 48px; padding: 0 4px; border: 0; border-bottom: 2px solid var(--ink); border-radius: 0; background: transparent; color: var(--ink); font: 17px/1 var(--sans); }
.filter input { flex: 1 1 260px; min-width: 0; }
.filter input::placeholder { color: var(--ink-3); }
.filter select { padding-right: 8px; cursor: pointer; }
.filter input:focus-visible, .filter select:focus-visible { outline: 0; border-bottom-color: var(--blue); }
#shown { font-family: var(--mono); font-size: 12.5px; min-height: 1.6em; }
.entries { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 18px; }
@media (min-width: 900px) { .entries { grid-template-columns: 1fr 1fr; } }
.entry { position: relative; padding: 22px 24px 18px; background: var(--paper-2); border: 1px solid var(--rule); border-radius: 6px; box-shadow: var(--shadow); scroll-margin-top: 90px; transition: transform .2s ease; }
.entry:hover { transform: translateY(-2px); }
.entry:target { outline: 2px solid var(--blue); outline-offset: 4px; }
.entry[data-revoked] { opacity: .72; }
.entry .stamp { position: absolute; top: 18px; right: 18px; }
.entry-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; padding-right: 96px; font: 12px/1.4 var(--mono); color: var(--ink-3); }
.entry-head .type { padding: 2px 8px; border-radius: 3px; background: var(--blue-soft); color: var(--blue); font-weight: 600; }
.entry[data-scope="content"] .entry-head .type { background: var(--ok-soft); color: var(--ok); }
.entry-head .anchor { color: var(--ink-3); text-decoration: none; overflow-wrap: anywhere; }
.entry-head .anchor:hover { color: var(--blue); }
.entry h3 { padding-right: 84px; margin-bottom: 14px; }
.entry h3 a { color: var(--ink); text-decoration-color: var(--rule); overflow-wrap: anywhere; }
.entry h3 a:hover { text-decoration-color: var(--ink); }
.entry dl { margin: 0; display: grid; gap: 6px; font-size: 14.5px; }
.entry dl > div { display: grid; grid-template-columns: 5.5em 1fr; gap: 12px; }
.entry dt { color: var(--ink-3); font-size: 13px; padding-top: 1px; }
.entry dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.entry dd ul { margin: 0; padding-left: 1.1em; }
.entry .files { margin: 14px 0 0; padding-top: 10px; border-top: 1px dashed var(--rule); font: 12px/1.5 var(--mono); color: var(--ink-3); }
.empty { padding: 48px 24px; text-align: center; color: var(--ink-2); background: var(--paper-2); border: 1.5px dashed var(--rule); border-radius: 6px; }

/* submit */
.paths { display: grid; gap: 18px; margin-top: 8px; }
@media (min-width: 820px) { .paths { grid-template-columns: 1fr 1fr; } }
.path { position: relative; display: flex; flex-direction: column; padding: 28px 28px 26px; border: 1px solid var(--rule); border-radius: 6px; background: var(--paper-2); box-shadow: var(--shadow); }
.path.primary { border-color: var(--ink); box-shadow: 5px 5px 0 var(--ink); }
.path .tag { align-self: flex-start; margin-bottom: 16px; font: 600 11.5px/1 var(--mono); letter-spacing: .04em; padding: 5px 8px; border-radius: 3px; background: var(--paper-3); color: var(--ink-2); }
.path.primary .tag { background: var(--blue-soft); color: var(--blue); }
.path p { color: var(--ink-2); margin: 0 0 22px; flex: 1; }
/* Keep the left edge of the page; only the line length is limited. */
.prose > * { max-width: 760px; }
.prose h2 { margin-top: 64px; }
.prose h2 .n { display: block; margin-bottom: 8px; font: 500 13px/1 var(--mono); color: var(--ink-3); letter-spacing: .06em; }
.prose ul { padding-left: 1.2em; }
.prose li { margin: 8px 0; }
.prose li::marker { color: var(--ink-3); }
.table { overflow-x: auto; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--rule); }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 13px 16px 13px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
th { font: 600 12px/1.4 var(--mono); color: var(--ink-3); letter-spacing: .06em; }

/* ---------- footer ---------- */
.bottom { margin-top: clamp(80px, 11vw, 140px); padding: 48px 0 56px; border-top: 2px solid var(--ink); }
.pull { max-width: 30em; margin: 0 0 24px; font: 700 clamp(18px, 2.2vw, 22px)/1.6 var(--serif); color: var(--ink); }
.bottom .links { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 0; font: 13px/1.6 var(--mono); }
.bottom .links a { color: var(--ink-2); }
.bottom .fine { margin: 14px 0 0; }

@media (max-width: 520px) {
  .entry { padding: 20px 18px 16px; }
  .entry dl > div { grid-template-columns: 1fr; gap: 0; }
  .entry-head, .entry h3 { padding-right: 78px; }
  .entry .stamp { top: 16px; right: 12px; font-size: 13px; }
  .stat { padding-right: 18px; margin-right: 18px; }
  .path { padding: 24px 20px 22px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-delay: 0s !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
