/*
 * Public store pages (store.kilanka.de): catalogue, detail, errors.
 *
 * Kilanka brand rules (brand review of 23 September 2026):
 * - Colours: Kilanka grey #323232 for text and filled controls, Kilanka green #04e676 as a
 *   line (title bar, underline, tick), background grey #f7f7f7 for quiet surfaces, white as
 *   the page. Loosened on 5 November 2026 (as in the review area): a soft tint of the green
 *   with a dark green text marks small states (Neu, chosen filter, areas), never a full fill.
 * - Lato Light (300) for headings, Regular (400) for text, Bold (700) for emphasis.
 * - The official logo file only; nothing tilted, no decorative effects.
 *
 * The pages run under a strict CSP (no inline styles or inline scripts), so all styles live
 * here and only the optional static detail-gallery lightbox script is loaded from /static/.
 */

/* ---------- fonts (self-hosted, SIL Open Font License, fonts/LICENSE-OFL.txt) ---------- */

@font-face {
	font-family: Lato;
	font-weight: 300;
	font-style: normal;

	font-display: swap;
	src: url("fonts/Lato-Light.woff2") format("woff2");
}

@font-face {
	font-family: Lato;
	font-weight: 400;
	font-style: normal;

	font-display: swap;
	src: url("fonts/Lato-Regular.woff2") format("woff2");
}

@font-face {
	font-family: Lato;
	font-weight: 700;
	font-style: normal;

	font-display: swap;
	src: url("fonts/Lato-Bold.woff2") format("woff2");
}

/* ---------- tokens ---------- */

:root {
	--ink: #323232;
	--ink-hover: #474747;
	--green: #04e676;
	/* Soft tint of the green and a dark green that reads on it and on white (contrast > 7:1). */
	--tint: oklch(96.5% 0.04 152deg);
	--tint-ink: oklch(38% 0.1 152deg);
	--grey: #f7f7f7;
	--paper: #fff;
	--muted: rgb(50 50 50 / 72%);
	--line: rgb(50 50 50 / 12%);
	--line-strong: rgb(50 50 50 / 30%);
	--on-dark: #fff;
	--on-dark-muted: rgb(255 255 255 / 80%);
	--on-dark-line: rgb(255 255 255 / 35%);
	--radius: 14px;
	--gutter: 1rem;

	/* Replicated www.kilanka.de chrome tokens (kilanka-website tailwind.config.js and _base.scss). */
	--site-dark: #424242;
	--site-green: #00e676;
	--site-unit: 1rem;

	/* Crisp UI motion tokens (strong ease-out for entering/exiting and interactive feedback). */
	--ease-out: cubic-bezier(0.23, 1, 0.32, 1);

	color-scheme: light;
}

@media (prefers-reduced-motion: no-preference) {
	@view-transition {
		navigation: auto;
	}

	::view-transition-old(root),
	::view-transition-new(root) {
		animation-duration: 220ms;
		animation-timing-function: var(--ease-out);
	}
}

@media (width >= 40rem) {
	:root {
		--gutter: 2rem;
	}
}

/* Matches kilanka-website's responsive root scale without altering the store body typography. */
@media (width >= 48rem) {
	:root {
		--site-unit: 0.8rem;
	}
}

@media (width >= 64rem) {
	:root {
		--site-unit: 0.75rem;
	}
}

@media (width >= 96rem) {
	:root {
		--site-unit: 0.85rem;
	}
}

@media (width >= 113.125rem) {
	:root {
		--site-unit: 0.9rem;
	}
}

@media (width >= 120rem) {
	:root {
		--site-unit: 1rem;
	}
}

/* ---------- base ---------- */

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

html {
	text-size-adjust: 100%;
}

body {
	display: flex;
	flex-direction: column;
	min-height: 100dvh;
	margin: 0;

	font-family: Lato, system-ui, sans-serif;
	font-size: 1.0625rem;
	line-height: 1.6;
	color: var(--ink);

	background: var(--paper);

	-webkit-font-smoothing: antialiased;
}

main {
	flex: 1 0 auto;
}

#inhalt {
	scroll-margin-top: 5.5rem;
}

h1,
h2,
h3,
p,
figure,
dl,
dd {
	margin: 0;
}

img {
	display: block;
	max-width: 100%;
	height: auto;
}

a {
	color: inherit;
}

:focus-visible {
	outline: 2px solid var(--ink);
	outline-offset: 2px;
}

.site-header :focus-visible,
.site-footer :focus-visible {
	outline-color: var(--on-dark);
}

.visually-hidden {
	position: absolute;

	overflow: hidden;

	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	border: 0;

	white-space: nowrap;

	clip-path: inset(50%);
}

.skip {
	position: absolute;
	z-index: 60;
	top: 0.5rem;
	left: 0.5rem;
	transform: translateY(-200%);

	padding: 0.5rem 1rem;
	border-radius: 999px;

	font-weight: 700;
	color: var(--paper);

	background: var(--ink);

	&:focus {
		transform: none;
	}

	&:focus-visible {
		outline-color: var(--on-dark);
	}
}

.wrap {
	width: 100%;
	max-width: 76rem;
	margin-inline: auto;
	padding-inline: var(--gutter);
}

