/* ==========================================================================
   Broich & Sohn - Landingpage
   Radius-Regel: Interaktives = Pill, Flächen & Bilder = 16px, Eingabefelder = 10px
   Farben: ein Akzent (Blau aus dem Logo), Rot ausschließlich für den Notdienst
   ========================================================================== */

:root {
  --accent: #0f62b0;
  --accent-hover: #0b4f8f;
  --accent-soft: #e7f0f9;
  --on-accent: #ffffff;
  --sos: #c4211a;          /* Text/Rahmen, 5.1:1 auf --sos-soft */
  --sos-fill: #c4211a;     /* Flächen mit weißer Schrift, 5.9:1 */
  --sos-soft: #fdeceb;

  --text: #16191c;
  --text-muted: #4f565c;   /* 7.5:1 auf Weiß */
  --surface: #ffffff;
  --surface-alt: #f3f5f7;
  --line: #dde2e6;
  --input-border: #7c858c; /* 3.8:1, Nicht-Text-Kontrast >= 3:1 */
  --shadow: 0 12px 32px -14px rgba(15, 50, 90, .28);

  --r-box: 16px;
  --r-input: 10px;
  --container: 1200px;
  --header-h: 76px;
  --mobile-bar-h: 72px;
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --ease-in-out: cubic-bezier(.77, 0, .175, 1);
  /* Feder mit leichtem Überschwingen (bounce ~0.2), als linear()-Kurve */
  --spring: linear(0, .009, .035 2.1%, .141 4.4%, .723 12.9%, .938 16.7%, 1.017 20.5%, 1.061 24.4%, 1.071 28.3%, 1.047 34.2%, 1.01 42%, .994 50%, .996 60%, 1);

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent: #5aaef0;
    --accent-hover: #86c4f5;
    --accent-soft: #15283a;
    --on-accent: #0b1520;
    --sos: #f26a63;        /* 5.3:1 auf --sos-soft, 6.1:1 auf --surface */
    --sos-fill: #c4211a;   /* weiße Schrift bleibt bei 5.9:1 */
    --sos-soft: #3a1917;

    --text: #eceff1;
    --text-muted: #a5aeb5;
    --surface: #121518;
    --surface-alt: #191d21;
    --line: #2a3036;
    --input-border: #6c767f; /* 4.0:1 */
    --shadow: 0 12px 32px -14px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
/* iOS Safari: Schriftgröße folgt der Systemeinstellung (Dynamic Type), alle rem-Werte skalieren mit */
@supports (font: -apple-system-body) { html { font: -apple-system-body; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
img { height: auto; }
figure { margin: 0; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.1; letter-spacing: -.025em; margin: 0 0 .5em; color: var(--text); text-wrap: balance; }
h1 { font-size: clamp(2.25rem, 4.4vw, 3.4rem); font-weight: 800; }
h2 { font-size: clamp(1.75rem, 3.2vw, 2.5rem); font-weight: 800; }
h3 { font-size: 1.3rem; font-weight: 700; letter-spacing: -.015em; }
p { margin: 0 0 1em; }

.container {
  width: 100%; max-width: var(--container); margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
}
@media (min-width: 640px) {
  .container { padding-left: max(32px, env(safe-area-inset-left)); padding-right: max(32px, env(safe-area-inset-right)); }
}

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--text); color: var(--surface); padding: 10px 16px; border-radius: 999px;
}
.skip-link:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.eyebrow {
  font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 1rem;
}

/* Buttons ------------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 48px; padding: .7rem 1.35rem;
  font: inherit; font-weight: 700; font-size: 1rem; line-height: 1.2; text-decoration: none; white-space: nowrap;
  border: 2px solid transparent; border-radius: 999px; cursor: pointer;
  transition: background-color 200ms ease, border-color 200ms ease, transform 160ms var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.btn svg { width: 18px; height: 18px; }
.btn:active { transform: scale(.97); }
.btn-lg { min-height: 54px; padding: .85rem 1.7rem; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-ghost { border-color: var(--line); color: var(--text); background: transparent; }
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover { background: var(--accent-hover); }
  .btn-ghost:hover { border-color: var(--text); }
}

/* Logo --------------------------------------------------------------------- */
/* Das Logo hat einen weißen Hintergrund, im Dark Mode sitzt es auf einem hellen Chip */
.logo-chip { display: inline-block; background: #fff; border-radius: 10px; line-height: 0; }
.logo-chip img { height: 56px; width: auto; }
@media (prefers-color-scheme: dark) {
  .logo-chip { padding: 4px 6px; background: #e9ecee; }
  .logo-chip img { filter: brightness(.93); } /* weißen Logohintergrund dämpfen, damit er nicht leuchtet */
}
.logo-chip-lg img { height: 96px; }

/* Header ------------------------------------------------------------------- */
.scroll-sentinel { position: absolute; top: 0; height: 8px; width: 1px; }
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms ease;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.header-inner { display: flex; align-items: center; gap: 32px; height: var(--header-h); }

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); margin-right: auto; }
.brand-text { font-weight: 800; font-size: 1.15rem; line-height: 1.15; letter-spacing: -.01em; }
.brand-text small { display: block; font-weight: 500; font-size: .78rem; color: var(--text-muted); letter-spacing: 0; }

.main-nav ul { display: flex; gap: clamp(16px, 2vw, 28px); list-style: none; margin: 0; padding: 0; }
.main-nav a { color: var(--text); text-decoration: none; font-weight: 600; font-size: .98rem; }

.nav-toggle {
  display: none; width: 48px; height: 48px; margin-right: -8px; border: 0; background: transparent; cursor: pointer;
  flex-direction: column; justify-content: center; align-items: center; gap: 5px;
}
.nav-toggle { -webkit-tap-highlight-color: transparent; }
.nav-toggle span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: transform 250ms var(--ease-out), opacity 150ms ease; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 899px) {
  :root { --header-h: 68px; }
  .logo-chip img { height: 48px; }
  .header-cta { display: none; }
  .nav-toggle { display: flex; }
  .main-nav {
    position: absolute; inset: var(--header-h) 0 auto 0;
    background: var(--surface); border-bottom: 1px solid var(--line);
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    /* Schließen: schnell (150ms) */
    transition: opacity 150ms ease, transform 150ms var(--ease-out), visibility 0s linear 150ms;
  }
  .main-nav.is-open {
    opacity: 1; visibility: visible; transform: none;
    /* Öffnen: 200ms */
    transition: opacity 200ms ease, transform 200ms var(--ease-out), visibility 0s;
  }
  .main-nav ul { flex-direction: column; gap: 0; padding: 4px 16px 12px; }
  .main-nav li + li { border-top: 1px solid var(--line); }
  .main-nav a { display: block; padding: 16px 0; font-size: 1.1rem; }
}

