/*
	sprain2026: the blog's theme for 2026.
	One file: fonts, colours, layout, text, components. No framework, no external requests.
	Fonts (SIL Open Font License, see fonts/OFL-*.txt): Bricolage Grotesque for headings,
	Inter for text, JetBrains Mono for dates, labels and code.
*/

/* ---------- Fonts ---------- */
@font-face {
	font-family: 'Bricolage Grotesque';
	src: url('../fonts/bricolage-grotesque.woff2') format('woff2');
	font-weight: 200 800;
	font-stretch: 75% 100%;
	font-display: swap;
	unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
	font-family: 'Inter';
	src: url('../fonts/inter.woff2') format('woff2');
	font-weight: 100 900;
	font-style: normal;
	font-display: swap;
	unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
	font-family: 'Inter';
	src: url('../fonts/inter-italic.woff2') format('woff2');
	font-weight: 100 900;
	font-style: italic;
	font-display: swap;
	unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
	font-family: 'JetBrains Mono';
	src: url('../fonts/jetbrains-mono.woff2') format('woff2');
	font-weight: 100 800;
	font-display: swap;
	unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

/* ---------- Colours ----------
   Warm paper and ink, one electric accent (indigo) and a gradient «aurora» from indigo
   over violet to cyan for the few places that may shine: wordmark, photo ring, KI mark.
   Text contrast on the page colour: --text 16 : 1, --text-muted 7 : 1, --accent 7.4 : 1 (light). */
:root {
	color-scheme: light dark;
	--bg: #f6f5f1;
	--surface: #ffffff;
	--text: #15171c;
	--text-soft: #33363f;
	--text-muted: #555a66;
	--line: rgba(21,23,28,0.12);
	--accent: #4a2fd6;
	--accent-rgb: 74,47,214;
	--accent-soft: rgba(74,47,214,0.09);
	--on-accent: #ffffff;
	--aurora: linear-gradient(115deg, #4a2fd6 0%, #9b3fd8 45%, #0aa3c2 100%);
	--glow-1: rgba(120,90,255,0.16);
	--glow-2: rgba(10,163,194,0.12);
	--code-bg: rgba(21,23,28,0.05);
	--shadow: 0 1px 2px rgba(21,23,28,0.05), 0 8px 24px -12px rgba(21,23,28,0.12);

	--font-text: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
	--font-display: 'Bricolage Grotesque', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	--font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

	--gutter: 1.25rem;
	--measure: 40rem;
	--radius: 14px;
}
@media (prefers-color-scheme: dark) {
	:root {
		--bg: #0d0f14;
		--surface: #161922;
		--text: #e9eaf0;
		--text-soft: #c9ccd6;
		--text-muted: #9a9fae;
		--line: rgba(233,234,240,0.12);
		--accent: #a99bff;
		--accent-rgb: 169,155,255;
		--accent-soft: rgba(169,155,255,0.12);
		--on-accent: #0d0f14;
		--aurora: linear-gradient(115deg, #8f7dff 0%, #d07cf2 45%, #3fd3ee 100%);
		--glow-1: rgba(120,90,255,0.20);
		--glow-2: rgba(30,190,220,0.10);
		--code-bg: rgba(233,234,240,0.07);
		--shadow: 0 1px 2px rgba(0,0,0,0.3), 0 8px 24px -12px rgba(0,0,0,0.6);
	}
	/* Photos a touch dimmer, so bright images don't glare on the dark page */
	#content img {
		filter: brightness(0.92);
	}
}
@media (min-width: 600px) {
	:root {
		--gutter: 2rem;
	}
}

/* ---------- Base ---------- */
*, *::before, *::after {
	box-sizing: border-box;
}
html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}
body {
	margin: 0;
	/* A soft glow behind the top of the page; the only decoration, it scrolls away with the page */
	background:
		radial-gradient(60rem 28rem at 15% -6rem, var(--glow-1), transparent 70%),
		radial-gradient(50rem 24rem at 95% -4rem, var(--glow-2), transparent 70%),
		var(--bg);
	background-repeat: no-repeat;
	background-color: var(--bg);
	color: var(--text);
	font-family: var(--font-text);
	font-size: 1.0625rem;
	line-height: 1.7;
	font-feature-settings: 'cv11', 'ss03';
	-webkit-font-smoothing: antialiased;
}
img {
	max-width: 100%;
	height: auto;
}
a {
	color: inherit;
}
:focus-visible {
	outline: 3px solid var(--accent);
	outline-offset: 3px;
	border-radius: 3px;
}
::selection {
	background: rgba(var(--accent-rgb),0.25);
}
.skip-link {
	position: absolute;
	left: 1rem;
	top: -3rem;
	z-index: 10;
	padding: 0.5rem 1rem;
	border-radius: 999px;
	background: var(--text);
	color: var(--bg);
	font-size: 0.9rem;
	text-decoration: none;
}
.skip-link:focus {
	top: 1rem;
}
#content:focus {
	outline: none;
}