.muted {
	color: var(--muted);
}

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

/* The brand's title card: light heading with a green bar on the left. */
.title-card {
	padding-left: 1.125rem;
	border-left: 4px solid var(--green);

	font-size: clamp(2rem, 1.4rem + 2.6vw, 3rem);
	font-weight: 300;
	line-height: 1.12;
}

.title-card-small {
	font-size: clamp(1.75rem, 1.4rem + 1.4vw, 2.25rem);
}

.subheading {
	font-size: 1.75rem;
	font-weight: 400;
	line-height: 1.2;
}

.eyebrow {
	font-size: 0.8125rem;
	font-weight: 700;
	color: var(--tint-ink);
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

.meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 1rem;
	align-items: center;

	font-size: 0.9375rem;
	color: var(--muted);
}

.publisher {
	display: inline-flex;
	gap: 0.375rem;
	align-items: center;

	font-weight: 700;
	color: var(--ink);
}

/* The brand's tick: a green line, never a filled badge. */
.tick {
	flex: none;

	width: 1em;
	height: 1em;

	fill: none;
	stroke: var(--green);
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 2.2;
}

.stars {
	color: var(--ink);
	letter-spacing: 0.08em;
}

.stars-count {
	color: var(--muted);
	letter-spacing: 0;
}

.new {
	display: inline-block;

	padding: 0.0625rem 0.5rem;
	border-radius: 999px;

	font-size: 0.75rem;
	font-weight: 700;
	color: var(--tint-ink);
	text-transform: uppercase;
	letter-spacing: 0.04em;
	vertical-align: 0.2em;

	background: var(--tint);
}

.text-link {
	font-weight: 700;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}

/* ---------- buttons ---------- */

/*
 * As on kilanka.de (buttons.scss of the website): a rounded frame instead of a fill. The
 * main action has the green frame and the arrow in front, which moves along on hover;
 * .button-quiet is a secondary action with a grey frame. Green stays a line.
 */
.button {
	cursor: pointer;

	display: inline-flex;
	align-items: center;
	justify-content: center;

	min-height: 2.75rem;
	padding: 0 1.25rem;
	border: 0.125rem solid var(--green);
	border-radius: 0.75rem;

	font: inherit;
	font-weight: 700;
	color: var(--ink);
	text-decoration: none;

	background: transparent;

	transition: background-color 0.12s ease-out;

	/* The arrow: two sides of a square, turned to point right, right before the text. */
	&::before {
		content: "";

		flex: none;

		width: 0.5rem;
		height: 0.5rem;
		margin-right: 0.625rem;
		border: solid currentcolor;
		border-width: 0 2px 2px 0;

		transform: rotate(-45deg);

		transition: transform 0.12s ease-out;
	}

	&:hover {
		background: var(--grey);

		&::before {
			transform: translateX(0.1875rem) rotate(-45deg);
		}
	}

	@media (prefers-reduced-motion: reduce) {
		&,
		&::before {
			transition: none;
		}
	}
}

.button-quiet {
	border-color: var(--line-strong);

	&::before {
		display: none;
	}
}

/* ---------- replicated www.kilanka.de header ---------- */

/* Matches kilanka-website wrapper.scss so logo and nav align identically on navigation. */
.site-wrap {
	width: 100%;
	margin-inline: auto;
	padding-inline: calc(1 * var(--site-unit));

	@media (width >= 48rem) {
		padding-inline: calc(3.5 * var(--site-unit));
	}

	@media (width >= 64rem) {
		padding-inline: calc(1 * var(--site-unit));
	}

	@media (width >= 73.75rem) {
		padding-inline: calc(4 * var(--site-unit));
	}

	@media (width >= 80rem) {
		padding-inline: calc(64px + 93.6 * ((100vw - 1280px) / 256));
	}

	@media (width >= 96rem) {
		max-width: calc(114 * var(--site-unit));
		padding-inline: calc(9 * var(--site-unit));
	}
}

.site-header {
	position: sticky;
	z-index: 50;
	inset-block-start: 0;

	color: var(--on-dark);
	background: var(--site-dark);
	border-block-end: 1px solid rgb(255 255 255 / 10%);

	@media (forced-colors: active) {
		border-block-end: 1px solid CanvasText;
	}
}

.site-header-inner {
	display: flex;
	gap: calc(1 * var(--site-unit));
	align-items: center;
	justify-content: space-between;
}

.site-brand {
	display: inline-flex;
	flex: none;
	align-items: center;
	padding-block: calc(1.25 * var(--site-unit));
	text-decoration: none;
}

.site-brand-mark,
.site-brand-wordmark {
	width: auto;
	height: calc(1.5 * var(--site-unit));

	@media (width >= 80rem) {
		height: calc(2.5 * var(--site-unit));
	}
}

.site-brand-mark {
	margin-inline-end: calc(0.5 * var(--site-unit));

	@media (width >= 80rem) {
		margin-inline-end: calc(0.75 * var(--site-unit));
	}
}

.site-nav {
	display: flex;
	align-items: center;
}

.site-nav-list {
	display: none;
	align-items: center;
	margin: 0;
	padding: 0;
	list-style: none;

	@media (width >= 64rem) {
		display: flex;
	}
}

