*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --black: #0a0a0a; --white: #ffffff; --gray-100: #f5f5f5;
  --gray-200: #e8e8e8; --gray-400: #999999; --gray-600: #555555;
  --gray-800: #222222; --accent: #c8a96e; --accent-light: rgba(200,169,110,0.15);
  --err: #b3453a;
  /* Mobile-Typografie-System (<=767px, siehe @media weiter unten) - identische
     Tokens wie auf den uebrigen Unterseiten. Nur auf Mobile referenziert -
     Tablet/Desktop bleiben unveraendert. */
  --fs-mobile-article-h1-a: clamp(1.75rem, 1.10714rem + 2.85714vw, 1.875rem); /* v3: kurze Titel (Syne 700): 28-30px */
  --fs-mobile-article-h1-b: clamp(1.65625rem, 1.17411rem + 2.14286vw, 1.75rem); /* v3: mittlere Titel (Syne 700): 26.5-28px */
  --fs-mobile-lead: clamp(1rem, 0.67857rem + 1.42857vw, 1.0625rem); /* Intro-Absatz: 16-17px */
  --fs-mobile-btn: 13.5px;  /* Button-Text auf Mobile */
  --lh-mobile-display: 1.04; /* v3: Zeilenhoehe Display-Headlines (Syne) */
  --lh-mobile-body: 1.55;
}
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { font-family: 'DM Sans', sans-serif; background: var(--white); color: var(--black); overflow-x: hidden; overflow-wrap: break-word; }
img, svg { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { hyphens: manual; -webkit-hyphens: manual; word-break: normal; overflow-wrap: normal; text-wrap: balance; }

.section-tag {
  font-size: 11px; font-weight: 500; letter-spacing: 0.22em; color: var(--accent);
  text-transform: uppercase; margin-bottom: 14px; display: flex; align-items: center; gap: 12px;
}
.section-tag::before { content: ''; display: block; width: 24px; height: 1px; background: var(--accent); flex-shrink: 0; }

.btn-primary {
  font-family: 'DM Sans', sans-serif; font-size: 14px; font-weight: 500; letter-spacing: 0.06em;
  padding: 16px 30px; border-radius: 2px; text-decoration: none; text-transform: uppercase;
  transition: all 0.25s ease; display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; border: 1px solid transparent; cursor: pointer;
  background: var(--accent); color: var(--black);
}
.btn-primary:hover { background: #dbbf85; transform: translateY(-1px); }

.pagehead { background: var(--black); padding: 14px 20px; display: flex; align-items: center; justify-content: space-between; }
.nav-logo-link { display: flex; flex-direction: column; gap: 2px; line-height: 1; text-decoration: none; }
.nav-logo-main { font-family: 'Syne', sans-serif; font-size: 17px; font-weight: 800; letter-spacing: 0.08em; color: var(--white); text-transform: uppercase; }
.nav-logo-sub { display: none; font-family: 'DM Sans', sans-serif; font-size: 9px; font-weight: 400; letter-spacing: 0.12em; color: rgba(255,255,255,0.45); text-transform: uppercase; }
.nav-logo-img { height: 28px; width: auto; max-width: none; display: block; align-self: flex-start; object-fit: contain; }
.pagehead-back { font-size: 12.5px; font-weight: 500; letter-spacing: 0.03em; color: rgba(255,255,255,0.75); text-decoration: none; min-height: 44px; display: flex; align-items: center; gap: 6px; transition: color 0.25s; }
.pagehead-back:hover { color: var(--accent); }

.page-intro { background: var(--black); padding: 28px 20px 36px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.page-intro-inner { max-width: 720px; margin: 0 auto; }
.page-headline { font-family: 'Syne', sans-serif; font-size: clamp(2.25rem, 9vw, 2.75rem); font-weight: 800; line-height: 1.06; letter-spacing: -0.02em; color: var(--white); margin-bottom: 14px; }
.page-sub { font-size: 15px; font-weight: 300; line-height: 1.6; color: rgba(255,255,255,0.72); max-width: 56ch; }
/* 768-799px: "Kontakt aufnehmen" bleibt wie die bisherige Headline einzeilig (1px kleiner). */
@media (min-width: 768px) and (max-width: 799px) { .page-headline { font-size: 2.6875rem; } }

#kontakt { padding: 36px 20px 24px; background: var(--white); }
.kontakt-inner { max-width: 720px; margin: 0 auto; }

.gc-summary-box { background: var(--gray-100); border: 1px solid var(--gray-200); border-radius: 3px; padding: 16px; margin-bottom: 28px; }
.gc-summary-title { font-size: 12px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
.gc-summary-text { font-size: 13px; line-height: 1.6; color: var(--gray-800); white-space: pre-line; margin-bottom: 10px; }
.gc-summary-remove { font-size: 12px; color: var(--gray-400); text-decoration: underline; background: none; border: none; cursor: pointer; font-family: inherit; padding: 0; }
.gc-summary-remove:hover { color: var(--err); }

.af-group { margin-bottom: 24px; }
.af-group-label { font-size: 12.5px; font-weight: 500; letter-spacing: 0.03em; color: var(--black); margin-bottom: 12px; }
.af-group-label .af-req { font-weight: 300; color: var(--gray-400); letter-spacing: 0; margin-left: 4px; }
.af-hint { font-size: 12px; font-weight: 300; color: var(--gray-400); margin-top: 8px; }
.af-hint.show { color: var(--err); }

.af-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.af-tile {
  display: flex; align-items: center; gap: 10px; text-align: left;
  background: var(--white); border: 1px solid var(--gray-200); border-radius: 3px;
  padding: 13px 12px; cursor: pointer; font-family: 'DM Sans', sans-serif;
  transition: border-color 0.25s, background 0.25s; min-height: 48px;
  /* min-width:0 überschreibt den Grid-Default (min-width:auto = Content-
     Breite). Ohne das erzwang ein langes, nicht trennbares Wort wie
     "Prozessoptimierung" eine breitere Spalte als verfügbar und die
     ganze Seite bekam horizontalen Overflow (Cards liefen rechts raus). */
  min-width: 0;
}
.af-tile-icon { flex-shrink: 0; width: 18px; height: 18px; }
.af-tile-icon svg { width: 100%; height: 100%; }
.af-tile-icon svg path, .af-tile-icon svg rect, .af-tile-icon svg circle, .af-tile-icon svg polyline, .af-tile-icon svg line { stroke: var(--gray-800); stroke-width: 1.5; fill: none; transition: stroke 0.25s; }
.af-tile span { font-size: 13px; font-weight: 500; line-height: 1.3; color: var(--black); }
.af-tile:hover { border-color: var(--accent); }
.af-tile.active { background: var(--black); border-color: var(--black); }
.af-tile.active span { color: var(--white); }
.af-tile.active .af-tile-icon svg path, .af-tile.active .af-tile-icon svg rect,
.af-tile.active .af-tile-icon svg circle, .af-tile.active .af-tile-icon svg polyline, .af-tile.active .af-tile-icon svg line { stroke: var(--accent); }
.af-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.af-service-error { font-size: 12.5px; color: var(--err); margin-top: 10px; display: none; }
.af-service-error.show { display: block; }

.af-dynamic { max-height: 0; opacity: 0; overflow: hidden; transition: max-height 0.35s ease, opacity 0.3s ease, margin 0.35s ease; margin-bottom: 0; }
.af-dynamic.open { max-height: 500px; opacity: 1; margin-bottom: 28px; }
.af-dynamic-inner { background: var(--gray-100); border-radius: 3px; padding: 16px; }
.af-dynamic-title { font-size: 12px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); margin-bottom: 16px; }

.af-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.af-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.af-field { display: flex; flex-direction: column; gap: 6px; }
.af-field-full { grid-column: 1 / -1; margin-top: 16px; }
.af-field label { font-size: 12.5px; font-weight: 500; color: var(--gray-800); }
.af-field label .af-optional { font-weight: 300; color: var(--gray-400); }
.af-field input, .af-field select, .af-field textarea {
  font-family: 'DM Sans', sans-serif; font-size: 16px; color: var(--black);
  background: var(--white); border: 1px solid var(--gray-200); border-radius: 2px;
  padding: 12px 14px; width: 100%; transition: border-color 0.25s; appearance: none;
}
.af-dynamic .af-field input, .af-dynamic .af-field select { background: var(--white); }
.af-field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpolyline points='6 9 12 15 18 9' fill='none' stroke='%23999' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; padding-right: 36px; }
.af-field input:focus, .af-field select:focus, .af-field textarea:focus { outline: none; border-color: var(--accent); }
.af-field textarea { resize: vertical; min-height: 96px; font-family: inherit; }
.af-field.af-invalid input, .af-field.af-invalid select, .af-field.af-invalid textarea { border-color: var(--err); }
.af-field-error { font-size: 12px; color: var(--err); display: none; }
.af-field.af-invalid .af-field-error { display: block; }
/* .af-field setzt display:flex - ohne diese Regel würde das [hidden]-Attribut
   (z.B. beim dynamischen "Sonstiges"-Freitextfeld) wirkungslos bleiben. */
.af-field[hidden] { display: none; }

.af-honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.af-privacy { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 22px; cursor: pointer; }
.af-privacy input { margin-top: 3px; flex-shrink: 0; width: 16px; height: 16px; accent-color: var(--accent); }
.af-privacy span { font-size: 13px; line-height: 1.55; color: var(--gray-600); }
.af-privacy a { color: var(--accent); text-decoration: underline; }
.af-privacy.af-invalid span { color: var(--err); }

.af-submit { border: none; width: 100%; text-align: center; font-size: 14px; }
.af-submit:disabled { opacity: 0.55; cursor: default; transform: none; }
.af-status { margin-top: 14px; font-size: 13px; text-align: center; min-height: 18px; color: var(--gray-600); }
.af-status.af-status-error { color: var(--err); }

.af-success { text-align: center; padding: 48px 20px; background: var(--gray-100); border-radius: 3px; }
.af-success-icon { width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--accent); color: var(--accent); font-size: 22px; display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; }
.af-success p { font-size: 16px; color: var(--black); font-weight: 500; }
.af-success p.af-success-next { font-size: 14.5px; font-weight: 300; color: var(--gray-600); max-width: 52ch; margin: 10px auto 0; line-height: 1.6; }

footer { background: var(--black); border-top: 1px solid rgba(255,255,255,0.06); padding: 16px 20px; display: flex; align-items: center; justify-content: center; text-align: center; }
.footer-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 16px; }
.footer-copy { font-size: 11.5px; color: rgba(255,255,255,0.4); letter-spacing: 0.02em; }
.footer-links { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 10px; }
.footer-links a { font-size: 11.5px; color: rgba(255,255,255,0.55); text-decoration: none; min-height: 32px; display: inline-flex; align-items: center; transition: color 0.25s; }
.footer-links a:hover { color: var(--accent); }
.footer-dot { color: rgba(255,255,255,0.25); font-size: 11px; }

