/* ==========================================================================
   der Technikhelfer — main.css
   Design tokens, reset, base typography, layout, header & footer.
   ========================================================================== */

/* ---------- Schriften (lokal gehostet) -----------------------------------
   Nunito liegt in assets/fonts/ und wird NICHT von Google geladen.
   Grund: Beim Einbinden über fonts.googleapis.com wird bei jedem Seiten-
   aufruf die IP-Adresse der Besucher an Google übertragen (DSGVO-Risiko,
   vgl. LG München I, 20.01.2022 – 3 O 17493/20).
   WOFF2 = modernes Format; TTF nur als Fallback für sehr alte Browser.
   -------------------------------------------------------------------------- */
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../assets/fonts/nunito-v32-latin-regular.woff2") format("woff2"),
       url("../assets/fonts/nunito-v32-latin-regular.ttf") format("truetype");
}
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../assets/fonts/nunito-v32-latin-600.woff2") format("woff2"),
       url("../assets/fonts/nunito-v32-latin-600.ttf") format("truetype");
}
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../assets/fonts/nunito-v32-latin-700.woff2") format("woff2"),
       url("../assets/fonts/nunito-v32-latin-700.ttf") format("truetype");
}
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("../assets/fonts/nunito-v32-latin-800.woff2") format("woff2"),
       url("../assets/fonts/nunito-v32-latin-800.ttf") format("truetype");
}

/* ---------- Design Tokens ------------------------------------------------ */
:root {
  /* Brand colours — Palette Petrol/Teal / Beige / Orange / Fast-Schwarz.
     Token-Namen bleiben aus Kompatibilität; die Rolle steht im Kommentar. */
  --color-navy:        #1A2328;  /* Fast-Schwarz: Überschriften, dunkle Flächen, Nav, Footer-Text */
  --color-navy-light:  #2F3D43;  /* helleres Dunkel: Hover, Verläufe */
  --color-navy-dark:   #12171B;  /* dunkelste Fläche: Hero-/CTA-Overlay */
  --color-green:       #8DBB8E;  /* Sage: Primär-/Trust-Akzent als Fläche (Badges, Icons) */
  --color-green-dark:  #79A97C;  /* dunkleres Sage */
  --color-green-text:  #3C7351;  /* abgedunkeltes Sage für Text/Icons auf Hell (AA ≥4.5:1) */
  --color-blue:        #3E7E8C;  /* helles Teal: Professional-Akzent als Fläche/Fokus */
  --color-blue-text:   #0F4958;  /* abgedunkeltes Teal für Links/Text (AA ≥4.5:1) */
  --color-copper:      #EA6830;  /* Orange: CTA-/Highlight-Akzent */
  --color-copper-dark: #D5591F;  /* Orange-Hover */
  --color-surface-dark:       #8DBB8E;  /* Helles Salbei (Badge-Farbe): große Flächen (CTA-Banner, Page-Hero, Kacheln) — Text darauf ist dunkel, nicht weiß */
  --color-surface-dark-light: #79A97C;  /* etwas dunkleres Salbei für Verläufe */
  --color-white:       #FFFFFF;
  --color-beige:       #F9F7F3;  /* Warmes Beige (hell): Seiten-/Body-Hintergrund */
  --color-gray-light:  #F3EFE8;  /* Warmes Beige (dunkler): Sektions- und Footer-Hintergrund */
  --color-gray-mid:    #E6DFD2;  /* warmes Hellgrau: Rahmen/Linien */
  --color-text:        #1A2328;  /* Fast-Schwarz: Fließtext (AAA) */
  --color-text-muted:  #55636A;  /* gedämpftes Teal-Grau (AAA-Kontrast) */

  /* Tinted surfaces (derived) */
  --tint-green:        rgba(141, 187, 142, 0.20);
  --tint-navy:         rgba(26, 35, 40, 0.06);
  --tint-blue:         rgba(62, 126, 140, 0.16);
  --tint-copper:       rgba(234, 104, 48, 0.16);

  /* Typography */
  --font-base: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --fs-base: 1.125rem;          /* 18px */
  --lh-base: 1.7;

  /* Radii */
  --radius-card: 16px;
  --radius-btn: 12px;
  --radius-pill: 999px;

  /* Shadows — weicher, mehrschichtig (modern, ohne harte Kanten) */
  --shadow-card: 0 1px 2px rgba(26, 35, 40, 0.05), 0 8px 24px rgba(26, 35, 40, 0.08);
  --shadow-card-hover: 0 2px 6px rgba(26, 35, 40, 0.07), 0 18px 40px rgba(26, 35, 40, 0.14);
  --shadow-nav: 0 1px 0 rgba(26, 35, 40, 0.05), 0 6px 20px rgba(26, 35, 40, 0.08);

  /* Motion */
  --transition: 200ms ease;

  /* Layout */
  --max-width: 1200px;
  --gutter: clamp(20px, 5vw, 48px);
  --spacing-section: clamp(48px, 6vw, 88px);

  /* Z-index scale */
  --z-header: 1000;
  --z-overlay: 1100;
}

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 90px; /* offset sticky header for in-page anchors */
}

