/* =========================================================================
   MAX FICHTEL Bauunternehmen GmbH — main.css
   Design-System nach PLAN.md Abschnitt 4, Komponenten-Reihenfolge nach 8.3
   ========================================================================= */

/* ---------- 1. Schrift ---------- */

@font-face {
  font-family: "Archivo";
  src: url("/assets/fonts/archivo-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- 2. Design-Tokens ---------- */

:root {
  --yellow: #f9b000;
  --yellow-hover: #de9d00;
  --yellow-tint: #fdf3dc;

  --ink: #1d2024;
  --anthracite: #17191c;
  --anthracite-2: #22252a;

  --paper: #ffffff;
  --paper-2: #f4f4f2;

  --line: #e2e3e5;
  --line-dark: #33373d;

  --text-muted: #565b62;
  --text-inv: #f2f3f4;
  --text-inv-muted: #a6abb2;

  --font: "Archivo", "Segoe UI", Arial, sans-serif;

  --wrap: 1160px;
  --gutter: clamp(16px, 4vw, 32px);
  --section-y: clamp(52px, 8vw, 100px);
  --radius: 4px;

  /* Signature: Hoehe der schraegen Sektionskante */
  --slant: min(3vw, 48px);

  --shadow-card: 0 2px 8px rgb(0 0 0 / 0.06);
}

/* ---------- 3. Reset & Basis ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

h1,
h2,
h3,
p,
ul,
ol,
figure,
blockquote {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
}

h1 {
  font-size: clamp(2.1rem, 5.5vw, 3.4rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.55rem, 3.5vw, 2.3rem);
  font-weight: 750;
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h3 {
  font-size: 1.25rem;
  font-weight: 650;
  line-height: 1.25;
}

strong {
  font-weight: 700;
}

/* Sichtbare Fokus-Ringe auf allem Interaktiven */
:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 2px;
  border-radius: 2px;
}

.btn--primary:focus-visible,
.on-dark .btn--primary:focus-visible {
  outline-color: var(--ink);
}

/* ---------- 4. Layout-Helfer ---------- */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--section-y);
}

/* Anker-Ziele (z. B. #leistungen, #bewerbung) nicht unter dem Sticky-Header
   landen lassen — Header ist ~80 px hoch. */
main [id] {
  scroll-margin-top: 92px;
}

.section--alt {
  background: var(--paper-2);
}

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

.prose {
  max-width: 68ch;
}

.lead {
  font-size: 1.1875rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.on-dark {
  background: var(--anthracite);
  color: var(--text-inv);
}

.on-dark .lead,
.on-dark .muted {
  color: var(--text-inv-muted);
}

.muted {
  color: var(--text-muted);
}

.center {
  text-align: center;
}

/* Nur fuer Screenreader — praezisiert generische Linktexte */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.mt-m {
  margin-top: 20px;
}

.mt-l {
  margin-top: 24px;
}

.mt-xl {
  margin-top: clamp(32px, 5vw, 48px);
}

.section__head {
  max-width: 62ch;
  margin-bottom: clamp(28px, 4vw, 44px);
}

.section__head.center {
  margin-inline: auto;
}

.section__head p {
  margin-top: 16px;
}

/* ---------- 5. Skip-Link ---------- */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  padding: 12px 20px;
  background: var(--yellow);
  color: var(--ink);
  font-weight: 650;
  text-decoration: none;
}

.skip-link:focus {
  left: 8px;
  top: 8px;
}

/* ---------- 6. Kicker & Signatur-Balken ---------- */

