/* ============================================================
   sidekit.net
   Warm paper ground, aubergine chrome, a full accent set.
   The mark is a narrowing: whole suite -> what matters -> the answer.
   Semantics are load-bearing: teal = pass, yellow = flaky, coral = fail.
   Aubergine is brand and never means a test state.
   ============================================================ */

:root {
  --paper: #F7F2ED;
  --paper-2: #F1EAE3;
  --card: #FFFFFF;
  --aub: #4A154B;
  --aub-deep: #3F0E40;
  --aub-soft: #EDE3EE;
  --teal: #2EB67D;
  --teal-ink: #1B7A52;
  --teal-wash: #EAF7F1;
  --yellow: #ECB22E;
  --yellow-ink: #8A6210;
  --yellow-wash: #FDF4E3;
  --coral: #E01E5A;
  --coral-ink: #B01446;
  --coral-wash: #FDEBF1;
  --sky: #36C5F0;
  --sky-ink: #1B7699;
  --sky-wash: #E8F6FD;
  --ink: #1D1C1D;
  --muted: #616061;
  --line: #E4DDD6;
  --line-soft: #F0EBE6;

  --sans: 'Lato', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --disp: 'Bricolage Grotesque', var(--sans);
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', monospace;

  --rail: clamp(1.25rem, 4vw, 3rem);
  --shell: 1080px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--aub); text-decoration-color: rgba(74, 21, 75, .3); text-underline-offset: 2px; }
a:hover { color: var(--coral-ink); text-decoration-color: currentColor; }

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

code, kbd, pre, samp { font-family: var(--mono); }

.shell { max-width: var(--shell); margin: 0 auto; padding: 0 var(--rail); }

/* ---------- nav ---------- */