/* ---------- Layout ----------
   Phones and tablets: top bar, content, then the text about Manuel at the bottom.
   Desktop (from 1100 px): three columns, the text in the middle one and the sidebar in
   the right one. From about 1470 px the text column stands exactly in the middle of the
   window; below that it glides to the left until the sidebar fits (Wunsch #59).
   The sidebar stays in view while scrolling if the window is tall enough. */
.page {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	min-height: 100vh;
}
.topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 1rem var(--gutter);
}
.wordmark {
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
	text-decoration: none;
}
.wordmark img {
	width: 2.25rem;
	height: 2.25rem;
	border-radius: 50%;
	object-fit: cover;
	box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px rgba(var(--accent-rgb),0.6);
}
.wordmark span,
.sidebar-wordmark a {
	font-family: var(--font-display);
	font-weight: 750;
	font-size: 1.35rem;
	letter-spacing: -0.03em;
	line-height: 1;
	background: var(--aurora);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}
.topbar nav {
	display: flex;
	gap: 1.25rem;
	font-family: var(--font-mono);
	font-size: 0.8rem;
	letter-spacing: 0.02em;
}
.topbar nav a {
	padding: 0.5rem 0;
	color: var(--text-muted);
	text-decoration: none;
}
.topbar nav a:hover {
	color: var(--text);
	text-decoration: underline;
	text-underline-offset: 0.3em;
}
#content {
	width: 100%;
	max-width: calc(var(--measure) + 2 * var(--gutter));
	margin: 0 auto;
	padding: 1.5rem var(--gutter) 3rem;
}
.sidebar {
	border-top: 1px solid var(--line);
	background: var(--surface);
}
.sidebar-inner {
	max-width: calc(var(--measure) + 2 * var(--gutter));
	margin: 0 auto;
	padding: 3rem var(--gutter) 3.5rem;
}
.sidebar-photo {
	display: inline-block;
	padding: 4px;
	border-radius: 50%;
	background: var(--aurora);
}
.sidebar-photo img {
	display: block;
	width: 6rem;
	height: 6rem;
	border: 3px solid var(--surface);
	border-radius: 50%;
	object-fit: cover;
}
.sidebar-wordmark {
	display: none;
	margin: 0;
}
.sidebar-wordmark a {
	text-decoration: none;
}
.sidebar h2 {
	margin: 1rem 0 0.5rem;
	font-family: var(--font-display);
	font-size: 1.5rem;
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: 1.2;
}
.sidebar h2 a {
	text-decoration: none;
}
.sidebar-text {
	color: var(--text-soft);
	font-size: 0.95rem;
	line-height: 1.6;
}
.sidebar-text p {
	margin: 0 0 0.75rem;
}
.sidebar-text a {
	text-decoration: underline;
	text-decoration-color: rgba(var(--accent-rgb),0.45);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}