.kicker {
  display: block;
  margin-bottom: 14px;
  font-size: 0.85rem;
  font-weight: 650;
  line-height: 1.4;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.on-dark .kicker {
  color: var(--yellow);
}

/* Gleicher Vollton-Marker wie in der Fakten-Leiste (.facts__title::before) —
   EIN wiederkehrendes Motiv statt zweier konkurrierender. */
.kicker--stripe::before {
  content: "";
  display: inline-block;
  width: 22px;
  height: 4px;
  margin-right: 12px;
  vertical-align: 0.12em;
  background: var(--yellow);
}

.stripe {
  width: 64px;
  height: 5px;
  margin-top: 24px;
  background: var(--yellow);
}

/* ---------- 7. Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 14px 28px;
  border: 2px solid transparent;
  border-radius: var(--radius);
  background: none;
  color: inherit;
  font: inherit;
  font-weight: 650;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease,
    border-color 0.18s ease;
}

.btn svg {
  flex: none;
  width: 20px;
  height: 20px;
}

.btn--primary {
  background: var(--yellow);
  border-color: var(--yellow);
  color: var(--ink);
}

.btn--primary:hover {
  background: var(--yellow-hover);
  border-color: var(--yellow-hover);
}

.btn--outline {
  border-color: var(--ink);
  color: var(--ink);
}

.btn--outline:hover {
  background: var(--ink);
  color: var(--paper);
}

.btn--outline-inv {
  border-color: var(--text-inv);
  color: var(--text-inv);
}

.btn--outline-inv:hover {
  background: var(--text-inv);
  color: var(--ink);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 32px;
}

/* Textlink mit Pfeil */
.arrow-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  /* Padding bringt das Tap-Ziel auf 48 px, ohne den Text zu vergroessern */
  padding-block: 10px 8px;
  font-weight: 650;
  text-decoration: none;
  border-bottom: 2px solid var(--yellow);
}

.arrow-link svg {
  flex: none;
  width: 18px;
  height: 18px;
}

.arrow-link::after {
  content: "→";
  transition: transform 0.18s ease;
}

.arrow-link:hover::after {
  transform: translateX(4px);
}

/* ---------- 8. Header & Navigation ---------- */

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  transition: box-shadow 0.18s ease;
}

/* Wird von enhance.js gesetzt, sobald Inhalt unter dem Header durchlaeuft */
.header.is-scrolled {
  box-shadow: 0 4px 16px rgb(0 0 0 / 0.08);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 76px;
  padding-block: 12px;
}

.header__logo {
  display: block;
  flex: none;
  line-height: 0;
}

.header__logo img {
  width: 210px;
  height: 54px;
}

/* Checkbox-Hack: reines CSS-Menue, JS nur Enhancement */
.nav-toggle {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.nav-burger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-right: -8px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
}

.nav-burger span,
.nav-burger span::before,
.nav-burger span::after {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
}

.nav-burger span {
  position: relative;
}

.nav-burger span::before,
.nav-burger span::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-burger span::before {
  top: -7px;
}

.nav-burger span::after {
  top: 7px;
}

.nav-toggle:focus-visible + .nav-burger {
  outline: 3px solid var(--yellow);
  outline-offset: 2px;
}

.nav__list {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav__link {
  display: block;
  padding: 10px 14px;
  border-bottom: 3px solid transparent;
  font-weight: 600;
  text-decoration: none;
}

.nav__link:hover {
  border-bottom-color: var(--line);
}

.nav__link[aria-current="page"] {
  border-bottom-color: var(--yellow);
}

.nav__item--cta .nav__link {
  margin-left: 8px;
  padding: 12px 22px;
  border: 2px solid var(--yellow);
  border-radius: var(--radius);
  background: var(--yellow);
  color: var(--ink);
}

.nav__item--cta .nav__link:hover {
  background: var(--yellow-hover);
  border-color: var(--yellow-hover);
}

@media (max-width: 1099px) {
  .nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    display: none;
    padding: 8px var(--gutter) 24px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 24px rgb(0 0 0 / 0.08);
  }

  .nav-toggle:checked ~ .nav {
    display: block;
  }

  .nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .nav__link {
    padding: 14px 4px;
    border-bottom: 1px solid var(--line);
  }

  .nav__link[aria-current="page"] {
    border-bottom-color: var(--yellow);
  }

  .nav__item--cta .nav__link {
    margin: 16px 0 0;
    text-align: center;
  }

  .header__inner {
    position: relative;
  }
}

@media (min-width: 1100px) {
  .nav-burger {
    display: none;
  }

  /* Straffere Abstaende, damit die acht Punkte einzeilig in die Kopfzeile
     passen — der laengste ist "Planung & Entwicklung". */
  .nav__list {
    gap: 2px;
  }

  .nav__link {
    padding: 10px 11px;
    font-size: 0.9375rem;
  }

  .nav__item--cta .nav__link {
    padding: 11px 18px;
  }
}

@media (max-width: 419px) {
  .header__logo img {
    width: 172px;
    height: 44px;
  }
}

/* ---------- 9. Hero ---------- */

