@font-face {
  font-family: "Archivo";
  src: url("/assets/fonts/archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  --sheet: #ffffff;
  --ink: #16121c;
  --ink-2: #4a4354;
  --rule: #d9d3e0;
  --field: #ffffff;
  --field-ink: #16121c;
  --field-ink-2: #4a4354;
  --field-rule: #d9d3e0;
  --grid: #f0ecf4;
  --accent: #552583;
  --spark: #fdb927;
  --code-bg: #f4f0f8;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1240px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --sheet: #0f0c14;
    --ink: #ece8f2;
    --ink-2: #b4abc0;
    --rule: #2e2738;
    --field: #0f0c14;
    --field-ink: #ece8f2;
    --field-ink-2: #b4abc0;
    --field-rule: #2e2738;
    --grid: #16121d;
    --accent: #b08be0;
    --code-bg: #1a1522;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --sheet: #0f0c14;
  --ink: #ece8f2;
  --ink-2: #b4abc0;
  --rule: #2e2738;
  --field: #0f0c14;
  --field-ink: #ece8f2;
  --field-ink-2: #b4abc0;
  --field-rule: #2e2738;
  --grid: #16121d;
  --accent: #b08be0;
  --code-bg: #1a1522;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--sheet);
  color: var(--ink);
  border-top: 4px solid var(--accent);
  font: 400 1.0625rem/1.6 "Archivo", system-ui, sans-serif;
  font-stretch: 100%;
  font-variant-numeric: tabular-nums;
}
::selection { background: var(--accent); color: var(--sheet); }
a { color: var(--accent); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; box-shadow: 0 0 0 3px var(--sheet); border-radius: 2px; }
p, li, dd, td, th, summary { text-wrap: pretty; }
code, pre { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.9em; }

.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--sheet); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; top: 8px; }
.defs { position: absolute; }

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

/* ---------- Field (first viewport) ---------- */
.field {
  background-color: var(--field);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: -1px -1px;
  color: var(--field-ink);
  position: relative;
  overflow: hidden;
}
.field a { color: var(--field-ink); }
.hero-links a, .install a { color: var(--accent); }
.masthead {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 24px;
  padding-block: 24px;
  border-bottom: 1px solid var(--field-rule);
}
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand svg { display: block; }
.brand span { font-weight: 650; font-size: 1.75rem; letter-spacing: -0.02em; line-height: 1; }
.index {
  justify-self: end;
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 24px;
  list-style: none; margin: 0; padding: 0;
  font-size: 0.9375rem;
}
.index a { text-decoration: none; display: inline-flex; gap: 8px; padding-block: 8px; }
.index a:hover { text-decoration: underline; }
.index b { font-weight: 500; color: var(--field-ink-2); }
.lang { display: flex; gap: 2px; border-left: 1px solid var(--field-rule); padding-left: 20px; }
.lang a { padding: 6px 8px; font-weight: 600; letter-spacing: 0.04em; font-size: 0.8125rem; }
.lang a[aria-current="true"] { background: var(--field-ink); color: var(--field); }

