/* Baofa documentation hub: the manuscript material system (paper, ink, gold, cinnabar, jade) in a
   documentation layout: top bar, section sidebar, reading column, page outline. Night edition via data-theme. */

@font-face {
  font-family: "Manuscript Sans Docs";
  src: url("/fonts/manuscript-sans-docs.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --paper: #f5eedd;
  --paper-deep: #ebe2cc;
  --raised: #fffdf6;
  --ink: #171b18;
  --ink-soft: #3a403b;
  --ink-mute: #6b6f66;
  --rule: rgba(23, 27, 24, 0.14);
  --rule-strong: rgba(23, 27, 24, 0.28);
  --gold: #ffd44a;
  --gold-deep: #c99a00;
  --gold-wash: rgba(255, 212, 74, 0.22);
  --cinnabar: #e94d36;
  --cinnabar-wash: rgba(233, 77, 54, 0.1);
  --jade: #177b55;
  --jade-wash: rgba(23, 123, 85, 0.1);
  --sky-wash: rgba(23, 27, 24, 0.05);
  --code-bg: #f1e9d4;
  --code-ink: #1f2420;
  --link: #0f4f3a;
  --link-hover: #b8321f;
  --focus: #1f6feb;
  --shadow: 0 1px 0 rgba(23, 27, 24, 0.06), 0 14px 32px -24px rgba(23, 27, 24, 0.5);
  --sans: "Manuscript Sans Docs", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  --topbar: 64px;
  --sidebar: 272px;
  --outline: 232px;
  --measure: 780px;
  --radius: 10px;
  color-scheme: light;
}

html[data-theme="night"] {
  --paper: #14171a;
  --paper-deep: #0f1114;
  --raised: #1c2025;
  --ink: #f1ece0;
  --ink-soft: #d6d0c1;
  --ink-mute: #a39d8e;
  --rule: rgba(241, 236, 224, 0.14);
  --rule-strong: rgba(241, 236, 224, 0.3);
  --gold: #ffd44a;
  --gold-deep: #ffd44a;
  --gold-wash: rgba(255, 212, 74, 0.14);
  --cinnabar: #ff715c;
  --cinnabar-wash: rgba(255, 113, 92, 0.14);
  --jade: #5ccc98;
  --jade-wash: rgba(92, 204, 152, 0.12);
  --sky-wash: rgba(241, 236, 224, 0.06);
  --code-bg: #0f1215;
  --code-ink: #e8e2d4;
  --link: #ffd44a;
  --link-hover: #ff9c8c;
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.4), 0 14px 32px -20px rgba(0, 0, 0, 0.9);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--topbar) + 20px);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: rgba(201, 154, 0, 0.7);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--link-hover);
  text-decoration-color: currentColor;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 8px 12px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 6px;
}

.skip:focus {
  top: 12px;
}

/* ---------------------------------------------------------------- top bar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  height: var(--topbar);
  padding: 0 20px;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--rule);
}

.menu-button {
  display: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  background: var(--raised);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.menu-button span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.brand img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

/* The wordmark is ink on transparent; the night edition lifts it to paper and keeps its hues. */
[data-theme="night"] .brand img,
[data-theme="night"] .chooser img {
  filter: invert(1) hue-rotate(180deg) saturate(1.15);
}

.brand-text {
  font-weight: 700;
  letter-spacing: 0.01em;
  font-size: 17px;
}

.brand-text em {
  font-style: normal;
  font-weight: 500;
  color: var(--ink-mute);
  margin-left: 6px;
}

.search {
  position: relative;
  max-width: 560px;
  justify-self: center;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-mute);
  pointer-events: none;
}

.search input {
  width: 100%;
  height: 40px;
  padding: 0 44px 0 38px;
  border: 1px solid var(--rule-strong);
  border-radius: 10px;
  background: var(--raised);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
}

.search input::placeholder {
  color: var(--ink-mute);
}

.search input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.search kbd {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  padding: 1px 7px;
  border: 1px solid var(--rule-strong);
  border-radius: 5px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-mute);
  background: var(--paper);
}

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  max-height: min(70vh, 520px);
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--rule-strong);
  border-radius: 12px;
  background: var(--raised);
  box-shadow: var(--shadow);
}

.search-results a {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
}

.search-results a[aria-selected="true"],
.search-results a:hover {
  background: var(--gold-wash);
}