.hero {
  position: relative;
  background: var(--anthracite);
  color: var(--text-inv);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--slant)), 0 100%);
}

/* Linksbuendig am Seitenraster: der Innenbereich spannt die volle wrap-Breite,
   nur die Textelemente selbst sind in der Breite begrenzt. */
.hero__inner {
  position: relative;
  z-index: 1;
  padding-top: clamp(40px, 7vw, 88px);
  padding-bottom: clamp(36px, 7vw, 88px);
}

.hero__inner h1 {
  max-width: 44rem;
}

.hero__inner .lead {
  margin-top: 20px;
  color: var(--text-inv-muted);
  max-width: 40rem;
}

/* Kompakter Hero der Unterseiten (ohne Foto) */
.hero--page .hero__inner {
  padding-top: clamp(32px, 5vw, 56px);
  padding-bottom: calc(clamp(32px, 5vw, 56px) + var(--slant));
}

/*
  Foto/Video liegen auf allen Breiten als Hintergrund hinter dem Text; die
  media-Query im <source> sorgt dafuer, dass immer nur EINE Bilddatei laedt.
*/
.hero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Statisches Overlay statt Filter — haelt die Schrift lesbar. Mobil flaechig
   dunkel (der Text laeuft ueber die volle Breite), ab Tablet der seitliche
   Verlauf: links dicht, rechts deutlich offener. */
.hero__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgb(23 25 28 / 0.88);
}

@media (min-width: 768px) {
  .hero__media::after {
    background: linear-gradient(
      100deg,
      rgb(23 25 28 / 0.95) 0%,
      rgb(23 25 28 / 0.88) 52%,
      rgb(23 25 28 / 0.38) 100%
    );
  }
}

.hero--photo .hero__inner {
  padding-bottom: calc(clamp(40px, 7vw, 88px) + var(--slant));
}

/* Hero-Hintergrundvideo: unsichtbar, bis enhance.js es startet (nie bei
   reduced-motion oder Datensparmodus). Blendet weich ueber dem Foto ein;
   das dunkle Overlay (::after) liegt weiterhin darueber. */
.hero__media video {
  display: none;
}

@media (prefers-reduced-motion: no-preference) {
  .hero__media video {
    display: block;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1.2s ease;
  }

  .hero__media video.is-playing {
    opacity: 1;
  }
}

/* ---------- 10. Fakten-Leiste ---------- */

/*
  Einzeilige Badge-Reihe: jeder Eintrag nimmt seine natuerliche Breite,
  die Reihe ist zentriert; auf schmalen Screens brechen ganze Eintraege um.
*/
.facts {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  gap: 14px clamp(28px, 6vw, 88px);
  padding: clamp(20px, 3vw, 26px) clamp(20px, 4vw, 40px);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

/*
  Bewusst kein <h3>: Die Fakten-Leiste ist eine Kennzahlen-Zeile, keine
  Dokumentgliederung. Als Ueberschrift wuerde sie direkt nach der H1 eine
  Ebene ueberspringen.
*/
.facts__title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.25;
}

.facts__title::before {
  content: "";
  flex: none;
  width: 22px;
  height: 4px;
  background: var(--yellow);
}

/*
  Startseite: Die Fakten-Leiste ueberlappt die Hero-Schraege als aufliegende
  Karte — verzahnt Hero und Inhalt und nutzt die Schraege als Gestaltungselement.
  Das Layout-Rechteck des Hero bleibt trotz clip-path voll erhalten, der negative
  Abstand zieht die Karte also exakt ueber die Diagonale.

  NUR ab Tablet-Breite: Auf Mobil ist das Hero-Foto ein schmaler Streifen unter
  dem Text — eine darueber gelegte Karte wuerde ihn fast vollstaendig verdecken.
*/
.section--overlap {
  padding-top: 28px;
  /* Die Fakten-Karte traegt durch Schatten und Rahmen genug Eigengewicht — sie
     braucht darunter nicht den vollen Sektionsabstand. Zusammen mit der Regel
     weiter unten halbiert das die Luecke zum Abschnitt "Das Unternehmen". */
  padding-bottom: clamp(28px, 4vw, 48px);
}

.section--overlap + .section {
  padding-top: clamp(24px, 4vw, 44px);
}

