/* ==========================================================================
   Websmarty – Basis: Reset, Typografie, Layout-Grundlagen, Barrierefreiheit
   ========================================================================== */

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

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-padding-top: calc(var(--header-h) + var(--header-gap) + 1.5rem);
	hanging-punctuation: first last;
	accent-color: var(--c-accent);
	scrollbar-color: var(--c-surface-3) var(--c-bg);
	scrollbar-width: thin;
}

@media (prefers-reduced-motion: no-preference) {
	html {
		scroll-behavior: smooth;
	}
}

body {
	margin: 0;
	min-height: 100dvh;
	background: var(--c-bg);
	color: var(--c-text);
	caret-color: var(--c-accent);
	font-family: var(--ff-sans);
	font-size: var(--fs-base);
	line-height: var(--lh-body);
	font-weight: 400;
	font-optical-sizing: auto;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
	overflow-x: clip;
}

body.is-locked {
	overflow: hidden;
}

img,
svg,
video,
picture {
	display: block;
	max-width: 100%;
	height: auto;
}

input,
button,
textarea,
select {
	font: inherit;
	color: inherit;
	letter-spacing: inherit;
}

button {
	cursor: pointer;
	background: none;
	border: 0;
	padding: 0;
}

:where(ul, ol)[class] {
	list-style: none;
	margin: 0;
	padding: 0;
}

p,
ul,
ol,
dl,
figure,
blockquote {
	margin: 0;
}

/* Typografie ------------------------------------------------------------- */

h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.display {
	margin: 0;
	font-family: var(--ff-display);
	font-weight: 600;
	color: var(--c-text);
	text-wrap: balance;
}

/* Große Überschriften etwas leichter, damit sie ruhig wirken */
.display,
h1,
.h1,
h2,
.h2 {
	font-family: var(--ff-display);
	font-weight: 500;
}

.display {
	font-size: var(--fs-display);
	line-height: 1.02;
	letter-spacing: var(--tracking-floor);
}

h1,
.h1 {
	font-size: var(--fs-h1);
	line-height: var(--lh-tight);
	letter-spacing: var(--tracking-floor);
}

h2,
.h2 {
	font-size: var(--fs-h2);
	line-height: 1.08;
	letter-spacing: var(--tracking-tight);
}

h3,
.h3 {
	font-size: var(--fs-h3);
	line-height: var(--lh-snug);
	letter-spacing: var(--tracking-snug);
}

h4,
.h4 {
	font-size: var(--fs-h4);
	line-height: 1.3;
	letter-spacing: -0.015em;
}

h5,
h6,
.h5 {
	font-family: var(--ff-sans);
	font-weight: 550;
	font-size: var(--fs-h5);
	line-height: 1.35;
	letter-spacing: -0.01em;
}

/*
 * Betonung in Überschriften mit <em>: gleiche Schrift, keine Kursive.
 * Große Überschriften (H1/Display) betonen in Lime, alle anderen
 * nehmen den Rest-Satz zurück (zweifarbige Überschrift).
 */
:is(h1, h2, h3, h4, .h1, .h2, .h3, .h4, .display) em {
	font-style: normal;
	color: var(--c-text-2);
}

:is(h1, .h1, .display) em {
	color: var(--c-accent);
}

p {
	text-wrap: pretty;
}

.lead {
	font-size: var(--fs-lg);
	line-height: 1.55;
	color: var(--c-text-2);
	max-width: 36em;
}

.text-2 {
	color: var(--c-text-2);
}

.text-3 {
	color: var(--c-text-3);
}

.small {
	font-size: var(--fs-sm);
}

.tabular {
	font-variant-numeric: tabular-nums;
}

strong,
b {
	font-weight: 600;
	color: var(--c-text);
}

mark,
.highlight {
	background: linear-gradient(transparent 62%, var(--c-accent-soft) 62%);
	color: var(--c-text);
	padding-inline: 0.08em;
}

a {
	color: inherit;
	text-decoration-color: var(--c-accent-line);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.22em;
	transition: color var(--dur-fast) ease, text-decoration-color var(--dur-fast) ease;
}

@media (hover: hover) and (pointer: fine) {
	a:hover {
		text-decoration-color: var(--c-accent);
	}
}

hr {
	border: 0;
	border-top: 1px solid var(--c-line);
	margin: var(--s-12) 0;
}

::selection {
	background: var(--c-accent);
	color: var(--c-accent-ink);
}

::-webkit-scrollbar {
	width: 10px;
	height: 10px;
}