body {
  font-family: var(--font-base);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  font-weight: 400;
  color: var(--color-text);
  background-color: var(--color-beige);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img,
picture,
svg {
  display: block;
  max-width: 100%;
}

img { height: auto; }

a {
  color: var(--color-blue-text);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
a:hover { color: var(--color-navy); }

button,
input { font: inherit; }

ul, ol { padding: 0; }

/* ---------- Typography --------------------------------------------------- */
h1, h2, h3, h4 {
  line-height: 1.2;
  color: var(--color-navy);
  font-weight: 800;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.9rem, 3.6vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.4rem;
  font-weight: 700;
}

p { text-wrap: pretty; }

p + p { margin-top: 1.1em; }

strong { font-weight: 700; }

/* Decorative accent line used under section headings */
.section-eyebrow {
  display: inline-block;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-green-text);
  margin-bottom: 0.75rem;
}

.lead {
  font-size: clamp(1.2rem, 2vw, 1.35rem);
  color: var(--color-text-muted);
  font-weight: 400;
}

/* ---------- Layout helpers ---------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container--narrow { max-width: 820px; }

.section { padding-block: var(--spacing-section); }
.section--tight { padding-block: clamp(40px, 5vw, 72px); }
.section--tight-top { padding-top: clamp(24px, 4vw, 48px); }
.section--alt { background-color: var(--color-gray-light); }
.section--navy {
  background-color: var(--color-surface-dark);
  color: var(--color-navy);
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.section--navy::after {
  content: "";
  position: absolute;
  right: -60px; bottom: -60px;
  width: 260px; height: 260px;
  background: radial-gradient(circle, rgba(26, 35, 40, 0.12), transparent 70%);
  z-index: -1;
}
.section--navy h2,
.section--navy h3 { color: var(--color-navy); }

.section__head {
  max-width: 720px;
  margin-bottom: clamp(36px, 5vw, 56px);
}
.section__head--center {
  margin-inline: auto;
  text-align: center;
}
.section__head p {
  margin-top: 0.85rem;
  color: var(--color-text-muted);
  font-size: 1.2rem;
}
.section--navy .section__head p { color: rgba(26, 35, 40, 0.82); }

/* Generic responsive grid */
.grid { display: grid; gap: clamp(20px, 3vw, 32px); }
@media (min-width: 640px) { .grid--2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 860px) { .grid--3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 640px) { .grid--3-sm { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .grid--3-sm { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Accessibility utilities ------------------------------------- */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -120px;
  z-index: var(--z-overlay);
  background: var(--color-navy);
  color: var(--color-white);
  padding: 14px 22px;
  border-radius: var(--radius-btn);
  font-weight: 700;
  text-decoration: none;
  transition: top var(--transition);
}
.skip-link:focus {
  top: 16px;
  color: var(--color-white);
}

/* Visible focus state for every interactive element */
:where(a, button, input, textarea, [tabindex]):focus-visible {
  outline: 3px solid var(--color-blue-text);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Header / Navigation ----------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: var(--color-beige);
  border-bottom: 1px solid transparent;
  transition: box-shadow var(--transition), border-color var(--transition);
}
.site-header.is-scrolled {
  box-shadow: var(--shadow-nav);
  border-bottom-color: var(--color-gray-mid);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(1.5rem, 3vw, 3rem);
  min-height: 76px;
}

.nav__logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
  line-height: 0;
}
.nav__logo img {
  height: 58px;
  width: auto;
}

/* Desktop: link list + CTA sit in one row, pushed to the right */
.nav__menu {
  display: flex;
  flex: 1;
  align-items: center;
  gap: clamp(0.5rem, 1.5vw, 1.5rem);
}

.nav__list {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
}

.nav__link {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  min-height: 44px;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-btn);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--color-navy);
  text-decoration: none;
  position: relative;
  transition: color var(--transition), background-color var(--transition);
}
.nav__link:hover { background-color: var(--color-gray-light); }
.nav__link::after {
  content: "";
  position: absolute;
  left: 0.9rem;
  right: 0.9rem;
  bottom: 0.35rem;
  height: 3px;
  border-radius: 3px;
  background: var(--color-green);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
}
.nav__link[aria-current="page"] { color: var(--color-navy); }
.nav__link[aria-current="page"]::after { transform: scaleX(1); }

.nav__cta { margin-left: auto; }

