/* cterm's documentation site: the app's own colours (packages/web/src/styles.css), dark by default and light under
   data-theme="light", which site.js sets from the theme this browser picked in cterm or from the toggle here. */
:root {
  color-scheme: dark;
  --sans: "IBM Plex Sans", "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --bg: #0d1015; --side: #11151b; --panel: #141920; --sunken: #0a0d11;
  --line: #232a34; --line-soft: #1a2029; --ink: #e6e9ee; --muted: #8a94a3; --faint: #5d6775;
  --accent: #3ccbb8; --accent-ink: #04211d; --accent-soft: #12302c; --accent-line: #1f4a44;
  --hover: #171d25; --code-ink: #cfe3ff; --shadow: 0 8px 24px rgba(0, 0, 0, .5);
  --top-h: 52px;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f5f0; --side: #efece6; --panel: #ffffff; --sunken: #f1eee8;
  --line: #ddd8cd; --line-soft: #e8e4db; --ink: #1f2328; --muted: #6b6a64; --faint: #9a978e;
  --accent: #0f8a7a; --accent-ink: #ffffff; --accent-soft: #e0efeb; --accent-line: #b5d9d1;
  --hover: #e8e4dc; --code-ink: #1d3a5f; --shadow: 0 8px 24px rgba(60, 50, 30, .16);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: calc(var(--top-h) + 12px); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.65 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre { font-family: var(--mono); font-size: .88em; }
code { background: var(--sunken); border: 1px solid var(--line-soft); border-radius: 5px; padding: 1px 5px; color: var(--code-ink); }
pre { background: var(--sunken); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; overflow-x: auto; line-height: 1.5; }
pre code { background: none; border: 0; padding: 0; font-size: 1em; }

/* The bar on top */
.top { position: sticky; top: 0; z-index: 10; height: var(--top-h); display: flex; align-items: center; gap: 10px; padding: 0 16px; background: var(--side); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 600; font-size: 15.5px; }
.brand:hover { text-decoration: none; }
.brand-docs { color: var(--muted); font-weight: 400; }
.spacer { flex: 1; }
.to-app { font-size: 13px; border: 1px solid var(--accent-line); background: var(--accent-soft); border-radius: 8px; padding: 4px 10px; }
.to-app:hover { text-decoration: none; filter: brightness(1.08); }
/* The public copy at cterm.dev/docs (p24.1): the way back to the site's home and its blog. */
.to-site { font-size: 13px; color: var(--muted); padding: 4px 8px; border-radius: 8px; }
.to-site:hover { color: var(--ink); background: var(--hover); text-decoration: none; }
@media (max-width: 560px) { .to-site + .to-site { display: none; } }
.top button { background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 8px; height: 30px; min-width: 30px; font: inherit; font-size: 15px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.top button:hover { color: var(--ink); background: var(--hover); }
.menu { display: none !important; }

/* Nav, page, contents */
.layout { display: grid; grid-template-columns: 270px minmax(0, 1fr) 210px; max-width: 1400px; margin: 0 auto; }
.side { position: sticky; top: var(--top-h); align-self: start; height: calc(100vh - var(--top-h)); overflow-y: auto; padding: 16px 12px 32px; border-right: 1px solid var(--line-soft); }
.search { width: 100%; background: var(--sunken); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font: inherit; font-size: 13.5px; margin-bottom: 12px; }
.search:focus { outline: none; border-color: var(--accent-line); }
.nav-group { margin-bottom: 14px; }
.nav-area { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); padding: 0 8px 4px; }
.nav-link { display: block; padding: 4px 8px; border-radius: 7px; color: var(--muted); font-size: 13.5px; line-height: 1.4; }
.nav-link:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.nav-link.on { background: var(--accent-soft); color: var(--accent); }
.nav-none { color: var(--muted); font-size: 13px; padding: 0 8px; }
.main { min-width: 0; padding: 28px 40px 48px; }
.page { max-width: 780px; }
.page h1 { font-size: 30px; line-height: 1.2; margin: 4px 0 14px; letter-spacing: -.01em; }
.page h2 { font-size: 21px; margin: 36px 0 10px; padding-top: 8px; border-top: 1px solid var(--line-soft); }
.page h3 { font-size: 16.5px; margin: 24px 0 6px; }
.page h4 { font-size: 15px; margin: 18px 0 4px; }
.page p, .page li { color: var(--ink); }
.page ul, .page ol { padding-left: 22px; }
.page li { margin: 3px 0; }
.page li > ul, .page li > ol { margin: 3px 0; }
.page strong { font-weight: 600; }
.page hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }
.page blockquote { margin: 16px 0; padding: 2px 16px; border-left: 3px solid var(--accent-line); background: var(--panel); border-radius: 0 8px 8px 0; color: var(--muted); }
.page .table { overflow-x: auto; margin: 14px 0; }
.page table { border-collapse: collapse; font-size: 14px; min-width: 60%; }
.page th, .page td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; vertical-align: top; }
.page th { background: var(--panel); font-weight: 600; }
.page img { max-width: 100%; height: auto; }
figure.shot { margin: 20px 0 24px; }
figure.shot img { display: block; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); background: var(--panel); }
figure.shot.tall img { max-width: min(100%, 340px); }
figure.shot figcaption { margin-top: 8px; font-size: 13.5px; color: var(--muted); }
figure.shot .by { display: block; font-size: 12px; color: var(--faint); }
figure.shot .by code { font-size: 11.5px; }
/* A figure with both theme pictures (build.mjs' themeTwin): the one for the page's theme, the toggle's. */
:root:not([data-theme="light"]) figure.shot.themed .for-light,
:root[data-theme="light"] figure.shot.themed .for-dark { display: none; }
.shots { max-width: 780px; margin-top: 32px; font-size: 12.5px; color: var(--faint); }
.pager { max-width: 780px; display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; }
.pager a { flex: 1; max-width: 48%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; color: var(--ink); background: var(--panel); }
.pager a:hover { border-color: var(--accent-line); text-decoration: none; }
.pager a span { display: block; font-size: 12px; color: var(--muted); }
.pager .next { text-align: right; }
.foot { max-width: 780px; margin-top: 28px; padding-top: 14px; border-top: 1px solid var(--line-soft); font-size: 12px; color: var(--faint); }
.toc { position: sticky; top: var(--top-h); align-self: start; padding: 28px 16px 24px 4px; font-size: 13px; max-height: calc(100vh - var(--top-h)); overflow-y: auto; }
.toc-head { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin-bottom: 6px; }
.toc a { display: block; color: var(--muted); padding: 3px 0 3px 10px; border-left: 2px solid var(--line-soft); }
.toc a:hover { color: var(--ink); text-decoration: none; border-left-color: var(--accent-line); }

@media (max-width: 1180px) {
  .layout { grid-template-columns: 250px minmax(0, 1fr); }
  .toc { display: none; }
}
/* A phone: the nav becomes a drawer behind the ☰ button. */
@media (max-width: 820px) {
  .menu { display: inline-flex !important; }
  .layout { display: block; }
  .side { position: fixed; top: var(--top-h); left: 0; height: calc(100vh - var(--top-h)); height: calc(100dvh - var(--top-h)); width: min(300px, 86vw); background: var(--side); z-index: 9; transform: translateX(-102%); transition: transform .18s ease; box-shadow: var(--shadow); }
  body.nav-open .side { transform: none; }
  .main { padding: 20px 16px 40px; }
  .page h1 { font-size: 25px; }
  .pager { flex-direction: column; }
  .pager a { max-width: none; }
}
