:root {
  --canvas: #F7F5F0;
  --surface: #FFFFFF;
  --surface-tint: #FAF9F6;
  --surface-subtle: #F1EEE7;
  --border: #DFDBD2;
  --border-strong: #C7C1B5;

  --ink: #14191F;
  --ink-muted: #4F5B66;

  --code-bg: #151A21;
  --code-bar: #1B222C;
  --code-border: #262F3C;
  --code-text: #E4E8EE;
  --code-muted: #8B98A8;

  --amber: #D98A1A;
  --amber-bright: #E5A024;
  --amber-tint: #FFFBF2;
  --sage: #86C5A9;
  --ochre: #8C5308;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --measure: 66ch;
  --page: 1180px;
  --gutter: clamp(18px, 4vw, 44px);
  --radius-card: 10px;
  --radius-control: 6px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 16px/1.65 var(--sans);
}

main {
  overflow-x: clip;
}

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

a {
  color: var(--ink);
  text-decoration-color: var(--border-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 120ms ease, text-decoration-color 120ms ease;
}

a:hover {
  text-decoration-color: var(--ink);
}

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

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

:where(p, li, td, dd, th) > code {
  padding: 0.1em 0.38em;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface-subtle);
  color: var(--ink);
  font-size: 0.84em;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  text-wrap: balance;
}

h1 {
  font-weight: 800;
  letter-spacing: -0.035em;
}

h2 {
  font-size: clamp(1.75rem, 3.2vw, 2.35rem);
  font-weight: 750;
  line-height: 1.14;
  letter-spacing: -0.03em;
}

h3 {
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.015em;
}

p {
  text-wrap: pretty;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 12px;
  z-index: 100;
  padding: 8px 14px;
  border-radius: var(--radius-control);
  background: var(--ink);
  color: var(--surface);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: none;
}

.shell {
  width: min(100% - 2 * var(--gutter), var(--page));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgb(247 245 240 / 92%);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-header .shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  flex-shrink: 0;
}

.brand svg {
  width: 30px;
  height: 30px;
}

.brand-name {
  font-size: 1.125rem;
  font-weight: 750;
  letter-spacing: -0.025em;
  line-height: 1;
}

.brand-name span {
  color: var(--ink-muted);
  font-weight: 600;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.5vw, 26px);
  font-size: 0.92rem;
  font-weight: 550;
}

.site-nav a:not(.button) {
  color: var(--ink-muted);
  text-decoration: none;
}

.site-nav a:not(.button):hover,
.site-nav a[aria-current="page"] {
  color: var(--ink);
}

.site-nav a[aria-current="page"] {
  box-shadow: inset 0 -2px 0 var(--amber);
  padding-block: 4px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  font-size: 0.92rem;
  font-weight: 650;
  line-height: 1;
  text-decoration: none;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.button-strap {
  background: var(--amber-bright);
  border-color: rgb(20 25 31 / 12%);
  color: var(--ink);
}

.button-strap:hover {
  background: var(--amber);
  color: var(--ink);
}

.button-plain {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--ink);
}

.button-plain:hover {
  background: var(--surface-subtle);
  border-color: var(--ink-muted);
}

.site-nav .button {
  min-height: 34px;
  padding: 0 14px;
  font-size: 0.875rem;
}

.hero {
  padding-block: clamp(44px, 6vw, 72px) 32px;
}

.hero h1 {
  font-size: clamp(2.4rem, 5.2vw, 4.15rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.hero h1 span {
  display: block;
}

.hero-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px 40px;
  margin-top: 22px;
}

.hero-lede {
  max-width: 58ch;
  margin: 0;
  color: var(--ink-muted);
  font-size: clamp(1rem, 1.3vw, 1.08rem);
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.lost .hero-actions {
  margin-top: 28px;
}

.exhibit {
  padding-bottom: clamp(56px, 8vw, 96px);
}

.recipe-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  margin: 0 0 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-subtle);
}

.recipe-tabs button,
.view-toggle button {
  font-family: var(--sans);
  cursor: pointer;
}

.recipe-tabs button {
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ink-muted);
  font-size: 0.86rem;
  font-weight: 550;
  transition: background-color 120ms ease, color 120ms ease;
}

.recipe-tabs button:hover {
  color: var(--ink);
}

