/* =========================================================
   WEBLABS TOOLS — Design System
   Kein Framework. Keine Webfonts. Nur das Nötige.
   ========================================================= */

/* ---------- Tokens ---------- */
:root {
	--bg: #ffffff;
	--surface: #fafafa;
	--surface-2: #f4f4f5;
	--border: #e4e4e7;
	--text: #09090b;
	--text-muted: #71717a;
	--accent: #0066ff;
	--accent-contrast: #ffffff;

	--green: #15803d;
	--green-bg: #dcfce7;
	--blue: #1d4ed8;
	--blue-bg: #dbeafe;
	--violet: #6d28d9;
	--violet-bg: #ede9fe;
	--amber: #b45309;
	--amber-bg: #fef3c7;

	--font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
		"Helvetica Neue", Arial, sans-serif;
	--font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

	--step-0: clamp(0.95rem, 0.92rem + 0.15vw, 1rem);
	--step-1: clamp(1.1rem, 1rem + 0.4vw, 1.25rem);
	--step-2: clamp(1.35rem, 1.15rem + 0.8vw, 1.75rem);
	--step-3: clamp(1.75rem, 1.4rem + 1.6vw, 2.6rem);
	--step-4: clamp(2.1rem, 1.5rem + 2.8vw, 3.5rem);

	--sp-1: 0.25rem;
	--sp-2: 0.5rem;
	--sp-3: 0.75rem;
	--sp-4: 1rem;
	--sp-6: 1.5rem;
	--sp-8: 2rem;
	--sp-12: 3rem;
	--sp-16: 4rem;
	--sp-24: 6rem;

	--radius: 10px;
	--radius-lg: 16px;
	--container: 1120px;
	--ring: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent);
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--bg: #09090b;
		--surface: #121214;
		--surface-2: #1a1a1d;
		--border: #27272a;
		--text: #fafafa;
		--text-muted: #a1a1aa;
		--accent: #4d94ff;
		--accent-contrast: #06131f;

		--green: #4ade80;
		--green-bg: #052e16;
		--blue: #93c5fd;
		--blue-bg: #0b2545;
		--violet: #c4b5fd;
		--violet-bg: #2a1a4d;
		--amber: #fcd34d;
		--amber-bg: #3b2905;
	}
}

:root[data-theme="dark"] {
	--bg: #09090b;
	--surface: #121214;
	--surface-2: #1a1a1d;
	--border: #27272a;
	--text: #fafafa;
	--text-muted: #a1a1aa;
	--accent: #4d94ff;
	--accent-contrast: #06131f;

	--green: #4ade80;
	--green-bg: #052e16;
	--blue: #93c5fd;
	--blue-bg: #0b2545;
	--violet: #c4b5fd;
	--violet-bg: #2a1a4d;
	--amber: #fcd34d;
	--amber-bg: #3b2905;
}

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

* {
	margin: 0;
}

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
}

body {
	background: var(--bg);
	color: var(--text);
	font-family: var(--font);
	font-size: var(--step-0);
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

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

a {
	color: inherit;
	text-decoration: none;
}

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

:focus-visible {
	outline: none;
	box-shadow: var(--ring);
	border-radius: 4px;
}

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

/* ---------- Layout ---------- */
.container {
	width: 100%;
	max-width: var(--container);
	margin-inline: auto;
	padding-inline: var(--sp-6);
}

.section {
	padding-block: var(--sp-16);
}

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	background: var(--accent);
	color: var(--accent-contrast);
	padding: var(--sp-3) var(--sp-4);
	z-index: 100;
}

.skip-link:focus {
	left: var(--sp-4);
	top: var(--sp-4);
}

/* ---------- Typografie ---------- */
h1,
h2,
h3,
h4 {
	line-height: 1.2;
	letter-spacing: -0.02em;
	font-weight: 650;
	text-wrap: balance;
}

h1 {
	font-size: var(--step-4);
}
h2 {
	font-size: var(--step-3);
}
h3 {
	font-size: var(--step-2);
}
h4 {
	font-size: var(--step-1);
}

p {
	text-wrap: pretty;
}

.lead {
	font-size: var(--step-1);
	color: var(--text-muted);
}

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

code,
pre {
	font-family: var(--font-mono);
	font-size: 0.9em;
}

code {
	background: var(--surface-2);
	padding: 0.15em 0.4em;
	border-radius: 5px;
}

/* ---------- Header ---------- */
.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: color-mix(in srgb, var(--bg) 85%, transparent);
	backdrop-filter: saturate(180%) blur(12px);
	border-bottom: 1px solid var(--border);
}