.sidebar-text a:hover {
	color: var(--accent);
	text-decoration-color: currentColor;
}
.sidebar-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 1.25rem;
	margin-top: 1.75rem;
	padding-top: 1.25rem;
	border-top: 1px solid var(--line);
	font-family: var(--font-mono);
	font-size: 0.75rem;
}
.sidebar-meta a {
	padding: 0.35rem 0;
	color: var(--text-muted);
	text-decoration: none;
}
.sidebar-meta a:hover {
	color: var(--text);
	text-decoration: underline;
	text-underline-offset: 0.3em;
}

@media (min-width: 1100px) {
	.page {
		grid-template-columns: minmax(0, 1fr) minmax(0, var(--measure)) minmax(23rem, 1fr);
		align-items: start;
		padding: 0 3rem;
	}
	.topbar {
		display: none;
	}
	#content {
		grid-column: 2;
		grid-row: 1;
		max-width: none;
		padding: 5rem 0 5rem;
	}
	.sidebar {
		grid-column: 3;
		grid-row: 1;
		border: none;
		background: none;
	}
	.sidebar-inner {
		max-width: 23rem;
		margin: 0;
		padding: 5rem 0 3rem 6rem;
	}
	.sidebar-wordmark {
		display: block;
		margin-top: 1.25rem;
	}
	.sidebar-wordmark a {
		font-size: 2rem;
	}
	.sidebar h2 {
		margin-top: 0.4rem;
		font-family: var(--font-mono);
		font-size: 0.8rem;
		font-weight: 500;
		letter-spacing: 0.02em;
		color: var(--text-muted);
	}
	.sidebar-photo img {
		width: 8rem;
		height: 8rem;
	}
	.sidebar-meta {
		flex-direction: column;
		gap: 0;
	}
}
/* The sidebar stays in view while scrolling, but only if it fits into the window (Wunsch #30) */
@media (min-width: 1100px) and (min-height: 760px) {
	.sidebar {
		position: sticky;
		top: 0;
	}
}

/* ---------- Text ---------- */
#content h1,
#content h2,
#content h3 {
	font-family: var(--font-display);
	color: var(--text);
	hyphens: auto;
	overflow-wrap: break-word;
	text-wrap: balance;
}
#content h1 {
	margin: 0.25rem 0 1.5rem;
	font-size: clamp(2.25rem, 1.5rem + 3.2vw, 3.6rem);
	font-weight: 750;
	line-height: 1.02;
	letter-spacing: -0.035em;
}
#content h2 {
	margin: 3rem 0 0.75rem;
	font-size: 1.6rem;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -0.02em;
}
#content h3 {
	margin: 2.25rem 0 0.5rem;
	font-size: 1.2rem;
	font-weight: 650;
	line-height: 1.3;
	letter-spacing: -0.01em;
}
#content h2 + h3 {
	margin-top: 1.25rem;
}
#content p,
#content ul,
#content ol {
	margin: 0 0 1.25rem;
}
#content h2 + p,
#content h3 + p,
#content h2 + ul,
#content h3 + ul {
	margin-top: 0;
}
#content ul,
#content ol {
	padding-left: 1.3rem;
}
#content li {
	margin-bottom: 0.6rem;
	line-height: 1.6;
	padding-left: 0.25rem;
}
#content li::marker {
	color: var(--accent);
}
#content strong,
#content b {
	font-weight: 650;
}
#content em,
#content i {
	font-style: italic;
}
#content hr {
	margin: 3rem auto;
	width: 4rem;
	height: 4px;
	border: none;
	border-radius: 2px;
	background: var(--aurora);
}
#content img {
	display: block;
	width: 100%;
	border-radius: 10px;
}
#content a {
	color: var(--text);
	text-decoration: underline;
	text-decoration-color: rgba(var(--accent-rgb),0.5);
	text-decoration-thickness: 0.09em;
	text-underline-offset: 0.2em;
	transition: color 0.15s, text-decoration-color 0.15s;
}
#content a:hover {
	color: var(--accent);
	text-decoration-color: currentColor;
}
/* Links around an image (e.g. a store badge): no underline, image at its own size */
#content a:has(> img) {
	text-decoration: none;
}
#content a:has(> img) img {
	width: auto;
	border-radius: 0;
}
#content code {
	padding: 0.1em 0.35em;
	border-radius: 5px;
	background: var(--code-bg);
	font-family: var(--font-mono);
	font-size: 0.86em;
}
#content pre {
	margin: 1.5rem 0;
	padding: 1rem 1.25rem;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--surface);
	overflow-x: auto;
	font-size: 0.85rem;
	line-height: 1.6;
	tab-size: 4;
}
#content pre code {
	padding: 0;
	background: none;
	font-size: inherit;
	white-space: pre;
}
#content blockquote {
	margin: 1.75rem 0;
	padding: 0.1rem 0 0.1rem 1.25rem;
	border-left: 3px solid var(--accent);
	color: var(--text-soft);
	font-style: italic;
	font-size: 1.1rem;
}
#content blockquote p:last-child {
	margin-bottom: 0;
}
#content table {
	width: 100%;
	margin: 1.5rem 0;
	border-collapse: collapse;
	font-size: 0.95rem;
}
#content th,
#content td {
	padding: 0.5rem 0.75rem 0.5rem 0;
	border-bottom: 1px solid var(--line);
	text-align: left;
	vertical-align: top;
}
#content th {
	font-weight: 650;
}
article {
	margin-bottom: 4rem;
}