/* Hamburger toggle (hidden on desktop) — mit sichtbarem „Menü“-Text */
.nav__toggle {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 48px;
  padding: 0 0.95rem;
  border: 1px solid var(--color-gray-mid);
  border-radius: var(--radius-btn);
  background: var(--color-white);
  color: var(--color-navy);
  font-family: inherit;
  font-weight: 700;
  font-size: 1.05rem;
  cursor: pointer;
}
.nav__toggle-label { line-height: 1; }
.nav__toggle-bars {
  position: relative;
  width: 24px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: background-color var(--transition);
}
.nav__toggle-bars::before,
.nav__toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 24px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform var(--transition), top var(--transition);
}
.nav__toggle-bars::before { top: -7px; }
.nav__toggle-bars::after { top: 7px; }
.nav__toggle[aria-expanded="true"] .nav__toggle-bars { background: transparent; }
.nav__toggle[aria-expanded="true"] .nav__toggle-bars::before { top: 0; transform: rotate(45deg); }
.nav__toggle[aria-expanded="true"] .nav__toggle-bars::after  { top: 0; transform: rotate(-45deg); }

/* Mobile navigation */
@media (max-width: 1100px) {
  .nav__toggle { display: inline-flex; margin-left: auto; }
  .nav__logo img { height: 42px; } /* smaller logo on mobile (spec) */

  .nav__menu {
    display: block;
    position: fixed;
    inset: 76px 0 auto 0;
    background: var(--color-white);
    border-bottom: 1px solid var(--color-gray-mid);
    box-shadow: var(--shadow-nav);
    padding: 0.5rem var(--gutter) 1.5rem;
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
    max-height: calc(100vh - 76px);
    overflow-y: auto;
  }
  .nav__menu.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  .nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
  }
  .nav__link {
    min-height: 52px;
    font-size: 1.15rem;
    padding: 0.6rem 0.75rem;
  }
  .nav__link::after { display: none; }
  .nav__link[aria-current="page"] {
    background-color: var(--tint-green);
    color: var(--color-green-text);
  }
  .nav__cta { margin: 0.75rem 0 0; }
  .nav__cta .btn { width: 100%; }
}

/* ---------- Footer ------------------------------------------------------- */
.site-footer {
  background: var(--color-gray-light);
  color: var(--color-text-muted);
  padding-block: clamp(48px, 6vw, 72px) 2rem;
  font-size: 1rem;
  border-top: 1px solid var(--color-gray-mid);
}
.footer__grid {
  display: grid;
  gap: clamp(32px, 4vw, 48px);
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .footer__grid { grid-template-columns: 1.4fr 1fr 1fr; }
}
/* Einheitliche farbige Logo-Grafik in Header und Footer */
.footer__wordmark {
  display: inline-block;
  line-height: 0;
}
.footer__wordmark img {
  height: 68px;
  max-width: 100%;
  width: auto;
}
.footer__wordmark:hover img { opacity: 0.85; }
.footer__tagline {
  margin-top: 1rem;
  max-width: 34ch;
  color: var(--color-text-muted);
}
.footer__title {
  color: var(--color-navy);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.footer__list { list-style: none; display: grid; gap: 0.6rem; }
.footer__list a {
  color: var(--color-text);
  text-decoration: none;
  transition: color var(--transition);
}
.footer__list a:hover { color: var(--color-green-text); }
.footer__contact-item {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  line-height: 1.5;
}
.footer__contact-item svg { flex-shrink: 0; margin-top: 3px; color: var(--color-green-text); }
.footer__contact-item a { color: var(--color-navy); font-weight: 700; text-decoration: none; }
.footer__contact-item a:hover { color: var(--color-green-text); }

.footer__withdrawal {
  margin-top: clamp(32px, 4vw, 48px);
  display: flex;
  justify-content: flex-end;
}
.footer__withdrawal > div { display: none; }
.footer__withdrawal-label {
  display: block;
  margin-bottom: 0.2rem;
  color: var(--color-green-text);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.footer__withdrawal-title {
  color: var(--color-navy);
  font-size: clamp(1.08rem, 2vw, 1.25rem);
  line-height: 1.3;
}
.footer__withdrawal .btn {
  min-height: 46px;
  padding: 0.55rem 1.15rem;
  font-size: 0.95rem;
  width: auto;
}
@media (max-width: 719px) {
  .footer__withdrawal { justify-content: flex-start; }
}

.footer__bottom {
  margin-top: clamp(36px, 5vw, 56px);
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-gray-mid);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  align-items: center;
  justify-content: space-between;
  font-size: 1rem;
  color: var(--color-text-muted);
}
.footer__bottom nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
}
.footer__bottom a {
  color: var(--color-text);
  text-decoration: none;
}
.footer__bottom a:hover { color: var(--color-green-text); }

/* ---------- Reduced motion ---------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
