/* =========================================================================
   ja-proengineering.de — Website-Layout
   Baut auf design-tokens.css (JANKE CI). Farben NIE hier neu definieren,
   immer die Tokens verwenden.

   CI-Regeln, die hier gelten:
   - Signal-Orange traegt NIE Text auf Hell. CTA = Orange-Flaeche + Midnight-Text.
   - Keine Schatten. Tiefe entsteht durch Flaeche, Linie und Weissraum.
   - Keine externen Ressourcen. Schriften liegen lokal in assets/fonts/.
   ========================================================================= */

@import url("design-tokens.css");

/* --- Schriften ---------------------------------------------------------- */
@font-face {
  font-family: "Montserrat";
  src: url("fonts/montserrat-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("fonts/inter-300.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("fonts/inter-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("fonts/inter-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* --- Farbschema festlegen ------------------------------------------------
   design-tokens.css ist theme-aware und kippt im dunklen Systemmodus die
   semantischen Tokens. Fuer ein Firmen-Aushaengeschild ist das unerwuenscht:
   Die CI ist auf hellen Grund ausgelegt ("Fliesstext auf Hell"), und ein
   Midnight-Logo auf Midnight-Flaeche verschwindet. Deshalb hier fest auf
   Hell. Die Kernfarben-Tokens bleiben unveraendert gueltig.
   ------------------------------------------------------------------------ */
:root { color-scheme: light; }

/* Die Selektoren spiegeln die aus design-tokens.css exakt wider. Gleiche
   Spezifitaet + spaetere Position = diese Werte gewinnen. Ein schlichtes
   :root reicht NICHT, weil :root:not([data-theme="light"]) spezifischer ist. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:      var(--c-ice);
    --surface: var(--c-white);
    --text:    var(--c-graphite);
    --heading: var(--c-midnight);
    --link:    var(--c-steel);
    --border:  var(--c-silver);
  }
}
:root[data-theme="dark"] {
  --bg:      var(--c-ice);
  --surface: var(--c-white);
  --text:    var(--c-graphite);
  --heading: var(--c-midnight);
  --link:    var(--c-steel);
  --border:  var(--c-silver);
}

/* --- Grundlagen --------------------------------------------------------- */

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

html { scroll-behavior: smooth; }

/* Sicherheitsnetz gegen waagerechtes Scrollen auf schmalen Geraeten.
   Deutsche Komposita ("Schnittstellenkoordination", "Maschinenverlagerung")
   sprengen sonst schmale Viewports. lang="de" im <html> steuert die Trennung. */
body { overflow-wrap: break-word; }
img, svg { max-width: 100%; height: auto; }

/* Silbentrennung NUR auf schmalen Bildschirmen: dort verhindert sie den
   Ueberlauf, auf breiten Zeilen macht sie den Satz nur unruhig. */
@media (max-width: 640px) {
  p, li, dd { hyphens: auto; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: var(--fw-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
}

/* Technische Angaben: Ziffern gleich breit, damit Tabellen und
   Nummerierungen sauber untereinander stehen. */
.tech { font-variant-numeric: tabular-nums; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: var(--fw-display);
  color: var(--heading);
  margin: 0 0 var(--sp-3);
}
h1 { font-size: var(--fs-h1); line-height: var(--lh-h1); }
h2 { font-size: var(--fs-h2); line-height: var(--lh-h2); }
h3 { font-size: var(--fs-h3); line-height: var(--lh-h3); }

p { margin: 0 0 var(--sp-3); }

a { color: var(--link); }
a:hover { text-decoration: none; }

/* Telefonnummern nie umbrechen: Die Leerzeichen in "+49 176 612 70 948"
   sind gueltige Trennstellen — im Fliesstext zerfaellt die Nummer sonst
   ueber zwei Zeilen und liest sich wie zwei verschiedene Angaben. */
a[href^="tel:"] { white-space: nowrap; }

/* Tastaturbedienung sichtbar halten — Barrierefreiheit */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: var(--line-strong) solid var(--c-orange);
  outline-offset: 2px;
}

/* Sprungmarke fuer Screenreader und Tastatur */
.skip {
  position: absolute;
  left: -9999px;
  background: var(--c-midnight);
  color: var(--c-white);
  padding: var(--sp-2) var(--sp-3);
  z-index: 10;
}
.skip:focus { left: var(--sp-3); top: var(--sp-3); }

/* --- Aussenmasse -------------------------------------------------------- */

.wrap {
  max-width: 860px;
  margin: 0 auto;
  padding-left: var(--sp-4);
  padding-right: var(--sp-4);
}

.inhalt { padding-top: var(--sp-7); padding-bottom: var(--sp-7); }

.abschnitt + .abschnitt { margin-top: var(--sp-7); }

/* --- Kopfbereich -------------------------------------------------------- */

.kopf {
  background: var(--surface);
  border-bottom: var(--line-hair) solid var(--border);
}

.kopf__innen {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding-top: var(--sp-3);
  padding-bottom: var(--sp-3);
  flex-wrap: wrap;
}

/* Logo-Groesse: Das Zeichen ist 4,5:1 breit. Unter ~52px Hoehe wird die
   gesperrte Subline "PROJECT ENGINEERING" unleserlich. Nicht kleiner setzen. */
.kopf__logo { display: block; line-height: 0; }
.kopf__logo img { height: 52px; width: auto; display: block; }

@media (max-width: 400px) {
  .kopf__logo img { height: 44px; }
}

.nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: var(--sp-4);
}

.nav a {
  color: var(--heading);
  text-decoration: none;
  font-weight: var(--fw-body-medium);
  padding: var(--sp-1) 0;
  border-bottom: var(--line-strong) solid transparent;
}
.nav a:hover { border-bottom-color: var(--c-orange); }

/* aktuelle Seite kennzeichnen */
.nav a[aria-current="page"] {
  border-bottom-color: var(--c-orange);
}

/* --- Hero (Startseite) ---------------------------------------------------
   Feste Farben statt semantischer Tokens: Der Hero bleibt in JEDEM
   Farbschema Midnight mit weisser Schrift (11.9:1, AAA). Semantische
   Tokens wuerden im Dark Mode die Flaeche gegen den Seitengrund aufloesen.
   ------------------------------------------------------------------------ */

.hero {
  background: var(--c-midnight);
  color: var(--c-white);
  padding-top: var(--sp-7);
  padding-bottom: var(--sp-7);
}

.hero h1 {
  color: var(--c-white);
  font-size: 34px;
  line-height: 1.25;
  margin-bottom: var(--sp-2);
}

.hero__rolle {
  color: var(--c-steel-lite);
  font-size: var(--fs-h3);
  line-height: var(--lh-h3);
  margin-bottom: var(--sp-5);
  max-width: 34em;
}

/* Akzentlinie in Signal-Orange — Flaeche, nicht Text */
.hero__linie {
  width: 64px;
  height: var(--line-strong);
  background: var(--c-orange);
  border: 0;
  margin: 0 0 var(--sp-4);
}

/* Kenndaten-Zeile unter dem Hero — Datenblatt-Anmutung statt Werbefloskel */
.hero__daten {
  list-style: none;
  margin: var(--sp-6) 0 0;
  padding: var(--sp-4) 0 0;
  border-top: var(--line-hair) solid rgba(197, 205, 212, 0.3);
  display: grid;
  gap: var(--sp-4);
  font-size: var(--fs-small);
  line-height: var(--lh-small);
}

@media (min-width: 720px) {
  .hero { padding-top: 96px; padding-bottom: 96px; }
  .hero h1 { font-size: 44px; }
  .hero__daten { grid-template-columns: repeat(3, 1fr); gap: var(--sp-5); }
}

.hero__daten dt,
.hero__daten .schluessel {
  display: block;
  color: var(--c-steel-lite);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 11px;
  margin-bottom: var(--sp-1);
}

.hero__daten dd { margin: 0; }
.hero__daten .wert { color: var(--c-white); }

/* --- Abschnittsmarke -----------------------------------------------------
   Greift die gesperrte Versalien-Subline des Logos auf
   ("PROJECT ENGINEERING", --ls-subline). Traegt die technische Anmutung
   durch die ganze Seite.
   ------------------------------------------------------------------------ */

.marke {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
  color: var(--c-steel);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.24em;
}

/* durchlaufende Hairline rechts der Marke — technisches Raster */
.marke::after {
  content: "";
  flex: 1;
  height: var(--line-hair);
  background: var(--border);
}

/* Midnight, NICHT Orange: Orange traegt nie Text auf hellem Grund (CI-Regel).
   Der Orange-Akzent sitzt stattdessen als Flaeche an den Schwerpunkt-Kanten. */
.marke .nr {
  font-variant-numeric: tabular-nums;
  color: var(--c-midnight);
  letter-spacing: 0.1em;
}

/* --- Portraet-Abschnitt (Ueber-Seite) ----------------------------------- */

.portrait { display: grid; gap: var(--sp-5); }

@media (min-width: 720px) {
  /* Bildspalte fest, Textspalte nimmt den Rest — sonst wandert die
     Textbreite mit der Bildgroesse mit. */
  .portrait { grid-template-columns: 260px 1fr; gap: var(--sp-6); align-items: start; }
}

.portrait__bild {
  display: block;
  width: 100%;
  max-width: 260px;
  height: auto;
  border-radius: var(--radius-flat);
  /* schmale Akzentkante statt Schatten — CI erlaubt keine Schatten */
  border-top: var(--line-strong) solid var(--c-orange);
}

.portrait__text > p:first-child { margin-top: 0; }

/* --- Datenblatt-Liste (Qualifikation, Verfuegbarkeit) ------------------- */

.daten { margin: 0; display: grid; gap: 0; }

.daten > div {
  display: grid;
  gap: var(--sp-1);
  padding: var(--sp-3) 0;
  border-top: var(--line-hair) solid var(--border);
}
.daten > div:last-child { border-bottom: var(--line-hair) solid var(--border); }

@media (min-width: 720px) {
  .daten > div { grid-template-columns: 200px 1fr; gap: var(--sp-4); align-items: baseline; }
}

.daten dt {
  color: var(--c-steel);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}
.daten dd { margin: 0; color: var(--heading); }

/* Innenseiten-Hero: flacher als die Startseite, damit der Inhalt frueher beginnt */
.hero--innen { padding-top: var(--sp-6); padding-bottom: var(--sp-6); }
@media (min-width: 720px) {
  .hero--innen { padding-top: var(--sp-7); padding-bottom: var(--sp-7); }
}
.hero--innen .hero__rolle { margin-bottom: 0; }

/* --- Leistungsposten -----------------------------------------------------
   Ein Posten je Leistung. Die Nummer sitzt als eigene Spalte links, damit
   die Ueberschriften eine gemeinsame Fluchtlinie bekommen — Datenblatt-Optik.
   ------------------------------------------------------------------------ */

.posten {
  padding-top: var(--sp-5);
  border-top: var(--line-hair) solid var(--border);
}
.posten:first-of-type { border-top: 0; padding-top: var(--sp-2); }
.posten + .posten { margin-top: var(--sp-5); }

/* Feste Spaltenbreite statt em: Nummer und Fliesstext haben
   unterschiedliche Schriftgroessen, em-Werte liefen sonst auseinander. */
.posten { --nr-spalte: 40px; }

.posten h2 {
  display: flex;
  align-items: baseline;
  gap: var(--sp-3);
  font-size: var(--fs-h2);
  line-height: var(--lh-h2);
  margin-bottom: var(--sp-2);
}

.posten__nr {
  flex: none;
  width: var(--nr-spalte);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--fs-small);
  color: var(--c-steel);
  letter-spacing: 0.08em;
}

/* Fliesstext auf die Fluchtlinie der Ueberschrift einruecken */
@media (min-width: 720px) {
  .posten p { margin-left: calc(var(--nr-spalte) + var(--sp-3)); }
}

/* --- Call-to-Action ------------------------------------------------------
   CI-Regel: Orange-FLAECHE mit Midnight-Text (4.84:1, AA).
   Orange wird nie als Textfarbe auf hellem Grund gesetzt.
   ------------------------------------------------------------------------ */

.cta {
  display: inline-block;
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  font-family: var(--font-body);
  font-weight: var(--fw-body-medium);
  font-size: var(--fs-body);
  line-height: 1;
  padding: var(--sp-3) var(--sp-5);
  border: 0;
  border-radius: var(--radius-flat); /* technische Kante statt Rundung */
  text-decoration: none;
  cursor: pointer;
}
.cta:hover { background: #d97b1c; }

.cta--sekundaer {
  background: transparent;
  color: var(--c-white);
  border: var(--line-std) solid var(--c-steel-lite);
  margin-left: var(--sp-3);
}
.cta--sekundaer:hover { background: rgba(255, 255, 255, 0.1); }

/* --- Leistungs-Anriss ---------------------------------------------------- */

/* Untergruppe innerhalb eines Abschnitts. Kleiner als .marke, ohne Linie —
   trennt Rolle (was ich bin) von Vorhaben (was ich verantworte). */
.gruppe {
  margin: var(--sp-5) 0 var(--sp-3);
  color: var(--c-graphite);
  font-size: var(--fs-small);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}
.gruppe:first-of-type { margin-top: var(--sp-4); }

/* Schwerpunkte als nummeriertes Raster — Datenblatt statt Werbekacheln.
   Kanten flach (--radius-flat), Tiefe nur ueber Linie und Flaeche. */

.leistungen {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--line-hair);
  background: var(--border); /* Fugen des Rasters */
  border: var(--line-hair) solid var(--border);
  border-radius: var(--radius-flat);
}

@media (min-width: 720px) {
  .leistungen { grid-template-columns: 1fr 1fr; }
}

.leistungen li {
  background: var(--surface);
  padding: var(--sp-4);
  display: flex;
  align-items: baseline;
  gap: var(--sp-3);
  color: var(--heading);
  position: relative;
}

/* Orange als schmale Flaeche an der Oberkante — nie als Textfarbe */
.leistungen li::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: var(--sp-5);
  height: var(--line-strong);
  background: var(--c-orange);
}

.leistungen .nr {
  font-variant-numeric: tabular-nums;
  font-size: var(--fs-small);
  color: var(--c-steel);
  letter-spacing: 0.08em;
  flex: none;
  min-width: 2.2em;
}

.leistungen .bez {
  font-family: var(--font-display);
  font-weight: var(--fw-display);
  font-size: var(--fs-h3);
  line-height: var(--lh-h3);
}

/* Nachgestellter Verweis unter einer Liste oder einem Block */
.nachtrag { margin-top: var(--sp-4); }

/* --- Formular ------------------------------------------------------------ */

.formular { margin-top: var(--sp-4); max-width: 640px; }

.feld { margin-bottom: var(--sp-4); }

.feld label {
  display: block;
  margin-bottom: var(--sp-2);
  color: var(--heading);
  font-weight: 500;
  font-size: var(--fs-small);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.feld input,
.feld textarea {
  width: 100%;
  padding: var(--sp-3);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--text);
  background: var(--surface);
  border: var(--line-hair) solid var(--border);
  border-radius: var(--radius-flat);
}

.feld input:hover,
.feld textarea:hover { border-color: var(--c-steel); }

.feld input:focus,
.feld textarea:focus {
  border-color: var(--c-midnight);
  outline: var(--line-strong) solid var(--c-orange);
  outline-offset: 1px;
}

.feld textarea { resize: vertical; min-height: 8em; }

.feld__hilfe {
  margin: var(--sp-2) 0 0;
  font-size: var(--fs-small);
  line-height: var(--lh-small);
  color: var(--c-graphite);
}

/* Pflicht-Stern: Midnight, nicht Orange — Orange traegt nie Text auf Hell */
.pflicht { color: var(--c-midnight); font-weight: 500; }
.optional { text-transform: none; letter-spacing: 0; color: var(--c-graphite); font-weight: 400; }

.pflicht-hinweis {
  font-size: var(--fs-small);
  color: var(--c-graphite);
  margin: 0 0 var(--sp-4);
}

/* Einwilligung abgesetzt, damit sie nicht uebersehen wird */
.feld--kasten {
  background: var(--surface);
  border: var(--line-hair) solid var(--border);
  border-left: var(--line-strong) solid var(--c-orange);
  padding: var(--sp-4);
}

/* Selektor muss .feld label schlagen (0,1,1) — sonst erbt der Einwilligungs-
   satz die gesperrten Versalien der Feldbeschriftungen und wird unlesbar. */
.feld label.einwilligung {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  margin: 0;
  text-transform: none;
  letter-spacing: var(--ls-body);
  font-weight: var(--fw-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--text);
}

.einwilligung input[type="checkbox"] {
  width: 20px;
  height: 20px;
  flex: none;
  margin-top: 2px;
  accent-color: var(--c-midnight);
}

/* Honeypot: fuer Menschen unsichtbar, fuer Bots im Quelltext sichtbar.
   Bewusst KEIN display:none — manche Bots ueberspringen versteckte Felder. */
.koeder {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* --- Platzhalter (offene Angaben) ----------------------------------------
   Bewusst grell: Was noch offen ist, MUSS vor dem Go-Live auffallen.
   Vor der Veroeffentlichung darf keine .luecke mehr im Markup stehen.
   Suchbefehl vor Go-Live:  grep -rn "luecke" website/
   ------------------------------------------------------------------------ */
.luecke {
  background: #FFE08A;
  color: #7A4B00;
  font-weight: 500;
  padding: 0 var(--sp-1);
  border-bottom: var(--line-strong) dashed #B23A2E;
  white-space: nowrap;
}

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

.rechtstext { max-width: 720px; }
.rechtstext h2 {
  font-size: var(--fs-h3);
  line-height: var(--lh-h3);
  margin-top: var(--sp-6);
}
.rechtstext h2:first-of-type { margin-top: var(--sp-2); }
.rechtstext h3 {
  font-size: var(--fs-body);
  font-family: var(--font-body);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--c-steel);
  margin-top: var(--sp-5);
  margin-bottom: var(--sp-2);
}
.rechtstext ul { padding-left: var(--sp-4); }
.rechtstext li { margin-bottom: var(--sp-2); }
.rechtstext address {
  font-style: normal;
  margin-bottom: var(--sp-3);
}

/* --- Hinweise ------------------------------------------------------------ */

.hinweis {
  padding: var(--sp-4);
  margin-bottom: var(--sp-5);
  background: var(--surface);
  border: var(--line-hair) solid var(--border);
}
.hinweis p:last-child, .hinweis ul:last-child { margin-bottom: 0; }
.hinweis ul { margin: var(--sp-2) 0 0; padding-left: var(--sp-4); }

.hinweis--fehler { border-left: var(--line-strong) solid var(--c-status-crit); }

/* --- Kontaktband --------------------------------------------------------- */

.band {
  background: var(--surface);
  border-top: var(--line-hair) solid var(--border);
  border-bottom: var(--line-hair) solid var(--border);
  padding-top: var(--sp-6);
  padding-bottom: var(--sp-6);
  text-align: center;
}

/* --- Fussbereich --------------------------------------------------------- */

.fuss {
  background: var(--c-midnight);
  color: var(--c-silver);
  padding-top: var(--sp-6);
  padding-bottom: var(--sp-6);
  font-size: var(--fs-small);
  line-height: var(--lh-small);
}

.fuss a { color: var(--c-steel-lite); }

.fuss__logo { height: 34px; width: auto; display: block; margin-bottom: var(--sp-4); }

.fuss__raster { display: grid; gap: var(--sp-5); }

@media (min-width: 720px) {
  .fuss__raster { grid-template-columns: 1fr auto; align-items: start; }
}

.fuss__recht {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: var(--sp-4);
  flex-wrap: wrap;
}

/* --- Mobil --------------------------------------------------------------- */

@media (max-width: 640px) {
  .kopf__innen { flex-direction: column; align-items: flex-start; gap: var(--sp-3); }
  .nav ul { flex-wrap: wrap; gap: var(--sp-3); }
  .inhalt { padding-top: var(--sp-6); padding-bottom: var(--sp-6); }
  .cta { display: block; text-align: center; }
  .cta--sekundaer { margin-left: 0; margin-top: var(--sp-2); }
}