.recipe-tabs button[aria-selected="true"] {
  background: var(--surface);
  color: var(--ink);
  font-weight: 650;
  box-shadow: 0 1px 2px rgb(20 25 31 / 8%), inset 0 -2px 0 var(--amber);
}

.cargo {
  display: grid;
  grid-template-columns: minmax(0, 5fr) 44px minmax(0, 7fr);
  align-items: stretch;
}

.plate,
.script {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-radius: var(--radius-card);
  overflow: hidden;
}

.plate {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgb(20 25 31 / 4%);
}

.file-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 0 18px;
  background: var(--surface-tint);
  border-bottom: 1px solid var(--border);
}

.plate pre + .file-bar {
  border-top: 1px solid var(--border);
}

.file-name {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1;
  color: var(--ink);
}

.file-lang {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--ink-muted);
}

.plate pre,
.script pre {
  margin: 0;
  overflow-x: auto;
  font-size: 0.8125rem;
  line-height: 1.62;
  tab-size: 4;
}

.plate pre {
  padding: 18px 20px;
  color: var(--ink);
}

.compile-arrow {
  align-self: center;
  justify-self: center;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--amber);
  box-shadow: 0 1px 2px rgb(20 25 31 / 5%);
}

.compile-arrow svg {
  width: 16px;
  height: 16px;
}

.script {
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  color: var(--code-text);
  box-shadow: 0 1px 3px rgb(20 25 31 / 8%);
}

.script-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 0 12px 0 18px;
  background: var(--code-bar);
  border-bottom: 1px solid var(--code-border);
}

.script-bar .file-name {
  color: var(--code-text);
}

.view-toggle {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--code-border);
  border-radius: var(--radius-control);
  background: var(--code-bg);
}

.view-toggle button {
  min-height: 26px;
  padding: 0 10px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--code-muted);
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 600;
  transition: background-color 120ms ease, color 120ms ease;
}

.view-toggle button:hover {
  color: var(--code-text);
}

.view-toggle button[aria-pressed="true"] {
  background: var(--amber-bright);
  color: var(--ink);
}

.view-toggle button:focus-visible,
.script pre:focus-visible,
.command .copy:focus-visible {
  outline-color: var(--amber-bright);
}

.script pre {
  flex: 1;
  padding: 18px 20px;
}

.script-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  margin: 0;
  padding: 11px 20px;
  background: var(--code-bar);
  border-top: 1px solid var(--code-border);
  color: var(--code-muted);
  font-family: var(--mono);
  font-size: 0.75rem;
}

.script-stats div {
  display: flex;
  gap: 6px;
}

.script-stats dt::after {
  content: ":";
}

.script-stats dd {
  margin: 0;
  color: var(--code-text);
  font-weight: 600;
}

.exhibit-note {
  max-width: var(--measure);
  margin: 16px 0 0;
  color: var(--ink-muted);
  font-size: 0.88rem;
}

.tok-key { color: var(--ink); font-weight: 650; }
.tok-com { color: #6B7682; }
.tok-str { color: var(--ochre); }

:is(.script, .snippet) .tok-key { color: var(--amber-bright); font-weight: 600; }
:is(.script, .snippet) .tok-com { color: var(--code-muted); }
:is(.script, .snippet) .tok-str { color: var(--sage); }
.tok-fn { color: var(--amber-bright); font-weight: 600; }
.tok-prompt { color: var(--code-muted); user-select: none; }
.tok-drift { color: var(--amber-bright); font-weight: 650; }
.tok-ok { color: var(--sage); }
.tok-changed { color: #F4F7FA; font-weight: 650; }

.section {
  padding-block: clamp(56px, 8vw, 96px);
  border-top: 1px solid var(--border);
}

.section-head {
  display: grid;
  gap: 12px;
  max-width: var(--measure);
  margin-bottom: 32px;
}

.section-head p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 1.02rem;
}

.table-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: 0 1px 3px rgb(20 25 31 / 4%);
}

.parts,
.fit {
  width: 100%;
  border-collapse: collapse;
}

.parts th,
.parts td,
.fit th,
.fit td {
  padding: 14px 20px;
  text-align: left;
  vertical-align: top;
}

.parts thead th,
.fit thead th {
  padding-block: 12px;
  background: var(--surface-tint);
  color: var(--ink-muted);
  font-size: 0.82rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}

.parts tbody tr + tr,
.fit tbody tr + tr {
  border-top: 1px solid var(--border);
}