#nav { background: var(--aub-deep); color: #fff; padding: .85rem 0; }
#nav .nav-inner {
  max-width: var(--shell); margin: 0 auto; padding: 0 var(--rail);
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
}
.nav-logo a {
  display: inline-flex; align-items: center; gap: .6rem;
  font-family: var(--disp); font-weight: 800; font-size: 1.15rem;
  color: #fff; text-decoration: none; letter-spacing: -.01em;
}
.mark { display: block; flex: none; }
.nav-links { display: flex; align-items: center; gap: 1.5rem; margin: 0; padding: 0; list-style: none; font-size: .93rem; }
.nav-links a { color: #E0CDE1; text-decoration: none; font-weight: 700; }
.nav-links a:hover { color: #fff; }
.nav-links a.active { color: #fff; box-shadow: inset 0 -2px 0 var(--yellow); }
@media (max-width: 620px) {
  .nav-links { gap: 1rem; font-size: .85rem; }
  .nav-links li.hide-sm { display: none; }
}

/* ---------- type ---------- */

h1, h2, h3, h4 { font-family: var(--disp); color: var(--ink); letter-spacing: -.02em; line-height: 1.1; text-wrap: balance; }
h1 { font-weight: 800; }
h2 { font-weight: 800; font-size: clamp(1.7rem, 3.6vw, 2.4rem); margin: 0 0 .5rem; }
h3 { font-weight: 700; font-size: 1.08rem; margin: 0 0 .35rem; }

.eyebrow {
  font-family: var(--mono); font-size: .72rem; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 1rem;
}
.lede { font-size: 1.12rem; color: var(--muted); max-width: 56ch; margin: 0; }
.sub { color: var(--muted); margin: 0 0 1.8rem; }

section { padding: clamp(3rem, 6vw, 4.75rem) 0; }
.rule { border: 0; height: 1px; background: var(--line); margin: 0; }

/* ---------- hero ---------- */

.hero { padding: clamp(3rem, 7vw, 5rem) 0 1rem; }
.hero h1 {
  font-size: clamp(2.2rem, 5.5vw, 3.6rem); line-height: 1.05;
  margin: 0 0 1.1rem; max-width: 17ch;
}
.hero h1 code {
  font-family: var(--mono);
  font-size: .8em;
  font-weight: 600;
  color: var(--aub);
  background: var(--aub-soft);
  padding: .05em .24em;
  border-radius: 7px;
  white-space: nowrap;
}
.hero h1 .hl { position: relative; white-space: nowrap; }
.hero h1 .hl svg { position: absolute; left: 0; bottom: -.3em; width: 100%; height: .38em; }
.hero .lede { margin-bottom: 2rem; }

/* The plain-language answer to "what is this?" — larger and darker than the
   supporting copy, so it reads before anything else on the page. */
.definition {
  font-size: clamp(1.2rem, 2.3vw, 1.45rem);
  line-height: 1.45;
  color: var(--ink);
  max-width: 60ch;
  margin: 0 0 1.1rem;
}
.definition strong { font-weight: 900; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .6rem; }

.btn {
  display: inline-block; padding: .78rem 1.5rem; border-radius: 10px;
  font-family: var(--sans); font-weight: 900; font-size: 1rem;
  text-decoration: none; border: 2px solid transparent; cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .15s ease;
}
.btn-primary { background: var(--aub); color: #fff; box-shadow: 0 3px 0 var(--aub-deep); }
.btn-primary:hover { color: #fff; transform: translateY(1px); box-shadow: 0 2px 0 var(--aub-deep); }
.btn-ghost { background: var(--card); color: var(--aub); border-color: var(--line); box-shadow: 0 3px 0 var(--line); }
.btn-ghost:hover { color: var(--aub); border-color: #D6CBC1; transform: translateY(1px); box-shadow: 0 2px 0 var(--line); }

/* ---------- signature: the same question, two answers ---------- */

.chat {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: .5rem 1.5rem; margin-top: 3rem; box-shadow: 0 12px 30px rgba(74, 21, 75, .07);
}
.msg { display: flex; gap: .9rem; padding: 1.1rem 0; }
.msg + .msg { border-top: 1px solid var(--line-soft); }
.msg-body { min-width: 0; }
.av {
  width: 38px; height: 38px; border-radius: 9px; flex: none; display: grid; place-items: center;
  font-family: var(--mono); font-size: .7rem; font-weight: 600; color: #fff;
}
.who { font-family: var(--sans); font-weight: 900; font-size: .96rem; }
.who span { font-weight: 400; color: var(--muted); font-size: .8rem; margin-left: .45rem; }
.bub {
  font-family: var(--mono); font-size: .74rem; line-height: 1.55; color: var(--muted);
  white-space: pre; overflow: hidden; max-height: 5.2rem; margin-top: .35rem;
  -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent);
  mask-image: linear-gradient(180deg, #000 55%, transparent);
}
.bub-answer {
  display: inline-block; margin-top: .4rem; padding: .6rem .8rem;
  background: var(--teal-wash); border: 1px solid #CFEBDD; border-radius: 10px;
  font-family: var(--mono); font-size: .84rem; color: var(--ink); white-space: pre-wrap;
  max-width: 100%; overflow-x: auto;
}
.msg-note { font-family: var(--mono); font-size: .74rem; color: var(--muted); margin: .55rem 0 0; }
.doodle {
  display: flex; align-items: center; gap: .5rem; margin-top: .5rem;
  font-family: var(--disp); font-weight: 700; font-size: .96rem; color: var(--coral-ink);
}
.doodle svg { flex: none; }

/* ---------- cards ---------- */

.q-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(248px, 1fr)); gap: 1.1rem; }
.q-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 1.4rem;
  transition: transform .15s ease, box-shadow .15s ease;
}
.q-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(74, 21, 75, .09); }
.q-card p { margin: 0; font-size: .93rem; color: var(--muted); }
.q-card .when { display: block; font-weight: 700; color: var(--ink); margin-bottom: .15rem; }

/* Step order is real information here: this is the sequence an agent actually
   walks on one edit, not a decorative numbering of an unordered list. */
.q-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .7rem; }
.q-step {
  flex: none; width: 21px; height: 21px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--paper-2); color: var(--muted);
  font-family: var(--mono); font-size: .68rem; font-weight: 600;
}
.q-head .chip { margin-bottom: 0; }

/* The sixth cell is a way out to the full reference, not a sixth question —
   which also keeps the grid from ending on an orphan. */
