:root {
	--bg: #fbf8f1;
	--paper: #ffffff;
	--text: #2b2116;
	--muted: #6f6253;
	--line: #e3dccd;
	--accent: #a3238e;        /* course purple */
	--link: #8a1f78;
	--head: #4a1c00;          /* the training slides' brown */
	--rule-bg: #fdecec;
	--rule-line: #c62828;
	--rule-text: #8e1616;
	--note-bg: #f3efe4;
	--code-bg: #f1ece0;
	color-scheme: light;
}
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--bg: #1b1814;
		--paper: #24201b;
		--text: #ece5d8;
		--muted: #b2a594;
		--line: #3b342c;
		--accent: #e07ad0;
		--link: #ef93df;
		--head: #f0c9a0;
		--rule-bg: #3a1a1a;
		--rule-line: #ef5350;
		--rule-text: #ffb4b0;
		--note-bg: #2c2721;
		--code-bg: #2f2922;
		color-scheme: dark;
	}
}
:root[data-theme="dark"] {
	--bg: #1b1814; --paper: #24201b; --text: #ece5d8; --muted: #b2a594; --line: #3b342c;
	--accent: #e07ad0; --link: #ef93df; --head: #f0c9a0; --rule-bg: #3a1a1a; --rule-line: #ef5350;
	--rule-text: #ffb4b0; --note-bg: #2c2721; --code-bg: #2f2922; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
}
header {
	position: sticky; top: 0; z-index: 10;
	display: flex; flex-wrap: wrap; align-items: center; gap: .3rem 1.2rem;
	padding: .6rem 16px;
	background: var(--paper);
	border-bottom: 3px solid var(--accent);
}
.brand { font-weight: 800; font-size: 1.1rem; color: var(--head); text-decoration: none; white-space: nowrap; }
.brand span { color: var(--accent); }
nav { display: flex; flex-wrap: wrap; gap: .2rem .9rem; }
nav a { color: var(--muted); text-decoration: none; font-size: .95rem; padding: .1rem 0; }
nav a:hover { color: var(--link); }
nav a[aria-current] { color: var(--text); font-weight: 600; border-bottom: 2px solid var(--accent); }

main { max-width: 52rem; margin: 0 auto; padding: 1.5rem 16px 3rem; }
footer { max-width: 52rem; margin: 0 auto; padding: 1rem 16px 2rem; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--line); }

h1, h2, h3 { color: var(--head); line-height: 1.25; }
h1 { font-size: 1.9rem; margin: .2rem 0 1rem; }
h2 { font-size: 1.4rem; margin-top: 2.2rem; padding-bottom: .2rem; border-bottom: 1px solid var(--line); }
h3 { font-size: 1.15rem; margin-top: 1.6rem; }
a { color: var(--link); }
img { max-width: 100%; height: auto; border-radius: 4px; }
p img, li img { vertical-align: middle; }
main > p > img, figure img { display: block; margin: .8rem 0; border: 1px solid var(--line); }
code { background: var(--code-bg); padding: .05em .3em; border-radius: 3px; font-size: .9em; overflow-wrap: anywhere; }
pre { background: var(--code-bg); padding: .8rem; border-radius: 6px; overflow-x: auto; }
pre code { padding: 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
.lead { font-size: 1.1rem; color: var(--muted); }
.crumbs { margin: 0; font-size: .9rem; }

table { border-collapse: collapse; width: 100%; margin: 1rem 0; font-size: .95rem; }
th, td { border: 1px solid var(--line); padding: .4rem .55rem; text-align: left; vertical-align: top; }
th { background: var(--note-bg); }
.scroll, main table { display: block; overflow-x: auto; }
.scroll table { display: table; }

/* Rules that must not be missed: always this red box. */
.admonition { margin: 1.2rem 0; padding: .8rem 1rem; border-radius: 6px; background: var(--note-bg); border-left: 5px solid var(--muted); }
.admonition-title { margin: 0 0 .3rem; font-weight: 700; }
.admonition > :last-child { margin-bottom: 0; }
.admonition.wazne { background: var(--rule-bg); border: 2px solid var(--rule-line); border-left-width: 8px; }
.admonition.wazne .admonition-title { color: var(--rule-text); font-size: 1.1rem; text-transform: uppercase; letter-spacing: .03em; }
.admonition.wazne strong { color: var(--rule-text); }
.admonition.wskazowka { border-left-color: var(--accent); }
.stop { color: var(--rule-text); font-weight: 800; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: .8rem; padding: 0; list-style: none; }
.cards li { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: .8rem 1rem; }
.cards a { font-weight: 700; font-size: 1.05rem; }
.kb { list-style: none; padding: 0; }
.kb li { padding: .6rem 0; border-bottom: 1px solid var(--line); }
.kb li a { font-weight: 600; }
.kb li span { color: var(--muted); font-size: .95rem; }
.kb .tag, .tag { display: inline-block; font-size: .75rem; padding: 0 .45rem; border-radius: 1rem; background: var(--note-bg); color: var(--muted); }
figure.video { margin: 1rem 0 1.5rem; }
figure.video video { width: 100%; max-height: 70vh; background: #000; border-radius: 6px; }
figure.video figcaption, figcaption { font-size: .85rem; color: var(--muted); }
.downloads td:nth-child(2) { overflow-wrap: anywhere; }
a.download { font-weight: 600; }
.sha { font-size: .75rem; }
details { margin: .5rem 0; }
summary { cursor: pointer; font-weight: 600; }
.note { color: var(--muted); font-style: italic; }

@media (max-width: 600px) {
	body { font-size: 16px; }
	h1 { font-size: 1.5rem; }
	header { position: static; }
}
@media print {
	header, footer, figure.video { display: none; }
	body { background: #fff; color: #000; }
}