/* ---------- Post head: date, tags, authorship ---------- */
#content .post-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem 1rem;
	margin: 0 0 0.75rem;
	font-family: var(--font-mono);
	font-size: 0.8rem;
	line-height: 1.5;
	color: var(--text-muted);
}
#content .tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
}
#content .tags a {
	padding: 0.15rem 0.6rem;
	border: 1px solid var(--line);
	border-radius: 999px;
	color: var(--text-muted);
	text-decoration: none;
}
#content .tags a:hover {
	border-color: var(--accent);
	color: var(--accent);
}
/* Title of the newest post on the front page links to the post: looks like the title */
#content h1 a.permalink {
	color: inherit;
	text-decoration: none;
}
#content h1 a.permalink:hover {
	text-decoration: underline;
	text-decoration-thickness: 0.06em;
	text-underline-offset: 0.12em;
	text-decoration-color: var(--accent);
}
/* Who wrote it: a card with a gradient edge and the KI mark, clearly visible above the title */
#content p.ai-notice {
	position: relative;
	display: flex;
	align-items: flex-start;
	gap: 0.75rem;
	margin: 1rem 0 2rem;
	padding: 0.8rem 1rem;
	border-radius: var(--radius);
	background: var(--surface);
	box-shadow: var(--shadow);
	font-size: 0.92rem;
	line-height: 1.55;
	color: var(--text-soft);
}
#content p.ai-notice::before {
	content: '';
	position: absolute;
	inset: 0;
	padding: 1.5px;
	border-radius: inherit;
	background: var(--aurora);
	-webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
	-webkit-mask-composite: xor;
	mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
	mask-composite: exclude;
	pointer-events: none;
}
.ai-mark {
	flex-shrink: 0;
	display: inline-grid;
	place-items: center;
	min-width: 2rem;
	height: 1.5rem;
	padding: 0 0.4rem;
	border-radius: 999px;
	background: var(--aurora);
	color: #fff;
	font-family: var(--font-mono);
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.04em;
}
/* Posts from the old blog: Manuel's original with Claude's assessment */
#content .archiv-notice {
	margin: 1rem 0 2.5rem;
	padding: 1rem 1.25rem;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--surface);
	font-size: 0.92rem;
	line-height: 1.6;
}
#content .archiv-notice p {
	margin: 0 0 0.6rem;
}
#content .archiv-notice p:last-child {
	margin-bottom: 0;
}