/* Hero --------------------------------------------------------------------- */
.hero { padding: 32px 0 56px; }
.hero-inner { display: grid; gap: 32px; align-items: center; }
@media (min-width: 900px) {
  .hero { padding: 48px 0 88px; }
  .hero-inner { grid-template-columns: 1.05fr .95fr; gap: 64px; }
}
.hero h1 em { font-style: normal; color: var(--accent); }
.lead { font-size: 1.2rem; color: var(--text-muted); max-width: 32em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

/* Rahmen sitzt auf der figure, damit das Bild darin zoomen/verschieben kann (Parallax) */
.hero-media { overflow: hidden; border-radius: var(--r-box); box-shadow: var(--shadow); isolation: isolate; }
.hero-media img {
  width: 100%; aspect-ratio: 4 / 5; object-fit: cover;
  max-height: calc(100dvh - var(--header-h) - 80px);
}
/* Mobil: flaches Querformat, höchstens ein Drittel der Displayhöhe */
@media (max-width: 899px) { .hero-media img { aspect-ratio: 16 / 9; max-height: 32svh; } }

/* Notdienst ---------------------------------------------------------------- */
.emergency { background: var(--sos-soft); }
.emergency-inner { display: flex; align-items: center; gap: 12px 20px; padding-block: 18px; flex-wrap: wrap; }
.emergency p { margin: 0; flex: 1 1 320px; }
.emergency-mark {
  display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%;
  background: var(--sos-fill); color: #fff; font-weight: 800; font-size: 1.1rem;
}
.emergency p small { display: block; margin-top: 2px; font-size: .9rem; color: var(--text-muted); }
.emergency-link {
  display: inline-flex; align-items: center; min-height: 44px;
  color: var(--sos); font-weight: 700; text-decoration: none; white-space: nowrap;
  padding: .5rem 1.2rem; border: 2px solid var(--sos); border-radius: 999px;
  transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease, transform 160ms var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.emergency-link:active { transform: scale(.97); }
@media (hover: hover) and (pointer: fine) {
  .emergency-link:hover { background: var(--sos-fill); border-color: var(--sos-fill); color: #fff; }
}

/* Sections ----------------------------------------------------------------- */
.section { padding: 72px 0; }
@media (min-width: 900px) { .section { padding: 112px 0; } }
.section-alt { background: var(--surface-alt); }
.section-head { max-width: 62ch; margin-bottom: 40px; }
.section-head p { color: var(--text-muted); font-size: 1.1rem; margin: 0; }

/* Leistungen (Bento) ------------------------------------------------------- */
.bento { display: grid; gap: 16px; }
@media (min-width: 720px) {
  .bento { grid-template-columns: repeat(2, 1fr); }
  .tile-heating { grid-column: 1 / -1; }
}
@media (min-width: 1024px) {
  .bento { grid-template-columns: 1.25fr 1fr 1fr; grid-template-rows: auto auto; }
  .tile-heating { grid-column: 1; grid-row: 1 / span 2; }
  .tile-bath { grid-column: 2 / span 2; }
}

.tile {
  position: relative; overflow: hidden;
  padding: 28px; border-radius: var(--r-box);
  background: var(--surface-alt);
  display: flex; flex-direction: column;
}
.tile p { color: var(--text-muted); font-size: .98rem; margin-bottom: 0; }
.tile-icon {
  display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 24px;
  border-radius: 50%; background: var(--surface); color: var(--accent);
}
.tile-icon svg { width: 24px; height: 24px; }
.tile { transition: transform 250ms var(--ease-out), box-shadow 250ms ease; }
.tile-icon { transition: transform 600ms var(--spring); }
@media (hover: hover) and (pointer: fine) {
  .tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -20px color-mix(in srgb, var(--accent) 55%, transparent);
  }
  .tile:hover .tile-icon { transform: rotate(-10deg) scale(1.12); }
}

.tile-bath { background: var(--accent); }
.tile-bath h3, .tile-bath p { color: var(--on-accent); }
.tile-bath p { opacity: .88; }
.tile-bath .tile-icon { background: color-mix(in srgb, var(--on-accent) 16%, transparent); color: var(--on-accent); }
.tile-bath .chips li { background: color-mix(in srgb, var(--on-accent) 16%, transparent); color: var(--on-accent); }

.tile-heating { padding: 0; min-height: 300px; justify-content: flex-end; }
@media (min-width: 1024px) { .tile-heating { min-height: 420px; } }
.tile-heating img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 500ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .tile-heating:hover img { transform: scale(1.03); }
}
.tile-heating::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(8, 20, 34, .88) 0%, rgba(8, 20, 34, .45) 45%, transparent 75%);
}
.tile-body { position: relative; z-index: 1; padding: 28px; }
.tile-heating h3 { color: #fff; font-size: 1.6rem; }
.tile-heating p { color: rgba(255, 255, 255, .88); }
.tile-heating .chips li { background: rgba(255, 255, 255, .16); color: #fff; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 20px 0 0; padding: 0; }
.chips li { padding: 4px 12px; border-radius: 999px; font-size: .85rem; font-weight: 600; }

/* Über uns ----------------------------------------------------------------- */
.about { display: grid; gap: 40px; align-items: center; }
@media (min-width: 900px) { .about { grid-template-columns: .9fr 1.1fr; gap: 80px; } }
.about-copy > p { color: var(--text-muted); max-width: 60ch; }
.about-media img { width: 100%; aspect-ratio: 9 / 10; object-fit: cover; border-radius: var(--r-box); }
@media (max-width: 899px) { .about-media img { aspect-ratio: 16 / 9; max-height: 32svh; } }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 32px 0; padding: 24px 0; border-block: 1px solid var(--line); }
.stats div { display: flex; flex-direction: column-reverse; }
.stats dt { font-size: .88rem; color: var(--text-muted); }
.stats dd { margin: 0; font-size: clamp(1.6rem, 3vw, 2.1rem); font-weight: 800; letter-spacing: -.02em; color: var(--accent); line-height: 1.1; font-variant-numeric: tabular-nums; }

.values { list-style: none; padding: 0; margin: 0; display: grid; gap: 20px 32px; }
@media (min-width: 560px) { .values { grid-template-columns: 1fr 1fr; } }
.values li { font-size: .95rem; color: var(--text-muted); }
.values strong { display: block; color: var(--text); font-size: 1rem; margin-bottom: 2px; }

/* Referenzen --------------------------------------------------------------- */
.refs { display: grid; gap: 24px; }
/* Mobil: Projekte als horizontal wischbare Reihe statt drei bildschirmfüllender Fotos */
@media (max-width: 799px) {
  .refs {
    grid-auto-flow: column; grid-auto-columns: 78%; gap: 12px;
    overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
    margin-inline: -16px; padding: 0 16px 8px; scroll-padding-inline: 16px;
    scrollbar-width: none;
  }
  .refs::-webkit-scrollbar { display: none; }
  .ref { scroll-snap-align: start; }
  .ref img { aspect-ratio: 3 / 2; }
}
@media (min-width: 800px) {
  .refs { grid-template-columns: 1.6fr 1fr; grid-template-rows: auto auto; gap: 24px 32px; }
  .ref-lead { grid-row: 1 / span 2; }
}
.ref img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r-box); }
@media (min-width: 800px) { .ref-lead img { aspect-ratio: auto; height: calc(100% - 64px); } }
.ref figcaption { padding-top: 12px; font-size: .92rem; color: var(--text-muted); }
.ref figcaption strong { display: block; color: var(--text); font-size: 1.05rem; }

