/* Darkhelp — colour-block briefing. Order: reset, tokens, base, layout, components, utilities, responsive. */

/* --- reset --- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body { margin: 0; }
img, svg { max-width: 100%; height: auto; display: block; }
table { border-collapse: collapse; border-spacing: 0; }
button, input { font: inherit; }
a { color: inherit; }

/* --- tokens --- */
:root {
  --bg: oklch(0.955 0.038 55);
  --bg-ink: oklch(0.205 0.048 20);
  --bg-oxblood: oklch(0.36 0.128 22);
  --bg-slate: oklch(0.88 0.032 50);
  --bg-ochre: oklch(0.78 0.12 75);
  --surface: oklch(0.93 0.042 55);
  --text: oklch(0.22 0.034 30);
  --text-muted: oklch(0.36 0.038 30);
  --text-on-ink: oklch(0.945 0.022 60);
  --text-muted-on-ink: oklch(0.82 0.03 60);
  --text-on-oxblood: oklch(0.96 0.02 65);
  --text-on-ochre: oklch(0.20 0.04 30);
  --primary: oklch(0.40 0.138 22);
  --primary-hover: oklch(0.30 0.12 22);
  --primary-active: oklch(0.26 0.10 20);
  --link-on-ink: oklch(0.84 0.12 78);
  --link-on-ink-hover: oklch(0.90 0.10 78);
  --link-on-oxblood: oklch(0.90 0.08 80);
  --accent-dispute: oklch(0.42 0.148 38);
  --accent-record: oklch(0.38 0.078 215);
  --focus: oklch(0.48 0.15 40);
  --focus-on-ink: oklch(0.84 0.12 78);
  --border: oklch(0.50 0.04 40);
  --rule: oklch(0.22 0.034 30);
  --font-display: Archivo, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: Literata, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
  --measure: 66ch;
  --rail: 15rem;
  --page: 78rem;
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: 4.5rem;
  --step-0: clamp(1.0625rem, 1rem + 0.25vw, 1.125rem);
  --step-1: 1.2rem;
  --step-2: clamp(1.45rem, 1.2rem + 1.2vw, 2rem);
  --step-3: clamp(2.1rem, 1.5rem + 3.2vw, 3.75rem);
  --r-0: 0;
  --r-2: 2px;
  --grain: radial-gradient(oklch(0.22 0.03 30 / 0.045) 0.6px, transparent 0.7px);
}