.site-nav-link {
	display: inline-flex;
	flex-direction: column;

	padding-block: calc(1.25 * var(--site-unit));
	padding-inline: calc(0.75 * var(--site-unit));

	font-size: calc(1.25 * var(--site-unit));
	font-weight: 300;
	line-height: calc(1.75 * var(--site-unit));
	color: var(--on-dark);
	text-transform: uppercase;
	text-decoration: none;
	white-space: nowrap;

	transition: color 0.3s ease;

	&:hover {
		color: var(--site-green);
	}

	&[aria-current="page"] {
		font-weight: 400;
		color: var(--site-green);

		@media (forced-colors: active) {
			text-decoration: underline;
			text-underline-offset: 0.25em;
		}
	}

	/* Reserve regular-weight width to prevent layout shift if an item becomes active. */
	&::after {
		content: attr(data-text);
		content: attr(data-text) / "";
		height: 0;
		font-weight: 400;
		text-transform: uppercase;
		visibility: hidden;
		user-select: none;
		pointer-events: none;
	}

	@media (prefers-reduced-motion: reduce) {
		transition: none;
	}
}

.site-menu-toggle,
.site-menu-close {
	cursor: pointer;

	display: inline-flex;
	align-items: center;
	justify-content: center;

	min-width: 2.75rem;
	min-height: 2.75rem;
	margin-inline-end: -0.5rem;
	padding: 0;
	border: 0;

	color: var(--on-dark);
	background: transparent;
}

.site-menu-toggle {
	@media (width >= 64rem) {
		display: none;
	}
}

.site-menu-icon {
	width: 1.5rem;
	height: 1.5rem;

	fill: none;
	stroke: currentcolor;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 2;
}

/* Mobile navigation popover: works without JavaScript under the strict script-free CSP. */
.site-mobile-menu {
	position: fixed;
	inset: auto;
	inset-block-start: 0;
	inset-inline: 0;

	inline-size: 100%;
	max-inline-size: none;
	max-block-size: 100dvh;
	margin: 0;
	padding: 0;
	border: 0;
	border-block-end: 1px solid rgb(255 255 255 / 12%);
	overflow-y: auto;

	color: var(--on-dark);
	background: var(--site-dark);
	box-shadow: 0 12px 32px rgb(0 0 0 / 28%);

	opacity: 0;
	translate: 0 -0.5rem;
	transition:
		opacity 0.2s ease-out,
		translate 0.2s ease-out,
		overlay 0.2s ease-out,
		display 0.2s ease-out;
	transition-behavior: allow-discrete;

	&::backdrop {
		background: rgb(0 0 0 / 40%);
		opacity: 0;
		transition:
			opacity 0.2s ease-out,
			overlay 0.2s ease-out,
			display 0.2s ease-out;
		transition-behavior: allow-discrete;
	}

	&:popover-open {
		opacity: 1;
		translate: 0 0;

		&::backdrop {
			opacity: 1;
		}

		@starting-style {
			opacity: 0;
			translate: 0 -0.5rem;

			&::backdrop {
				opacity: 0;
			}
		}
	}

	@media (prefers-reduced-motion: reduce) {
		transition: none;

		&::backdrop {
			transition: none;
		}
	}

	@media (forced-colors: active) {
		border-block-end: 1px solid CanvasText;
	}

	@media (width >= 64rem) {
		display: none;
	}
}

.site-mobile-menu-inner {
	padding-block-end: calc(2.5 * var(--site-unit));
}

.site-mobile-menu-head {
	display: flex;
	gap: calc(1 * var(--site-unit));
	align-items: center;
	justify-content: space-between;
	margin-block-end: calc(1 * var(--site-unit));
}

.site-mobile-menu-list {
	margin: 0;
	padding: 0;
	list-style: none;

	@media (width >= 48rem) {
		display: flex;
		flex-wrap: wrap;
		gap: calc(0.25 * var(--site-unit)) calc(1.25 * var(--site-unit));
	}
}

.site-mobile-menu-link {
	display: flex;
	align-items: center;
	min-height: 2.75rem;
	padding-block: calc(0.375 * var(--site-unit));

	font-size: calc(1.25 * var(--site-unit));
	font-weight: 300;
	line-height: 1.5;
	color: var(--on-dark);
	text-transform: uppercase;
	text-decoration: none;

	transition: color 0.3s ease;

	&:hover {
		color: var(--site-green);
	}

	&[aria-current="page"] {
		font-weight: 400;
		color: var(--site-green);

		@media (forced-colors: active) {
			text-decoration: underline;
			text-underline-offset: 0.25em;
		}
	}

	@media (prefers-reduced-motion: reduce) {
		transition: none;
	}
}

/* Fallback for browsers without Popover API support: avoid an invisible click-stealing
   overlay and keep navigation reachable as a horizontal scrolling row. */
@supports not selector(:popover-open) {
	.site-menu-toggle,
	.site-mobile-menu {
		display: none;
	}

	.site-header-inner {
		flex-wrap: wrap;
	}

	.site-nav {
		max-width: 100%;
		overflow-x: auto;
	}

	.site-nav-list {
		display: flex;
	}
}

