/* ==========================================================================
   Musterdach GmbH — Design-System "Schiefer & Kupfer"
   base.css: Reset, Tokens, Typografie, Utilities, Icons, Buttons, Motion
   ========================================================================== */

:root {
	/* Farb-Tokens (oklch, überschreibbar über den Customizer als Hex-Inline-Style) */
	--primary: oklch(22% 0.02 250);      /* Schiefergrau */
	--accent: oklch(58% 0.14 45);        /* Kupfer */
	--clay: oklch(72% 0.09 55);          /* Ziegelton */
	--surface: oklch(97% 0.006 90);      /* Nebelweiß */
	--surface-2: oklch(94% 0.008 85);    /* leicht dunklerer Nebelton für Wechsel-Sektionen */
	--ink: oklch(22% 0.02 250);
	--ink-soft: oklch(40% 0.015 250);
	--line: oklch(85% 0.01 80);
	--accent-soft: oklch(90% 0.03 55);
	--paper: oklch(99% 0.002 90);

	--font-display: "Fraunces", "Iowan Old Style", "Source Serif 4", Georgia, serif;
	--font-body: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

	--radius: 2px;
	--ease-out: cubic-bezier(0.16, 1, 0.3, 1);
	--duration-ui: 220ms;
	--duration-reveal: 620ms;

	--container: 1240px;
	--gap: clamp(1rem, 3vw, 2.5rem);
	--section-pad: clamp(3.5rem, 7vw, 7.5rem);

	--shadow-sm: 0 1px 3px oklch(22% 0.02 250 / 0.12);
	--shadow-md: 0 12px 32px -12px oklch(22% 0.02 250 / 0.28);
	--shadow-lift: 0 28px 48px -20px oklch(22% 0.02 250 / 0.38);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

html, body {
	overflow-x: hidden;
	max-width: 100%;
}

body {
	font-family: var(--font-body);
	font-size: 16px;
	line-height: 1.65;
	color: var(--ink);
	background: var(--paper);
	-webkit-font-smoothing: antialiased;
}

img, picture, video { max-width: 100%; height: auto; display: block; }
svg { max-width: 100%; height: auto; }
.icon { width: 1.4em; height: 1.4em; flex: 0 0 auto; vertical-align: middle; }

a { color: inherit; text-decoration: none; }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }

/* ---------- Typografie ---------- */
h1, h2, h3, h4, .font-display {
	font-family: var(--font-display);
	font-weight: 600;
	line-height: 1.12;
	letter-spacing: -0.01em;
	color: var(--primary);
	text-wrap: pretty;
}

h1 { font-size: clamp(2.4rem, 1.7rem + 3vw, 4.35rem); font-weight: 600; }
h2 { font-size: clamp(1.9rem, 1.55rem + 1.6vw, 2.85rem); }
h3 { font-size: clamp(1.3rem, 1.15rem + 0.6vw, 1.55rem); }
h4 { font-size: clamp(1.1rem, 1.02rem + 0.3vw, 1.2rem); font-weight: 600; }

p { text-wrap: pretty; }
p + p { margin-top: 1em; }

.eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 0.6em;
	font-family: var(--font-body);
	font-size: 0.8rem;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--accent);
}
.eyebrow::before {
	content: "";
	width: 28px;
	height: 2px;
	background: var(--accent);
}

.lede { font-size: clamp(1.05rem, 1rem + 0.3vw, 1.2rem); color: var(--ink-soft); max-width: 54ch; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: clamp(1.25rem, 4vw, 2.5rem); }
.section { padding-block: var(--section-pad); }
.section-head { max-width: 62ch; margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.section-head.center { margin-inline: auto; text-align: center; }

.grid-12 { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--gap); }

.surface-alt { background: var(--surface); }
.surface-primary { background: var(--primary); color: var(--surface); }
.surface-primary h2, .surface-primary h3 { color: var(--surface); }

/* ---------- Giebel-Motiv (Kern-Formsprache statt SVG-Icon) ---------- */
.gable-clip {
	clip-path: polygon(50% 0%, 100% 30%, 100% 100%, 0% 100%, 0% 30%);
}
.gable-divider {
	--h: 34px;
	height: var(--h);
	background: var(--primary);
	clip-path: polygon(0% 100%, 8.33% 0%, 16.66% 100%, 25% 0%, 33.33% 100%, 41.66% 0%, 50% 100%, 58.33% 0%, 66.66% 100%, 75% 0%, 83.33% 100%, 91.66% 0%, 100% 100%);
}

/* ---------- Buttons ---------- */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.6em;
	padding: 0.95em 1.7em;
	min-height: 48px;
	border-radius: var(--radius);
	font-weight: 600;
	font-size: 0.98rem;
	letter-spacing: 0.01em;
	white-space: nowrap;
	transition: transform var(--duration-ui) var(--ease-out), box-shadow var(--duration-ui) var(--ease-out), background-color var(--duration-ui) var(--ease-out), color var(--duration-ui) var(--ease-out);
}
.btn-primary { background: var(--accent); color: var(--paper); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: oklch(52% 0.14 45); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.btn-primary:active { transform: translateY(0) scale(0.98); }

.btn-ghost { background: transparent; color: var(--surface); border: 1.5px solid oklch(97% 0.006 90 / 0.4); }
.btn-ghost:hover { border-color: var(--surface); background: oklch(97% 0.006 90 / 0.08); transform: translateY(-2px); }
.btn-ghost:active { transform: translateY(0) scale(0.98); }

.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--line); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-outline:active { transform: scale(0.98); }

a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
	outline: 2.5px solid var(--accent);
	outline-offset: 3px;
	border-radius: 1px;
}

/* ---------- Reveal-Animationen ----------
   Inhalte bleiben IMMER opacity:1 (niemals unsichtbar) — animiert wird nur transform.
   So bleibt der Inhalt auch sichtbar, falls IntersectionObserver in einem Renderer
   ohne echtes Scrollen (z. B. Headless-Fullpage-Screenshot) nie auslöst. */
.reveal {
	opacity: 1;
	transform: none;
	transition: transform var(--duration-reveal) var(--ease-out);
}
.js-anim .reveal { transform: translateY(28px); }
.js-anim .reveal.is-visible { transform: none; }

@media (prefers-reduced-motion: reduce) {
	.js-anim .reveal { opacity: 1; transform: none; transition: opacity 200ms linear; }
	.btn:hover, .btn:active { transform: none; }
}

/* ---------- Sichtbarkeits-/Screenreader-Helfer ---------- */
.sr-only {
	position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
	position: absolute; left: 1rem; top: -60px; z-index: 200;
	background: var(--primary); color: var(--surface); padding: 0.8em 1.2em;
	border-radius: var(--radius); transition: top var(--duration-ui) var(--ease-out);
}
.skip-link:focus { top: 1rem; }