/* Kontakt ------------------------------------------------------------------ */
.contact { display: grid; gap: 40px; }
@media (min-width: 900px) { .contact { grid-template-columns: 1fr 1fr; gap: 80px; align-items: start; } }
.contact-copy > p { color: var(--text-muted); }

.contact-list { list-style: none; padding: 0; margin: 32px 0 0; display: grid; gap: 20px; }
.contact-list { gap: 8px; }
.contact-list li { display: flex; gap: 14px; align-items: center; min-height: 44px; }
.contact-list svg { width: 22px; height: 22px; flex: none; color: var(--accent); }
.contact-list a { display: inline-flex; align-items: center; min-height: 44px; color: var(--text); text-decoration: none; font-weight: 600; font-size: 1.1rem; }
.contact-list small { display: block; color: var(--text-muted); font-size: .88rem; }

.contact-form { background: var(--surface); padding: 24px; border-radius: var(--r-box); border: 1px solid var(--line); }
@media (min-width: 640px) { .contact-form { padding: 36px; } }
.field { display: grid; gap: 6px; margin-bottom: 18px; }
.field-row { display: grid; gap: 0 16px; }
@media (min-width: 560px) { .field-row { grid-template-columns: 1fr 1fr; } }
.field label { font-size: .92rem; font-weight: 600; }
.optional { font-weight: 400; color: var(--text-muted); }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--text);
  padding: 12px 14px; border: 1px solid var(--input-border); border-radius: var(--r-input); background: var(--surface);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.field textarea { resize: vertical; }
