/* ============================================================
   global.css: Technik-Geruest + Design-Tokens der Site.

   WICHTIG: Die :root-Bloecke unten sind die EINZIGE Stelle, an der
   Design lebt (Farben, Font, Typo-Scale, Abstaende, Radien, Schatten,
   Motion). Alle Werte sind PLATZHALTER, nur damit der Styleguide vor
   Phase 2 ueberhaupt rendert. Phase 2 (Corporate Identity) MUSS jeden
   Token projektspezifisch setzen. Kein Platzhalter geht live, und
   zwei Kundenseiten teilen niemals dieselben Tokens.

   Nicht verhandelbar (Qualitaets-Untergrenzen, KEIN Design):
   Body-Schrift nie unter 17px, Touch-Targets min. 44px, WCAG-AA-
   Kontrast, Animationen nur mit transform + opacity.

   Fonts: self-hosted via css/fonts.css (scripts/fetch-fonts.sh),
   NIEMALS fonts.googleapis.com einbinden.
   ============================================================ */

:root {
  /* ── Farben — CI „Navy & Gold" (direkt aus dem Kundenlogo, Kundenwunsch 2026-07-29) ──
     Das Logo IST die Palette: goldenes Kran-/Giebel-Zeichen auf tiefem Navy.
     Navy traegt Struktur und Text (immer lesbar), Gold ist der EINE laute Akzent
     und erscheint nur als FLAECHE (CTA, Keyline, Akzent auf Dunkel) — nie als
     kleine Schrift auf Hell (Gold auf Weiss = 1.6:1, unlesbar).
     Alle Kontraste geprueft: Navy-Text/Hell 12:1, Navy auf Gold-Button 11.2:1,
     Gold auf Navy 11.2:1, Muted/Hell 5.9:1. */
  --color-brand-main:       #232170;   /* Navy — Links, Eyebrows, Icons, Kennzahlen (12:1 auf Hell) */
  --color-brand-darker:     #14134A;   /* Hover (17:1) */
  --color-brand-lighter:    #4F4DAE;   /* helles Indigo — Keylines/Deko, NICHT Fliesstext auf hell */
  --color-brand-subtle:     #E8E9F6;   /* blasse Navy-Toenung — Icon-Flaechen, Hover-Fills auf hell */
  --color-accent:           #FBC534;   /* Logo-Gold — nur als Flaeche: CTA, Unterstrich, Chip */
  --color-accent-darker:    #E5AE14;   /* Gold-Hover */
  --color-accent-subtle:    #FDF1CE;   /* blasses Gold — sparsame Fuellungen */
  --color-bg-light:         #F4F5F9;   /* helles Papier mit Navy-Anflug, Seiten-Hintergrund */
  --color-bg-dark:          #111040;   /* Logo-Navy — Footer/Dunkelband, exakt die Logo-Feldfarbe */
  --color-bg-card:          #FFFFFF;
  --color-bg-accent:        #E9EBF5;   /* tieferes Papier — alternierende Baender/Insets */
  --color-border:           #DCDFEC;   /* kuehle Haarlinie */
  --color-text-muted:       #5B5C77;   /* gedaempftes Navy-Grau (AA, 5.9:1) */
  --color-off-white:        #F4F5F9;
  --color-success:          #2F6A4C;   /* gedecktes Gruen — NUR Formular-Erfolg */
  --color-heading:          #14133A;   /* Navy-Tinte */
  --color-body:             #3A3A55;   /* gedaempftes Navy, Fliesstext (9.9:1) */

  /* ── Logo-Farben (aus der Originaldatei gemessen) ──
     Seit dem CI-Wechsel sind sie die BASIS der Palette und nicht mehr aufs
     Bildzeichen beschraenkt. Als eigene Tokens behalten, weil Nav-Plate,
     Footer-Zeichen und Favicon exakt diese Werte brauchen. */
  --color-logo-navy:        #111040;   /* Logo-Feldfarbe = --color-bg-dark */
  --color-logo-gold:        #FBC534;   /* Logo-Bildzeichen = --color-accent */

  /* Scrim ueber Fotos (Bildunterschriften, Maps-Overlay): fast schwarzes Navy.
     Das gesaettigte Logo-Navy wuerde neutrale Motive sichtbar violett faerben. */
  --color-scrim:            #0B0B1C;

  /* Zusatz-Tokens: dunkler Footer/Band (Logo-Navy) */
  --color-text-on-dark:     #F4F5F9;
  --color-muted-on-dark:    #A9A9C8;   /* 7.9:1 auf Navy */
  --color-border-on-dark:   #2C2A63;
  --color-accent-on-dark:   #FBC534;   /* Logo-Gold auf Navy (11.2:1) — das Logo-Verhaeltnis selbst */

  /* ── Typografie — Libre Franklin (Franklin-Gothic-Revival, etabliert/industriell) ──
     Eine warme, charaktervolle Sans; kein techy/geometrisch-kaltes Gefühl. Body nie unter 17px. */
  --font-main:              'Libre Franklin', -apple-system, 'Segoe UI', sans-serif;
  --font-weight-heading:    700;
  --letter-spacing-h1:      -0.02em;
  --letter-spacing-h2:      -0.012em;
  --font-size-body:         18px;
  --line-height-body:       1.6;
  --line-height-heading:    1.12;
  --font-size-h1:           60px;
  --font-size-h1-md:        46px;    /* greift <= 1024px */
  --font-size-h1-sm:        34px;    /* greift <= 767px  */
  --font-size-h2:           40px;
  --font-size-h2-md:        33px;
  --font-size-h2-sm:        27px;
  --font-size-h3:           25px;
  --font-size-h3-sm:        21px;
  --font-size-h4:           20px;
  --font-size-h5:           18px;
  --font-size-eyebrow:      14px;    /* einzige erlaubte Ausnahme unter 17px */

  /* ── Layout + Abstaende ── */
  --max-width:              1200px;
  --container-padding:      40px;
  --container-padding-sm:   20px;
  --section-padding:        96px 40px;
  --section-padding-mobile: 56px 20px;
  --header-gap-eyebrow:     12px;    /* Abstand Eyebrow -> Title   */
  --header-gap-title:       16px;    /* Abstand Title -> Subline   */
  --header-gap-subline:     36px;    /* Abstand Subline -> Inhalt  */

  /* ── Form + Tiefe — moderat, solide, gefasst (Handwerk, nicht verspielt) ── */
  --radius-s:               6px;     /* Buttons, Inputs  */
  --radius-m:               10px;    /* Cards, Bilder    */
  --shadow-card:            0 1px 2px rgba(17, 16, 64, 0.07), 0 10px 28px rgba(17, 16, 64, 0.11);

  /* ── Motion — ruhig, verlässlich (kein Firlefanz) ── */
  --ease-out:               cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring:            cubic-bezier(0.34, 1.4, 0.64, 1);
  --duration-fast:          0.2s;
  --reveal-duration:        0.6s;
  --reveal-distance:        18px;
}

