/* ==========================================================================
   Motoexperts OG · Stylesheet
   Aufbau: Schriften · Tokens · Basis · Raster · Kopf · Elemente · Abschnitte · Seiten
   ========================================================================== */

/* ---------- Schriften (selbst gehostet) ---------- */

@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-var-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/plexmono-400-latin.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/plexmono-500-latin.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

/* ---------- Tokens ---------- */

:root {
  color-scheme: dark;

  --asphalt: #121110;
  --werkbank: #1b1a18;
  --werkbank-2: #252321;
  --linie: #34322f;
  --linie-stark: #4a4743;
  --kreide: #ece8e1;
  --kreide-2: #a8a29a;
  --kreide-3: #7a746c;
  --signalrot: #c4251b;
  --signalrot-tief: #a11d15;
  --rot-text: #e8473a;
  --papier: #ece8e1;
  --papier-2: #cfc9bf;
  --papier-linie: #bdb6ab;
  --tinte: #121110;
  --tinte-2: #5e5850;
  --rot-papier: #b8221a;
  --ok: #6faf7f;
  --hinweis: #e0b04a;
  --fehler: #ff5a4e;

  --schrift: "Archivo", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;

  --ease: cubic-bezier(.2, .7, .1, 1);
  --ease-wisch: cubic-bezier(.77, 0, .175, 1);
  --rand: clamp(16px, 5vw, 72px);
  --spalt: 24px;
  --kopf-h: 64px;
  --leiste-h: 56px;
}

/* ---------- Basis ---------- */

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

html {
  background: var(--asphalt);
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--kopf-h) + 24px);
}

body {
  margin: 0;
  background: var(--asphalt);
  color: var(--kreide);
  font-family: var(--schrift);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
p, li, dd { hyphens: auto; }
p { margin: 0 0 16px; max-width: 64ch; }
p:last-child { margin-bottom: 0; }
strong { font-weight: 650; }

::selection { background: var(--signalrot); color: #fff; }
:focus-visible { outline: 2px solid var(--kreide); outline-offset: 3px; }

.skip {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  background: var(--kreide);
  color: var(--tinte);
  padding: 10px 16px;
  font-family: var(--mono);
  font-size: 14px;
}
.skip:focus { top: 16px; }

@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .2s; }

/* Typografie */

h1, h2, h3 {
  margin: 0;
  font-weight: 750;
  text-wrap: balance;
  hyphens: auto;
  hyphenate-limit-chars: 10 4 4;
}

.titel-gross {
  font-stretch: 70%;
  font-weight: 800;
  font-size: clamp(46px, 8.2vw, 124px);
  line-height: .92;
  letter-spacing: -.005em;
  text-transform: uppercase;
}

h1, .titel-seite {
  font-stretch: 70%;
  font-weight: 800;
  font-size: clamp(40px, 6.2vw, 88px);
  line-height: .94;
  text-transform: uppercase;
}

h2 {
  font-stretch: 72%;
  font-size: clamp(32px, 4.2vw, 58px);
  line-height: .98;
  text-transform: uppercase;
  max-width: 18ch;
}

h3 {
  font-stretch: 80%;
  font-weight: 700;
  font-size: clamp(20px, 1.6vw, 23px);
  line-height: 1.15;
  letter-spacing: .005em;
}

.lead { font-size: clamp(18px, 1.5vw, 21px); line-height: 1.5; max-width: 56ch; }
.klein { font-size: 15px; color: var(--kreide-2); }

.label {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--kreide-2);
  line-height: 1.5;
}
.label .nr { color: var(--rot-text); }

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* Anzugsstrich: das rote Leitmotiv */
.strich { position: relative; white-space: nowrap; }
.strich::after {
  content: "";
  position: absolute;
  left: .04em;
  bottom: -.08em;
  width: .9em;
  height: .07em;
  min-height: 3px;
  background: var(--signalrot);
  transform: skewX(-18deg);
}

/* ---------- Raster ---------- */

.wrap {
  max-width: 1320px;
  margin-inline: auto;
  padding-inline: var(--rand);
}

.raster {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--spalt);
}

.rand { grid-column: 1 / span 3; }
.inhalt { grid-column: 4 / -1; min-width: 0; }
.inhalt-schmal { grid-column: 4 / span 7; min-width: 0; }

.abschnitt {
  border-top: 1px solid var(--linie);
  padding-block: clamp(64px, 9vw, 144px);
}
.abschnitt.dicht { padding-block: clamp(48px, 20vw, 190px); }
.abschnitt.ohne-linie { border-top: 0; }

.abschnitt-kopf { display: grid; gap: 20px; margin-bottom: clamp(32px, 4vw, 56px); }

@media (max-width: 900px) {
  .rand, .inhalt, .inhalt-schmal { grid-column: 1 / -1; }
  .rand-sticky { position: static; }
}

/* ---------- Kopf ---------- */

.kopf {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--asphalt);
  border-bottom: 1px solid var(--linie);
}

.statusleiste { border-bottom: 1px solid var(--linie); }
.statusleiste .wrap {
  display: flex;
  justify-content: flex-end;
  gap: 28px;
  min-height: 34px;
  align-items: center;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--kreide-2);
  letter-spacing: .02em;
}
.statusleiste b { color: var(--kreide); font-weight: 500; }
.statusleiste a { text-decoration: none; }
.statusleiste a:hover { color: var(--kreide); }
.statusleiste .wrap > * { white-space: nowrap; }
.statusleiste .gebiet { margin-right: auto; }
@media (max-width: 1240px) { .statusleiste .gebiet { display: none; } }

.kopf-haupt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: var(--kopf-h);
}

.wortmarke {
  position: relative;
  display: inline-flex;
  align-items: flex-start;
  gap: 5px;
  padding-bottom: 6px;
  font-stretch: 68%;
  font-weight: 800;
  font-size: 26px;
  line-height: 1;
  letter-spacing: .01em;
  text-decoration: none;
  color: var(--kreide);
}
.wortmarke .og {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 10px;
  letter-spacing: .08em;
  color: var(--kreide-2);
  padding-top: 1px;
}
.wortmarke::after {
  content: "";
  position: absolute;
  left: 1px;
  bottom: 0;
  width: 22px;
  height: 3px;
  background: var(--signalrot);
  transform: skewX(-18deg);
}