.site-header__inner {
	display: flex;
	align-items: center;
	gap: var(--sp-6);
	min-height: 62px;
}

.brand {
	display: inline-flex;
	align-items: baseline;
	gap: var(--sp-2);
	font-weight: 700;
	letter-spacing: -0.03em;
	font-size: 1.0625rem;
	white-space: nowrap;
}

.brand__mark {
	color: var(--accent);
}

.nav {
	display: flex;
	align-items: center;
	gap: var(--sp-6);
	margin-left: auto;
}

.nav ul {
	display: flex;
	align-items: center;
	gap: var(--sp-6);
	list-style: none;
	padding: 0;
	margin: 0;
}

.nav a {
	color: var(--text-muted);
	font-size: 0.9375rem;
	transition: color 0.15s ease;
}

.nav a:hover,
.nav a:focus-visible,
.nav .current-menu-item > a {
	color: var(--text);
}

.theme-toggle {
	display: inline-grid;
	place-items: center;
	width: 34px;
	height: 34px;
	border: 1px solid var(--border);
	border-radius: 8px;
	background: var(--surface);
	cursor: pointer;
	transition: border-color 0.15s ease;
}

.theme-toggle:hover {
	border-color: var(--text-muted);
}

.theme-toggle svg {
	width: 16px;
	height: 16px;
}

:root[data-theme="dark"] .theme-toggle .icon-sun,
:root:not([data-theme="light"]) .theme-toggle .icon-sun {
	display: none;
}

:root[data-theme="dark"] .theme-toggle .icon-moon,
:root:not([data-theme="light"]) .theme-toggle .icon-moon {
	display: block;
}

@media (prefers-color-scheme: light) {
	:root:not([data-theme="dark"]) .theme-toggle .icon-sun {
		display: block;
	}
	:root:not([data-theme="dark"]) .theme-toggle .icon-moon {
		display: none;
	}
}

:root[data-theme="light"] .theme-toggle .icon-sun {
	display: block;
}
:root[data-theme="light"] .theme-toggle .icon-moon {
	display: none;
}

/* ---------- Hero ---------- */
.hero {
	padding-block: clamp(var(--sp-16), 10vw, var(--sp-24)) var(--sp-12);
	text-align: center;
}

.hero__claim {
	margin-top: var(--sp-4);
	font-size: var(--step-1);
	color: var(--text-muted);
	max-width: 46ch;
	margin-inline: auto;
}

.hero__meta {
	margin-top: var(--sp-6);
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: var(--sp-2) var(--sp-4);
	font-size: 0.875rem;
	color: var(--text-muted);
}

.hero__meta span {
	display: inline-flex;
	align-items: center;
	gap: var(--sp-2);
}

.hero__meta span::before {
	content: "";
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: var(--green);
}

/* ---------- Suche ---------- */
.search {
	margin-top: var(--sp-8);
	max-width: 520px;
	margin-inline: auto;
}

.search__field {
	display: flex;
	align-items: center;
	gap: var(--sp-3);
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: var(--sp-3) var(--sp-4);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search__field:focus-within {
	border-color: var(--accent);
	box-shadow: var(--ring);
}

.search__field svg {
	width: 17px;
	height: 17px;
	color: var(--text-muted);
	flex-shrink: 0;
}

.search__field input {
	flex: 1;
	border: 0;
	background: transparent;
	outline: none;
	min-width: 0;
}

/* ---------- Grid & Cards ---------- */
.grid {
	display: grid;
	gap: var(--sp-4);
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 265px), 1fr));
}

.card {
	display: flex;
	flex-direction: column;
	gap: var(--sp-2);
	padding: var(--sp-4) var(--sp-4) var(--sp-3);
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	transition: border-color 0.15s ease, transform 0.15s ease;
}

.card:hover,
.card:focus-visible {
	border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
	transform: translateY(-2px);
}

.card__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--sp-3);
}

.card__title {
	font-weight: 600;
	letter-spacing: -0.01em;
}

.card__text {
	color: var(--text-muted);
	font-size: 0.9rem;
	line-height: 1.55;
}

.card__foot {
	margin-top: auto;
	padding-top: var(--sp-2);
}

/* Kategorie-Kachel */
.card--category .card__count {
	color: var(--text-muted);
	font-size: 0.8125rem;
}

/* ---------- Badges ---------- */
.badge {
	display: inline-flex;
	align-items: center;
	font-size: 0.6875rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	padding: 0.2em 0.55em;
	border-radius: 5px;
	background: var(--surface-2);
	color: var(--text-muted);
	white-space: nowrap;
}