/* ---------- Lists of posts ---------- */
#content .list-header {
	margin-bottom: 2rem;
}
#content .kicker {
	margin: 0;
	font-family: var(--font-mono);
	font-size: 0.8rem;
	color: var(--accent);
}
#content .list-heading {
	margin-top: 4rem;
	padding-top: 2rem;
	border-top: 1px solid var(--line);
	font-family: var(--font-mono);
	font-size: 0.8rem;
	font-weight: 500;
	letter-spacing: 0.02em;
	color: var(--text-muted);
}
#content p.list-item {
	margin: 0;
	padding: 0.9rem 0;
	border-bottom: 1px solid var(--line);
	line-height: 1.35;
}
#content p.list-item:last-child {
	border-bottom: none;
}
#content .list-meta {
	display: inline-block;
	margin-bottom: 0.3rem;
	font-family: var(--font-mono);
	font-size: 0.75rem;
	color: var(--text-muted);
}
#content p.list-item > a {
	font-family: var(--font-display);
	font-size: 1.25rem;
	font-weight: 600;
	letter-spacing: -0.015em;
	text-decoration: none;
}
#content p.list-item > a:hover {
	color: var(--accent);
}
#content .badge {
	display: inline-block;
	margin-left: 0.4rem;
	padding: 0 0.45rem;
	border-radius: 999px;
	background: var(--accent-soft);
	color: var(--accent);
	font-family: var(--font-mono);
	font-size: 0.68rem;
	font-weight: 600;
	line-height: 1.6;
	vertical-align: 0.05em;
}
#content .badge-ai {
	background: var(--aurora);
	color: #fff;
}
#content .pagination {
	margin-top: 2.5rem;
}
#content .pagination p {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: center;
	font-family: var(--font-mono);
	font-size: 0.85rem;
}
#content .pagination a,
#content .pagination span {
	display: inline-block;
	min-width: 2.75rem;
	padding: 0.55rem 0.75rem;
	border: 1px solid var(--line);
	border-radius: 999px;
	text-align: center;
	text-decoration: none;
	line-height: 1.2;
}
#content .pagination a:hover {
	border-color: var(--accent);
}
#content .pagination span[aria-current] {
	border-color: transparent;
	background: var(--text);
	color: var(--bg);
	font-weight: 700;
}

/* ---------- Components ---------- */
/* Quote posts: the quote set large, the source quietly below */
#content .quote {
	margin: 2rem 0;
}
#content .quote blockquote {
	margin: 0;
	padding: 0;
	border: none;
	font-family: var(--font-display);
	font-style: normal;
	font-size: clamp(1.6rem, 1.2rem + 1.8vw, 2.4rem);
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: -0.02em;
	color: var(--text);
}
#content .quote blockquote::before {
	content: '«';
	display: block;
	margin-bottom: -0.2em;
	font-size: 2.5em;
	line-height: 1;
	background: var(--aurora);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}
#content .quote figcaption {
	margin-top: 1rem;
	font-family: var(--font-mono);
	font-size: 0.85rem;
	color: var(--text-muted);
}
/* Link posts: the title leads to the linked page, its domain small below */
#content .link-post h1 a {
	text-decoration: none;
}
#content .link-post h1 a:hover {
	color: var(--accent);
}
#content .link-arrow {
	font-size: 0.7em;
	color: var(--accent);
}
#content .link-domain,
#content .list-domain {
	font-family: var(--font-mono);
	font-size: 0.8rem;
	color: var(--text-muted);
}
#content .link-domain {
	margin-top: -0.5rem;
}
/* Image with caption (engine 0.6.6) */
#content figure:not(.gedicht):not(.quote) {
	margin: 2rem 0;
}
#content figure:not(.gedicht):not(.quote) figcaption {
	margin-top: 0.6rem;
	font-size: 0.85rem;
	line-height: 1.45;
	color: var(--text-muted);
}
/* Poems: each verse on its own line, short lines indented, long lines wrap with a hanging indent.
   The <br> between verses keeps the lines apart in the feed and is hidden here */
