@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("https://cdn.jsdelivr.net/fontsource/fonts/bricolage-grotesque:vf@latest/latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url("https://cdn.jsdelivr.net/fontsource/fonts/ibm-plex-mono@5.2.5/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url("https://cdn.jsdelivr.net/fontsource/fonts/ibm-plex-mono@5.2.5/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
}

:root {
  --ink: #16140f;
  --paper: #f6f3ec;
  --seal: #9c2a1c;
  --on-seal: #ffffff;
  --bg: #f6f3ec;
  --fg: #16140f;
  --mute: #5d584d;
  --rule: #d9d3c5;
  --code: #ece7db;
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #12110e;
  --seal: #ff8a70;
  --on-seal: #12110e;
  --fg: #f1ede3;
  --mute: #b4b2a6;
  --rule: #2f2c25;
  --code: #1b1914;
  color-scheme: dark;
}

html, body {
  background: var(--bg);
  color: var(--fg);
  margin: 0;
  overflow-x: clip;
}

body.man {
  font-family: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  max-width: 52rem;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 4rem;
  line-height: 1.55;
}

.manhead, .manfoot {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mute);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.75rem;
  margin-bottom: 2rem;
}

.manfoot {
  border-bottom: 0;
  border-top: 1px solid var(--rule);
  padding-top: 1rem;
  margin-top: 3rem;
  display: flex;
}

h1 {
  font-size: clamp(2.4rem, 8vw, 4.5rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
  font-weight: 680;
  margin: 0 0 1.5rem;
  overflow-wrap: anywhere;
}

h2 {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--seal);
  margin: 2.4rem 0 0.8rem;
  font-weight: 500;
}

h3 {
  font-size: 1.05rem;
  margin: 1.6rem 0 0.4rem;
}

p, li { color: var(--fg); }
p { margin: 0 0 0.9rem; }

a { color: var(--seal); text-decoration: none; }
a:hover { text-decoration: underline; }

code, pre {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}

code {
  font-size: 0.88em;
  color: var(--seal);
}

pre {
  background: var(--code);
  border: 1px solid var(--rule);
  padding: 1rem 1.1rem;
  overflow-x: auto;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  color: var(--fg);
  font-size: 0.86rem;
}

pre code { color: var(--fg); }

.table-wrap {
  overflow-x: auto;
  margin: 1rem 0 1.5rem;
}

table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  margin: 1rem 0 1.5rem;
  display: block;
  overflow-x: auto;
}

th, td {
  border: 1px solid var(--rule);
  padding: 0.65rem 0.75rem;
  text-align: left;
  vertical-align: top;
}

th { color: var(--seal); font-weight: 600; }

ul { padding-left: 1.2rem; }

.theme-btn {
  min-height: 44px;
  min-width: 44px;
  padding: 0 0.75rem;
  border: 1px solid var(--rule);
  background: var(--code);
  color: var(--fg);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}

.theme-btn:hover {
  background: var(--seal);
  color: var(--on-seal);
}

.theme-btn .when-dark { display: none; }
html[data-theme="dark"] .theme-btn .when-light { display: none; }
html[data-theme="dark"] .theme-btn .when-dark { display: inline; }
