:root {
  --paper: #FAF9F5;
  --ink: #141413;
  --muted: #5E5D59;
  --rule: #E3E0D6;
  --clay: #D97757;
  --accent-text: #B4532F; /* the clay for text and focus rings: 4.7:1 on paper */
  --code-bg: #F0EEE6;
  --pass: #3F7A4A; /* verify's ✓ on paper; the terminal keeps --ok */

  --term: #262624;
  --term-fg: #E8E6DC;
  --term-dim: #8F8D86;
  --term-rule: #4A4945;
  --ok: #7FB685;
  --bad: #E0736A;
  --warn: #D9B25F;
  --del-bg: #4A2729;
  --add-bg: #22402A;

  --sans: "Instrument Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1180px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1A1A18;
    --ink: #ECEAE2;
    --muted: #A3A19A;
    --rule: #34332F;
    --code-bg: #262624;
    --term: #20201E;
    --term-rule: #3D3C38;
    --accent-text: #D97757;
    --pass: #7FB685;
  }
}
:root[data-theme="dark"] {
  --paper: #1A1A18;
  --ink: #ECEAE2;
  --muted: #A3A19A;
  --rule: #34332F;
  --code-bg: #262624;
  --term: #20201E;
  --term-rule: #3D3C38;
  --accent-text: #D97757;
  --pass: #7FB685;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--clay); }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 3px; border-radius: 2px; }
code, pre, kbd { font-family: var(--mono); font-size: 0.88em; }
p code, li code, td code {
  background: var(--code-bg);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.skip {
  position: absolute; left: 8px; top: -48px; z-index: 10;
  background: var(--ink); color: var(--paper);
  padding: 8px 14px; border-radius: 6px; text-decoration: none; font-size: 15px;
}
.skip:focus { top: 8px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
}
.site-head .wrap {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding-top: 16px; padding-bottom: 16px;
}
/* the header's rule appears once the page has scrolled under it */
@supports (animation-timeline: scroll()) {
  .site-head { animation: head-edge linear both; animation-timeline: scroll(); animation-range: 0 64px; }
}
@keyframes head-edge { to { border-bottom-color: var(--rule); } }
.logo {
  font: 700 18px/1 var(--mono);
  white-space: nowrap;
  text-decoration: none;
  letter-spacing: -0.02em;
}
.logo span { color: var(--muted); font-weight: 400; }
.site-head nav { display: flex; align-items: center; gap: 22px; font-size: 15px; white-space: nowrap; }
.site-head nav a { text-decoration: none; color: var(--muted); transition: color .15s; }
.site-head nav a:hover, .site-head nav a.is-active { color: var(--ink); }
.site-head .nav-cta {
  color: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 6px;
  padding: 7px 12px;
  margin-left: 2px;
  font-weight: 500;
  transition: background-color .15s, color .15s;
}
.site-head .nav-cta:hover { background: var(--ink); color: var(--paper); }
.theme-toggle {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px; margin: 0 -6px;
  padding: 0; border: 0; border-radius: 6px;
  background: none; color: var(--muted); cursor: pointer;
  transition: color .15s;
}
.theme-toggle:hover { color: var(--ink); }
.theme-toggle svg { width: 18px; height: 18px; }
/* the icon shows the theme a click switches to */
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; }
}