.section--overlap .facts {
  position: relative;
  z-index: 2;
  background: var(--paper);
  box-shadow: 0 16px 40px rgb(0 0 0 / 0.1);
}

@media (min-width: 768px) {
  .section--overlap {
    padding-top: 0;
  }

  .section--overlap .facts {
    margin-top: calc(-1 * var(--slant) - 16px);
  }
}

/* ---------- 11. Zwei-Spalten-Block ---------- */

.split {
  display: grid;
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}

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

  .split--text-first > :first-child {
    order: 0;
  }
}

.split__media img {
  width: 100%;
  border-radius: var(--radius);
}

/*
  Personenfotos liegen im Hochformat vor (rund 3:4). In der Spalte neben dem Text
  wuerden sie ungebremst sehr hoch werden, deshalb hier eine Breitenbegrenzung
  statt eines Zuschnitts — so wird garantiert kein Kopf angeschnitten.
*/
.split__media--portrait img {
  max-width: 380px;
  margin-inline: auto;
}

/* Zwei Personenfotos nebeneinander; 3:4 entspricht fast dem Original,
   der Zuschnitt betraegt nur wenige Prozent und bringt beide auf eine Linie. */
.photo-pair {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: clamp(16px, 2.5vw, 24px);
  /* Bei drei Fotos ueber die volle Inhaltsbreite ergibt das rund 370 px je Bild
     — dieselbe Groesse wie das Portraet des Geschaeftsfuehrers weiter oben. */
  max-width: 1160px;
}

.photo-pair img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: center 28%;
  border-radius: var(--radius);
}

/*
  Der Link steht im Markup hinter dem Foto — mobil erscheint er dadurch von
  selbst darunter, wo er nach dem Bild den Lesefluss abschliesst. Ab zwei
  Spalten rueckt er zurueck unter den Text; das Foto ueberspannt dann beide
  Zeilen, damit rechts keine Luecke entsteht.
*/
.split__cta {
  margin-top: 0;
}

@media (min-width: 860px) {
  .split--cta-below {
    row-gap: 24px;
  }

  .split--cta-below > .split__media {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  .split--cta-below > .split__cta {
    grid-column: 1;
  }
}

.signature {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-weight: 700;
}

.signature span {
  display: block;
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.975rem;
}

/* ---------- 12. Karten-Raster ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: clamp(20px, 3vw, 32px);
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease,
    border-color 0.18s ease;
}

.card:hover {
  border-color: var(--ink);
  box-shadow: 0 12px 28px rgb(0 0 0 / 0.12);
}

@media (prefers-reduced-motion: no-preference) {
  .card:hover {
    transform: translateY(-3px);
  }
}

/* Stretched Link: die ganze Karte ist klickbar, nicht nur "Mehr erfahren" */
.card .arrow-link::before {
  content: "";
  position: absolute;
  inset: 0;
}

.card .arrow-link:focus-visible {
  outline: none;
}

.card:has(.arrow-link:focus-visible) {
  outline: 3px solid var(--yellow);
  outline-offset: 2px;
}

.card__img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

/* Hochformat-Fotos in Karten: oberen Bildteil zeigen, sonst fehlen die Koepfe */
.card__img--top {
  object-position: center top;
}

.card__icon {
  width: 26px;
  height: 26px;
  color: var(--yellow);
  margin-bottom: 10px;
}

.card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 24px;
}

.card__body p {
  margin-top: 10px;
  color: var(--text-muted);
  font-size: 0.975rem;
}

.card__body .arrow-link {
  margin-top: auto;
  padding-top: 20px;
  align-self: flex-start;
}