@font-face {
  font-family: Archivo;
  src: url("/assets/fonts/archivo-latin-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+2010-2027, U+20AC, U+2212;
}

@font-face {
  font-family: Literata;
  src: url("/assets/fonts/literata-latin-wght.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+2010-2027, U+20AC, U+2212;
}

/* --- base --- */
html { background: var(--bg-ink); }
body {
  background-color: var(--bg);
  background-image: var(--grain);
  background-size: 18px 18px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--step-0);
  font-weight: 450;
  line-height: 1.6;
}
h1, h2, h3 {
  font-family: var(--font-display);
  text-wrap: balance;
  margin: 0 0 var(--s-4);
}
h1 {
  font-size: var(--step-3);
  font-weight: 750;
  line-height: 1.05;
  letter-spacing: -0.02em;
}
h2 {
  font-size: var(--step-2);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin-top: var(--s-7);
}
h3 {
  font-size: var(--step-1);
  font-weight: 650;
  line-height: 1.25;
  margin-top: var(--s-5);
}
p, li, dd { text-wrap: pretty; }
p { margin: 0 0 var(--s-4); }
ul, ol { margin: 0 0 var(--s-4); padding-left: 1.25rem; }
li + li { margin-top: var(--s-2); }

/* --- layout --- */
.skip-link {
  position: absolute;
  left: var(--s-3);
  top: var(--s-3);
  z-index: 20;
  min-height: 44px;
  min-width: 44px;
  padding: var(--s-2) var(--s-4);
  background: var(--bg-ochre);
  color: var(--text-on-ochre);
  font-family: var(--font-display);
  font-weight: 700;
  text-decoration: none;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
}
.skip-link:focus-visible {
  clip: auto;
  clip-path: none;
}

header {
  background-color: var(--bg-ink);
  background-image: var(--grain);
  background-size: 18px 18px;
  color: var(--text-on-ink);
  padding: var(--s-3) var(--s-4);
  border-bottom: 6px solid var(--bg-ochre);
}
.nav-open {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.nav-open:focus,
.nav-open:focus-visible {
  clip: auto;
  clip-path: none;
  width: 44px;
  height: 44px;
  margin: 0;
  overflow: visible;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  z-index: 21;
}
.masthead-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-3);
  max-width: var(--page);
  margin-inline: auto;
}
.masthead { min-width: 0; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--text-on-ink);
  text-decoration: none;
}
.brand-mark {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: block;
}
.brand:hover { color: var(--link-on-ink-hover); }
.brand-tag {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-muted-on-ink);
}
.nav-open-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: var(--s-2) var(--s-4);
  margin-top: 0.1rem;
  background: var(--bg-ochre);
  color: var(--text-on-ochre);
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
}
.nav-open-hide { display: none; }
.nav-open:checked ~ .masthead-bar .nav-open-show { display: none; }
.nav-open:checked ~ .masthead-bar .nav-open-hide { display: inline; }
.nav-open:checked ~ .masthead-bar .nav-open-btn {
  background: var(--bg-oxblood);
  color: var(--text-on-oxblood);
}
.nav-open:focus-visible ~ .masthead-bar .nav-open-btn {
  outline: 2px solid var(--focus-on-ink);
  outline-offset: 3px;
}
header nav[aria-label="Primary"] {
  display: none;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  max-width: var(--page);
  margin: var(--s-3) auto 0;
  padding-top: var(--s-2);
  border-top: 1px solid oklch(0.82 0.03 60 / 0.28);
}
.nav-open:checked ~ nav[aria-label="Primary"] { display: flex; }
header nav[aria-label="Primary"] a,
.nav-guides > summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  padding: var(--s-2) var(--s-3);
  color: var(--link-on-ink);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.nav-guides > summary {
  list-style: none;
  cursor: pointer;
}
.nav-guides > summary::-webkit-details-marker { display: none; }
header nav[aria-label="Primary"] a:hover,
.nav-guides > summary:hover {
  color: var(--link-on-ink-hover);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
header nav[aria-label="Primary"] a:active,
.nav-guides > summary:active { color: var(--text-on-ink); }
header nav[aria-label="Primary"] a[aria-current="page"] {
  background: var(--bg-oxblood);
  color: var(--text-on-oxblood);
}
.nav-guides {
  display: flex;
  flex-direction: column;
}
.nav-guides > summary { display: none; }
.nav-guides:not([open]) .nav-guides-panel { display: none; }
.nav-guides[open] .nav-guides-panel {
  display: flex;
  flex-direction: column;
  padding: 0 0 var(--s-2) var(--s-3);
  border-left: 3px solid var(--bg-ochre);
  margin: var(--s-1) 0 var(--s-2);
}
.nav-guides-panel a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted-on-ink);
}
.nav-guides-panel a:hover { color: var(--link-on-ink-hover); }
.nav-guides.is-current > summary {
  background: var(--bg-oxblood);
  color: var(--text-on-oxblood);
}

nav[aria-label="Breadcrumb"] {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: var(--s-2) var(--s-4);
  font-family: var(--font-display);
  font-size: 0.8125rem;
}
nav[aria-label="Breadcrumb"] ol {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: var(--page);
}
nav[aria-label="Breadcrumb"] li { margin: 0; }
nav[aria-label="Breadcrumb"] li:not(:last-child)::after {
  content: "/";
  margin-left: var(--s-2);
  color: var(--text-muted);
}
nav[aria-label="Breadcrumb"] a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--primary);
}
nav[aria-label="Breadcrumb"] [aria-current="page"] { color: var(--text); font-weight: 650; }

.page-shell {
  max-width: var(--page);
  margin-inline: auto;
  padding: 0 var(--s-4) var(--s-8);
}
.toc-rail:empty { display: none; }
.toc-rail nav {
  margin: var(--s-5) 0;
  padding: var(--s-4);
  background: var(--bg);
  border: 2px solid var(--bg-ink);
}
.toc-rail ol {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: toc;
}
.toc-rail li { margin: 0; }
.toc-rail a {
  display: flex;
  align-items: flex-start;
  gap: var(--s-2);
  min-height: 44px;
  padding: var(--s-2) 0;
  color: var(--primary);
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 550;
  text-decoration: none;
  line-height: 1.3;
}
.toc-rail a::before {
  counter-increment: toc;
  content: counter(toc, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-record);
  min-width: 1.6em;
}
.toc-rail a:hover { color: var(--primary-hover); text-decoration: underline; }
.toc-rail a:active { color: var(--primary-active); }