/* ---------- hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
  padding-top: clamp(32px, 7vw, 88px);
  padding-bottom: clamp(56px, 9vw, 120px);
}
.hero h1 {
  font-weight: 600;
  font-size: clamp(38px, 5.2vw, 62px);
  line-height: 1.04;
  letter-spacing: -0.035em;
  margin: 0 0 24px;
  max-width: 11ch;
}
.hero .lede { color: var(--muted); font-size: 19px; line-height: 1.55; margin: 0 0 32px; max-width: 34ch; }

.install {
  display: flex; align-items: stretch;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--code-bg);
  max-width: 360px;
  font: 400 15px/1 var(--mono);
}
.install code { flex: 1; min-width: 0; padding: 14px 16px; font-size: inherit; white-space: nowrap; overflow-x: auto; }
.install code::before { content: "$ "; color: var(--muted); }
.install button {
  font: 500 13px/1 var(--sans);
  color: var(--muted);
  background: none; border: 0; border-left: 1px solid var(--rule);
  padding: 0 16px; cursor: pointer;
  min-width: 72px;
}
.install button:hover { color: var(--ink); }
.install button.done { color: var(--pass); }
.hero .cta { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 18px 0 0; font-size: 15px; }
.hero .cta a { color: var(--ink); font-weight: 500; }
.hero .small { font-size: 14.5px; color: var(--muted); margin: 16px 0 0; max-width: 40ch; }

/* hero background graph (hero-graph.js); the page is complete without it */
.hero-stage { position: relative; overflow: hidden; }
.hero-stage .hero { position: relative; z-index: 1; }
#hero-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.2s ease;
  -webkit-mask-image: radial-gradient(110% 95% at 68% 45%, #000 35%, transparent 80%);
  mask-image: radial-gradient(110% 95% at 68% 45%, #000 35%, transparent 80%);
}
#hero-canvas.on { opacity: 1; }
@media (max-width: 700px) { #hero-canvas { display: none; } }

/* ---------- terminal ---------- */
.term {
  background: var(--term);
  color: var(--term-fg);
  border-radius: 10px;
  font: 400 13px/1.6 var(--mono);
  box-shadow: 0 1px 0 rgba(0,0,0,.04), 0 24px 48px -24px rgba(40, 30, 20, .35);
  overflow: hidden;
}
.term-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--term-rule);
  color: var(--term-dim);
  font-size: 12px;
}
.term-bar .dots { display: flex; gap: 6px; }
.term-bar .dots i { width: 11px; height: 11px; border-radius: 50%; background: #4A4945; display: block; }
.term-bar .title { flex: 1; text-align: center; }
.term-bar button {
  font: inherit; color: var(--term-dim);
  background: none; border: 1px solid var(--term-rule); border-radius: 5px;
  padding: 3px 9px; cursor: pointer;
}
.term-bar button:hover { color: var(--term-fg); }
.term-body {
  height: 540px;
  overflow-y: auto;
  padding: 16px 18px 20px;
  scrollbar-width: thin;
  scrollbar-color: var(--term-rule) transparent;
}
.term-body > div { white-space: pre-wrap; word-break: break-word; min-height: 1.6em; }
.t-dim { color: var(--term-dim); }
.t-clay { color: var(--clay); }
.t-ok { color: var(--ok); }
.t-bad { color: var(--bad); }
.t-warn { color: var(--warn); }
.t-b { font-weight: 700; }
.t-del { background: var(--del-bg); display: block; }
.t-add { background: var(--add-bg); display: block; }
.welcome {
  border: 1px solid var(--clay);
  border-radius: 6px;
  padding: 8px 14px;
  margin-bottom: 14px;
  white-space: normal !important;
}
.welcome p { margin: 0; }
.prompt-box {
  border: 1px solid var(--term-rule);
  border-radius: 6px;
  padding: 6px 12px;
  margin: 10px 0 4px;
}
.cursor {
  display: inline-block; width: 0.6em; height: 1.15em;
  background: var(--term-fg); vertical-align: text-bottom;
  animation: blink 1s steps(1) infinite;
}
.hook {
  border-left: 2px solid var(--clay);
  padding-left: 10px;
  margin: 6px 0 6px 2px;
}
@keyframes blink { 50% { opacity: 0; } }

/* ---------- sections ---------- */
section { border-top: 1px solid var(--rule); padding: clamp(56px, 8vw, 104px) 0; }
.sec-head { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 72px); margin-bottom: 48px; }
h2 {
  font-weight: 600;
  font-size: clamp(28px, 3.2vw, 38px);
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin: 0;
}
.sec-head p { margin: 0; color: var(--muted); max-width: 58ch; }

/* steps: a real sequence, so they are numbered */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 5vw, 72px);
  padding: 28px 0;
  border-top: 1px dashed var(--rule);
}
.steps li:first-child { border-top: 0; padding-top: 0; }
.steps .cmd { display: flex; gap: 18px; align-items: baseline; }
.steps .cmd::before {
  content: counter(step);
  font: 500 15px/1 var(--mono);
  color: var(--muted);
  width: 1ch;
}
.steps .cmd code { font-size: 17px; font-weight: 500; }
.steps p { margin: 0; max-width: 60ch; }
.steps .who { display: block; font-size: 14.5px; color: var(--muted); margin-top: 6px; }

