/* Meisterbau – Konzeptstudie von Studio Niers
   Design Read: lokaler Handwerksbetrieb, Vertrauen zuerst, funktional, Nachtblau + Signalgelb.
   Dials 4 / 3 / 4 (trust-first laut design-taste-frontend). Ein Farbmodus pro Seite, keine dunklen Blöcke in der hellen Seite.
   Schrift: Barlow + Barlow Condensed (OFL, selbst gehostet, statt Windows-only Bahnschrift). Fotos: CC0, siehe CREDITS.md.
   Formen: alles 8px (kantig-solide), Buttons ebenfalls 8px. */

@font-face { font-family: "Barlow"; src: url("fonts/barlow-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("fonts/barlow-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("fonts/barlow-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("fonts/barlow-condensed-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("fonts/barlow-condensed-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  color-scheme: light;
  --bg: #f4f5f7; --card: #ffffff; --ink: #121826; --ink-2: #4b5563; --line: #dde1e7;
  --navy: #1d2b4a; --navy-ink: #1d2b4a; --yellow: #e3b23c; --on-yellow: #121826; --yellow-soft: #fbf1d6;
  --display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --font: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --r: 8px; --ease: cubic-bezier(.16, 1, .3, 1); --t: 200ms;
}
:root[data-theme="dark"] { color-scheme: dark; --bg: #0d1320; --card: #151d2e; --ink: #e8ecf3; --ink-2: #a3adc2; --line: #263149; --navy: #2a3a60; --navy-ink: #e8ecf3; --yellow-soft: #2a2414; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { color-scheme: dark; --bg: #0d1320; --card: #151d2e; --ink: #e8ecf3; --ink-2: #a3adc2; --line: #263149; --navy: #2a3a60; --navy-ink: #e8ecf3; --yellow-soft: #2a2414; } }

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
body { background: var(--bg); color: var(--ink); font: 400 17px/1.6 var(--font); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: .25em; }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
svg { width: 22px; height: 22px; fill: currentColor; flex-shrink: 0; }
.sprite { position: absolute; width: 0; height: 0; }

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 max(32px, env(safe-area-inset-right)) 0 max(32px, env(safe-area-inset-left)); }
.skip { position: absolute; left: 16px; top: -100px; z-index: 100; background: var(--yellow); color: var(--on-yellow); padding: 12px 18px; font-weight: 600; }
.skip:focus { top: 16px; }

h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1; letter-spacing: -.005em; text-wrap: balance; overflow-wrap: break-word; hyphens: auto; }
h2 { font-size: clamp(2.2rem, 4.4vw, 3.4rem); color: var(--navy-ink); }
h3 { font-size: 1.6rem; color: var(--navy-ink); }
p { text-wrap: pretty; }
.section__lead { color: var(--ink-2); font-size: 1.1rem; max-width: 50ch; margin-top: 16px; }
.section__title { margin-bottom: 40px; }

.concept-bar { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; background: var(--navy); color: #fff; font-size: .84rem; padding: 8px 32px; }
.concept-bar a { color: inherit; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 50px; padding: 12px 24px; border-radius: var(--r); background: var(--yellow); color: var(--on-yellow); font-family: var(--display); font-weight: 700; font-size: 1.2rem; letter-spacing: .02em; text-decoration: none; white-space: nowrap; border: 0; transition: filter var(--t), transform 120ms var(--ease); }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn--dark { background: var(--navy); color: #fff; }
.btn--block { width: 100%; }
.text-link { font-weight: 600; padding: 10px 2px; text-decoration: underline; text-decoration-color: var(--yellow); text-decoration-thickness: 2px; }
.text-link:hover { color: var(--navy-ink); }

/* Notdienst */
.emergency { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 16px; border-radius: var(--r); background: var(--yellow); color: var(--on-yellow); font-family: var(--display); font-weight: 700; font-size: 1.1rem; letter-spacing: .02em; text-decoration: none; white-space: nowrap; }
.emergency:hover { filter: brightness(1.08); }
.emergency svg { width: 20px; height: 20px; }
.emergency--sticky { display: none; }

/* Header */
.top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top__inner { display: flex; align-items: center; gap: 24px; height: 72px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; font-size: 1.6rem; letter-spacing: .04em; text-transform: uppercase; color: var(--navy-ink); text-decoration: none; }
.brand__mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 6px; background: var(--yellow); color: var(--on-yellow); font-size: 1.3rem; }
.top__nav { display: flex; gap: 26px; margin-left: auto; font-weight: 500; }
.top__nav a { text-decoration: none; color: var(--ink-2); padding: 8px 0; transition: color var(--t); }
.top__nav a:hover { color: var(--ink); }
.theme-toggle { min-height: 40px; padding: 8px 14px; border-radius: var(--r); border: 1px solid var(--line); background: none; color: var(--ink-2); font-size: .9rem; font-weight: 500; transition: color var(--t), border-color var(--t), background var(--t); }
.theme-toggle:hover { color: var(--ink); border-color: var(--ink-2); }
.theme-toggle[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* Hero */
.hero { padding: 56px 0 72px; }
.hero__grid { display: grid; grid-template-columns: 6fr 5fr; gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(3rem, 6vw, 5.2rem); text-transform: uppercase; color: var(--navy-ink); line-height: .95; }
.mark { background: var(--yellow); color: var(--on-yellow); padding: 0 .12em; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.hero__lead { font-size: 1.2rem; color: var(--ink-2); max-width: 38ch; margin-top: 24px; }
.hero__actions { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-top: 32px; }
.hero__img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: var(--r); }

/* Vertrauensleiste */
.trust { background: var(--card); border-block: 1px solid var(--line); }
.trust__list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px 24px; padding-block: 20px; }
.trust__list li { display: flex; align-items: center; gap: 10px; color: var(--ink-2); }
.trust__list svg { color: var(--yellow); }
.trust__list strong { color: var(--ink); font-weight: 600; }

/* Abschnitte */
.section { padding: 96px 0 112px; }
.section--tint { background: var(--card); border-block: 1px solid var(--line); }

/* Leistungen: Bento 1 groß + 3 */
.services { display: grid; grid-template-columns: 5fr 4fr 4fr; grid-template-rows: auto auto; gap: 20px; }
.service { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.service img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.service--feature { grid-row: span 2; }
.service--feature img { aspect-ratio: auto; flex: 1; min-height: 320px; }
.service__body { padding: 22px 24px 26px; }
.service h3 { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.service h3 svg { color: var(--yellow); }
.service p { color: var(--ink-2); }
.service--alert { grid-column: span 2; background: var(--yellow-soft); border-color: var(--yellow); }
.service--alert .service__body { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px 24px; height: 100%; }
.service--alert h3, .service--alert p { grid-column: 1; }
.service--alert .btn { grid-column: 2; grid-row: 1 / span 2; }
.service--alert h3 svg { color: var(--navy-ink); }

/* Kostenrechner */
.calc { display: grid; grid-template-columns: 5fr 6fr; gap: 64px; align-items: start; }
.calc__intro { position: sticky; top: 104px; }
.calc__form { background: var(--bg); border: 1px solid var(--line); border-top: 6px solid var(--yellow); border-radius: var(--r); padding: 30px; }
.field { border: 0; margin-bottom: 26px; }
.field > label, .field legend { display: flex; justify-content: space-between; align-items: baseline; width: 100%; font-family: var(--display); font-weight: 700; font-size: 1.15rem; letter-spacing: .03em; text-transform: uppercase; margin-bottom: 12px; color: var(--navy-ink); }
.field output { font-size: 1.6rem; }
input[type="range"] { width: 100%; height: 32px; accent-color: var(--navy); cursor: pointer; }
:root[data-theme="dark"] input[type="range"] { accent-color: var(--yellow); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) input[type="range"] { accent-color: var(--yellow); } }
.range-scale { display: flex; justify-content: space-between; font-size: .85rem; color: var(--ink-2); }
.options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.options label, .checks label { position: relative; }
.options input, .checks input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.options span { display: block; height: 100%; min-height: 44px; padding: 12px 14px; border: 2px solid var(--line); border-radius: var(--r); font-size: .9rem; color: var(--ink-2); background: var(--card); cursor: pointer; transition: border-color var(--t); }
.options b { display: block; font-family: var(--display); font-size: 1.2rem; color: var(--ink); }
.options input:checked + span { border-color: var(--yellow); box-shadow: inset 0 -4px 0 var(--yellow); }
.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.checks span { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px 14px; border: 2px solid var(--line); border-radius: var(--r); background: var(--card); cursor: pointer; transition: border-color var(--t); }
.checks span::before { content: ""; width: 18px; height: 18px; flex-shrink: 0; border: 2px solid var(--ink-2); border-radius: 4px; }
.checks input:checked + span { border-color: var(--yellow); }
.checks input:checked + span::before { background: var(--yellow); border-color: var(--yellow); box-shadow: inset 0 0 0 3px var(--card); }
.options input:focus-visible + span, .checks input:focus-visible + span { outline: 3px solid var(--yellow); outline-offset: 2px; }
.result { display: grid; gap: 4px; background: var(--card); border-left: 6px solid var(--navy); border-radius: var(--r); padding: 18px 20px; margin-bottom: 16px; }
.result__label { font-family: var(--display); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; font-size: .9rem; color: var(--ink-2); }
.result__value { font-family: var(--display); font-weight: 700; font-size: clamp(1.8rem, 3.4vw, 2.4rem); color: var(--navy-ink); line-height: 1.1; font-variant-numeric: tabular-nums; }
.result__note { font-size: .85rem; color: var(--ink-2); }

/* Versprechen */
.promise { display: grid; grid-template-columns: 5fr 7fr; gap: 56px; align-items: start; }
.promise__list { counter-reset: p; }
.promise__list li { counter-increment: p; display: grid; grid-template-columns: 64px 1fr; column-gap: 20px; padding: 24px 0; border-top: 1px solid var(--line); }
.promise__list li::before { content: counter(p); grid-row: span 2; font-family: var(--display); font-weight: 700; font-size: 3rem; line-height: .9; color: var(--yellow); }
.promise__list p { color: var(--ink-2); margin-top: 6px; }

/* Kontakt */
.contact { display: grid; grid-template-columns: 6fr 5fr; gap: 56px; align-items: start; }
.contact__phone { display: inline-flex; align-items: center; gap: 14px; margin: 28px 0 8px; font-family: var(--display); font-weight: 700; font-size: clamp(2.2rem, 5vw, 3.4rem); color: var(--navy-ink); text-decoration: none; }
.contact__phone svg { width: 40px; height: 40px; color: var(--yellow); }
.contact__phone:hover { text-decoration: underline; text-decoration-color: var(--yellow); }
address { display: flex; gap: 10px; font-style: normal; color: var(--ink-2); margin-top: 16px; }
address svg { color: var(--yellow); }
.area p { color: var(--ink-2); margin: 10px 0 18px; }
.districts { display: flex; flex-wrap: wrap; gap: 8px; }
.districts li { padding: 6px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); font-weight: 500; }

.foot { border-top: 1px solid var(--line); padding: 24px 0 32px; font-size: .9rem; color: var(--ink-2); }
.foot__inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }

@media (prefers-reduced-motion: no-preference) {
  .hero__text { animation: rise 600ms var(--ease) both; }
  @keyframes rise { from { opacity: 0; transform: translateY(12px); } }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

@media (max-width: 1000px) {
  .top__nav { display: none; }
  .theme-toggle { margin-left: auto; }
  .trust__list { grid-template-columns: 1fr 1fr; }
  .services { grid-template-columns: 1fr 1fr; }
  .service--feature { grid-row: auto; grid-column: span 2; }
  .service--feature img { aspect-ratio: 16 / 9; min-height: 0; }
}
@media (max-width: 860px) {
  .hero__grid, .calc, .promise, .contact { grid-template-columns: 1fr; gap: 40px; }
  .calc__intro { position: static; }
  .hero__img { aspect-ratio: 4 / 3; }
}
@media (max-width: 640px) {
  body { font-size: 16px; padding-bottom: 64px; }
  .wrap { padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); }
  .concept-bar { padding: 8px 16px; }
  .top__inner { height: 64px; gap: 10px; }
  .emergency--top { display: none; }
  .emergency--sticky { display: flex; justify-content: center; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; border-radius: 0; padding: 16px max(16px, env(safe-area-inset-left)) calc(16px + env(safe-area-inset-bottom)); }
  .hero { padding: 32px 0 56px; }
  .section { padding: 72px 0 88px; }
  .trust__list, .services, .options, .checks { grid-template-columns: 1fr; }
  .service--feature, .service--alert { grid-column: auto; }
  .service--alert .service__body { grid-template-columns: 1fr; }
  .service--alert .btn { grid-column: 1; grid-row: auto; justify-self: start; margin-top: 8px; }
  .calc__form { padding: 22px 16px; }
}

/* Hell/Dunkel: kurze Überblendung ohne Einzel-Übergänge (siehe /theme.js) */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
.theme-switching *, .theme-switching *::before, .theme-switching *::after { transition: none !important; }
