/* codeout docs - static docs shell (Nextra-style 3-column layout), built fresh.
   Light + dark themes, driven by document.documentElement[data-theme].
   IBM Plex (OFL). Single pink accent. No build step. */

/* fonts - paths resolve when served at /docs/ (Caddy site root holds /fonts) */
@font-face { font-family: "IBM Plex Sans"; src: url("/fonts/ibm-plex-sans-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("/fonts/ibm-plex-sans-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("/fonts/ibm-plex-sans-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/fonts/ibm-plex-mono-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/fonts/ibm-plex-mono-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }

/* ----------------------------------------------------------------- theme tokens */
/* shared (theme-independent) tokens live on :root; colour tokens are set per theme */
:root {
	--r: 12px;
	--r-pill: 999px;
	--mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
	--sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--ease: cubic-bezier(0.16, 1, 0.3, 1);

	--nav-h: 60px;
	--side-w: 252px;
	--toc-w: 220px;
	--gutter: 48px;
}

/* dark is the default (also the fallback when no attribute is present) */
:root,
:root[data-theme="dark"] {
	--bg: #0b0d10;
	--nav-bg: rgba(11, 13, 16, 0.72);
	--surface: #12151a;
	--code-bg-a: #11141a;
	--code-bg-b: #0d1014;
	--border: #222831;
	--border-soft: #1a1e25;
	--text: #e8ebf0;
	--muted: #8b93a1;
	--faint: #565d6a;
	--accent: #ff6ac1;        /* codeout pink - fills, active states, large text */
	--accent-dim: #ff8fd0;
	--accent-text: #ff6ac1;   /* small accent text / links (already legible on dark) */
	--accent-wash: rgba(255, 106, 193, 0.08);
	--accent-rule: rgba(255, 106, 193, 0.35);
	--ink: #1a0610;           /* text on the pink accent */
	--dot: #2a2f38;           /* code-block window dots */
	--sel: rgba(255, 106, 193, 0.28);
	--sel-text: #fff;
	--shadow: 0 40px 90px -55px rgba(0, 0, 0, 0.95);
}

/* light - near-white surfaces, near-black text, darker pink for small text (AA on white) */
:root[data-theme="light"] {
	--bg: #fbfbfc;
	--nav-bg: rgba(251, 251, 252, 0.78);
	--surface: #f2f3f5;
	--code-bg-a: #f6f7f9;
	--code-bg-b: #eef0f3;
	--border: #d9dce1;
	--border-soft: #e6e8ec;
	--text: #15181d;
	--muted: #5a626e;
	--faint: #8b93a1;
	--accent: #ff6ac1;        /* keep brand pink for fills + large text */
	--accent-dim: #d6258e;    /* hover for the darker link pink */
	--accent-text: #c81d83;   /* small accent text / links - 5.3:1 on white (AA) */
	--accent-wash: rgba(200, 29, 131, 0.07);
	--accent-rule: rgba(200, 29, 131, 0.3);
	--ink: #1a0610;
	--dot: #c8ccd2;
	--sel: rgba(255, 106, 193, 0.3);
	--sel-text: #15181d;
	--shadow: 0 24px 60px -40px rgba(20, 24, 31, 0.35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-gutter: stable; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
	margin: 0; background: var(--bg); color: var(--text);
	font-family: var(--sans); font-size: 16px; line-height: 1.65;
	-webkit-font-smoothing: antialiased;
	transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
@media (prefers-reduced-motion: reduce) { body { transition: none; } }
a { color: inherit; text-decoration: none; }
::selection { background: var(--sel); color: var(--sel-text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* scroll target offset so anchors clear the sticky header */
:target { scroll-margin-top: calc(var(--nav-h) + 16px); }
[id] { scroll-margin-top: calc(var(--nav-h) + 16px); }

/* ----------------------------------------------------------------- header */
/* matches the main site nav: full-width bar, bold wordmark left, gray link + octocat + toggle right */
.nav {
	position: sticky; top: 0; z-index: 60; height: var(--nav-h);
	display: flex; align-items: center;
	border-bottom: 1px solid var(--border-soft);
	background: var(--nav-bg);
	backdrop-filter: saturate(160%) blur(14px);
	-webkit-backdrop-filter: saturate(160%) blur(14px);
}
.nav-inner { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 24px; }
.nav-left { display: flex; align-items: center; gap: 14px; }
.brand { display: inline-flex; align-items: center; font-family: var(--sans); font-weight: 600; font-size: 17px; letter-spacing: -0.01em; color: var(--text); }
.nav-links { display: flex; align-items: center; gap: 18px; }
.nav-links a { color: var(--muted); font-size: 14px; transition: color 0.2s var(--ease); }
.nav-links a:hover { color: var(--text); }
.nav-links .gh { display: inline-flex; align-items: center; color: var(--muted); }
.nav-links .gh:hover { color: var(--text); }
.nav-links .gh svg { width: 22px; height: 22px; fill: currentColor; display: block; }

/* theme toggle button (sun/moon, inline SVG) */
.theme-toggle {
	display: inline-flex; align-items: center; justify-content: center;
	width: 34px; height: 34px; border-radius: 9px;
	background: transparent; border: 1px solid var(--border); color: var(--muted);
	cursor: pointer; padding: 0;
	transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.theme-toggle:hover { color: var(--text); border-color: var(--faint); }
.theme-toggle svg { width: 17px; height: 17px; display: block; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* show the moon in dark mode (offer light), the sun in light mode (offer dark) */
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: none; }

/* mobile sidebar toggle - hidden on desktop */
.menu-btn {
	display: none; align-items: center; justify-content: center;
	width: 38px; height: 38px; border-radius: 9px;
	background: transparent; border: 1px solid var(--border); color: var(--text);
	cursor: pointer; padding: 0;
}
.menu-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; }

/* ----------------------------------------------------------------- layout */
.shell {
	display: grid;
	grid-template-columns: var(--side-w) minmax(0, 1fr) var(--toc-w);
	gap: var(--gutter);
	max-width: none;
	margin: 0 auto;
	padding: 0 36px;
	align-items: start;
}

/* ----------------------------------------------------------------- sidebar */
.sidebar {
	display: flex; flex-direction: column;
	position: sticky; top: var(--nav-h);
	height: calc(100vh - var(--nav-h));
	overflow-y: auto;
	padding: 28px 14px 48px 0;
	border-right: 1px solid var(--border-soft);
	-ms-overflow-style: none; scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.sidebar-footer { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--border-soft); }
.sidebar::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; }
.nav-group { margin-bottom: 12px; }

/* collapsible group header */
.nav-group > .group-label {
	display: flex; align-items: center; justify-content: space-between; gap: 8px;
	width: 100%; text-align: left;
	font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.06em;
	text-transform: uppercase; color: var(--faint);
	margin: 0 0 8px; padding: 6px 10px;
	background: none; border: 0; cursor: pointer;
	transition: color 0.15s var(--ease);
}
.nav-group > .group-label:hover { color: var(--muted); }
.nav-group > .group-label .chev {
	width: 13px; height: 13px; flex: none; stroke: currentColor; fill: none; stroke-width: 2;
	stroke-linecap: round; stroke-linejoin: round;
	transition: transform 0.2s var(--ease);
}
.nav-group[data-collapsed="true"] > .group-label .chev { transform: rotate(-90deg); }
.nav-group ul {
	list-style: none; margin: 0; padding: 0; display: grid; gap: 1px;
	overflow: hidden;
}
.nav-group[data-collapsed="true"] ul { display: none; }
.nav-group a {
	display: block; padding: 6px 10px; border-radius: 8px;
	font-size: 14px; color: var(--muted);
	border-left: 2px solid transparent;
	transition: color 0.15s var(--ease), background 0.15s var(--ease);
}
.nav-group a:hover { color: var(--text); background: var(--surface); }
.nav-group a.active {
	color: var(--accent-text); background: var(--accent-wash);
	border-left-color: var(--accent);
	font-weight: 500;
}
@media (prefers-reduced-motion: reduce) { .nav-group > .group-label .chev { transition: none; } }

/* ----------------------------------------------------------------- content */
/* full-width: content fills the space between the sidebar and the TOC.
   no narrow measure cap; comfortable left/right padding keeps long lines sane. */
.content {
	min-width: 0;
	padding: 40px 8px 120px 4px;
}
.content > section { padding-top: 8px; margin-top: 40px; }
.content > section:first-of-type { margin-top: 0; }

.breadcrumb { font-family: var(--mono); font-size: 12.5px; color: var(--faint); margin: 0 0 10px; }
.breadcrumb .accent { color: var(--accent-text); }

.content h1 { font-size: clamp(28px, 3.4vw, 36px); line-height: 1.15; letter-spacing: -0.02em; font-weight: 600; margin: 0 0 14px; }
.content h2 {
	font-size: 23px; letter-spacing: -0.01em; font-weight: 600;
	margin: 0 0 14px; padding-top: 6px;
}
.content h3 { font-size: 17px; font-weight: 600; margin: 28px 0 8px; }
.content p { color: var(--text); margin: 0 0 16px; }
.content .lede { font-size: 17.5px; color: var(--muted); line-height: 1.55; margin-bottom: 22px; }
.content ul, .content ol { color: var(--text); margin: 0 0 16px; padding-left: 22px; }
.content li { margin: 0 0 7px; }
.content li::marker { color: var(--faint); }
.content strong { font-weight: 600; color: var(--text); }
.content a.link { color: var(--accent-text); border-bottom: 1px solid var(--accent-rule); transition: border-color 0.15s var(--ease); }
.content a.link:hover { border-bottom-color: var(--accent-text); }

/* a heading anchor that appears on hover */
.content h2 .anchor, .content h3 .anchor {
	opacity: 0; margin-left: 8px; color: var(--faint); font-weight: 400;
	transition: opacity 0.15s var(--ease);
}
.content h2:hover .anchor, .content h3:hover .anchor { opacity: 1; }
.content h2 .anchor:hover, .content h3 .anchor:hover { color: var(--accent-text); }

/* divider between top-level sections */
.content .rule { border: 0; border-top: 1px solid var(--border-soft); margin: 56px 0 0; }

/* inline code */
.content code {
	font-family: var(--mono); font-size: 0.86em; color: var(--text);
	background: var(--surface); border: 1px solid var(--border-soft);
	padding: 1px 6px; border-radius: 6px;
}

/* code block - terminal-flavoured */
.code {
	margin: 0 0 20px; background: linear-gradient(180deg, var(--code-bg-a), var(--code-bg-b));
	border: 1px solid var(--border); border-radius: var(--r); overflow: hidden;
}
.code .bar { display: flex; align-items: center; gap: 7px; padding: 9px 14px; border-bottom: 1px solid var(--border-soft); }
.code .bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--dot); flex: none; }
.code .bar span { margin-left: 8px; font-family: var(--mono); font-size: 11.5px; color: var(--faint); }
.code pre {
	font-family: var(--mono); font-size: 13.5px; line-height: 1.8;
	padding: 16px 18px; margin: 0; overflow-x: auto; color: var(--text);
	-webkit-overflow-scrolling: touch;
}
.code .p { color: var(--accent-text); }   /* prompt */
.code .o { color: var(--muted); }    /* output */
.code .c { color: var(--faint); }    /* comment */
.code .k { color: var(--accent-dim); }

/* callout / note */
.note {
	display: flex; gap: 12px; margin: 0 0 20px;
	background: var(--surface); border: 1px solid var(--border-soft);
	border-left: 2px solid var(--accent); border-radius: var(--r);
	padding: 14px 16px;
}
.note .label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--accent-text); flex: none; padding-top: 2px; }
.note p { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.6; }

/* a CLI-tree entry (matches the marketing site treatment) */
.tree { display: grid; gap: 18px; margin: 0 0 8px; }
.tree .t { font-family: var(--mono); font-weight: 500; font-size: 14.5px; margin: 0 0 5px; color: var(--text); }
.tree .d { display: flex; gap: 8px; }
.tree .branch { color: var(--faint); font-family: var(--mono); flex: none; }
.tree .d p { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.6; }

/* definition rows (e.g. FAQ-ish or key/value reference) */
.kv { display: grid; gap: 0; margin: 0 0 20px; }
.kv .row { display: grid; grid-template-columns: 180px 1fr; gap: 18px; padding: 14px 0; border-top: 1px solid var(--border-soft); }
.kv .row:first-child { border-top: none; }
.kv .k { font-family: var(--mono); font-size: 13.5px; color: var(--accent-text); }
.kv .v { color: var(--muted); font-size: 14.5px; }
.kv .v code { color: var(--text); }

/* a typeable pairing code, shown big and monospace */
.codeline {
	display: inline-block; font-family: var(--mono); font-size: 18px; font-weight: 500;
	letter-spacing: 0.08em; color: var(--text);
	background: var(--surface); border: 1px solid var(--border);
	border-radius: 8px; padding: 6px 12px; margin: 2px 0;
}

/* paragraphs read better with a soft measure even inside the wide column */
.content .lede, .content > section > p, .note p, .tree .d p { max-width: 78ch; }

/* card grid - uses the extra width to lay related items side by side */
.cards {
	display: grid; gap: 16px; margin: 0 0 22px;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.cards .card {
	background: var(--surface); border: 1px solid var(--border-soft);
	border-radius: var(--r); padding: 18px 18px 16px;
	transition: border-color 0.15s var(--ease);
}
.cards .card:hover { border-color: var(--border); }
.cards .card .ct { font-family: var(--mono); font-size: 13px; font-weight: 500; color: var(--accent-text); margin: 0 0 8px; letter-spacing: 0.01em; }
.cards .card p { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.6; }
.cards .card p + p { margin-top: 10px; }

/* numbered steps - for sequential procedures */
.steps { list-style: none; counter-reset: step; margin: 0 0 22px; padding: 0; display: grid; gap: 16px; }
.steps > li { counter-increment: step; position: relative; padding-left: 44px; min-height: 30px; }
.steps > li::before {
	content: counter(step); position: absolute; left: 0; top: 0;
	width: 30px; height: 30px; border-radius: 8px;
	display: flex; align-items: center; justify-content: center;
	font-family: var(--mono); font-size: 14px; font-weight: 500;
	color: var(--accent-text); background: var(--accent-wash);
	border: 1px solid var(--accent-rule);
}
.steps > li p { margin: 0 0 8px; }
.steps > li > strong { display: block; margin-bottom: 4px; }
.steps .code, .steps .note { margin-top: 10px; }

/* a two-column compare table for the comparisons page */
.compare { width: 100%; border-collapse: collapse; margin: 0 0 22px; font-size: 14.5px; }
.compare th, .compare td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border-soft); vertical-align: top; }
.compare thead th { font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--faint); font-weight: 500; }
.compare tbody th { font-weight: 500; color: var(--text); width: 26%; }
.compare td { color: var(--muted); }
.compare td.yes { color: var(--accent-text); }
.table-scroll { overflow-x: auto; margin: 0 0 22px; -webkit-overflow-scrolling: touch; }
.table-scroll .compare { margin: 0; min-width: 540px; }

