/* Project AB website. No external fonts or resources. */

/* ---- Tokens ----------------------------------------------------------- */

:root {
  color-scheme: light;
  --bg: #faf9f7;
  --bg-elev: #ffffff;
  --bg-sunken: #f1ede7;
  --text: #1b1917;
  --text-muted: #57534e;
  --border: #e3ded6;
  --border-strong: #cfc8bd;
  --accent: #b4400b;
  --accent-hover: #933409;
  --accent-soft: #fbeee6;
  --on-accent: #ffffff;
  --ok: #15803d;
  --ok-soft: #e7f5ec;
  --warn: #a15c07;
  --warn-soft: #fdf3dc;
  --mark-bg: #fff1a8;
  --mark-text: #3d2f00;
  --code-bg: #f1ede7;
  --shadow: 0 1px 2px rgb(28 25 23 / 0.06), 0 8px 24px rgb(28 25 23 / 0.08);
  --focus: #1d4ed8;

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --radius: 10px;
  --radius-lg: 16px;
  --gutter: clamp(16px, 4vw, 32px);
  --measure: 70ch;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #12110f;
    --bg-elev: #1b1a17;
    --bg-sunken: #0c0b0a;
    --text: #ece8e2;
    --text-muted: #aaa49c;
    --border: #2f2c28;
    --border-strong: #45413b;
    --accent: #fb8c4c;
    --accent-hover: #fdab7b;
    --accent-soft: #2e1a0f;
    --on-accent: #1b1917;
    --ok: #4ade80;
    --ok-soft: #12261a;
    --warn: #fbbf24;
    --warn-soft: #2b2108;
    --mark-bg: #5c4a00;
    --mark-text: #fff6c7;
    --code-bg: #1f1d1a;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 8px 24px rgb(0 0 0 / 0.35);
    --focus: #93b4ff;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #12110f;
  --bg-elev: #1b1a17;
  --bg-sunken: #0c0b0a;
  --text: #ece8e2;
  --text-muted: #aaa49c;
  --border: #2f2c28;
  --border-strong: #45413b;
  --accent: #fb8c4c;
  --accent-hover: #fdab7b;
  --accent-soft: #2e1a0f;
  --on-accent: #1b1917;
  --ok: #4ade80;
  --ok-soft: #12261a;
  --warn: #fbbf24;
  --warn-soft: #2b2108;
  --mark-bg: #5c4a00;
  --mark-text: #fff6c7;
  --code-bg: #1f1d1a;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 8px 24px rgb(0 0 0 / 0.35);
  --focus: #93b4ff;
}

