/* ccbs — the website. Every color is a CSS variable taken from the current
   btop theme, so picking a theme recolors the whole page. */
:root {
  --bg: #0c0c0c; --fg: #cccccc; --title: #eeeeee; --hi: #b54040;
  --sel-bg: #6a2f2f; --sel-fg: #eeeeee; --dim: #404040; --text2: #808080; --div: #303030;
  --misc: #0de756; --box1: #556d59; --box2: #6c6c4b; --box3: #5c588d; --box4: #805252;
  --g1: #77ca9b; --g2: #cbc06c; --g3: #dc4c4c; --t1: #4897d4; --t2: #5474e8; --t3: #ff40b6;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace;
  color-scheme: dark;
  /* readable small-text and border colors; sitegen sets them per theme */
  --muted: #909090; --edge: #4a4a4a;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 15px/1.6 var(--mono);
  transition: background .35s, color .35s;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--title); text-decoration-color: var(--edge); text-underline-offset: 3px; }
a:hover { color: var(--hi); }
code, kbd { font-family: var(--mono); }
code { color: var(--title); background: color-mix(in srgb, var(--fg) 8%, transparent); padding: 0 .35em; border-radius: 3px; }
kbd { color: var(--hi); font-weight: 700; }
b { color: var(--title); }
::selection { background: var(--sel-bg); color: var(--sel-fg); }

