/* ============================================================
   Dietrich Consulting — Stylesheet
   Farben aus dem Logo abgeleitet.
   Schrift: Calibri (Windows/Office) mit metrisch identischem, selbst
   gehostetem Fallback Carlito (frei) und Segoe UI.
   Kein externer Font-Dienst → DSGVO-freundlich, keine externen Requests.
   ============================================================ */

@font-face { font-family: "Carlito"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/Carlito-Regular.woff2") format("woff2"); }
@font-face { font-family: "Carlito"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("../fonts/Carlito-Bold.woff2") format("woff2"); }

:root {
  --blau: #1E6FB8;
  --blau-dunkel: #12365A;
  --navy: #0E2A47;
  --grau-hell: #F4F6F8;
  --grau-linie: #E2E7ED;
  --text: #1B2733;
  --text-muted: #5A6B7B;
  --weiss: #FFFFFF;
  --radius: 10px;
  --container: 1080px;
  --font: Calibri, Carlito, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

/* scroll-behavior bewusst auf auto: Das sanfte Scrollen uebernimmt main.js,
   weil Browser CSS-Smoothscroll bei aktivem "Animationen reduzieren" abschalten. */
html { scroll-behavior: auto; scroll-padding-top: 78px; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  font-size: 1.075rem;
  line-height: 1.7;
  background: var(--weiss);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { color: var(--blau-dunkel); line-height: 1.25; font-weight: 400; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 4.2vw, 3rem); font-weight: 300; letter-spacing: -.005em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 300; }
h3 { font-size: 1.15rem; font-weight: 600; }
p { margin: 0 0 1em; }
a { color: var(--blau); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 1.25rem; }
.section { padding: 4.5rem 0; }
.section--grau { background: var(--grau-hell); }
.section__lead { max-width: 660px; color: var(--text-muted); font-size: 1.18rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  background: var(--blau);
  color: #fff;
  padding: .8rem 1.6rem;
  border-radius: var(--radius);
  font-weight: 600;
  transition: background .15s ease;
}
.btn:hover { background: var(--blau-dunkel); text-decoration: none; }
.btn--ghost { background: transparent; color: var(--blau); border: 1.5px solid var(--blau); }
.btn--ghost:hover { background: var(--blau); color: #fff; }

/* ---------- Header ---------- */
.header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.95);
  backdrop-filter: saturate(180%) blur(6px);
  border-bottom: 1px solid var(--grau-linie);
}
.header__inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { font-size: 1.3rem; font-weight: 400; text-transform: uppercase; letter-spacing: .32em; color: var(--blau-dunkel); white-space: nowrap; }
.brand span { font-weight: 400; letter-spacing: .34em; color: var(--blau); }
.nav { display: flex; align-items: center; gap: 1.4rem; }
.nav a { color: var(--text); font-size: .95rem; font-weight: 500; }
.nav a:hover { color: var(--blau); text-decoration: none; }
.lang { display: flex; gap: .35rem; font-size: .85rem; color: var(--text-muted); }
.lang a { color: var(--text-muted); font-weight: 600; }
.lang a.is-active { color: var(--blau); }
.nav__toggle { display: none; background: none; border: 0; cursor: pointer; padding: .4rem; }
.nav__toggle span { display: block; width: 24px; height: 2px; background: var(--blau-dunkel); margin: 5px 0; }

/* ---------- Hero ---------- */
.hero { background: var(--grau-hell); padding: 4.5rem 0 4rem; border-bottom: 1px solid var(--grau-linie); }
.hero__eyebrow { color: var(--blau); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; font-size: .85rem; margin-bottom: .6rem; }
.hero p.hero__sub { font-size: 1.28rem; color: var(--text-muted); max-width: 640px; }
.hero__actions { margin-top: 1.6rem; display: flex; gap: .8rem; flex-wrap: wrap; }
.hero__marker { margin: 1.6rem 0 0; padding-top: 1.1rem; border-top: 1px solid var(--grau-linie);
  max-width: 640px; font-size: .82rem; font-weight: 500; letter-spacing: .05em;
  text-transform: uppercase; color: var(--text-muted); line-height: 1.6; }

/* ---------- Feld-Kacheln ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.25rem; margin-top: 2.2rem; }
.card {
  display: block; background: #fff; border: 1px solid var(--grau-linie);
  border-radius: 12px; padding: 1.5rem; color: inherit;
  transition: border-color .25s ease, transform .35s cubic-bezier(.22, .61, .36, 1),
              box-shadow .35s ease;
}
.card:hover {
  border-color: var(--blau);
  transform: translateY(-5px) scale(1.012);
  box-shadow: 0 12px 28px rgba(14, 42, 71, .15);
  text-decoration: none;
}
.card__icon { width: 44px; height: 44px; color: var(--blau); margin-bottom: .9rem; }
.card h3 { margin-bottom: .3rem; }
.card p { color: var(--text-muted); font-size: 1.05rem; margin: 0; }

/* ---------- Feld-Detailsektionen ---------- */
/* Feld-Sektion: grosses Bild auf einer Seite, Textkarte schneidet nur dessen Kante an */
.feld { position: relative; padding: 4.5rem 0; }
/* sichtbare Trennung, damit die Bildsektionen nicht ineinander uebergehen */
.feld + .feld { margin-top: 14px; }

.feld__bg { position: absolute; top: 0; bottom: 0; right: 0; width: 60%; z-index: 0; overflow: hidden; }
.feld--reverse .feld__bg { right: auto; left: 0; }
.feld__bg img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
/* Bildausschnitt je Motiv */
#produktion .feld__bg img { object-position: right center; }
/* Gebaeude: nach rechts schieben, damit die Ladestation im Bild bleibt */
#gebaeude .feld__bg img { object-position: 82% center; }
/* Robotik: unten verankern - bei schmalen/hohen Ausschnitten bleiben die Roboter (unten) sichtbar */
#robotik .feld__bg img { object-position: center bottom; }

.feld .container { position: relative; z-index: 1; }
.feld__card {
  background: rgba(255, 255, 255, .97);
  border-radius: 12px;
  padding: 2.25rem 2.5rem;
  max-width: 520px;
  box-shadow: 0 8px 32px rgba(14, 42, 71, .22);
}
.feld--reverse .feld__card { margin-left: auto; }
.feld__card .anker { background: var(--grau-hell); }

@media (max-width: 860px) {
  .feld { padding: 0 0 3rem; }
  .feld__bg { position: relative; width: 100%; height: 230px; }
  .feld--reverse .feld__bg { left: auto; }
  .feld__card { max-width: none; padding: 1.75rem; margin-top: -2.5rem; }
}
.feld__num { color: var(--blau); font-weight: 700; font-size: .9rem; letter-spacing: .05em; }
.feld ul { padding-left: 1.1rem; color: var(--text); }
.feld ul li { margin-bottom: .4rem; }
.anker {
  margin-top: 1.5rem; background: #fff; border: 1px solid var(--grau-linie);
  border-left: 4px solid var(--blau); border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.1rem 1.35rem; color: var(--text-muted); font-size: 1.05rem;
}
.feld:nth-of-type(even) .anker { background: var(--weiss); }
.anker strong { color: var(--blau-dunkel); }

/* ---------- Profil ---------- */
.profil { display: grid; grid-template-columns: 220px 1fr; gap: 2.5rem; align-items: start; }
.profil__foto { width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--grau-linie); }
.profil__hinweis { font-size: .88rem; color: var(--text-muted); font-style: italic; border-top: 1px solid var(--grau-linie); padding-top: 1rem; margin-top: 1rem; }
.cv { list-style: none; padding: 0; margin: 1rem 0 0; }
.cv li { padding: .5rem 0; border-bottom: 1px solid var(--grau-linie); display: flex; gap: 1rem; }
.cv li span { color: var(--blau); font-weight: 600; min-width: 98px; font-size: .95rem; }
.pubs-title { font-weight: 600; color: var(--blau-dunkel); margin: 1.5rem 0 .3rem; font-size: 1rem; }
.pubs { list-style: none; padding: 0; margin: 0; }
.pubs li { padding: .5rem 0; border-top: 1px solid var(--grau-linie); font-size: .95rem; color: var(--text); line-height: 1.5; }
.pubs li span { color: var(--text-muted); white-space: nowrap; }