/* Responsive Token-Umschaltung: Komponenten unten enthalten KEINE
   eigenen Breakpoint-Werte, hier werden nur Tokens umgeschaltet. */
@media (max-width: 1024px) {
  :root {
    --font-size-h1: var(--font-size-h1-md);
    --font-size-h2: var(--font-size-h2-md);
  }
}
@media (max-width: 767px) {
  :root {
    --font-size-h1: var(--font-size-h1-sm);
    --font-size-h2: var(--font-size-h2-sm);
    --font-size-h3: var(--font-size-h3-sm);
    --container-padding: var(--container-padding-sm);
    --header-gap-eyebrow: 10px;
    --header-gap-title: 14px;
    --header-gap-subline: 28px;
  }
}

/* ============================================================
   Ab hier nur noch Technik: alles referenziert Tokens,
   nirgendwo stehen Design-Literale.
   ============================================================ */

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* KEIN scroll-behavior: smooth hier oder anderswo: kollidiert mit Lenis (Phase 5). */

body {
  font-family: var(--font-main);
  font-size: var(--font-size-body);
  line-height: var(--line-height-body);
  color: var(--color-body);
  background: var(--color-bg-light);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--color-heading);
  font-weight: var(--font-weight-heading);
  line-height: var(--line-height-heading);
}

h1 { font-size: var(--font-size-h1); letter-spacing: var(--letter-spacing-h1); }
h2 { font-size: var(--font-size-h2); letter-spacing: var(--letter-spacing-h2); }
h3 { font-size: var(--font-size-h3); }
h4 { font-size: var(--font-size-h4); }
h5 { font-size: var(--font-size-h5); }

a { color: var(--color-brand-main); text-decoration: none; }
a:hover { color: var(--color-brand-darker); }
/* Fokus-Ring: auf hell Navy. Dunkle Flaechen (Footer, Maps-Scrim) setzen
   --color-focus lokal auf Gold um, sonst waere der Ring dort unsichtbar. */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--color-focus, var(--color-brand-main));
  outline-offset: 2px;
}