article { max-width: var(--measure); }

article > h1 {
  background: var(--bg-ink);
  color: var(--text-on-ink);
  margin: 0 calc(-1 * var(--s-4)) var(--s-6);
  padding: var(--s-6) var(--s-4);
}
article > h1::before {
  display: block;
  margin-bottom: var(--s-3);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--link-on-ink);
}
.page-home article > h1::before { content: "The 2026 map"; }
.page-darknet-markets article > h1::before { content: "The catalog"; }
.page-darknet-economy article > h1::before { content: "The money system"; }
.page-darknet-crypto article > h1::before { content: "The rails"; }
.page-torzon-market article > h1::before,
.page-nexus-darknet-market article > h1::before,
.page-drughub-market article > h1::before,
.page-we-the-north-darknet article > h1::before,
.page-black-ops-darknet-market article > h1::before,
.page-darkmatter-dark-web article > h1::before { content: "Named shop"; }
.page-darknet-news article > h1::before { content: "The briefing"; }
.page-darknet-forums article > h1::before { content: "The rooms"; }
.page-useful-links article > h1::before { content: "Public-interest onions"; }
.page-about article > h1::before { content: "Who publishes this"; }
.page-privacy article > h1::before { content: "What is collected"; }
.page-disclaimer article > h1::before { content: "The limits"; }

.page-trust h1 { font-size: clamp(1.7rem, 1.4rem + 1.6vw, 2.4rem); }

article > section { margin-bottom: var(--s-6); }

/* --- components --- */
article a {
  color: var(--primary);
  text-decoration: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.16em;
  text-decoration-skip-ink: auto;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
article p a,
article li a,
article dd a,
article dt a,
article td a,
article th a,
article figcaption a,
article blockquote a {
  display: inline-block;
  max-width: 100%;
  vertical-align: baseline;
}
article a:hover {
  color: var(--primary-hover);
  text-decoration-thickness: 0.12em;
}
article a:active { color: var(--primary-active); }

article aside:has(> h2) {
  background: var(--bg-oxblood);
  color: var(--text-on-oxblood);
  margin: var(--s-6) calc(-1 * var(--s-4));
  padding: var(--s-5) var(--s-4);
}
article aside:has(> h2) h2 {
  margin-top: 0;
  color: var(--text-on-oxblood);
  font-size: clamp(1.2rem, 1.1rem + 0.6vw, 1.5rem);
}
article aside:has(> h2) a { color: var(--link-on-oxblood); }
article aside:has(> h2) a:hover { color: var(--text-on-oxblood); }
article aside:has(> h2) code {
  background: oklch(0.28 0.08 22);
  color: var(--text-on-oxblood);
}

article aside:not(:has(> h2)) {
  background: var(--bg-ochre);
  color: var(--text-on-ochre);
  margin: var(--s-5) 0;
  padding: var(--s-4) var(--s-4) var(--s-4) var(--s-5);
  border-left: 6px solid var(--accent-dispute);
}
article aside:not(:has(> h2)) a { color: var(--primary); }
article aside:not(:has(> h2)) p:last-child { margin-bottom: 0; }

article table {
  width: 100%;
  max-width: none;
  margin: var(--s-5) 0 var(--s-6);
  background: var(--bg-slate);
  border-top: 3px solid var(--rule);
  font-variant-numeric: tabular-nums;
}
article caption {
  caption-side: top;
  text-align: left;
  padding: var(--s-3) var(--s-3) var(--s-2);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-slate);
}
article th, article td {
  padding: 0.65em 0.75em;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}
article thead th {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-slate);
}
article tbody th {
  font-family: var(--font-display);
  font-weight: 650;
}
article tbody tr:hover { background: var(--surface); }

article dl { margin: 0 0 var(--s-5); }
article dt {
  font-family: var(--font-display);
  font-weight: 700;
  margin-top: var(--s-4);
  padding-bottom: 2px;
  box-shadow: inset 0 -3px 0 var(--accent-record);
  display: inline-block;
}
article dd {
  margin: var(--s-2) 0 0;
  padding: 0 0 var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--border);
}