.field ::placeholder { color: var(--text-muted); opacity: .85; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}
.field-error { display: none; margin: 0; font-size: .85rem; color: var(--sos); }
.field [aria-invalid="true"] { border-color: var(--sos); }
.field [aria-invalid="true"] ~ .field-error { display: block; animation: fade-in 200ms ease-out; }

.consent { display: flex; gap: 10px; align-items: flex-start; font-size: .88rem; color: var(--text-muted); margin: 4px 0 24px; }
.consent input { width: 20px; height: 20px; margin-top: 1px; flex: none; accent-color: var(--accent); }
.consent-error { display: none; margin: -16px 0 20px 30px; font-size: .85rem; color: var(--sos); }
.consent.is-invalid input { outline: 2px solid var(--sos); outline-offset: 2px; }
.consent.is-invalid + .consent-error { display: block; animation: fade-in 200ms ease-out; }
.form-hint { margin: 10px 0 0; font-size: .85rem; color: var(--text-muted); text-align: center; }
.form-status { margin: 12px 0 0; font-size: .92rem; min-height: 1.4em; }
.form-status.is-error { color: var(--sos); }

/* Footer ------------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--line); color: var(--text-muted); font-size: .92rem; }
.footer-inner { display: grid; gap: 24px; padding-block: 40px; align-items: center; }
@media (min-width: 800px) { .footer-inner { grid-template-columns: auto 1fr auto; gap: 40px; } }
.footer-inner p { margin: 0; }
.footer-inner ul { display: flex; flex-wrap: wrap; gap: 8px 24px; list-style: none; margin: 0; padding: 0; }
.footer-inner a { display: inline-flex; align-items: center; min-height: 44px; color: var(--text); text-decoration: none; font-weight: 600; }
@media (hover: hover) and (pointer: fine) {
  .footer-inner a:hover, .contact-list a:hover, .main-nav a:hover { color: var(--accent); }
}

/* Mobile Kontaktleiste ----------------------------------------------------- */
.mobile-cta { display: none; }
@media (max-width: 899px) {
  body { padding-bottom: calc(var(--mobile-bar-h) + env(safe-area-inset-bottom)); }
  .mobile-cta {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    display: grid; grid-template-columns: 1fr 1fr 56px; gap: 8px; align-items: center;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface) 95%, transparent);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
  }
  .mobile-cta a {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    height: 52px; border-radius: 999px; font-weight: 700; font-size: .98rem; text-decoration: none; white-space: nowrap;
    transition: transform 160ms var(--ease-out);
    -webkit-tap-highlight-color: transparent;
  }
  .mobile-cta a:active { transform: scale(.97); }
  .mobile-cta svg { width: 20px; height: 20px; }
  .mobile-cta-call { background: var(--accent); color: var(--on-accent); }
  .mobile-cta-mail { background: var(--accent-soft); color: var(--accent); }
  .mobile-cta .mobile-cta-sos {
    width: 56px; height: 56px; border-radius: 50%;
    background: var(--sos-fill); color: #fff; font-size: 1.5rem; font-weight: 800;
    box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--sos-fill) 70%, transparent);
    position: relative;
  }
  /* Einmaliger Puls nach dem Laden (2 Ringe), danach ruhig */
  .mobile-cta .mobile-cta-sos::after {
    content: ""; position: absolute; inset: 0; border-radius: 50%;
    border: 2px solid var(--sos-fill); opacity: 0; pointer-events: none;
  }
}

