/* ================================================================
   ROHRWERK HAUSTECHNIK — Blueprint / Industrial
   Palette: Blaupause #0E2A47 · Papier #F2EFE9 · Kupfer #D2691E
   Fonts: Oswald (Headlines) · Space Mono (Labels/Maße)
   ================================================================ */

:root {
  --blue: #0E2A47;
  --blue-deep: #0A2039;
  --paper: #F2EFE9;
  --copper: #D2691E;
  --cyan: #4FC8E9;
  --line-on-blue: rgba(199, 222, 243, 0.34);
  --line-on-paper: rgba(14, 42, 71, 0.28);
  --pipe-base: #7FA6C9;
  --flow: var(--copper);
  --trunk-x: 84px;
  --content-x: 170px;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --mono: "Space Mono", monospace;
  --head: "Oswald", sans-serif;
}

body[data-flow="kalt"] { --flow: var(--cyan); }

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--blue);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }

.mono { font-family: var(--mono); }

/* ---------------- Rohrleitungs-Layer ---------------- */

.pipe-layer {
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  z-index: 3;
  pointer-events: none;
}
.pipe-layer svg { display: block; width: 100%; height: 100%; overflow: visible; }

.pipe-casing {
  fill: none;
  stroke: var(--pipe-base);
  stroke-opacity: 0.22;
  stroke-width: 10;
}
.pipe-base {
  fill: none;
  stroke: var(--pipe-base);
  stroke-opacity: 0.55;
  stroke-width: 1.5;
  stroke-dasharray: 6 5;
}
.pipe-flow {
  fill: none;
  stroke: var(--flow);
  stroke-width: 4;
  transition: stroke 1.1s var(--ease);
}
.pipe-flow-dash {
  fill: none;
  stroke: var(--paper);
  stroke-opacity: 0.5;
  stroke-width: 4;
  stroke-dasharray: 10 26;
  animation: dashflow 1.15s linear infinite;
}
@keyframes dashflow { to { stroke-dashoffset: -36; } }

.branch-flow {
  fill: none;
  stroke: var(--flow);
  stroke-width: 4;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 1s var(--ease), stroke 1.1s var(--ease);
}
.branch-flow.on { stroke-dashoffset: 0; }

.fitting {
  fill: var(--blue);
  stroke: var(--pipe-base);
  stroke-opacity: 0.8;
  stroke-width: 1.5;
}
.fitting-hot { fill: var(--flow); stroke: none; transition: fill 1.1s var(--ease); }

/* Ventil */
.valve { pointer-events: auto; cursor: pointer; }
.valve .wheel {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0.9s var(--ease);
}
.valve circle.rim {
  fill: var(--blue);
  stroke: var(--flow);
  stroke-width: 3;
  transition: stroke 1.1s var(--ease);
}
.valve line {
  stroke: var(--flow);
  stroke-width: 3;
  stroke-linecap: square;
  transition: stroke 1.1s var(--ease);
}
.valve .hit { fill: transparent; }
.valve .valve-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  fill: var(--pipe-base);
}
@media (max-width: 768px) {
  .valve .valve-label { display: none; }
}

/* ---------------- Header ---------------- */

.site-head {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.1rem 2.2rem;
  background: rgba(14, 42, 71, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line-on-blue);
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  font-family: var(--head);
  font-size: 1.15rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.brand em { font-style: normal; color: var(--copper); margin-left: 0.45em; }
.brand-mark { width: 26px; height: 26px; color: var(--copper); }
.site-nav { display: flex; gap: 2rem; }
.site-nav a {
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: border-color 0.4s var(--ease), color 0.4s var(--ease);
}
.site-nav a:hover { border-color: var(--copper); color: var(--copper); }
.head-phone {
  white-space: nowrap;
  font-size: 0.85rem;
  text-decoration: none;
  color: var(--copper);
  border: 1px solid var(--copper);
  padding: 0.45rem 0.9rem;
  transition: background 0.4s var(--ease), color 0.4s var(--ease);
}
.head-phone:hover { background: var(--copper); color: var(--blue); }

/* ---------------- Sektionen (gemeinsam) ---------------- */

.sec {
  position: relative;
  padding: 160px 6vw 160px var(--content-x);
}
.sec-paper {
  background: var(--paper);
  color: var(--blue);
  --line: var(--line-on-paper);
  --stroke-ink: rgba(14, 42, 71, 0.5);
}
.sec-blue {
  background: var(--blue);
  color: var(--paper);
  --line: var(--line-on-blue);
  --stroke-ink: rgba(199, 222, 243, 0.55);
}
.sec-paper { border-top: 1px solid rgba(14, 42, 71, 0.15); border-bottom: 1px solid rgba(14, 42, 71, 0.15); }

.sec-label {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  opacity: 0.75;
  margin-bottom: 2.2rem;
}
.sec-label .tick {
  display: inline-block;
  width: 34px;
  height: 1px;
  background: currentColor;
}

/* Titel mit Wasser-Füllung */
.fill-title {
  position: relative;
  display: inline-block;
  font-family: var(--head);
  font-weight: 600;
  text-transform: uppercase;
  line-height: 1.02;
  letter-spacing: 0.01em;
  color: var(--stroke-ink);
}
@supports (-webkit-text-stroke: 1px black) {
  .fill-title { color: transparent; -webkit-text-stroke: 1.5px var(--stroke-ink); }
}
.fill-title::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  color: var(--flow);
  -webkit-text-stroke: 0;
  clip-path: inset(100% 0 0 0);
  transition: clip-path 1.2s var(--ease), color 1.1s var(--ease);
}
.fill-title.filled::after { clip-path: inset(-2% 0 0 0); }