.search-results .r-section {
  display: block;
  font-size: 12px;
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.search-results .r-title {
  display: block;
  font-weight: 700;
}

.search-results .r-snippet {
  display: block;
  font-size: 13.5px;
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-results mark {
  background: var(--gold-wash);
  color: inherit;
  padding: 0 1px;
}

.search-results .r-empty,
.search-results .r-hint {
  padding: 10px 12px;
  color: var(--ink-mute);
  font-size: 14px;
}

.topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.lang-switch,
.theme-button,
.app-link {
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  background: var(--raised);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.theme-button {
  width: 36px;
  padding: 0;
}

.theme-button .sun {
  display: none;
}

html[data-theme="night"] .theme-button .sun {
  display: block;
}

html[data-theme="night"] .theme-button .moon {
  display: none;
}

.app-link {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

html[data-theme="night"] .app-link {
  background: var(--gold);
  color: #171b18;
  border-color: var(--gold);
}

.lang-switch:hover,
.theme-button:hover {
  border-color: var(--ink);
  color: var(--ink);
}

/* ---------------------------------------------------------------- layout */

.layout {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr) var(--outline);
  max-width: 1440px;
  margin: 0 auto;
  min-height: calc(100vh - var(--topbar));
}

.sidebar {
  position: sticky;
  top: var(--topbar);
  align-self: start;
  height: calc(100vh - var(--topbar));
  overflow-y: auto;
  padding: 24px 16px 40px 20px;
  border-right: 1px solid var(--rule);
  scrollbar-width: thin;
}

.nav-home {
  display: block;
  margin: 0 0 14px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
  text-decoration: none;
}

.nav-home:hover {
  color: var(--ink);
}

.nav-group {
  margin: 0 0 18px;
}

.nav-group h2 {
  margin: 0 0 4px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.nav-group ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-group li a {
  display: block;
  position: relative;
  padding: 6px 10px 6px 14px;
  border-radius: 7px;
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.4;
  text-decoration: none;
}

.nav-group li a:hover {
  background: var(--sky-wash);
  color: var(--ink);
}

.nav-group li a[aria-current="page"] {
  color: var(--ink);
  font-weight: 700;
  background: var(--gold-wash);
}

.nav-group li a[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  bottom: 7px;
  width: 3px;
  border-radius: 3px;
  background: var(--gold-deep);
}

html[data-theme="night"] .nav-group li a[aria-current="page"]::before {
  background: var(--gold);
}

.content {
  min-width: 0;
  padding: 36px 48px 72px;
}

.toc {
  position: sticky;
  top: var(--topbar);
  align-self: start;
  max-height: calc(100vh - var(--topbar));
  overflow-y: auto;
  padding: 36px 20px 40px 8px;
  font-size: 13.5px;
  scrollbar-width: thin;
}

.toc-title {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--rule);
}

.toc li a {
  display: block;
  padding: 4px 0 4px 12px;
  margin-left: -1px;
  border-left: 2px solid transparent;
  color: var(--ink-mute);
  text-decoration: none;
  line-height: 1.4;
}

.toc li.toc-3 a {
  padding-left: 24px;
}

.toc li a:hover {
  color: var(--ink);
}

.toc li a.active {
  color: var(--ink);
  border-left-color: var(--gold-deep);
  font-weight: 600;
}

html[data-theme="night"] .toc li a.active {
  border-left-color: var(--gold);
}

.scrim {
  position: fixed;
  inset: var(--topbar) 0 0 0;
  background: rgba(23, 27, 24, 0.45);
  z-index: 30;
}

/* ---------------------------------------------------------------- page header */

.crumbs {
  display: flex;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-mute);
  margin-bottom: 12px;
}

.crumbs a {
  color: var(--ink-mute);
  text-decoration: none;
}

.crumbs a:hover {
  color: var(--ink);
}

.page-head {
  max-width: var(--measure);
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--rule);
}

.page-head h1 {
  margin: 0 0 10px;
  font-size: 36px;
  line-height: 1.2;
  letter-spacing: -0.015em;
  font-weight: 800;
}

.lede {
  margin: 0 0 14px;
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink-soft);
}

.page-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 13px;
  color: var(--ink-mute);
}

.page-meta code {
  font-size: 12px;
}

.page-meta .dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--rule-strong);
}

/* ---------------------------------------------------------------- prose */

.prose {
  max-width: var(--measure);
}

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

.prose h2 {
  position: relative;
  margin: 44px 0 14px;
  padding-top: 8px;
  font-size: 25px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  font-weight: 750;
  scroll-margin-top: calc(var(--topbar) + 16px);
}