.nav { display: flex; align-items: center; gap: 32px; }
.nav ul { display: flex; gap: 26px; list-style: none; margin: 0; padding: 0; }
.nav ul a {
  position: relative;
  display: inline-block;
  padding-block: 8px;
  font-stretch: 85%;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: .04em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--kreide-2);
  transition: color .15s var(--ease);
}
.nav ul a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 2px;
  width: 16px;
  height: 3px;
  background: var(--signalrot);
  transform: skewX(-18deg) scaleX(0);
  transform-origin: left;
  transition: transform .25s var(--ease);
}
.nav ul a:hover { color: var(--kreide); }
.nav ul a:hover::after { transform: skewX(-18deg) scaleX(1); }
.nav ul a[aria-current="page"] { color: var(--kreide); }
.nav ul a[aria-current="page"]::after { transform: skewX(-18deg) scaleX(1); }

.nav-kopf, .nav-kontakt, .nav-zu, .nav .nur-handy { display: none; }

/* Handyleiste unten: Menü, Anrufen, Termin */
.handyleiste { display: none; }

@media (max-width: 1080px) {
  .nav ul { gap: 18px; }
  .nav ul a { font-size: 14px; }
}

@media (max-width: 900px) {
  :root { --kopf-h: 56px; }
  body { font-size: 16px; padding-bottom: calc(var(--leiste-h) + env(safe-area-inset-bottom, 0px)); }
  .statusleiste { display: none; }
  .wortmarke { font-size: 23px; }
  .nav .kopf-termin { display: none; }

  .handyleiste {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 45;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--asphalt);
    border-top: 1px solid var(--linie-stark);
  }
  .handyleiste a {
    display: grid;
    place-items: center;
    height: var(--leiste-h);
    font-family: var(--mono);
    font-weight: 500;
    font-size: 12px;
    letter-spacing: .08em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--kreide);
    border-right: 1px solid var(--linie);
  }
  .handyleiste a:last-child { border-right: 0; background: var(--signalrot); color: #fff; }

  /* Menü als Vollbild, geöffnet über #menu (ohne JavaScript) */
  /* Offenes Menü liegt über Handyleiste und Cookie-Banner, Seite dahinter scrollt nicht mit */
  .kopf:has(.nav:target) { z-index: 90; }
  html:has(.nav:target) { overflow: hidden; }
  .nav {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: flex;
    visibility: hidden;
    clip-path: inset(0 0 100% 0);
    transition: clip-path .4s var(--ease), visibility 0s linear .4s;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    overflow-y: auto;
    background: var(--asphalt);
    padding: calc(8px + env(safe-area-inset-top, 0px)) var(--rand) calc(var(--leiste-h) + 24px + env(safe-area-inset-bottom, 0px));
  }
  .nav:target { visibility: visible; clip-path: inset(0); transition: clip-path .45s var(--ease); }
  .nav ul li, .nav-kontakt { opacity: 0; transform: translateY(18px); transition: opacity .2s var(--ease), transform .2s var(--ease); }
  .nav:target ul li, .nav:target .nav-kontakt { opacity: 1; transform: none; transition-duration: .5s; transition-delay: calc(.12s + var(--i, 0) * .05s); }
  .nav ul li:nth-child(2) { --i: 1; }
  .nav ul li:nth-child(3) { --i: 2; }
  .nav ul li:nth-child(4) { --i: 3; }
  .nav ul li:nth-child(5) { --i: 4; }
  .nav ul li:nth-child(6) { --i: 5; }
  .nav .nav-kontakt { --i: 7; }
  .nav-kopf {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: calc(var(--kopf-h) - 8px);
  }
  .nav-x {
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: .08em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--kreide);
    padding: 10px 0 10px 12px;
  }
  .nav-x span { color: var(--signalrot); margin-left: 4px; }
  .nav ul { flex-direction: column; gap: 0; border-top: 1px solid var(--linie); margin-top: 16px; }
  .nav ul li { border-bottom: 1px solid var(--linie); }
  .nav .nur-handy { display: block; }
  .nav ul a {
    display: block;
    padding: 14px 0 12px;
    font-stretch: 70%;
    font-weight: 800;
    font-size: clamp(28px, min(10vw, 6.2svh), 48px);
    line-height: 1;
    letter-spacing: 0;
    color: var(--kreide);
  }
  .nav ul a::after { bottom: 6px; width: 28px; height: 4px; }
  .nav-kontakt {
    display: grid;
    gap: 6px;
    margin-top: 28px;
    font-family: var(--mono);
    font-size: 14px;
    color: var(--kreide-2);
  }
  .nav-kontakt a { color: var(--kreide); text-decoration: none; font-size: 18px; }
  .nav-zu {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    display: grid;
    place-items: center;
    height: calc(var(--leiste-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--kreide);
    color: var(--tinte);
    font-family: var(--mono);
    font-weight: 500;
    font-size: 12px;
    letter-spacing: .08em;
    text-transform: uppercase;
    text-decoration: none;
  }
}


/* ---------- Elemente ---------- */

/* Buttons */
.knopfreihe { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; }

.knopf {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 2px;
  overflow: hidden;
  font-family: var(--schrift);
  font-stretch: 88%;
  font-weight: 650;
  font-size: 15px;
  letter-spacing: .05em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease);
}
.knopf-klein { min-height: 42px; padding: 0 16px; font-size: 13px; }

.knopf-primaer { background: var(--signalrot); color: #fff; }
.knopf-primaer::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%;
  height: 3px;
  background: #fff;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .32s var(--ease);
}
.knopf-primaer:hover { background: var(--signalrot-tief); }
.knopf-primaer:hover::after { transform: scaleX(1); }

.knopf-sekundaer { color: var(--kreide); border-color: var(--linie-stark); background: transparent; }
.knopf-sekundaer:hover { background: var(--kreide); border-color: var(--kreide); color: var(--tinte); }

.textlink {
  position: relative;
  display: inline-block;
  padding-bottom: 7px;
  font-stretch: 88%;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: .04em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--kreide);
}
.textlink::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 18px;
  height: 3px;
  background: var(--signalrot);
  transform: skewX(-18deg);
  transition: width .28s var(--ease);
}
.textlink:hover::after { width: 100%; }

/* Definitionslisten im Handbuchstil */
.spez { display: grid; grid-template-columns: minmax(120px, 220px) 1fr; margin: 0; border-top: 1px solid var(--linie); }
.spez dt, .spez dd { margin: 0; padding: 16px 0; border-bottom: 1px solid var(--linie); }
.spez dt {
  padding-top: 19px;
  padding-right: 20px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--kreide-2);
}
@media (max-width: 560px) {
  .spez { grid-template-columns: 1fr; }
  .spez dt { border-bottom: 0; padding-bottom: 2px; }
  .spez dd { padding-top: 4px; }
}