.sec-title {
  font-size: clamp(3rem, 7vw, 6.2rem);
  margin-bottom: 4.5rem;
}

/* Scroll-Reveals */
.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.reveal.in { opacity: 1; transform: none; }

/* ---------------- Hero ---------------- */

.hero {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 140px 6vw 120px var(--content-x);
  --stroke-ink: rgba(199, 222, 243, 0.55);
  background:
    linear-gradient(rgba(199, 222, 243, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(199, 222, 243, 0.05) 1px, transparent 1px),
    var(--blue-deep);
  background-size: 56px 56px, 56px 56px, auto;
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem 3rem;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  opacity: 0.65;
  margin-bottom: 3.4rem;
}
.hero-title {
  display: flex;
  flex-direction: column;
  font-size: clamp(3.4rem, 10.5vw, 9.5rem);
  font-weight: 600;
  line-height: 0.98;
}
.hero-title .fill-title { align-self: flex-start; }
.hero-title .indent { margin-left: clamp(1.5rem, 6vw, 7rem); }
.dim-line {
  width: min(560px, 70%);
  height: 24px;
  margin: 2.4rem 0 0 clamp(1.5rem, 6vw, 7rem);
  stroke: var(--line-on-blue);
  stroke-width: 1;
}
.hero-sub { max-width: 560px; margin-top: 3rem; }
.hero-caption { font-size: 0.78rem; letter-spacing: 0.3em; color: var(--copper); margin-bottom: 1.1rem; }
.hero-lede { font-size: 1.05rem; opacity: 0.88; }
.hero-hint { margin-top: 2.6rem; font-size: 0.7rem; letter-spacing: 0.2em; opacity: 0.5; }

.cross { position: absolute; width: 22px; height: 22px; opacity: 0.5; }
.cross::before, .cross::after { content: ""; position: absolute; background: var(--line-on-blue); }
.cross::before { left: 50%; top: 0; width: 1px; height: 100%; }
.cross::after { top: 50%; left: 0; height: 1px; width: 100%; }
.cross-a { top: 16vh; right: 10vw; }
.cross-b { bottom: 12vh; right: 24vw; }

/* ---------------- Leistungen ---------------- */

.service-list { list-style: none; max-width: 980px; }
.service {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  gap: 2rem;
  align-items: baseline;
  padding: 2.4rem 0;
  border-top: 1px solid var(--line);
}
.service:last-child { border-bottom: 1px solid var(--line); }
.s-no { font-size: 0.85rem; color: var(--copper); }
.service h3 {
  font-family: var(--head);
  font-weight: 500;
  text-transform: uppercase;
  font-size: 1.65rem;
  letter-spacing: 0.03em;
  margin-bottom: 0.5rem;
}
.service p { max-width: 56ch; font-size: 0.92rem; opacity: 0.82; }
.s-spec { font-size: 0.7rem; letter-spacing: 0.14em; opacity: 0.55; white-space: nowrap; }

/* ---------------- Referenz ---------------- */

.ref { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); gap: 4rem; align-items: start; max-width: 1200px; }
.ref-frame { position: relative; padding: 14px; }
.ref-frame img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.corner { position: absolute; width: 22px; height: 22px; border: 0 solid var(--copper); }
.c-tl { top: 0; left: 0; border-top-width: 2px; border-left-width: 2px; }
.c-tr { top: 0; right: 0; border-top-width: 2px; border-right-width: 2px; }
.c-bl { bottom: 0; left: 0; border-bottom-width: 2px; border-left-width: 2px; }
.c-br { bottom: 0; right: 0; border-bottom-width: 2px; border-right-width: 2px; }
.ref-caption h3 {
  font-family: var(--head);
  font-weight: 500;
  text-transform: uppercase;
  font-size: 1.8rem;
  line-height: 1.15;
  margin-bottom: 1.2rem;
}
.ref-caption > p { font-size: 0.92rem; opacity: 0.85; margin-bottom: 2.2rem; }
.ref-data { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem 2rem; }
.ref-data dt { font-size: 0.65rem; letter-spacing: 0.2em; opacity: 0.55; margin-bottom: 0.2rem; }
.ref-data dd { font-size: 0.95rem; color: var(--copper); }

/* ---------------- Betrieb ---------------- */

