/* ==========================================================================
   Werkbank – Basis: Schriften, Farben (Tokens), Grundelemente.
   Wird im Frontend und im Editor geladen.
   Anpassen: vor allem die Custom Properties in :root (z. B. --color-accent).
   ========================================================================== */

/* ---------- Schriften (lokal, OFL-lizenziert, keine externen Requests) ---------- */
@font-face {
	font-family: "Space Grotesk";
	src: url("../fonts/space-grotesk-latin-wght-normal.woff2") format("woff2");
	font-weight: 300 700;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "JetBrains Mono";
	src: url("../fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2");
	font-weight: 100 800;
	font-style: normal;
	font-display: swap;
}

/* ---------- Tokens: hell ---------- */
:root {
	--color-bg: #f6f6f3;
	--color-surface: #ffffff;
	--color-surface-2: #eeeee9;
	--color-text: #16181a;
	--color-muted: #585f66;
	--color-border: #e0e0da;
	--color-border-strong: #c9c9c1;
	--color-accent: #0c7a67;
	--color-accent-hover: #09614f;
	--color-accent-soft: #dff1ec;
	--color-on-accent: #ffffff;
	--color-code-bg: #1b1e22;
	--color-code-text: #e6e8ea;
	--color-grid: rgba(22, 24, 26, 0.045);

	--font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--font-display: "Space Grotesk", var(--font-sans);
	--font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

	--fs-xs: 0.8125rem;
	--fs-s: 0.9375rem;
	--fs-m: 1.0625rem;
	--fs-l: clamp(1.15rem, 1rem + 0.5vw, 1.35rem);
	--fs-xl: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem);
	--fs-xxl: clamp(2rem, 1.5rem + 2.2vw, 3.2rem);
	--fs-display: clamp(2.8rem, 1.6rem + 5.5vw, 6rem);

	--space-1: 0.5rem;
	--space-2: 1rem;
	--space-3: 1.5rem;
	--space-4: clamp(2rem, 4vw, 3rem);
	--space-5: clamp(3rem, 7vw, 5.5rem);
	--space-6: clamp(4rem, 10vw, 8rem);

	--width-content: 44rem;
	--width-wide: 76rem;
	--gutter: clamp(1rem, 4vw, 2.5rem);

	--radius: 14px;
	--radius-s: 8px;
	--shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px -12px rgba(0, 0, 0, 0.12);
	--ease: cubic-bezier(0.2, 0.7, 0.2, 1);

	color-scheme: light;
}

/* ---------- Tokens: dunkel (Anthrazit statt Schwarz, keine Neonfarben) ---------- */
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--color-bg: #15171a;
		--color-surface: #1c1f23;
		--color-surface-2: #23272c;
		--color-text: #e6e8ea;
		--color-muted: #a0a7ae;
		--color-border: #2c3136;
		--color-border-strong: #3b4148;
		--color-accent: #5cc3a9;
		--color-accent-hover: #7fd4be;
		--color-accent-soft: #1d3530;
		--color-on-accent: #0f1a17;
		--color-code-bg: #101215;
		--color-code-text: #e6e8ea;
		--color-grid: rgba(255, 255, 255, 0.035);
		--shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px -14px rgba(0, 0, 0, 0.6);
		color-scheme: dark;
	}
}

:root[data-theme="dark"] {
	--color-bg: #15171a;
	--color-surface: #1c1f23;
	--color-surface-2: #23272c;
	--color-text: #e6e8ea;
	--color-muted: #a0a7ae;
	--color-border: #2c3136;
	--color-border-strong: #3b4148;
	--color-accent: #5cc3a9;
	--color-accent-hover: #7fd4be;
	--color-accent-soft: #1d3530;
	--color-on-accent: #0f1a17;
	--color-code-bg: #101215;
	--color-code-text: #e6e8ea;
	--color-grid: rgba(255, 255, 255, 0.035);
	--shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px -14px rgba(0, 0, 0, 0.6);
	color-scheme: dark;
}

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

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-padding-top: 5rem;
}

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

