/* SYNEX – ruhige Firmenseite mit einem einzigen Motiv:
   die Leistungen hängen als Abgänge an einer Sammelschiene.
   Marineblau = Schrift und Linie, Rot = EIN (Schiene unter Spannung, geschlossener Schalter, Anruf). */

@font-face {
  font-family: Archivo;
  src: url(assets/fonts/archivo.woff2) format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {
  font-family: Normschrift; /* osifont, ISO 3098 – nur für die Kennzeichen am Plan */
  src: url(assets/fonts/osifont.woff2) format("woff2");
  font-display: swap;
}

:root {
  --papier: #f8f9fb;
  --tusche: #071d54;
  --tusche-2: #414f7d;
  --linie: #cdd2df;
  --ein: #c8161d;
  --ein-tief: #a50f16;

  --pad: clamp(1.25rem, 4vw, 3rem);
  --seite: max(var(--pad), calc(50% - 39rem + var(--pad))); /* Inhalt höchstens 78rem breit, Flächen laufen durch */
  --rinne: 2.5rem;   /* Einzug rechts der Steigleitung */
  --ader: .25rem;    /* x-Position der Steigleitung */
  --weit: clamp(4rem, 8vw, 7rem);
  --raus: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light;
}

*, ::before, ::after { box-sizing: border-box; }
::selection { background: var(--tusche); color: var(--papier); }
.blau ::selection { background: var(--papier); color: var(--tusche); }

html {
  font-size: 106.25%;
  scroll-behavior: smooth;
  scroll-padding-top: 1rem;
  scrollbar-color: var(--tusche) var(--papier);
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--papier);
  color: var(--tusche);
  font: 400 1rem/1.55 Archivo, "Helvetica Neue", Arial, sans-serif;
}

h1, h2, h3, p, ul, ol, figure, address { margin: 0; }
ul, ol { padding: 0; list-style: none; }
address { font-style: normal; }
h1, h2 {
  font-weight: 650;
  font-stretch: 112%;
  letter-spacing: -.02em;
  line-height: 1.08;
  text-wrap: balance;
}
h1 { font-size: clamp(1.6rem, 7.4vw, 2.6rem); }
h2 { font-size: clamp(1.4rem, 1rem + 1.4vw, 1.9rem); }
h3 { font-size: 1.06rem; font-weight: 650; font-stretch: 112%; line-height: 1.22; }
p { max-width: 60ch; }
img { display: block; max-width: 100%; }

a { color: inherit; text-decoration-thickness: 1.5px; text-underline-offset: .2em; }
a:hover { color: var(--ein); }
:focus-visible { outline: 2px solid var(--ein); outline-offset: 3px; }

.ns { font-family: Normschrift, "DIN Alternate", sans-serif; font-weight: 400; letter-spacing: .04em; }
.zahl { font-variant-numeric: tabular-nums; white-space: nowrap; }
.sprung { position: absolute; left: 1rem; top: -4rem; background: var(--tusche); color: var(--papier); padding: .6rem 1rem; z-index: 20; }
.sprung:focus, .sprung:hover { top: 1rem; color: var(--papier); }

/* ---------- Kopf ---------- */

.kopf {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .8rem clamp(1rem, 2vw, 1.75rem);
  padding: 1.25rem var(--seite);
}
.marke { display: block; width: clamp(7.5rem, 13vw, 10.5rem); }
.marke img { width: 100%; height: auto; }
.kopf nav { display: flex; flex-wrap: wrap; gap: .35rem .7rem; order: 3; width: 100%; font-size: .94rem; font-weight: 500; }
.kopf nav a { text-decoration: none; white-space: nowrap; }
body:has(.rufleiste) .kopf .ruf { display: none; } /* auf dem Telefon übernimmt die Anrufleiste, wo es sie gibt */
.ruf { padding: .35rem .75rem; border: 2px solid; font-weight: 650; text-decoration: none; }

/* ---------- Einstieg ---------- */