/* ---- Base ------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 5rem;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

img,
svg {
  max-width: 100%;
}

h1,
h2,
h3,
h4 {
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 2em 0 0.6em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.1rem, 1.4rem + 3vw, 3.4rem);
  letter-spacing: -0.03em;
  margin-top: 0;
}

h2 {
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
}

h3 {
  font-size: 1.2rem;
}

p,
ul,
ol,
dl,
pre,
table,
figure {
  margin: 0 0 1.1em;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent-hover);
  text-decoration-thickness: 2px;
}

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

main:focus {
  outline: none;
}

code,
kbd,
pre {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

:not(pre) > code {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0.08em 0.35em;
  white-space: break-spaces;
}

kbd {
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 0.05em 0.4em;
  background: var(--bg-elev);
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

mark.placeholder {
  background: var(--mark-bg);
  color: var(--mark-text);
  padding: 0 0.25em;
  border-radius: 3px;
  font-weight: 600;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 100;
  background: var(--accent);
  color: var(--on-accent);
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 0.75rem;
  color: var(--on-accent);
}

.container {
  width: 100%;
  max-width: 74rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

.muted {
  color: var(--text-muted);
}

/* ---- Header ----------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: 1px solid var(--border);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 4rem;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.08rem;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
  margin-right: auto;
}

.brand:hover {
  color: var(--text);
}

.brand__mark {
  width: 30px;
  height: 30px;
  flex: none;
}

.brand__bg {
  fill: var(--accent);
}

.brand__fg {
  fill: var(--on-accent);
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  display: block;
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 550;
  font-size: 0.97rem;
}

.site-nav a:hover {
  color: var(--text);
  background: var(--bg-sunken);
}

.site-nav a[aria-current="page"] {
  color: var(--text);
  background: var(--bg-sunken);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.nav-toggle,
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-width: 44px;
  min-height: 44px;
  padding: 0 0.6rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elev);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  cursor: pointer;
}

.nav-toggle[hidden],
.theme-toggle[hidden] {
  display: none;
}

.nav-toggle:hover,
.theme-toggle:hover {
  border-color: var(--border-strong);
}

.nav-toggle svg,
.theme-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-toggle .icon-sun {
  display: none;
}

.theme-toggle[aria-pressed="true"] .icon-sun {
  display: block;
}

.theme-toggle[aria-pressed="true"] .icon-moon {
  display: none;
}

@media (min-width: 52.01rem) {
  .nav-toggle {
    display: none !important;
  }
}

@media (max-width: 52rem) {
  .js .site-nav {
    display: none;
    order: 10;
    flex-basis: 100%;
    padding-bottom: 0.75rem;
  }

  .js .site-nav.is-open {
    display: block;
  }

  .site-nav ul {
    flex-direction: column;
  }

  .js .site-nav a {
    padding: 0.7rem 0.8rem;
  }

  html:not(.js) .site-nav {
    flex-basis: 100%;
    padding-bottom: 0.5rem;
  }

  html:not(.js) .site-nav ul {
    flex-direction: row;
  }
}

/* ---- Footer ----------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-sunken);
  margin-top: 5rem;
  padding-block: 2.5rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.site-footer__inner {
  display: grid;
  gap: 0.75rem 2rem;
  grid-template-columns: 1fr auto;
  align-items: start;
}

.site-footer p {
  margin: 0;
}

.site-footer strong {
  color: var(--text);
}

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer a {
  color: var(--text-muted);
}

.site-footer a:hover,
.site-footer a[aria-current="page"] {
  color: var(--text);
}

.site-footer__note {
  grid-column: 1 / -1;
}

@media (max-width: 40rem) {
  .site-footer__inner {
    grid-template-columns: 1fr;
  }
}

/* ---- Buttons ---------------------------------------------------------- */

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.65rem 1.15rem;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 600;
  text-decoration: none;
  line-height: 1.2;
}

.button--primary {
  background: var(--accent);
  color: var(--on-accent);
}

.button--primary:hover {
  background: var(--accent-hover);
  color: var(--on-accent);
}

.button--ghost {
  border-color: var(--border-strong);
  color: var(--text);
  background: var(--bg-elev);
}

.button--ghost:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.75rem 0 0;
}

/* ---- Page header (inner pages) --------------------------------------- */

.page-head {
  padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(1.5rem, 3vw, 2.5rem);
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.5rem;
}

.page-head .eyebrow {
  margin-bottom: 0.75rem;
}

.page-head p.lead {
  margin-bottom: 0;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1rem;
}

.lead {
  font-size: clamp(1.1rem, 1rem + 0.5vw, 1.3rem);
  color: var(--text-muted);
  max-width: 60ch;
  line-height: 1.55;
}

/* ---- Hero ------------------------------------------------------------- */

.hero {
  padding-block: clamp(3rem, 8vw, 6rem) clamp(2.5rem, 6vw, 4.5rem);
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.hero h1 {
  max-width: 18ch;
}

.hero h1 em {
  font-style: normal;
  color: var(--accent);
}

.hero__status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 1.5rem 0 0;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.hero__status::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 4px var(--ok-soft);
  flex: none;
}

@media (max-width: 56rem) {
  .hero__grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Illustrative browser window, drawn with CSS. */
.window {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--bg-elev);
  box-shadow: var(--shadow);
  overflow: hidden;
  font-size: 0.85rem;
}

.window__tabs {
  display: flex;
  gap: 0.3rem;
  padding: 0.55rem 0.6rem 0;
  background: var(--bg-sunken);
}

.window__tab {
  padding: 0.4rem 0.9rem;
  border-radius: 8px 8px 0 0;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 11rem;
}

.window__tab--active {
  background: var(--bg-elev);
  color: var(--text);
  font-weight: 600;
}