.hero {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 0 24px;
  padding-block: clamp(40px, 6vw, 80px) clamp(40px, 4vw, 56px);
  position: relative;
}
.hero > * { min-width: 0; }
.hero h1 {
  position: relative;
  grid-column: 1 / span 7;
  margin: 0;
  font-weight: 700;
  font-stretch: 87.5%;
  font-size: clamp(2.25rem, 4.6vw, 3.75rem);
  line-height: 1.04;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.hero .lede {
  grid-column: 1 / span 7;
  margin: 24px 0 0;
  font-size: clamp(1.0625rem, 1.4vw, 1.1875rem);
  line-height: 1.5;
  color: var(--field-ink-2);
  max-width: 38em;
}
.install {
  grid-column: 1 / span 7;
  margin-top: 32px;
  border: 1px solid var(--rule);
  background: var(--code-bg);
}
.titleblock {
  grid-column: 9 / span 4; grid-row: 1 / span 4; align-self: start;
  margin: 0; border: 1px solid var(--ink); background: var(--sheet);
  font-size: 0.875rem;
}
.titleblock dl { margin: 0; }
.titleblock dl div { display: grid; grid-template-columns: 7.5em 1fr; border-top: 1px solid var(--rule); }
.titleblock dl div:first-child { border-top: 0; }
.titleblock dt, .titleblock dd { margin: 0; padding: 8px 12px; }
.titleblock dt { color: var(--ink-2); border-right: 1px solid var(--rule); font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; align-self: center; }
.titleblock dd { font-weight: 600; }
.titleblock .tb-head { background: var(--accent); color: var(--sheet); margin: 0; padding: 8px 12px; font-weight: 700; font-size: 0.8125rem; letter-spacing: 0.06em; text-transform: uppercase; display: flex; justify-content: space-between; }
.install-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 8px 8px 16px;
  border-bottom: 1px solid var(--rule);
  font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--field-ink-2);
}
.install pre { margin: 0; padding: 16px; overflow-x: auto; line-height: 1.8; color: var(--ink); }
.install pre .p { color: var(--accent); user-select: none; }
.copy {
  font: inherit; font-size: 0.8125rem; letter-spacing: 0.04em;
  background: transparent; color: var(--ink); border: 1px solid var(--ink-2);
  padding: 6px 14px; cursor: pointer; font-weight: 700;
}
/* Agent switch: a tab list for the install commands. Without JavaScript, both command blocks show with their names. */
.agent-switch { display: flex; margin-left: auto; margin-right: 12px; border: 1px solid var(--rule); }
.agent-switch[hidden] { display: none; }
.agent-switch [role="tab"] { font: inherit; font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.02em; text-transform: none; background: transparent; color: var(--ink-2); border: 0; padding: 6px 12px; cursor: pointer; }
.agent-switch [role="tab"] + [role="tab"] { border-left: 1px solid var(--rule); }
.agent-switch [role="tab"][aria-selected="true"] { background: var(--ink); color: var(--sheet); }
.agent-name { margin: 0; padding: 12px 16px 0; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.js .agent-name { display: none; }
.agent-cmd + .agent-cmd { border-top: 1px solid var(--rule); }
.js .agent-cmd + .agent-cmd { border-top: 0; }
.copy:hover { background: var(--ink); color: var(--sheet); }
.hero-links { grid-column: 1 / span 7; margin: 24px 0 0; display: flex; gap: 24px; flex-wrap: wrap; font-weight: 600; }

/* ---------- Sections ---------- */
section.part { border-top: 1px solid var(--rule); padding-block: clamp(64px, 9vw, 120px) clamp(48px, 6vw, 80px); }
#loop { padding-top: clamp(32px, 3vw, 48px); }
#loop .part-head { margin-bottom: 24px; }
.part-head {
  display: grid; grid-template-columns: repeat(12, 1fr); gap: 0 24px;
  margin-bottom: 48px;
}
.part-head .addr {
  grid-column: 1 / span 2;
  font-weight: 600; font-stretch: 87.5%; font-size: 1.25rem; color: var(--accent);
  line-height: 1.2;
}
.part-head h2 {
  grid-column: 3 / span 7;
  margin: 0;
  font-weight: 700; font-stretch: 87.5%;
  font-size: clamp(1.75rem, 3vw, 2.5rem); line-height: 1.08; letter-spacing: -0.025em;
  text-wrap: balance;
}
.part-head p { grid-column: 3 / span 6; margin: 16px 0 0; color: var(--ink-2); max-width: 40em; }

/* Loop strip */
.loop {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(7, 1fr);
  border: 1px solid var(--rule);
  counter-reset: step;
}
.loop li {
  counter-increment: step;
  border-right: 1px solid var(--rule);
  padding: 20px 16px 24px;
  min-height: 248px;
  display: flex; flex-direction: column; gap: 8px;
  transition: background-color 400ms cubic-bezier(.16,1,.3,1), color 400ms cubic-bezier(.16,1,.3,1), box-shadow 400ms cubic-bezier(.16,1,.3,1);
  position: relative;
}
.loop li:last-child { border-right: 0; }
.loop li::before {
  content: counter(step);
  font-weight: 600; font-stretch: 87.5%; font-size: 1.75rem; line-height: 1;
  color: var(--accent);
}
.loop h3 { margin: 12px 0 0; font-size: 1.125rem; font-weight: 700; }
.loop .cmd { font-size: 0.8125rem; color: var(--ink-2); }
.loop p { margin: 0; font-size: 0.9375rem; line-height: 1.5; color: var(--ink-2); }
.loop .pain { margin: 0; font-size: 0.8125rem; line-height: 1.4; color: var(--ink); }
.loop .pain span { display: block; font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.loop .who { margin-top: auto; font-size: 0.8125rem; line-height: 1.4; min-height: calc(3 * 1.4em + 12px); font-weight: 600; color: var(--ink); padding-top: 12px; border-top: 1px solid var(--rule); }
.loop li.is-active { background: var(--code-bg); box-shadow: inset 0 4px 0 var(--spark); }
.loop li.is-next { box-shadow: inset 0 0 0 1px var(--accent); }
/* The rule back from the last step to the first: the next change starts the loop again. */
.loop-return {
  position: relative; height: 28px; margin: 0 calc(100% / 14);
  border: 1px solid var(--ink-2); border-top: 0;
}
.loop-return::before {
  content: ""; position: absolute; left: -5px; top: -1px;
  border: 5px solid transparent; border-bottom: 7px solid var(--ink-2); border-top: 0;
}
.loop-return span {
  position: absolute; left: 50%; bottom: -0.7em; transform: translateX(-50%);
  background: var(--sheet); padding: 0 12px;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2);
}

/* Spec tables */
.spec { width: 100%; border-collapse: collapse; font-size: 1rem; }
.spec caption { text-align: left; }
.spec th, .spec td { text-align: left; vertical-align: top; padding: 16px 16px 16px 0; border-top: 1px solid var(--rule); }
.spec thead th { font-size: 0.8125rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); font-weight: 600; border-top: 2px solid var(--ink); padding-block: 10px; }
.spec tbody th { font-weight: 700; width: 22%; }
.spec td code { background: var(--code-bg); padding: 2px 6px; }
.spec tbody tr:last-child > * { border-bottom: 1px solid var(--rule); }