/* ---------- light store headers: StoreHeader + Spotlight (mirrors internal console) ---------- */

.store-hero-band {
	padding: 1.5rem 0 2rem;
	border-bottom: 1px solid var(--line);
	background: var(--grey);

	@media (width >= 48rem) {
		padding: 2rem 0 2.5rem;
	}
}

.store-hero {
	display: grid;
	gap: 1.75rem;
}

.store-head {
	isolation: isolate;
	position: relative;

	/* clip, not hidden: scrolling an image into view must not shift the head sideways. */
	overflow: clip;
	display: grid;
	align-items: center;

	min-height: 19rem;
	border: 1px solid var(--line);
	border-radius: 18px;

	background: var(--paper);
}

.store-head-text {
	position: relative;
	z-index: 2;

	display: grid;
	gap: 1rem;

	max-width: 26rem;
	padding: 2rem 2.5rem;
}

.store-head-title {
	margin: 0;
}

.store-head-logo {
	display: block;
	width: auto;
	height: 58px;
}

.store-head-claim {
	max-width: 22ch;
	font-size: 1.25rem;
	font-weight: 700;
	line-height: 1.3;
	color: var(--ink);
	text-wrap: balance;
}

.store-floor {
	position: absolute;
	z-index: 1;
	inset: 0;

	perspective: 1100px;
	perspective-origin: 70% -20%;

	/* Fade out under the text, towards the back and to the edges. */
	&::after {
		pointer-events: none;
		content: "";

		position: absolute;
		inset: 0;

		background:
			linear-gradient(
				90deg,
				var(--paper) 0%,
				var(--paper) 30%,
				rgb(255 255 255 / 80%) 40%,
				rgb(255 255 255 / 0%) 56%
			),
			linear-gradient(180deg, rgb(255 255 255 / 70%) 0%, rgb(255 255 255 / 0%) 26%),
			linear-gradient(0deg, rgb(255 255 255 / 60%) 0%, rgb(255 255 255 / 0%) 18%),
			linear-gradient(270deg, rgb(255 255 255 / 55%) 0%, rgb(255 255 255 / 0%) 12%);
	}
}

.store-plane {
	position: absolute;
	top: -14%;
	left: 30%;
	transform-origin: 30% 0;
	transform-style: preserve-3d;
	transform: rotateX(54deg) rotateZ(-24deg);

	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 18px;

	width: 92%;
}

.store-tile {
	cursor: default;

	overflow: hidden;
	display: block;

	aspect-ratio: 1500 / 940;
	border-radius: 9px;

	background: var(--paper);
	box-shadow:
		0 0 0 1px var(--line),
		0 16px 22px -14px rgb(30 40 35 / 35%);

	transition:
		transform 0.25s cubic-bezier(0.2, 0.7, 0.2, 1),
		box-shadow 0.25s cubic-bezier(0.2, 0.7, 0.2, 1);

	img {
		display: block;
		width: 100%;
		height: 100%;
		object-fit: cover;
		object-position: top left;
	}

	&[data-highlight] {
		box-shadow:
			0 0 0 2px var(--green),
			0 22px 30px -14px rgb(30 40 35 / 42%);
	}

	/* Only tiles with a screenshot respond to the pointer; empty ones stay quiet. */
	&:has(img):hover {
		transform: translateZ(22px);
		box-shadow:
			0 0 0 2px var(--green),
			0 34px 40px -18px rgb(30 40 35 / 48%);
	}
}

@media (width < 40rem) {
	.store-head {
		align-items: start;
		min-height: 0;
	}

	.store-head-text {
		max-width: none;
		padding: 1.5rem 1.25rem 14.5rem;
	}

	.store-head-logo {
		height: 46px;
	}

	.store-floor {
		top: auto;
		bottom: 0;
		height: 14rem;
		perspective-origin: 50% -30%;

		&::after {
			background:
				linear-gradient(180deg, var(--paper) 0%, rgb(255 255 255 / 0%) 22%),
				linear-gradient(0deg, rgb(255 255 255 / 60%) 0%, rgb(255 255 255 / 0%) 20%);
		}
	}

	.store-plane {
		top: 6%;
		left: -10%;
		gap: 12px;
		width: 150%;
	}
}

.spotlight {
	position: relative;

	overflow: hidden;
	display: grid;
	grid-template-columns: minmax(0, 1fr);

	border: 1px solid var(--line);
	border-radius: 12px;

	background: var(--paper);

	transition:
		border-color 180ms var(--ease-out),
		box-shadow 220ms var(--ease-out),
		transform 140ms var(--ease-out);

	&:hover,
	&:has(a:focus-visible) {
		border-color: var(--green);
		box-shadow: 0 12px 30px -16px var(--line-strong);
	}

	&:has(a:focus-visible) {
		outline: 2px solid var(--ink);
		outline-offset: 3px;
	}

	@media (prefers-reduced-motion: no-preference) {
		&:active {
			transform: scale(0.994);
		}
	}

	@media (width >= 48rem) {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
	}
}

.spotlight-text {
	display: grid;
	gap: 1.25rem;
	align-content: center;
	padding: 1.5rem;

	@media (width >= 48rem) {
		padding: 2rem 2.5rem;
	}
}

