/* ==========================================================================
   Mühlmann Haustechnik – Stylesheet
   Aufbau: Fonts · Tokens · Reset · Basis · Layout · Komponenten · Seiten · Utilities
   ========================================================================== */

/* Fonts (lokal gehostet, kein Google-Request) ----------------------------- */
@font-face {
  font-family: "Source Sans 3";
  src: url("../fonts/source-sans-3-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("../fonts/source-sans-3-latin-wght-italic.woff2") format("woff2");
  font-weight: 200 900;
  font-style: italic;
  font-display: swap;
}

/* Tokens ------------------------------------------------------------------ */
:root {
  /* CI */
  --ci: #464848;
  --ci-light: #c9caca;
  --accent: #e7501e;
  --accent-strong: #c2410c;   /* AA-Kontrast auf Weiß / mit weißer Schrift */
  --accent-soft: #fdf0ea;

  /* Neutrals */
  --ink: #222424;
  --text: #3a3d3d;
  --muted: #646868;
  --line: #e4e4e0;
  --bg: #ffffff;
  --sand: #f4f3ef;
  --dark: #2b2d2d;
  --dark-2: #353838;

  /* Typo */
  --font: "Source Sans 3", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --fs-sm: clamp(0.875rem, 0.85rem + 0.1vw, 0.9375rem);
  --fs-base: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --fs-lg: clamp(1.1875rem, 1.1rem + 0.4vw, 1.375rem);
  --fs-h3: clamp(1.3rem, 1.15rem + 0.6vw, 1.6rem);
  --fs-h2: clamp(1.9rem, 1.4rem + 2vw, 3rem);
  --fs-h1: clamp(2.3rem, 1.5rem + 3.4vw, 4.25rem);

  /* Abstände */
  --gutter: clamp(1rem, 0.5rem + 2.5vw, 2.5rem);
  --section: clamp(4rem, 2.5rem + 6vw, 8rem);
  --radius: 14px;
  --radius-lg: 24px;
  --container: 1240px;

  --shadow-sm: 0 1px 2px rgb(0 0 0 / .05), 0 2px 8px rgb(0 0 0 / .04);
  --shadow: 0 2px 4px rgb(0 0 0 / .04), 0 12px 32px rgb(0 0 0 / .08);
  --ease: cubic-bezier(.2, .7, .2, 1);

  --header-h: 5.5rem; /* Höhe der schwebenden Header-Pille inkl. Abstand */
}

/* Reset ------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html {
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
  interpolate-size: allow-keywords;
}
body { min-height: 100dvh; }
img, picture, svg, video, iframe { display: block; max-width: 100%; }
img { height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
p, li, h1, h2, h3, h4 { overflow-wrap: break-word; }
h1, h2, h3, h4 { text-wrap: balance; }
p { text-wrap: pretty; }
ul[class], ol[class] { list-style: none; padding: 0; }

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  html { scroll-behavior: auto; }
  .emergency__phone .pulse::after { animation: none; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Cross-Document View Transitions (sanfter Seitenwechsel, progressiv) */
@view-transition { navigation: auto; }

/* Basis ------------------------------------------------------------------- */
body {
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-optical-sizing: auto;
}
h1, h2, h3, h4 { color: var(--ink); line-height: 1.12; font-weight: 700; letter-spacing: -0.015em; }
h1 { font-size: var(--fs-h1); letter-spacing: -0.025em; }
h2 { font-size: var(--fs-h2); letter-spacing: -0.02em; }
h3 { font-size: var(--fs-h3); }
a { color: var(--accent-strong); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
strong { color: var(--ink); font-weight: 650; }

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

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

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 1.25em; height: 1.25em; flex: none; }

.skip-link {
  position: fixed; left: 1rem; top: -100px; z-index: 100;
  background: var(--ink); color: #fff; padding: .75rem 1.25rem; border-radius: 8px;
  text-decoration: none; font-weight: 600;
}
.skip-link:focus { top: 1rem; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Layout ------------------------------------------------------------------ */
.container {
  width: min(100% - 2 * var(--gutter), var(--container));
  margin-inline: auto;
}
.container--narrow { --container: 820px; }

.section { padding-block: var(--section); background: var(--bg); }
.section--sand { background: var(--sand); }
.section--dark { background: var(--dark); color: #d6d8d8; }
.section--dark h2, .section--dark h3 { color: #fff; }
.section--tight { padding-block: calc(var(--section) * .6); }

.section-head { max-width: 46rem; margin-bottom: clamp(2rem, 1.5rem + 2vw, 3.5rem); }
.section-head p { margin-top: 1rem; font-size: var(--fs-lg); color: var(--muted); }
.section--dark .section-head p { color: #b9bcbc; }
.section-head--center { margin-inline: auto; text-align: center; }

.eyebrow {
  display: inline-flex; align-items: center; gap: .6rem;
  font-size: var(--fs-sm); font-weight: 650; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent-strong); margin-bottom: 1rem;
}
.section--dark .eyebrow, .hero .eyebrow, .page-hero .eyebrow { color: #ff8a5c; }

.grid-2 {
  display: grid; gap: clamp(2rem, 1rem + 4vw, 5rem); align-items: center;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
}

/* Buttons ----------------------------------------------------------------- */
.btn {
  --btn-bg: var(--ink); --btn-fg: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  min-height: 3.25rem; padding: .75rem 1.5rem;
  border: 2px solid var(--btn-bg); border-radius: 999px;
  background: var(--btn-bg); color: var(--btn-fg);
  font-weight: 650; font-size: 1.0625rem; line-height: 1.2; text-decoration: none;
  cursor: pointer; transition: transform .2s var(--ease), background-color .2s, border-color .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0); }
.btn .icon { width: 1.15em; height: 1.15em; }
.btn--accent { --btn-bg: var(--accent-strong); }
.btn--accent:hover { --btn-bg: #a8370a; }
.btn--light { --btn-bg: #fff; --btn-fg: var(--ink); }
.btn--ghost { --btn-bg: transparent; --btn-fg: currentColor; border-color: currentColor; }
.btn--ghost:hover { background: rgb(255 255 255 / .1); }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; }
/* Anruf-Button mit kleinem Kicker über der Nummer */
.btn--call { gap: .75rem; padding-block: .55rem; padding-inline: 1.25rem 1.6rem; text-align: left; font-variant-numeric: tabular-nums; }
.btn--call .icon { width: 1.3em; height: 1.3em; }
.btn--call small { display: block; font-size: .6875rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; opacity: .8; margin-bottom: .1rem; }
/* Notdienst: transparentes Orange (volles Orange bleibt der Anfrage vorbehalten) */
.btn--emergency {
  --btn-bg: rgb(231 80 30 / .2); --btn-fg: #fff;
  border-color: rgb(255 138 92 / .75);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.btn--emergency:hover { --btn-bg: rgb(231 80 30 / .34); }
.btn--emergency .icon, .btn--emergency small { color: #ff9a70; opacity: 1; }
/* Dieselben Pillen auf hellem Hintergrund (Kontaktmodul, Footer) */
.on-light .btn--ghost { color: var(--ink); border-color: rgb(34 36 36 / .7); }
.on-light .btn--ghost:hover { background: rgb(34 36 36 / .05); }
/* Notdienst auf hellem Grund farblich 1:1 wie in Hero/Sticky-Leiste (Dunkelgrau + orange Tönung) */
.on-light .btn--emergency {
  color: #fff;
  background: linear-gradient(rgb(231 80 30 / .2), rgb(231 80 30 / .2)), var(--dark);
  border-color: rgb(255 138 92 / .75);
}
.on-light .btn--emergency:hover { background: linear-gradient(rgb(231 80 30 / .34), rgb(231 80 30 / .34)), var(--dark); }
.on-light .btn--ghost .icon { color: var(--accent-strong); }

.link-arrow {
  display: inline-flex; align-items: center; gap: .4rem;
  font-weight: 650; text-decoration: none; color: var(--accent-strong);
}
.link-arrow .icon { transition: transform .2s var(--ease); }
.link-arrow:hover .icon { transform: translateX(4px); }

/* Header & Navigation ----------------------------------------------------- */
/*
 * Oben: komplett transparent, weißes Logo + Menü (liegt auf dem dunklen Hero).
 * Ab dem Scrollen (.is-scrolled): dezente Glas-Pille, kleineres Logo, Hintergrund darunter unscharf.
 * .is-dark (per JS): Pille liegt gerade über einem dunklen Bereich -> helle Schrift/helles Logo.
 */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  padding-top: clamp(.5rem, .25rem + 1vw, 1rem);
  pointer-events: none;
  color: var(--ink);
}
.site-header.is-dark { color: #fff; }
/* 3-Spalten-Raster: Navigation bleibt exakt mittig, egal wie breit das Logo gerade ist */
.site-header__inner {
  pointer-events: auto;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1.5rem;
  min-height: 4.25rem;
  /* Pille ragt um ihren Innenabstand über den Inhaltsbereich hinaus -> Logo und CTA stehen bündig
     mit den Modulen darunter. Auf schmalen Screens begrenzt der Bildschirmrand (0,5rem Luft). */
  --pill-pad: clamp(1rem, .5rem + 1vw, 1.5rem);
  width: min(100% - 1rem, min(100% - 2 * var(--gutter), var(--container)) + 2 * var(--pill-pad) + 2px);
  padding: .5rem var(--pill-pad);
  border-radius: 999px;
  border: 1px solid transparent;
  background-color: transparent;
  transition: background-color .4s var(--ease), border-color .4s, box-shadow .4s, backdrop-filter .4s, padding .4s var(--ease);
}
.site-header.is-scrolled .site-header__inner {
  background-color: rgb(255 255 255 / .3);
  border-color: rgb(255 255 255 / .5);
  box-shadow: 0 6px 24px rgb(0 0 0 / .06);
  backdrop-filter: blur(18px) saturate(1.5) brightness(1.06);
  -webkit-backdrop-filter: blur(18px) saturate(1.5) brightness(1.06);
}
/* Über dunklen Bereichen: Untergrund leicht abdunkeln, damit weiße Schrift auch über hellen Bildteilen lesbar bleibt */
.site-header.is-scrolled.is-dark .site-header__inner {
  background-color: rgb(255 255 255 / .08);
  border-color: rgb(255 255 255 / .16);
  box-shadow: 0 6px 24px rgb(0 0 0 / .15);
  backdrop-filter: blur(18px) saturate(1.3) brightness(.62);
  -webkit-backdrop-filter: blur(18px) saturate(1.3) brightness(.62);
}

.brand { display: grid; grid-column: 1; justify-self: start; }
.site-nav { grid-column: 2; }
.header-actions { grid-column: 3; justify-self: end; }
.brand__logo {
  grid-area: 1 / 1; height: auto;
  width: clamp(150px, 8vw + 100px, 200px);
  transition: width .4s var(--ease), opacity .3s;
}
.site-header.is-scrolled .brand__logo { width: clamp(130px, 6vw + 85px, 160px); }
.brand__logo--light { opacity: 0; }
.site-header.is-dark .brand__logo--light { opacity: 1; }
.site-header.is-dark .brand__logo--dark { opacity: 0; }

.header-actions { display: flex; align-items: center; gap: .5rem; }
.header-cta { min-height: 3.1rem; padding-inline: 1.35rem; }
@media (max-width: 599px) { .header-cta { display: none; } }

.nav-toggle, .nav-close {
  display: inline-grid; place-items: center;
  width: 3.1rem; height: 3.1rem; border: 0; border-radius: 999px;
  background: rgb(0 0 0 / .06); color: inherit; cursor: pointer;
  transition: background-color .3s;
}
.site-header.is-dark .nav-toggle { background: rgb(255 255 255 / .14); }
.nav-close { background: var(--sand); color: var(--ink); }
.nav-toggle .icon, .nav-close .icon { width: 24px; height: 24px; }

/* Mobil: Navigation als Popover-Panel (Popover API, ohne JS lauffähig) */
.site-nav {
  position: fixed; inset: 0 0 0 auto; margin: 0;
  width: min(100%, 26rem); height: 100dvh; max-height: none;
  padding: 1.25rem var(--gutter) 2rem; border: 0;
  background: #fff; color: var(--ink);
  flex-direction: column; gap: 1.5rem;
  box-shadow: -20px 0 60px rgb(0 0 0 / .15);
  opacity: 0; translate: 2rem 0;
  transition: opacity .3s var(--ease), translate .3s var(--ease), overlay .3s allow-discrete, display .3s allow-discrete;
}
.site-nav:popover-open { display: flex; opacity: 1; translate: 0 0; }
@starting-style { .site-nav:popover-open { opacity: 0; translate: 2rem 0; } }
.site-nav::backdrop { background: rgb(20 22 22 / .45); backdrop-filter: blur(3px); }
.nav-close { align-self: flex-end; }
.site-nav__list { display: flex; flex-direction: column; }
.site-nav__list a {
  display: block; padding: .9rem 0; border-bottom: 1px solid var(--line);
  font-size: 1.375rem; font-weight: 600; color: var(--ink); text-decoration: none;
}
.site-nav__list a[aria-current="page"] { color: var(--accent-strong); }
.site-nav__contact { margin-top: auto; display: grid; gap: .6rem; }
.site-nav__contact .btn { width: 100%; }

@media (min-width: 1100px) {
  .nav-toggle, .nav-close { display: none; }
  .site-nav,
  .site-nav:not(:popover-open) {
    display: flex; position: static; inset: auto; width: auto; height: auto;
    flex-direction: row; align-items: center; gap: 2rem;
    padding: 0; background: none; box-shadow: none; opacity: 1; translate: none; overflow: visible;
  }
  .site-nav__list { flex-direction: row; gap: .25rem; }
  .site-nav__list a {
    position: relative; padding: .5rem .75rem; border: 0; font-size: 1.0625rem; font-weight: 550;
    color: inherit; opacity: .88; transition: opacity .2s;
  }
  .site-nav__list a:hover, .site-nav__list a[aria-current="page"] { opacity: 1; }
  .site-nav { color: inherit; }
  .site-nav__list a::after {
    content: ""; position: absolute; left: .75rem; right: .75rem; bottom: .2rem; height: 2px;
    background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .25s var(--ease);
  }
  .site-nav__list a:hover::after, .site-nav__list a[aria-current="page"]::after { transform: scaleX(1); }
  .site-nav__list a[aria-current="page"] { color: inherit; }
  .site-nav__contact { display: none; }
}

/* Hero (Startseite) ------------------------------------------------------- */
/* Hero bleibt stehen (sticky), der folgende Inhalt scrollt darüber */
.hero {
  position: sticky; top: 0; z-index: 0;
  isolation: isolate; overflow: hidden;
  min-height: min(88svh, 52rem);
  display: grid; align-items: end;
  color: #fff;
}
:where(main > :not(.hero, .page-hero)) { position: relative; z-index: 1; }
.hero__media { position: absolute; inset: 0; z-index: -2; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; object-position: 40% 50%; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgb(24 26 26 / .6) 0, rgb(24 26 26 / 0) 10rem),
    linear-gradient(90deg, rgb(24 26 26 / .82) 0%, rgb(24 26 26 / .55) 45%, rgb(24 26 26 / .1) 100%),
    linear-gradient(0deg, rgb(24 26 26 / .6) 0%, transparent 45%);
}
.hero__content { padding-block: clamp(6rem, 4rem + 10vw, 10rem) clamp(3rem, 2rem + 4vw, 5rem); max-width: 48rem; }
.hero h1 { color: #fff; }
.hero h1 em { font-style: normal; color: #ff8a5c; }
.hero__lead { margin-top: 1.5rem; font-size: var(--fs-lg); color: rgb(255 255 255 / .88); max-width: 38rem; }
.hero .btn-row { margin-top: 2.25rem; }

/* Trust-Leiste */
.trust { background: var(--dark); color: #e9eaea; }
.trust__list {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: 1px; background: rgb(255 255 255 / .08);
}
.trust__item {
  display: flex; align-items: center; gap: .9rem;
  padding: 1.4rem clamp(1rem, .5rem + 1.5vw, 1.75rem); background: var(--dark);
  font-weight: 600; line-height: 1.3;
}
.trust__item .icon { width: 2rem; height: 2rem; color: #ff8a5c; }
.trust__item small { display: block; font-weight: 400; color: #a9adad; font-size: var(--fs-sm); }

/* Über uns ---------------------------------------------------------------- */
.about__media { position: relative; }
.about__media img { width: 100%; aspect-ratio: 4 / 4.2; object-fit: cover; object-position: 50% 20%; border-radius: var(--radius-lg); }
.about__caption {
  position: absolute; left: clamp(-1rem, -2vw, 0rem); bottom: 1.5rem;
  padding: 1rem 1.25rem; border-radius: var(--radius);
  background: #fff; box-shadow: var(--shadow); line-height: 1.3;
}
.about__caption strong { display: block; font-size: 1.125rem; }
.about__caption span { font-size: var(--fs-sm); color: var(--muted); }
.about__text p + p { margin-top: 1.1rem; }
.about__text h2 { margin-bottom: 1.5rem; }

/* Leistungs-Karten -------------------------------------------------------- */
.cards {
  display: grid; gap: clamp(1rem, .5rem + 1.5vw, 1.5rem);
  grid-template-columns: 1fr;
}
@media (min-width: 600px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .cards { grid-template-columns: repeat(4, 1fr); } .card__body { padding: 1.5rem 1.5rem 1.75rem; } }
.card {
  position: relative; display: flex; flex-direction: column;
  background: #fff; border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-sm); border: 1px solid var(--line);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card__media { aspect-ratio: 16 / 10; overflow: hidden; }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: scale .6s var(--ease); }
.card:hover .card__media img { scale: 1.04; }
.card__body { display: flex; flex-direction: column; gap: 1rem; padding: 1.75rem 1.75rem 2rem; flex: 1; }
.card__icon {
  display: grid; place-items: center; width: 3.25rem; height: 3.25rem; margin-top: -3.4rem;
  border-radius: 14px; background: var(--accent-strong); color: #fff; box-shadow: var(--shadow-sm);
  position: relative;
}
.card__icon .icon { width: 1.6rem; height: 1.6rem; }
.card h3 a { color: inherit; text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; } /* ganze Karte klickbar */
.card h3 a:focus-visible { outline: none; }
.card:has(h3 a:focus-visible) { outline: 3px solid var(--accent); outline-offset: 3px; }
.card p { color: var(--muted); }
.card .link-arrow { margin-top: auto; }
.card:hover .link-arrow .icon { transform: translateX(4px); }

.check-list { display: grid; gap: .55rem; }
.check-list li { display: flex; gap: .65rem; align-items: flex-start; line-height: 1.45; }
.check-list .icon { width: 1.25rem; height: 1.25rem; margin-top: .15rem; color: var(--accent-strong); }
.check-list--lg { gap: .9rem; font-size: var(--fs-lg); }
.section--dark .check-list .icon { color: #ff8a5c; }

/* Notdienst-Banner -------------------------------------------------------- */
/* 1:1 wie die Notdienst-Pille (dunkle Variante): Dunkelgrau mit orange Tönung, oranger Rand, weiße Schrift */
.emergency {
  position: relative; isolation: isolate; overflow: hidden;
  border-radius: var(--radius-lg);
  background: linear-gradient(rgb(231 80 30 / .2), rgb(231 80 30 / .2)), var(--dark); color: #fff;
  border: 2px solid rgb(255 138 92 / .75);
  padding: clamp(2rem, 1.25rem + 3vw, 3.75rem);
  display: grid; gap: 1.5rem 3rem; align-items: center;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
}
.emergency::before {
  content: ""; position: absolute; z-index: -1; right: -6rem; top: -8rem;
  width: 26rem; height: 26rem; border-radius: 50%;
  background: radial-gradient(circle, rgb(255 138 92 / .14), transparent 65%);
}
.emergency h2 { color: #fff; font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.4rem); }
.emergency p { margin-top: .75rem; color: rgb(255 255 255 / .82); }
.emergency__phone {
  justify-self: start; display: inline-flex; align-items: center; gap: 1rem;
  color: #fff; text-decoration: none; font-weight: 700; line-height: 1.1;
  font-size: clamp(1.75rem, 1.2rem + 2.4vw, 3rem); letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.emergency__phone small { display: block; font-size: .9rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: #ff9a70; margin-bottom: .35rem; }
.emergency__phone .pulse {
  position: relative; display: grid; place-items: center; flex: none;
  width: clamp(3.5rem, 3rem + 2vw, 4.5rem); aspect-ratio: 1; border-radius: 50%;
  background: rgb(231 80 30 / .2); color: #ff9a70;
  border: 2px solid rgb(255 138 92 / .75);
}
.emergency__phone .pulse::after {
  content: ""; position: absolute; inset: -2px; border-radius: inherit;
  border: 2px solid rgb(255 138 92 / .75); animation: pulse 2.2s var(--ease) infinite;
}
.emergency__phone .pulse .icon { width: 45%; height: 45%; }
@keyframes pulse { from { scale: 1; opacity: .8; } to { scale: 1.6; opacity: 0; } }
@media (min-width: 900px) { .emergency__phone { justify-self: end; } }

/* Ausbildung-Teaser ------------------------------------------------------- */
.split-media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-lg); }
.split-text p { margin-top: 1rem; }
.split-text .btn-row, .split-text .check-list { margin-top: 2rem; }

/* Kontakt ----------------------------------------------------------------- */
.contact {
  display: grid; gap: clamp(2rem, 1rem + 4vw, 4.5rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr));
  align-items: start;
}
.contact__info h2 { margin-bottom: 1rem; }
.contact__info > p { color: var(--muted); font-size: var(--fs-lg); }
.contact-pills { display: grid; gap: .75rem; justify-items: start; margin-top: 2rem; }
.contact-pills .btn { min-width: min(100%, 22rem); justify-content: flex-start; }
.contact-hours { margin-top: 1.5rem; display: grid; grid-template-columns: auto 1fr; gap: .2rem 1.25rem; font-size: var(--fs-sm); color: var(--muted); }
.contact-hours dt { font-weight: 600; color: var(--ink); }

/* Formular */
.form-card {
  background: #fff; border-radius: var(--radius-lg); border: 1px solid var(--line);
  box-shadow: var(--shadow); padding: clamp(1.5rem, 1rem + 2vw, 2.75rem);
}
.form-card h3 { margin-bottom: .4rem; }
.form-card > p { color: var(--muted); margin-bottom: 1.75rem; font-size: var(--fs-sm); }
.form-grid { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
.field { display: grid; gap: .4rem; align-content: start; } /* start: Feld nicht strecken, wenn nebenan eine Fehlermeldung steht */
.field--full { grid-column: 1 / -1; }
.field label { font-weight: 600; color: var(--ink); font-size: var(--fs-sm); }
.field label .req { color: var(--accent-strong); }
.field input, .field textarea, .field select {
  width: 100%; padding: .85rem 1rem; min-height: 3.25rem;
  border: 1.5px solid #d3d4d0; border-radius: 10px; background: #fcfcfb;
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}
.field textarea { min-height: 9rem; resize: vertical; field-sizing: content; max-height: 24rem; }
.field input:hover, .field textarea:hover { border-color: #b5b7b3; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--ci); background: #fff; box-shadow: 0 0 0 4px rgb(70 72 72 / .12); }
.field input:user-invalid, .field textarea:user-invalid { border-color: #c62828; background: #fff7f7; }
.field .error-text { display: none; color: #b71c1c; font-size: var(--fs-sm); }
.field:has(:user-invalid) .error-text { display: block; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-note { font-size: var(--fs-sm); color: var(--muted); grid-column: 1 / -1; }
.form-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin-top: .25rem; }
.form-actions .btn { min-width: 12rem; }
.btn[aria-busy="true"] { opacity: .7; pointer-events: none; }

.form-status {
  grid-column: 1 / -1; display: none; gap: .75rem; align-items: flex-start;
  padding: 1rem 1.25rem; border-radius: 12px; font-weight: 550;
}
.form-status.is-visible { display: flex; }
.form-status:focus { outline: none; } /* nur per Script fokussiert (Screenreader), kein Bedienelement */
.form-status--ok { background: #ecf7ef; color: #1b5e20; }
.form-status--error { background: #fdecec; color: #8e1b1b; }

/* Karte (2-Klick-Lösung) */
.map {
  position: relative; min-height: 26rem; background: #e7e7e3;
  display: grid; place-items: center; overflow: hidden;
}
.map iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.map__consent {
  position: relative; max-width: 34rem; margin: 2rem var(--gutter); padding: 2rem;
  background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow); text-align: center;
}
.map__consent > .icon { width: 2.5rem; height: 2.5rem; margin: 0 auto 1rem; color: var(--accent-strong); }
.map__consent h2 { font-size: var(--fs-h3); }
.map__consent p { margin: .6rem 0 1.5rem; font-size: var(--fs-sm); color: var(--muted); }
.map__consent .btn-row { justify-content: center; }
.map__pattern {
  position: absolute; inset: 0; opacity: .5;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
}

/* Unterseiten-Hero -------------------------------------------------------- */
.page-hero {
  position: sticky; top: 0; z-index: 0; isolation: isolate; overflow: hidden; color: #fff;
  min-height: clamp(20rem, 16rem + 18vw, 32rem); display: grid; align-items: end;
}
.page-hero__media { position: absolute; inset: 0; z-index: -2; }
.page-hero__media img { width: 100%; height: 100%; object-fit: cover; }
.page-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgb(24 26 26 / .55) 0, rgb(24 26 26 / 0) 9rem), linear-gradient(90deg, rgb(24 26 26 / .85), rgb(24 26 26 / .35)), linear-gradient(0deg, rgb(24 26 26 / .5), transparent 60%);
}
.page-hero__content { padding-block: calc(var(--header-h) + 3rem) clamp(2.5rem, 2rem + 3vw, 4rem); max-width: 44rem; }
.page-hero h1 { color: #fff; }
.page-hero p { margin-top: 1rem; font-size: var(--fs-lg); color: rgb(255 255 255 / .88); }

.breadcrumb { display: flex; flex-wrap: wrap; gap: .5rem; font-size: var(--fs-sm); margin-bottom: 1.25rem; color: rgb(255 255 255 / .75); }
.breadcrumb a { color: #fff; text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb li + li::before { content: "/"; margin-right: .5rem; opacity: .6; }

/* Fließtext (Rechtliches, Leistungsseiten) */
.prose { max-width: 46rem; }
.prose > * + * { margin-top: 1.1rem; }
.prose h2 { font-size: clamp(1.5rem, 1.25rem + 1vw, 2rem); margin-top: 3rem; }
.prose h3 { font-size: 1.25rem; margin-top: 2rem; }
.prose h2 + *, .prose h3 + * { margin-top: .75rem; }
.prose ul { padding-left: 1.25rem; }
.prose li + li { margin-top: .35rem; }
.prose address { font-style: normal; }
.prose .placeholder { background: #fff4d6; padding: .1em .4em; border-radius: 4px; }

.feature-grid {
  display: grid; gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
}
.feature {
  padding: 1.75rem; border-radius: var(--radius-lg); background: #fff; border: 1px solid var(--line);
}
.feature .icon-wrap {
  display: grid; place-items: center; width: 3rem; height: 3rem; margin-bottom: 1.1rem;
  border-radius: 12px; background: var(--accent-soft); color: var(--accent-strong);
}
.feature .icon-wrap .icon { width: 1.5rem; height: 1.5rem; }
.feature h3 { font-size: 1.25rem; margin-bottom: .5rem; }
.feature p { color: var(--muted); font-size: var(--fs-base); }

.steps { counter-reset: step; display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }
.step { position: relative; padding: 1.75rem; border-radius: var(--radius-lg); background: var(--dark-2); }
.step::before {
  counter-increment: step; content: "0" counter(step);
  display: block; margin-bottom: .75rem; font-size: 2.25rem; font-weight: 800; line-height: 1; color: #ff8a5c;
}
.step h3 { font-size: 1.2rem; margin-bottom: .4rem; }
.step p { color: #b9bcbc; }

.cta-band { text-align: center; }
.cta-band h2 { max-width: 40rem; margin-inline: auto; }
.cta-band p { max-width: 36rem; margin: 1rem auto 0; color: var(--muted); font-size: var(--fs-lg); }
.cta-band .btn-row { justify-content: center; margin-top: 2rem; }

.related { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); }
.related a {
  display: flex; align-items: center; gap: 1rem; padding: 1.25rem 1.5rem;
  border-radius: var(--radius); background: #fff; border: 1px solid var(--line);
  color: var(--ink); text-decoration: none; font-weight: 650; transition: border-color .2s, box-shadow .2s;
}
.related a:hover { border-color: var(--ci-light); box-shadow: var(--shadow-sm); }
.related a > .icon:first-child { width: 1.75rem; height: 1.75rem; color: var(--accent-strong); }
.related a > .icon:last-child { margin-left: auto; color: var(--muted); }

/* Footer ------------------------------------------------------------------ */
.site-footer { background: var(--sand); color: var(--text); padding-top: clamp(3.5rem, 2.5rem + 3vw, 5rem); font-size: var(--fs-sm); }
.site-footer__grid {
  display: grid; gap: 2.5rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
}
.site-footer__brand img { width: 180px; margin-bottom: 1.25rem; }
.site-footer__brand p { max-width: 22rem; color: var(--muted); }
.site-footer__title { font-size: .8125rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 1rem; font-weight: 650; }
.site-footer address { font-style: normal; line-height: 1.6; }
.site-footer a { color: var(--ink); text-decoration: none; }
.site-footer a:hover { color: var(--accent-strong); text-decoration: underline; }
.site-footer__contact, .site-footer__links { display: grid; gap: .5rem; margin-top: 1rem; }
.site-footer__links { margin-top: 0; }
.site-footer__contact a { display: inline-flex; gap: .5rem; align-items: center; }
.site-footer__contact .icon { width: 1rem; height: 1rem; color: var(--accent-strong); }
.site-footer__phones .btn-row { flex-direction: column; align-items: flex-start; gap: .6rem; }
.site-footer__bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem;
  margin-top: 3rem; padding-block: 1.5rem; border-top: 1px solid #dddcd6; color: var(--muted);
}
.site-footer__bottom ul { display: flex; gap: 1.5rem; list-style: none; padding: 0; }

/* Schwebende Anruf-Pille: dunkles Glas mit denselben Pillen wie im Hero (JS steuert .is-visible) */
.callpill {
  position: fixed; z-index: 40;
  left: 50%; bottom: calc(clamp(.75rem, .5rem + 1vw, 1.25rem) + env(safe-area-inset-bottom));
  translate: -50% 150%; opacity: 0; pointer-events: none;
  display: flex; gap: .4rem;
  width: max-content; max-width: calc(100% - 2 * var(--gutter));
  padding: .4rem; border-radius: 999px;
  color: #fff;
  background: rgb(34 36 36 / .72);
  border: 1px solid rgb(255 255 255 / .12);
  box-shadow: 0 12px 40px rgb(0 0 0 / .25);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  visibility: hidden;
  transition: translate .45s var(--ease), opacity .3s, visibility 0s linear .45s;
}
.callpill.is-visible { translate: -50% 0; opacity: 1; pointer-events: auto; visibility: visible; transition-delay: 0s; }
.callpill .btn { min-height: 3rem; }
@media (max-width: 599px) {
  .callpill { width: calc(100% - 2 * var(--gutter)); }
  .callpill .btn { flex: 1; padding-inline: .8rem; gap: .5rem; font-size: .9375rem; }
  .callpill .btn .icon { display: none; }
}

/* Scroll-Animationen (nur wo unterstützt und erwünscht) ------------------- */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .reveal {
      animation: reveal linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 40%;
    }
    @keyframes reveal { from { opacity: 0; translate: 0 2rem; } to { opacity: 1; translate: 0 0; } }
  }
  .hero__content > * { animation: hero-in .9s var(--ease) both; }
  .hero__content > :nth-child(2) { animation-delay: .08s; }
  .hero__content > :nth-child(3) { animation-delay: .16s; }
  .hero__content > :nth-child(4) { animation-delay: .24s; }
  @keyframes hero-in { from { opacity: 0; translate: 0 1.5rem; } }
}

/* 404 */
.notfound { padding-top: calc(var(--header-h) + var(--section)); min-height: 60vh; display: grid; place-items: center; text-align: center; }
.notfound .code { font-size: clamp(5rem, 3rem + 10vw, 9rem); font-weight: 800; line-height: 1; color: var(--accent); }
.notfound .btn-row { justify-content: center; margin-top: 2rem; }

/* Druck */
@media print {
  .site-header, .callpill, .map, .site-nav, .hero__media, .page-hero__media { display: none !important; }
  .hero, .page-hero { color: #000; min-height: 0; }
  .hero h1, .page-hero h1 { color: #000; }
}
.step a { color: #fff; }
.page-hero { background: var(--dark); }
.page-hero--plain { min-height: 0; }
.page-hero--plain::before { background: radial-gradient(60rem 30rem at 85% 0%, rgb(231 80 30 / .18), transparent 60%); }
.page-hero--plain .page-hero__content { padding-block: calc(var(--header-h) + clamp(2rem, 1rem + 3vw, 3.5rem)) clamp(3rem, 2rem + 4vw, 5rem); }
@media (max-width: 767px) {
  .hero::before { background: linear-gradient(180deg, rgb(24 26 26 / .6) 0, rgb(24 26 26 / 0) 8rem), linear-gradient(0deg, rgb(24 26 26 / .9) 0%, rgb(24 26 26 / .7) 55%, rgb(24 26 26 / .35) 100%); }
}
.prose > :first-child { margin-top: 0; }
h1, h2, h3, .trust__item { hyphens: auto; }


/* Hero wird unscharf, sobald der Inhalt darüber scrollt (--cover: 0…1, per JS).
   Performance: feste Unschärfe-Ebene, deren Deckkraft sich ändert – statt den Blur-Radius
   bei jedem Scroll-Schritt neu zu berechnen. */
.hero, .page-hero { --cover: 0; }
.hero::after, .page-hero::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  backdrop-filter: blur(14px) brightness(.68);
  -webkit-backdrop-filter: blur(14px) brightness(.68);
  opacity: var(--cover);
}
.hero:not(.is-covered)::after, .page-hero:not(.is-covered)::after { display: none; }
.site-footer .btn, .site-footer .btn:hover { text-decoration: none; color: var(--ink); }
.site-footer .btn--emergency, .site-footer .btn--emergency:hover { color: #fff; }
/* Überschrift, die nie umbrechen soll – Schrift skaliert auf schmalen Screens mit */
.one-line { white-space: nowrap; }
h2.one-line { font-size: min(var(--fs-h2), 8.6vw); }
h1 .one-line { font-size: min(var(--fs-h1), 9vw); }
/* Mobil: Hero scrollt normal weg (kein Stehenbleiben, keine Unschärfe) */
@media (max-width: 767px) {
  .hero, .page-hero { position: relative; }
  .hero::after, .page-hero::after { display: none; }
}
.emergency .emergency__note { font-size: var(--fs-sm); color: rgb(255 255 255 / .65); }
/* Bildausschnitte (Fokuspunkt) für einzelne Fotos */
.page-hero__media img[src*="/ausbildung-"] { object-position: 62% 18%; }
.page-hero__media img[src*="/klima-"] { object-position: 50% 30%; }
.page-hero__media img[src*="/waermepumpe-"] { object-position: 50% 45%; }
.page-hero__media img[src*="/klima-hero-"] { object-position: 72% 30%; }
.page-hero__media img[src*="/klima-aussen-"] { object-position: 85% 75%; }