/* prev / next footer */
.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 56px; }
.pager a {
	flex: 1; padding: 14px 16px; border: 1px solid var(--border-soft); border-radius: var(--r);
	transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.pager a:hover { border-color: var(--faint); background: var(--surface); }
.pager .dir { font-family: var(--mono); font-size: 11.5px; color: var(--faint); display: block; margin-bottom: 3px; }
.pager .ttl { color: var(--text); font-size: 14.5px; font-weight: 500; }
.pager .next { text-align: right; }

/* ----------------------------------------------------------------- toc */
.toc {
	position: sticky; top: var(--nav-h);
	height: calc(100vh - var(--nav-h));
	overflow-y: auto;
	padding: 44px 0 48px;
	scrollbar-width: none;
}
.toc::-webkit-scrollbar { display: none; }
.toc .toc-label { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); margin: 0 0 12px; }
.toc ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.toc li.lvl-3 { padding-left: 14px; }
.toc a {
	display: block; padding: 4px 0 4px 12px; font-size: 13px; color: var(--faint);
	border-left: 2px solid var(--border-soft);
	transition: color 0.15s var(--ease), border-color 0.15s var(--ease);
	line-height: 1.4;
}
.toc a:hover { color: var(--muted); }
.toc a.active { color: var(--accent-text); border-left-color: var(--accent); }

