/* ---------------------------------------------------------------------------
   Colorlib documentation

   The subject is a theme whose whole identity is twelve interchangeable
   palettes, so the documentation deliberately does not borrow one of them —
   it would date the moment a palette changed, and it would compete with the
   previews, which are the only things on the page that should be colourful.
   Instead: warm paper, near-black ink, hairline rules, and one deep pine
   accent used sparingly.

   IBM Plex is used across all three roles. It gives documentation the feel of
   a printed manual rather than a marketing site, and its serif has enough
   character to carry headings without a second display family.
   --------------------------------------------------------------------------- */

:root {
	--paper: #fcfcfa;
	--panel: #f5f5f0;
	--ink: #15181c;
	--muted: #5b6169;
	--rule: #e3e3dc;
	--accent: #16645a;
	--accent-ink: #0e453e;
	--accent-wash: #e8f1ef;
	--shadow: 0 1px 2px rgba(21, 24, 28, .04), 0 8px 24px rgba(21, 24, 28, .06);

	--sans: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
	--serif: "IBM Plex Serif", ui-serif, Georgia, "Times New Roman", serif;
	--mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

	--sidebar: 250px;
	--measure: 70ch;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--paper: #101215;
		--panel: #171a1f;
		--ink: #e7e9ec;
		--muted: #9aa1ac;
		--rule: #262a31;
		--accent: #5cc2b1;
		--accent-ink: #8ad8ca;
		--accent-wash: #16282a;
		--shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .34);
	}
}

:root[data-theme="dark"] {
	--paper: #101215;
	--panel: #171a1f;
	--ink: #e7e9ec;
	--muted: #9aa1ac;
	--rule: #262a31;
	--accent: #5cc2b1;
	--accent-ink: #8ad8ca;
	--accent-wash: #16282a;
	--shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .34);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--sans);
	font-size: 16.5px;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }

/* ---------------------------------------------------------------- shell */

.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); gap: 0; }

.side {
	position: sticky; top: 0; align-self: start;
	height: 100vh; overflow-y: auto;
	border-right: 1px solid var(--rule);
	padding: 26px 20px 40px;
	background: var(--paper);
}

.brand { display: block; text-decoration: none; color: var(--ink); margin-bottom: 4px; }
.brand strong { font-family: var(--serif); font-size: 1.18rem; font-weight: 600; letter-spacing: -.01em; display: block; }
.brand span { font-family: var(--mono); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

.side nav { margin-top: 26px; }
.side h4 {
	font-family: var(--mono); font-size: .66rem; font-weight: 500;
	letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
	margin: 24px 0 8px;
}
.side ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.side a {
	display: block; padding: 5px 9px; margin-inline: -9px;
	border-radius: 6px; text-decoration: none;
	color: var(--ink); font-size: .92rem;
}
.side a:hover { background: var(--panel); }
.side a[aria-current="page"] { background: var(--accent-wash); color: var(--accent-ink); font-weight: 500; }

.main { min-width: 0; padding: 46px 44px 100px; }
.wrap { max-width: var(--measure); }
.wide { max-width: 1080px; }

/* ---------------------------------------------------------------- type */

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; letter-spacing: -.015em; text-wrap: balance; }
h1 { font-size: clamp(2rem, 1.5rem + 1.9vw, 2.9rem); line-height: 1.1; margin: 0 0 .3em; }
h2 { font-size: 1.55rem; line-height: 1.22; margin: 2.4em 0 .5em; padding-top: .9em; border-top: 1px solid var(--rule); }
h2:first-of-type { border-top: 0; padding-top: 0; }
h3 { font-size: 1.16rem; margin: 1.9em 0 .35em; }
p, ul, ol { margin: 0 0 1.05em; }
li { margin-bottom: .3em; }
li > ul, li > ol { margin-top: .3em; }
strong { font-weight: 600; }

.lede { font-size: 1.14rem; line-height: 1.55; color: var(--muted); margin-bottom: 1.8em; max-width: 62ch; }

.eyebrow {
	font-family: var(--mono); font-size: .68rem; font-weight: 500;
	letter-spacing: .12em; text-transform: uppercase; color: var(--accent);
	display: block; margin-bottom: .9em;
}

code {
	font-family: var(--mono); font-size: .86em;
	background: var(--panel); border: 1px solid var(--rule);
	padding: .1em .36em; border-radius: 4px;
}
pre {
	background: var(--panel); border: 1px solid var(--rule);
	border-radius: 10px; padding: 15px 17px;
	overflow-x: auto; margin: 0 0 1.4em; line-height: 1.55;
}
pre code { background: none; border: 0; padding: 0; font-size: .84rem; }

