/* bitcd.org — shared stylesheet */

:root {
  --bg: #F5F7FA;
  --surface: #FFFFFF;
  --surface-2: #EAEEF4;
  --ink: #16212C;
  --muted: #5C6C7E;
  --line: #D5DDE6;
  --accent: #1E5FBF;
  --accent-ink: #FFFFFF;
  --accent-soft: #E3ECFA;
  --ok: #187A4B;
  --ok-soft: #E0F1E8;
  --warn: #9A5B08;
  --warn-soft: #F6ECD9;
  --crit: #B3261E;
  --crit-soft: #F8E4E2;
  --code-bg: #EDF1F6;
  --term-bg: #101923;
  --term-ink: #D6E2EE;
  --term-muted: #6E8299;
  --term-accent: #8FBCFF;
  --term-ok: #6FD3A0;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0D141C; --surface: #152030; --surface-2: #1B2938;
    --ink: #E2E9F1; --muted: #8CA0B4; --line: #27394D;
    --accent: #74A9F2; --accent-ink: #0D141C; --accent-soft: #1C3050;
    --ok: #52C08D; --ok-soft: #143526;
    --warn: #E0A94E; --warn-soft: #3A2C12;
    --crit: #F0837B; --crit-soft: #431E1B;
    --code-bg: #1A2634;
    --term-bg: #0A1119; --term-ink: #CFDCEA;
  }
}
:root[data-theme="dark"] {
  --bg: #0D141C; --surface: #152030; --surface-2: #1B2938;
  --ink: #E2E9F1; --muted: #8CA0B4; --line: #27394D;
  --accent: #74A9F2; --accent-ink: #0D141C; --accent-soft: #1C3050;
  --ok: #52C08D; --ok-soft: #143526;
  --warn: #E0A94E; --warn-soft: #3A2C12;
  --crit: #F0837B; --crit-soft: #431E1B;
  --code-bg: #1A2634;
  --term-bg: #0A1119; --term-ink: #CFDCEA;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px; line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

code, pre, .mono { font-family: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace; }
code { background: var(--code-bg); border-radius: 4px; padding: 1px 5px; font-size: 0.86em; }
p > code, li > code, td > code { white-space: nowrap; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 780px; }

/* ---------- top nav ---------- */
.topnav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topnav .wrap {
  display: flex; align-items: center; gap: 26px;
  min-height: 58px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px;
}
.brand {
  display: flex; align-items: center; gap: 9px;
  font-family: "IBM Plex Mono", monospace; font-weight: 600; font-size: 18px;
  color: var(--ink); text-decoration: none; letter-spacing: -0.02em;
  margin-right: auto;
}
.brand img { display: block; width: 26px; height: 26px; border-radius: 50%; }
.brand .tld { color: var(--muted); font-weight: 400; }
.topnav nav { display: flex; gap: 4px 22px; flex-wrap: wrap; }
.topnav nav a {
  font-size: 15px; font-weight: 500;
  color: var(--muted); text-decoration: none; padding: 4px 0;
}
.topnav nav a:hover { color: var(--ink); }
.topnav nav a[aria-current="page"] { color: var(--ink); border-bottom: 2px solid var(--accent); }

/* ---------- page header ---------- */
.pagehead { padding: 48px 0 8px; }
.eyebrow {
  font-family: "IBM Plex Sans Condensed", sans-serif; font-weight: 600;
  font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 10px;
}
h1 {
  font-size: clamp(30px, 4.2vw, 40px); font-weight: 700; line-height: 1.12;
  letter-spacing: -0.015em; margin: 0 0 14px; text-wrap: balance;
}
.lede { font-size: 18.5px; color: var(--muted); max-width: 46em; margin: 0 0 8px; }
.lede strong { color: var(--ink); font-weight: 600; }

h2 { font-size: 26px; font-weight: 700; letter-spacing: -0.01em; margin: 54px 0 10px; scroll-margin-top: 76px; text-wrap: balance; }
h3 { font-size: 19px; font-weight: 600; margin: 32px 0 8px; scroll-margin-top: 76px; }
section > p, section li, article > p, article li { max-width: 48em; }
.kicker {
  font-family: "IBM Plex Sans Condensed", sans-serif; font-weight: 600;
  font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent); margin: 54px 0 -4px;
}
.kicker + h2 { margin-top: 6px; }