.anlage {
  display: grid;
  gap: 2rem 3.5rem;
  align-items: center;
  padding: clamp(1.25rem, 3.5vw, 3rem) var(--seite) var(--weit);
}
h1 span { display: block; }
.vorspann { margin-top: 1.25rem; max-width: 52ch; font-size: 1.08rem; }
.taten { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; margin-top: 1.75rem; }
.nachweis { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--linie); max-width: 52ch; font-size: .9rem; color: var(--tusche-2); }
.knopf {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0 .6rem;
  padding: .8rem 1.2rem;
  border-radius: 2px;
  background: var(--ein);
  color: #fff;
  font-weight: 650;
  font-stretch: 112%;
  text-decoration: none;
  transition: background-color .2s, transform .2s var(--raus);
}
.knopf:hover { background: var(--ein-tief); color: #fff; }
.knopf:active { transform: translateY(1px); }
.knopf:focus-visible { outline-color: var(--tusche); }

.bild img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; background: var(--linie); }
.bild figcaption { margin-top: .4rem; font-size: .78rem; color: var(--tusche-2); }
.band { padding: 0 var(--seite) var(--weit); }
.band img { aspect-ratio: 16 / 9; object-position: 50% 45%; }

/* ---------- Leistungen: Sammelschiene und Abgänge ---------- */

#leistungen { padding: 0 var(--seite) var(--weit); }
.schiene { position: relative; padding-left: var(--rinne); }
.schiene h2 { position: relative; padding: 2rem 0 .9rem; }
.schiene:first-of-type h2 { padding-top: 0; }
.schiene h2::before, .schiene ul::after { /* Steigleitung */
  content: "";
  position: absolute;
  left: calc(var(--ader) - var(--rinne));
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--ein);
}
.schiene ul { position: relative; }

.sch {
  width: 24px;
  height: 64px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  background: var(--papier);
}
.klinge {
  transform-box: view-box;
  transform-origin: 12px 48px;
  transform: rotate(-20deg); /* gezeichnet wie im Plan: spannungslos, offen */
  transition: transform .45s var(--raus);
}
.bmk { position: absolute; font-size: .9rem; white-space: nowrap; }

.abgang { position: relative; padding: 2.9rem 0 1.9rem; --strich: var(--tusche); }
.abgang::before { /* Stichleitung von der Steigleitung zum Schalter */
  content: "";
  position: absolute;
  left: calc(var(--ader) - var(--rinne));
  top: calc(1.2rem - 1px);
  width: calc(var(--rinne) - var(--ader));
  height: 2px;
  background: var(--ein);
}
.abgang .sch { position: absolute; left: 20px; top: calc(1.2rem - 32px); transform: rotate(-90deg); color: var(--strich); transition: color .3s; }
.abgang .bmk { left: 5.4rem; top: .55rem; color: var(--strich); transition: color .3s; }
.abgang h3 { margin-bottom: .35rem; }
.abgang p { color: var(--tusche-2); font-size: .97rem; max-width: 46ch; overflow-wrap: break-word; }
.abgang.ein { --strich: var(--ein); }
.abgang.ein .klinge { transform: none; }
.reserve::before { background: none; border-top: 2px dashed var(--tusche-2); }
.reserve .sch { stroke-dasharray: 3 4; color: var(--tusche-2); }
.reserve .bmk { color: var(--tusche-2); }
.letzte li:last-child::after { /* Steigleitung endet am letzten Abgang */
  content: "";
  position: absolute;
  left: calc(var(--ader) - var(--rinne) - 2px);
  top: calc(1.2rem + 1px);
  bottom: 0;
  width: 6px;
  background: var(--papier);
  z-index: 1;
}

/* ---------- Für wen ---------- */

.wer { display: grid; gap: 2rem 3.5rem; padding: 0 var(--seite) var(--weit); }
.wer > div { display: contents; } /* schmal: Überschrift, Liste, dann das Bild */
.wer .bild { order: 1; }
.wer .bild img { object-position: 50% 45%; }
.anlage .bild img { object-position: 50% 85%; }
.gruppen li { padding: 1.4rem 0; border-top: 1px solid var(--linie); }
.gruppen li:last-child { border-bottom: 1px solid var(--linie); }
.gruppen h3 { margin-bottom: .3rem; }
.gruppen p { color: var(--tusche-2); max-width: 56ch; }