.q-card.q-more {
  background: var(--aub); border-color: var(--aub); color: #E8D9E9;
  display: flex; flex-direction: column; justify-content: center; text-decoration: none;
}
.q-card.q-more h3 { color: #fff; }
.q-card.q-more p { color: #C9B6CA; }
.q-card.q-more .arrow { margin-left: .3rem; transition: transform .15s ease; display: inline-block; }
.q-card.q-more:hover .arrow { transform: translateX(3px); }

.chip {
  display: inline-block; font-family: var(--mono); font-size: .7rem;
  padding: .2rem .5rem; border-radius: 6px; margin-bottom: .7rem;
  background: var(--aub-soft); color: var(--aub);
}
.chip.teal { background: var(--teal-wash); color: var(--teal-ink); }
.chip.sky { background: var(--sky-wash); color: var(--sky-ink); }
.chip.coral { background: var(--coral-wash); color: var(--coral-ink); }
.chip.yellow { background: var(--yellow-wash); color: var(--yellow-ink); }

/* ---------- response-size meters ----------
   One series, one hue. The categories are kinds of query, not an ordered scale,
   so a darker-where-bigger ramp would double-encode bar length as colour. Each
   row is a ratio against a fixed 1 kB ceiling, so the empty track carries the
   message: the numbers are small against a limit the reader can hold in mind. */

.sizes { width: 100%; border-collapse: collapse; margin: 1.75rem 0 0; }
.sizes caption {
  caption-side: top; text-align: left; font-size: .82rem; color: var(--muted);
  padding-bottom: .9rem;
}
.sizes th, .sizes td { border: 0; padding: .5rem 0; vertical-align: middle; }
.sizes th {
  text-align: left; font-weight: 400; font-size: .93rem; color: var(--ink);
  width: 19rem; padding-right: 1.5rem;
}
.sizes tr:hover th { color: var(--aub); }
.sizes .track {
  display: block; width: 100%; height: 11px; border-radius: 6px;
  background: rgba(74, 21, 75, .09);
}
.sizes .bar {
  display: block; height: 100%; width: var(--pct);
  background: var(--aub); border-radius: 6px 4px 4px 6px;
}
.sizes .val {
  width: 6.5rem; padding-left: 1.25rem; text-align: right;
  font-family: var(--mono); font-size: .85rem; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.sizes .ceiling {
  font-size: .78rem; color: var(--muted); padding-top: .4rem;
}
@media (max-width: 620px) {
  .sizes th { width: auto; font-size: .88rem; padding-right: .75rem; }
  .sizes .val { width: 4.5rem; padding-left: .6rem; font-size: .78rem; }
}
@media (prefers-reduced-motion: no-preference) {
  .sizes .bar { animation: grow 800ms cubic-bezier(.2,.8,.2,1) both; transform-origin: left center; }
  @keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
}

/* ---------- setup steps ----------
   Numbered because installing, configuring and instructing genuinely happen in
   that order — the numbers are the information, not decoration. */

.steps { list-style: none; margin: 2.25rem 0 0; padding: 0; counter-reset: step; }
.step { position: relative; padding: 0 0 2rem 3.25rem; }
.step::before {
  content: counter(step); counter-increment: step;
  position: absolute; left: 0; top: 0;
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--aub); color: #fff;
  font-family: var(--mono); font-size: .82rem; font-weight: 600;
}
/* The rail joins the steps into one procedure rather than three loose blocks. */
.step:not(:last-child)::after {
  content: ""; position: absolute; left: 14px; top: 38px; bottom: .35rem;
  width: 2px; background: var(--line);
}
.step h3 { margin: .3rem 0 .5rem; font-size: 1.12rem; }
.step > p { margin: 0 0 .5rem; color: var(--muted); max-width: 60ch; }
.step .code { margin: .9rem 0; }
@media (max-width: 620px) {
  .step { padding-left: 2.6rem; }
  .step::before { width: 26px; height: 26px; font-size: .75rem; }
  .step:not(:last-child)::after { left: 12px; top: 33px; }
}

/* ---------- objection list ----------
   Deliberately quiet: the page already has a chat block, cards and meters, so
   this section is typographic only. No numbering — these are not a sequence. */

.qa { margin-top: 2.25rem; }
.qa-item { padding: 1.5rem 0; border-top: 1px solid var(--line); }
.qa-item:first-child { border-top: 0; padding-top: .5rem; }
.qa-item h3 {
  font-size: 1.15rem; color: var(--aub); margin: 0 0 .55rem; max-width: 34ch;
}
.qa-item p { margin: 0; max-width: 62ch; color: var(--muted); }
.qa-item p + p { margin-top: .7rem; }
.qa-item strong { color: var(--ink); }

/* ---------- code ---------- */

.code { background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin: 1.4rem 0; overflow: hidden; }
.code-head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .55rem .95rem; background: var(--paper-2); border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: .72rem; color: var(--muted);
}
.code pre { margin: 0; padding: 1rem; overflow-x: auto; font-size: .82rem; line-height: 1.7; color: var(--ink); }
.copy-btn {
  border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: var(--muted);
  font-family: var(--mono); font-size: .68rem; padding: .22rem .55rem; cursor: pointer;
}
.copy-btn:hover { color: var(--aub); border-color: var(--aub-soft); background: var(--aub-soft); }

.tok-key { color: var(--aub); }
.tok-str { color: var(--teal-ink); }
.tok-num { color: var(--coral-ink); }
.tok-com { color: var(--muted); }

/* ---------- badges, callouts, tables ---------- */

.badge-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.badge {
  display: inline-block; background: var(--card); border: 2px solid var(--line);
  border-radius: 999px; padding: .3rem .9rem; font-size: .82rem; font-weight: 700; color: var(--muted);
}
.badge.lit { border-color: var(--teal); color: var(--teal-ink); }

.callout {
  display: flex; gap: .9rem; padding: 1.1rem 1.3rem; margin: 1.5rem 0;
  background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--yellow);
  border-radius: 12px; font-size: .95rem;
}
.callout strong { color: var(--ink); }