#content figure.gedicht {
	margin: 1.5rem 0 2.5rem;
	padding: 1.25rem 1.5rem;
	border-radius: var(--radius);
	background: var(--surface);
	box-shadow: var(--shadow);
}
#content figure.gedicht figcaption {
	margin-bottom: 0.6rem;
	font-family: var(--font-display);
	font-size: 1.25rem;
	font-weight: 650;
	line-height: 1.3;
}
#content figure.gedicht p {
	margin: 0;
	line-height: 1.6;
	hyphens: manual;
}
#content figure.gedicht br {
	display: none;
}
#content figure.gedicht .vers {
	display: block;
	padding-left: 1.5em;
	text-indent: -1.5em;
}
#content figure.gedicht .vers.einzug {
	padding-left: 3em;
}
/* Later addition to a post («Update, <date>») */
#content .update {
	margin: 3rem 0 2rem;
	padding: 1.25rem 1.5rem;
	border: 1px solid rgba(var(--accent-rgb),0.35);
	border-radius: var(--radius);
	background: var(--surface);
	box-shadow: var(--shadow);
}
#content .update p {
	margin: 0 0 0.75rem;
}
#content .update p:last-child {
	margin-bottom: 0;
}
#content .update p.update-label {
	font-family: var(--font-mono);
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--accent);
}
/* Embedded Bluesky post: a card until the reader loads it (scripts/bluesky.js) */
#content .bluesky-embed {
	margin: 2rem 0;
	padding: 1.25rem 1.5rem;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--surface);
	box-shadow: var(--shadow);
}
#content .bluesky-embed p {
	margin: 0;
}
#content .bluesky-embed a {
	text-decoration: none;
}
#content .bluesky-embed-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
	color: inherit;
}
#content .bluesky-embed-who {
	display: flex;
	flex-direction: column;
	min-width: 0;
}
#content .bluesky-embed-author {
	font-weight: 650;
	font-size: 1.05rem;
	line-height: 1.4;
}
#content .bluesky-embed-handle {
	font-size: 0.9rem;
	line-height: 1.5;
	color: var(--text-muted);
	overflow-wrap: anywhere;
}
#content .bluesky-embed-source {
	flex-shrink: 0;
	font-family: var(--font-mono);
	font-size: 0.72rem;
	color: var(--accent);
	line-height: 2;
}
#content a.bluesky-embed-head:hover {
	color: inherit;
}
#content a.bluesky-embed-head:hover .bluesky-embed-author {
	text-decoration: underline;
}
#content .bluesky-embed-foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem 1rem;
	margin-top: 1.25rem;
	padding-top: 1.25rem;
	border-top: 1px solid var(--line);
}
#content .bluesky-embed button {
	font: inherit;
	font-size: 0.92rem;
	font-weight: 600;
	padding: 0.5rem 1.1rem;
	border: none;
	border-radius: 999px;
	background: var(--text);
	color: var(--bg);
	cursor: pointer;
}
#content .bluesky-embed button:hover {
	background: var(--accent);
	color: var(--on-accent);
}
#content .bluesky-embed-note {
	flex: 1 1 14rem;
	font-size: 0.8rem;
	line-height: 1.5;
	color: var(--text-muted);
}
#content .bluesky-embed--loaded {
	padding: 0;
	border: none;
	background: none;
	box-shadow: none;
}
#content .bluesky-embed iframe {
	display: block;
	width: 100%;
	min-height: 200px;
	border: none;
}
/* Statistics above the change log */
#content .change-stats {
	margin: 2rem 0 2.5rem;
}
#content .change-stats dl {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
	gap: 0.75rem;
	margin: 0;
}
#content .change-stats dl > div {
	padding: 0.9rem 1rem;
	border-radius: var(--radius);
	background: var(--surface);
	box-shadow: var(--shadow);
}
#content .change-stats dt {
	font-family: var(--font-mono);
	font-size: 0.72rem;
	color: var(--text-muted);
}
#content .change-stats dd {
	margin: 0.2rem 0 0;
	font-family: var(--font-display);
	font-size: 2rem;
	font-weight: 750;
	line-height: 1.1;
	letter-spacing: -0.02em;
}