.spotlight-head {
	display: grid;
	gap: 0.375rem;
}

.spotlight-eyebrow {
	color: var(--tint-ink);
}

.spotlight-title {
	font-size: clamp(1.5rem, 1.2rem + 1vw, 1.875rem);
	font-weight: 700;
	line-height: 1.2;
}

/* Stretches over the whole spotlight card so clicking anywhere (including the image) opens details. */
.cover-link {
	color: inherit;
	text-decoration: none;

	&::after {
		content: "";
		position: absolute;
		z-index: 0;
		inset: 0;
		border-radius: inherit;
	}

	&:focus-visible {
		outline: none;
	}
}

.spotlight-lead {
	overflow: hidden;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 4;

	max-width: 34rem;
	color: var(--muted);
}

.spotlight-categories {
	display: flex;
	flex-wrap: wrap;
	gap: 0.375rem;

	margin: 0;
	padding: 0;

	list-style: none;

	li {
		padding: 0.25rem 0.75rem;
		border-radius: 999px;
		font-size: 0.875rem;
		color: var(--tint-ink);
		background: var(--tint);
	}
}

.spotlight-shot {
	overflow: hidden;
	border-top: 1px solid var(--line);
	background: var(--paper);

	@media (width >= 48rem) {
		border-top: 0;
		border-left: 1px solid var(--line);
	}

	img {
		display: block;
		aspect-ratio: 1500 / 940;
		width: 100%;
		height: 100%;
		object-fit: cover;
		object-position: top center;
		transition: transform 240ms var(--ease-out);
	}
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
	.spotlight:hover .spotlight-shot img {
		transform: scale(1.02);
	}
}

@media (prefers-reduced-motion: reduce) {
	.store-tile,
	.spotlight,
	.spotlight-shot img {
		transition: none;
	}
}

/* ---------- catalogue list ---------- */

.section {
	padding-top: 2.75rem;
	padding-bottom: 4rem;
}

.section-head {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem 1.5rem;
	align-items: center;
	justify-content: space-between;
}

.section-head-title {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.25rem;
	align-items: baseline;
}

.search {
	display: flex;
	flex: 0 1 24rem;
	gap: 0.5rem;
	align-items: center;

	min-height: 2.75rem;
	padding: 0.25rem 0.25rem 0.25rem 0.875rem;
	border-radius: 0.625rem;

	background: var(--paper);
	box-shadow: inset 0 0 0 1px var(--line-strong);

	input {
		flex: 1;

		min-width: 0;
		padding: 0.375rem 0;
		border: 0;

		font: inherit;
		font-size: 0.9375rem;
		color: var(--ink);

		background: transparent;
		outline: none;
	}

	button {
		cursor: pointer;

		min-height: 2.25rem;
		padding: 0 0.9375rem;
		border: 0;
		border-radius: 0.4375rem;

		font: inherit;
		font-size: 0.9375rem;
		font-weight: 700;
		color: var(--ink);

		background: var(--grey);

		transition:
			background-color 0.12s ease-out,
			color 0.12s ease-out;

		&:hover {
			color: var(--tint-ink);
			background: var(--tint);
		}
	}

	&:focus-within {
		box-shadow: inset 0 0 0 2px var(--ink);
	}
}

.search-icon {
	flex: none;
	width: 1rem;
	height: 1rem;

	fill: none;
	stroke: var(--muted);
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 2;
}

.filters {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 1.25rem;
}

.filter {
	display: inline-flex;
	align-items: center;

	min-height: 2.25rem;
	padding: 0 0.875rem;
	border-radius: 999px;

	font-size: 0.9375rem;
	text-decoration: none;

	box-shadow: inset 0 0 0 1px var(--line-strong);

	&[aria-current="page"] {
		font-weight: 700;
		color: var(--tint-ink);
		background: var(--tint);
		box-shadow: inset 0 0 0 0.125rem var(--green);
	}

	&:hover:not([aria-current="page"]) {
		background: var(--grey);
	}
}

.lines {
	margin: 1.5rem 0 0;
	padding: 0;
	border-top: 1px solid var(--line);
	list-style: none;
}

.line {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 1rem;
	align-items: start;

	padding: 1.5rem 0;
	border-bottom: 1px solid var(--line);

	@media (width >= 48rem) {
		grid-template-columns: minmax(0, 1fr) 16rem;
		gap: 2rem;
		align-items: center;
	}

	@media (width >= 64rem) {
		grid-template-columns: minmax(0, 1fr) 20rem;
	}
}

.line-text {
	display: grid;
	gap: 0.375rem;
	min-width: 0;
}

.line-title {
	font-size: 1.375rem;
	font-weight: 700;
	line-height: 1.25;

	a {
		text-decoration: none;

		&:hover {
			text-decoration: underline;
			text-decoration-thickness: 1px;
			text-underline-offset: 0.2em;
		}
	}
}

.line-teaser {
	max-width: 64ch;
	color: var(--muted);
}