/* Stellen-Karten (/jobs/): kleines Zwischenlabel + kompakte Checkliste */
.card__sub {
  margin-top: 18px;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.card .checklist {
  margin-top: 10px;
  gap: 8px;
  font-size: 0.95rem;
}

.card .checklist svg {
  width: 18px;
  height: 18px;
  margin-top: 4px;
}

/* ---------- 13. Ablauf-Schritte ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: clamp(24px, 4vw, 40px);
  counter-reset: step;
}

.steps__item {
  counter-increment: step;
  padding-top: 24px;
  border-top: 2px solid var(--line-dark);
}

/* Tabellenziffern + Sperrung: wirkt wie technische Planbeschriftung */
.steps__item::before {
  content: counter(step, decimal-leading-zero);
  display: block;
  margin-bottom: 12px;
  color: var(--yellow);
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.08em;
  font-feature-settings: "tnum";
}

.steps__item p {
  margin-top: 10px;
  color: var(--text-inv-muted);
  font-size: 0.975rem;
}

/* ---------- 14. Leistungs-Liste (Haekchen) ---------- */

.checklist {
  display: grid;
  gap: 14px;
  max-width: 60ch;
}

.checklist li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.checklist svg {
  flex: none;
  width: 22px;
  height: 22px;
  margin-top: 3px;
  color: var(--yellow);
}

/* ---------- 15. Info-Box ---------- */

.infobox {
  padding: clamp(24px, 4vw, 36px);
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 6px solid var(--yellow);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

.infobox p {
  max-width: 60ch;
}

.infobox .btn {
  margin-top: 20px;
}

/* ---------- 16. FAQ ---------- */

.faq {
  max-width: 74ch;
  margin-inline: auto;
  border-top: 1px solid var(--line);
}

.faq details {
  border-bottom: 1px solid var(--line);
}

.faq summary {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 22px 4px;
  font-size: 1.0625rem;
  font-weight: 650;
  line-height: 1.4;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  margin-left: auto;
  color: var(--yellow);
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
}

.faq details[open] summary::after {
  content: "–";
}

/* Neutraler Hover statt Gelb-Tint: funktioniert auf Weiss UND auf --paper-2 */
.faq summary:hover {
  background: rgb(29 32 36 / 0.04);
}

.faq__answer {
  padding: 0 4px 24px;
  max-width: 66ch;
  color: var(--text-muted);
}

/* ---------- 17. CTA-Band ---------- */

.cta {
  background: var(--anthracite);
  color: var(--text-inv);
  clip-path: polygon(0 var(--slant), 100% 0, 100% 100%, 0 100%);
  padding-block: calc(var(--section-y) + var(--slant)) var(--section-y);
  text-align: center;
}

.cta p {
  max-width: 52ch;
  margin: 16px auto 0;
  color: var(--text-inv-muted);
}

.cta .btn-row {
  justify-content: center;
}

/* ---------- 18. Foto-Reihe & Feature-Band ---------- */

.photo-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: clamp(16px, 2.5vw, 24px);
}

.photo-row img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: var(--radius);
}

/*
  Grundrisse: bewusst OHNE aspect-ratio und object-fit. Ein Zuschnitt wuerde
  Raeume abschneiden und die Beschriftungen unlesbar machen — die Plaene behalten
  ihr eigenes Format. Da alle drei gleich gross sind, stehen sie trotzdem auf
  einer Linie. Weisser Grund, damit sie sich von der hellgrauen Sektion abheben.
*/
.plan-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: clamp(16px, 2.5vw, 24px);
  align-items: start;
}

.plan-row img {
  width: 100%;
  height: auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* Einzelnes, grosses Motiv ueber einer Bildreihe — 3:2 schneidet die 4:3-Vorlage
   nur leicht an und passt zum Zuschnitt der Reihe darunter. */
.feature-photo img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: var(--radius);
}

.feature-band img {
  width: 100%;
  aspect-ratio: 1200 / 424;
  object-fit: cover;
  border-radius: var(--radius);
}

figure figcaption {
  margin-top: 12px;
  color: var(--text-muted);
  font-size: 0.925rem;
}

/* ---------- 18b. Drohnen-Sektion: Hochformat-Video + Fotos ---------- */

/*
  Das Drohnenvideo liegt nativ im Hochformat (9:16). Ab Tablet steht es links
  in fester Spaltenbreite, rechts stapeln sich zwei Querformat-Fotos, die die
  Videohoehe ausfuellen. Mobil alles untereinander, Video begrenzt.
*/
.media-split {
  display: grid;
  gap: clamp(16px, 2.5vw, 24px);
}

.media-split .video-frame {
  position: relative;
  width: 100%;
  max-width: 420px;
  margin-inline: auto;
}

.media-split video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  background: var(--anthracite);
}