/* ---------- chips ---------- */
.chip {
  display: inline-block; border-radius: 999px; padding: 1px 10px 2px;
  font-family: "IBM Plex Sans Condensed", sans-serif; font-size: 12px; font-weight: 600;
  letter-spacing: 0.05em; text-transform: uppercase; white-space: nowrap; vertical-align: middle;
}
.chip.ok     { background: var(--ok-soft);     color: var(--ok); }
.chip.warn   { background: var(--warn-soft);   color: var(--warn); }
.chip.crit   { background: var(--crit-soft);   color: var(--crit); }
.chip.plain  { background: var(--surface-2);   color: var(--muted); }
.chip.accent { background: var(--accent-soft); color: var(--accent); }

/* ---------- buttons ---------- */
.btns { display: flex; gap: 12px; flex-wrap: wrap; margin: 26px 0 0; }
.btn {
  display: inline-block; border-radius: 8px; padding: 10px 22px;
  font-weight: 600; font-size: 15px; text-decoration: none;
  border: 1px solid var(--line); color: var(--ink); background: var(--surface);
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.08); color: var(--accent-ink); }

/* ---------- cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; margin-top: 22px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 18px 20px;
}
.card h3, .card h4 { margin: 0 0 6px; font-size: 16.5px; font-weight: 600; }
.card p { margin: 0; font-size: 14.5px; color: var(--muted); line-height: 1.55; }
.card .ref { display: block; margin-top: 10px; font-size: 12.5px; color: var(--muted); opacity: 0.9; }
a.card { display: block; text-decoration: none; color: inherit; }
a.card:hover { border-color: var(--accent); }
a.card h3 { color: var(--accent); }
/* four cards that should sit 2 x 2 rather than 3 + 1 on wide screens */
.grid.two { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); }

/* ---------- code blocks ---------- */
pre {
  background: var(--term-bg); color: var(--term-ink);
  border-radius: 10px; padding: 16px 18px; overflow-x: auto;
  font-size: 13.5px; line-height: 1.6; margin: 14px 0;
  border: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}
