/* docs.sansfer.com: the Sansfer User Guide on the web, in the style of sansfer.com. */
@font-face { font-family: "Archivo"; font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; src: url(/fonts/archivo-100-900-latin.woff2) format("woff2"); }
@font-face { font-family: "Archivo"; font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; src: url(/fonts/archivo-100-900-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+1E00-1EFF, U+20A0-20C4; }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-display: swap; src: url(/fonts/ibm-plex-mono-400-latin.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url(/fonts/ibm-plex-mono-500-latin.woff2) format("woff2"); }

:root {
  color-scheme: light;
  --blue: #4457F0; --blue-ink: #2F3FD0; --blue-light: #9AA6FF; --blue-wash: #EEF0FE;
  --ink: #0D0F22; --muted: #555A75; --faint: #7D8199; --line: #D5D8E5; --paper: #F2F3F7; --white: #FFFFFF;
  --verify: #0B7F53; --verify-wash: #E7F4EE; --amber: #B5650F; --amber-wash: #FDF3E6; --pin: #F0A04B;
  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --top: 64px;
}
* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--top) + 16px); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--white); color: var(--ink); font-family: var(--display); font-size: 16.5px; line-height: 1.6; font-variant-numeric: tabular-nums; }
a { color: var(--blue-ink); text-decoration-thickness: 1px; text-underline-offset: 2px; }
code { font-family: var(--mono); font-size: 0.86em; background: var(--paper); padding: 0.12em 0.4em; border-radius: 4px; overflow-wrap: anywhere; }
pre { font-family: var(--mono); font-size: 0.84rem; line-height: 1.55; background: var(--ink); color: #E9EBF7; padding: 16px 20px; border-radius: 8px; overflow-x: auto; }
kbd { font-family: var(--display); font-size: 0.82em; font-weight: 600; padding: 0.06em 0.45em; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; background: var(--white); white-space: nowrap; }
.ui { font-weight: 650; }
.sr, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { position: fixed; left: 12px; top: 12px; z-index: 50; background: var(--white); padding: 8px 12px; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ---------- Top bar ---------- */
.top { position: sticky; top: 0; z-index: 30; height: var(--top); display: flex; align-items: center; gap: 18px; padding: 0 max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left));
  background: rgba(255, 255, 255, 0.94); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; font-stretch: 118%; font-weight: 800; font-size: 1.18rem; letter-spacing: -0.02em; flex: none; }
.brand em { font-style: normal; font-stretch: 100%; font-weight: 600; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--blue); border: 1.5px solid var(--blue); border-radius: 4px; padding: 1px 6px; }
.menu { display: none; border: 0; background: none; padding: 6px; margin-left: -6px; cursor: pointer; color: var(--ink); }
.menu svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.top-link { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 0.92rem; flex: none; }
.top-link:hover { color: var(--blue); }