/* ---------- Ablauf ---------- */

.ablauf { padding: 0 var(--seite) var(--weit); }
.reihe { display: grid; gap: 0 2rem; margin-top: 2rem; counter-reset: s; }
.reihe li {
  display: grid;
  grid-template-columns: 2.25rem 1fr;
  padding: 1.1rem 0 1.3rem;
  border-top: 1px solid var(--linie);
  counter-increment: s;
}
.reihe li::before {
  content: counter(s);
  grid-row: span 2;
  font-size: 1.35rem;
  font-weight: 500;
  font-stretch: 112%;
  line-height: 1.1;
  color: var(--tusche-2);
}
.reihe h3 { margin-bottom: .3rem; }
.reihe p { color: var(--tusche-2); font-size: .97rem; max-width: 46ch; }

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

.blau { background: var(--tusche); color: var(--papier); }
.blau a:hover { color: #fff; text-decoration-thickness: 2.5px; }
.blau :focus-visible { outline-color: #fff; }
.anschluss { padding: var(--weit) var(--seite) calc(var(--weit) * .8); }
.anschluss h2 { font-size: clamp(1.7rem, 1rem + 2.4vw, 2.8rem); margin-bottom: 1rem; }
.anschluss p { font-size: 1.08rem; max-width: 50ch; }
.nummer {
  display: inline-block;
  margin-top: 2.25rem;
  font-size: clamp(1.7rem, 9.2vw, 4.75rem);
  font-weight: 650;
  font-stretch: 112%;
  line-height: 1;
  letter-spacing: -.02em;
  text-decoration: none;
}
.anschluss .knopf:hover { background: #fff; color: var(--ein-tief); }

/* ---------- Fuß ---------- */

.fuss {
  display: grid;
  gap: 1.5rem 3rem;
  padding: 2rem var(--seite) 2.5rem;
  border-top: 1px solid var(--linie);
  font-size: .94rem;
}
.fuss.blau { border-top-color: rgb(255 255 255 / .22); padding-bottom: calc(6rem + env(safe-area-inset-bottom)); } /* Platz für die Anrufleiste */
.fuss address { white-space: nowrap; }
.fuss .marke { width: 8.5rem; margin-bottom: .7rem; }
.fuss nav { display: flex; flex-direction: column; align-items: start; gap: .3rem; }
.urheber { grid-column: 1 / -1; max-width: none; margin-top: .5rem; padding-top: 1.25rem; border-top: 1px solid var(--linie); font-size: .85rem; text-align: center; }
.blau .urheber { border-top-color: rgb(255 255 255 / .22); }

/* ---------- Rechtstexte ---------- */

.prosa { padding: clamp(1.5rem, 4vw, 3.5rem) var(--seite) var(--weit); }
.prosa h1 { margin-bottom: 2rem; }
.prosa h2 { font-size: 1.2rem; letter-spacing: 0; margin: 2.25rem 0 .6rem; }
.prosa p, .prosa ul { max-width: 62ch; margin-bottom: .9rem; }
.prosa ul { padding-left: 1.2rem; list-style: square; }

/* ---------- Anrufleiste auf dem Telefon ---------- */

.rufleiste {
  position: fixed;
  inset: auto 0 0;
  z-index: 10;
  display: flex;
  justify-content: center;
  gap: .6rem;
  padding: .85rem 1rem calc(.85rem + env(safe-area-inset-bottom));
  background: var(--ein);
  color: #fff;
  font-weight: 650;
  font-stretch: 112%;
  text-decoration: none;
}
.rufleiste:hover { color: #fff; }

@media (min-width: 44em) {
  html { scroll-padding-top: 5.5rem; }
  .rufleiste { display: none; }
  .fuss.blau { padding-bottom: 2.5rem; }
  .kopf { position: sticky; top: 0; z-index: 10; padding-block: .9rem; background: var(--papier); border-bottom: 1px solid var(--linie); } /* die Nummer bleibt beim Lesen erreichbar */
  .kopf nav { order: 0; width: auto; margin-left: auto; gap: clamp(1rem, 2vw, 1.75rem); font-size: 1rem; }
  body:has(.rufleiste) .kopf .ruf { display: block; }
  .band img { aspect-ratio: 5 / 2; }
  .fuss { grid-template-columns: 1.6fr 1.3fr 1.3fr 1fr; }
}

@media (min-width: 44em) and (max-width: 62.49em) { /* breites Hochformat: Titel links, Beschreibung rechts */
  .abgang { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 0 2rem; align-items: start; }
  .abgang p { max-width: none; }
  .reihe li { grid-template-columns: 2.25rem minmax(0, 2fr) minmax(0, 3fr); gap: 0 1rem; }
  .reihe li::before { grid-row: auto; }
  .reihe p { max-width: none; }
}

@media (min-width: 62.5em) {
  :root { --rinne: calc(var(--pad) - .5rem); }
  h1 { font-size: clamp(2.2rem, .9rem + 2.4vw, 2.9rem); }

  .anlage { grid-template-columns: 7fr 5fr; }
  .anlage .bild img { aspect-ratio: 4 / 5; max-height: 38rem; object-position: 50% 70%; }
  .wer .bild img { aspect-ratio: 1; }
  .wer { grid-template-columns: 5fr 7fr; align-items: start; }
  .wer > div { display: block; }
  .wer h2 { margin-bottom: 1.5rem; }

  /* die Steigleitung steht im Seitenrand, die Überschriften bleiben in der Textflucht */
  .schiene { margin-left: calc(-1 * var(--rinne)); }
  .schiene ul { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 1.75rem; padding-bottom: 1.5rem; }
  .schiene ul::before { /* Sammelschiene */
    content: "";
    position: absolute;
    left: calc(var(--ader) - var(--rinne));
    right: 0;
    top: 0;
    height: 3px;
    background: var(--ein);
  }
  .schiene h2::after { /* Abzweigpunkt Steigleitung/Schiene */
    content: "";
    position: absolute;
    left: calc(var(--ader) - var(--rinne) - 3px);
    bottom: -6px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ein);
    z-index: 1;
  }
  .schiene:first-of-type h2::before { top: 100%; } /* die Steigleitung beginnt an der ersten Schiene */
  .letzte h2::after, .letzte ul::after, .letzte li:last-child::after { display: none; }

  .abgang { padding: 6rem 0 2.25rem 2.1rem; }
  .abgang::before {
    left: 11px;
    top: 0;
    bottom: .4rem;
    width: 2px;
    height: auto;
    background: linear-gradient(var(--ein), var(--ein)) top / 100% 0 no-repeat var(--tusche);
    transition: background-size .6s var(--raus);
  }
  .abgang.ein::before { background-size: 100% 100%; }
  .abgang::after, .letzte li.abgang:last-child::after { /* Klemme am Ende des Abgangs */
    content: "";
    display: block;
    position: absolute;
    left: 6px;
    top: auto;
    bottom: 0;
    width: 12px;
    height: 12px;
    border: 2px solid var(--strich);
    border-radius: 50%;
    background: var(--papier);
    transition: border-color .3s;
  }
  .abgang .sch { left: 0; top: 1.1rem; transform: none; }
  .abgang .bmk { left: 2.1rem; top: 2.5rem; }
  .reserve::before { width: 0; background: none; border-top: 0; border-left: 2px dashed var(--tusche-2); }
  .reserve::after { border-style: dashed; border-color: var(--tusche-2); }

  .reihe { grid-template-columns: repeat(5, 1fr); }
  .reihe li { display: block; }
  .reihe li::before { display: block; margin-bottom: .7rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, ::before, ::after { animation: none !important; transition: none !important; }
}