.line-shot {
	display: none;
	overflow: hidden;
	border-radius: 8px;

	img {
		display: block;
		aspect-ratio: 1500 / 940;
		width: 100%;

		object-fit: cover;
		object-position: top left;
	}

	@media (width >= 48rem) {
		display: block;
	}
}

a.line-shot {
	box-shadow: 0 0 0 1px var(--line);
	transition:
		box-shadow 180ms var(--ease-out),
		transform 140ms var(--ease-out);

	img {
		transition: transform 220ms var(--ease-out);
	}

	&:hover {
		box-shadow:
			0 0 0 2px var(--green),
			0 12px 26px -14px var(--line-strong);
	}

	@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
		&:hover img {
			transform: scale(1.025);
		}
	}

	@media (prefers-reduced-motion: no-preference) {
		&:active {
			transform: scale(0.985);
		}
	}

	@media (prefers-reduced-motion: reduce) {
		transition: none;

		img {
			transition: none;
		}
	}
}

.empty {
	display: grid;
	gap: 1rem;
	justify-items: start;
	padding: 2rem 0;
}

.pager {
	display: flex;
	align-items: center;
	justify-content: space-between;

	margin-top: 2rem;

	color: var(--muted);
}

/* ---------- Kilanka Studio ---------- */

.studio {
	padding: 4rem 0;
	border-top: 1px solid var(--line);
	background: var(--grey);
}

.studio-text {
	max-width: 70ch;
	margin-top: 1.25rem;
	font-size: 1.125rem;
	color: var(--muted);
}

.steps {
	display: grid;
	gap: 2rem;

	margin: 2.5rem 0 0;
	padding: 0;

	list-style: none;

	li {
		display: grid;
		gap: 0.375rem;
		align-content: start;

		padding-top: 1rem;
		border-top: 4px solid var(--green);
	}

	h3 {
		font-size: 1.125rem;
		font-weight: 700;
	}

	p {
		color: var(--muted);
	}

	@media (width >= 48rem) {
		grid-template-columns: repeat(3, 1fr);
		gap: 2.5rem;
	}
}

/* ---------- detail ---------- */

.detail-head {
	border-bottom: 1px solid var(--line);
	background: var(--grey);
}

.detail-hero {
	display: grid;
	gap: 0.75rem;
	padding-top: 2rem;
	padding-bottom: 2.25rem;

	h1 {
		font-size: clamp(1.75rem, 1.35rem + 1.5vw, 2.375rem);
		font-weight: 400;
		line-height: 1.15;
	}
}

.detail-title-row {
	display: flex;
	gap: 1rem;
	align-items: center;
}

.detail-title-group {
	display: grid;
	gap: 0.25rem;
	min-width: 0;
}

.detail-meta {
	@media (width >= 40rem) {
		padding-left: 3.5rem;
	}
}

.back-round,
.round-btn {
	cursor: pointer;

	display: inline-grid;
	flex: none;
	place-items: center;

	width: 2.5rem;
	height: 2.5rem;
	padding: 0;
	border: 1px solid var(--line-strong);
	border-radius: 50%;

	color: var(--ink);
	text-decoration: none;

	background: var(--paper);

	transition:
		background-color 140ms var(--ease-out),
		border-color 140ms var(--ease-out),
		transform 120ms var(--ease-out);

	svg {
		width: 1.125rem;
		height: 1.125rem;
		fill: none;
		stroke: currentcolor;
		stroke-linecap: round;
		stroke-linejoin: round;
		stroke-width: 2;
	}

	&:hover {
		border-color: var(--green);
		background: var(--tint);
	}

	@media (prefers-reduced-motion: no-preference) {
		&:active {
			transform: scale(0.94);
		}
	}

	@media (prefers-reduced-motion: reduce) {
		transition: none;
	}
}

.detail {
	display: grid;
	gap: 3.5rem;
	padding-top: 2.5rem;
	padding-bottom: 4rem;
}

.gallery {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 1rem;

	figcaption {
		margin-top: 0.5rem;
		font-size: 0.875rem;
		color: var(--muted);
	}
}

.gallery-main {
	grid-column: 1 / -1;
}

.gallery-trigger {
	cursor: zoom-in;

	position: relative;

	overflow: hidden;
	display: block;

	width: 100%;
	padding: 0;
	border: 0;
	border-radius: 10px;

	text-align: left;

	background: var(--paper);
	box-shadow: 0 0 0 1px var(--line);

	transition:
		box-shadow 180ms var(--ease-out),
		transform 140ms var(--ease-out);

	img {
		display: block;
		width: 100%;
		transition: transform 240ms var(--ease-out);
	}

	&:hover,
	&:focus-visible {
		box-shadow:
			0 0 0 2px var(--green),
			0 12px 28px -14px var(--line-strong);
	}

	@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
		&:hover img {
			transform: scale(1.015);
		}

		&:hover .zoom-label {
			transform: translateY(-2px);
			border-color: var(--green);
		}
	}

	@media (prefers-reduced-motion: no-preference) {
		&:active {
			transform: scale(0.992);
		}
	}

	@media (prefers-reduced-motion: reduce) {
		transition: none;

		img {
			transition: none;
		}
	}
}