.table-wrap { overflow-x: auto; margin: 1.5rem 0; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; background: var(--card); border-radius: 10px; overflow: hidden; }
.table th, .table td { text-align: left; padding: .65rem .9rem; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.table th {
  background: var(--paper-2); font-family: var(--mono); font-size: .7rem; font-weight: 500;
  letter-spacing: .09em; text-transform: uppercase; color: var(--muted);
}
.table tr:last-child td { border-bottom: 0; }

/* ---------- docs ---------- */

.doc-layout {
  display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: clamp(2rem, 5vw, 3.5rem);
  max-width: var(--shell); margin: 0 auto; padding: 2.75rem var(--rail) 4.5rem; align-items: start;
}
.doc-sidebar { position: sticky; top: 1.5rem; font-size: .92rem; }
.doc-sidebar h4 {
  font-family: var(--mono); font-size: .7rem; font-weight: 500; letter-spacing: .13em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 .7rem;
}
.doc-sidebar ul { list-style: none; margin: 0; padding: 0; }
.doc-sidebar a {
  display: block; padding: .35rem .8rem; margin-bottom: 2px; border-radius: 8px;
  color: var(--muted); text-decoration: none; font-weight: 700;
}
.doc-sidebar a:hover { background: var(--card); color: var(--ink); }
.doc-sidebar a.active { background: var(--aub); color: #fff; }
@media (max-width: 860px) { .doc-layout { grid-template-columns: 1fr; } .doc-sidebar { position: static; } }

.crumbs { font-family: var(--mono); font-size: .72rem; color: var(--muted); margin-bottom: .9rem; }
.crumbs a { color: var(--muted); }
.crumbs span { margin: 0 .4rem; color: #C7BDB3; }

.prose { max-width: 74ch; }
.prose h1 { font-size: clamp(1.9rem, 4vw, 2.5rem); margin: 0 0 1rem; }
.prose h2 { font-size: 1.4rem; margin: 2.75rem 0 .8rem; padding-top: 1.4rem; border-top: 1px solid var(--line); }
.prose h3 { margin: 1.9rem 0 .5rem; }
.prose p, .prose li { font-size: .98rem; }
.prose ul, .prose ol { padding-left: 1.2rem; }
.prose li { margin: .4rem 0; }
.prose li::marker { color: var(--yellow); }
.prose code {
  padding: .1rem .35rem; background: var(--aub-soft); border-radius: 5px;
  font-size: .85em; color: var(--aub);
}
.prose .code code, .prose .code pre code { background: none; padding: 0; color: inherit; }
.prose strong { color: var(--ink); }
.anchor-h { scroll-margin-top: 1.5rem; }

/* ---------- docs prev/next ---------- */

.doc-nav {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  margin-top: 3.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line);
}
.doc-nav a {
  display: block; padding: .8rem 1.1rem; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); text-decoration: none; font-weight: 700; color: var(--ink);
  max-width: 48%;
}
.doc-nav a:hover { border-color: var(--aub-soft); background: var(--aub-soft); color: var(--aub); }
.doc-nav a span {
  display: block; font-family: var(--mono); font-size: .68rem; font-weight: 500;
  letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: .15rem;
}
.doc-nav-next { text-align: right; margin-left: auto; }
@media (max-width: 520px) { .doc-nav a { max-width: 100%; flex: 1 1 100%; } }

/* ---------- footer ---------- */

footer { background: var(--aub-deep); color: #C9B6CA; padding: 2.5rem 0; font-size: .92rem; }
.footer-inner {
  max-width: var(--shell); margin: 0 auto; padding: 0 var(--rail);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 1.3rem; margin: 0; padding: 0; list-style: none; }
.footer-links a { color: #E8D9E9; text-decoration: none; font-weight: 700; }
.footer-links a:hover { color: #fff; }
.footer-meta { color: #B29CB3; }

/* ---------- reveal ---------- */

.reveal { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(12px); transition: opacity .5s ease, transform .5s ease; }
  .reveal.visible { opacity: 1; transform: none; }
}

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

.center-page {
  min-height: 58vh; display: flex; flex-direction: column; align-items: flex-start; justify-content: center;
  gap: 1rem; max-width: var(--shell); margin: 0 auto; padding: 4rem var(--rail);
}