.cols { display: grid; grid-template-columns: repeat(12, 1fr); gap: 0 24px; }
.cols > .main { grid-column: 3 / span 10; }

/* Record (proof) */
.record { display: grid; grid-template-columns: repeat(12, 1fr); gap: 0 24px; }
.record .ledger { grid-column: 3 / span 10; }
.tally {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--rule); margin: 0 0 40px;
}
.tally div { padding: 16px; border-right: 1px solid var(--rule); }
.tally div:last-child { border-right: 0; }
.tally dt { font-size: 0.875rem; color: var(--ink-2); }
.tally dd { margin: 4px 0 0; font-weight: 700; font-size: 1.25rem; }

/* FAQ */
.faq details { border-top: 1px solid var(--rule); }
.faq details:last-child { border-bottom: 1px solid var(--rule); }
.faq summary {
  list-style: none; cursor: pointer;
  display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center;
  padding: 18px 0; font-weight: 600; font-size: 1.0625rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; width: 12px; height: 12px;
  border-right: 2px solid var(--ink-2); border-bottom: 2px solid var(--ink-2);
  transform: translateY(-3px) rotate(45deg); transition: transform 240ms cubic-bezier(.16,1,.3,1);
}
.faq details[open] summary::after { transform: translateY(3px) rotate(-135deg); }
.faq summary:hover { color: var(--accent); }
.faq details p { margin: 0 0 20px; max-width: 68ch; color: var(--ink-2); }
.faq code { background: var(--code-bg); padding: 1px 5px; }
@media (prefers-reduced-motion: reduce) { .faq summary::after { transition: none; } }

/* Install part */
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 48px 1fr; gap: 0 16px; padding: 20px 0; border-top: 1px solid var(--rule); }
.steps li::before { content: counter(s); font-weight: 600; font-stretch: 87.5%; font-size: 1.5rem; color: var(--accent); line-height: 1.2; }
.steps pre { margin: 12px 0 0; padding: 14px 16px; background: var(--code-bg); overflow-x: auto; line-height: 1.7; }
.steps p { margin: 0; }
.steps li > div, .cols > .main, .record .ledger { min-width: 0; }
.prereq { color: var(--ink-2); margin: 0 0 24px; }