@media (min-width: 768px) {
  .pagehead { padding: 20px 40px; }
  .nav-logo-sub { display: block; } .nav-logo-img { height: 34px; width: auto; object-fit: contain; }
  .page-intro { padding: 36px 40px 48px; }
  #kontakt { padding-left: 40px; padding-right: 40px; }
  .af-tiles { grid-template-columns: repeat(3, 1fr); }
  .af-grid.af-grid-3 { grid-template-columns: repeat(3, 1fr); }
  footer { padding: 20px 40px 18px; }
}
@media (min-width: 1024px) {
  .pagehead { padding: 24px 56px; }
  .page-intro { padding: 44px 56px 56px; }
  #kontakt { padding: 56px 56px 32px; }
  footer { padding: 20px 56px; }
}
@media (max-width: 480px) {
  .af-grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 374px) {
  /* Auf sehr schmalen Geräten (<375px, z.B. iPhone SE) wechseln die
     Themen-Kacheln auf eine Spalte - bei zwei Spalten wäre der Text
     dort zu eng. Ab ca. 375px (siehe Grundregel oben) bleiben zwei
     Spalten, die sehen bei 390-412px sauber aus. */
  .af-tiles { grid-template-columns: 1fr; }
}
@media (max-width: 767px) {
  /* Kontakt-Hero: auf 360-412px sonst zu gross, responsive Groesse +
     overflow-wrap:normal (siehe h1,h2,h3 oben) verhindert unschoene
     Umbrueche zuverlässig; Hero insgesamt etwas kompakter, muss nicht
     fast einen ganzen Screen fuellen. */
  .page-intro { padding: 22px 20px 26px; }
  .page-headline { font-size: var(--fs-mobile-article-h1-a); line-height: var(--lh-mobile-display); }
  .page-sub { font-size: var(--fs-mobile-lead); line-height: var(--lh-mobile-body); }
  .btn-primary { font-size: var(--fs-mobile-btn); }

  /* text-wrap:wrap statt balance: verhindert, dass eine bereits
     "ausbalancierte" Zeilenaufteilung nach dem Nachladen der Web-Schrift
     (Font-Swap) ueber den verfuegbaren Platz hinausragt - insbesondere bei
     langen, zusammengesetzten Woertern in Headlines. Rein defensiv, keine
     sichtbare Optik-Aenderung im Normalfall. */
  .page-headline { text-wrap: wrap; }
}

/* ============================================================
   MOBILE-TYPOGRAFIE v3 (nur <=767px) - ruhiger, kompakter, hochwertiger.
   Groessen kommen aus den --fs-mobile-*-Tokens in :root (v3). Tablet
   (>=768px) und Desktop bleiben unveraendert, da alle Regeln hier nur
   innerhalb von max-width:767px greifen. Display-Headlines nutzen auf
   Mobile Syne 700 (ca. 30 % schmaler als 800 -> weniger Zeilen, keine
   Wortbrueche); Desktop behaelt Syne 800.
   ============================================================ */
@media (max-width: 767px) {
  .page-intro { padding: 20px 20px 22px; }
  .page-intro .section-tag { margin-bottom: 10px; }
  .page-headline { font-weight: 700; hyphens: none; -webkit-hyphens: none; font-size: var(--fs-mobile-article-h1-b); line-height: var(--lh-mobile-display); margin-bottom: 10px; }
  /* Unter 360px (sehr schmale Geraete) greift wieder die manuelle Silbentrennung
     (&shy;) als Sicherheitsnetz - besser ein sauberer Trennstrich als ein harter Umbruch. */
  @media (max-width: 359px) { .page-headline { hyphens: manual; -webkit-hyphens: manual; } }
}
