/* RUM-PLAN – Ingenieurbüro für Gebäudetechnik
   Farben der Leitungen folgen der Kennzeichnung in TGA-Plänen:
   Heizung rot, Lüftung blau, Sanitär grün, Energie ocker. */

@font-face { font-family: "Plex"; src: url("../fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Plex"; src: url("../fonts/ibm-plex-sans-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Plex"; src: url("../fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Plex"; src: url("../fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Plex Condensed"; src: url("../fonts/ibm-plex-sans-condensed-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Plex Condensed"; src: url("../fonts/ibm-plex-sans-condensed-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }

:root {
  --papier: #f6f7f7;
  --weiss: #ffffff;
  --tinte: #1c2b3a;
  --tinte-2: #4a5866;
  --linie: #cfd6db;
  --raster: #e6eaed;
  --heizung: #c0392b;
  --lueftung: #2b6cb0;
  --sanitaer: #2e8656;
  --energie: #c98f0c;
  --fokus: #2b6cb0;

  --sans: "Plex", "Segoe UI", system-ui, sans-serif;
  --cond: "Plex Condensed", "Plex", "Arial Narrow", sans-serif;

  --maxw: 72rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --pipe: 6px;
}

*, *::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;
  background: var(--papier);
  color: var(--tinte);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--tinte); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--lueftung); }
:focus-visible { outline: 3px solid var(--fokus); outline-offset: 3px; }

h1, h2, h3 { font-family: var(--cond); font-weight: 600; line-height: 1.1; margin: 0 0 0.6em; letter-spacing: -0.005em; }
h1 { font-size: clamp(2.4rem, 6vw, 4.25rem); }
h2 { font-size: clamp(1.75rem, 3.6vw, 2.5rem); }
h3 { font-size: 1.375rem; line-height: 1.2; }
p { margin: 0 0 1em; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.measure { max-width: 40rem; }
.lead { font-size: clamp(1.125rem, 1.6vw, 1.3rem); color: var(--tinte-2); max-width: 38rem; }

.skip { position: absolute; left: -9999px; top: 0; background: var(--tinte); color: #fff; padding: 0.5rem 1rem; z-index: 100; }
.skip:focus { left: 1rem; top: 1rem; }

/* ---------- Kopf ---------- */
.kopf { background: var(--weiss); border-bottom: 1px solid var(--linie); position: sticky; top: 0; z-index: 50; }
.kopf .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 4.5rem; }
.marke { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; color: var(--tinte); }
.marke img { height: 2.75rem; width: auto; }
.marke span { font-family: var(--cond); font-weight: 500; font-size: 0.95rem; line-height: 1.15; color: var(--tinte-2); }
.marke strong { display: block; font-weight: 600; font-size: 1.15rem; color: var(--tinte); }

.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 0.25rem; align-items: center; }
.nav a { display: block; padding: 0.5rem 0.8rem; text-decoration: none; font-weight: 500; border-bottom: 3px solid transparent; }
.nav a[aria-current="page"] { border-bottom-color: var(--tinte); }
.nav a.tel { margin-left: 0.5rem; border: 1px solid var(--tinte); border-radius: 2px; padding: 0.45rem 0.9rem; white-space: nowrap; }
.nav a.tel:hover { background: var(--tinte); color: #fff; }

.menu-knopf { display: none; background: none; border: 1px solid var(--tinte); border-radius: 2px; font: 500 1rem var(--sans); color: var(--tinte); padding: 0.45rem 0.8rem; cursor: pointer; }

@media (max-width: 52rem) {
  .marke span { font-size: 0; }
  .marke strong { font-size: 1.15rem; }
  .js .menu-knopf { display: block; }
  .js .nav { display: none; }
  .js .nav.offen { display: block; }
  .kopf .wrap { flex-wrap: wrap; }
  .nav { width: 100%; padding-bottom: 0.75rem; }
  .nav ul { flex-direction: column; align-items: stretch; gap: 0; }
  .nav a { border-bottom: 1px solid var(--raster); padding: 0.8rem 0; }
  .nav a[aria-current="page"] { border-bottom-color: var(--raster); font-weight: 600; }
  .nav a.tel { margin: 0.75rem 0 0; text-align: center; padding: 0.7rem; }
}

/* ---------- Startseite: Kopfbereich ---------- */
.held { background: var(--weiss); padding: clamp(2.5rem, 7vw, 5rem) 0 0; }
.held-raster { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: end; }
.held h1 { margin-bottom: 0.35em; }
.held-bild { position: relative; margin: 0; }
.held-bild img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.held-bild figcaption { font-size: 0.85rem; color: var(--tinte-2); padding-top: 0.4rem; }
.knoepfe { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }
.knopf { display: inline-block; padding: 0.8rem 1.3rem; font-weight: 500; text-decoration: none; border: 1px solid var(--tinte); border-radius: 2px; background: var(--tinte); color: #fff; }
.knopf:hover { background: #fff; color: var(--tinte); }
.knopf.hell { background: transparent; color: var(--tinte); }
.knopf.hell:hover { background: var(--tinte); color: #fff; }
@media (max-width: 52rem) { .held-raster { grid-template-columns: 1fr; } }

/* ---------- Leitungsband ----------
   Vier Leitungen kommen vom linken Seitenrand und knicken in "ihr" Gewerk ab.
   Die unterste (Heizung) knickt zuerst ab, so kreuzt sich nichts. */
.leitungen { background: var(--weiss); padding: 6rem 0 0; overflow-x: clip; }
.gewerke { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 clamp(1rem, 3vw, 2.5rem); padding-bottom: 3.5rem; }
.gewerk { position: relative; border-top: var(--pipe) solid var(--farbe); padding-top: 1.1rem; }
.gewerk h3 { margin-bottom: 0.5rem; }
.gewerk ul { list-style: none; margin: 0; padding: 0; color: var(--tinte-2); font-size: 0.98rem; }
.gewerk li { padding: 0.2rem 0; }
.gewerk a { text-decoration: none; }
.gewerk a:hover h3 { text-decoration: underline; }
.f-heizung { --farbe: var(--heizung); --hoehe: 16px; }
.f-lueftung { --farbe: var(--lueftung); --hoehe: 32px; }
.f-sanitaer { --farbe: var(--sanitaer); --hoehe: 48px; }
.f-energie { --farbe: var(--energie); --hoehe: 64px; }

.leitungen .gewerk::before,
.leitungen .gewerk::after { content: ""; position: absolute; background: var(--farbe); }
/* waagerechtes Stück: vom Seitenrand bis zur linken Kante der Spalte */
.leitungen .gewerk::before { height: var(--pipe); top: calc(-1 * var(--hoehe) - var(--pipe)); right: calc(100% - var(--pipe)); width: 200vw; transform-origin: left center; }
/* senkrechtes Stück: hinunter auf die Oberkante der Spalte */
.leitungen .gewerk::after { width: var(--pipe); left: 0; top: calc(-1 * var(--hoehe) - var(--pipe)); height: var(--hoehe); transform-origin: top center; }

@media (prefers-reduced-motion: no-preference) {
  .js .leitungen .gewerk::before { animation: waagerecht 1.1s cubic-bezier(.5,0,.3,1) both; animation-delay: var(--start, 0s); }
  .js .leitungen .gewerk::after { animation: senkrecht .35s ease-out both; animation-delay: calc(var(--start, 0s) + 1.05s); }
  .js .leitungen .gewerk { border-top-color: transparent; animation: kante .01s linear both; animation-delay: calc(var(--start, 0s) + 1.35s); }
  .f-heizung { --start: 0s; } .f-lueftung { --start: .12s; } .f-sanitaer { --start: .24s; } .f-energie { --start: .36s; }
}
@keyframes waagerecht { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes senkrecht { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes kante { to { border-top-color: var(--farbe); } }

@media (max-width: 52rem) {
  .leitungen { padding-top: 2.5rem; }
  .leitungen .gewerk::before, .leitungen .gewerk::after { display: none; }
  .js .leitungen .gewerk { animation: none; border-top-color: var(--farbe); }
  .gewerke { grid-template-columns: 1fr 1fr; gap: 2rem 1.25rem; }
}
@media (max-width: 30rem) { .gewerke { grid-template-columns: 1fr; } }

/* ---------- Abschnitte ---------- */
.abschnitt { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.abschnitt + .abschnitt { border-top: 1px solid var(--linie); }
.abschnitt.weiss { background: var(--weiss); }

.zwei { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 5vw, 4rem); align-items: start; }
@media (max-width: 52rem) { .zwei { grid-template-columns: 1fr; } }

.kunden { list-style: none; padding: 0; margin: 1.5rem 0 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.kunden li { border: 1px solid var(--linie); background: var(--weiss); padding: 0.45rem 0.85rem; border-radius: 2px; }

/* Referenz-Auswahl auf der Startseite */
.auswahl { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; margin-top: 2rem; }
.auswahl figure { margin: 0; }
.auswahl img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
@media (max-width: 52rem) { .auswahl { grid-template-columns: 1fr 1fr; } }
figcaption { font-size: 0.85rem; color: var(--tinte-2); padding-top: 0.4rem; }
.knoepfe { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }
.knopf { display: inline-block; padding: 0.8rem 1.3rem; font-weight: 500; text-decoration: none; border: 1px solid var(--tinte); border-radius: 2px; background: var(--tinte); color: #fff; }
.knopf:hover { background: #fff; color: var(--tinte); }
.knopf.hell { background: transparent; color: var(--tinte); }
.knopf.hell:hover { background: var(--tinte); color: #fff; }
@media (max-width: 52rem) { .held-raster { grid-template-columns: 1fr; } }

/* ---------- Leitungsband ----------
   Vier Leitungen kommen vom linken Seitenrand und knicken in "ihr" Gewerk ab.
   Die unterste (Heizung) knickt zuerst ab, so kreuzt sich nichts. */
.leitungen { background: var(--weiss); padding: 6rem 0 0; overflow-x: clip; }
.gewerke { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 clamp(1rem, 3vw, 2.5rem); padding-bottom: 3.5rem; }
.gewerk { position: relative; border-top: var(--pipe) solid var(--farbe); padding-top: 1.1rem; }
.gewerk h3 { margin-bottom: 0.5rem; }
.gewerk ul { list-style: none; margin: 0; padding: 0; color: var(--tinte-2); font-size: 0.98rem; }
.gewerk li { padding: 0.2rem 0; }
.gewerk a { text-decoration: none; }
.gewerk a:hover h3 { text-decoration: underline; }
.f-heizung { --farbe: var(--heizung); --hoehe: 16px; }
.f-lueftung { --farbe: var(--lueftung); --hoehe: 32px; }
.f-sanitaer { --farbe: var(--sanitaer); --hoehe: 48px; }
.f-energie { --farbe: var(--energie); --hoehe: 64px; }

.leitungen .gewerk::before,
.leitungen .gewerk::after { content: ""; position: absolute; background: var(--farbe); }
/* waagerechtes Stück: vom Seitenrand bis zur linken Kante der Spalte */
.leitungen .gewerk::before { height: var(--pipe); top: calc(-1 * var(--hoehe) - var(--pipe)); right: calc(100% - var(--pipe)); width: 200vw; transform-origin: left center; }
/* senkrechtes Stück: hinunter auf die Oberkante der Spalte */
.leitungen .gewerk::after { width: var(--pipe); left: 0; top: calc(-1 * var(--hoehe) - var(--pipe)); height: var(--hoehe); transform-origin: top center; }

@media (prefers-reduced-motion: no-preference) {
  .js .leitungen .gewerk::before { animation: waagerecht 1.1s cubic-bezier(.5,0,.3,1) both; animation-delay: var(--start, 0s); }
  .js .leitungen .gewerk::after { animation: senkrecht .35s ease-out both; animation-delay: calc(var(--start, 0s) + 1.05s); }
  .js .leitungen .gewerk { border-top-color: transparent; animation: kante .01s linear both; animation-delay: calc(var(--start, 0s) + 1.35s); }
  .f-heizung { --start: 0s; } .f-lueftung { --start: .12s; } .f-sanitaer { --start: .24s; } .f-energie { --start: .36s; }
}
@keyframes waagerecht { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes senkrecht { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes kante { to { border-top-color: var(--farbe); } }

@media (max-width: 52rem) {
  .leitungen { padding-top: 2.5rem; }
  .leitungen .gewerk::before, .leitungen .gewerk::after { display: none; }
  .js .leitungen .gewerk { animation: none; border-top-color: var(--farbe); }
  .gewerke { grid-template-columns: 1fr 1fr; gap: 2rem 1.25rem; }
}
@media (max-width: 30rem) { .gewerke { grid-template-columns: 1fr; } }

/* ---------- Abschnitte ---------- */
.abschnitt { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.abschnitt + .abschnitt { border-top: 1px solid var(--linie); }
.abschnitt.weiss { background: var(--weiss); }

.zwei { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 5vw, 4rem); align-items: start; }
@media (max-width: 52rem) { .zwei { grid-template-columns: 1fr; } }

.kunden { list-style: none; padding: 0; margin: 1.5rem 0 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.kunden li { border: 1px solid var(--linie); background: var(--weiss); padding: 0.45rem 0.85rem; border-radius: 2px; }

/* Referenz-Auswahl auf der Startseite */
.auswahl { display: grid; grid-template-columns: repeat(12, 1fr); gap: 1rem; margin-top: 2rem; }
.auswahl figure { margin: 0; }
.auswahl figure:nth-child(1) { grid-column: span 7; }
.auswahl figure:nth-child(2) { grid-column: span 5; }
.auswahl figure:nth-child(3) { grid-column: span 5; }
.auswahl figure:nth-child(4) { grid-column: span 7; }
.auswahl img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
figcaption { font-size: 0.92rem; color: var(--tinte-2); padding-top: 0.5rem; line-height: 1.4; }
figcaption b { display: block; color: var(--tinte); font-weight: 500; }

.mehr { margin-top: 1.75rem; font-weight: 500; }

/* ---------- Unterseiten ---------- */
.seitenkopf { background: var(--weiss); padding: clamp(2.5rem, 6vw, 4rem) 0 clamp(2rem, 4vw, 3rem); border-bottom: 1px solid var(--linie); }
.seitenkopf h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); }
.seitenkopf p { margin-bottom: 0; }

.leistung { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(1.5rem, 4vw, 3.5rem); padding: clamp(2.5rem, 6vw, 4rem) 0; border-bottom: 1px solid var(--linie); align-items: start; scroll-margin-top: 5rem; }
.leistung:last-child { border-bottom: 0; }
.leistung img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.leistung h2 { border-top: var(--pipe) solid var(--farbe); padding-top: 1rem; }
.punkte { list-style: none; margin: 1.25rem 0 0; padding: 0; columns: 2 14rem; column-gap: 2rem; }
.punkte li { padding: 0.45rem 0 0.45rem 1.4rem; position: relative; break-inside: avoid; }
.punkte li::before { content: ""; position: absolute; left: 0; top: 1.05rem; width: 0.8rem; height: 3px; background: var(--farbe, var(--tinte)); }
@media (max-width: 52rem) { .leistung { grid-template-columns: 1fr; } .leistung img { aspect-ratio: 16 / 9; } }

/* Referenzen */
.sprungleiste { position: sticky; top: 4.5rem; z-index: 40; background: var(--papier); border-bottom: 1px solid var(--linie); }
.sprungleiste ul { list-style: none; margin: 0; padding: 0.6rem 0; display: flex; gap: 0.5rem; overflow-x: auto; scrollbar-width: thin; }
.sprungleiste a { display: block; white-space: nowrap; padding: 0.4rem 0.8rem; border: 1px solid var(--linie); background: var(--weiss); border-radius: 2px; text-decoration: none; font-size: 0.95rem; }
.sprungleiste a:hover { border-color: var(--tinte); color: var(--tinte); }
@media (max-width: 52rem) { .sprungleiste { top: 0; position: relative; } }

.kategorie { padding: clamp(2.5rem, 6vw, 4rem) 0; border-bottom: 1px solid var(--linie); scroll-margin-top: 8.5rem; }
.kategorie:last-of-type { border-bottom: 0; }
.bilder { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1rem; margin: 1.5rem 0 2.5rem; }
.bilder figure { margin: 0; }
.bilder img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; background: var(--raster); }

.projekte { display: grid; grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr)); gap: 0 2.5rem; }
.auftraggeber { border-top: 1px solid var(--tinte); padding: 0.9rem 0 1.5rem; break-inside: avoid; }
.auftraggeber h3 { font-size: 1.15rem; margin-bottom: 0.4rem; }
.auftraggeber ul { list-style: none; margin: 0; padding: 0; }
.auftraggeber li { padding: 0.3rem 0; color: var(--tinte-2); line-height: 1.45; }
.auftraggeber li strong { display: block; color: var(--tinte); font-weight: 500; }
.auftraggeber li small { display: block; font-size: 0.92rem; }

/* Kontakt */
.kontaktliste { list-style: none; padding: 0; margin: 0; }
.kontaktliste li { padding: 0.9rem 0; border-top: 1px solid var(--linie); }
.kontaktliste li:last-child { border-bottom: 1px solid var(--linie); }
.kontaktliste span { display: block; font-size: 0.92rem; color: var(--tinte-2); }
.gross { font-family: var(--cond); font-weight: 600; font-size: clamp(1.6rem, 3vw, 2.1rem); line-height: 1.2; }
.gross a { text-decoration: none; }
.gross a:hover { text-decoration: underline; }

/* Rechtstexte */
.text h2 { font-size: 1.6rem; margin-top: 2.2rem; }
.text h3 { font-size: 1.2rem; margin-top: 1.6rem; }
.text ul { padding-left: 1.2rem; }

/* ---------- Fuß als Schriftfeld ---------- */
.fuss { background: var(--weiss); border-top: 1px solid var(--linie); padding: 2.5rem 0 1.5rem; font-size: 0.95rem; }
.schriftfeld { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; border: 1.5px solid var(--tinte); }
.schriftfeld > div { padding: 0.8rem 1rem; border-right: 1px solid var(--tinte); }
.schriftfeld > div:last-child { border-right: 0; }
.schriftfeld .feld { display: block; font-size: 0.78rem; color: var(--tinte-2); margin-bottom: 0.2rem; }
.schriftfeld img { height: 3rem; width: auto; margin-bottom: 0.5rem; }
.schriftfeld p { margin: 0; line-height: 1.5; }
.schriftfeld a { text-decoration: none; }
.schriftfeld a:hover { text-decoration: underline; }
.fusszeile { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin-top: 1rem; color: var(--tinte-2); font-size: 0.88rem; }
.fusszeile a { color: var(--tinte-2); }
@media (max-width: 52rem) {
  .schriftfeld { grid-template-columns: 1fr 1fr; }
  .schriftfeld > div:nth-child(2) { border-right: 0; }
  .schriftfeld > div:nth-child(-n+2) { border-bottom: 1px solid var(--tinte); }
}
@media (max-width: 30rem) {
  .schriftfeld { grid-template-columns: 1fr; }
  .schriftfeld > div { border-right: 0; border-bottom: 1px solid var(--tinte); }
  .schriftfeld > div:last-child { border-bottom: 0; }
}

@media print {
  .kopf, .sprungleiste, .leitungen svg, .knoepfe { display: none; }
  body { background: #fff; }
}

@media (max-width: 40rem) {
  .bilder { grid-template-columns: 1fr 1fr; gap: 0.75rem; }
  .bilder figcaption { font-size: 0.85rem; }
}

/* Gebäudetypen auf der Startseite */
.typen { list-style: none; margin: 2rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--tinte); border-left: 1px solid var(--linie); }
.typen li { border-right: 1px solid var(--linie); border-bottom: 1px solid var(--linie); }
.typen a { display: flex; flex-direction: column; gap: 0.4rem; height: 100%; padding: 1.25rem 1.25rem 1.1rem; text-decoration: none; color: var(--tinte); }
.typen a:hover { background: var(--papier); }
.typen a:hover strong { text-decoration: underline; }
.typen strong { font-family: var(--cond); font-weight: 600; font-size: 1.3rem; line-height: 1.2; }
.typen span { color: var(--tinte-2); font-size: 0.95rem; line-height: 1.5; flex: 1; }
.typen em { font-style: normal; font-size: 0.9rem; font-weight: 500; }
@media (max-width: 52rem) { .typen { grid-template-columns: 1fr 1fr; } }
@media (max-width: 34rem) { .typen { grid-template-columns: 1fr; } }

/* Platzhalter für noch fehlende Pflichtangaben – muss vor dem Livegang verschwinden */
mark.fehlt { background: #ffe08a; color: #5a3d00; padding: 0 0.25em; }

/* Neues Logo */
.marke img { height: 2.4rem; }
.schriftfeld img.logo-voll { height: auto; width: 100%; max-width: 15rem; margin: 0.2rem 0; }