/*
  Grosser Play-Button in Videomitte: startet das Video per Klick und
  verschwindet waehrend der Wiedergabe (enhance.js). Ohne JS bleibt er per
  hidden-Attribut unsichtbar — dann gelten die nativen Controls.
*/
.video-play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 88px;
  height: 88px;
  transform: translate(-50%, -50%);
  border: 0;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 10px 28px rgb(0 0 0 / 0.35);
  cursor: pointer;
  transition: background-color 0.18s ease, transform 0.18s ease;
}

.video-play:hover {
  background: var(--yellow-hover);
  transform: translate(-50%, -50%) scale(1.06);
}

.video-play::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-38%, -50%);
  border-left: 28px solid var(--ink);
  border-top: 17px solid transparent;
  border-bottom: 17px solid transparent;
}

.video-play[hidden] {
  display: none;
}

.media-split__photos {
  display: grid;
  gap: clamp(16px, 2.5vw, 24px);
}

.media-split__photos a {
  display: block;
  height: 100%;
  min-height: 0;
}

.media-split__photos img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  border-radius: var(--radius);
}

@media (min-width: 700px) {
  .media-split {
    grid-template-columns: minmax(0, 380px) 1fr;
    align-items: stretch;
  }

  .media-split .video-frame {
    max-width: none;
    margin-inline: 0;
  }

  .media-split__photos {
    grid-template-rows: 1fr 1fr;
    min-height: 0;
  }
}

/* ---------- 18c. Zoombare Bilder & Lightbox ---------- */

/*
  a.zoomable verlinkt die Grossversion eines Bildes: Ohne JS oeffnet der Link
  schlicht die Bilddatei, mit JS faengt enhance.js den Klick ab und zeigt das
  Overlay. Das Overlay ist ein <button>, damit Enter/ESC und Fokus natuerlich
  funktionieren.
*/
a.zoomable {
  display: block;
  cursor: zoom-in;
}

.photo-row a.zoomable img {
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: var(--radius);
}

.feature-band a.zoomable img {
  aspect-ratio: 1200 / 424;
  object-fit: cover;
  border-radius: var(--radius);
}

/* ---------- 18b. Galerie-Raster ---------- */

/*
  Quadratische Vorschaubilder: Die Aufnahmen liegen gemischt im Hoch- und
  Querformat vor. Ein einheitliches Raster wirkt ruhiger als eine Treppe aus
  unterschiedlichen Hoehen — die volle Aufnahme zeigt ohnehin die Lightbox.
*/
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr));
  gap: clamp(8px, 1.4vw, 14px);
}

@media (min-width: 600px) {
  .gallery {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}

.gallery__item {
  position: relative;
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper-2);
  cursor: zoom-in;
}

.gallery__item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
}

@media (hover: hover) {
  .gallery__item:hover img {
    transform: scale(1.05);
  }
}

/* Play-Kennzeichnung auf Video-Kacheln */
.gallery__item--video::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgb(23 25 28 / 0.25);
}

.gallery__play {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--ink);
  pointer-events: none;
}

.gallery__play svg {
  width: 22px;
  height: 22px;
  margin-left: 3px;
}

/* ---------- 18c. Lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  grid-template-rows: 1fr auto;
  background: rgb(23 25 28 / 0.94);
  /* Verhindert, dass die Seite dahinter mitscrollt — ohne den Body zu sperren.
     Ein Scroll-Lock am Body kann haengenbleiben, wenn das Schliessen ausfaellt. */
  overscroll-behavior: contain;
  /* pinch-zoom bleibt erlaubt: Bei Grundrissen und Detailaufnahmen ist das
     Aufziehen mit zwei Fingern der eigentliche Zweck der Lightbox. */
  touch-action: pan-y pinch-zoom;
}

.lightbox__stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: clamp(48px, 6vw, 72px) clamp(12px, 4vw, 80px) 8px;
}

.lightbox__stage img,
.lightbox__stage video {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  border-radius: var(--radius);
  box-shadow: 0 24px 64px rgb(0 0 0 / 0.5);
  background: #000;
}

.lightbox__bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 12px clamp(12px, 4vw, 24px) calc(12px + env(safe-area-inset-bottom));
  color: var(--text-inv-muted);
  font-size: 0.9rem;
  text-align: center;
}

.lightbox__caption {
  max-width: 62ch;
}

.lightbox__count {
  flex: none;
  font-variant-numeric: tabular-nums;
  color: var(--text-inv);
  font-weight: 650;
}