/* Bild mit Unterschrift */
.abb { margin: 0; min-width: 0; }
.abb img { width: 100%; background: var(--werkbank-2); }
.abb figcaption {
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  color: var(--kreide-2);
}
.abb figcaption b { color: var(--kreide); font-weight: 500; }

/* Schiebetür-Reveal: nur mit Scroll-Timeline, sonst einfach sichtbar */
@supports (animation-timeline: view()) {
  .tuer {
    animation: tuer linear both;
    animation-timeline: view();
    animation-range: entry 5% cover 40%;
  }
}
@keyframes tuer { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

/* ---------- Einstieg (Startseite) ---------- */

.einstieg { padding-block: clamp(40px, 7vw, 104px) 0; }
.einstieg-text { grid-column: 1 / span 6; padding-bottom: clamp(8px, 2vw, 32px); container-type: inline-size; }
.einstieg-bild { grid-column: 7 / -1; margin-right: calc(-1 * var(--rand)); overflow: hidden; background: var(--werkbank-2); }

/* Startbilder: alle 3 Sekunden nach links weiterwischen. Das dritte Bild ist eine Kopie des ersten,
   damit der Sprung zurück an den Anfang unsichtbar bleibt. */
.held-spur { display: flex; animation: held-wischen 6s infinite; }
.held-spur > img { flex: 0 0 100%; min-width: 0; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.held-spur > img:nth-child(2) { object-position: 62% 50%; }

@keyframes held-wischen {
  0%, 40% { transform: translateX(0); animation-timing-function: var(--ease-wisch); }
  50%, 90% { transform: translateX(-100%); animation-timing-function: var(--ease-wisch); }
  100% { transform: translateX(-200%); }
}
@keyframes held-blende {
  0%, 40% { opacity: 0; }
  50%, 90% { opacity: 1; }
  100% { opacity: 0; }
}

/* Schriftgröße am Textblock gemessen: „des Vertrauens!“ passt immer in eine Zeile,
   „Motorradwerkstatt“ bricht überall gleich als „Motorrad-“ / „werkstatt“. */
.einstieg h1 { margin: 20px 0 28px; font-size: clamp(28px, 13.4cqi, 96px); hyphens: manual; }
.einstieg h1 .zeile { display: block; overflow: hidden; padding-bottom: .08em; margin-bottom: -.08em; }
.einstieg h1 .zeile > span { display: block; animation: zeile-hoch .8s var(--ease) both; }
.einstieg h1 .zeile:nth-child(2) > span { animation-delay: .08s; }
.einstieg h1 .zeile:nth-child(3) > span { animation-delay: .16s; }
/* Strich in die Unterlänge holen, sonst schneidet ihn die Zeilenmaske ab */
.einstieg h1 .strich::after { bottom: .03em; animation: strich-rein .5s var(--ease) .6s both; transform-origin: left; }

@keyframes zeile-hoch { from { transform: translateY(105%); } to { transform: none; } }
@keyframes strich-rein { from { transform: skewX(-18deg) scaleX(0); } to { transform: skewX(-18deg) scaleX(1); } }

.einstieg .lead { margin-bottom: 32px; }

.datenleiste {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: clamp(40px, 6vw, 72px);
  border-top: 1px solid var(--linie-stark);
}
.datenleiste > div { padding: 18px 20px 20px 0; display: grid; gap: 4px; align-content: start; }
.datenleiste > div + div { padding-left: 20px; border-left: 1px solid var(--linie); }
.datenleiste .wert { font-family: var(--mono); font-size: 15px; color: var(--kreide); }
.datenleiste a.wert { text-decoration: none; }
.datenleiste a.wert:hover { color: var(--rot-text); }

@media (max-width: 900px) {
  .einstieg-text { grid-column: 1 / -1; order: 2; }
  .einstieg-bild { grid-column: 1 / -1; order: 1; margin-inline: calc(-1 * var(--rand)); }
  .held-spur > img { aspect-ratio: 3 / 2; }
  .einstieg { padding-top: 0; }
  .einstieg h1 { margin-top: 12px; }
  .datenleiste { grid-template-columns: 1fr 1fr; }
  .datenleiste > div:nth-child(3) { padding-left: 0; border-left: 0; }
  .datenleiste > div:nth-child(n+3) { border-top: 1px solid var(--linie); }
}
@media (max-width: 480px) {
  .datenleiste { grid-template-columns: 1fr; }
  .datenleiste > div, .datenleiste > div + div { padding: 14px 0; border-left: 0; }
  .datenleiste > div + div { border-top: 1px solid var(--linie); }
}

/* ---------- Ablauf (vier echte Schritte) ---------- */

.ablauf {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--spalt);
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: schritt;
}
.ablauf li { position: relative; padding-top: 36px; border-top: 1px solid var(--linie-stark); counter-increment: schritt; }
.ablauf li::before {
  content: counter(schritt, decimal-leading-zero);
  position: absolute;
  top: 10px;
  left: 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--rot-text);
}
.ablauf li::after {
  content: "";
  position: absolute;
  top: -5px;
  left: 0;
  width: 9px;
  height: 9px;
  background: var(--kreide);
}
.ablauf h3 { margin-bottom: 8px; }
.ablauf p { font-size: 15px; color: var(--kreide-2); }

@media (max-width: 900px) {
  .ablauf { grid-template-columns: 1fr; gap: 0; border-left: 1px solid var(--linie-stark); margin-left: 4px; }
  .ablauf li { border-top: 0; padding: 0 0 28px 28px; }
  .ablauf li:last-child { padding-bottom: 0; }
  .ablauf li::before { position: static; display: block; margin-bottom: 4px; }
  .ablauf li::after { top: 4px; left: -5px; }
}

/* ---------- Leistungsverzeichnis ---------- */

.lv { border-top: 1px solid var(--linie-stark); }
.lv-kopfzeile, .lv-zeile, .lv-details > summary {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 2fr) 110px;
  gap: 6px 28px;
  align-items: baseline;
}
.lv-kopfzeile { padding: 10px 12px 10px 22px; border-bottom: 1px solid var(--linie); }
.lv-kopfzeile span:last-child { text-align: right; }

.lv-zeile, .lv-details > summary {
  position: relative;
  padding: 18px 12px 18px 22px;
  transition: background-color .2s var(--ease);
}
.lv-zeile, .lv-details { border-bottom: 1px solid var(--linie); }
.lv-zeile::before, .lv-details > summary::before {
  content: "";
  position: absolute;
  left: 0;
  top: 29px;
  width: 12px;
  height: 3px;
  background: var(--signalrot);
  transform: skewX(-18deg) scaleX(0);
  transform-origin: left;
  transition: transform .25s var(--ease);
}
.lv-zeile:hover, .lv-details > summary:hover { background: var(--werkbank); }
.lv-zeile:hover::before, .lv-details > summary:hover::before, .lv-details[open] > summary::before { transform: skewX(-18deg) scaleX(1); }