.window__bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.window__buttons {
  display: flex;
  gap: 0.25rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  letter-spacing: 0.2em;
}

.window__address {
  flex: 1;
  min-width: 0;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: var(--bg-sunken);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.window__page {
  padding: clamp(1.25rem, 4vw, 2.25rem);
  background: #f0f0f2;
  color: #222;
  min-height: 15rem;
  display: grid;
  place-items: center;
}

.window__doc {
  max-width: 24rem;
  background: #fdfdff;
  border-radius: 0.5em;
  padding: 1.25rem 1.5rem;
  box-shadow: 2px 3px 7px 2px rgb(0 0 0 / 0.04);
}

.window__doc strong {
  display: block;
  font-size: 1.35rem;
  margin-bottom: 0.4rem;
  font-family: var(--font-sans);
}

.window__doc span {
  display: block;
  color: #333;
  line-height: 1.5;
}

.window__doc u {
  color: #38488f;
}

.window__status {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.35rem 0.75rem;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ---- Sections --------------------------------------------------------- */

.section {
  padding-block: clamp(2.5rem, 6vw, 4.5rem);
}

.section--alt {
  background: var(--bg-sunken);
  border-block: 1px solid var(--border);
}

.section > .container > h2:first-child,
.section-head h2 {
  margin-top: 0;
}

.section-head {
  max-width: 46rem;
  margin-bottom: 2rem;
}

.section-head p {
  color: var(--text-muted);
}

/* Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 0;
}

.stats > div {
  background: var(--bg-elev);
  padding: 1.25rem 1.4rem;
}

.stats dt {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.stats dd {
  margin: 0;
  order: -1;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.stats > div {
  display: flex;
  flex-direction: column;
}

.stats dd small {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0;
}

/* Pipeline */
.pipeline {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14.5rem, 1fr));
  gap: 0.9rem;
  counter-reset: stage;
}

.pipeline li {
  counter-increment: stage;
  position: relative;
  padding: 1.1rem 1.2rem 1.15rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elev);
}

.pipeline li::before {
  content: counter(stage, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 700;
}

.pipeline h3 {
  margin: 0.2rem 0 0.35rem;
  font-size: 1.05rem;
}

.pipeline p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.pipeline .crate {
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

/* Cards */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 1rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-elev);
  padding: 1.4rem 1.5rem;
  display: flex;
  flex-direction: column;
}

.card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}

.card p {
  color: var(--text-muted);
  margin-bottom: 0.9rem;
  font-size: 0.97rem;
}

.card a.more {
  margin-top: auto;
  font-weight: 600;
  font-size: 0.95rem;
}

.card__icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--accent-soft);
  display: grid;
  place-items: center;
  margin-bottom: 0.9rem;
}

.card__icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Rules list */
.rules {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 0.5rem 2rem;
  list-style: none;
  padding: 0;
}

.rules li {
  padding: 0.8rem 0 0.8rem 2rem;
  border-top: 1px solid var(--border);
  position: relative;
}

.rules li::before {
  content: "";
  position: absolute;
  left: 0.2rem;
  top: 1.15rem;
  width: 0.9rem;
  height: 0.5rem;
  border-left: 2.5px solid var(--ok);
  border-bottom: 2.5px solid var(--ok);
  transform: rotate(-45deg);
}

.callout {
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  background: var(--bg-elev);
  padding: 1.1rem 1.3rem;
  margin: 1.5rem 0;
}

.callout > :last-child {
  margin-bottom: 0;
}

.callout--warn {
  border-left-color: var(--warn);
  background: var(--warn-soft);
}

.callout h3,
.callout h2 {
  margin-top: 0;
  font-size: 1.05rem;
}

.cta {
  text-align: center;
  padding: clamp(2rem, 5vw, 3.5rem) var(--gutter);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(60rem 18rem at 50% -6rem, var(--accent-soft), transparent 70%),
    var(--bg-elev);
}

.cta h2 {
  margin-top: 0;
}

.cta p {
  color: var(--text-muted);
  max-width: 48ch;
  margin-inline: auto;
}

.cta .button-row {
  justify-content: center;
}