body {
	margin: 0;
	background: var(--color-bg);
	color: var(--color-text);
	font-family: var(--font-sans);
	font-size: var(--fs-m);
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	font-family: var(--font-display);
	font-weight: 650;
	line-height: 1.15;
	letter-spacing: -0.02em;
	margin: 0;
	text-wrap: balance;
}

p {
	text-wrap: pretty;
}

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

a {
	color: inherit;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
	transition: color 0.15s var(--ease);
}

a:hover {
	color: var(--color-accent);
}

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

:focus-visible {
	outline: 2px solid var(--color-accent);
	outline-offset: 3px;
	border-radius: 4px;
}

.screen-reader-text {
	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:focus {
	position: fixed !important;
	top: 0.75rem;
	left: 0.75rem;
	z-index: 100;
	width: auto;
	height: auto;
	clip: auto;
	margin: 0;
	padding: 0.6rem 1rem;
	background: var(--color-text);
	color: var(--color-bg);
	border-radius: var(--radius-s);
	text-decoration: none;
}

.icon {
	width: 1.1em;
	height: 1.1em;
	flex: none;
	vertical-align: -0.15em;
}

/* ---------- Buttons ---------- */
.button,
.wp-element-button,
.wp-block-button__link,
input[type="submit"],
button[type="submit"] {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	padding: 0.7em 1.25em;
	border: 1px solid var(--color-text);
	border-radius: 999px;
	background: var(--color-text);
	color: var(--color-bg);
	font-family: var(--font-display);
	font-size: var(--fs-s);
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease);
}

.button:hover,
.wp-element-button:hover,
.wp-block-button__link:hover,
input[type="submit"]:hover,
button[type="submit"]:hover {
	background: var(--color-accent);
	border-color: var(--color-accent);
	color: var(--color-on-accent);
}

.button--ghost,
.is-style-outline > .wp-block-button__link {
	background: transparent;
	color: var(--color-text);
	border-color: var(--color-border-strong);
}

.button--ghost:hover,
.is-style-outline > .wp-block-button__link:hover {
	background: transparent;
	color: var(--color-accent);
	border-color: var(--color-accent);
}

/* ---------- Tags / Chips ---------- */
.tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	list-style: none;
	margin: 0;
	padding: 0;
	font-family: var(--font-mono);
	font-size: 0.75rem;
	line-height: 1.4;
}

.tags li,
.tags a {
	display: inline-block;
	text-decoration: none;
}

.tags li {
	padding: 0.25em 0.65em;
	border-radius: 6px;
	background: var(--color-surface-2);
	color: var(--color-muted);
}

.tags a:hover {
	color: var(--color-accent);
}

.tags--outline li {
	background: transparent;
	border: 1px solid var(--color-border);
}

.tags--hash li {
	background: transparent;
	border: 1px solid var(--color-border);
	padding: 0.3em 0.8em;
	border-radius: 999px;
}

.tags--hash li::before {
	content: "#";
	color: var(--color-accent);
}

.eyebrow {
	margin: 0 0 var(--space-2);
	font-family: var(--font-mono);
	font-size: var(--fs-xs);
	letter-spacing: 0.04em;
	color: var(--color-muted);
}

.eyebrow::before {
	content: "// ";
	color: var(--color-accent);
}

.eyebrow a {
	text-decoration: none;
}

/* ---------- Formularfelder ---------- */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="search"],
textarea {
	width: 100%;
	padding: 0.7em 0.9em;
	border: 1px solid var(--color-border-strong);
	border-radius: var(--radius-s);
	background: var(--color-surface);
	color: var(--color-text);
	font: inherit;
	font-size: var(--fs-s);
}

input:focus,
textarea:focus {
	outline: 2px solid var(--color-accent);
	outline-offset: 0;
	border-color: var(--color-accent);
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
	}
}