/* Bedienelemente */
.lightbox__btn {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.12);
  color: var(--text-inv);
  cursor: pointer;
  transition: background-color 0.18s ease;
}

.lightbox__btn:hover {
  background: rgb(255 255 255 / 0.24);
}

.lightbox__btn svg {
  width: 24px;
  height: 24px;
}

.lightbox__close {
  top: max(12px, env(safe-area-inset-top));
  right: 12px;
}

.lightbox__prev {
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox__next {
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
}

/*
  Mobil wandern die Blaetter-Knopfe nach unten neben den Zaehler: am Bildrand
  liegen sie sonst unter dem Daumen genau auf dem Bild, und gewischt wird
  ohnehin. Tap-Ziele bleiben bei 48 px.
*/
@media (max-width: 599px) {
  .lightbox__prev,
  .lightbox__next {
    top: auto;
    bottom: calc(8px + env(safe-area-inset-bottom));
    transform: none;
  }

  .lightbox__bar {
    padding-inline: 72px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .lightbox {
    animation: lightbox-ein 0.18s ease-out;
  }
}

@keyframes lightbox-ein {
  from {
    opacity: 0;
  }
}

/* ---------- 19. Querverweis-Karten ---------- */

.crosslinks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 20px;
}

.crosslink {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  font-weight: 650;
  text-decoration: none;
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

.crosslink::after {
  content: "→";
  color: var(--yellow);
  font-size: 1.25rem;
}

.crosslink:hover {
  border-color: var(--ink);
  background: var(--paper-2);
}

/* ---------- 20. Werdegang (kompakt, Ueber uns) ---------- */

/*
  Bewusst zurueckhaltend: kleine Schrift, kein eigener Abschnitt, keine
  Ueberschrift — der Werdegang begleitet den Text zum Geschaeftsfuehrer,
  statt ihm die Aufmerksamkeit zu nehmen.
*/
.milestones__label {
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.milestones {
  display: grid;
  gap: 6px;
  max-width: 46ch;
  padding-left: 14px;
  border-left: 3px solid var(--yellow);
}

.milestones li {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 12px;
  font-size: 0.925rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.milestones b {
  font-weight: 700;
  color: var(--ink);
}

@media (max-width: 479px) {
  .milestones li {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .milestones {
    gap: 12px;
  }
}

/* ---------- 21. Kontakt-Karten & Adresse ---------- */

.contact-cards {
  display: grid;
  /* 300 px statt 260 px: schmaler duerfen die Karten nicht werden, sonst bricht
     die E-Mail-Adresse im Button um. Darunter faellt das Raster auf eine Spalte
     (volle Breite), wo die Adresse reichlich Platz hat. */
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: clamp(20px, 3vw, 28px);
}

.contact-card {
  display: flex;
  flex-direction: column;
  padding: 32px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow-card);
}

.contact-card__icon {
  width: 30px;
  height: 30px;
  color: var(--yellow);
  margin-bottom: 14px;
}

.contact-card p {
  margin-top: 10px;
  /* Mindestabstand zum Button, falls margin-top:auto auf der hoechsten Karte kollabiert */
  margin-bottom: 24px;
  color: var(--text-muted);
  font-size: 0.975rem;
}

.contact-card .btn {
  /* an den Kartenboden geschoben, damit die Buttons aller Karten auf einer
     Hoehe stehen, auch wenn der Beschreibungstext unterschiedlich lang ist.
     Volle Breite und schmaleres Innenpadding: alle drei gleich gross, und die
     lange E-Mail-Adresse passt auch in der schmalsten Karte einzeilig. */
  margin-top: auto;
  width: 100%;
  padding-inline: 16px;
}

address {
  font-style: normal;
  font-size: 1.125rem;
  line-height: 1.7;
}

.note {
  margin-top: 24px;
  color: var(--text-muted);
  font-size: 0.9rem;
  max-width: 68ch;
}

/* ---------- 22. Footer ---------- */

.footer {
  background: var(--anthracite);
  color: var(--text-inv);
  border-top: 4px solid var(--yellow);
}

.footer__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: clamp(32px, 5vw, 56px);
  padding-block: clamp(40px, 6vw, 60px);
}

.footer h2 {
  margin-bottom: 18px;
  font-size: 0.85rem;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--yellow);
}

.footer__logo img {
  width: 200px;
  height: 51px;
  margin-bottom: 20px;
}

.footer address,
.footer li {
  color: var(--text-inv-muted);
  font-size: 0.975rem;
}

.footer a {
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.footer a:hover {
  border-bottom-color: var(--yellow);
  color: var(--text-inv);
}

/* Padding statt Zeilenabstand: macht jeden Footer-Link zu einem 44-px-Tap-Ziel */
.footer li a,
.footer__bottom nav a {
  display: inline-block;
  padding-block: 13px;
}

.footer__contact {
  margin-top: 8px;
}

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  align-items: center;
  padding-block: 24px;
  border-top: 1px solid var(--line-dark);
  color: var(--text-inv-muted);
  font-size: 0.9rem;
}

.footer__bottom nav {
  display: flex;
  gap: 24px;
  margin-left: auto;
}

@media (max-width: 559px) {
  .footer__bottom nav {
    margin-left: 0;
  }
}

/* ---------- 23. Rechtstexte ---------- */

.legal {
  max-width: 76ch;
}

.legal h2 {
  margin-top: 48px;
  margin-bottom: 16px;
  font-size: 1.375rem;
}

.legal h3 {
  margin-top: 28px;
  margin-bottom: 10px;
  font-size: 1.0625rem;
}

.legal p + p,
.legal ul + p,
.legal p + ul {
  margin-top: 1.1em;
}

.legal ul {
  list-style: disc;
  padding-left: 1.4em;
  display: grid;
  gap: 8px;
}

.legal address {
  font-size: 1.0625rem;
}

.legal a {
  color: var(--ink);
}

/* ---------- 24. Below-the-fold entlasten ---------- */

/*
  content-visibility spart das Rendern und Dekodieren von Sektionen, die noch nicht
  sichtbar sind — deshalb steht es nur an den bildlastigen Sektionen, wo es etwas
  bringt. Reine Textsektionen laesst es unangetastet: dort waere der Gewinn null,
  der Platzhalter aber trotzdem eine Fehlschaetzung der Seitenhoehe.

  Die Platzhalterwerte sind an den gemessenen echten Hoehen ausgerichtet (Ein-Wert-
  Syntax; die Zwei-Wert-Variante bringt manche Build-Parser zum Entgleisen). Je
  genauer der Wert, desto weniger springt die Scrollleiste beim Scrollen.
*/
.cv {
  content-visibility: auto;
  contain-intrinsic-size: 1020px;
}

/* Kartenraster: mobil untereinander, ab Tablet nebeneinander — deshalb eigene
   Werte. Muss nach .cv stehen, sonst gewinnt .cv durch die Quellreihenfolge. */
.cv--cards {
  contain-intrinsic-size: 2000px;
}

@media (min-width: 700px) {
  .cv {
    contain-intrinsic-size: 800px;
  }

  .cv--cards {
    contain-intrinsic-size: 1500px;
  }
}

@media (min-width: 860px) {
  .cv {
    contain-intrinsic-size: 645px;
  }

  .cv--cards {
    contain-intrinsic-size: 1110px;
  }
}

/* ---------- 25. Reveal (nur Desktop, nur ohne reduced-motion) ---------- */

/*
  Bewusst OHNE opacity: Ein Startzustand von opacity:0 macht Inhalt tatsaechlich
  unsichtbar — bis das JS greift oder der Failsafe zuschlaegt. Eine reine
  Bewegung erreicht denselben Effekt, laesst den Text aber jederzeit lesbar
  (auch fuer Prueftools, die die Seite vor dem Scrollen auswerten).
*/
@media (prefers-reduced-motion: no-preference) and (min-width: 768px) {
  .reveal {
    transform: translateY(20px);
    /* CSS-Failsafe: ohne JS sitzt alles nach 2,5 s in jedem Fall am Platz */
    animation: reveal-failsafe 0.4s ease 2.5s forwards;
  }

  .reveal.is-visible {
    animation: none;
    transform: none;
    transition: transform 0.5s cubic-bezier(0.22, 0.61, 0.36, 1);
  }
}

@keyframes reveal-failsafe {
  to {
    transform: none;
  }
}

/* ---------- 26. Druck ---------- */

@media print {
  .header,
  .footer,
  .cta,
  .skip-link {
    display: none;
  }

  body {
    color: #000;
  }
}