.prose h2::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 44px;
  height: 3px;
  border-radius: 3px;
  background: var(--gold);
}

.prose h3 {
  margin: 30px 0 10px;
  font-size: 19px;
  line-height: 1.35;
  font-weight: 700;
  scroll-margin-top: calc(var(--topbar) + 16px);
}

.prose h4 {
  margin: 22px 0 8px;
  font-size: 16px;
  font-weight: 700;
}

.prose .anchor {
  margin-left: 8px;
  color: var(--ink-mute);
  text-decoration: none;
  opacity: 0;
  font-weight: 500;
}

.prose h2:hover .anchor,
.prose h3:hover .anchor,
.prose .anchor:focus {
  opacity: 1;
}

.prose p,
.prose ul,
.prose ol {
  margin: 0 0 16px;
}

.prose ul,
.prose ol {
  padding-left: 24px;
}

.prose li {
  margin: 4px 0;
}

.prose li > ul,
.prose li > ol {
  margin: 4px 0 0;
}

.prose strong {
  font-weight: 700;
}

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

.prose img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--rule);
}

.prose blockquote {
  margin: 0 0 16px;
  padding: 4px 18px;
  border-left: 3px solid var(--rule-strong);
  color: var(--ink-soft);
}

.prose code {
  font-family: var(--mono);
  font-size: 0.88em;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--code-bg);
  color: var(--code-ink);
  word-break: break-word;
}

.prose figure.code {
  margin: 0 0 18px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--code-bg);
  overflow: hidden;
}

.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px 6px 14px;
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-mute);
  text-transform: lowercase;
}

.copy,
.copy-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border: 1px solid var(--rule-strong);
  border-radius: 6px;
  background: var(--raised);
  color: var(--ink-soft);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.copy:hover,
.copy-inline:hover {
  color: var(--ink);
  border-color: var(--ink);
}

.copy.done,
.copy-inline.done {
  color: var(--jade);
  border-color: var(--jade);
}

.prose pre {
  margin: 0;
  padding: 14px 16px;
  overflow: auto;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.6;
  tab-size: 2;
}

.prose pre code {
  padding: 0;
  background: transparent;
  font-size: inherit;
  word-break: normal;
}

.addr {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  vertical-align: middle;
}

.addr code {
  overflow-wrap: anywhere;
}

.copy-inline {
  padding: 2px 5px;
  line-height: 0;
}

.table-scroll {
  margin: 0 0 20px;
  overflow-x: auto;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--raised);
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.5;
}

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

.prose th {
  font-weight: 700;
  background: var(--sky-wash);
  white-space: nowrap;
}

.prose tbody tr:last-child td {
  border-bottom: 0;
}

.prose td code {
  font-size: 12.5px;
}

/* ---------------------------------------------------------------- callouts */

.callout {
  margin: 0 0 20px;
  padding: 14px 18px 4px;
  border: 1px solid var(--rule);
  border-left-width: 4px;
  border-radius: var(--radius);
  background: var(--raised);
}

.callout p:last-child,
.callout ul:last-child {
  margin-bottom: 12px;
}

.callout-title {
  margin: 0 0 6px;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.callout-note {
  border-left-color: var(--ink-soft);
}

.callout-tip {
  border-left-color: var(--jade);
}

.callout-tip .callout-title {
  color: var(--jade);
}

.callout-warning {
  border-left-color: var(--cinnabar);
  background: var(--cinnabar-wash);
}

.callout-warning .callout-title {
  color: var(--cinnabar);
}

.callout-fact {
  border-left-color: var(--jade);
  background: var(--jade-wash);
}

.callout-fact .callout-title {
  color: var(--jade);
}

.callout-estimate {
  border-left-color: var(--gold-deep);
  background: var(--gold-wash);
}

.callout-estimate .callout-title {
  color: var(--gold-deep);
}

.callout-launch {
  border-left-color: var(--gold-deep);
  background: linear-gradient(90deg, var(--gold-wash), transparent 70%);
}

.callout-launch .callout-title {
  color: var(--ink);
}

html[data-theme="night"] .callout-estimate .callout-title,
html[data-theme="night"] .callout-launch .callout-title {
  color: var(--gold);
}

.generated-note {
  margin: 0 0 18px;
  padding: 8px 12px;
  border: 1px dashed var(--rule-strong);
  border-radius: 8px;
  font-size: 13px;
  color: var(--ink-mute);
}

.stamp {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border: 1.5px solid currentColor;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transform: rotate(-1.5deg);
}

.stamp-launch {
  color: var(--cinnabar);
}

/* ---------------------------------------------------------------- pager and foot */

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  max-width: var(--measure);
  margin: 48px 0 0;
}