/* "How a removal runs": a line beside the steps fills as you scroll through
   them, and each number lights up when its step is reached. CSS scroll-driven
   animations only; without support the steps stay as they are. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .steps { position: relative; view-timeline: --steps block; }
    .steps::before {
      content: "";
      position: absolute;
      left: calc(var(--gutter) * -0.5);
      top: 0; bottom: 0;
      width: 1px;
      background: var(--clay);
      transform-origin: top;
      animation: steps-fill linear both;
      animation-timeline: --steps;
      /* from the list's top to its bottom crossing 60% down the screen */
      animation-range: cover 40vh cover calc(100% - 60vh);
    }
    .steps li { view-timeline: --step block; }
    .steps .cmd::before {
      animation: step-on linear both;
      animation-timeline: --step;
      /* as the step's top crosses the same line */
      animation-range: cover 38vh cover 42vh;
    }
  }
}
@keyframes steps-fill { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes step-on { from { color: var(--muted); } to { color: var(--accent-text); } }
@media (max-width: 900px) { .steps::before { display: none; } }

/* checks table, styled like verify's own output */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 16px; }
th { text-align: left; font-weight: 500; color: var(--muted); font-size: 14.5px; padding: 0 20px 12px 0; border-bottom: 1px solid var(--ink); }
td { padding: 18px 20px 18px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
td:first-child { white-space: nowrap; width: 1%; }
td:first-child code { background: none; padding: 0; font-weight: 500; font-size: 15.5px; }

/* verify's own mark before each check: as a row scrolls up into view its dot
   turns into a ✓, the way verify's output reads. Without scroll-driven
   animations, or with reduced motion, every row simply shows the ✓. */
.tick { position: relative; display: inline-block; width: 1.5em; font: 700 15.5px/inherit var(--mono); }
.tick::after { content: "✓"; color: var(--pass); display: inline-block; }
.tick::before { content: "·"; color: var(--muted); opacity: 0; position: absolute; left: 0; top: 0; }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    /* the timeline sits on the table's wrapper: it scrolls horizontally, so
       anything inside it would measure that scroller instead of the page */
    #verify .table-wrap { view-timeline: --checks block; }
    .tick::before, .tick::after {
      animation: linear both;
      animation-timeline: --checks;
      animation-range: cover 22% cover 27%;
    }
    #verify tr:nth-child(2) .tick::before, #verify tr:nth-child(2) .tick::after { animation-range: cover 28% cover 33%; }
    #verify tr:nth-child(3) .tick::before, #verify tr:nth-child(3) .tick::after { animation-range: cover 34% cover 39%; }
    #verify tr:nth-child(4) .tick::before, #verify tr:nth-child(4) .tick::after { animation-range: cover 40% cover 45%; }
    .tick::before { animation-name: tick-dot; }
    .tick::after { animation-name: tick-mark; }
  }
}
@keyframes tick-dot { from { opacity: 1; } to { opacity: 0; } }
@keyframes tick-mark { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: none; } }
.note { margin: 28px 0 0; color: var(--muted); max-width: 64ch; }

@media (max-width: 700px) {
  .stacks table, .stacks tbody, .stacks tr, .stacks td { display: block; width: auto; }
  .stacks thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .stacks tr { padding: 20px 0; border-bottom: 1px solid var(--rule); }
  .stacks tr:first-child { border-top: 1px solid var(--ink); }
  .stacks td { padding: 0; border: 0; }
  .stacks td:first-child { margin-bottom: 10px; }
  .stacks td:first-child code { font-size: 17px; }
  .stacks td + td { margin-top: 10px; }
  .stacks td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 14px; color: var(--muted);
    margin-bottom: 2px;
  }
}

