/* FN Montagen – Stylesheet
   Farben und Schrift folgen Logo 3 „Maßlinie“. Wer das Logo tauscht, ändert nur die Werte in :root. */

@font-face {
  font-family: "Sofia Sans";
  src: url("../fonts/sofia-sans-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}
@font-face {
  font-family: "Sofia Sans Condensed";
  src: url("../fonts/sofia-sans-condensed-latin.woff2") format("woff2");
  font-weight: 500 900;
  font-display: swap;
}

:root {
  --graphit: #2b2f33;
  --rot: #e2231a;
  --rot-dunkel: #b81a13;
  --zink: #eef1f3;
  --stahl: #5a636b;
  --linie: #c9d0d5;
  --weiss: #fff;
  --offen: #ffe66b;

  /* Namen, die der Tracking-Baustein (consent.css) erwartet */
  --ink: var(--graphit);
  --line: var(--linie);
  --text: var(--graphit);
  --ink-deep: #1b1e21;

  --schrift: "Sofia Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --schmal: "Sofia Sans Condensed", "Arial Narrow", "Sofia Sans", sans-serif;
  --rand: clamp(20px, 5vw, 64px);
  --breite: 1200px;
  --kopf: 72px;
}

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

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

body {
  margin: 0;
  font-family: var(--schrift);
  font-size: 1.125rem;
  line-height: 1.55;
  color: var(--graphit);
  background: var(--weiss);
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
p, h1, h2, h3, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }

h1, h2, h3 {
  font-family: var(--schmal);
  font-weight: 800;
  line-height: 1;
  text-wrap: balance;
}
h2 { font-size: clamp(2.1rem, 1.3rem + 3vw, 3.5rem); letter-spacing: -0.005em; }
h3 { font-size: 1.75rem; line-height: 1.05; }

:focus-visible { outline: 3px solid var(--rot); outline-offset: 3px; }

section[id] { scroll-margin-top: calc(var(--kopf) + 16px); }

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

.sprung { position: absolute; left: -9999px; top: 0; background: var(--graphit); color: var(--weiss); padding: 12px 16px; z-index: 20; }
.sprung:focus { left: 8px; top: 8px; }

/* Noch fehlende Angaben, in der Vorschau gelb markiert */
.offen { background: var(--offen); color: var(--graphit); padding: 0 0.25em; }

/* ---------- Knöpfe ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 24px;
  border: 2px solid var(--graphit);
  border-radius: 2px;
  background: transparent;
  color: var(--graphit);
  font: 700 1.0625rem/1 var(--schrift);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.btn:hover { background: var(--graphit); color: var(--weiss); }
.btn--rot { background: var(--rot); border-color: var(--rot); color: var(--weiss); }
.btn--rot:hover { background: var(--rot-dunkel); border-color: var(--rot-dunkel); color: var(--weiss); }

/* ---------- Kopf ---------- */
.kopf {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--weiss);
  border-bottom: 1px solid var(--linie);
}
.kopf__zeile { display: flex; align-items: center; gap: 24px; min-height: var(--kopf); }
.kopf__logo { display: block; flex: none; margin-right: auto; }
.kopf__logo img { width: 227px; height: 36px; }
.kopf__nav { display: none; }
.kopf__nav ul { display: flex; gap: 28px; }
.kopf__nav a { font-weight: 600; font-size: 1.0625rem; text-decoration: none; padding: 8px 0; border-bottom: 2px solid transparent; }
.kopf__nav a:hover { border-bottom-color: var(--rot); }
.kopf__cta { min-height: 44px; padding: 0 18px; }
.kopf__cta .lang { display: none; }

@media (min-width: 520px) {
  .kopf__cta .lang { display: inline; }
  .kopf__cta .kurz { display: none; }
}
@media (min-width: 900px) {
  .kopf__nav { display: block; }
  .kopf__logo img { width: 252px; height: 40px; }
}
@media (max-width: 380px) {
  .kopf__logo img { width: 189px; height: 30px; }
}
@media (max-width: 345px) {
  .kopf__zeile { gap: 12px; }
  .kopf__logo img { width: 151px; height: 24px; }
  .kopf__cta { padding: 0 12px; }
}

/* ---------- Hero ---------- */
.hero { padding-block: clamp(36px, 5vw, 64px) clamp(56px, 7vw, 104px); }
.hero__raster { display: grid; gap: clamp(36px, 5vw, 72px); align-items: center; }
/* Die Überschrift richtet sich nach der Spaltenbreite: Bei 14,5 % der Spalte passen bis zu
   6,6 em in eine Zeile, also auch lange Wörter ohne Trennung. */
.hero__text { container-type: inline-size; }
.hero h1 {
  font-size: clamp(2.25rem, 1.15rem + 5.4vw, 5rem);
  font-size: clamp(2.25rem, 14.5cqi, 5rem);
  line-height: 0.96;
  letter-spacing: -0.01em;
}
.hero__text p { margin-top: 24px; max-width: 33em; font-size: clamp(1.125rem, 1rem + 0.4vw, 1.3rem); color: var(--stahl); }
.hero__knoepfe { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero__bild figcaption { margin-top: 10px; font-size: 0.9375rem; color: var(--stahl); }

@media (min-width: 980px) {
  .hero__raster { grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr); }
}

/* Zeichnung im Hero: baut sich einmal beim Laden auf */
.bau { width: 100%; height: auto; overflow: visible; }
.bau__zahl { font-family: var(--schmal); font-weight: 700; font-size: 22px; fill: var(--graphit); }

.bau__pfosten { transform-box: fill-box; transform-origin: 50% 100%; animation: bau-wachsen 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: calc(var(--n) * 70ms); }
.bau__holm { transform-box: fill-box; transform-origin: 0 50%; animation: bau-ziehen 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: 0.5s; }
.bau__feld { animation: bau-setzen 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: calc(0.9s + var(--n) * 180ms); }
.bau__tuer { transform-box: fill-box; transform-origin: 0 50%; animation: bau-schwenken 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: calc(1.35s + var(--n) * 180ms); }
.bau__auto { animation: bau-zeigen 0.4s linear both; animation-delay: 1.7s; }
.bau__schloss, .bau__anker { animation: bau-zeigen 0.2s linear both; animation-delay: 2s; }
.bau__linie { stroke-dasharray: 1; animation: bau-messen 0.6s ease-out both; animation-delay: 2.15s; }
.bau__hilfe, .bau__strich, .bau__zahl { animation: bau-zeigen 0.3s linear both; animation-delay: 2.7s; }

@keyframes bau-wachsen { from { transform: scaleY(0); } }
@keyframes bau-ziehen { from { transform: scaleX(0); } }
@keyframes bau-setzen { from { transform: translateY(-32px); opacity: 0; } }
@keyframes bau-schwenken { from { transform: scaleX(0); opacity: 0; } }
@keyframes bau-zeigen { from { opacity: 0; } }
@keyframes bau-messen { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .bau * { animation: none !important; }
  .btn { transition: none; }
}

/* ---------- Abschnitte ---------- */
.abschnitt { padding-block: clamp(56px, 8vw, 112px); }
.abschnitt--zink { background: var(--zink); }
.abschnitt--dunkel { background: var(--graphit); color: var(--weiss); }
.abschnitt__einleitung { margin-top: 16px; max-width: 38em; color: var(--stahl); font-size: 1.1875rem; }
.abschnitt--dunkel .abschnitt__einleitung { color: #cfd5da; }

/* ---------- Leistungen ---------- */
.kacheln { display: grid; gap: 44px 32px; margin-top: clamp(36px, 5vw, 56px); }
.kachel__bild { background: var(--zink); aspect-ratio: 16 / 10; }
.kachel__bild svg { width: 100%; height: 100%; }
.kachel h3 { margin-top: 20px; }
.kachel p { margin-top: 8px; color: var(--stahl); max-width: 30em; }

@media (min-width: 640px) { .kacheln { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .kacheln { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---------- Für wen ---------- */
.fuer__raster { display: grid; gap: 32px clamp(32px, 6vw, 96px); }
.fuer__liste > div { padding-block: 18px; border-top: 1px solid var(--linie); display: grid; gap: 2px 24px; }
.fuer__liste > div:last-child { border-bottom: 1px solid var(--linie); }
.fuer__liste dt { font-family: var(--schmal); font-weight: 700; font-size: 1.5rem; line-height: 1.1; }
.fuer__liste dd { color: var(--stahl); }

@media (min-width: 720px) {
  .fuer__liste > div { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); align-items: baseline; }
}
@media (min-width: 980px) {
  .fuer__raster { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr); align-items: start; }
}

/* ---------- Ablauf: Schritte an einer Maßkette ---------- */
.schritte { display: grid; gap: 36px 0; margin-top: clamp(40px, 5vw, 64px); counter-reset: schritt; }
.schritt { position: relative; counter-increment: schritt; padding: 22px 24px 0 0; border-top: 2px solid var(--graphit); }
.schritt::before {
  content: "";
  position: absolute;
  left: 4px;
  top: -14px;
  width: 3px;
  height: 26px;
  background: var(--rot);
  transform: rotate(35deg);
}
.schritt__nr::before { content: counter(schritt); }
.schritt__nr { display: block; font: 800 3.25rem/1 var(--schmal); }
.schritt h3 { margin-top: 6px; }
.schritt p { margin-top: 8px; color: var(--stahl); max-width: 22em; }

@media (min-width: 640px) { .schritte { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .schritte { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---------- Einsatzgebiet ---------- */
.gebiet__raster { display: grid; gap: 48px clamp(32px, 6vw, 96px); align-items: center; }
.gebiet__text p + p { margin-top: 16px; }
.gebiet__text p { color: #cfd5da; max-width: 34em; }
.gebiet__text h2 + p { margin-top: 20px; }

.kette { --teil: 66.667%; padding-inline: 14px; }
.kette__bahn { position: relative; }
.kette__standort { width: max-content; margin-left: var(--teil); transform: translateX(-50%); text-align: center; line-height: 1.1; }
.kette__standort strong { display: block; font: 800 clamp(1.75rem, 1rem + 2vw, 2.5rem)/1 var(--schmal); }
.kette__standort span { font-size: 0.9375rem; color: #cfd5da; }
.kette__linie { position: relative; height: 30px; margin-top: 12px; }
.kette__linie::before { content: ""; position: absolute; inset: 14px 0 auto 0; height: 2px; background: var(--weiss); }
.kette__linie i { position: absolute; top: 0; width: 4px; height: 30px; margin-left: -2px; background: var(--rot); transform: rotate(35deg); }
.kette__linie i:nth-child(1) { left: 0; }
.kette__linie i:nth-child(2) { left: var(--teil); }
.kette__linie i:nth-child(3) { left: 100%; }
.kette__masse { display: flex; margin-top: 6px; font-weight: 600; }
.kette__masse span { text-align: center; }
.kette__masse span:first-child { flex: 2; }
.kette__masse span:last-child { flex: 1; }
.kette__orte { display: flex; justify-content: space-between; margin: 16px -14px 0; font: 700 1.5rem/1.1 var(--schmal); }
.kette__hinweis { margin: 18px -14px 0; font-size: 0.9375rem; color: #cfd5da; }

@media (min-width: 980px) {
  .gebiet__raster { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

/* ---------- Kontakt ---------- */
.kontakt__raster { display: grid; gap: 40px clamp(32px, 6vw, 96px); align-items: start; }
.kontakt__daten { margin-top: 32px; display: grid; gap: 18px; }
.kontakt__daten dt { font-size: 0.9375rem; color: var(--stahl); }
.kontakt__daten dd { font: 700 1.5rem/1.2 var(--schmal); }
.kontakt__daten dd a { text-decoration: none; }
.kontakt__daten dd a:hover { text-decoration: underline; }
.kontakt__daten .adresse { font: 400 1.125rem/1.5 var(--schrift); }

.formular { background: var(--zink); padding: clamp(20px, 4vw, 40px); display: grid; gap: 18px; }
.formular__reihe { display: grid; gap: 18px; }
.feld label { display: block; font-weight: 600; font-size: 1rem; margin-bottom: 6px; }
.feld label small { font-weight: 400; color: var(--stahl); font-size: 0.9375rem; }
.feld input, .feld select, .feld textarea {
  display: block;
  width: 100%;
  min-height: 50px;
  padding: 10px 12px;
  border: 1px solid #8d969d;
  border-radius: 2px;
  background: var(--weiss);
  color: var(--graphit);
  font: 400 1.0625rem/1.4 var(--schrift);
}
.feld textarea { min-height: 132px; resize: vertical; }
.feld [aria-invalid="true"] { border-color: var(--rot); border-width: 2px; }
.feld__fehler { margin-top: 6px; font-size: 0.9375rem; font-weight: 600; color: var(--rot-dunkel); }
.feld__fehler:empty { display: none; }
.formular__hinweis { font-size: 0.9375rem; color: var(--stahl); }
.formular__status { font-weight: 600; }
.formular__status:empty { display: none; }
.formular .btn { justify-self: start; }

@media (min-width: 560px) { .formular__reihe { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 980px) { .kontakt__raster { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); } }

/* ---------- Fuß ---------- */
.fuss { border-top: 1px solid var(--linie); padding-block: 40px 32px; font-size: 1rem; }
.fuss__raster { display: grid; gap: 28px; }
.fuss__logo img { width: 189px; height: 30px; }
.fuss__text { margin-top: 12px; color: var(--stahl); max-width: 26em; }
.fuss__links { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.fuss__links a, .consent-link { font-weight: 600; text-decoration: none; }
.fuss__links a:hover { text-decoration: underline; }
.fuss__unten { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--linie); display: flex; flex-wrap: wrap; gap: 6px 24px; justify-content: space-between; color: var(--stahl); font-size: 0.9375rem; }

@media (min-width: 800px) {
  .fuss__raster { grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
  .fuss__links { justify-content: flex-end; }
}

/* ---------- Rechtsseiten ---------- */
.recht { padding-block: clamp(40px, 6vw, 80px) clamp(56px, 8vw, 104px); }
.recht h1 { font-size: clamp(2.5rem, 1.5rem + 4vw, 4rem); }
.recht h2 { font-size: 1.75rem; margin-top: 40px; }
.recht p, .recht ul { margin-top: 12px; max-width: 42em; }
.recht ul { list-style: disc; padding-left: 1.2em; }
.recht__entwurf { margin-top: 20px; padding: 14px 18px; background: var(--offen); max-width: 42em; font-weight: 600; }

/* ---------- Cookie-Einwilligung (nur aktiv, wenn in consent.js eine GA-Mess-ID steht) ---------- */
.consent { position: fixed; z-index: 200; left: 16px; right: 16px; bottom: 16px; max-width: 560px; margin-left: auto; padding: 22px 22px 18px; background: #fff; color: var(--text); border: 1px solid var(--line); box-shadow: 0 18px 50px rgba(34, 39, 44, .22); font-size: 14.5px; line-height: 1.55; }
.consent[hidden] { display: none; }
.consent strong { display: block; margin-bottom: 6px; font-size: 16px; color: var(--ink); }
.consent a { color: var(--ink); text-decoration: underline; }
.consent__actions { margin-top: 16px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.consent__btn { justify-content: center; width: 100%; min-width: 0; padding: 0 14px; background: var(--ink); color: #fff; }
@media (max-width: 480px) { .consent__actions { grid-template-columns: 1fr; } .consent { padding: 18px 18px 16px; } }
.consent__btn:hover { background: var(--ink-deep); }
.consent-link { background: none; border: 0; padding: 0; margin-left: 10px; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; }
.consent-link[hidden] { display: none; }
.fuss__links .consent-link { margin-left: 0; font-weight: 600; text-decoration: none; }
.fuss__links .consent-link:hover { text-decoration: underline; }