/* ---------- Lightbox (scripts/lightbox.js) ---------- */
#content img.zoomable {
	cursor: zoom-in;
}
html.lightbox-open {
	overflow: hidden;
}
dialog.lightbox {
	width: 100vw;
	height: 100dvh;
	max-width: none;
	max-height: none;
	margin: 0;
	padding: 3rem 1rem 1.5rem;
	border: none;
	background: #090a0e;
	color: #e3e5ec;
	cursor: zoom-out;
}
dialog.lightbox::backdrop {
	background: #090a0e;
}
dialog.lightbox[open] {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	animation: lightbox-in 0.18s ease-out;
}
@keyframes lightbox-in {
	from { opacity: 0; }
}
dialog.lightbox [hidden] {
	display: none;
}
dialog.lightbox figure {
	display: flex;
	flex-direction: column;
	align-items: center;
	min-height: 0;
	max-width: 100%;
	margin: 0;
}
dialog.lightbox img {
	display: block;
	min-height: 0;
	max-width: 100%;
	max-height: calc(100dvh - 8rem);
	object-fit: contain;
	filter: none;
}
dialog.lightbox figcaption {
	max-width: 40rem;
	margin-top: 0.9rem;
	font-size: 0.875rem;
	line-height: 1.45;
	color: #b9bdca;
}
dialog.lightbox .lightbox-counter {
	position: absolute;
	top: 1rem;
	left: 1rem;
	margin: 0;
	font-family: var(--font-mono);
	font-size: 0.75rem;
	color: #9a9fae;
}
dialog.lightbox button {
	position: absolute;
	width: 3rem;
	height: 3rem;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: rgba(255,255,255,0.08);
	color: #f2f3f7;
	font: inherit;
	font-size: 1.75rem;
	line-height: 1;
	cursor: pointer;
}
dialog.lightbox button:hover,
dialog.lightbox button:focus-visible {
	background: rgba(255,255,255,0.2);
}
dialog.lightbox button:focus-visible {
	outline: 2px solid #a99bff;
	outline-offset: 2px;
}
dialog.lightbox .lightbox-close {
	top: 0.5rem;
	right: 0.5rem;
}
dialog.lightbox .lightbox-prev,
dialog.lightbox .lightbox-next {
	top: 50%;
	transform: translateY(-50%);
}
dialog.lightbox .lightbox-prev {
	left: 0.5rem;
}
dialog.lightbox .lightbox-next {
	right: 0.5rem;
}
@media (max-width: 599px) {
	dialog.lightbox .lightbox-prev,
	dialog.lightbox .lightbox-next {
		top: auto;
		bottom: 0.5rem;
		transform: none;
	}
	dialog.lightbox {
		padding-bottom: 4rem;
	}
}

/* ---------- Motion and print ---------- */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation: none !important;
		transition: none !important;
	}
}
@media print {
	body {
		background: #fff;
		color: #000;
		font-size: 11pt;
	}
	.topbar,
	.sidebar,
	.skip-link {
		display: none;
	}
	.page {
		display: block;
	}
	#content {
		max-width: none;
		padding: 0;
	}
	#content a[href^="http"]::after {
		content: ' (' attr(href) ')';
		font-size: 0.8em;
		color: #555;
		overflow-wrap: anywhere;
	}
	#content p.ai-notice,
	#content .update,
	#content figure.gedicht {
		box-shadow: none;
		border: 1px solid #999;
	}
}