.about { display: grid; grid-template-columns: minmax(260px, 420px) minmax(0, 1fr); gap: 4.5rem; align-items: start; max-width: 1160px; }
.about-img img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.img-note { margin-top: 0.8rem; font-size: 0.65rem; letter-spacing: 0.18em; opacity: 0.55; }
.about-text > p { max-width: 58ch; font-size: 0.98rem; margin-bottom: 1.4rem; opacity: 0.9; }
.stats { display: grid; grid-template-columns: repeat(4, auto); gap: 2.5rem; margin-top: 3.2rem; justify-content: start; }
.stat { border-top: 1px solid var(--line); padding-top: 1rem; min-width: 96px; }
.stat dt { font-size: 0.62rem; letter-spacing: 0.2em; opacity: 0.6; margin-bottom: 0.3rem; }
.stat dd { font-family: var(--head); font-weight: 600; font-size: 2.6rem; line-height: 1; color: var(--copper); }

/* ---------------- Notdienst ---------------- */

.sec-notdienst { padding-top: 110px; padding-bottom: 110px; }
.notdienst-line {
  font-family: var(--head);
  font-weight: 500;
  text-transform: uppercase;
  font-size: clamp(1.6rem, 3.6vw, 3rem);
  line-height: 1.25;
  max-width: 900px;
}
.notdienst-phone {
  display: inline-block;
  margin-left: 0.6em;
  color: var(--flow);
  text-decoration: none;
  border-bottom: 3px solid var(--flow);
  transition: color 1.1s var(--ease), border-color 1.1s var(--ease);
}
.notdienst-note { margin-top: 1.6rem; font-size: 0.68rem; letter-spacing: 0.18em; opacity: 0.55; }

/* ---------------- Kontakt ---------------- */

.contact { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(260px, 1fr); gap: 4.5rem; max-width: 1100px; }
.contact-form .field { margin-bottom: 1.8rem; }
.contact-form label {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  opacity: 0.65;
  margin-bottom: 0.5rem;
}
.contact-form input,
.contact-form textarea {
  width: 100%;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 0;
  color: inherit;
  font-family: var(--mono);
  font-size: 0.95rem;
  padding: 0.8rem 0.9rem;
  transition: border-color 0.4s var(--ease);
}
.contact-form input:focus,
.contact-form textarea:focus { outline: none; border-color: var(--copper); }
.submit {
  display: inline-flex;
  align-items: baseline;
  gap: 1rem;
  background: var(--copper);
  color: var(--paper);
  border: 0;
  border-radius: 0;
  font-family: var(--head);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 1.05rem;
  padding: 0.95rem 1.6rem;
  cursor: pointer;
  transition: background 0.4s var(--ease);
}
.submit:hover { background: var(--blue); color: var(--paper); }
.submit .btn-no { font-size: 0.65rem; letter-spacing: 0.16em; opacity: 0.8; }
.contact-data { font-style: normal; }
.contact-data dl > div { border-top: 1px solid var(--line); padding: 1.1rem 0; }
.contact-data dt { font-size: 0.65rem; letter-spacing: 0.22em; opacity: 0.55; margin-bottom: 0.35rem; }
.contact-data dd { font-size: 0.92rem; line-height: 1.6; }
.contact-data a { color: var(--copper); text-decoration: none; }
.contact-data a:hover { text-decoration: underline; }

/* ---------------- Footer ---------------- */

.site-foot {
  position: relative;
  background: var(--blue-deep);
  padding: 70px 6vw 60px var(--content-x);
  border-top: 1px solid var(--line-on-blue);
}
.foot-nav { display: flex; flex-wrap: wrap; gap: 2rem; margin-bottom: 2.4rem; }
.foot-nav a {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  opacity: 0.75;
}
.foot-nav a:hover { color: var(--copper); opacity: 1; }
.foot-imprint p { font-size: 0.7rem; letter-spacing: 0.06em; opacity: 0.55; max-width: 80ch; }
.foot-note { margin-top: 1rem; }
.foot-note a { color: var(--copper); }

/* ---------------- Responsive ---------------- */

@media (max-width: 1024px) {
  :root { --trunk-x: 44px; --content-x: 100px; }
  .stats { grid-template-columns: repeat(2, auto); }
}

@media (max-width: 768px) {
  :root { --trunk-x: 20px; --content-x: 52px; }
  .site-head { padding: 0.9rem 1.2rem; }
  .site-nav { display: none; }
  .sec { padding-top: 110px; padding-bottom: 110px; padding-right: 5vw; }
  .hero { padding-right: 5vw; }
  .hero-title { font-size: clamp(2.3rem, 11.5vw, 3.4rem); }
  .hero-title .indent { margin-left: 0.8rem; }
  .dim-line { margin-left: 0.8rem; }
  .service { grid-template-columns: 44px 1fr; }
  .s-spec { display: none; }
  .ref, .about, .contact { grid-template-columns: 1fr; gap: 2.6rem; }
  .stats { gap: 1.6rem 2.2rem; }
  .cross-b { display: none; }
}

/* ---------------- Reduced Motion ---------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .fill-title::after { clip-path: inset(-2% 0 0 0); transition: none; }
  .pipe-flow-dash { animation: none; }
  .branch-flow { stroke-dashoffset: 0; transition: none; }
  .valve .wheel { transition: none; }
}