/* ----------------------------------------------------------------- scrim for mobile sidebar */
.scrim {
	position: fixed; inset: var(--nav-h) 0 0 0; z-index: 40;
	background: rgba(0, 0, 0, 0.55); opacity: 0; pointer-events: none;
	transition: opacity 0.2s var(--ease);
}
body.nav-open .scrim { opacity: 1; pointer-events: auto; }

/* ----------------------------------------------------------------- responsive */

/* hide the right TOC under 1280 (keeps content + sidebar comfortable) */
@media (max-width: 1280px) {
	.shell { grid-template-columns: var(--side-w) minmax(0, 1fr); }
	.toc { display: none; }
}

/* below 1024: sidebar becomes a slide-in drawer */
@media (max-width: 1024px) {
	.menu-btn { display: inline-flex; }
	.shell { grid-template-columns: minmax(0, 1fr); padding: 0 22px; }
	.sidebar {
		position: fixed; top: var(--nav-h); left: 0; z-index: 50;
		width: min(300px, 82vw); height: calc(100vh - var(--nav-h));
		background: var(--bg); border-right: 1px solid var(--border);
		padding: 24px 18px 48px;
		transform: translateX(-102%);
		transition: transform 0.24s var(--ease);
	}
	body.nav-open .sidebar { transform: translateX(0); }
	.content { padding: 32px 0 100px; }
}
@media (prefers-reduced-motion: reduce) { .sidebar { transition: none; } .scrim { transition: none; } }

@media (max-width: 560px) {
	.nav-inner { padding: 0 18px; }
	.nav-links { gap: 14px; }
	.shell { padding: 0 18px; }
	.content h1 { font-size: 27px; }
	.content h2 { font-size: 20px; }
	.kv .row { grid-template-columns: 1fr; gap: 4px; }
	.pager { flex-direction: column; }
	.pager .next { text-align: left; }
	.code pre { font-size: 12.5px; }
}

@media (max-width: 360px) {
	.nav-inner { padding: 0 14px; }
	.shell { padding: 0 14px; }
	.codeline { font-size: 16px; }
}