.pager a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 16px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--raised);
  color: var(--ink);
  text-decoration: none;
}

.pager a:hover {
  border-color: var(--ink);
}

.pager a span {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.pager-next {
  text-align: right;
  align-items: flex-end;
}

.page-foot {
  max-width: var(--measure);
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  font-size: 13px;
  color: var(--ink-mute);
}

.page-foot code {
  font-family: var(--mono);
  font-size: 12px;
}

.page-foot p + p {
  margin-top: 6px;
}

.page-foot a {
  color: var(--ink-mute);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.page-foot a:hover {
  color: var(--ink);
}

/* ---------------------------------------------------------------- hub landing */

.hub-hero {
  max-width: 860px;
  padding: 8px 0 28px;
}

.hub-kicker {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.hub-hero h1 {
  margin: 0 0 14px;
  font-size: 44px;
  line-height: 1.12;
  letter-spacing: -0.02em;
  font-weight: 800;
}

.hub-intro {
  margin: 0 0 18px;
  font-size: 19px;
  line-height: 1.6;
  color: var(--ink-soft);
}

.hub-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--raised);
  font-size: 14.5px;
  color: var(--ink-soft);
}

.hub-heading {
  margin: 36px 0 14px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.start-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.start-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px;
  border: 1px solid var(--rule);
  border-top: 3px solid var(--gold);
  border-radius: var(--radius);
  background: var(--raised);
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--shadow);
}

.start-card:hover {
  border-color: var(--ink);
  border-top-color: var(--gold);
}

.start-card strong {
  font-size: 17px;
}

.start-card span {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.5;
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.hub-section {
  padding: 20px 22px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--raised);
}

.hub-section h2 {
  margin: 0 0 6px;
  font-size: 20px;
}

.hub-section p {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--ink-soft);
}

.hub-section ul {
  margin: 0;
  padding: 0;
  list-style: none;
  columns: 1;
}

.hub-section li {
  padding: 4px 0;
  border-top: 1px solid var(--rule);
  font-size: 14.5px;
}

.hub-section li a {
  text-decoration: none;
  color: var(--ink);
}

.hub-section li a:hover {
  color: var(--link-hover);
}

/* ---------------------------------------------------------------- chooser */

body.chooser {
  display: grid;
  place-items: center;
  min-height: 100vh;
}

.chooser-card {
  text-align: center;
  padding: 32px;
}

.chooser-card h1 {
  font-size: 28px;
  margin: 12px 0;
}

/* ---------------------------------------------------------------- responsive */

@media (max-width: 1200px) {
  .layout {
    grid-template-columns: var(--sidebar) minmax(0, 1fr);
  }

  .toc {
    display: none;
  }
}

@media (max-width: 900px) {
  .topbar {
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    gap: 10px;
    padding: 0 12px;
  }

  .menu-button {
    display: inline-flex;
  }

  .brand-text em {
    display: none;
  }

  .search kbd {
    display: none;
  }

  .app-link {
    display: none;
  }

  .layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: fixed;
    top: var(--topbar);
    left: 0;
    bottom: 0;
    width: min(320px, 86vw);
    height: auto;
    z-index: 35;
    background: var(--paper);
    transform: translateX(-104%);
    transition: transform 200ms ease;
    box-shadow: var(--shadow);
  }

  body.nav-open .sidebar {
    transform: none;
  }

  .content {
    padding: 24px 18px 56px;
  }

  .page-head h1 {
    font-size: 29px;
  }

  .hub-hero h1 {
    font-size: 32px;
  }

  .hub-intro {
    font-size: 17px;
  }

  .pager {
    grid-template-columns: 1fr;
  }

  .pager-next {
    align-items: flex-start;
    text-align: left;
  }
}

@media (max-width: 560px) {
  .brand-text {
    display: none;
  }

  .search input {
    font-size: 16px;
  }

  .lang-switch {
    padding: 0 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .topbar,
  .sidebar,
  .toc,
  .pager,
  .copy,
  .copy-inline,
  .scrim,
  .skip {
    display: none !important;
  }

  .layout {
    display: block;
  }

  .content {
    padding: 0;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 12pt;
  }

  a {
    color: #000;
  }

  .prose a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    color: #444;
  }
}
