/* visionfi.dev — builders site.
   Self-contained on purpose: this site has its own web root, so it cannot
   reach visionfi.ai's /assets/visionfi-core.css. The colour values below are
   the VisionFI Core v4 tokens (black carries actions, orange is accent only).
   Every class is prefixed d- . */

:root {
  --ink: #2D2A26;
  --black: #0d0d0d;
  --muted: #6B6B6B;
  --line: #E5E5E5;
  --line-strong: #bdbdbd;
  --surface: #f9f9f9;
  --chip: #f2f2f2;
  --brown: #6B4C3E;
  --accent: #F26334;
  --teal-hi: #17b3bd;
  --dk-panel: #161616;
  --dk-line: #2f2f2f;
  --dk-text: #ececec;
  --dk-soft: #c9c9c9;
  --dk-muted: #8e8e8e;
  --code-kw: #ff8a5c;
  --font-head: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
}
h1, h2, h3, p { margin: 0; }
a { color: var(--ink); }
a:hover { color: var(--black); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
section[id], div[id] { scroll-margin-top: 24px; }

.d-wrap { max-width: 1200px; margin: 0 auto; padding-inline: 32px; }
.d-wrap--wide { max-width: 1360px; }
.d-sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

/* ---------- nav ---------- */
.d-nav { border-bottom: 1px solid var(--line); background: #fff; }
.d-nav .d-wrap {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 4px 32px; padding-block: 14px;
}
.d-brand { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.d-brand b { font-family: var(--font-head); font-weight: 700; font-size: 22px; letter-spacing: -0.3px; color: var(--black); }
.d-dev {
  margin-left: 6px; padding: 2px 7px; border-radius: 4px;
  background: var(--accent); color: var(--black);
  font-family: var(--font-mono); font-weight: 500; font-size: 15px;
}
.d-navlinks { display: flex; flex-wrap: wrap; align-items: center; gap: 0 28px; font-family: var(--font-head); font-weight: 500; font-size: 15px; }
.d-navlinks a { padding: 12px 0; text-decoration: none; }
.d-navlinks a:hover { text-decoration: underline; text-underline-offset: 4px; }
.d-navutil { display: flex; align-items: center; gap: 20px; }
.d-navutil .d-out { font-size: 14px; color: var(--muted); text-decoration: none; padding: 12px 0; }
.d-navutil .d-out:hover { color: var(--black); }

/* ---------- buttons ---------- */
.d-btn {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 0 24px; border-radius: 999px; border: 1px solid transparent;
  font-family: var(--font-head); font-weight: 600; font-size: 16px; text-decoration: none;
  background: var(--black); color: #fff;
}
.d-btn:hover { background: #2a2a2a; color: #fff; }
.d-btn--sm { min-height: 44px; padding: 0 20px; font-size: 14px; }
.d-btn--accent { background: var(--accent); color: var(--black); }
.d-btn--accent:hover { background: #ff7a4d; color: var(--black); }
.d-btn--ghost { background: transparent; border-color: #5a5a5a; color: #fff; }
.d-btn--ghost:hover { background: #1f1f1f; border-color: #8e8e8e; }

/* ---------- shared type ---------- */
.d-kicker { font-family: var(--font-mono); font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--brown); }
.d-h2 { font-family: var(--font-head); font-weight: 700; font-size: clamp(28px, 3.4vw, 38px); line-height: 1.15; letter-spacing: -0.6px; color: var(--black); }
.d-lede { color: var(--muted); font-size: 18px; }
.d-more { font-family: var(--font-head); font-weight: 600; font-size: 15px; display: inline-block; padding: 12px 0; }
.d-section { padding-block: 88px; }
.d-head { display: flex; flex-direction: column; gap: 10px; max-width: 720px; margin-bottom: 40px; }
.d-head--row { max-width: none; flex-direction: row; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 40px; }
.d-head--row > div { display: flex; flex-direction: column; gap: 10px; max-width: 640px; }
.d-alt { background: var(--surface); border-block: 1px solid var(--line); }
.d-chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; font-family: var(--font-mono); font-size: 12.5px; color: var(--ink); }
.d-chips li { background: var(--chip); padding: 4px 10px; border-radius: 999px; }
code { font-family: var(--font-mono); font-size: 0.84em; background: var(--chip); color: var(--ink); padding: 1px 5px; border-radius: 4px; }

/* ---------- hero ---------- */
.d-hero {
  background-color: var(--black);
  background-image: linear-gradient(#1b1b1b 1px, transparent 1px), linear-gradient(90deg, #1b1b1b 1px, transparent 1px);
  background-size: 48px 48px;
  color: var(--dk-text);
}
.d-hero .d-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 56px; padding-block: 88px 96px; }
.d-hero-copy { flex: 1 1 440px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.d-hero .d-kicker, .d-band .d-kicker, .d-card--dark .d-kicker { color: var(--accent); }
.d-hero h1 {
  font-family: var(--font-head); font-weight: 700; font-size: clamp(38px, 5vw, 60px);
  line-height: 1.08; letter-spacing: -1.2px; color: #fff; text-wrap: balance;
}
.d-hero-copy > p { font-size: 19px; color: var(--dk-soft); max-width: 540px; }
.d-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }
.d-install {
  display: flex; align-items: center; gap: 12px; max-width: 440px; margin-top: 8px;
  padding: 4px 6px 4px 16px; background: var(--dk-panel); border: 1px solid var(--dk-line); border-radius: 8px;
  font-family: var(--font-mono); font-size: 14px;
}
.d-install .d-prompt { color: var(--accent); }
.d-install span:nth-child(2) { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; color: var(--dk-text); }

/* ---------- code ---------- */
.d-code { background: var(--dk-panel); border: 1px solid var(--dk-line); border-radius: 12px; overflow: hidden; color: var(--dk-text); }
.d-hero .d-code { flex: 1 1 480px; min-width: 0; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5); }
.d-codebar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 8px 0 20px; border-bottom: 1px solid var(--dk-line);
  font-family: var(--font-mono); font-size: 13px; color: #b5b5b5; min-height: 44px;
}
.d-copy {
  min-height: 44px; padding: 0 12px; background: transparent; border: 0; cursor: pointer;
  font-family: var(--font-mono); font-size: 13px; color: #b5b5b5;
}
.d-copy:hover { color: #fff; }
.d-tabs { display: flex; gap: 4px; padding: 0 12px; border-bottom: 1px solid var(--dk-line); }
.d-tab {
  min-height: 44px; padding: 0 14px; background: transparent; border: 0; border-bottom: 2px solid transparent;
  font-family: var(--font-mono); font-size: 13px; color: var(--dk-muted); cursor: pointer;
}
.d-tab:hover { color: #fff; }
.d-tab[aria-selected="true"] { color: #fff; border-bottom-color: var(--accent); }
.d-code pre {
  margin: 0; padding: 22px 24px 26px; overflow-x: auto;
  font-family: var(--font-mono); font-size: 13.5px; line-height: 1.75; color: var(--dk-text);
}
.d-code pre code { font-size: inherit; background: none; color: inherit; padding: 0; border-radius: 0; }
.d-code--line pre { padding-block: 18px; font-size: 14px; }
.c-k { color: var(--code-kw); }
.c-s { color: var(--teal-hi); }
.c-c { color: var(--dk-muted); }
.c-m { color: #fff; }
.d-toolchips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: -14px 0 0; padding: 0 24px 26px; font-family: var(--font-mono); font-size: 12.5px; }
.d-toolchips li { border: 1px solid #3a3a3a; border-radius: 999px; padding: 4px 10px; }

/* ---------- start here ---------- */
.d-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 24px; list-style: none; margin: 0; padding: 0; }
.d-steps li { border-top: 3px solid var(--black); padding-top: 20px; display: flex; flex-direction: column; gap: 10px; }
.d-steps .d-n { font-family: var(--font-mono); font-size: 14px; color: var(--muted); }
.d-steps h3 { font-family: var(--font-head); font-weight: 600; font-size: 21px; color: var(--black); }
.d-steps p { color: var(--muted); }

/* ---------- surface cards ---------- */
.d-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(480px, 100%), 1fr)); gap: 24px; }
.d-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 32px; display: flex; flex-direction: column; gap: 14px; }
.d-card h3 { font-family: var(--font-head); font-weight: 600; font-size: 26px; color: var(--black); }
.d-card p { color: var(--muted); }
.d-card .d-more { margin-top: auto; padding-bottom: 0; }
.d-card--dark { background: var(--black); border-color: var(--black); }
.d-card--dark h3, .d-card--dark .d-more { color: #fff; }
.d-card--dark p { color: var(--dk-soft); }

/* ---------- architecture ---------- */
.d-arch { display: flex; flex-wrap: wrap; align-items: stretch; gap: 24px; }
.d-side-box { flex: 1 1 230px; min-width: 0; border: 1px solid var(--line); border-radius: 12px; padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.d-side-box .d-kicker { font-size: 12.5px; }
.d-side-box h3 { font-family: var(--font-head); font-weight: 600; font-size: 22px; color: var(--black); }
.d-side-box p { color: var(--muted); font-size: 16px; }
.d-side-box .d-chips, .d-side-box .d-more { margin-top: auto; }
.d-rings { flex: 2.2 1 480px; min-width: 0; }
.d-ring { border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.d-ring--doors { background: var(--surface); border: 1px solid var(--line); height: 100%; }
.d-ring--sdk { background: #fff; border: 1px solid var(--line-strong); border-radius: 12px; flex: 1 1 auto; }
.d-ring--harness { background: var(--black); border-radius: 10px; flex: 1 1 auto; }
.d-ring-label { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; padding: 0 6px; font-family: var(--font-mono); font-size: 13px; color: var(--ink); }
.d-ring-label b { font-weight: 700; }
.d-ring-label span { color: var(--muted); }
.d-ring--harness > .d-ring-label { color: #fff; }
.d-ring--harness > .d-ring-label span { color: #b5b5b5; }
.d-file { background: var(--accent); color: var(--black); border-radius: 8px; padding: 22px 20px; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin-top: auto; }
.d-file b { font-family: var(--font-head); font-weight: 700; font-size: 22px; }
.d-file span { font-family: var(--font-mono); font-size: 13px; font-weight: 500; }

/* ---------- recipes band ---------- */
.d-band { background: var(--black); color: var(--dk-text); }
.d-band .d-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 56px; }
.d-band-copy { flex: 1 1 400px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.d-band .d-h2, .d-band .d-more { color: #fff; }
.d-band .d-lede { color: var(--dk-soft); }
.d-band .d-code { flex: 1 1 440px; min-width: 0; }
.d-band .d-code pre { font-size: 14.5px; line-height: 2; }

/* ---------- link lists ---------- */
.d-lists { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 48px; }
.d-lists h2 { font-family: var(--font-head); font-weight: 600; font-size: 22px; color: var(--black); padding-bottom: 12px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.d-lists ul { list-style: none; margin: 0; padding: 0; }
.d-lists a { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; text-decoration: none; }
.d-lists a b { font-weight: 600; color: var(--black); text-decoration: underline; text-underline-offset: 3px; }
.d-lists a span { color: var(--muted); font-size: 15px; }
.d-lists a:hover b { text-decoration-thickness: 2px; }

/* ---------- token cta ---------- */
.d-cta { background: var(--surface); border-top: 1px solid var(--line); padding-block: 72px; }
.d-cta .d-wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px 48px; }
.d-cta div div { display: flex; flex-direction: column; gap: 10px; max-width: 680px; }
.d-cta h2 { font-family: var(--font-head); font-weight: 700; font-size: clamp(26px, 3vw, 32px); line-height: 1.2; letter-spacing: -0.4px; color: var(--black); }

/* ---------- footer ---------- */
.d-footer { background: var(--black); color: var(--dk-text); padding-block: 56px 40px; }
.d-footcols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 32px; }
.d-footcols > div { display: flex; flex-direction: column; gap: 2px; font-size: 15px; }
.d-footcols .d-brand b { color: #fff; font-size: 20px; }
.d-footcols .d-brand i { font-style: normal; font-family: var(--font-mono); font-weight: 500; font-size: 14px; color: var(--accent); }
.d-footcols p { color: #b5b5b5; max-width: 260px; }
.d-footcols h2 { font-family: var(--font-mono); font-weight: 400; font-size: 12.5px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--dk-muted); padding-bottom: 6px; }
.d-footcols a:not(.d-brand) { color: var(--dk-text); padding: 6px 0; }
.d-footcols a:not(.d-brand):hover { color: #fff; }
.d-legal { border-top: 1px solid var(--dk-line); margin-top: 40px; padding-top: 20px; color: var(--dk-muted); font-size: 14px; }
.d-footer--slim { background: #fff; color: var(--muted); border-top: 1px solid var(--line); padding-block: 24px; font-size: 14px; }
.d-footer--slim .d-wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }

/* ---------- docs layout ---------- */
.d-docs { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0 56px; }
.d-sidebar { flex: 1 1 220px; max-width: 260px; padding-block: 36px; display: flex; flex-direction: column; gap: 26px; font-size: 15px; }
.d-sidebar h2 { font-family: var(--font-mono); font-weight: 400; font-size: 12.5px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--brown); padding-bottom: 6px; }
.d-sidebar ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.d-sidebar a { display: block; padding: 7px 12px; border-radius: 6px; text-decoration: none; }
.d-sidebar a:hover { background: var(--chip); }
.d-sidebar a[aria-current="page"] { background: var(--black); color: #fff; font-weight: 600; }
.d-main { flex: 999 1 560px; min-width: 0; padding-block: 40px 88px; display: flex; flex-direction: column; gap: 48px; }
.d-main > header { display: flex; flex-direction: column; gap: 14px; }
.d-crumb { font-family: var(--font-mono); font-size: 13px; color: var(--muted); }
.d-main h1 { font-family: var(--font-head); font-weight: 700; font-size: clamp(34px, 4.4vw, 46px); line-height: 1.1; letter-spacing: -0.9px; color: var(--black); }
.d-main > header > p { font-size: 20px; line-height: 1.5; color: var(--muted); max-width: 720px; }
.d-main section { display: flex; flex-direction: column; gap: 18px; }
.d-main section > p { max-width: 720px; }
.d-main h2 { font-family: var(--font-head); font-weight: 600; font-size: 28px; letter-spacing: -0.3px; color: var(--black); display: flex; align-items: center; gap: 14px; }
.d-num {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 999px; background: var(--accent); color: var(--black);
  font-family: var(--font-mono); font-weight: 700; font-size: 15px; letter-spacing: 0;
}
.d-prereqs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); gap: 16px; list-style: none; margin: 0; padding: 0; }
.d-prereqs li, .d-next a { border: 1px solid var(--line); border-radius: 10px; padding: 20px; display: flex; flex-direction: column; gap: 6px; }
.d-prereqs h3, .d-next b { font-family: var(--font-head); font-weight: 600; font-size: 17px; color: var(--black); }
.d-prereqs p, .d-next span { font-size: 15px; color: var(--muted); }
.d-note { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 18px 22px; max-width: 720px; display: flex; flex-direction: column; gap: 4px; }
.d-note b { font-family: var(--font-head); font-weight: 600; font-size: 16px; color: var(--black); }
.d-note p { font-size: 15.5px; color: var(--muted); }
.d-tablebox { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.d-table { width: 100%; border-collapse: collapse; font-size: 15.5px; min-width: 560px; }
.d-table th, .d-table td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.d-table tr:last-child td { border-bottom: 0; }
.d-table th { font-family: var(--font-mono); font-weight: 400; font-size: 12.5px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--brown); background: var(--surface); }
.d-divide { border-top: 1px solid var(--line); padding-top: 40px; }
.d-next { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); gap: 16px; }
.d-next a { text-decoration: none; }
.d-next a:hover { border-color: var(--line-strong); }
.d-toc { flex: 1 1 180px; max-width: 220px; padding-block: 44px; position: sticky; top: 0; font-size: 14.5px; }
.d-toc h2 { font-family: var(--font-mono); font-weight: 400; font-size: 12.5px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--brown); padding-bottom: 6px; }
.d-toc ul { list-style: none; margin: 0; padding: 0; }
.d-toc a { display: block; padding: 6px 0; color: var(--muted); text-decoration: none; }
.d-toc a:hover { color: var(--black); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- small screens ---------- */
@media (max-width: 1100px) {
  .d-toc { display: none; }
}
@media (max-width: 860px) {
  .d-sidebar { max-width: none; flex-basis: 100%; padding-block: 20px 0; gap: 14px; }
  .d-sidebar ul { flex-direction: row; flex-wrap: wrap; gap: 2px 4px; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .d-wrap { padding-inline: 20px; }
  .d-section { padding-block: 64px; }
  .d-hero .d-wrap { padding-block: 56px 64px; gap: 40px; }
  .d-card { padding: 24px; }
  .d-navlinks { gap: 0 16px; order: 3; flex-basis: 100%; font-size: 14px; }
  .d-navutil .d-out { display: none; }
  .d-code pre { padding-inline: 18px; font-size: 12.5px; }
  .d-toolchips { padding-inline: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
