/* chainboot website: the same calm terminal look as the program's own interface. */
:root {
  --bg: #121416; --panel: #181b1e; --inset: #0f1113; --line: #2a2e33; --line-strong: #3a3f45;
  --text: #d5d9dd; --dim: #8a9199; --accent: #86c7a4; --accent-ink: #10201a;
  --warn: #d4b072; --blue: #8fb4d9; --violet: #b5a3d6;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace;
  --radius: 8px; --w: 1080px;
}
* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; scroll-padding-top: 76px; }
body { margin: 0; color: var(--text); font: 15px/1.65 var(--mono); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: 6px; z-index: 50; }
.skip:focus { left: 8px; }
.wrap { width: 100%; max-width: var(--w); margin: 0 auto; padding: 0 24px; }
code { color: var(--accent); font: inherit; }
p code, li code { white-space: nowrap; }
b { font-weight: 700; color: var(--text); }
.dim { color: var(--dim); }

/* navigation */
.nav { position: sticky; top: 0; z-index: 20; background: rgba(18, 20, 22, 0.88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 20px; height: 60px; }
.logo { color: var(--accent); font-weight: 700; font-size: 18px; letter-spacing: 0.3px; display: inline-flex; align-items: center; }
.logo:hover { text-decoration: none; }
.nav nav { display: flex; gap: 24px; }
.nav nav a { color: var(--dim); font-size: 14px; }
.nav nav a:hover { color: var(--text); text-decoration: none; }
.cursor { display: inline-block; width: 9px; height: 18px; background: var(--accent); margin-left: 5px; animation: blink 1.2s steps(2) infinite; }
.cursor.inline { height: 1.05em; width: 0.55em; margin-left: 0; vertical-align: -0.15em; }
@keyframes blink { 50% { opacity: 0; } }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; height: 42px; padding: 0 20px; border-radius: var(--radius); border: 1px solid var(--line-strong); color: var(--text); background: transparent; font: inherit; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--dim); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.btn.primary:hover { filter: brightness(1.07); }
.btn.quiet { border-color: transparent; color: var(--dim); }
.btn.quiet:hover { color: var(--text); }
.btn.small { height: 34px; padding: 0 14px; font-size: 14px; }
.btn .gh { flex: none; margin-right: 9px; }
.btn.small .gh { margin-right: 7px; width: 15px; height: 15px; }
.bar-end { display: flex; align-items: center; gap: 10px; }

/* hero */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 48px; align-items: center; padding-top: 72px; padding-bottom: 64px; }
.kicker { color: var(--dim); margin: 0 0 18px; font-size: 14px; display: flex; align-items: center; gap: 10px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(134, 199, 164, 0.15); }
h1 { font-size: clamp(30px, 3.6vw, 42px); line-height: 1.18; margin: 0 0 22px; letter-spacing: -0.5px; font-weight: 700; text-wrap: balance; }
.lead { color: var(--dim); font-size: 16px; margin: 0 0 30px; max-width: 54ch; }
.lead.small { font-size: 15px; margin-bottom: 22px; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; }

/* terminal windows */
.term { background: var(--inset); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35); min-width: 0; }
.term-bar { display: flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-bottom: 1px solid var(--line); background: var(--panel); }
.term-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); }
.term-bar span { margin-left: auto; margin-right: auto; padding-right: 44px; color: var(--dim); font-size: 12.5px; }
.term-body { margin: 0; padding: 18px 20px 20px; font: 13.5px/1.7 var(--mono); color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; min-height: 120px; }
.hero .term-body { min-height: 318px; }
.p { color: var(--accent); user-select: none; } .r { color: var(--blue); } .o { color: var(--dim); } .ok { color: var(--accent); }
.c { color: #6f767e; } .k { color: var(--violet); } .s { color: var(--warn); }

/* numbers */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); margin-bottom: 24px; }
.stats > div { padding: 22px 24px; border-left: 1px solid var(--line); }
.stats > div:first-child { border-left: 0; }
.stats b { display: block; font-size: 24px; color: var(--accent); margin-bottom: 6px; letter-spacing: -0.3px; }
.stats span { color: var(--dim); font-size: 13.5px; line-height: 1.5; display: block; }