.zoom-label {
	position: absolute;
	right: 0.75rem;
	bottom: 0.75rem;

	display: inline-flex;
	gap: 0.375rem;
	align-items: center;

	padding: 0.3125rem 0.625rem;
	border: 1px solid var(--line);
	border-radius: 6px;

	font: 700 0.8125rem / 1.2 Lato, system-ui, sans-serif;
	color: var(--ink);

	background: var(--paper);
	box-shadow: 0 2px 8px rgb(0 0 0 / 12%);

	transition:
		opacity 160ms var(--ease-out),
		transform 180ms var(--ease-out),
		border-color 160ms var(--ease-out);

	svg {
		width: 0.9375rem;
		height: 0.9375rem;
		fill: none;
		stroke: currentcolor;
		stroke-linecap: round;
		stroke-linejoin: round;
		stroke-width: 2;
	}
}

/* Keep thumbnail captions uncluttered until hovered or focused. */
.gallery-more .zoom-label {
	right: 0.5rem;
	bottom: 0.5rem;
	opacity: 0;
}

.gallery-more .gallery-trigger:hover .zoom-label,
.gallery-more .gallery-trigger:focus-visible .zoom-label {
	opacity: 1;
}

/* Screenshot lightbox powered by native <dialog> + @starting-style + allow-discrete. */
body:has(dialog.lightbox[open]) {
	overflow: hidden;
}

.lightbox-probe {
	position: fixed;
	visibility: hidden;
	display: block;
	transition: display 1s allow-discrete !important;

	&[data-hidden] {
		display: none;
	}
}

dialog.lightbox {
	inset: 0;

	overflow: hidden;

	width: min(76rem, calc(100vw - 2rem));
	max-width: calc(100vw - 2rem);
	max-height: calc(100dvh - 2rem);
	margin: auto;
	padding: 0;
	border: 1px solid var(--line);
	border-radius: 14px;

	color: var(--ink);
	opacity: 0;
	background: var(--paper);
	box-shadow: 0 24px 60px rgb(0 0 0 / 32%);

	transition-property: opacity, transform, display, overlay;
	transition-duration: 240ms;
	transition-timing-function: var(--ease-out);
	transition-behavior: allow-discrete;

	@media (prefers-reduced-motion: no-preference) {
		transform: scale(0.95) translateY(8px);
	}

	&::backdrop {
		background-color: rgb(20 20 20 / 0%);
		backdrop-filter: blur(0px);
		transition-property: background-color, backdrop-filter, display, overlay;
		transition-duration: 240ms;
		transition-timing-function: var(--ease-out);
		transition-behavior: allow-discrete;
	}

	&[open]:not([data-closing]) {
		opacity: 1;

		@starting-style {
			opacity: 0;
		}

		@media (prefers-reduced-motion: no-preference) {
			transform: scale(1) translateY(0);

			@starting-style {
				transform: scale(0.95) translateY(8px);
			}
		}

		&::backdrop {
			background-color: rgb(20 20 20 / 62%);
			backdrop-filter: blur(3px);

			@starting-style {
				background-color: rgb(20 20 20 / 0%);
				backdrop-filter: blur(0px);
			}
		}
	}

	@media (prefers-reduced-motion: reduce) {
		transition-duration: 100ms;

		&::backdrop {
			transition-duration: 100ms;
		}
	}
}

.lightbox-shell {
	display: flex;
	flex-direction: column;
	max-height: calc(100dvh - 2rem);
}

.lightbox-head {
	display: flex;
	flex: none;
	gap: 1rem;
	align-items: center;
	justify-content: space-between;

	padding: 0.875rem 1.25rem;
	border-bottom: 1px solid var(--line);
}

.lightbox-title {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 0.75rem;
	align-items: baseline;
	min-width: 0;
}

.lightbox-count {
	font-size: 0.9375rem;
	color: var(--muted);
	white-space: nowrap;
}

.lightbox-stage {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 0.75rem;
	align-items: center;
	justify-items: center;

	min-height: 0;
	padding: 1rem 1.25rem 1.25rem;

	&[data-several] {
		grid-template-columns: 1fr 1fr;

		.lightbox-img {
			grid-column: 1 / -1;
			grid-row: 1;
		}

		.lightbox-prev {
			grid-column: 1;
			grid-row: 2;
			justify-self: end;
		}

		.lightbox-next {
			grid-column: 2;
			grid-row: 2;
			justify-self: start;
		}

		@media (width >= 40rem) {
			grid-template-columns: 2.5rem minmax(0, 1fr) 2.5rem;

			.lightbox-prev {
				grid-column: 1;
				grid-row: 1;
				justify-self: center;
			}

			.lightbox-img {
				grid-column: 2;
				grid-row: 1;
			}

			.lightbox-next {
				grid-column: 3;
				grid-row: 1;
				justify-self: center;
			}
		}
	}
}

@keyframes lightbox-swap {
	from {
		opacity: 0;
		transform: scale(0.985);
	}

	to {
		opacity: 1;
		transform: scale(1);
	}
}

