/* =========================================================
   Crumble — docs
   Same palette, fonts and furniture as the landing; the layout is
   rebuilt for reading: one column of text at a comfortable measure,
   a sticky contents rail beside it.
   ========================================================= */

:root {
  --doc-rail: 264px;
  --doc-measure: 68ch;
}

body.doc {
  background: var(--deep);
  color: var(--cream);
  font-size: 17px;
  line-height: 1.62;
}

/* film grain, same recipe as the landing sections */
body.doc::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: url("/assets/img/grain-1.png") 0 0 / 96px 96px repeat;
  opacity: .07;
}
.doc-shell, .doc-top, .doc-foot { position: relative; z-index: 1; }

/* ---------- top bar ---------- */
.doc-top {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--deep) 86%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(226, 254, 165, .14);
}
.doc-top-bar {
  display: flex; align-items: center; gap: 16px;
  height: 72px;
}
.doc-top .brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--f-display); font-size: 19px; color: var(--cream);
  text-decoration: none; white-space: nowrap;
}
.doc-top .brand img { width: 34px; height: 34px; }
.doc-tag {
  font-weight: 800; font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--deep); background: var(--lime);
  padding: 4px 9px 5px; border-radius: 100px;
}
.doc-top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.doc-top-right .btn.sm { height: 40px; font-size: 15px; }

/* ---------- shell ---------- */
.doc-shell {
  display: grid;
  grid-template-columns: var(--doc-rail) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: start;
  padding: 44px 0 96px;
}

/* ---------- contents rail ---------- */
.doc-rail { position: sticky; top: 104px; }
.doc-rail h2 {
  font-family: var(--f-body); font-weight: 800;
  font-size: 11px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--mint); margin: 0 0 14px;
}
.doc-rail ol { list-style: none; margin: 0 0 30px; padding: 0; }
.doc-rail li { margin: 0 0 2px; }
.doc-rail a {
  display: flex; gap: 12px; align-items: baseline;
  padding: 9px 14px; border-radius: 12px;
  color: var(--cream); text-decoration: none;
  font-weight: 600; font-size: 15.5px; line-height: 1.35;
  transition: background .14s ease, color .14s ease;
}
.doc-rail a i {
  font-style: normal; font-variant-numeric: tabular-nums;
  font-size: 12px; font-weight: 800; color: var(--mint); opacity: .75;
}
.doc-rail a:hover { background: rgba(226, 254, 165, .09); }
.doc-rail a[aria-current="page"] {
  background: var(--lime); color: var(--ink);
}
.doc-rail a[aria-current="page"] i { color: var(--ink); opacity: .55; }

/* ---------- article ---------- */
.doc-body { max-width: var(--doc-measure); min-width: 0; }
.doc-kicker {
  font-weight: 800; font-size: 11px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--orange); margin: 0 0 12px;
}
.doc-body h1 {
  font-family: var(--f-display); font-weight: 400; text-transform: uppercase;
  font-size: clamp(34px, 5.2vw, 54px); line-height: 1.02; letter-spacing: -.01em;
  color: var(--lime); margin: 0 0 18px;
}
.doc-lede { font-size: 20px; line-height: 1.5; color: var(--cream); margin: 0 0 8px; }
.doc-body h2 {
  font-family: var(--f-display); font-weight: 400;
  font-size: clamp(22px, 2.6vw, 28px); line-height: 1.2;
  color: var(--cream); margin: 52px 0 14px; scroll-margin-top: 96px;
}
.doc-body h3 {
  font-family: var(--f-body); font-weight: 800; font-size: 18px;
  color: var(--lime); margin: 30px 0 8px;
}
.doc-body p { margin: 0 0 18px; }
.doc-body ul, .doc-body ol { margin: 0 0 18px; padding-left: 22px; }
.doc-body li { margin: 0 0 9px; }
.doc-body li::marker { color: var(--mint); }
.doc-body strong { color: var(--lime); font-weight: 700; }
.doc-body a { color: var(--lime); text-underline-offset: 3px; }
.doc-body a:hover { color: var(--butter); }
.doc-body hr {
  border: 0; height: 1px; background: rgba(226, 254, 165, .16); margin: 42px 0;
}

code, .mono {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: .9em;
}
.doc-body :not(pre) > code {
  background: rgba(226, 254, 165, .12);
  color: var(--butter);
  padding: 2px 6px; border-radius: 6px;
  overflow-wrap: anywhere;
}

/* ---------- blocks ---------- */
.note {
  background: rgba(226, 254, 165, .07);
  border-left: 4px solid var(--mint);
  border-radius: 0 16px 16px 0;
  padding: 18px 22px; margin: 0 0 22px;
}
.note.warn { border-left-color: var(--orange); }
.note > :last-child { margin-bottom: 0; }
.note b { color: var(--lime); }

.steps { counter-reset: s; list-style: none; padding: 0; margin: 0 0 24px; }
.steps > li {
  counter-increment: s; position: relative;
  padding: 0 0 0 52px; margin: 0 0 22px;
}
.steps > li::before {
  content: counter(s, decimal-leading-zero);
  position: absolute; left: 0; top: 1px;
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--lime); color: var(--ink);
  font-weight: 800; font-size: 13px; font-variant-numeric: tabular-nums;
}
.steps h3 { margin: 4px 0 6px; }
.steps > li > :last-child { margin-bottom: 0; }