.lv h3 { font-size: 21px; }
.lv-art { display: block; margin-top: 6px; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--kreide-3); }
.lv-text { font-size: 15px; color: var(--kreide-2); margin: 0; }
.lv-preis { text-align: right; font-family: var(--mono); font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.lv-preis small { display: block; font-size: 11px; color: var(--kreide-3); }

.lv-details > summary { cursor: pointer; list-style: none; }
.lv-details > summary::-webkit-details-marker { display: none; }
.lv-details .lv-art::after { content: " · Details +"; color: var(--kreide-2); }
.lv-details[open] .lv-art::after { content: " · schließen –"; }
.lv-details[open] > summary { background: var(--werkbank); }
.lv-mehr {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px 28px;
  padding: 8px 12px 28px 22px;
  background: var(--werkbank);
  font-size: 15px;
}
.lv-mehr h4 { margin: 0 0 6px; font-family: var(--mono); font-weight: 500; font-size: 12px; letter-spacing: .07em; text-transform: uppercase; color: var(--kreide-2); }
.lv-mehr ul { margin: 0; padding-left: 18px; }
.lv-mehr li { margin-bottom: 2px; }

@media (max-width: 700px) {
  .lv-kopfzeile { display: none; }
  .lv-zeile, .lv-details > summary { grid-template-columns: minmax(0, 1fr) auto; padding-left: 20px; padding-right: 4px; }
  .lv-text { grid-column: 1 / -1; grid-row: 2; }
  .lv-mehr { grid-template-columns: 1fr; padding-left: 20px; }
}

/* ---------- Einsatzgebiet ---------- */

.gebiet { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 72px); align-items: start; }
.gebiet svg { display: block; width: 100%; max-width: 440px; height: auto; }
.gebiet svg .ort { font-family: var(--schrift); font-stretch: 80%; font-weight: 700; font-size: 14px; fill: var(--kreide); letter-spacing: .04em; }
.gebiet svg .ort-klein { font-family: var(--schrift); font-size: 13px; fill: var(--kreide-2); }
.gebiet svg .fluss { font-family: var(--mono); font-size: 10px; fill: var(--kreide-3); }

.zonen { width: 100%; border-collapse: collapse; font-size: 15px; }
.zonen caption { text-align: left; margin-bottom: 12px; }
.zonen th, .zonen td { text-align: left; vertical-align: top; padding: 14px 16px 14px 0; border-bottom: 1px solid var(--linie); }
.zonen thead th { font-family: var(--mono); font-weight: 500; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--kreide-2); border-bottom-color: var(--linie-stark); }
.zonen tbody th { font-stretch: 80%; font-weight: 700; font-size: 18px; white-space: nowrap; }
.zonen td:last-child { font-family: var(--mono); font-size: 14px; white-space: nowrap; text-align: right; padding-right: 0; }
.zonen td:nth-child(2) { color: var(--kreide-2); }

@media (max-width: 900px) {
  .gebiet { grid-template-columns: 1fr; }
  .gebiet svg { max-width: 360px; }
}
@media (max-width: 560px) {
  .zonen thead { display: none; }
  .zonen tr { display: grid; grid-template-columns: 1fr auto; padding: 12px 0; border-bottom: 1px solid var(--linie); }
  .zonen th, .zonen td { border: 0; padding: 0; }
  .zonen td:nth-child(2) { grid-column: 1 / -1; grid-row: 2; margin-top: 4px; }
}

.orte { display: flex; flex-wrap: wrap; gap: 6px 8px; list-style: none; margin: 0; padding: 0; }
.orte li {
  padding: 5px 10px;
  border: 1px solid var(--linie-stark);
  border-radius: 2px;
  font-size: 14px;
  color: var(--kreide);
}

/* ---------- Servicewagen, Bildkomposition ---------- */

.wagen { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--spalt); align-items: start; }
.wagen .abb-gross { grid-column: 1 / span 8; margin-left: calc(-1 * var(--rand)); }
.wagen .abb-gross figcaption { margin-left: var(--rand); }
.wagen .abb-hoch-1 { grid-column: 9 / -1; margin-top: clamp(40px, 8vw, 120px); }
.wagen .abb-hoch-2 { grid-column: 5 / span 4; margin-top: 8px; }
.wagen .ausstattung { grid-column: 10 / -1; margin-top: 40px; grid-template-columns: 1fr; }
.wagen .ausstattung dt { border-bottom: 0; padding-bottom: 2px; }
.wagen .ausstattung dd { padding-top: 2px; }

@media (max-width: 900px) {
  .wagen .abb-gross { grid-column: 1 / -1; margin-inline: calc(-1 * var(--rand)); }
  .wagen .abb-hoch-1 { grid-column: 1 / span 7; margin-top: 8px; }
  .wagen .abb-hoch-2 { grid-column: 6 / -1; margin-top: 96px; }
  .wagen .ausstattung { grid-column: 1 / -1; margin-top: 16px; }
}

/* ---------- Team ---------- */

/* Zwei Spalten, die beim Scrollen die Breite tauschen: jeder kommt einmal ins Spotlight.
   Ohne Scroll-Timeline (z. B. Firefox) oder bei reduzierter Bewegung: gleich breit, ohne Effekt. */
.team { display: grid; grid-template-columns: 1fr 1fr; gap: var(--spalt); align-items: start; }
.person { margin: 0; min-width: 0; }
.person .bild { overflow: hidden; background: var(--werkbank-2); }
.person img { width: 100%; height: clamp(300px, 54vh, 620px); object-fit: cover; object-position: 50% 25%; }
.person h3 { margin: 16px 0 4px; font-size: 26px; font-stretch: 72%; font-weight: 800; text-transform: uppercase; }
.person .rolle { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--rot-text); margin-bottom: 10px; }
.person dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; margin: 12px 0 0; font-size: 15px; }
.person dt { font-family: var(--mono); font-size: 12px; color: var(--kreide-2); padding-top: 2px; }
.person dd { margin: 0; }