article ol {
  list-style: none;
  padding-left: 0;
  counter-reset: step;
}
article ol > li {
  position: relative;
  padding-left: 2.6rem;
  margin-bottom: var(--s-4);
}
article ol > li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 750;
  line-height: 1;
  color: var(--bg-oxblood);
}

article figure {
  margin: var(--s-6) 0;
  background: var(--bg-ink);
  color: var(--text-on-ink);
  padding: var(--s-3);
  border: 2px solid var(--link-on-ink);
}
article figure img {
  width: 100%;
  height: auto;
  background: var(--surface);
}
article figure svg { width: 100%; height: auto; color: var(--text-on-ink); }
article figcaption {
  margin-top: var(--s-3);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--link-on-ink);
}
article figure:has(> svg) {
  background: var(--bg-slate);
  border-color: var(--bg-ink);
  color: var(--text);
}
article figure:has(> svg) svg { color: var(--text); }
article figure:has(> svg) figcaption { color: var(--text-muted); }

article svg rect[fill="#d9d3c4"] { fill: var(--bg-slate); }
article svg rect[fill="#b7b0a0"] { fill: var(--bg-ochre); }
article svg rect[fill="#3d3a36"] { fill: var(--bg-ink); }
article svg [stroke="#2a2722"] { stroke: var(--text); }
article svg text[fill="#2a2722"] { fill: var(--text); }
article svg text[fill="#f4efe4"] { fill: var(--text-on-ink); }

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  color: var(--accent-record);
  background: var(--surface);
  padding: 0.05em 0.3em;
  border-radius: var(--r-2);
  overflow-wrap: anywhere;
}
time {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--accent-record);
}
.page-updated {
  font-family: var(--font-display);
  font-size: 0.875rem;
  color: var(--text-muted);
}

blockquote {
  margin: var(--s-5) 0;
  padding: var(--s-2) 0 var(--s-2) var(--s-5);
  border-left: 6px solid var(--bg-oxblood);
  font-size: 1.2rem;
  font-weight: 500;
  line-height: 1.45;
}
article footer,
blockquote footer {
  margin-top: var(--s-3);
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
}

h2:target, h3:target {
  box-shadow: inset 6px 0 0 var(--bg-ochre);
  padding-left: var(--s-3);
}