/* ---- Two-column docs layout ------------------------------------------ */

.with-toc {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
}

.toc {
  position: sticky;
  top: 5.5rem;
  font-size: 0.93rem;
  max-height: calc(100vh - 7rem);
  overflow: auto;
  padding-right: 0.5rem;
}

.toc h2 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 0 0 0.6rem;
}

.toc ol,
.toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc li {
  margin: 0;
}

.toc a {
  display: block;
  padding: 0.3rem 0.6rem;
  border-left: 2px solid var(--border);
  color: var(--text-muted);
  text-decoration: none;
}

.toc a:hover {
  color: var(--text);
  border-left-color: var(--accent);
}

@media (max-width: 56rem) {
  .with-toc {
    grid-template-columns: minmax(0, 1fr);
  }

  .toc {
    position: static;
    max-height: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    background: var(--bg-elev);
  }
}

.content > h2:first-child,
.content > section:first-child > h2:first-child {
  margin-top: 0;
}

.content section + section {
  margin-top: 1rem;
}

.content p,
.content ul,
.content ol {
  max-width: var(--measure);
}

/* ---- Code ------------------------------------------------------------- */

pre.code-block {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.95rem 1.1rem;
  overflow-x: auto;
  line-height: 1.55;
  font-size: 0.88rem;
  tab-size: 4;
}

pre.code-block code {
  white-space: pre;
}

.code-wrap {
  position: relative;
  margin-bottom: 1.1em;
}

.code-wrap pre.code-block {
  margin: 0;
  padding-right: 5rem;
}

.copy-button {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  min-height: 32px;
  padding: 0.2rem 0.7rem;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  background: var(--bg-elev);
  color: var(--text-muted);
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}

.copy-button:hover {
  color: var(--text);
}

.code-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0 0 0.35rem;
}

figure.diagram pre {
  margin: 0;
}

figure.diagram figcaption {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* ---- Tables ----------------------------------------------------------- */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}

table {
  border-collapse: collapse;
  width: 100%;
  margin: 0;
  font-size: 0.95rem;
}

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

thead th {
  background: var(--bg-sunken);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

tbody tr:last-child > * {
  border-bottom: 0;
}

td code,
th code {
  white-space: nowrap;
}

/* ---- Steps ------------------------------------------------------------ */

.steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 0 0 1.5rem;
}

.steps > li {
  counter-increment: step;
  position: relative;
  padding: 0 0 1.25rem 3rem;
  border-left: 2px solid var(--border);
  margin-left: 1rem;
}

.steps > li:last-child {
  border-left-color: transparent;
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  left: -1.05rem;
  top: -0.1rem;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
  display: grid;
  place-items: center;
  font-size: 0.95rem;
}

.steps h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}

/* ---- Feature lists ---------------------------------------------------- */

.feature-group {
  padding-block: 0.5rem 1rem;
  border-top: 1px solid var(--border);
}

.feature-group:first-child {
  border-top: 0;
}

.feature-group h2 {
  margin-top: 1.5rem;
}

.feature-group .crate-tag {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: -0.3rem;
}

.checks {
  list-style: none;
  padding: 0;
  columns: 2 22rem;
  column-gap: 2.5rem;
  max-width: none !important;
}

.checks li {
  break-inside: avoid;
  padding-left: 1.6rem;
  position: relative;
  margin-bottom: 0.55rem;
}

.checks li::before {
  content: "";
  position: absolute;
  left: 0.15rem;
  top: 0.5em;
  width: 0.75rem;
  height: 0.42rem;
  border-left: 2px solid var(--ok);
  border-bottom: 2px solid var(--ok);
  transform: rotate(-45deg);
}

/* ---- Roadmap ---------------------------------------------------------- */

.rm-toc {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}

.rm-toc li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.15rem 0.5rem;
  padding: 0.55rem 0 0.6rem;
  border-bottom: 1px solid var(--border);
  align-items: center;
}

.rm-toc a {
  border: 0;
  padding: 0;
  color: var(--text);
  font-weight: 550;
  line-height: 1.35;
}

.rm-toc .badge {
  justify-self: end;
}