.facts { width: 100%; border-collapse: collapse; margin: 0 0 24px; font-size: 16px; }
.facts th, .facts td {
  text-align: left; padding: 12px 14px;
  border-bottom: 1px solid rgba(226, 254, 165, .14);
  vertical-align: top;
}
.facts th {
  font-weight: 800; font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--mint); border-bottom-color: rgba(226, 254, 165, .3);
}
.facts td:first-child { font-weight: 700; color: var(--lime); white-space: nowrap; }
.facts .mono { font-size: 13px; overflow-wrap: anywhere; white-space: normal; }

.can { display: grid; gap: 14px; margin: 0 0 24px; }
@container (min-width: 640px) { .can { grid-template-columns: 1fr 1fr; } }
.can > div {
  background: rgba(226, 254, 165, .06); border-radius: 20px; padding: 20px 22px;
  border: 1px solid rgba(226, 254, 165, .14);
}
.can h3 { margin: 0 0 10px; font-size: 15px; letter-spacing: .04em; text-transform: uppercase; }
.can.no h3 { color: var(--orange); }
.can ul { margin: 0; padding-left: 20px; font-size: 16px; }
.can li { margin: 0 0 7px; }

/* ---------- prev / next ---------- */
.doc-nav {
  display: flex; gap: 14px; flex-wrap: wrap;
  margin: 56px 0 0; padding-top: 28px;
  border-top: 1px solid rgba(226, 254, 165, .16);
}
.doc-nav a {
  flex: 1 1 220px; min-width: 0;
  background: rgba(226, 254, 165, .06);
  border: 1px solid rgba(226, 254, 165, .16);
  border-radius: 18px; padding: 14px 18px;
  color: var(--cream); text-decoration: none;
  transition: background .14s ease;
}
.doc-nav a:hover { background: rgba(226, 254, 165, .12); }
.doc-nav span {
  display: block; font-size: 11px; font-weight: 800;
  letter-spacing: .16em; text-transform: uppercase; color: var(--mint);
  margin-bottom: 3px;
}
.doc-nav b { font-weight: 700; font-size: 17px; color: var(--lime); }
.doc-nav .next { text-align: right; }

/* ---------- index cards ---------- */
.doc-cards { display: grid; gap: 16px; margin: 8px 0 0; }
@container (min-width: 620px) { .doc-cards { grid-template-columns: 1fr 1fr; } }
.doc-cards a {
  display: block; text-decoration: none; color: var(--cream);
  background: rgba(226, 254, 165, .06);
  border: 1px solid rgba(226, 254, 165, .16);
  border-radius: 22px; padding: 22px 24px;
  transition: transform .15s ease, background .15s ease;
}
.doc-cards a:hover { transform: translateY(-3px); background: rgba(226, 254, 165, .12); }
.doc-cards i {
  font-style: normal; font-size: 11px; font-weight: 800;
  letter-spacing: .16em; color: var(--mint); display: block; margin-bottom: 8px;
}
.doc-cards b {
  font-family: var(--f-display); font-weight: 400; font-size: 21px;
  color: var(--lime); display: block; margin-bottom: 8px;
}
.doc-cards p { margin: 0; font-size: 16px; line-height: 1.5; }

/* ---------- footer ---------- */
.doc-foot {
  border-top: 1px solid rgba(226, 254, 165, .14);
  padding: 26px 0 40px;
  display: flex; gap: 16px; flex-wrap: wrap; align-items: center;
  font-size: 14px; color: var(--cream);
}
.doc-foot .sep { margin-left: auto; }
.doc-foot a { color: var(--cream); text-decoration: none; font-weight: 600; }
.doc-foot a:hover { color: var(--lime); }

/* ---------- rail toggle (mobile) ---------- */
.rail-btn {
  display: none; align-items: center; gap: 9px;
  background: rgba(226, 254, 165, .1);
  border: 1px solid rgba(226, 254, 165, .22);
  color: var(--cream); font: inherit; font-weight: 700; font-size: 15px;
  padding: 11px 16px; border-radius: 100px;
  margin: 0 0 22px;
}
.rail-btn::after { content: "▾"; font-size: 12px; transition: transform .16s ease; }
.rail-btn[aria-expanded="true"]::after { transform: rotate(180deg); }

@media (max-width: 900px) {
  .doc-shell { grid-template-columns: minmax(0, 1fr); gap: 0; padding-top: 28px; }
  .doc-rail { position: static; order: -1; }
  .rail-btn { display: inline-flex; }
  /* the "Contents" button is the label here — the standing heading would
     otherwise sit alone over a collapsed list */
  .doc-rail h2 { display: none; }
  .doc-rail ol { display: none; margin-bottom: 26px; }
  .doc-rail.open ol { display: block; }
  .doc-body { max-width: none; }
  .doc-top .doc-tag { display: none; }
}