footer.site-end {
  background-color: var(--bg-ink);
  background-image: var(--grain);
  background-size: 18px 18px;
  color: var(--text-muted-on-ink);
  padding: var(--s-7) var(--s-4) var(--s-6);
  padding-bottom: calc(var(--s-6) + env(safe-area-inset-bottom, 0px));
  border-top: 6px solid var(--bg-oxblood);
}
.footer-inner {
  display: grid;
  gap: var(--s-6);
  max-width: var(--page);
  margin-inline: auto;
}
.footer-brand .brand { margin-bottom: var(--s-1); }
.footer-brand .brand-tag { margin-bottom: var(--s-3); }
.footer-stand {
  margin: 0;
  max-width: 36ch;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text-on-ink);
}
footer.site-end nav[aria-label="Footer"] {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-5);
}
.footer-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}
.footer-label {
  margin: 0 0 var(--s-2);
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bg-ochre);
}
footer.site-end nav[aria-label="Footer"] a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--link-on-ink);
  font-family: var(--font-display);
  font-weight: 600;
  text-decoration: none;
}
footer.site-end nav[aria-label="Footer"] a:hover {
  color: var(--link-on-ink-hover);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
footer.site-end nav[aria-label="Footer"] a:active { color: var(--text-on-ink); }
.footer-end {
  max-width: var(--page);
  margin: var(--s-6) auto 0;
  padding-top: var(--s-4);
  border-top: 1px solid oklch(0.82 0.03 60 / 0.28);
  font-family: var(--font-display);
  font-size: 0.875rem;
  color: var(--text-muted-on-ink);
}

.to-top {
  position: fixed;
  right: var(--s-4);
  bottom: calc(var(--s-4) + env(safe-area-inset-bottom, 0px));
  z-index: 20;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: var(--s-2) var(--s-4);
  background: var(--bg-ochre);
  color: var(--text-on-ochre);
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-decoration: none;
}
.to-top:hover {
  background: var(--bg-oxblood);
  color: var(--text-on-oxblood);
}
.to-top:active {
  background: var(--bg-ink);
  color: var(--link-on-ink);
}
.to-top:focus-visible {
  outline: 2px solid var(--bg-ink);
  outline-offset: 3px;
}
.to-top[hidden] { display: none; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}
header :focus-visible,
footer :focus-visible,
article > h1 a:focus-visible,
article aside:has(> h2) a:focus-visible,
article figure a:focus-visible {
  outline-color: var(--focus-on-ink);
}

[hidden], [disabled] { cursor: not-allowed; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* --- utilities --- */
.page-home article > figure:first-of-type {
  margin-left: calc(-1 * var(--s-4));
  margin-right: calc(-1 * var(--s-4));
}

article figure.figure-inset {
  max-width: min(38rem, 100%);
  margin-left: auto;
  margin-right: 0;
}
article figure.figure-portrait {
  max-width: min(26rem, 100%);
  margin-inline: auto;
}
@media (min-width: 48rem) {
  article figure.figure-pull-start {
    margin-left: calc(-1 * var(--s-2));
    margin-right: var(--s-6);
    max-width: min(44rem, 100%);
  }
}

/* --- responsive --- */
@media (max-width: 47.99rem) {
  .nav-guides[open]::before {
    content: "Guides";
    display: block;
    padding: var(--s-3) var(--s-3) var(--s-1);
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 650;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--bg-ochre);
  }
  article table {
    font-size: 0.92rem;
  }
  article th, article td {
    padding: 0.55em 0.55em;
  }
}

@media (min-width: 40rem) {
  header { padding-inline: var(--s-6); }
  .page-shell { padding-inline: var(--s-6); }
  nav[aria-label="Breadcrumb"] { padding-inline: var(--s-6); }
  footer.site-end { padding-inline: var(--s-6); }
  .to-top {
    right: var(--s-6);
    bottom: calc(var(--s-6) + env(safe-area-inset-bottom, 0px));
  }
  footer.site-end nav[aria-label="Footer"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  article > h1,
  article aside:has(> h2),
  .page-home article > figure:first-of-type {
    margin-left: calc(-1 * var(--s-6));
    margin-right: calc(-1 * var(--s-6));
    padding-left: var(--s-6);
    padding-right: var(--s-6);
  }
  article thead th { position: sticky; top: 0; z-index: 1; }
}

@media (min-width: 48rem) {
  .nav-open,
  .nav-open-btn { display: none; }
  header nav[aria-label="Primary"] {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--s-1) var(--s-2);
    margin-top: var(--s-3);
    padding-top: 0;
    border-top: 0;
  }
  header nav[aria-label="Primary"] a,
  .nav-guides > summary {
    display: inline-flex;
    width: auto;
    font-size: 0.95rem;
  }
  .nav-guides {
    position: relative;
    display: block;
  }
  .nav-guides > summary {
    display: inline-flex;
  }
  .nav-guides > summary::after {
    content: "▾";
    margin-left: 0.4em;
    font-size: 0.7em;
  }
  .nav-guides[open] .nav-guides-panel {
    position: absolute;
    top: calc(100% - 2px);
    left: 0;
    z-index: 12;
    min-width: 14rem;
    margin: 0;
    padding: var(--s-2);
    background: var(--bg-ink);
    border: 2px solid var(--bg-ochre);
    border-left-width: 2px;
  }
  .nav-guides-panel a {
    width: 100%;
    font-size: 0.875rem;
  }
  .footer-inner {
    grid-template-columns: minmax(14rem, 1.1fr) minmax(0, 2fr);
    gap: var(--s-7);
    align-items: start;
  }
  footer.site-end nav[aria-label="Footer"] {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--s-5);
  }
}

@media (min-width: 68rem) {
  .page-shell {
    display: grid;
    grid-template-columns: var(--rail) minmax(0, var(--measure));
    column-gap: var(--s-6);
    justify-content: start;
    padding-top: var(--s-5);
  }
  .toc-rail {
    grid-column: 1;
    grid-row: 1;
    position: sticky;
    top: var(--s-4);
    align-self: start;
    max-height: calc(100vh - var(--s-6));
    overflow: auto;
  }
  .page-shell > article { grid-column: 2; grid-row: 1; }
  .toc-rail nav { margin-top: 0; }
  article > h1,
  article aside:has(> h2),
  .page-home article > figure:first-of-type {
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
  }
}

@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  a, .brand {
    transition: color 160ms ease, background-color 160ms ease, text-decoration-thickness 160ms ease;
  }
}