/* Barrierefreiheit: reduzierte Transparenz & erhöhter Kontrast */
@media (prefers-reduced-transparency: reduce) {
  .site-header, .mobile-cta { background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  :root { --text-muted: var(--text); --line: var(--input-border); }
  .btn-ghost, .contact-form { border-color: var(--text); }
}
@media (max-width: 359px) {
  .mobile-cta-call svg { display: none; }
}

/* Gemeinsame Helfer -------------------------------------------------------- */
.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;
}
.main-nav a[aria-current="page"] { color: var(--accent); }
.section-tight { padding-block: 56px; }
@media (min-width: 900px) { .section-tight { padding-block: 80px; } }

.tick-list, .tick-grid { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 10px; }
@media (min-width: 560px) { .tick-grid { grid-template-columns: 1fr 1fr; gap: 12px 24px; } }
.tick-list li, .tick-grid li { position: relative; padding-left: 28px; font-size: .98rem; }
.tick-list li::before, .tick-grid li::before {
  content: ""; position: absolute; left: 3px; top: .42em; width: 12px; height: 7px;
  border-left: 2.5px solid var(--accent); border-bottom: 2.5px solid var(--accent); transform: rotate(-45deg);
}

.note {
  margin: 20px 0 0; padding: 14px 16px; border-radius: 10px; font-size: .95rem;
  background: color-mix(in srgb, var(--accent) 8%, var(--surface)); border-left: 3px solid var(--accent);
}
.text-link { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; color: var(--accent); text-decoration: none; }