@media (max-width: 900px) {
  .person img { height: clamp(260px, 44vh, 460px); }
  .person h3 { font-size: 22px; }
  .person dl { grid-template-columns: 1fr; gap: 0; font-size: 14px; }
  .person dd + dt { margin-top: 6px; }
}

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    /* Sichtbarer Bereich unter der Kopfzeile (Statusleiste 34px + Rahmen) und über der Handyleiste */
    .team-buehne { --oben: calc(var(--kopf-h) + 36px); --unten: 0px; view-timeline: --team block; height: 250svh; }
    .team {
      position: sticky;
      top: var(--oben);
      height: calc(100svh - var(--oben) - var(--unten));
      align-content: center;
      animation: team-tausch linear both;
      animation-timeline: --team;
      animation-range: contain 0% contain 100%;
    }
    .person img, .person figcaption { animation: linear both; animation-timeline: --team; animation-range: contain 0% contain 100%; }
    .person-1 img { animation-name: spot-ab; }
    .person-2 img { animation-name: spot-auf; }
    .person-1 figcaption { animation-name: text-ab; }
    .person-2 figcaption { animation-name: text-auf; }
  }
  @media (prefers-reduced-motion: no-preference) and (max-width: 900px) {
    .team-buehne { --oben: calc(var(--kopf-h) + 1px); --unten: calc(var(--leiste-h) + env(safe-area-inset-bottom, 0px)); }
  }
}
@keyframes team-tausch {
  0%, 12% { grid-template-columns: 1.2fr 1fr; }
  88%, 100% { grid-template-columns: 1fr 1.2fr; }
}
@keyframes spot-ab {
  0%, 40% { filter: none; transform: none; }
  88%, 100% { filter: grayscale(.8) brightness(.6); transform: scale(1.04); }
}
@keyframes spot-auf {
  0%, 12% { filter: grayscale(.8) brightness(.6); transform: scale(1.04); }
  60%, 100% { filter: none; transform: none; }
}
@keyframes text-ab { 0%, 40% { opacity: 1; } 88%, 100% { opacity: .45; } }
@keyframes text-auf { 0%, 12% { opacity: .45; } 60%, 100% { opacity: 1; } }

/* ---------- Papier: Fahrzeugmarkt ---------- */

.papier {
  background: var(--papier);
  color: var(--tinte);
  padding-block: clamp(56px, 8vw, 128px);
}
.papier .label { color: var(--tinte-2); }
.papier .label .nr { color: var(--rot-papier); }
.papier .klein { color: var(--tinte-2); }
.papier ::selection { background: var(--tinte); color: var(--papier); }
.papier :focus-visible { outline-color: var(--tinte); }
.papier .textlink { color: var(--tinte); }
.papier .textlink::after { background: var(--rot-papier); }
.papier .knopf-sekundaer { color: var(--tinte); border-color: var(--tinte-2); }
.papier .knopf-sekundaer:hover { background: var(--tinte); color: var(--papier); border-color: var(--tinte); }

.zettel-reihe {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
  gap: clamp(28px, 3vw, 40px) clamp(20px, 2.4vw, 32px);
}
.zettel { position: relative; display: grid; gap: 12px; align-content: start; min-width: 0; }
.zettel .foto { position: relative; overflow: hidden; background: var(--papier-2); }
.zettel .foto img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: filter .25s var(--ease), transform .6s var(--ease); }
.zettel:hover .foto img { filter: brightness(1.04); transform: scale(1.04); }
.zettel .art { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--tinte-2); }
.zettel h3 { font-stretch: 72%; font-weight: 800; font-size: 25px; line-height: 1; text-transform: uppercase; }
.zettel .daten {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 14px;
  margin: 0;
  padding-top: 10px;
  border-top: 1px solid var(--papier-linie);
  font-family: var(--mono);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.zettel .daten dt { color: var(--tinte-2); }
.zettel .daten dd { margin: 0; }
.zettel .preiszeile {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px 16px;
  padding-top: 10px;
  border-top: 2px solid var(--tinte);
}
.zettel .preis { font-family: var(--mono); font-weight: 500; font-size: 22px; font-variant-numeric: tabular-nums; }
.zettel .extern {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--rot-papier);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.zettel .extern:hover { color: var(--tinte); }

.stempel {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-9deg);
  padding: 2px 14px;
  border: 3px solid var(--rot-papier);
  background: rgba(236, 232, 225, .88);
  color: var(--rot-papier);
  font-stretch: 75%;
  font-weight: 800;
  font-size: 28px;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.zettel.verkauft .foto img { filter: grayscale(1); opacity: .55; }
.zettel.verkauft .preis { text-decoration: line-through; color: var(--tinte-2); }
.zettel.reserviert .stempel { border-color: var(--tinte-2); color: var(--tinte-2); }

.papier-fuss {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px 32px;
  margin-top: clamp(40px, 5vw, 64px);
  padding-top: 24px;
  border-top: 1px solid var(--papier-linie);
}

/* ---------- Blog ---------- */

.blog-start { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--spalt); }
.beitrag-gross { grid-column: 1 / span 7; }
.beitrag-liste { grid-column: 9 / -1; list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--linie-stark); align-self: start; }

.beitrag-gross a, .beitrag-liste a { text-decoration: none; display: block; }
.beitrag-gross img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; transition: filter .25s var(--ease); }
.beitrag-gross a:hover img { filter: brightness(1.08); }
.beitrag-gross .meta, .beitrag-liste .meta { display: block; margin: 16px 0 8px; font-family: var(--mono); font-size: 12px; letter-spacing: .04em; color: var(--kreide-2); }
.beitrag-gross h3 { font-size: clamp(26px, 2.6vw, 36px); font-stretch: 72%; font-weight: 800; text-transform: uppercase; line-height: 1; margin-bottom: 10px; }
.beitrag-gross p { color: var(--kreide-2); font-size: 16px; }
.beitrag-gross a:hover h3, .beitrag-liste a:hover h3 { text-decoration: underline; text-decoration-color: var(--signalrot); text-decoration-thickness: 3px; text-underline-offset: 5px; }
.beitrag-liste li { border-bottom: 1px solid var(--linie); }
.beitrag-liste a { padding: 4px 0 20px; }
.beitrag-liste .meta { margin-top: 14px; }
.beitrag-liste h3 { font-size: 21px; }

@media (max-width: 900px) {
  .beitrag-gross, .beitrag-liste { grid-column: 1 / -1; }
  .beitrag-liste { margin-top: 16px; }
}