pre code { background: none; padding: 0; font-size: inherit; color: inherit; }
pre .c   { color: var(--term-muted); }              /* comment */
pre .p   { color: var(--term-accent); user-select: none; }  /* prompt $ */
pre .o   { color: var(--term-muted); }              /* output */
pre .ok  { color: var(--term-ok); }
pre .k   { color: var(--term-accent); }             /* yaml key / flag */
pre .s   { color: #E8C97C; }                        /* string */

.codeblock { position: relative; }
.codeblock:has(.copy) pre { padding-right: 72px; }
.codeblock .copy {
  position: absolute; top: 8px; right: 8px;
  font-family: "IBM Plex Mono", monospace; font-size: 12px; font-weight: 500;
  background: color-mix(in srgb, var(--term-bg) 40%, #FFFFFF 12%);
  color: var(--term-muted); border: 1px solid #2A3B4E; border-radius: 6px;
  padding: 3px 9px; cursor: pointer;
}
.codeblock .copy:hover { color: var(--term-ink); border-color: var(--term-muted); }

/* ---------- tables ---------- */
.scroll { overflow-x: auto; margin: 18px 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
th, td { text-align: left; vertical-align: top; padding: 9px 14px; border-top: 1px solid var(--line); }
thead th {
  border-top: none; background: var(--surface-2);
  font-family: "IBM Plex Sans Condensed", sans-serif;
  font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); white-space: nowrap;
}
tr.group td { background: var(--surface-2); font-weight: 600; font-size: 13.5px; }

/* ---------- figures ---------- */
figure { margin: 26px 0; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 20px 18px 12px; }
figure svg { max-width: 100%; height: auto; display: block; margin: 0 auto; }
figcaption { font-size: 13.5px; color: var(--muted); margin-top: 10px; max-width: 52em; }
.fig-scroll { overflow-x: auto; }

/* ---------- callouts ---------- */
.note {
  background: var(--accent-soft); border-radius: 10px; padding: 14px 18px;
  font-size: 14.5px; max-width: 52em; margin: 22px 0;
}
.note.warn { background: var(--warn-soft); }
.note b { font-weight: 600; }

/* ---------- step ladder (quickstart) ---------- */
.step { position: relative; margin-top: 40px; padding-left: 62px; }
.step::before {
  content: ""; position: absolute; left: 20px; top: 50px; bottom: -40px;
  width: 2px; background: var(--line);
}
.step:last-of-type::before { display: none; }
.step-num {
  position: absolute; left: 0; top: 0; width: 42px; height: 42px;
  border-radius: 50%; background: var(--surface); border: 2px solid var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-family: "IBM Plex Mono", monospace; font-weight: 600; font-size: 15px; color: var(--accent);
}
.step h2, .step h3 { margin-top: 4px; }
.step .why { color: var(--muted); max-width: 46em; margin: 4px 0 10px; }

/* ---------- definition list (concepts) ---------- */
.concept {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 20px 24px; margin-top: 16px;
}
.concept h3 { margin: 0 0 6px; }
.concept p { margin: 8px 0 0; }
.concept .ref { font-size: 12.5px; color: var(--muted); display: block; margin-top: 10px; }

/* ---------- docs layout: sidebar + article ---------- */
.docs { max-width: 1180px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 52px; align-items: start; }
.doc { min-width: 0; max-width: 800px; }
.sidenav { font-size: 14px; }
.sidenav a { display: block; color: var(--muted); text-decoration: none; padding: 3px 0; line-height: 1.4; }
.sidenav a:hover { color: var(--accent); }
.sidenav a[aria-current="page"] { color: var(--accent); font-weight: 600; }
.sidenav .home {
  font-family: "IBM Plex Sans Condensed", sans-serif; font-weight: 600; font-size: 13px;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink);
}
.sidenav .group { margin-top: 18px; }
.sidenav .group-title {
  display: block; font-family: "IBM Plex Sans Condensed", sans-serif; font-weight: 600;
  font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
  opacity: 0.75; margin-bottom: 3px;
}
@media (min-width: 980px) {
  .docs { grid-template-columns: 200px minmax(0, 1fr); }
  .sidenav {
    position: sticky; top: 58px; max-height: calc(100vh - 58px); overflow-y: auto;
    padding: 56px 16px 24px 0; border-right: 1px solid var(--line);
  }
}
@media (max-width: 979px) {
  /* one wrapped row of links above the article; group titles are dropped */
  .sidenav { display: flex; flex-wrap: wrap; gap: 4px 18px; padding: 14px 0 12px; border-bottom: 1px solid var(--line); }
  .sidenav .group { display: contents; }
  .sidenav .group-title { display: none; }
  .sidenav .home { flex-basis: 100%; }
}

/* ---------- footer ---------- */
footer.site {
  margin-top: 90px; border-top: 1px solid var(--line);
  padding: 26px 0 48px; font-size: 13.5px; color: var(--muted);
}
footer.site .wrap { display: flex; flex-wrap: wrap; gap: 8px 28px; justify-content: space-between; }
footer.site a { color: var(--muted); }
footer.site a:hover { color: var(--accent); }

/* ---------- prev/next pager ---------- */
.pager { display: flex; justify-content: space-between; gap: 14px; margin-top: 64px; flex-wrap: wrap; }
.pager a {
  flex: 1 1 240px; border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 18px; text-decoration: none; background: var(--surface); color: var(--ink);
}
.pager a:hover { border-color: var(--accent); }
.pager a small {
  display: block; font-family: "IBM Plex Sans Condensed", sans-serif;
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 2px;
}
.pager a.next { text-align: right; }
.pager a b { color: var(--accent); font-weight: 600; }

/* ---------- brand mark ---------- */
.brand-mark {
  display: block; width: 22px; height: 22px; border-radius: 50%; flex: none;
  border: 5px solid var(--accent); box-shadow: inset 0 0 0 3px var(--bg);
  background: var(--accent);
}

/* ---------- main page ---------- */
.main { max-width: 720px; padding-top: 56px; }
.main h1 { font-size: 40px; margin-bottom: 10px; }
.main .lede strong { display: block; font-size: 24px; line-height: 1.3; letter-spacing: -0.01em; margin-bottom: 10px; }
.main h2 { margin-top: 44px; }
.main p { max-width: 46em; }
.main pre.wrap { white-space: pre-wrap; word-break: break-all; }
.main .points { padding-left: 1.2em; max-width: 48em; }
.main .points li { margin: 8px 0; }
.main .video {
  aspect-ratio: 16 / 9; max-width: 640px; margin: 14px 0 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1px dashed var(--line); border-radius: 10px;
  color: var(--muted); font-family: "IBM Plex Mono", monospace; font-size: 15px;
}
.main .next { margin-top: 44px; font-size: 15px; }
.main .next a { margin-right: 18px; }