/* faint CRT scanlines */
.scan { position: fixed; inset: 0; pointer-events: none; z-index: 50; opacity: .05;
  background: repeating-linear-gradient(to bottom, transparent 0 2px, #000 2px 3px); }

/* header: a btop menu bar */
.top {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: 1180px; margin: 0 auto; padding: 14px 20px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--div);
}
.brand { font-weight: 700; font-size: 18px; color: var(--title); text-decoration: none; letter-spacing: .02em; }
.cursor-box { color: var(--hi); animation: blink 1.1s steps(1) infinite; margin-right: 2px; }
nav { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; justify-content: flex-end; }
nav a { color: var(--fg); text-decoration: none; padding: 4px 10px; border-radius: 4px; font-size: 14px; }
nav a:hover { background: var(--sel-bg); color: var(--sel-fg); }
nav .k, legend .k { color: var(--hi); font-weight: 700; }
nav .cta { border: 1px solid var(--hi); color: var(--title); margin-left: 6px; }
nav .cta::before { content: "┤ "; color: var(--hi); }
nav .cta::after { content: " ├"; color: var(--hi); }
@media (max-width: 640px) { nav a:not(.cta) { display: none; } }

main { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* hero */
.hero { text-align: center; padding: 56px 0 24px; }
@keyframes blink { 50% { opacity: 0; } }
.logo {
  display: inline-block; margin: 0; text-align: left;
  font-size: clamp(9px, 2.6vw, 20px); line-height: 1.12; font-weight: 700;
  background: linear-gradient(90deg, var(--g1), var(--g2) 55%, var(--g3));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 18px color-mix(in srgb, var(--g2) 35%, transparent));
}
.tag { margin: 10px 0 0; color: var(--muted); letter-spacing: .32em; text-transform: uppercase; font-size: 12px; }
.tag b { color: var(--hi); }
h1 { margin: 26px auto 0; max-width: 860px; color: var(--title); font-size: clamp(28px, 5.2vw, 54px); line-height: 1.08; letter-spacing: -.02em; }
.lede { margin: 18px auto 0; max-width: 680px; font-size: clamp(14px, 1.8vw, 17px); color: var(--fg); }

/* btop boxes: a fieldset legend sits on the border exactly like btop's titles */
.box {
  --c: var(--box1);
  margin: 0; min-width: 0; border: 1px solid var(--c); border-radius: 10px;
  padding: 14px 18px 16px; text-align: left; background: color-mix(in srgb, var(--c) 5%, transparent);
  transition: border-color .35s, background .35s;
}
.box legend { padding: 0 6px; color: var(--title); font-weight: 700; margin-left: -4px; }
.box p { margin: 0 0 8px; }
.box p:last-child { margin-bottom: 0; }
.box .more { color: var(--muted); }

/* install */
.install { max-width: 760px; margin: 36px auto 0; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 10px; }
.tabs button {
  font: inherit; font-size: 13px; cursor: pointer; padding: 3px 12px; border-radius: 4px;
  background: transparent; color: var(--muted); border: 1px solid var(--edge);
}
.tabs button[aria-selected="true"] { background: var(--sel-bg); color: var(--sel-fg); border-color: var(--sel-bg); font-weight: 700; }
.cmd {
  display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; border-radius: 6px;
  background: color-mix(in srgb, var(--bg) 70%, #000); border: 1px solid var(--edge);
}
.cmd .sig { color: var(--g1); font-weight: 700; user-select: none; }
.cmd code { flex: 1; background: none; padding: 0; color: var(--title); overflow-x: auto; white-space: nowrap; scrollbar-width: none; font-size: 14px; }
.cmd code::-webkit-scrollbar { display: none; }
@media (max-width: 640px) {
  .cmd { align-items: flex-start; flex-wrap: wrap; }
  .cmd code { white-space: normal; word-break: break-all; flex-basis: calc(100% - 30px); }
  .copy { margin-left: auto; }
}
.copy {
  font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; flex: none;
  padding: 4px 12px; border-radius: 4px; border: 1px solid var(--hi); background: transparent; color: var(--title);
}
.copy:hover, .copy.done { background: var(--hi); color: var(--bg); }
.after { margin: 10px 0 0 !important; font-size: 13px; color: var(--muted); }
.fine { color: color-mix(in srgb, var(--fg) 62%, var(--bg)); font-size: 13px; margin: 14px auto 0; max-width: 680px; }

/* preview window */
.preview-wrap { position: relative; margin: 48px auto 0; max-width: 1140px; }
.glow { position: absolute; inset: 6% 4% 0; z-index: -1; filter: blur(70px); opacity: .32;
  background: radial-gradient(closest-side, var(--box1), transparent), radial-gradient(closest-side at 80% 60%, var(--box4), transparent); }
.window { border-radius: 12px; overflow: hidden; border: 1px solid var(--edge); box-shadow: 0 24px 80px #000a; background: var(--term-bg, var(--bg)); }
.titlebar {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  background: color-mix(in srgb, var(--fg) 7%, var(--bg)); border-bottom: 1px solid var(--div); font-size: 13px;
}
.dots { display: flex; gap: 7px; }
.dots i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.dots i:nth-child(2) { background: #febc2e; } .dots i:nth-child(3) { background: #28c840; }
.wtitle { flex: 1; text-align: center; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wtitle .flag { color: var(--muted); }
select, .arrows button {
  font: inherit; font-size: 13px; color: var(--title); background: transparent; cursor: pointer;
  border: 1px solid var(--edge); border-radius: 4px; padding: 1px 6px;
}
select option { background: var(--bg); color: var(--fg); }
.arrows { display: flex; gap: 4px; }
.arrows button { width: 26px; padding: 1px 0; }
.term {
  padding: 10px 8px; overflow: hidden; line-height: 1.18; white-space: pre;
  font-family: "JetBrains Mono", "DejaVu Sans Mono", Menlo, Consolas, monospace; font-size: 13px;
  min-height: 200px; transition: opacity .2s;
}
.term.loading { opacity: .4; }
.term div { height: 1.18em; }
.term .g { font-style: normal; display: inline-block; width: 1ch; text-align: center; height: 1.18em; vertical-align: top; overflow: visible; }
.term .g.w { width: 2ch; }

/* sections */
.sec { padding: 64px 0 8px; scroll-margin-top: 64px; }
.sec h2 { margin: 0; color: var(--title); font-size: clamp(20px, 3vw, 28px); }
.dollar { color: var(--g1); }
.sub { margin: 8px 0 26px; color: var(--muted); max-width: 760px; }
.narrow { max-width: 820px; margin: 0 auto; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; margin-top: 24px; }
@media (max-width: 420px) { .grid, .cols { grid-template-columns: 1fr; } }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 22px; margin: 0; font-size: 14px; }
.kv dt { color: var(--title); font-weight: 700; white-space: nowrap; }
.kv dd { margin: 0; color: var(--fg); }
.kv.keys dt { font-weight: 400; }
@media (max-width: 520px) {
  .kv { grid-template-columns: 1fr; gap: 0; }
  .kv dd { margin-bottom: 10px; color: var(--muted); }
}
.prose p { margin: 0 0 12px; }
.links { display: flex; flex-wrap: wrap; gap: 8px; }
.btn { text-decoration: none; color: var(--title); font-weight: 700; padding: 2px 4px; border-radius: 4px; }
.btn:hover { background: var(--sel-bg); color: var(--sel-fg); }
.credit { color: var(--muted); font-size: 13px; }

/* theme picker: collapsed until asked for */
.theme-list summary {
  display: inline-block; cursor: pointer; list-style: none; user-select: none;
  font-weight: 700; color: var(--title); padding: 4px 10px; border: 1px solid var(--edge); border-radius: 4px;
}
.theme-list summary::-webkit-details-marker { display: none; }
.theme-list summary:hover { background: var(--sel-bg); color: var(--sel-fg); }
.theme-list .when-open, .theme-list[open] .when-closed { display: none; }
.theme-list[open] .when-open { display: inline; }
.theme-list .themes { margin-top: 16px; }

/* theme picker grid */
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.chip {
  font: inherit; font-size: 13px; text-align: left; cursor: pointer; padding: 9px 11px 10px; border-radius: 8px;
  border: 1px solid var(--cbox1); background: var(--cbg); color: var(--cfg); position: relative;
  transition: transform .12s;
}
.chip:hover { transform: translateY(-2px); }
.chip[aria-pressed="true"] { outline: 2px solid var(--hi); outline-offset: 2px; }
.chip .nm { display: block; font-weight: 700; color: var(--ctitle); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip .nm::before { content: "▌"; color: var(--chi); margin-right: 4px; }
.chip .sw { display: flex; gap: 4px; margin-top: 7px; }
.chip .sw i { flex: 1; height: 6px; border-radius: 2px; }
.chip .bar { margin-top: 5px; height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--cg1), var(--cg2), var(--cg3)); }

footer { max-width: 1180px; margin: 72px auto 0; padding: 26px 20px 48px; border-top: 1px solid var(--div); text-align: center; }
footer p { margin: 0 0 6px; }
footer .d { color: var(--g1); }
footer .ok { color: var(--misc); }
footer .made { margin: 14px 0 12px; color: var(--fg); }
footer .made a { color: var(--title); font-weight: 700; }
/* pixel heart, colored from the theme's highlight color */
footer .heart { width: 1.25em; height: auto; vertical-align: -0.2em; margin: 0 .15em; image-rendering: pixelated; }
footer .heart .r { fill: var(--hi); }
footer .heart .o { fill: color-mix(in srgb, var(--hi) 30%, #000); }
footer .heart .s { fill: color-mix(in srgb, var(--hi) 62%, #000); }
footer .heart .h { fill: color-mix(in srgb, var(--hi) 15%, #fff); }
footer .made a:hover { color: var(--hi); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cursor-box { animation: none; }
}