/* ---------- Search ---------- */
.search { position: relative; flex: 1; max-width: 560px; margin-left: auto; }
.search input { width: 100%; height: 40px; padding: 0 40px 0 38px; border: 1.5px solid var(--line); border-radius: 9px; background: var(--paper); color: var(--ink); font: inherit; font-size: 0.95rem; }
.search input:focus { outline: none; border-color: var(--blue); background: var(--white); box-shadow: 0 0 0 4px rgba(68, 87, 240, 0.14); }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search-icon { position: absolute; left: 12px; top: 11px; width: 18px; height: 18px; fill: none; stroke: var(--faint); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.search-key { position: absolute; right: 10px; top: 9px; color: var(--faint); }
.search input:focus ~ .search-key, .search input:not(:placeholder-shown) ~ .search-key { display: none; }
.results { position: absolute; left: 0; right: 0; top: calc(100% + 8px); max-height: min(70vh, 560px); overflow-y: auto; background: var(--white); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 24px 60px -20px rgba(13, 15, 34, 0.35); padding: 6px; }
.result { display: block; padding: 10px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.result[aria-selected="true"], .result:hover { background: var(--blue-wash); }
.result .where { display: block; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.02em; color: var(--blue); margin-bottom: 2px; }
.result .title { display: block; font-weight: 700; font-size: 0.98rem; line-height: 1.3; }
.result .snippet { display: block; margin-top: 3px; font-size: 0.86rem; line-height: 1.45; color: var(--muted); }
.result mark { background: rgba(240, 160, 75, 0.32); color: inherit; border-radius: 2px; padding: 0 1px; }
.results .empty { padding: 14px 12px; color: var(--muted); font-size: 0.92rem; }
.results .hint { padding: 8px 12px 4px; color: var(--faint); font-size: 0.78rem; border-top: 1px solid var(--line); margin-top: 4px; }

/* ---------- Layout ---------- */
.layout { display: grid; grid-template-columns: 280px minmax(0, 1fr) 220px; gap: 0 48px; max-width: 1400px; margin: 0 auto; padding: 0 max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left)); }
.layout.wide { grid-template-columns: minmax(0, 1fr); max-width: 1080px; }
main { min-width: 0; padding: 40px 0 72px; }
.nav { position: sticky; top: var(--top); align-self: start; max-height: calc(100vh - var(--top)); overflow-y: auto; padding: 28px 4px 40px 0; font-size: 0.92rem; }
.nav ol { list-style: none; margin: 0 0 6px; padding: 0; }
.nav-part { margin: 20px 0 6px; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--blue); }
.nav-part:first-child { margin-top: 0; }
.nav li > a { display: flex; gap: 10px; padding: 5px 8px; border-radius: 6px; color: var(--ink); text-decoration: none; line-height: 1.35; }
.nav li > a:hover { background: var(--paper); }
.nav .n { flex: none; width: 20px; color: var(--faint); font-stretch: 112%; font-weight: 700; font-size: 0.82rem; padding-top: 1px; }
.nav li.here > a { background: var(--blue-wash); font-weight: 700; color: var(--blue-ink); }
.nav li.here > a .n { color: var(--blue); }
.nav-sections { margin: 4px 0 8px 30px !important; border-left: 2px solid var(--line); }
.nav-sections a { display: block; padding: 3px 10px; font-size: 0.86rem; color: var(--muted) !important; text-decoration: none; }
.nav-sections a:hover { color: var(--ink) !important; }
.nav-sections a.active { color: var(--blue-ink) !important; box-shadow: -2px 0 0 var(--blue); }
.nav-pdf { display: inline-block; margin-top: 16px; padding: 7px 10px; font-weight: 600; font-size: 0.88rem; color: var(--ink); text-decoration: none; border: 1.5px solid var(--ink); border-radius: 6px; }
.nav-pdf:hover { background: var(--ink); color: var(--white); }
.toc { position: sticky; top: var(--top); align-self: start; padding: 40px 0; font-size: 0.86rem; }
.toc p { margin: 0 0 8px; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.toc a { display: block; padding: 4px 12px; color: var(--muted); text-decoration: none; line-height: 1.35; }
.toc a:hover { color: var(--ink); }
.toc a.active { color: var(--blue-ink); font-weight: 600; box-shadow: -2px 0 0 var(--blue); }

/* ---------- Chapter ---------- */
.crumb { margin: 0 0 10px; font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--blue); }
.chapter-head { margin-bottom: 28px; padding-bottom: 22px; border-bottom: 2px solid var(--ink); }
.chapter-head .num { font-stretch: 125%; font-weight: 800; font-size: 2.6rem; line-height: 1; color: var(--blue); }
.chapter-head h1 { margin: 8px 0 12px; font-stretch: 125%; font-weight: 800; font-size: clamp(2rem, 1.4rem + 2.2vw, 2.8rem); line-height: 1.04; letter-spacing: -0.03em; text-wrap: balance; }
.lede { margin: 0; font-size: 1.12rem; line-height: 1.55; color: var(--muted); max-width: 46em; }
article h2 { position: relative; margin: 44px 0 12px; font-stretch: 112%; font-weight: 800; font-size: 1.5rem; line-height: 1.2; letter-spacing: -0.015em; }
article h3 { position: relative; margin: 26px 0 8px; font-size: 1.12rem; }
.anchor { position: absolute; left: -1.1em; width: 1em; color: var(--line); text-decoration: none; font-weight: 600; opacity: 0; }
h2:hover .anchor, h3:hover .anchor, .anchor:focus { opacity: 1; color: var(--blue-light); }
article p, article li, article dd { max-width: 46em; }
article ul, article ol { padding-left: 1.3em; }
article li { margin: 4px 0; }
article li::marker { color: var(--blue); }
dt { font-weight: 700; margin-top: 12px; }
dd { margin: 2px 0 0; }
.pro-tag { display: inline-block; margin-left: 8px; padding: 1px 6px; vertical-align: 0.25em; font-family: var(--display); font-stretch: 100%; font-size: 0.62rem; font-weight: 800; letter-spacing: 0.08em; line-height: 1.5; color: var(--blue); border: 1.5px solid var(--blue); border-radius: 4px; }
ol.steps { list-style: none; padding: 0; counter-reset: step; }
ol.steps > li { counter-increment: step; position: relative; padding-left: 40px; margin: 12px 0; }
ol.steps > li::before { content: counter(step); position: absolute; left: 0; top: 1px; width: 26px; height: 26px; border-radius: 50%; background: var(--blue); color: #fff; font-size: 0.8rem; font-weight: 800; display: flex; align-items: center; justify-content: center; }

figure { margin: 22px 0 26px; }
figure img { display: block; width: 100%; height: auto; border-radius: 10px; border: 1px solid #2A2B33; }
figure.narrow { max-width: 72%; }
figure.half { max-width: 56%; }
figure.third { max-width: 44%; }
figcaption { margin-top: 10px; font-size: 0.88rem; color: var(--muted); }
.fig-n { font-family: var(--mono); font-size: 0.78rem; color: var(--blue); margin-right: 6px; }
.frame { position: relative; }
.pin { position: absolute; width: 24px; height: 24px; margin: -12px 0 0 -12px; border-radius: 50%; background: var(--pin); color: var(--ink); border: 2px solid #fff; font-size: 0.74rem; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.legend { list-style: none; padding: 0 !important; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 28px; }
.legend li { position: relative; padding-left: 32px; font-size: 0.94rem; line-height: 1.45; }
.legend .k { position: absolute; left: 0; top: 1px; width: 22px; height: 22px; border-radius: 50%; background: var(--pin); font-size: 0.72rem; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
.pair figure { margin-top: 6px; }
.pair.settings { grid-template-columns: 0.8fr 1.2fr; }
.pair.settings table { margin-top: 4px; font-size: 0.88rem; }

.box { margin: 18px 0 22px; padding: 14px 18px; border-left: 4px solid var(--blue); background: var(--blue-wash); border-radius: 0 10px 10px 0; max-width: 46em; }
.box p:last-child, .box ul:last-child { margin-bottom: 0; }
.box .t { display: block; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--blue-ink); margin-bottom: 4px; }
.box.safe { border-color: var(--verify); background: var(--verify-wash); }
.box.safe .t { color: var(--verify); }
.box.caution { border-color: #C9761C; background: var(--amber-wash); }
.box.caution .t { color: var(--amber); }

table { width: 100%; border-collapse: collapse; margin: 14px 0 24px; font-size: 0.93rem; line-height: 1.45; display: block; overflow-x: auto; }
table > thead, table > tbody { display: table; width: 100%; border-collapse: collapse; }
table > thead + tbody { display: table-row-group; }
th { text-align: left; font-family: var(--mono); font-weight: 500; font-size: 0.72rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); padding: 8px 12px 8px 0; border-bottom: 2px solid var(--ink); }
td { padding: 9px 12px 9px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
td:first-child { font-weight: 650; }
table.plain td:first-child { font-weight: 400; }
.yes { color: var(--verify); font-weight: 700; }
.no { color: var(--faint); }
.small { font-size: 0.88rem; color: var(--muted); }
.cols { columns: 2; column-gap: 40px; }
.cols dt { break-after: avoid; }
.cols dd { break-inside: avoid; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); }
.pager a { display: grid; gap: 2px; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 700; }
.pager a:hover { border-color: var(--blue); }
.pager span { font-family: var(--mono); font-size: 0.72rem; font-weight: 400; letter-spacing: 0.05em; text-transform: uppercase; color: var(--faint); }
.pager .next { text-align: right; }

/* ---------- Home ---------- */
.hero { padding: 40px 0 28px; }
.eyebrow { margin: 0 0 10px; font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--blue); }
.hero h1 { margin: 0; font-stretch: 125%; font-weight: 800; font-size: clamp(2.6rem, 1.6rem + 4vw, 4.6rem); line-height: 0.98; letter-spacing: -0.035em; }
.hero-lede { margin: 18px 0 0; font-size: 1.18rem; color: var(--muted); max-width: 40em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.btn { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px; border: 2px solid var(--ink); background: var(--ink); color: var(--white); font: inherit; font-weight: 700; font-size: 0.96rem; text-decoration: none; cursor: pointer; }
.btn.line { background: var(--white); color: var(--ink); }
.btn:hover { background: var(--blue); border-color: var(--blue); color: var(--white); }
.btn kbd { color: var(--ink); }
.quick h2, .part h2 { margin: 0 0 6px; font-stretch: 112%; font-weight: 800; font-size: 1.6rem; letter-spacing: -0.015em; }
.quick { padding: 24px 0 8px; }
.quick-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.quick-grid a { display: grid; align-content: start; gap: 4px; padding: 16px; border: 1.5px solid var(--line); border-radius: 12px; color: var(--ink); text-decoration: none; }
.quick-grid a:hover { border-color: var(--blue); }
.quick-grid .n { font-stretch: 125%; font-weight: 800; color: var(--blue); }
.quick-grid .d { font-size: 0.88rem; color: var(--muted); line-height: 1.45; }
.part { padding: 36px 0 4px; border-top: 2px solid var(--ink); margin-top: 32px; }
.part-intro { margin: 0 0 14px; color: var(--muted); max-width: 46em; }
.chapter-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 28px; }
.chapter-list a { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.chapter-list a:hover strong { color: var(--blue-ink); }
.chapter-list .n { flex: none; width: 28px; font-stretch: 125%; font-weight: 800; color: var(--blue); }
.chapter-list .d { display: block; font-size: 0.9rem; color: var(--muted); line-height: 1.45; margin-top: 2px; }

.foot { border-top: 1px solid var(--line); background: var(--paper); padding: 28px max(20px, env(safe-area-inset-left)); font-size: 0.88rem; color: var(--muted); }
.foot > div { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.foot p { margin: 8px 0 0; }
.foot .fine { font-size: 0.78rem; color: var(--faint); }
@keyframes flash { from { background: rgba(240, 160, 75, 0.35); } to { background: transparent; } }
.flash { animation: flash 1.6s ease-out; border-radius: 4px; }

/* ---------- Smaller screens ---------- */
@media (max-width: 1240px) {
  .layout { grid-template-columns: 260px minmax(0, 1fr); gap: 0 40px; }
  .toc { display: none; }
}
@media (max-width: 900px) {
  :root { --top: 58px; }
  .menu { display: inline-flex; }
  .top { gap: 12px; }
  .top-link { display: none; }
  .brand span { display: none; }
  .search { margin-left: 0; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .nav { position: fixed; z-index: 25; top: var(--top); left: 0; bottom: 0; width: min(320px, 86vw); max-height: none; padding: 20px 16px 40px; background: var(--white);
    border-right: 1px solid var(--line); box-shadow: 20px 0 50px -20px rgba(13, 15, 34, 0.3); transform: translateX(-105%); transition: transform 0.25s ease; }
  body.nav-open .nav { transform: none; }
  main { padding-top: 28px; }
  .pair, .pair.settings, .legend, .chapter-list { grid-template-columns: minmax(0, 1fr); }
  figure.narrow, figure.half, figure.third { max-width: 100%; }
  .quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols { columns: 1; }
  .anchor { display: none; }
}
@media (max-width: 520px) {
  body { font-size: 16px; }
  .quick-grid { grid-template-columns: minmax(0, 1fr); }
  .pager { grid-template-columns: minmax(0, 1fr); }
  .pin { width: 18px; height: 18px; margin: -9px 0 0 -9px; font-size: 0.6rem; border-width: 1.5px; }
}
@media (prefers-reduced-motion: reduce) { .nav { transition: none; } }
@media print { .top, .nav, .toc, .pager, .foot { display: none; } .layout { display: block; } }