.parts tbody th {
  width: 8.5rem;
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: 650;
  color: var(--ink);
  white-space: nowrap;
}

.parts td:last-child {
  color: var(--ink-muted);
}

.parts code,
.fit code,
.docs-body table code {
  white-space: nowrap;
}

.extras {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 32px;
  align-items: stretch;
}

.extras > div {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: 0 1px 3px rgb(20 25 31 / 4%);
}

.extras p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.93rem;
  line-height: 1.58;
}

.snippet {
  margin: 6px 0 0;
  padding: 14px 16px;
  overflow-x: auto;
  border: 1px solid var(--code-border);
  border-radius: 7px;
  background: var(--code-bg);
  color: var(--code-text);
  font-size: 0.78rem;
  line-height: 1.62;
}

.extras .snippet {
  flex: 1;
}

.fit tbody th {
  width: 12.5rem;
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--ink);
}

.fit tbody td {
  color: var(--ink-muted);
  font-size: 0.95rem;
}

.fit tbody tr.is-us {
  background: var(--amber-tint);
}

.fit tbody tr.is-us th {
  color: var(--ink);
  box-shadow: inset 3px 0 0 var(--amber);
}

.fit tbody tr.is-us td {
  color: var(--ink);
}

/* Stacked bands prevent wide install commands from clipping. */

.install-band {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
}

.install-intro p {
  margin: 12px 0 0;
  color: var(--ink-muted);
}

.install-band > div,
.commands > li,
.steps > li,
.steps > li > * {
  min-width: 0;
}

.commands {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.commands p {
  margin: 0 0 6px;
  color: var(--ink-muted);
  font-size: 0.88rem;
  font-weight: 550;
}

.command {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--code-border);
  border-radius: var(--radius-control);
  background: var(--code-bg);
  color: var(--code-text);
  overflow: hidden;
}

.command code {
  flex: 1;
  min-width: 0;
  padding: 12px 16px;
  overflow-x: auto;
  font-size: 0.84rem;
  line-height: 1.45;
  white-space: pre;
}

.command code::before {
  content: "$ ";
  color: var(--code-muted);
  user-select: none;
}

.copy {
  flex: none;
  min-width: 68px;
  padding: 0 12px;
  border: 0;
  border-left: 1px solid var(--code-border);
  background: var(--code-bar);
  color: var(--code-muted);
  font: 600 0.78rem var(--sans);
  cursor: pointer;
  transition: color 120ms ease, background-color 120ms ease;
}

.copy:hover {
  color: var(--code-text);
  background: #222B38;
}

.copy[data-state="done"] {
  color: var(--amber-bright);
}

.quickstart-band {
  margin-top: 52px;
  padding-top: 44px;
  border-top: 1px solid var(--border);
}

.steps {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 20px clamp(24px, 4vw, 56px);
  align-items: start;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps > li {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  gap: 4px 14px;
  counter-increment: step;
}

.steps > li:first-child {
  grid-row: 1 / span 3;
}

.steps > li::before {
  content: counter(step, decimal-leading-zero);
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 0.76rem;
  font-weight: 650;
}

.steps p {
  margin: 0.2rem 0 8px;
  color: var(--ink);
  font-size: 0.95rem;
}

.steps .snippet {
  margin-top: 2px;
}

.site-footer {
  padding-block: 36px 48px;
  border-top: 1px solid var(--border);
  color: var(--ink-muted);
  font-size: 0.88rem;
}

.site-footer .shell {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 14px 32px;
}

.site-footer p {
  margin: 0;
}

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

.site-footer a:hover {
  color: var(--ink);
}

.site-footer nav {
  display: flex;
  gap: 20px;
}

.docs {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: clamp(32px, 5vw, 68px);
  padding-block: 44px 96px;
}

.docs-nav {
  position: sticky;
  top: 88px;
  align-self: start;
  font-size: 0.88rem;
}

.docs-toc summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0 10px;
  color: var(--ink-muted);
  font-size: 0.8rem;
  font-weight: 650;
  list-style: none;
  cursor: default;
  pointer-events: none;
}

.docs-toc summary::-webkit-details-marker {
  display: none;
}

.docs-toc summary .toc-chevron {
  display: none;
}

.docs-nav ol {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0 0 0 12px;
  border-left: 1px solid var(--border);
  list-style: none;
}