img { max-width: 100%; display: block; }
/* Fotos liegen in <picture> (WebP-Quelle + JPEG-Fallback). display:contents nimmt
   das Wrapper-Element aus dem Layout, damit Regeln wie "img { height: 100% }" sich
   weiter auf die Card beziehen und nicht auf das picture-Element. */
picture { display: contents; }

/* Anker-Ziele: ohne diesen Versatz schiebt die Sticky-Nav den Section-Header
   beim Sprung aus dem Bild (Nav ist 74px hoch, mobil 66px). */
section[id], footer[id] { scroll-margin-top: 90px; }
@media (max-width: 900px) {
  section[id], footer[id] { scroll-margin-top: 80px; }
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

/* Buttons: Look kommt komplett aus den Tokens (Radius, Farben, Motion).
   min-height 48px ist Touch-Target-Untergrenze, kein Design. */
.btn-primary, .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 28px;
  border-radius: var(--radius-s);
  font-size: var(--font-size-body);
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition:
    background-color var(--duration-fast) ease,
    color var(--duration-fast) ease,
    transform var(--duration-fast) var(--ease-spring),
    box-shadow var(--duration-fast) ease;
}
/* Primaer-CTA = das Logo-Verhaeltnis: Navy-Schrift auf Logo-Gold (11.2:1).
   Gold traegt hier als FLAECHE, nie als Schrift auf Hell. */
.btn-primary {
  background: var(--color-accent);
  color: var(--color-brand-darker);
}
.btn-primary:hover {
  background: var(--color-accent-darker);
  color: var(--color-brand-darker);
  transform: translateY(-2px);
}
.btn-primary:active { transform: translateY(0); }
.btn-secondary {
  background: transparent;
  color: var(--color-brand-main);
  box-shadow: inset 0 0 0 2px var(--color-brand-main);
}
.btn-secondary:hover { background: var(--color-brand-subtle); }

/* ── Section-Header: Eyebrow / Title / Subline ──
   PFLICHT: Jeder Section-Header nutzt diese 3 Klassen, damit Groessen,
   Abstaende und Alignment in JEDER Section identisch sind. Das ist ein
   Konsistenz-Mechanismus INNERHALB einer Site; wie er aussieht, steuern
   die Tokens oben. Niemals pro Section ueberschreiben. */
.section-eyebrow {
  display: block;
  font-size: var(--font-size-eyebrow);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-brand-main);
  margin-bottom: var(--header-gap-eyebrow);
}
.section-title {
  font-size: var(--font-size-h2);
  font-weight: var(--font-weight-heading);
  line-height: var(--line-height-heading);
  letter-spacing: var(--letter-spacing-h2);
  color: var(--color-heading);
  margin-bottom: var(--header-gap-title);
}
.section-subline {
  font-size: var(--font-size-body);
  line-height: var(--line-height-body);
  color: var(--color-text-muted);
  margin-bottom: var(--header-gap-subline);
  max-width: 640px;
}

/* ── Reveal-Animationen (Init in js/main.js) ──
   Charakter (Distanz, Dauer, Kurve) kommt aus den Motion-Tokens.
   Ohne JS (html ohne .js-Klasse) bleibt alles sichtbar. */
html.js [data-reveal] {
  opacity: 0;
  transform: translateY(var(--reveal-distance));
  transition:
    opacity var(--reveal-duration) var(--ease-out),
    transform var(--reveal-duration) var(--ease-out);
}
html.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}
/* Screenshots deterministisch: screenshot.mjs setzt html.screenshot */
html.screenshot [data-reveal] {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}
@media (prefers-reduced-motion: reduce) {
  html.js [data-reveal] { opacity: 1; transform: none; transition: none; }
}

/* ── Google Maps Zwei-Klick (Markup: snippets/google-maps-consent.html) ── */
.map-consent {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-m);
  overflow: hidden;
  background: var(--color-bg-accent);
}
/* Nachfahren-Selektor, nicht Direktkind: das Vorschaubild liegt in einem
   <picture> (WebP + JPEG-Fallback). Nach dem Klick ersetzt js/main.js den
   Inhalt der Box komplett durch das iframe, hier steht also nie ein zweites Bild. */
.map-consent img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(2px) brightness(0.85);
}
.map-consent-overlay {
  --color-focus: var(--color-accent);
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  text-align: center;
  background: color-mix(in srgb, var(--color-scrim) 66%, transparent);
}
.map-consent-overlay p {
  color: var(--color-off-white);
  font-size: var(--font-size-body);
  max-width: 520px;
}
.map-consent-overlay a { color: #FFFFFF; text-decoration: underline; }