/* Billing block */
.billing { background: var(--code-bg); color: var(--ink); border-top: 1px solid var(--rule); margin-top: clamp(64px, 9vw, 120px); }
.billing a { color: var(--ink); }
.billing .wrap { display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px; padding-block: 48px 32px; }
.billing .b-brand { grid-column: 1 / span 4; }
.billing .b-brand p { color: var(--ink-2); margin: 16px 0 0; font-size: 0.9375rem; max-width: 26em; }
.billing nav { grid-column: span 2; font-size: 0.9375rem; }
.billing h2 { font-size: 0.8125rem; letter-spacing: 0.06em; text-transform: uppercase; margin: 0 0 12px; color: var(--ink-2); font-weight: 600; }
.billing ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.billing .agate {
  grid-column: 1 / -1;
  border-top: 1px solid var(--rule); padding-top: 20px;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  font-size: 0.8125rem; color: var(--ink-2);
}

/* ---------- Legal pages ---------- */
.legal { padding-block: 56px 0; }
.legal .cols > .main { grid-column: 3 / span 7; }
.legal h1 { font-weight: 700; font-stretch: 87.5%; font-size: clamp(2.25rem, 5vw, 3.5rem); line-height: 1.04; letter-spacing: -0.025em; margin: 0 0 8px; }
.legal h2 { font-size: 1.25rem; margin: 40px 0 8px; }
.legal p, .legal li { max-width: 68ch; }
.legal address { font-style: normal; }
.binding { border: 1px solid var(--rule); padding: 12px 16px; color: var(--ink-2); font-size: 0.9375rem; margin: 16px 0 32px; }
.back { display: inline-block; margin-bottom: 32px; font-weight: 600; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .loop { grid-template-columns: repeat(4, 1fr); }
  .loop li:nth-child(4) { border-right: 0; }
  .loop li:nth-child(-n+4) { border-bottom: 1px solid var(--rule); }
  .loop-return { margin: 0 calc(100% / 8); }
}
@media (max-width: 860px) {
  .masthead { grid-template-columns: 1fr auto; }
  .masthead nav { grid-column: 1 / -1; }
  .index { justify-self: start; gap: 0 20px; }
  .install-head { gap: 12px; }
  .index .lang { border-left: 0; padding-left: 0; }
  .hero h1, .hero .lede, .install, .hero-links { grid-column: 1 / -1; }
  .titleblock { grid-column: 1 / -1; grid-row: auto; margin-top: 32px; order: 5; }
  .part-head .addr, .part-head h2, .part-head p, .cols > .main, .record .ledger, .legal .cols > .main { grid-column: 1 / -1; }
  .part-head .addr { margin-bottom: 8px; }
  .tally { grid-template-columns: repeat(2, 1fr); }
  .tally div:nth-child(2) { border-right: 0; }
  .tally div:nth-child(-n+2) { border-bottom: 1px solid var(--rule); }
  .billing .b-brand { grid-column: 1 / -1; }
  .billing nav { grid-column: span 6; }
}
@media (max-width: 560px) {
  .install-head { flex-wrap: wrap; }
  .agent-switch { order: 3; margin: 8px 0 0; width: 100%; }
  .agent-switch [role="tab"] { flex: 1; }
  .loop { grid-template-columns: 1fr; }
  .loop li { border-right: 0; border-bottom: 1px solid var(--rule); min-height: 0; display: grid; grid-template-columns: 32px 1fr; gap: 2px 12px; padding: 14px 16px; }
  .loop li:last-child { border-bottom: 0; }
  .loop li::before { grid-row: span 4; font-size: 1.5rem; }
  .loop h3 { margin: 0; display: flex; align-items: baseline; gap: 12px; }
  .loop .pain span { display: inline; margin-right: 4px; }
  .loop .who { display: none; }
  .loop-return { display: none; }
  .spec thead { display: none; }
  .spec tbody tr { display: block; border-top: 1px solid var(--rule); padding: 12px 0; }
  .spec tbody th, .spec tbody td { display: block; border: 0; padding: 2px 0; width: auto; }
  .spec td[data-label]::before { content: attr(data-label) ": "; color: var(--ink-2); }
  .install pre, .steps pre { font-size: 0.75rem; }
  .install pre code, .steps pre code { font-size: 1em; }
  .spec tbody tr:last-child > * { border-bottom: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .loop li { transition: none; }
}