/* config */
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 72px); }
.split p { margin: 16px 0 0; max-width: 46ch; }
.split p:first-of-type { margin-top: 20px; }
pre.file {
  margin: 0;
  background: var(--code-bg);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 0;
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.65;
}
pre.file .fname { display: block; padding: 9px 18px; border-bottom: 1px solid var(--rule); color: var(--muted); font-size: 12.5px; }
pre.file code { display: block; padding: 16px 18px; font-size: inherit; }
.y-k { color: var(--ink); font-weight: 500; }
.y-c { color: var(--muted); }
.y-s { color: #8A5A2B; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .y-s { color: #D9A877; } }
:root[data-theme="dark"] .y-s { color: #D9A877; }

/* questions */
.faq { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(32px, 5vw, 72px); }
.faq > div { padding: 24px 0; border-top: 1px dashed var(--rule); }
.faq dt { font-weight: 600; margin: 0 0 8px; }
.faq dd { margin: 0; color: var(--muted); max-width: 60ch; }
@media (max-width: 900px) { .faq { grid-template-columns: minmax(0, 1fr); } }

/* footer */
.site-foot { border-top: 1px solid var(--rule); padding: 36px 0 48px; font-size: 14.5px; color: var(--muted); }
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between; }
.site-foot nav { display: flex; gap: 22px; }

/* ---------- changelog ---------- */
.page-head { padding-top: clamp(32px, 6vw, 72px); padding-bottom: clamp(40px, 6vw, 72px); }
.page-head h1 {
  font-weight: 600;
  font-size: clamp(36px, 4.6vw, 54px);
  line-height: 1.05;
  letter-spacing: -0.035em;
  margin: 0 0 16px;
}
.page-head p { margin: 0; color: var(--muted); max-width: 62ch; }
.page-head .source { font-size: 14.5px; margin-top: 12px; }
.releases { border-top: 1px solid var(--rule); padding: 0 0 clamp(56px, 8vw, 104px); }
/* the releases arrive after a fetch: keep the footer below the fold until then */
#releases { min-height: 100vh; }
.release {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 5vw, 72px);
  padding: 40px 0;
  border-top: 1px dashed var(--rule);
}
.release:first-child { border-top: 0; }
.release-meta { position: sticky; top: 92px; align-self: start; }
.release-meta h2 { font: 600 clamp(24px, 2.6vw, 30px)/1.1 var(--mono); letter-spacing: -0.02em; }
.release-meta h2 a { text-decoration: none; }
.release-meta h2 a:hover { text-decoration: underline; }
.release-meta time { display: block; margin-top: 8px; color: var(--muted); font-size: 14.5px; }
.release-meta .latest {
  display: inline-block; margin-top: 10px;
  font: 500 12px/1 var(--sans); color: var(--accent-text);
  border: 1px solid var(--accent-text); border-radius: 999px; padding: 4px 9px;
}
.release-body { min-width: 0; }
.release-body > :first-child { margin-top: 0; }
.release-body h3 {
  font: 500 14.5px/1.2 var(--sans);
  color: var(--muted);
  margin: 28px 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
}
.release-body p { margin: 0 0 12px; max-width: 64ch; }
.release-body ul { margin: 0; padding-left: 1.1em; max-width: 64ch; }
.release-body li { margin: 0 0 12px; }
.release-body li::marker { color: var(--muted); }
.release-body strong { font-weight: 600; color: var(--accent-text); }
.release-body pre { background: var(--code-bg); border: 1px solid var(--rule); border-radius: 8px; padding: 14px 16px; overflow-x: auto; }
.cl-status { color: var(--muted); padding: 40px 0; }
.site-head nav a[aria-current="page"] { color: var(--ink); }
@media (max-width: 900px) {
  .release { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .release-meta { position: static; }
}

/* ---------- guide ---------- */
.crumbs { font-size: 14.5px; color: var(--muted); margin-bottom: 20px; }
.crumbs a { color: inherit; }
.page-head p + p { margin-top: 14px; }
.page-head .byline { font-size: 14.5px; }
.guide-body { border-top: 1px solid var(--rule); padding: clamp(40px, 6vw, 72px) 0 clamp(56px, 8vw, 104px); }
.prose { max-width: 72ch; }
.prose h2 { font-size: clamp(24px, 2.6vw, 30px); margin: 56px 0 16px; }
.prose h3 { font-size: 18px; font-weight: 600; margin: 32px 0 10px; }
.prose p, .prose ul { margin: 0 0 16px; }
.prose ul { padding-left: 1.1em; }
.prose li { margin: 0 0 8px; }
.prose li::marker { color: var(--muted); }
.prose strong { font-weight: 600; }
.prose pre {
  margin: 0 0 16px;
  background: var(--code-bg);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 14px 18px;
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.65;
}
.prose pre code { font-size: inherit; }
.prose pre .c { color: var(--muted); }
.guide-grid { display: grid; grid-template-columns: minmax(0, 72ch); gap: 40px; }
.toc { border: 1px solid var(--rule); border-radius: 8px; padding: 18px 22px; }
.toc ol { margin: 0; padding-left: 1.3em; }
.toc li { margin: 4px 0; }
.toc li::marker { color: var(--muted); font-family: var(--mono); font-size: 0.85em; }
.toc a { text-decoration-color: var(--rule); }
.toc a[aria-current] { text-decoration-color: var(--clay); }
/* wide screens: the contents sit beside the text and stay in view */
@media (min-width: 1100px) {
  .guide-grid { grid-template-columns: minmax(0, 72ch) minmax(0, 1fr); gap: clamp(40px, 4vw, 64px); }
  .toc {
    grid-column: 2; grid-row: 1;
    position: sticky; top: 96px; align-self: start;
    border: 0; border-left: 1px solid var(--rule); border-radius: 0;
    padding: 2px 0 2px 20px;
    font-size: 15px;
  }
  .toc ol { list-style: none; padding: 0; counter-reset: toc; }
  .toc li { margin: 0; position: relative; counter-increment: toc; }
  .toc a {
    display: block; padding: 5px 0 5px 1.7em; text-indent: -1.7em;
    color: var(--muted); text-decoration: none;
    transition: color .15s;
  }
  .toc a::before {
    content: counter(toc) ".";
    display: inline-block; width: 2em; text-indent: 0; /* 1.7em of the link text at 0.85em */
    font: 400 0.85em var(--mono);
  }
  .toc a:hover { color: var(--ink); }
  .toc a[aria-current] { color: var(--ink); }
  .toc li:has(a[aria-current])::before {
    content: ""; position: absolute;
    left: -21px; top: 6px; bottom: 6px; width: 2px;
    background: var(--clay);
  }
  .prose { grid-column: 1; grid-row: 1; }
}
.prose > h2:first-child { margin-top: 0; }
.checklist { list-style: none; padding-left: 0 !important; }
.checklist li { position: relative; padding-left: 1.6em; }
.checklist li::before { content: "✓"; position: absolute; left: 0; color: var(--accent-text); font-weight: 600; }
.callout {
  margin-top: 64px;
  border-top: 2px solid var(--clay);
  background: var(--code-bg);
  border-radius: 0 0 8px 8px;
  padding: 4px 24px 22px;
}
.callout h2 { margin-top: 24px; }
.callout .install { background: var(--paper); margin: 20px 0 0; }
.callout .small { font-size: 14.5px; color: var(--muted); margin: 16px 0 0; }

/* ---------- 404 ---------- */
.not-found { padding-bottom: clamp(56px, 8vw, 104px); }
.not-found ul { margin: 24px 0 0; padding-left: 1.1em; }
.not-found li { margin: 6px 0; }

/* ---------- responsive ---------- */
@media (max-width: 860px) { .site-head nav a.hide-md { display: none; } }
@media (max-width: 900px) {
  .hero, .sec-head, .steps li, .split { grid-template-columns: minmax(0, 1fr); }
  .hero h1 { max-width: 14ch; }
  .term-body { height: 460px; }
  .steps li { gap: 12px; }
}
@media (max-width: 520px) {
  body { font-size: 16px; }
  .site-head nav a.hide-sm { display: none; }
  .site-head nav { gap: 16px; }
  .term { font-size: 11.5px; margin: 0 calc(var(--gutter) * -1); border-radius: 0; }
  .term-body { padding: 14px 14px 18px; height: 420px; }
  .install { max-width: none; }
  td { padding-right: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .cursor { animation: none; }
}