.lightbox-img {
	display: block;
	width: auto;
	max-width: 100%;
	height: auto;
	max-height: calc(100dvh - 10.5rem);
	border-radius: 6px;
	object-fit: contain;
	box-shadow: 0 0 0 1px var(--line);

	@media (width >= 40rem) {
		max-height: calc(100dvh - 8.5rem);
	}

	@media (prefers-reduced-motion: no-preference) {
		&.is-entering {
			animation: lightbox-swap 180ms var(--ease-out);
		}
	}
}

.detail-columns {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 2.5rem;
	align-items: start;

	@media (width >= 60rem) {
		grid-template-columns: minmax(0, 1fr) 22rem;
		gap: 2.75rem 3.5rem;

		> .gallery,
		> .prose {
			grid-column: 1;
		}

		> .install {
			position: sticky;
			top: 6rem;
			grid-column: 2;
			grid-row: 1 / span 2;
		}
	}
}

.prose {
	display: grid;
	gap: 1rem;
	max-width: 68ch;

	.subheading + p {
		margin-top: 0.25rem;
	}

	p + .subheading {
		margin-top: 1.5rem;
	}
}

.install {
	display: grid;
	gap: 1.25rem;

	padding: 1.75rem;
	border: 1px solid var(--line);
	border-radius: 12px;

	background: var(--paper);
	box-shadow: 0 1px 3px rgb(30 30 30 / 6%);
}

.install-title {
	font-size: 1.375rem;
	font-weight: 400;
	line-height: 1.25;
}

.install-lead {
	color: var(--muted);

	strong {
		color: var(--ink);
		overflow-wrap: anywhere;
	}
}

.install-open {
	width: 100%;
	background: var(--paper);

	&:hover {
		background: var(--tint);
	}
}

.install-steps {
	display: grid;
	gap: 0.75rem;
	margin: 0;
	padding-left: 1.25rem;

	li::marker {
		font-weight: 700;
	}
}

.facts {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 0.5rem 1.25rem;

	padding-top: 1.25rem;
	border-top: 1px solid var(--line);

	font-size: 0.9375rem;

	dt {
		font-weight: 700;
	}
}

.related {
	display: grid;
	gap: 0.5rem;
}

/* ---------- errors, replicated www.kilanka.de footer ---------- */

.notice {
	display: grid;
	gap: 1.25rem;
	align-content: start;
	justify-items: start;

	padding-top: 3.5rem;
	padding-bottom: 5rem;
}

/* Matches kilanka-website _footer.inc across all breakpoints. */
.site-footer {
	font-size: calc(1.25 * var(--site-unit));
	line-height: calc(1.75 * var(--site-unit));
	color: var(--on-dark);
	background: var(--site-dark);

	a {
		color: var(--on-dark);
		text-decoration: none;
		transition: color 0.15s ease;

		&:hover {
			color: var(--site-green);
			text-decoration: underline;
			text-underline-offset: 0.2em;
		}

		@media (prefers-reduced-motion: reduce) {
			transition: none;
		}
	}
}

.site-footer-inner {
	padding-block: calc(6 * var(--site-unit));
}

.site-footer-grid {
	display: grid;
	gap: calc(1.5 * var(--site-unit));

	@media (width >= 48rem) {
		grid-template-columns: 8fr 4fr;
	}

	@media (width >= 64rem) {
		grid-template-columns: 9fr 3fr;
	}
}

.site-footer-company {
	display: grid;

	@media (width >= 80rem) {
		grid-template-columns: 4fr 8fr;
		gap: calc(1.5 * var(--site-unit));
	}
}

.site-footer-heading {
	font-size: calc(1.5 * var(--site-unit));
	font-weight: 400;
	line-height: calc(2 * var(--site-unit));
}

.site-footer-heading-brand {
	margin-block-end: calc(0.5 * var(--site-unit));

	@media (width >= 40rem) {
		font-size: calc(1.7 * var(--site-unit));
	}
}

.site-footer-address p:not(:last-child) {
	margin-block-end: calc(1.25 * var(--site-unit));
}

.site-footer-about {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	padding-block-start: calc(2.75 * var(--site-unit));

	@media (width >= 80rem) {
		padding-inline-end: calc(3 * var(--site-unit));
	}
}

.site-footer-legal {
	display: flex;
	flex-wrap: wrap;
	gap: calc(0.5 * var(--site-unit)) calc(0.75 * var(--site-unit));
	margin-block-start: calc(1.25 * var(--site-unit));

	@media (width >= 80rem) {
		margin-block-start: calc(1.5 * var(--site-unit));
	}
}

.site-footer-downloads {
	padding-block-start: calc(1.5 * var(--site-unit));
	border-block-start: 1px solid var(--on-dark);

	@media (width >= 48rem) {
		padding-block-start: 0;
		padding-inline-start: calc(1.5 * var(--site-unit));
		border-block-start: 0;
		border-inline-start: 1px solid var(--on-dark);
	}
}

.site-footer-download-list {
	margin: calc(0.75 * var(--site-unit)) 0 0;
	padding: 0;
	list-style: none;
}

/* Data an applet reads (detail page): one line per kind of data, name first. */
.data-list {
	display: grid;
	gap: 0.5rem;
	margin: 0 0 1rem;
	padding: 0;
	list-style: none;

	li {
		display: grid;
		gap: 0.125rem;
	}

	span {
		color: var(--muted);
	}
}
