/* Erstattwerk Version B. Eigenes Stylesheet ohne Tailwind, wird von scripts/build_site.py nach site/assets/v2.css kopiert.
   Farben in OKLCH. Jede Nische setzt Farbton und Sättigung über body.theme-*. Alle drei auf Kontrast ≥ 4.5:1 geprüft
   (Markenfarbe auf Weiß: Ziegelrot 7.2:1, Petrol 6.5:1, Indigo 7.0:1; Hero-Text auf Markenfarbe ≥ 5.4:1). Neue Nischen genauso prüfen. */

@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url('/assets/fonts/archivo-latin-wdth-normal.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Tokens ---------- */

body {
  --hue: 250;
  --chroma: 0.12;
  --brand: oklch(0.47 var(--chroma) var(--hue));
  --brand-deep: oklch(0.36 calc(var(--chroma) * 0.75) var(--hue));
  --on-brand: oklch(0.93 0.03 var(--hue));
  --ink: oklch(0.21 0.012 var(--hue));
  --text: oklch(0.33 0.012 var(--hue));
  --muted: oklch(0.47 0.012 var(--hue));
  --line: oklch(0.89 0.006 var(--hue));
  --field: oklch(0.62 0.01 var(--hue));
  --error: oklch(0.5 0.2 25);
  --surface: oklch(0.965 0.003 var(--hue));
  --bg: oklch(0.995 0.002 var(--hue));
  --ink-muted: oklch(0.8 0.01 var(--hue));

  --radius: 4px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --measure: 65ch;
  --z-sticky: 10;
  --z-skip: 50;
}
.theme-bauprodukte { --hue: 38; --chroma: 0.14; }
.theme-kunststoff { --hue: 182; --chroma: 0.08; }
.theme-optik { --hue: 278; --chroma: 0.14; }
/* Start-, Danke- und Rechtsseiten: Erstattwerk selbst ist Tinte (Weiß darauf 16:1), die Nischen bringen ihre Farbe mit. */
.theme-neutral { --hue: 250; --chroma: 0.02; --brand: oklch(0.25 0.014 var(--hue)); --brand-deep: oklch(0.19 0.012 var(--hue)); }

/* ---------- Grundlagen ---------- */

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

body {
  margin: 0;
  font-family: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
@media (min-width: 48rem) { body { font-size: 1.125rem; } }

h1, h2, h3, p, ul, ol, dl, dd, figure, fieldset { margin: 0; }
ul, ol { padding: 0; list-style: none; }
fieldset { border: 0; padding: 0; min-width: 0; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 0.2em; }
sup { font-size: 0.62em; line-height: 0; vertical-align: super; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
::selection { background: var(--brand); color: #fff; }
/* Lange deutsche Komposita („Energieberatungsunternehmen“) brechen sonst auf 320 px nicht um. */
p, li, dd, dt, label, legend, summary { overflow-wrap: break-word; }
/* Nur lange Wörter trennen (ab 12 Zeichen, mindestens 5 davor und danach), damit kurze Wörter nicht zerhackt werden. */
@media (max-width: 47.99rem) {
  p, li, dd, label, legend {
    hyphens: auto; -webkit-hyphens: auto;
    hyphenate-limit-chars: 12 5 5; -webkit-hyphenate-limit-before: 5; -webkit-hyphenate-limit-after: 5;
  }
}

.skip {
  position: absolute; left: 1rem; top: -5rem; z-index: var(--z-skip);
  padding: 0.6rem 1rem; border-radius: var(--radius);
  background: #fff; color: var(--ink); font-weight: 600;
}
.skip:focus { top: 1rem; }

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

.h1, .h2, .h3 { color: var(--ink); font-weight: 760; text-wrap: balance; overflow-wrap: break-word; }
.h1 {
  font-stretch: 76%;
  font-size: clamp(2.6rem, 1.5rem + 4.6vw, 4.9rem);
  line-height: 0.98;
  letter-spacing: -0.015em;
}
.h2 {
  font-stretch: 80%;
  font-size: clamp(1.9rem, 1.3rem + 2.3vw, 3.1rem);
  line-height: 1.04;
  letter-spacing: -0.01em;
  max-width: 24ch;
}
.h2.narrow { max-width: 32ch; }
.h3 { font-stretch: 88%; font-size: 1.3rem; line-height: 1.2; }

.lead {
  font-size: clamp(1.125rem, 1rem + 0.45vw, 1.3rem);
  line-height: 1.5;
  max-width: 58ch;
  margin-top: 1.25rem;
  text-wrap: pretty;
}
.prose { max-width: var(--measure); }
.prose p + p { margin-top: 1rem; }
.hint { font-size: 0.875rem; line-height: 1.5; color: var(--muted); margin-top: 0.75rem; max-width: var(--measure); }

/* ---------- Raster ---------- */

.wrap { width: 100%; max-width: 75rem; margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2.5rem); }
.section { padding-block: clamp(4rem, 2.5rem + 6vw, 7.5rem); }
.surface { background: var(--surface); }

/* ---------- Buttons ---------- */

.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3.1rem; padding: 0.75rem 1.4rem;
  border: 2px solid transparent; border-radius: var(--radius);
  font: inherit; font-weight: 650; font-stretch: 92%; line-height: 1.2; text-align: center;
  text-decoration: none; cursor: pointer;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.1s var(--ease);
}
.button:active { transform: translateY(1px); }
.button-light { background: #fff; color: var(--brand-deep); }
.button-light:hover { background: var(--on-brand); }
.button-outline { border-color: oklch(1 0 0 / 0.55); color: #fff; }
.button-outline:hover { border-color: #fff; background: oklch(1 0 0 / 0.08); }
.button-brand { background: var(--brand); color: #fff; }
.button-brand:hover { background: var(--brand-deep); }
.button:disabled { opacity: 0.6; cursor: progress; }

/* ---------- Kopf und Hero (durchgehend in der Nischenfarbe) ---------- */

.masthead, .hero, .band { background: var(--brand); color: var(--on-brand); }
/* Auf dunklen und farbigen Flächen ist der Fokusrahmen weiß, Ziegelrot auf Fast-Schwarz hätte nur 2.4:1. */
.masthead :focus-visible, .hero :focus-visible, .band :focus-visible, .result :focus-visible { outline-color: #fff; }
/* Feste Höhe in ganzen Pixeln, sonst entsteht zwischen Kopf und Hero ein heller Haarspalt. */
.top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 4.75rem; }
.wordmark, .top-link { display: inline-flex; align-items: center; min-height: 2.75rem; color: #fff; }
.wordmark { gap: 0.6rem; text-decoration: none; font-weight: 800; font-stretch: 72%; font-size: 1.45rem; letter-spacing: -0.01em; }
.wordmark img { width: 2rem; height: 2rem; border-radius: 0.44rem; }
/* Auf Tinte hebt sich das dunkle Logo-Quadrat sonst kaum ab. */
.theme-neutral .wordmark img { box-shadow: 0 0 0 1px oklch(1 0 0 / 0.22); }
.top-link { font-weight: 600; font-size: 0.9375rem; }

.hero-grid {
  display: grid; gap: 2.5rem;
  padding-block: clamp(1.5rem, 0.5rem + 4vw, 4rem) clamp(3.5rem, 2rem + 5vw, 6rem);
}
@media (min-width: 60rem) {
  .hero-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr); align-items: end; gap: 4rem; }
}
.hero .h1 { color: #fff; max-width: 15ch; }
.hero .lead { color: var(--on-brand); margin-top: 1.5rem; }
.kicker { font-weight: 600; font-stretch: 90%; color: #fff; margin-bottom: 1.25rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2.25rem; }
/* Handy: Fakten als Zeilen (Bezeichnung links, Wert rechts), ab 40rem drei Spalten. */
.facts { margin-top: 2.5rem; border-top: 1px solid oklch(1 0 0 / 0.3); }
.facts > div { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding-block: 0.75rem; border-bottom: 1px solid oklch(1 0 0 / 0.18); }
.facts dt { font-size: 0.9375rem; color: var(--on-brand); }
.facts dd { color: #fff; font-weight: 650; font-stretch: 90%; text-align: right; white-space: nowrap; }
@media (max-width: 39.99rem) {
  .actions { flex-direction: column; }
  .actions .button { width: 100%; }
}
@media (min-width: 40rem) {
  .facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 2.75rem; }
  .facts > div { display: block; padding: 0.9rem 1.25rem 0 0; border-bottom: 0; }
  .facts dt { font-size: 0.875rem; }
  .facts dd { text-align: left; }
}

.photo-frame { overflow: hidden; border-radius: var(--radius); }
.photo-frame img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
@media (min-width: 40rem) and (max-width: 59.99rem) { .photo-frame img { aspect-ratio: 16 / 9; } }
@media (min-width: 60rem) { .photo-frame img { aspect-ratio: 4 / 5; } }

/* Ladeanimation: nur Bewegung, keine Deckkraft. Inhalte sind auch ohne Animation sofort sichtbar. */
@media (prefers-reduced-motion: no-preference) {
  .rise { animation: rise 0.9s var(--ease) both; }
  .rise.d1 { animation-delay: 0.06s; }
  .rise.d2 { animation-delay: 0.14s; }
  .rise.d3 { animation-delay: 0.22s; }
  .photo-frame img { animation: settle 1.6s var(--ease) both; }
}
@keyframes rise { from { transform: translateY(16px); } to { transform: none; } }
@keyframes settle { from { transform: scale(1.06); } to { transform: none; } }

/* ---------- Ablauf ---------- */

.steps { display: grid; gap: 2.5rem 2rem; margin-top: 3rem; }
@media (min-width: 40rem) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 68rem) { .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2rem; } }
.step { border-top: 2px solid var(--ink); padding-top: 1.25rem; display: flex; flex-direction: column; }
.step-n {
  font-weight: 780; font-stretch: 68%; font-size: 3.4rem; line-height: 0.9;
  color: var(--brand); font-variant-numeric: lining-nums; margin-bottom: 1rem;
}
.step p { margin-top: 0.6rem; }
.step-cost { margin-top: auto; padding-top: 1rem; font-size: 0.9375rem; font-weight: 600; color: var(--ink); }
/* Ab zwei Spalten teilt jeder Schritt die Zeilen des Rasters (Nummer, Titel, Text, Aufwand).
   So beginnt „Ihr Aufwand“ in jeder Spalte auf derselben Höhe, egal wie lang Titel und Text sind. */
@supports (grid-template-rows: subgrid) {
  @media (min-width: 40rem) {
    .steps { row-gap: 0; }
    .step { display: grid; grid-row: span 4; grid-template-rows: subgrid; row-gap: 0; padding-bottom: 2.5rem; }
    .step-cost { margin-top: 0; }
  }
  @media (min-width: 68rem) { .step { padding-bottom: 0; } }
}
.aside { margin-top: 3rem; max-width: var(--measure); color: var(--ink); font-weight: 500; }

/* ---------- Beispiele als Datenblatt ---------- */

.examples { margin-top: 3rem; border-top: 2px solid var(--ink); }
.example { display: grid; gap: 1.25rem 4rem; padding-block: 2.25rem; border-bottom: 1px solid var(--line); }
@media (min-width: 60rem) { .example { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.example-open { margin-top: 0.75rem; max-width: 52ch; }
.spec { display: grid; gap: 0.15rem; font-variant-numeric: tabular-nums lining-nums; }
/* Schmal: Bezeichnung über dem Wert. Ab 30rem: eine Zeile, Wert rechtsbündig. */
.spec > div { display: grid; gap: 0.1rem; padding-block: 0.45rem; }
.spec dt { color: var(--muted); font-size: 0.9375rem; }
.spec dd { color: var(--ink); }
@media (min-width: 30rem) {
  .spec > div { display: flex; justify-content: space-between; align-items: baseline; gap: 1.5rem; }
  .spec dd { text-align: right; }
}
.spec .spec-total { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; border-top: 1px solid var(--line); margin-top: 0.4rem; padding-top: 0.9rem; }
.spec .spec-total dt { color: var(--ink); font-weight: 600; }
.spec .spec-total dd { color: var(--brand); font-weight: 780; font-stretch: 72%; font-size: clamp(2rem, 1.5rem + 1.6vw, 2.75rem); line-height: 1; }

/* ---------- F&E ja / nein ---------- */

.split { display: grid; gap: 2.5rem 4rem; margin-top: 3rem; }
@media (min-width: 48rem) { .split { grid-template-columns: 1fr 1fr; } }
.checklist { margin-top: 1rem; border-top: 2px solid var(--ink); }
.checklist li { display: grid; grid-template-columns: 1.5rem 1fr; gap: 0.5rem; padding-block: 0.85rem; border-bottom: 1px solid var(--line); }
.checklist .mark { font-weight: 800; color: var(--brand); }
.checklist.no .mark { color: var(--muted); }
.note { margin-top: 2.5rem; max-width: var(--measure); color: var(--ink); font-weight: 500; }

/* ---------- Eingabefelder (Rechner und Anfrage) ---------- */

.field label, .field legend { display: block; margin-bottom: 0.45rem; font-size: 0.9375rem; font-weight: 600; color: var(--ink); }
.field legend { padding: 0; }
.hint-top { margin-top: -0.2rem; margin-bottom: 0.6rem; }
.optional { font-weight: 400; color: var(--muted); }
.input {
  display: block; width: 100%; min-height: 3.1rem; padding: 0.65rem 0.85rem;
  font: inherit; color: var(--ink); background: #fff;
  border: 1px solid var(--field); border-radius: var(--radius);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.input:hover { border-color: var(--text); }
.input:focus-visible { outline: none; border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand), 0 0 0 4px oklch(0.47 var(--chroma) var(--hue) / 0.18); }
.input::placeholder { color: var(--muted); }
/* Erst nach einer Eingabe rot (nicht schon beim Laden). Die Meldung schreibt app.js auf Deutsch unter das Feld. */
.input:user-invalid, .input[aria-invalid='true'] { border-color: var(--error); box-shadow: inset 0 0 0 1px var(--error); }
.field-error { margin-top: 0.4rem; font-size: 0.875rem; font-weight: 600; line-height: 1.4; color: var(--error); }
textarea.input { min-height: 6.5rem; resize: vertical; }
input[type='radio'], input[type='checkbox'] { width: 1.3rem; height: 1.3rem; margin: 0; accent-color: var(--brand); flex-shrink: 0; }
.check { display: grid; grid-template-columns: 1.3rem 1fr; gap: 0.75rem; align-items: start; font-size: 0.9375rem; color: var(--text); cursor: pointer; }
.check input { margin-top: 0.15rem; }

/* ---------- Rechner ---------- */

/* Ab Tablet stehen Eingaben und Ergebnis nebeneinander, damit man beim Ändern die Zahl sieht. */
.calc { display: grid; gap: 2.5rem clamp(2rem, 4vw, 4rem); margin-top: 3rem; }
@media (min-width: 48rem) { .calc { grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr); align-items: start; } }
/* Flex statt Grid: nur so kann die mitlaufende Zahl (.calc-peek) am Handy unten kleben bleiben. */
.fields { display: flex; flex-direction: column; gap: 1.75rem; }

.unit-input { position: relative; }
.unit-input .input { padding-right: 2.5rem; font-variant-numeric: tabular-nums; }
.unit { position: absolute; right: 0.95rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }

.field-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.field-head label { margin-bottom: 0; }
.field-head output { color: var(--brand); font-weight: 780; font-stretch: 76%; font-size: 1.5rem; line-height: 1; font-variant-numeric: tabular-nums lining-nums; }

/* Schieberegler: gefüllte Spur bis zum Griff (--fill setzt app.js), Griff 24 px für Daumen. */
.range { --fill: 40%; -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 2.75rem; margin: 0; background: transparent; cursor: pointer; }
.range::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(to right, var(--brand) var(--fill), var(--line) var(--fill)); }
.range::-moz-range-track { height: 6px; border-radius: 3px; background: var(--line); }
.range::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--brand); }
.range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 1.5rem; height: 1.5rem; margin-top: calc(3px - 0.75rem);
  border: 2px solid var(--brand); border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px oklch(0 0 0 / 0.18); transition: transform 0.15s var(--ease);
}
.range::-moz-range-thumb { box-sizing: border-box; width: 1.5rem; height: 1.5rem; border: 2px solid var(--brand); border-radius: 50%; background: #fff; box-shadow: 0 1px 3px oklch(0 0 0 / 0.18); }
.range:active::-webkit-slider-thumb { transform: scale(1.12); }
.range:focus-visible { outline-offset: 0; }

/* Ja/Nein als Umschalter: die echten Radio-Buttons liegen unsichtbar darüber, Tastatur und Screenreader bleiben nativ. */
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 3px; max-width: 18rem; padding: 3px; border: 1px solid var(--field); border-radius: var(--radius); background: #fff; }
.segmented label { position: relative; display: flex; margin: 0; font-size: 1rem; font-weight: 600; cursor: pointer; }
.segmented input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.segmented span { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 2.75rem; border-radius: 2px; color: var(--ink); transition: background-color 0.2s var(--ease), color 0.2s var(--ease); }
.segmented label:hover span { background: var(--surface); }
.segmented input:checked + span { background: var(--brand); color: #fff; }
.segmented input:focus-visible + span { outline: 3px solid var(--brand); outline-offset: 2px; }
/* Jahre: fünf Stufen in einer Zeile, am Handy etwas schmaler gesetzt, damit „nur 2026“ hineinpasst. */
.segmented-years { max-width: 34rem; }
.segmented-years span { padding-inline: 0.25rem; font-stretch: 88%; white-space: nowrap; font-variant-numeric: tabular-nums lining-nums; }
@media (max-width: 29.99rem) { .segmented-years span { font-size: 0.9375rem; font-stretch: 80%; } }
.frist-hint { display: none; }
.field:has(input[name='jahre'][value='4']:checked) .frist-hint { display: block; }

/* Übrige Auswahllisten (Formular): eigener Pfeil, damit Safari Höhe, Schrift und Rahmen der Seite übernimmt. */
select.input {
  -webkit-appearance: none; appearance: none; padding-right: 2.75rem; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' fill='none' viewBox='0 0 14 9'%3E%3Cpath stroke='%23655d59' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m1 1.5 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 1rem center; background-size: 0.875rem auto;
}

/* Handy: Ergebnis steht unter den Feldern. Diese Leiste zeigt die Zahl beim Ändern unten am Rand,
   app.js blendet sie aus, sobald die Ergebnisbox selbst im Bild ist. */
.calc-peek {
  position: sticky; bottom: 0; z-index: var(--z-sticky);
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  margin-inline: calc(-1 * clamp(1rem, 4vw, 2.5rem)); padding: 0.8rem clamp(1rem, 4vw, 2.5rem) calc(0.8rem + env(safe-area-inset-bottom, 0px));
  background: var(--ink); color: var(--ink-muted); font-size: 0.9375rem;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.calc-peek strong { color: #fff; font-weight: 780; font-stretch: 76%; font-size: 1.5rem; line-height: 1; font-variant-numeric: tabular-nums lining-nums; }
.calc-peek.is-hidden { opacity: 0; transform: translateY(0.5rem); pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .calc-peek { transition: opacity 0.2s linear; } .calc-peek.is-hidden { transform: none; } }
@media (min-width: 48rem) { .calc-peek { display: none; } }

@media (min-width: 48rem) { .result-col { position: sticky; top: 1.5rem; } }
.result { background: var(--ink); color: var(--ink-muted); border-radius: var(--radius); padding: clamp(1.5rem, 1rem + 2vw, 2.5rem); }
.result-label { font-size: 0.9375rem; }
.result-main {
  margin-top: 0.4rem; color: #fff; font-weight: 780; font-stretch: 70%;
  font-size: clamp(3rem, 2.2rem + 3vw, 4.4rem); line-height: 1; font-variant-numeric: tabular-nums lining-nums;
}
.result-rows { margin-top: 1.75rem; border-top: 1px solid oklch(1 0 0 / 0.18); font-variant-numeric: tabular-nums lining-nums; }
.result-rows > div { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding-block: 0.75rem; border-bottom: 1px solid oklch(1 0 0 / 0.18); }
.result-rows dd { color: #fff; font-weight: 650; }
.result .button { margin-top: 1.75rem; width: 100%; }
.method { margin-top: 1rem; font-size: 0.9375rem; }
.method summary {
  display: flex; align-items: center; gap: 0.6rem; min-height: 2.75rem;
  cursor: pointer; list-style: none; font-weight: 600; color: var(--ink);
}
.method summary::-webkit-details-marker { display: none; }
.method summary:hover { color: var(--brand); }
.method[open] .plus { transform: rotate(45deg); }
.calc-line { margin-top: 0.6rem; font-variant-numeric: tabular-nums; color: var(--text); }
ul.calc-line li + li { margin-top: 0.2rem; }

/* ---------- Team ---------- */

.people { display: grid; gap: 2.5rem 4rem; margin-top: 3rem; }
@media (min-width: 48rem) { .people { grid-template-columns: 1fr 1fr; } }
.person { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: 1.25rem; align-items: start; }
@media (max-width: 29.99rem) { .person { grid-template-columns: minmax(0, 1fr); gap: 1rem; } }
.person img { width: 5.5rem; height: 5.5rem; object-fit: cover; border-radius: var(--radius); }
.person p { margin-top: 0.4rem; }

/* ---------- Frist ---------- */

.band-grid { display: grid; gap: 1.5rem 4rem; }
@media (min-width: 60rem) { .band-grid { grid-template-columns: 1fr 1fr; align-items: start; } }
.band .h2 { color: #fff; }
.band .lead { margin-top: 0; color: var(--on-brand); }
.band .button { margin-top: 2rem; }

/* ---------- FAQ ---------- */

.faq { margin-top: 2.5rem; max-width: 54rem; border-top: 2px solid var(--ink); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1.5rem;
  padding-block: 1.2rem; cursor: pointer; list-style: none;
  font-weight: 650; font-stretch: 92%; font-size: 1.15rem; color: var(--ink);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: var(--brand); }
.plus { font-size: 1.5rem; line-height: 1; color: var(--brand); transition: transform 0.25s var(--ease); }
.faq details[open] .plus { transform: rotate(45deg); }
.answer { padding-bottom: 1.4rem; max-width: var(--measure); }

/* ---------- Anfrage ---------- */

/* Handy: Überschrift, gleich danach die Felder, dann „So geht es weiter“.
   Desktop: links Überschrift und Ablauf, rechts das Formular über die ganze Höhe. */
.anfrage { display: grid; gap: 2.25rem clamp(3rem, 7vw, 6.5rem); grid-template-areas: "head" "form" "more"; }
@media (min-width: 60rem) {
  .anfrage { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); grid-template-rows: auto 1fr; grid-template-areas: "head form" "more form"; align-items: start; }
}
.anfrage-head { grid-area: head; }
.anfrage-more { grid-area: more; }
.anfrage .form { grid-area: form; }
.kicker-ink { font-weight: 600; font-stretch: 90%; color: var(--brand); margin-bottom: 1rem; }
.anfrage .lead { margin-top: 1rem; color: var(--ink); }

.next { margin-top: 1rem; border-top: 2px solid var(--ink); }
.next li { display: grid; grid-template-columns: 1.75rem minmax(0, 1fr); gap: 0.75rem; padding-block: 0.9rem; border-bottom: 1px solid var(--line); }
.next-n { color: var(--brand); font-weight: 780; font-stretch: 68%; font-size: 1.5rem; line-height: 1.05; font-variant-numeric: lining-nums; }
.contact { display: flex; align-items: center; gap: 1rem; margin-top: 1.75rem; font-size: 0.9375rem; }
.contact-photos { display: flex; gap: 0.375rem; flex-shrink: 0; }
.contact-photos img { width: 3rem; height: 3rem; object-fit: cover; border-radius: var(--radius); }

/* Das Formular ist die eine weiße Fläche im grauen Abschnitt: hier wird gehandelt. */
.form {
  display: grid; gap: 1.5rem 1.25rem; align-items: end;
  padding: clamp(1.25rem, 0.5rem + 3vw, 2.5rem);
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 1px 2px oklch(0.21 0.012 var(--hue) / 0.04), 0 12px 32px -12px oklch(0.21 0.012 var(--hue) / 0.12);
}
@media (min-width: 40rem) { .form { grid-template-columns: 1fr 1fr; } .form .full { grid-column: 1 / -1; } }
/* Zwei Felder nebeneinander: Beschriftung, Feld und Fehlermeldung je in einer gemeinsamen Zeile,
   damit die Felder auf einer Höhe bleiben, auch wenn nur neben einem eine Meldung steht. */
@supports (grid-template-rows: subgrid) {
  @media (min-width: 40rem) {
    .form > .field { display: grid; grid-row: span 3; grid-template-rows: subgrid; row-gap: 0; }
    .form > .field > label { align-self: end; }
  }
}
.form .button { width: 100%; min-height: 3.4rem; padding-inline: 1rem; font-size: 1.0625rem; }
/* 375 px: Knopftext bleibt einzeilig. */
@media (max-width: 29.99rem) { .form .button { font-size: 1rem; } }
.consent { display: grid; grid-template-columns: 1.3rem 1fr; gap: 0.75rem; align-items: start; font-size: 0.875rem; line-height: 1.5; color: var(--text); }
.consent input { margin-top: 0.1rem; }
.consent label { cursor: pointer; }
.consent .field-error { grid-column: 2; margin-top: 0; }
/* Statuszeile bleibt im Barrierefreiheitsbaum (sonst liest der Screenreader „Wird gesendet …“ nicht vor), nur ohne Abstand. */
.status { margin-top: 0.75rem; font-weight: 600; color: var(--ink); }
.status:empty { margin: 0; }
.status a { color: inherit; }

/* ---------- Fußnoten und Fuß ---------- */

.notes { padding-block: 3rem; font-size: 0.875rem; color: var(--muted); }
.notes p { max-width: 80ch; }
.notes p + p { margin-top: 0.4rem; }
.notes a { white-space: nowrap; }
.foot { background: var(--bg); color: var(--text); border-top: 1px solid var(--line); padding-block: 3.5rem; font-size: 0.9375rem; }
.foot-grid { display: grid; gap: 2.5rem; }
@media (min-width: 75rem) { .foot-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 3fr); gap: 3rem; } }
.foot-logo { display: inline-flex; align-items: center; gap: 0.75rem; min-height: 2.75rem; color: var(--ink); text-decoration: none; font-weight: 800; font-stretch: 72%; font-size: 1.45rem; letter-spacing: -0.01em; }
.foot-logo img { width: 2.5rem; height: 2.5rem; }
.foot-address { margin-top: 1.25rem; font-style: normal; color: var(--muted); }
/* Handy: Spalten untereinander, ab 40rem zwei, ab 64rem vier nebeneinander mit Trennlinien wie bei Förderkollegen. */
.foot-cols { display: grid; gap: 1.5rem 2rem; }
@media (min-width: 40rem) { .foot-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 64rem) { .foot-cols { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; } }
.foot-col { --brand: oklch(0.47 var(--chroma) var(--hue)); padding-top: 1.25rem; border-top: 1px solid var(--line); }
@media (min-width: 64rem) { .foot-col { padding: 0 0 0 1.5rem; border-top: 0; border-left: 1px solid var(--line); } }
/* Handy: Branchen-Links nebeneinander, damit der Footer nicht vier volle Listen lang wird. */
@media (max-width: 39.99rem) { .foot-col:not(.foot-col-home) ul { display: flex; flex-wrap: wrap; column-gap: 1.25rem; } }
.foot-head { color: var(--brand); font-weight: 700; font-stretch: 92%; font-size: 1rem; line-height: 1.3; margin-bottom: 0.4rem; }
.foot-col-home .foot-head { color: var(--ink); }
.foot-col a { display: inline-flex; align-items: center; min-height: 2.5rem; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.foot-col a:hover { color: var(--brand); text-decoration: underline; }

/* ---------- Startseite ---------- */

/* Kein Foto im Hero: rechts stehen die drei Fakten als Datenblatt-Zeilen. */
@media (min-width: 60rem) { .hero-grid-start { grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.6fr); } }
@media (min-width: 40rem) {
  .facts-stack { display: block; }
  .facts-stack > div { display: flex; padding-block: 0.85rem; padding-right: 0; border-bottom: 1px solid oklch(1 0 0 / 0.18); }
  .facts-stack dt { font-size: 0.9375rem; }
  .facts-stack dd { text-align: right; }
}
@media (min-width: 60rem) { .facts-stack { margin-top: 0; } }

/* Jede Zeile rechnet ihre Markenfarbe aus der Nischenklasse neu aus. */
.branches { margin-top: 3rem; border-top: 2px solid var(--ink); }
.branch { --brand: oklch(0.47 var(--chroma) var(--hue)); border-bottom: 1px solid var(--line); }
.branch a {
  display: grid; grid-template-columns: 5.5rem minmax(0, 1fr) auto; gap: 1.25rem; align-items: center;
  padding-block: 1.25rem; color: inherit; text-decoration: none;
}
@media (min-width: 48rem) { .branch a { grid-template-columns: 13rem minmax(0, 1fr) auto; gap: 2.5rem; padding-block: 1.75rem; } }
.branch img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); }
@media (min-width: 48rem) { .branch img { aspect-ratio: 3 / 2; } }
.branch-name {
  display: block; color: var(--ink); font-weight: 760; font-stretch: 80%;
  font-size: clamp(1.35rem, 1rem + 1.4vw, 2.1rem); line-height: 1.08; text-wrap: balance;
  transition: color 0.2s var(--ease);
}
.branch-desc { display: block; margin-top: 0.4rem; color: var(--text); }
.branch-arrow { color: var(--brand); font-size: 1.75rem; font-weight: 600; line-height: 1; transition: transform 0.25s var(--ease); }
.branch a:hover .branch-name { color: var(--brand); }
.branch a:hover .branch-arrow { transform: translateX(4px); }
.branch a:focus-visible { outline-offset: 4px; }
@media (max-width: 47.99rem) { .branch-desc { hyphens: auto; -webkit-hyphens: auto; hyphenate-limit-chars: 12 5 5; } }

/* ---------- Danke- und Rechtsseiten ---------- */

.page { padding-block: clamp(3rem, 2rem + 4vw, 5.5rem) clamp(4rem, 2.5rem + 6vw, 7.5rem); }
.danke { max-width: 42rem; }
.danke .next { margin-top: 2.5rem; }
.danke .button { margin-top: 2.5rem; }
.legal { max-width: var(--measure); }
.legal h1 {
  color: var(--ink); font-weight: 760; font-stretch: 80%; text-wrap: balance;
  font-size: clamp(1.9rem, 1.3rem + 2.3vw, 3.1rem); line-height: 1.04; letter-spacing: -0.01em;
}
.legal h2 { color: var(--ink); font-weight: 760; font-stretch: 88%; font-size: 1.2rem; line-height: 1.25; margin-top: 2.25rem; text-wrap: balance; }
.legal p, .legal ul { margin-top: 0.6rem; }
.legal ul { list-style: disc; padding-left: 1.25rem; }
.legal li + li { margin-top: 0.3rem; }
.legal strong { color: var(--ink); font-weight: 650; }
.legal h1 + p { color: var(--muted); font-size: 0.9375rem; }

/* Drei Streifen in den Nischenfarben: das Erkennungszeichen auf den Seiten ohne Nische (und im Vorschaubild). */
.tricolor { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); height: 0.375rem; }
.tricolor span { background: oklch(0.47 var(--chroma) var(--hue)); }

/* ---------- Ältere Browser ohne OKLCH (z. B. Chrome 109 auf Windows 7, Safari vor 15.4) ----------
   Ohne diesen Block wären dort alle Farben ungültig: weiße Hero-Schrift auf weißem Grund.
   Werte aus den OKLCH-Tokens oben umgerechnet; die Nischentönung der Grautöne entfällt. */
@supports not (color: oklch(0 0 0)) {
  body {
    --brand: #175d9b; --brand-deep: #0e3f6a; --on-brand: #d9eafc;
    --ink: #14191e; --text: #31363b; --muted: #565b61; --line: #d8dbdf; --field: #82878c;
    --error: #bb061e; --surface: #f2f4f5; --bg: #fcfdff; --ink-muted: #b9bec4;
  }
  .theme-bauprodukte { --brand: #993613; --brand-deep: #69230c; --on-brand: #fbe2da; }
  .theme-kunststoff { --brand: #0f695e; --brand-deep: #0a473f; --on-brand: #d3efe9; }
  .theme-optik { --brand: #4b4ea7; --brand-deep: #323473; --on-brand: #e3e6fc; }
  .theme-neutral { --brand: #1d2228; --brand-deep: #101419; --on-brand: #d9eafc; }
  .foot-col-home { --brand: var(--ink); }
  .tricolor span { background: var(--brand); }
  .button-outline { border-color: rgba(255, 255, 255, 0.55); }
  .button-outline:hover { background: rgba(255, 255, 255, 0.08); }
  .theme-neutral .wordmark img { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.22); }
  /* Rahmen mit OKLCH-Farbe verwirft der Browser ganz, deshalb hier vollständig neu. */
  .facts { border-top: 1px solid rgba(255, 255, 255, 0.3); }
  .result-rows { border-top: 1px solid rgba(255, 255, 255, 0.18); }
  .result-rows > div { border-bottom: 1px solid rgba(255, 255, 255, 0.18); }
  @media (max-width: 39.99rem) { .facts > div { border-bottom: 1px solid rgba(255, 255, 255, 0.18); } }
  @media (min-width: 40rem) { .facts-stack > div { border-bottom: 1px solid rgba(255, 255, 255, 0.18); } }
  .input:focus-visible { box-shadow: 0 0 0 1px var(--brand), 0 0 0 4px rgba(20, 25, 30, 0.12); }
  .range::-webkit-slider-thumb { box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18); }
  .range::-moz-range-thumb { box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18); }
  .form { box-shadow: 0 1px 2px rgba(20, 25, 30, 0.04), 0 12px 32px -12px rgba(20, 25, 30, 0.12); }
}