/* Artikel */
.artikel-kopf { padding-block: clamp(40px, 6vw, 88px) clamp(32px, 4vw, 56px); }
.artikel-kopf h1 { max-width: 16ch; margin: 16px 0 24px; }
.artikel-bild img { width: 100%; aspect-ratio: 21 / 9; object-fit: cover; }
.artikel { padding-block: clamp(48px, 6vw, 88px); }
.artikel-text { grid-column: 4 / span 6; min-width: 0; }
.artikel-text h2 { font-size: clamp(26px, 2.8vw, 36px); margin: 48px 0 16px; max-width: none; }
.artikel-text p, .artikel-text li { font-size: 18px; line-height: 1.65; }
.artikel-text ul, .artikel-text ol { padding-left: 20px; margin: 0 0 20px; max-width: 62ch; }
.artikel-text li { margin-bottom: 6px; }
.artikel-text li::marker { color: var(--rot-text); font-family: var(--mono); font-size: 14px; }
.randnotiz { grid-column: 10 / -1; min-width: 0; align-self: start; position: sticky; top: calc(var(--kopf-h) + 32px); }
.randnotiz .notiz { padding: 16px 0; border-top: 1px solid var(--linie-stark); font-family: var(--mono); font-size: 13px; line-height: 1.6; color: var(--kreide-2); }
.randnotiz .notiz b { display: block; color: var(--kreide); font-weight: 500; margin-bottom: 4px; letter-spacing: .06em; text-transform: uppercase; font-size: 12px; }
.artikel .rand { align-self: start; }

@media (max-width: 1100px) {
  .artikel-text { grid-column: 4 / -1; }
  .randnotiz { grid-column: 4 / -1; position: static; order: -1; display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
}
@media (max-width: 900px) {
  .artikel-text, .randnotiz { grid-column: 1 / -1; }
  .artikel-bild img { aspect-ratio: 3 / 2; }
}
@media (max-width: 520px) { .randnotiz { grid-template-columns: 1fr; } }

/* ---------- Formular ---------- */

.formular { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.formular .voll { grid-column: 1 / -1; }
.formular-block { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 20px 24px; padding-top: 24px; border-top: 1px solid var(--linie); }
.formular-block > .label { grid-column: 1 / -1; color: var(--kreide); }
.formular-block > .label .nr { margin-right: 8px; }

.feld { display: grid; gap: 8px; align-content: start; min-width: 0; }
.feld label, .feld legend, .feld .feld-titel {
  padding: 0;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--kreide-2);
}
.feld .optional { text-transform: none; letter-spacing: 0; color: var(--kreide-3); }

.eingabe {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  background: var(--werkbank);
  border: 1px solid var(--linie-stark);
  border-radius: 2px;
  color: var(--kreide);
  font-family: var(--schrift);
  font-size: 17px;
  line-height: 1.4;
  transition: border-color .15s var(--ease), background-color .15s var(--ease), box-shadow .15s var(--ease);
}
textarea.eingabe { min-height: 140px; resize: vertical; }
select.eingabe {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--kreide-2) 50%), linear-gradient(135deg, var(--kreide-2) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  padding-right: 40px;
}
.eingabe::placeholder { color: var(--kreide-3); }
.eingabe:hover { border-color: #6a665f; }
.eingabe:focus { outline: none; border-color: var(--kreide); background-color: var(--werkbank-2); box-shadow: inset 0 -3px 0 var(--signalrot); }
.eingabe:user-invalid { border-color: var(--fehler); }
.feld .fehlertext { display: none; font-size: 14px; color: var(--fehler); }
.eingabe:user-invalid ~ .fehlertext { display: block; }
.hilfe { font-size: 14px; color: var(--kreide-2); }

fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
/* Legende als normales Rasterelement statt auf der Rahmenlinie */
fieldset > legend { float: left; width: 100%; padding: 0; grid-column: 1 / -1; }
fieldset.feld { display: grid; gap: 10px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips label { position: relative; text-transform: none; letter-spacing: 0; font-family: var(--schrift); color: var(--kreide); font-size: 15px; }
.chips input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chips span {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--linie-stark);
  border-radius: 2px;
  cursor: pointer;
  transition: background-color .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease);
}
.chips span:hover { border-color: var(--kreide); }
.chips input:checked + span { background: var(--kreide); border-color: var(--kreide); color: var(--tinte); }
.chips input:focus-visible + span { outline: 2px solid var(--kreide); outline-offset: 2px; }

.zustimmung { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; font-size: 15px; color: var(--kreide-2); }
.zustimmung input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--signalrot); }

@media (max-width: 640px) {
  .formular, .formular-block { grid-template-columns: 1fr; }
}

/* ---------- Seitenkopf (Unterseiten) ---------- */

.seitenkopf { padding-block: clamp(40px, 6vw, 96px) clamp(40px, 5vw, 72px); }
.seitenkopf h1 { margin: 16px 0 24px; max-width: 14ch; }

/* ---------- Schluss-Abschnitt (Termin) ---------- */

.schluss h2 { max-width: 14ch; margin-bottom: 24px; }
.schluss .kontaktdaten { display: grid; gap: 18px; }
.schluss .kontaktdaten div { display: grid; gap: 2px; }
.schluss .kontaktdaten .wert { font-family: var(--mono); font-size: 16px; text-decoration: none; }
.schluss .kontaktdaten a.wert:hover { color: var(--rot-text); }

.hinweisbox {
  padding: 16px 18px;
  border: 1px solid var(--linie-stark);
  border-left: 3px solid var(--hinweis);
  font-size: 15px;
  color: var(--kreide-2);
  max-width: 64ch;
}

/* ---------- Text-Seiten (Impressum, Datenschutz, AGB) ---------- */

.rechtstext h2 { font-size: clamp(22px, 2.2vw, 28px); margin: 40px 0 12px; max-width: none; }
.rechtstext h2:first-child { margin-top: 0; }
.rechtstext p, .rechtstext li { font-size: 16px; color: var(--kreide-2); }
.rechtstext ul { padding-left: 20px; max-width: 64ch; }