/* sections */
main > section:not(.hero):not(.stats) { padding-top: 84px; }
.label { color: var(--accent); margin: 0 0 10px; font-size: 14px; }
h2 { font-size: clamp(22px, 2.6vw, 30px); line-height: 1.25; margin: 0 0 32px; letter-spacing: -0.3px; max-width: 34ch; text-wrap: balance; }
h3 { font-size: 15px; margin: 0 0 6px; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 40px; align-items: start; }
.cols.even { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: center; }
.note { color: var(--dim); font-size: 13.5px; margin: 16px 0 0; }

.steps { display: flex; flex-direction: column; gap: 22px; }
.step { display: grid; grid-template-columns: 32px 1fr; gap: 16px; }
.step .n { width: 32px; height: 32px; border: 1px solid var(--line-strong); border-radius: 50%; display: grid; place-items: center; color: var(--accent); font-size: 14px; }
.step p { margin: 0; color: var(--dim); }
.diagram { margin: 0; background: var(--inset); border: 1px solid var(--line); border-radius: 10px; padding: 26px 28px; display: grid; gap: 26px; }
.diagram svg { display: block; width: 100%; height: auto; font-family: var(--mono); overflow: visible; }
.diagram svg + svg { border-top: 1px solid var(--line); padding-top: 26px; }
.diagram text { fill: var(--text); font-size: 12.5px; }
.diagram text.s { font-size: 9.5px; fill: var(--accent); }
.diagram text.d { fill: var(--dim); font-size: 10.5px; }
.diagram text.t { fill: var(--accent); font-size: 11px; }
.diagram text.b { font-weight: 700; font-size: 13.5px; }
.diagram .bx { fill: var(--panel); stroke: var(--line-strong); stroke-width: 1; }
.diagram .bx.a { stroke: var(--accent); fill: rgba(134, 199, 164, 0.07); }
.diagram .bx.chain { fill: rgba(134, 199, 164, 0.05); stroke: var(--accent); stroke-dasharray: 3 4; }
.diagram .lf { fill: rgba(134, 199, 164, 0.13); stroke: var(--accent); stroke-width: 1; }
.diagram .ln { stroke: var(--line-strong); stroke-width: 1.2; fill: none; }
.diagram .ln.dash { stroke-dasharray: 2 4; }
.diagram .ar { stroke: var(--dim); stroke-width: 1.2; fill: none; marker-end: url(#ah); }
.diagram .ah { fill: var(--dim); }

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.grid article { border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius); padding: 20px 22px; }
.grid article p { margin: 0; color: var(--dim); }
.mark { color: var(--accent); margin-right: 8px; font-weight: 400; }

.table { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.tr { display: grid; grid-template-columns: 1.3fr 3.4fr 1.2fr 0.9fr 1.1fr; gap: 16px; padding: 14px 22px; border-top: 1px solid var(--line); align-items: baseline; }
.tr:first-child { border-top: 0; }
.tr.th { color: var(--dim); font-size: 13px; }
.tr span:nth-child(n+3) { color: var(--dim); }
.tr span:nth-child(2) { color: var(--text); }

.ticks, .plain, .blocks, .next { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.ticks li { position: relative; padding-left: 26px; color: var(--dim); }
.ticks li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); }
.plain li { position: relative; padding-left: 20px; color: var(--dim); }
.plain li::before { content: "-"; position: absolute; left: 2px; color: var(--line-strong); }
.blocks li { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; background: var(--panel); display: grid; gap: 2px; }
.blocks span { color: var(--dim); font-size: 14px; }
.box { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 22px 24px; height: 100%; }
.box h3 { margin-bottom: 14px; font-size: 14px; }
.box h3.ok { color: var(--accent); } .box h3.warn { color: var(--warn); }

/* install */
.install { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); padding: 22px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs button { height: 34px; padding: 0 14px; border-radius: var(--radius); border: 1px solid transparent; background: transparent; color: var(--dim); font: inherit; font-size: 14px; cursor: pointer; }
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { color: var(--accent); border-color: var(--line-strong); background: var(--inset); }
.cmd { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; background: var(--inset); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 10px 10px 16px; }
.cmd code { color: var(--text); overflow-x: auto; white-space: nowrap; scrollbar-width: thin; padding: 4px 0; }
.next { margin-top: 20px; counter-reset: n; gap: 10px; }
.next li { display: grid; grid-template-columns: 26px minmax(0, 1.1fr) minmax(0, 1fr); gap: 12px; align-items: baseline; counter-increment: n; }
.next li::before { content: counter(n); color: var(--dim); }
.next span { color: var(--dim); font-size: 14px; }

.thanks p:last-child { color: var(--dim); max-width: 86ch; margin: 0; }
footer { margin-top: 96px; border-top: 1px solid var(--line); padding: 28px 0 36px; }
.foot { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.foot > div { display: flex; align-items: baseline; gap: 16px; }
.foot nav { display: flex; gap: 20px; flex-wrap: wrap; }
.foot nav a { color: var(--dim); font-size: 14px; }
.foot nav a:hover { color: var(--text); text-decoration: none; }
.legal { color: #6f767e; font-size: 12.5px; margin-top: 18px; max-width: var(--w); }

/* pre-release mode: <body class="prelaunch"> */
.prelaunch-only { display: none; }
.prelaunch .prelaunch-only { display: revert; }
.prelaunch [data-public] { display: none !important; }
.soon { margin: 0; padding: 9px 24px; text-align: center; font-size: 13.5px; color: var(--warn); background: var(--panel); border-bottom: 1px solid var(--line); }
.soon-note { margin: -14px 0 18px; color: var(--warn); font-size: 14px; }
.prelaunch .install .cmd, .prelaunch .install .tabs, .prelaunch .install .next { opacity: 0.6; }

/* gentle reveal */
.reveal { opacity: 0; transform: translateY(10px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (max-width: 920px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 36px; padding-top: 48px; padding-bottom: 48px; }
  .cols, .cols.even { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats > div:nth-child(3) { border-left: 0; }
  .stats > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .nav nav { display: none; }
  main > section:not(.hero):not(.stats) { padding-top: 64px; }
}
@media (max-width: 620px) {
  body { font-size: 14.5px; }
  .wrap { padding: 0 16px; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: minmax(0, 1fr); }
  .stats > div { border-left: 0; border-top: 1px solid var(--line); }
  .stats > div:first-child { border-top: 0; }
  .tr { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 14px 16px; }
  .tr.th { display: none; }
  .tr span:nth-child(2) { grid-column: 1 / -1; grid-row: 2; color: var(--dim); }
  .tr span:nth-child(3) { grid-column: 1; grid-row: 3; }
  .tr span:nth-child(4) { grid-column: 2; grid-row: 1; text-align: right; }
  .tr span:nth-child(5) { grid-column: 2; grid-row: 3; text-align: right; }
  .next li { grid-template-columns: 22px minmax(0, 1fr); }
  .next span { grid-column: 2; }
  .term-body { font-size: 12.5px; padding: 14px 14px 16px; }
  .hero .term-body { min-height: 300px; }
  .diagram { padding: 18px 16px; gap: 18px; }
  .diagram svg + svg { padding-top: 18px; }
  .install { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cursor { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------------------------------------------------------------- documentation pages */
.docs { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 56px; padding-top: 40px; align-items: start; }
.side { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow-y: auto; font-size: 13.5px; padding-right: 4px; scrollbar-width: thin; }
.side-toggle { display: none; }
.side ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.side ol > li > a { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 6px; padding: 6px 10px; border-radius: 6px; color: var(--dim); line-height: 1.4; }
.side ol > li > a:hover { color: var(--text); text-decoration: none; background: var(--panel); }
.side .num { color: var(--line-strong); }
.side li.here > a { color: var(--accent); background: var(--panel); }
.side li.here > a .num { color: var(--accent); }
.side ul { list-style: none; margin: 4px 0 8px 42px; padding: 0 0 0 12px; border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 5px; }
.side ul a { color: var(--dim); font-size: 12.5px; line-height: 1.4; display: block; }
.side ul a:hover { color: var(--text); text-decoration: none; }

.prose { min-width: 0; max-width: 78ch; padding-bottom: 24px; }
.prose h1 { font-size: clamp(26px, 3vw, 34px); margin: 0 0 20px; text-wrap: balance; }
.prose h2 { font-size: 21px; margin: 44px 0 14px; max-width: none; padding-top: 18px; border-top: 1px solid var(--line); }
.prose h3 { font-size: 16px; margin: 30px 0 10px; }
.prose h4 { font-size: 15px; margin: 24px 0 8px; color: var(--dim); }
.prose p { margin: 0 0 16px; color: #bcc2c8; }
.prose li { color: #bcc2c8; }
.prose strong { color: var(--text); }
.prose ul, .prose ol { margin: 0 0 16px; padding-left: 24px; display: flex; flex-direction: column; gap: 8px; }
.prose ul { list-style: none; padding-left: 0; }
.prose ul > li { position: relative; padding-left: 22px; }
.prose ul > li::before { content: "-"; position: absolute; left: 4px; color: var(--accent); }
.prose ol > li::marker { color: var(--accent); }
.prose a { text-decoration: underline; text-decoration-color: rgba(134, 199, 164, 0.4); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--accent); }
.prose :is(h2, h3, h4) { position: relative; scroll-margin-top: 84px; }
.prose .anchor { position: absolute; left: -22px; color: var(--line-strong); text-decoration: none; opacity: 0; }
.prose :is(h2, h3, h4):hover .anchor { opacity: 1; }
.prose code { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; font-size: 0.93em; overflow-wrap: anywhere; white-space: normal; }
.code-wrap { position: relative; margin: 0 0 18px; }
.code-wrap pre { margin: 0; background: var(--inset); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; overflow-x: auto; font: 13px/1.65 var(--mono); }
.code-wrap pre code { background: none; border: 0; padding: 0; color: var(--text); white-space: pre; font-size: inherit; overflow-wrap: normal; }
.code-wrap .copy { position: absolute; top: 8px; right: 8px; height: 26px; padding: 0 10px; border-radius: 6px; border: 1px solid var(--line-strong); background: var(--panel); color: var(--dim); font: 12px var(--mono); cursor: pointer; opacity: 0; transition: opacity 0.15s; }
.code-wrap:hover .copy, .code-wrap .copy:focus-visible { opacity: 1; }
.code-wrap .copy:hover { color: var(--text); }
.table-wrap { overflow-x: auto; margin: 0 0 18px; border: 1px solid var(--line); border-radius: var(--radius); }
.prose table { border-collapse: collapse; width: 100%; font-size: 14px; }
.prose th { text-align: left; color: var(--dim); font-weight: 400; background: var(--panel); }
.prose th, .prose td { padding: 10px 14px; border-top: 1px solid var(--line); vertical-align: top; }
.prose thead th { border-top: 0; }
.prose td { color: #bcc2c8; }
.prose blockquote { margin: 0 0 18px; padding: 14px 18px; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--radius); background: var(--panel); }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }
.pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 48px; align-items: stretch; }
.pager a { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; margin: 0; color: var(--text); text-decoration: none; display: flex; flex-direction: column; justify-content: center; gap: 4px; min-height: 72px; background: var(--panel); }
.pager a:hover { border-color: var(--line-strong); }
.pager a span { color: var(--dim); font-size: 12.5px; }
.pager-next { text-align: right; align-items: flex-end; }
.source { margin-top: 18px; font-size: 13px; }
.source a { color: var(--dim); text-decoration: none; }
.doc-list { list-style: none; padding: 0; margin: 24px 0 0; display: flex; flex-direction: column; gap: 10px; }
.prose .doc-list { padding-left: 0; }
.doc-list a { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 8px; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; background: var(--panel); text-decoration: none; color: var(--text); }
.doc-list a:hover { border-color: var(--line-strong); }
.doc-list .num { color: var(--accent); }
.doc-list a > span:last-child { display: grid; gap: 2px; }
.doc-list a > span:last-child > span { color: var(--dim); font-size: 14px; }
.docs-page footer { margin-top: 64px; }
.nav nav a[aria-current="page"] { color: var(--text); }

@media (max-width: 920px) {
  .docs { grid-template-columns: minmax(0, 1fr); gap: 20px; padding-top: 20px; }
  .side { position: static; max-height: none; overflow: visible; }
  .side-toggle { display: inline-flex; }
  .side ol { display: none; margin-top: 10px; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; background: var(--panel); }
  .side.open ol { display: flex; }
  .prose .anchor { display: none; }
  .code-wrap .copy { opacity: 1; }
}
.prose td:first-child code, .prose th:first-child { white-space: nowrap; overflow-wrap: normal; }