.rm-toc__count {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.rm-toc__bar {
  grid-column: 1 / -1;
  width: 100%;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  border: 0;
  border-radius: 99px;
  background: var(--border);
  overflow: hidden;
}

.rm-toc__bar::-webkit-progress-bar {
  background: var(--border);
  border-radius: 99px;
}

.rm-toc__bar::-webkit-progress-value {
  background: var(--ok);
  border-radius: 99px;
}

.rm-toc__bar::-moz-progress-bar {
  background: var(--ok);
  border-radius: 99px;
}

.rm-toc li:has(.badge) .rm-toc__count {
  grid-column: 1;
}

.badge {
  display: inline-block;
  vertical-align: middle;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 99px;
  line-height: 1.3;
  white-space: nowrap;
  border: 1px solid transparent;
}

h2 .badge,
h3 .badge {
  margin-left: 0.5rem;
  position: relative;
  top: -0.15em;
}

.badge--done {
  color: var(--ok);
  background: var(--ok-soft);
  border-color: color-mix(in srgb, var(--ok) 35%, transparent);
}

.badge--progress {
  color: var(--warn);
  background: var(--warn-soft);
  border-color: color-mix(in srgb, var(--warn) 35%, transparent);
}

.badge--neutral {
  color: var(--text-muted);
  background: var(--bg-sunken);
  border-color: var(--border);
}

.roadmap h2,
.roadmap h3 {
  scroll-margin-top: 5rem;
}

.roadmap a.anchor {
  color: inherit;
  text-decoration: none;
}

.roadmap a.anchor:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

.rm-section {
  border-top: 1px solid var(--border);
  margin-top: 2.5rem;
}

.rm-section:first-of-type {
  border-top: 0;
  margin-top: 0;
}

.rm-section > h2 {
  margin-top: 2rem;
}

.md-list {
  padding-left: 1.4rem;
  max-width: var(--measure);
}

.md-list .md-list {
  margin: 0.4rem 0 0.2rem;
}

.md-list > li {
  margin-bottom: 0.45rem;
}

.md-list > li.task {
  list-style: none;
  position: relative;
  margin-left: -1.4rem;
  padding-left: 1.9rem;
}

.task__mark {
  position: absolute;
  left: 0;
  top: 0.22em;
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 5px;
  border: 1.5px solid var(--border-strong);
  background: var(--bg-elev);
}

.task--done .task__mark {
  background: var(--ok);
  border-color: var(--ok);
}

.task--done .task__mark::after {
  content: "";
  position: absolute;
  left: 0.32rem;
  top: 0.12rem;
  width: 0.32rem;
  height: 0.62rem;
  border-right: 2px solid var(--bg-elev);
  border-bottom: 2px solid var(--bg-elev);
  transform: rotate(45deg);
}

.md-list > li.note {
  list-style: none;
  margin-left: -1.4rem;
  margin-top: 0.9rem;
  padding: 0.75rem 1rem;
  background: var(--warn-soft);
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--warn) 25%, transparent);
}

.md-list > li.note .md-list {
  margin-bottom: 0;
}

.generated-note {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ---- Legal pages ------------------------------------------------------ */

.legal h2 {
  font-size: 1.3rem;
  margin-top: 2.2rem;
}

.legal address {
  font-style: normal;
}

/* ---- 404 -------------------------------------------------------------- */

.not-found {
  text-align: center;
  padding-block: clamp(3rem, 10vw, 7rem);
}

.not-found .code {
  font-family: var(--font-mono);
  font-size: clamp(4rem, 12vw, 7rem);
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
  margin: 0 0 1rem;
  letter-spacing: -0.05em;
}

.not-found .lead {
  margin-inline: auto;
}

.not-found .button-row {
  justify-content: center;
}

/* ---- Motion ----------------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
  .button,
  .site-nav a,
  .card,
  .theme-toggle,
  .nav-toggle {
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  }

  .card:hover {
    transform: translateY(-2px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---- Print ------------------------------------------------------------ */

@media print {
  .site-header,
  .site-footer,
  .skip-link,
  .copy-button,
  .toc {
    display: none !important;
  }

  .with-toc {
    display: block;
  }

  body {
    background: #fff;
    color: #000;
  }
}