.docs-nav ol ol {
  margin: 2px 0 6px 10px;
  padding-left: 10px;
  border-left: 1px solid var(--border);
  font-size: 0.84rem;
}

.docs-nav a {
  display: block;
  padding: 3px 0;
  color: var(--ink-muted);
  text-decoration: none;
}

.docs-nav a:hover {
  color: var(--ink);
}

.docs-body {
  min-width: 0;
  max-width: 74ch;
}

.docs-body h1 {
  font-size: clamp(2.1rem, 4.5vw, 3rem);
  line-height: 1.08;
}

.docs-body h2 {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: clamp(1.45rem, 2.8vw, 1.85rem);
  scroll-margin-top: 84px;
}

.docs-body h3 {
  margin-top: 32px;
  font-size: 1.15rem;
  scroll-margin-top: 84px;
}

.docs-body h3 code {
  padding: 0.1em 0.35em;
  font-size: 0.92em;
}

.docs-body > p:first-of-type {
  margin-top: 14px;
  color: var(--ink-muted);
  font-size: 1.06rem;
}

.docs-body pre {
  margin: 16px 0;
  padding: 15px 18px;
  overflow-x: auto;
  border: 1px solid var(--code-border);
  border-radius: 8px;
  background: var(--code-bg);
  color: var(--code-text);
  font-size: 0.8125rem;
  line-height: 1.6;
}

.docs-body pre.wrap-output {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.docs-body table {
  width: 100%;
  margin: 18px 0;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  font-size: 0.92rem;
}

.docs-body th,
.docs-body td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.docs-body tbody tr:last-child td {
  border-bottom: 0;
}

.docs-body thead th {
  background: var(--surface-tint);
  color: var(--ink-muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.docs-body td:first-child {
  white-space: nowrap;
}

.lost {
  padding-block: clamp(64px, 12vw, 144px);
}

.lost h1 {
  max-width: 18ch;
  font-size: clamp(2.4rem, 6vw, 4rem);
  line-height: 1.06;
}

.lost p {
  max-width: 52ch;
  margin: 18px 0 28px;
  color: var(--ink-muted);
  font-size: 1.05rem;
}

@media (max-width: 900px) {
  .cargo {
    grid-template-columns: minmax(0, 1fr);
  }

  .compile-arrow {
    margin: 12px auto;
    transform: rotate(90deg);
  }

  .extras {
    grid-template-columns: minmax(0, 1fr);
  }

  .install-band,
  .steps {
    grid-template-columns: minmax(0, 1fr);
  }

  .steps > li:first-child {
    grid-row: auto;
  }

  .docs {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    padding-block: 24px 72px;
  }

  .docs-nav {
    position: static;
  }

  .docs-toc {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
  }

  .docs-toc summary {
    padding: 12px 16px;
    color: var(--ink);
    font-size: 0.88rem;
    cursor: pointer;
    pointer-events: auto;
  }

  .docs-toc summary .toc-chevron {
    display: block;
    width: 16px;
    height: 16px;
    color: var(--ink-muted);
    transition: transform 140ms ease;
  }

  .docs-toc[open] summary {
    border-bottom: 1px solid var(--border);
  }

  .docs-toc[open] summary .toc-chevron {
    transform: rotate(180deg);
  }

  .docs-nav ol {
    padding: 10px 16px 14px 20px;
    border-left: 0;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 15.5px;
  }

  .site-nav .nav-github {
    display: none;
  }

  .recipe-tabs {
    display: flex;
    width: 100%;
  }

  .recipe-tabs button {
    flex: 1 1 auto;
    padding: 0 10px;
    font-size: 0.82rem;
  }

  .parts thead,
  .fit thead {
    display: none;
  }

  .parts tr,
  .fit tr {
    display: grid;
    gap: 4px;
    padding: 14px 16px;
  }

  .parts th,
  .parts td,
  .fit th,
  .fit td {
    width: auto;
    padding: 2px 0;
  }

  .fit td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-top: 6px;
    color: var(--ink-muted);
    font-size: 0.78rem;
    font-weight: 600;
  }

  .fit tbody tr.is-us th {
    box-shadow: none;
  }

  .fit tbody tr.is-us {
    box-shadow: inset 3px 0 0 var(--amber);
  }

  .docs-body td:first-child {
    white-space: normal;
  }

  .docs-body table code {
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

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