.badge--local {
	background: var(--green-bg);
	color: var(--green);
}
.badge--server {
	background: var(--blue-bg);
	color: var(--blue);
}
.badge--ai {
	background: var(--violet-bg);
	color: var(--violet);
}
.badge--credits {
	background: var(--amber-bg);
	color: var(--amber);
}
.badge--free {
	background: var(--green-bg);
	color: var(--green);
}

/* ---------- Buttons ---------- */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--sp-2);
	padding: var(--sp-3) var(--sp-6);
	border: 1px solid transparent;
	border-radius: var(--radius);
	font-weight: 550;
	font-size: 0.9375rem;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.btn--primary {
	background: var(--accent);
	color: var(--accent-contrast);
}

.btn--primary:hover {
	opacity: 0.9;
}

.btn--ghost {
	background: transparent;
	border-color: var(--border);
	color: var(--text);
}

.btn--ghost:hover {
	border-color: var(--text-muted);
}

/* ---------- Tool-Seite ---------- */
.tool-header {
	padding-block: var(--sp-12) var(--sp-6);
	border-bottom: 1px solid var(--border);
}

.tool-header__badges {
	display: flex;
	flex-wrap: wrap;
	gap: var(--sp-2);
	margin-bottom: var(--sp-4);
}

.tool-header h1 {
	font-size: var(--step-3);
}

.tool-header__tagline {
	margin-top: var(--sp-3);
	color: var(--text-muted);
	font-size: var(--step-1);
	max-width: 60ch;
}

/* Das Tool selbst — direkt unter dem Titel, ohne SEO-Text davor. */
.tool-stage {
	margin-block: var(--sp-8);
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	padding: clamp(var(--sp-6), 4vw, var(--sp-12));
	min-height: 240px;
}

.tool-stage__placeholder {
	display: grid;
	place-items: center;
	gap: var(--sp-3);
	text-align: center;
	color: var(--text-muted);
	min-height: 200px;
}

.tool-stage__placeholder code {
	font-size: 0.85rem;
}

/* Inhalt unterhalb des Tools */
.tool-content {
	max-width: 70ch;
	margin-block: var(--sp-12);
}

.tool-content h2 {
	font-size: var(--step-2);
	margin-top: var(--sp-8);
	margin-bottom: var(--sp-3);
}

.tool-content h3 {
	font-size: var(--step-1);
	margin-top: var(--sp-6);
	margin-bottom: var(--sp-2);
}

.tool-content p + p {
	margin-top: var(--sp-4);
}

.tool-content ul,
.tool-content ol {
	margin-top: var(--sp-3);
	padding-left: 1.3em;
}

.tool-content li + li {
	margin-top: var(--sp-2);
}

/* ---------- Abschnitts-Kopf ---------- */
.section-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: var(--sp-4);
	margin-bottom: var(--sp-6);
	flex-wrap: wrap;
}

.section-head h2 {
	font-size: var(--step-2);
}

.section-head a {
	color: var(--accent);
	font-size: 0.9375rem;
}

/* ---------- Agentur-Hinweis ---------- */
.agency-note {
	margin-block: var(--sp-12);
	padding: var(--sp-6);
	background: var(--surface);
	border: 1px solid var(--border);
	border-left: 3px solid var(--accent);
	border-radius: var(--radius);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--sp-4);
	flex-wrap: wrap;
}

.agency-note p {
	color: var(--text-muted);
	max-width: 52ch;
}

.agency-note strong {
	color: var(--text);
	display: block;
}

/* ---------- Footer ---------- */
.site-footer {
	margin-top: var(--sp-24);
	border-top: 1px solid var(--border);
	padding-block: var(--sp-8);
	font-size: 0.875rem;
	color: var(--text-muted);
}

.site-footer__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--sp-4);
	flex-wrap: wrap;
}

.site-footer ul {
	display: flex;
	gap: var(--sp-6);
	list-style: none;
	padding: 0;
	margin: 0;
	flex-wrap: wrap;
}

.site-footer a:hover {
	color: var(--text);
}

/* ---------- Leerzustand / 404 ---------- */
.empty {
	text-align: center;
	padding-block: var(--sp-16);
	color: var(--text-muted);
}

.empty h1 {
	color: var(--text);
	margin-bottom: var(--sp-3);
}

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

.is-hidden {
	display: none !important;
}

/* =========================================================
   Tool-App — geteilte Bausteine für die Local-Tools
   ========================================================= */
.tool-app {
	display: flex;
	flex-direction: column;
	gap: var(--sp-6);
}

.tool-app__row {
	display: flex;
	gap: var(--sp-4);
	flex-wrap: wrap;
}

.tool-app__row > * {
	flex: 1 1 220px;
}