/* Pfeil-Links in Kacheln: die ganze Kachel ist klickbar */
.tile-link {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 20px; min-height: 44px;
  font-weight: 700; color: inherit; text-decoration: none;
}
.tile-link::after { content: ""; position: absolute; inset: 0; z-index: 2; border-radius: inherit; }
.tile-link svg { width: 18px; height: 18px; transition: transform 400ms var(--spring); }
.tile-bath .tile-link { color: var(--on-accent); margin-top: auto; padding-top: 20px; }
.tile-heating .tile-link { color: #fff; }
.tile:has(.tile-link:focus-visible) { outline: 3px solid var(--accent); outline-offset: 3px; }
.tile-link:focus-visible { outline: none; }
@media (hover: hover) and (pointer: fine) {
  .tile:hover .tile-link svg { transform: translateX(4px); }
}

/* Online planen (farbiges Band) ------------------------------------------- */
.planner-band {
  position: relative; overflow: hidden; padding: 72px 0;
  background:
    radial-gradient(60% 80% at 100% 0%, color-mix(in srgb, #fff 18%, transparent), transparent 70%),
    var(--accent);
  color: var(--on-accent);
}
@media (min-width: 900px) { .planner-band { padding: 104px 0; } }
.planner-head { max-width: 60ch; margin-bottom: 40px; }
.planner-head h2 { color: var(--on-accent); }
.planner-head p { font-size: 1.1rem; opacity: .9; margin: 0; }

.tools { display: grid; gap: 16px; }
@media (min-width: 900px) { .tools { grid-template-columns: 1.3fr 1fr 1fr; } }
.tool {
  position: relative; display: flex; flex-direction: column;
  padding: 28px 28px 24px; border-radius: var(--r-box); text-decoration: none;
  color: var(--on-accent);
  background: color-mix(in srgb, var(--on-accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--on-accent) 20%, transparent);
  transition: transform 250ms var(--ease-out), background-color 200ms ease;
  -webkit-tap-highlight-color: transparent;
}
.tool h3 { color: inherit; margin-bottom: .35em; }
.tool p { margin: 0; opacity: .9; font-size: .98rem; }
.tool:active { transform: scale(.98); }
.tool-icon {
  display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 20px; border-radius: 50%;
  background: color-mix(in srgb, currentColor 14%, transparent); color: inherit;
}
.tool-icon svg { width: 26px; height: 26px; }
.tool-go {
  position: absolute; top: 24px; right: 24px; display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 50%; background: color-mix(in srgb, currentColor 14%, transparent);
}
.tool-go svg { width: 18px; height: 18px; transition: transform 400ms var(--spring); }
.tool-meta { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 20px; font-size: .88rem; font-weight: 600; opacity: .85; }
.tool-meta svg { width: 18px; height: 18px; flex: none; }
/* Hervorgehobenes Werkzeug: invertiert, damit es im Band heraussticht */
.tool-feature { background: var(--surface); color: var(--text); border-color: transparent; }
.tool-feature .tool-icon, .tool-feature .tool-go { background: var(--accent-soft); color: var(--accent); }
.tool-feature p { color: var(--text-muted); opacity: 1; }
@media (hover: hover) and (pointer: fine) {
  .tool:hover { transform: translateY(-4px); background-color: color-mix(in srgb, var(--on-accent) 16%, transparent); }
  .tool-feature:hover { background-color: var(--surface); }
  .tool:hover .tool-go svg { transform: translate(3px, -3px); }
  .tool:hover .tool-go svg:has(use[href$="i-arrow"]) { transform: translateX(4px); }
}
/* Helle Variante auf Unterseiten */
.tool-light { background: var(--surface-alt); color: var(--text); border-color: var(--line); }
.tool-light .tool-icon, .tool-light .tool-go { background: var(--surface); color: var(--accent); }
.tool-light p { color: var(--text-muted); opacity: 1; }
@media (hover: hover) and (pointer: fine) { a.tool-light:hover { background-color: var(--surface-alt); box-shadow: var(--shadow); } }
div.tool-light { transition: none; }
div.tool-light:active { transform: none; }
.tool-links { display: flex; gap: 20px; margin-top: 12px !important; }
.tool-links a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; color: var(--accent); text-decoration: none; }

/* Unterseiten: Hero, Brotkrumen -------------------------------------------- */
.breadcrumb { display: flex; gap: 8px; align-items: center; margin-bottom: 20px; font-size: .9rem; color: var(--text-muted); }
.breadcrumb a { color: var(--text-muted); text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb [aria-current] { color: var(--text); font-weight: 600; }
@media (min-width: 900px) { .hero-page .hero-media img { aspect-ratio: 4 / 3; } }

.pill-row { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; margin: 0; padding: 0; }
.pill-row li {
  padding: 10px 18px; border-radius: 999px; font-weight: 600; font-size: .98rem;
  background: var(--surface); border: 1px solid var(--line);
}
.pill-row li:nth-child(3n+1) { background: var(--accent-soft); border-color: transparent; color: var(--accent); }

/* Text + Bild ---------------------------------------------------------------- */
.split { display: grid; gap: 40px; align-items: center; }
@media (min-width: 900px) {
  .split { grid-template-columns: .9fr 1.1fr; gap: 80px; }
  .split-flip { grid-template-columns: 1fr 1fr; }
}
.split-copy > p { color: var(--text-muted); max-width: 60ch; }
.split-media img { width: 100%; aspect-ratio: 9 / 10; object-fit: cover; border-radius: var(--r-box); }
@media (max-width: 899px) { .split-media img { aspect-ratio: 16 / 9; max-height: 32svh; } }

/* Ablauf (Zeitstrahl) ------------------------------------------------------ */
.timeline { --dot: 18px; position: relative; list-style: none; margin: 0; padding: 0; display: grid; gap: 28px; }
.timeline::before, .timeline::after {
  content: ""; position: absolute; border-radius: 2px;
  left: calc(var(--dot) / 2 - 1.5px); top: 6px; bottom: 6px; width: 3px; background: var(--line);
}
.timeline::after { background: var(--accent); transform-origin: top; }
.timeline li { position: relative; padding-left: calc(var(--dot) + 20px); color: var(--text-muted); }
.timeline li::before {
  content: ""; position: absolute; left: 0; top: 4px; width: var(--dot); height: var(--dot); border-radius: 50%;
  background: var(--surface); border: 3px solid var(--accent); z-index: 1;
}
.timeline strong { display: block; color: var(--text); font-size: 1.15rem; margin: 2px 0; }
.timeline-step { font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
@media (min-width: 900px) {
  .timeline { grid-template-columns: repeat(4, 1fr); gap: 24px; }
  .timeline::before, .timeline::after { left: 0; right: 0; top: calc(var(--dot) / 2 - 1.5px); bottom: auto; width: auto; height: 3px; }
  .timeline::after { transform-origin: left; }
  .timeline li { padding: calc(var(--dot) + 20px) 16px 0 0; }
}

/* Zwei Karten nebeneinander ------------------------------------------------ */
.duo { display: grid; gap: 20px; }
@media (min-width: 900px) { .duo { grid-template-columns: 1fr 1fr; gap: 24px; } }
.duo-card { padding: 32px; border-radius: var(--r-box); background: var(--surface); }
@media (min-width: 640px) { .duo-card { padding: 40px; } }
.duo-card > p { color: var(--text-muted); }
.duo-card h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
.duo-card-accent { background: var(--accent-soft); }
.duo-card-accent .tile-icon { background: var(--surface); }
.facts { display: grid; gap: 16px; margin: 20px 0 0; }
.facts dt { font-weight: 700; }
.facts dd { margin: 2px 0 0; color: var(--text-muted); font-size: .96rem; }

/* Planer auf der Bad-Seite ------------------------------------------------- */
.planner-grid { display: grid; gap: 20px; }
@media (min-width: 1024px) { .planner-grid { grid-template-columns: 1.7fr 1fr; align-items: start; } }
.planner-side { display: grid; gap: 16px; }

/* Eingebettete Assistenten (2-Klick-Lösung, lädt erst nach Klick) ---------- */
.embed {
  position: relative; min-height: 520px; border-radius: var(--r-box); overflow: hidden;
  background:
    radial-gradient(70% 60% at 50% 0%, var(--accent-soft), transparent 70%),
    var(--surface-alt);
  border: 1px solid var(--line);
  display: grid; place-items: center;
}
.embed iframe { display: block; width: 100%; height: 760px; border: 0; background: #fff; }
@media (max-width: 639px) { .embed iframe { height: 680px; } }
.embed.is-loaded { display: block; min-height: 0; background: #fff; }
.embed-placeholder { max-width: 440px; padding: 40px 24px; text-align: center; }
.embed-placeholder .tool-icon { margin-inline: auto; background: var(--surface); color: var(--accent); width: 64px; height: 64px; }
.embed-placeholder .tool-icon svg { width: 30px; height: 30px; }
.embed-placeholder > p { color: var(--text-muted); }
.embed-placeholder .btn { margin-top: 8px; }
.embed-note { margin: 16px 0 0; font-size: .82rem; }

/* Heizungs-Check ------------------------------------------------------------ */
.check { padding: 24px; border-radius: var(--r-box); background: var(--surface); box-shadow: var(--shadow); }
@media (min-width: 640px) { .check { padding: 32px; } }
.check fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 4px; }
.check label {
  position: relative; display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 8px 12px;
  border-radius: 10px; cursor: pointer; font-weight: 500; transition: background-color 150ms ease;
  -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) and (pointer: fine) { .check label:hover { background: var(--surface-alt); } }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check-box {
  display: grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 8px;
  border: 2px solid var(--input-border); background: var(--surface);
  transition: background-color 150ms ease, border-color 150ms ease, transform 160ms var(--ease-out);
}
.check-box svg { width: 16px; height: 16px; color: var(--on-accent); transform: scale(.4); opacity: 0; transition: transform 400ms var(--spring), opacity 150ms ease; }
.check input:checked + .check-box { background: var(--accent); border-color: var(--accent); }
.check input:checked + .check-box svg { transform: none; opacity: 1; }
.check label:active .check-box { transform: scale(.9); }
.check input:focus-visible + .check-box { outline: 3px solid var(--accent); outline-offset: 2px; }
.check-result { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.check-meter { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 12px; }
.check-meter i { height: 6px; border-radius: 3px; background: var(--line); transition: background-color 250ms ease; }
.check-meter i.is-on { background: var(--accent); }
.check-result p { margin: 0; font-weight: 600; }
.check-result .text-link { margin-top: 4px; }

/* Heizsysteme ---------------------------------------------------------------- */
.systems { display: grid; gap: 16px; }
@media (min-width: 720px) { .systems { grid-template-columns: 1fr 1fr; } .system-feature { grid-column: 1 / -1; } }
@media (min-width: 1024px) {
  .systems { grid-template-columns: 1.3fr 1fr 1fr; }
  .system-feature { grid-column: 1; grid-row: 1 / span 2; }
}
.system {
  padding: 28px; border-radius: var(--r-box); background: var(--surface-alt);
  transition: transform 250ms var(--ease-out), box-shadow 250ms ease;
}
.system p { color: var(--text-muted); font-size: .98rem; margin: 0; }
.system-feature {
  display: flex; flex-direction: column; justify-content: flex-end; min-height: 320px;
  background:
    radial-gradient(90% 70% at 100% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%),
    var(--accent-soft);
}
.system-feature h3 { font-size: 1.7rem; }
.system-feature .chips li { background: var(--surface); color: var(--accent); }
.system .tile-icon { transition: transform 600ms var(--spring); }
@media (hover: hover) and (pointer: fine) {
  .system:hover { transform: translateY(-4px); box-shadow: 0 20px 40px -20px color-mix(in srgb, var(--accent) 55%, transparent); }
  .system:hover .tile-icon { transform: rotate(-10deg) scale(1.12); }
}

.mini-cards { display: grid; gap: 16px; margin-top: 28px; }
@media (min-width: 560px) { .mini-cards { grid-template-columns: 1fr 1fr; } }
.mini-cards > div { padding: 24px; border-radius: var(--r-box); background: var(--surface); }
.mini-cards h3 { font-size: 1.1rem; }
.mini-cards p { color: var(--text-muted); font-size: .95rem; margin: 0; }
.mini-cards .tile-icon { width: 44px; height: 44px; margin-bottom: 16px; background: var(--accent-soft); }

/* Förderung ------------------------------------------------------------------ */
.funding {
  display: grid; gap: 32px; padding: 32px; border-radius: var(--r-box);
  background:
    radial-gradient(60% 90% at 0% 100%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%),
    var(--surface-alt);
}
@media (min-width: 900px) { .funding { grid-template-columns: 1.3fr 1fr; gap: 56px; padding: 56px; align-items: center; } }
.funding-copy > p:not(.note) { color: var(--text-muted); }
.funding-list h3 { font-size: 1.05rem; margin-bottom: 16px; }
.funding-list .pill-row li { background: var(--surface); }

/* Abschluss-CTA ----------------------------------------------------------- */
.cta-band { padding: 72px 0; background: var(--accent-soft); }
.cta-inner { display: grid; gap: 24px; justify-items: start; }
.cta-inner h2 { margin: 0; }
.cta-inner .hero-actions { margin-top: 0; }
@media (min-width: 900px) { .cta-inner { grid-template-columns: 1fr auto; align-items: center; } }

/* Motion ------------------------------------------------------------------- */
/* Einmaliger Einstieg (Hero) und Einblenden beim Scrollen. --i wird per JS für Geschwister gesetzt (Stagger) */
@media (prefers-reduced-motion: no-preference) {
  .hero-copy > *, .hero-media { animation: rise 600ms var(--ease-out) both; }
  .hero-copy > :nth-child(2) { animation-delay: 50ms; }
  .hero-copy > :nth-child(3) { animation-delay: 100ms; }
  .hero-copy > :nth-child(4) { animation-delay: 150ms; }
  .hero-media { animation-delay: 80ms; }

  /* 1a. Headline baut sich Wort für Wort auf (Wörter werden per JS in .word gesetzt) */
  .js .hero h1:not(.is-split) { animation: fade-in 300ms ease 1s both; } /* Sicherheitsnetz, falls JS fehlt */
  .hero h1.is-split { animation: none; }
  .hero h1 .word {
    display: inline-block;
    animation: word-in 700ms var(--ease-out) both;
    animation-delay: calc(60ms + var(--w) * 55ms);
  }

  /* 1b. Hero-Bild: Zoom + Parallax beim Wegscrollen */
  @supports (animation-timeline: scroll()) {
    .hero-media img {
      animation: hero-parallax linear both;
      animation-timeline: scroll(root);
      animation-range: 0 100vh;
    }
  }

  .js .reveal {
    opacity: 0; transform: translateY(12px);
    transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out);
    transition-delay: calc(var(--i, 0) * 60ms);
  }
  .js .reveal.is-visible { opacity: 1; transform: none; }

  /* 2. Fotos öffnen sich von unten nach oben */
  .js .about-media.reveal img, .js .ref.reveal img {
    clip-path: inset(100% 0 0 0 round var(--r-box));
    transition: clip-path 900ms var(--ease-in-out);
    transition-delay: calc(100ms + var(--i, 0) * 80ms);
  }
  .js .about-media.reveal.is-visible img, .js .ref.reveal.is-visible img {
    clip-path: inset(0 0 0 0 round var(--r-box));
  }

  /* 5. Referenzen (Desktop): leichte Neigung, die sich beim Scrollen aufrichtet */
  @supports (animation-timeline: view()) {
    @media (min-width: 800px) {
      .ref { perspective: 1200px; }
      .ref img {
        transform-origin: 50% 100%;
        animation: ref-tilt linear both;
        animation-timeline: view();
        animation-range: entry 0% cover 45%;
      }
    }
  }

  /* Zeitstrahl: blaue Linie füllt sich beim Scrollen */
  @supports (animation-timeline: view()) {
    .timeline { view-timeline-name: --timeline; }
    .timeline::after {
      animation: grow-y linear both;
      animation-timeline: --timeline;
      animation-range: entry 40% cover 60%;
    }
    @media (min-width: 900px) { .timeline::after { animation-name: grow-x; } }
  }

  /* 6. Notdienst-Button: zwei Pulsringe nach dem Laden, dann Ruhe */
  .mobile-cta .mobile-cta-sos::after { animation: sos-pulse 1.4s var(--ease-out) 1.2s 2; }
}

/* Reduzierte Bewegung: nur sanfte Überblendungen, keine Positionsänderungen */
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 0; transition: opacity 250ms ease; }
  .js .reveal.is-visible { opacity: 1; }
  .btn:active, .mobile-cta a:active, .emergency-link:active { transform: none; }
  .main-nav, .main-nav.is-open { transform: none; }
  .tile-heating img, .tile, .tile-icon { transition: none; }
  .tile:hover, .tile:hover .tile-icon { transform: none; }
}
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes word-in {
  from { opacity: 0; transform: translateY(.35em); filter: blur(4px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}
@keyframes hero-parallax {
  from { transform: scale(1.02) translateY(0); }
  to { transform: scale(1.14) translateY(7%); }
}
@keyframes ref-tilt {
  from { transform: rotateX(9deg) translateY(28px) scale(.97); }
  to { transform: none; }
}
@keyframes grow-y { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes sos-pulse {
  from { opacity: .7; transform: scale(1); }
  to { opacity: 0; transform: scale(1.6); }
}