blockquote {
	margin: 0 0 1.3em; padding: 2px 0 2px 18px;
	border-left: 2px solid var(--accent); color: var(--muted);
}

hr { border: 0; border-top: 1px solid var(--rule); margin: 2.6em 0; }

/* ---------------------------------------------------------------- tables */

.tablewrap { overflow-x: auto; margin: 0 0 1.5em; }
table { border-collapse: collapse; width: 100%; font-size: .93rem; }
th, td { text-align: left; padding: 9px 14px 9px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-family: var(--mono); font-size: .7rem; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
td code { white-space: nowrap; }

/* ---------------------------------------------------------------- starters */

.starters {
	display: grid; gap: 26px; margin: 2em 0 2.6em;
	grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
}
.starter {
	/* A grid item defaults to min-width:auto, which resolves to the intrinsic
	   width of the preview image (1120px) and pushes the card out of its track.
	   The same shrink problem the theme's own header has. */
	min-width: 0;
	border: 1px solid var(--rule); border-radius: 13px; overflow: hidden;
	background: var(--paper); box-shadow: var(--shadow);
	display: flex; flex-direction: column;
	transition: transform .16s ease, box-shadow .16s ease;
}
@media (prefers-reduced-motion: reduce) { .starter { transition: none; } }
.starter:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(21,24,28,.06), 0 14px 34px rgba(21,24,28,.11); }
.starter img { display: block; width: 100%; height: auto; aspect-ratio: 14 / 10; object-fit: cover; object-position: top center; border-bottom: 1px solid var(--rule); background: var(--panel); }
.starter .body { padding: 15px 17px 17px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.starter h3 { margin: 0; font-size: 1.05rem; }
.starter p { margin: 0; font-size: .87rem; color: var(--muted); line-height: 1.5; flex: 1; }
.starter .meta { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-top: 3px; }
.swatches { display: inline-flex; gap: 4px; }
.swatch { width: 13px; height: 13px; border-radius: 999px; border: 1px solid rgba(0,0,0,.14); }
.tag { font-family: var(--mono); font-size: .67rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.starter .go { font-size: .87rem; font-weight: 500; text-decoration: none; }
.starter .go::after { content: " →"; }

/* ---------------------------------------------------------------- bits */

.note {
	background: var(--accent-wash); border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
	border-radius: 10px; padding: 14px 17px; margin: 0 0 1.5em; font-size: .93rem;
}
.note p:last-child { margin-bottom: 0; }
.note strong { color: var(--accent-ink); }

.cols { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin: 0 0 1.8em; }
.card { min-width: 0; border: 1px solid var(--rule); border-radius: 11px; padding: 16px 18px; background: var(--paper); }
.card h3 { margin: 0 0 .3em; font-size: 1rem; }
.card p { margin: 0; font-size: .89rem; color: var(--muted); }

.stat { font-family: var(--serif); font-size: 1.85rem; font-weight: 600; line-height: 1; display: block; }
.stat + span { font-family: var(--mono); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

.btnrow { display: flex; flex-wrap: wrap; gap: 11px; margin: 0 0 2em; }
.btn {
	display: inline-block; padding: 9px 17px; border-radius: 999px;
	text-decoration: none; font-size: .92rem; font-weight: 500;
	background: var(--accent); color: var(--paper); border: 1px solid var(--accent);
}
.btn:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: var(--paper); }
.btn.ghost { background: none; color: var(--ink); border-color: var(--rule); }
.btn.ghost:hover { background: var(--panel); color: var(--ink); }

.pagenav { display: flex; justify-content: space-between; gap: 16px; margin-top: 3.4em; padding-top: 1.3em; border-top: 1px solid var(--rule); font-size: .93rem; }
.pagenav a { text-decoration: none; font-weight: 500; }

footer.site { margin-top: 4em; padding-top: 1.4em; border-top: 1px solid var(--rule); color: var(--muted); font-size: .85rem; }

/* ---------------------------------------------------------------- mobile */

.menubtn {
	display: none; position: fixed; z-index: 30; top: 12px; right: 12px;
	background: var(--paper); border: 1px solid var(--rule); border-radius: 8px;
	padding: 7px 12px; font-family: var(--mono); font-size: .74rem; color: var(--ink);
	box-shadow: var(--shadow); cursor: pointer;
}

@media (max-width: 900px) {
	.shell { grid-template-columns: 1fr; }
	.side {
		position: fixed; inset: 0 auto 0 0; z-index: 25; width: 268px;
		transform: translateX(-100%); transition: transform .2s ease;
		box-shadow: var(--shadow);
	}
	.side.open { transform: none; }
	.menubtn { display: block; }
	.main { padding: 62px 22px 80px; }
}
@media (prefers-reduced-motion: reduce) { .side { transition: none; } }