::-webkit-scrollbar-track {
	background: var(--c-bg);
}

::-webkit-scrollbar-thumb {
	border: 2px solid var(--c-bg);
	border-radius: var(--r-pill);
	background: var(--c-surface-3);
}

/* Fließtext aus dem Editor ----------------------------------------------- */

.prose {
	max-width: 68ch;
	color: var(--c-text-2);
}

.prose > * + * {
	margin-top: 1.1em;
}

.prose :is(h2, h3, h4) {
	margin-top: 2em;
	font-weight: 600;
}

.prose :is(h2, h3, h4) + * {
	margin-top: 0.75em;
}

.prose h2 {
	font-size: var(--fs-h3);
}

.prose h3 {
	font-size: var(--fs-h4);
}

.prose ul,
.prose ol {
	padding-left: 1.25em;
}

.prose li + li {
	margin-top: 0.4em;
}

.prose ul li::marker {
	color: var(--c-accent);
}

.prose a {
	color: var(--c-text);
	text-decoration-line: underline;
}

/* Layout ----------------------------------------------------------------- */

.container {
	width: 100%;
	max-width: calc(var(--container) + var(--gutter) * 2);
	margin-inline: auto;
	padding-inline: var(--gutter);
}

.container--narrow {
	max-width: calc(var(--container-narrow) + var(--gutter) * 2);
}

.section {
	padding-block: var(--section-y) calc(var(--section-y) * 1.08);
	position: relative;
}

.section--sm {
	padding-block: var(--section-y-sm) calc(var(--section-y-sm) * 1.08);
}

.section--raised {
	background: var(--c-bg-raised);
}

.section--line {
	border-top: 1px solid var(--c-line);
}

.section-head {
	display: grid;
	gap: var(--s-5);
	max-width: 46rem;
	margin-bottom: clamp(2.5rem, 1.8rem + 3vw, 4.5rem);
}

.section-head--center {
	margin-inline: auto;
	text-align: center;
	justify-items: center;
}

.stack > * + * {
	margin-top: var(--stack, var(--s-5));
}

.cluster {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--cluster, var(--s-3));
}

.grid {
	display: grid;
	gap: var(--grid-gap, var(--s-5));
}

@media (min-width: 48em) {
	.grid--2 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* Barrierefreiheit ------------------------------------------------------- */

.screen-reader-text,
.sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.skip-link {
	position: fixed;
	top: var(--s-3);
	left: var(--s-3);
	z-index: var(--z-skip);
	padding: var(--s-3) var(--s-5);
	border-radius: var(--r-pill);
	background: var(--c-accent);
	color: var(--c-accent-ink);
	font-weight: 600;
	text-decoration: none;
	transform: translateY(-200%);
}

.skip-link:focus {
	transform: none;
}

:focus {
	outline: none;
}

:focus-visible {
	outline: 2px solid var(--c-accent);
	outline-offset: 3px;
	border-radius: var(--r-xs);
}

main:focus {
	outline: none;
}

/* Einstieg: einmaliger, gestaffelter Auftritt beim Laden (ohne JS) -------- */

@keyframes ws-rise {
	from {
		opacity: 0;
		transform: translate3d(0, 18px, 0);
		filter: blur(6px);
	}
}

@keyframes ws-fade {
	from {
		opacity: 0;
	}
}

.intro > * {
	animation: ws-rise 760ms var(--ease-out) both;
	animation-delay: calc(var(--i, 0) * 70ms + 60ms);
}

.intro > :nth-child(1) { --i: 0; }
.intro > :nth-child(2) { --i: 1; }
.intro > :nth-child(3) { --i: 2; }
.intro > :nth-child(4) { --i: 3; }
.intro > :nth-child(5) { --i: 4; }

/* Scroll-Reveal (sparsam, nur für ausgewählte Elemente; nur mit JS) ------- */

.js [data-reveal] {
	opacity: 0;
	transform: translate3d(0, 16px, 0);
	transition:
		opacity var(--dur-reveal) var(--ease-out),
		transform var(--dur-reveal) var(--ease-out);
	transition-delay: calc(var(--reveal-i, 0) * 60ms);
}

.js [data-reveal].is-in {
	opacity: 1;
	transform: none;
}

@media (prefers-reduced-motion: reduce) {
	.intro > * {
		animation: ws-fade 300ms ease both;
	}

	.js [data-reveal] {
		transform: none;
		transition: opacity 300ms ease;
		transition-delay: 0ms;
	}
}