/* AGB: nummerierte Punkte, Inhaltsverzeichnis am Rand */
.agb section + section { margin-top: 8px; }
/* Kopf mit Statusleiste ist höher als --kopf-h, Sprungziele sonst verdeckt */
.agb section { scroll-margin-top: 48px; }
.agb h2 .nr { color: var(--rot-text); }
.agb ol { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.agb li { display: grid; grid-template-columns: 3.4em minmax(0, 1fr); gap: 8px; }
.agb li .nr { padding-top: 3px; font-family: var(--mono); font-size: 13px; color: var(--kreide-3); font-variant-numeric: tabular-nums; }
.agb li p { margin: 0; }
.agb a { color: var(--kreide); text-underline-offset: 3px; text-decoration-color: var(--signalrot); }

.agb-inhalt {
  position: sticky;
  top: calc(var(--kopf-h) + 60px);
  max-height: calc(100dvh - var(--kopf-h) - 84px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.agb-inhalt ol { display: grid; margin: 12px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--linie); }
.agb-inhalt a {
  display: grid;
  grid-template-columns: 2.4em minmax(0, 1fr);
  padding: 6px 0;
  border-bottom: 1px solid var(--linie);
  font-size: 14px;
  line-height: 1.3;
  color: var(--kreide-2);
  text-decoration: none;
}
.agb-inhalt .nr { font-family: var(--mono); font-size: 12px; color: var(--rot-text); padding-top: 1px; }
@media (hover: hover) and (pointer: fine) {
  .agb-inhalt a:hover { color: var(--kreide); }
}
@media (max-width: 900px) {
  .agb-inhalt { position: static; max-height: none; overflow: visible; margin-bottom: 16px; }
  .agb-inhalt ol { grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); column-gap: 24px; }
  .agb-inhalt a { min-height: 44px; align-items: center; }
}
@media (max-width: 520px) {
  .agb li { grid-template-columns: 2.9em minmax(0, 1fr); gap: 6px; }
}
.platzhalter { background: rgba(224, 176, 74, .14); color: var(--hinweis); padding: 0 4px; font-family: var(--mono); font-size: .9em; }

/* ---------- Fuß ---------- */

.fuss { border-top: 1px solid var(--linie); padding-block: clamp(48px, 6vw, 88px) 40px; }
.fuss-raster { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 32px var(--spalt); }
.fuss-marke { grid-column: 1 / span 3; display: grid; gap: 16px; align-content: start; }
.fuss-spalte { grid-column: span 3; display: grid; gap: 6px; align-content: start; font-size: 15px; }
.fuss-spalte .label { margin-bottom: 6px; }
.fuss-spalte a { text-decoration: none; }
.fuss-spalte a:hover { color: var(--rot-text); }
.fuss-spalte .mono { font-size: 14px; }
.fuss-unten {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
  margin-top: clamp(40px, 5vw, 64px);
  padding-top: 20px;
  border-top: 1px solid var(--linie);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--kreide-3);
}
.fuss-unten nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.fuss-unten a { color: var(--kreide-2); text-decoration: none; }
.fuss-unten a:hover { color: var(--kreide); }

@media (max-width: 900px) {
  .fuss-marke { grid-column: 1 / -1; }
  .fuss-spalte { grid-column: span 6; }
}
@media (max-width: 520px) {
  .fuss-spalte { grid-column: 1 / -1; }
}

/* ---------- Hilfsklassen ---------- */

.abstand-oben { margin-top: clamp(32px, 4vw, 56px); }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Bewegung beim Scrollen ----------
   Reine CSS-Scroll-Timelines, kein JavaScript. Browser ohne Unterstützung zeigen alles sofort. */

.wortmarke::after { animation: strich-rein .6s var(--ease) .2s both; transform-origin: left; }

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    /* Inhalte gleiten beim Hereinscrollen sanft nach oben */
    .abschnitt-kopf, .ablauf li, .lv-zeile, .lv-details, .zettel, .beitrag-gross, .beitrag-liste li,
    .datenleiste > div, .gebiet > *, .zonen tbody tr, .orte, .spez, .schluss .kontaktdaten > div,
    .formular-block, .fuss-raster > *, .artikel-text > *, .papier-fuss {
      animation: auftauchen linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 70%;
    }
    /* Nebeneinanderliegende Elemente leicht versetzt */
    .ablauf li:nth-child(2), .zettel:nth-child(3n+2), .datenleiste > div:nth-child(2), .fuss-raster > :nth-child(2) { animation-range: entry 8% entry 78%; }
    .ablauf li:nth-child(3), .zettel:nth-child(3n+3), .datenleiste > div:nth-child(3), .fuss-raster > :nth-child(3) { animation-range: entry 16% entry 86%; }
    .ablauf li:nth-child(4), .datenleiste > div:nth-child(4), .fuss-raster > :nth-child(4) { animation-range: entry 24% entry 94%; }

    /* Roter Strich unter Abschnittstiteln zieht sich beim Hereinscrollen auf */
    .abschnitt-kopf .label .nr { display: inline-block; animation: nr-rein linear both; animation-timeline: view(); animation-range: entry 20% entry 90%; }

    /* Startbild: leichter Zoom beim Wegscrollen */
    .held-zoom { animation: bild-weg linear both; animation-timeline: scroll(root); animation-range: 0 90vh; transform-origin: 50% 30%; }

    /* Kopfzeile bekommt nach dem ersten Scrollen einen Schatten */
    .kopf { animation: kopf-schatten linear both; animation-timeline: scroll(root); animation-range: 0 160px; }
  }
}

@keyframes auftauchen { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes nr-rein { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }
@keyframes bild-weg { from { transform: none; } to { transform: scale(1.08) translateY(3%); } }
@keyframes kopf-schatten { from { box-shadow: 0 0 0 rgba(0, 0, 0, 0); } to { box-shadow: 0 10px 30px rgba(0, 0, 0, .45); } }

/* Lesefortschritt, Route, Stempel, Details: nur mit Bewegung erlaubt */
.lesefortschritt { display: none; }

@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: scroll()) {
    .lesefortschritt {
      display: block;
      position: fixed;
      top: 0; left: 0; right: 0;
      z-index: 95;
      height: 3px;
      background: var(--signalrot);
      transform-origin: left;
      animation: fortschritt linear both;
      animation-timeline: scroll(root);
    }
    .route {
      stroke-dasharray: 1;
      animation: route-zeichnen linear both;
      animation-timeline: view();
      animation-range: entry 30% cover 55%;
    }
    .stempel {
      animation: stempel-drauf linear both;
      animation-timeline: view();
      animation-range: entry 40% entry 100%;
    }
  }

  @supports selector(::details-content) {
    :root { interpolate-size: allow-keywords; }
    details::details-content {
      block-size: 0;
      overflow: hidden;
      transition: block-size .35s var(--ease), content-visibility .35s allow-discrete;
    }
    details[open]::details-content { block-size: auto; }
  }
}