/* ---------- Referenzen ---------- */
.branchen { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1rem 0 2rem; }
.branchen span { background: #fff; border: 1px solid var(--grau-linie); border-radius: 999px; padding: .4rem 1.1rem; font-size: 1rem; color: var(--blau-dunkel); }
.refs { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.25rem; }
.ref { background: #fff; border: 1px solid var(--grau-linie); border-radius: 12px; padding: 1.5rem; }
.ref h3 { margin-bottom: .3rem; }
.ref p { color: var(--text-muted); font-size: 1.05rem; }

/* ---------- Kontakt ---------- */
.kontakt { text-align: center; }
.kontakt address { font-style: normal; color: var(--text-muted); margin-top: 1.2rem; line-height: 1.7; }

/* ---------- Footer ---------- */
.footer { background: var(--navy); color: #c7d3e0; padding: 2.5rem 0; font-size: .92rem; }
.footer a { color: #fff; }
.footer__inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.footer__links { display: flex; gap: 1.4rem; }

/* ---------- Rechtstext-Seiten ---------- */
.legal { max-width: 780px; padding: 3rem 0; }
.legal h2 { margin-top: 2rem; font-size: 1.3rem; }
.legal p, .legal li { color: var(--text); }
.hinweisbox { background: var(--grau-hell); border: 1px solid var(--grau-linie); border-radius: var(--radius); padding: 1rem 1.25rem; font-size: .92rem; color: var(--text-muted); }

/* ---------- Mobil ---------- */
@media (max-width: 760px) {
  .brand { font-size: .92rem; letter-spacing: .16em; }
  .nav {
    position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; align-items: flex-start; gap: 0;
    background: #fff; border-bottom: 1px solid var(--grau-linie);
    padding: .5rem 1.25rem 1rem; display: none;
  }
  .nav.is-open { display: flex; }
  .nav a { padding: .6rem 0; width: 100%; }
  .nav__toggle { display: block; }
  .profil { grid-template-columns: 1fr; }
  .profil__foto { max-width: 220px; }
}

/* ============================================================
   Dynamische Effekte
   Die Startzustaende greifen nur, wenn <html class="js"> gesetzt ist
   (Inline-Skript im <head>). Ohne JavaScript bleibt alles sichtbar.
   ============================================================ */

/* Kacheln blenden nur ueber die Deckkraft ein — transform bleibt so
   vollstaendig fuer den 3D-Hover-Effekt reserviert (kein Konflikt). */
.js .card {
  opacity: 0;
  transition: opacity .85s cubic-bezier(.22, .61, .36, 1), border-color .25s ease,
              transform .35s cubic-bezier(.22, .61, .36, 1), box-shadow .35s ease;
}
.js .card.is-visible { opacity: 1; }
.js .card:hover { transition-delay: 0s; }

.js .feld__card,
.js .profil,
.js .ref,
.js .kontakt {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .95s cubic-bezier(.22, .61, .36, 1),
              transform .95s cubic-bezier(.22, .61, .36, 1);
}
.js .feld__card.is-visible,
.js .profil.is-visible,
.js .ref.is-visible,
.js .kontakt.is-visible { opacity: 1; transform: none; }

/* leichter Versatz, damit Kacheln nacheinander erscheinen */
.js .cards .card:nth-child(2) { transition-delay: .1s; }
.js .cards .card:nth-child(3) { transition-delay: .2s; }
.js .refs .ref:nth-child(2) { transition-delay: .1s; }

/* Kopfleiste beim Scrollen */
.header { transition: box-shadow .25s ease; }
.header.is-scrolled { box-shadow: 0 2px 14px rgba(14, 42, 71, .12); }

/* aktiver Navigationspunkt */
.nav a.is-current { color: var(--blau); }

/* sehr langsamer Zoom auf dem Motivbild beim Ueberfahren */
.feld__bg img { transition: transform 2s cubic-bezier(.22, .61, .36, 1); }
.feld:hover .feld__bg img { transform: scale(1.03); }

/* Bewusste Entscheidung des Betreibers: Die Effekte laufen unabhaengig von der
   Systemeinstellung "reduzierte Bewegung". Sie sind dafuer betont sanft gehalten
   (kurze Wege, weiche Kurven), damit sie auch dann angenehm bleiben. */