.field {
	display: flex;
	flex-direction: column;
	gap: var(--sp-2);
}

.field label {
	font-size: 0.875rem;
	font-weight: 550;
	color: var(--text-muted);
}

.input,
.textarea,
.select {
	width: 100%;
	background: var(--bg);
	color: var(--text);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: var(--sp-3) var(--sp-4);
	font-family: var(--font);
	font-size: 0.9375rem;
	line-height: 1.5;
}

.textarea {
	font-family: var(--font-mono);
	font-size: 0.875rem;
	resize: vertical;
	min-height: 160px;
}

.input:focus,
.textarea:focus,
.select:focus {
	outline: none;
	border-color: var(--accent);
	box-shadow: var(--ring);
}

.toolbar {
	display: flex;
	align-items: center;
	gap: var(--sp-3);
	flex-wrap: wrap;
}

.toolbar--end {
	justify-content: flex-end;
}

.btn--sm {
	padding: var(--sp-2) var(--sp-4);
	font-size: 0.8125rem;
}

.btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.output-box {
	position: relative;
}

.output-box .textarea {
	background: var(--surface-2);
}

.copy-btn {
	position: absolute;
	top: var(--sp-3);
	right: var(--sp-3);
}

.stat-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
	gap: var(--sp-3);
}

.stat-tile {
	background: var(--surface-2);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: var(--sp-4);
	text-align: center;
}

.stat-tile__value {
	font-size: var(--step-2);
	font-weight: 650;
	font-variant-numeric: tabular-nums;
}

.stat-tile__label {
	margin-top: var(--sp-1);
	font-size: 0.8125rem;
	color: var(--text-muted);
}

.tool-error {
	border: 1px solid var(--amber);
	background: var(--amber-bg);
	color: var(--amber);
	border-radius: var(--radius);
	padding: var(--sp-3) var(--sp-4);
	font-size: 0.875rem;
}

.tool-error.is-hidden {
	display: none !important;
}

.uuid-list {
	display: flex;
	flex-direction: column;
	gap: var(--sp-2);
	max-height: 360px;
	overflow-y: auto;
}

.uuid-list__item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--sp-3);
	background: var(--surface-2);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: var(--sp-2) var(--sp-3);
	font-family: var(--font-mono);
	font-size: 0.875rem;
}

.uuid-list__item span {
	overflow-x: auto;
	white-space: nowrap;
}

.serp-preview {
	max-width: 600px;
	padding: var(--sp-4);
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	font-family: arial, sans-serif;
}

.serp-preview__url {
	color: #202124;
	font-size: 0.8125rem;
	display: flex;
	align-items: center;
	gap: var(--sp-2);
}

.serp-preview__favicon {
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: var(--surface-2);
	flex-shrink: 0;
}

.serp-preview__title {
	color: #1a0dab;
	font-size: 1.25rem;
	line-height: 1.3;
	margin-top: var(--sp-1);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

@media (prefers-color-scheme: dark) {
	.serp-preview:not([data-force-light]) .serp-preview__title {
		color: #8ab4f8;
	}
}

.serp-preview__desc {
	color: #4d5156;
	font-size: 0.875rem;
	margin-top: var(--sp-1);
	line-height: 1.5;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.contrast-preview {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
	gap: var(--sp-4);
}

.contrast-preview__swatch {
	border-radius: var(--radius);
	border: 1px solid var(--border);
	padding: var(--sp-6) var(--sp-4);
	text-align: center;
	font-weight: 600;
}

.contrast-result {
	display: flex;
	align-items: center;
	gap: var(--sp-4);
	flex-wrap: wrap;
}

.contrast-result__ratio {
	font-size: var(--step-3);
	font-weight: 650;
	font-variant-numeric: tabular-nums;
}

.pill {
	display: inline-flex;
	align-items: center;
	padding: var(--sp-1) var(--sp-3);
	border-radius: 999px;
	font-size: 0.8125rem;
	font-weight: 600;
	margin: var(--sp-1) var(--sp-2) var(--sp-1) 0;
}

.pill--pass {
	background: var(--green-bg);
	color: var(--green);
}

.pill--fail {
	background: var(--amber-bg);
	color: var(--amber);
}

.color-swatch-input {
	display: flex;
	align-items: center;
	gap: var(--sp-2);
}

.color-swatch-input input[type="color"] {
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: none;
	cursor: pointer;
}

.cron-readable {
	background: var(--surface-2);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: var(--sp-4);
	font-size: 0.9375rem;
}

.cron-output {
	font-family: var(--font-mono);
	font-size: 1.5rem;
	font-weight: 650;
	letter-spacing: 0.02em;
}