@keyframes fortschritt { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes route-zeichnen { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes stempel-drauf {
  0% { opacity: 0; transform: translate(-50%, -50%) rotate(-9deg) scale(1.6); }
  70% { opacity: 1; transform: translate(-50%, -50%) rotate(-9deg) scale(.96); }
  100% { opacity: 1; transform: translate(-50%, -50%) rotate(-9deg) scale(1); }
}

/* ---------- Bewegung reduzieren ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-delay: 0s !important;
    transition-duration: .01ms !important;
  }
  .tuer { animation: none !important; }
  /* Startbilder: weich überblenden statt seitlich wischen */
  .held-spur { display: grid; animation: none !important; }
  .held-spur > img { grid-area: 1 / 1; }
  .held-spur > img:nth-child(2) { animation: held-blende 6s var(--ease-wisch) infinite !important; }
  .held-spur > img:nth-child(3) { display: none; }
  @view-transition { navigation: none; }
}

/* ---------- Formular: Fehler vom Server, Spamschutz ---------- */

.fehlertext.sichtbar { display: block; }
.fehlerbox {
  margin-bottom: 28px;
  padding: 16px 18px;
  border: 1px solid var(--fehler);
  border-left-width: 3px;
  color: var(--kreide);
  font-size: 15px;
}
.honig { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.formular > .hinweisbox { max-width: none; }

/* ---------- Cookie-Banner (ohne JavaScript) ---------- */

body.mit-cookie-banner { padding-bottom: 220px; }

.cookie-banner {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 80;
  background: var(--werkbank);
  border-top: 1px solid var(--linie-stark);
  padding-block: 20px calc(20px + env(safe-area-inset-bottom, 0px));
  max-height: 80vh;
  overflow-y: auto;
}
.cookie-inhalt { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px 40px; align-items: end; }
.cookie-text h2 { margin-bottom: 6px; max-width: none; }
.cookie-text p { font-size: 15px; color: var(--kreide-2); max-width: 78ch; }
.cookie-knoepfe { display: flex; flex-wrap: wrap; gap: 10px; }
.cookie-knoepfe .knopf { min-height: 46px; }
.cookie-details { margin-top: 10px; font-size: 15px; }
.cookie-details summary { cursor: pointer; color: var(--kreide); text-decoration: underline; text-underline-offset: 3px; width: max-content; }
.cookie-details[open] { display: grid; gap: 12px; }
.cookie-details .knopf { justify-self: start; }
.cookie-option { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; font-size: 15px; color: var(--kreide-2); max-width: 70ch; }
.cookie-option input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--signalrot); }
.cookie-option b { color: var(--kreide); font-weight: 650; display: block; }
.cookie-seite { display: grid; gap: 20px; }
.cookie-seite .cookie-option { padding-bottom: 20px; border-bottom: 1px solid var(--linie); }

@media (max-width: 900px) {
  body.mit-cookie-banner { padding-bottom: calc(var(--leiste-h) + 320px); }
  .cookie-banner { bottom: calc(var(--leiste-h) + env(safe-area-inset-bottom, 0px)); padding-bottom: 16px; }
  .cookie-inhalt { grid-template-columns: 1fr; }
  .cookie-knoepfe .knopf { flex: 1 1 140px; }
}

/* ---------- Info-Popup (im Admin gepflegt) ---------- */

html:has(.info-popup[open]) { overflow: hidden; }

.info-popup {
  width: min(560px, calc(100% - 24px));
  max-width: none;
  max-height: calc(100dvh - 24px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--linie-stark);
  border-radius: 2px;
  background: var(--werkbank);
  color: var(--kreide);
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
  opacity: 0;
  transform: translateY(12px) scale(.98);
  transition: opacity .26s var(--ease), transform .26s var(--ease), overlay .26s allow-discrete, display .26s allow-discrete;
}
.info-popup.mit-bild { width: min(1040px, calc(100% - 24px)); }
.info-popup.mit-bild:not(.mit-text) { width: min(720px, calc(100% - 24px)); }
.info-popup[open] { opacity: 1; transform: none; }
@starting-style { .info-popup[open] { opacity: 0; transform: translateY(12px) scale(.98); } }

.info-popup::backdrop {
  background: rgba(10, 9, 8, 0);
  transition: background-color .26s var(--ease), overlay .26s allow-discrete, display .26s allow-discrete;
}
.info-popup[open]::backdrop { background: rgba(10, 9, 8, .8); }
@starting-style { .info-popup[open]::backdrop { background: rgba(10, 9, 8, 0); } }

/* Leiste bleibt beim Scrollen oben, damit Schließen immer erreichbar ist */
.info-popup-leiste {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 2px 4px 2px 20px;
  background: var(--werkbank);
  border-bottom: 1px solid var(--linie);
}
.info-popup-leiste form { margin: 0; }
.info-popup-zu {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 16px;
  border: 0;
  background: none;
  color: var(--kreide);
  font-family: var(--mono);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.info-popup-zu span { color: var(--signalrot); font-size: 15px; }
.info-popup-zu:focus-visible { outline-offset: -6px; }
@media (hover: hover) and (pointer: fine) {
  .info-popup-zu:hover { color: var(--rot-text); }
}

/* Schmal: erst der Text, dann die Fotos, damit Titel und Button sofort zu sehen sind */
.info-popup-inhalt { display: grid; }
.info-popup-text { order: -1; }
.info-popup-bilder { display: grid; gap: 2px; background: var(--asphalt); }
.info-popup-bilder a { display: block; }
.info-popup-bilder img {
  width: 100%;
  max-height: 70dvh;
  object-fit: contain;
  background: var(--asphalt);
}

.info-popup-text { display: grid; gap: 18px; align-content: start; padding: clamp(22px, 4vw, 40px); }
.info-popup-text h2 { font-size: clamp(30px, 3.6vw, 46px); max-width: none; overflow-wrap: anywhere; }
.info-popup-text p { margin: 0; }
.info-popup-fliesstext { display: grid; gap: 12px; color: var(--kreide-2); font-size: 16px; }
.info-popup-fliesstext h2, .info-popup-fliesstext h3 { font-size: 20px; font-stretch: 80%; color: var(--kreide); max-width: none; text-transform: none; line-height: 1.2; }
.info-popup-fliesstext strong { color: var(--kreide); }
.info-popup-fliesstext ul, .info-popup-fliesstext ol { margin: 0; padding-left: 1.2em; }
.info-popup-fliesstext a { color: var(--kreide); text-underline-offset: 3px; text-decoration-color: var(--signalrot); }
.info-popup-text .knopf { margin-top: 4px; }

/* Breit genug: Foto links, Text rechts. Der Text bleibt stehen, wenn mehrere Fotos durchgescrollt werden. */
@media (min-width: 820px) {
  .info-popup.mit-bild.mit-text .info-popup-inhalt { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
  .info-popup.mit-bild.mit-text .info-popup-bilder { border-right: 1px solid var(--linie); }
  .info-popup.mit-bild.mit-text .info-popup-bilder img { max-height: calc(100dvh - 24px - 54px); }
  .info-popup.mit-bild.mit-text .info-popup-text { order: 0; position: sticky; top: 53px; align-self: start; }
}
