/* =====================================================================
   Basis — nur MECHANIK, keine Identität.
   Hier steht, was auf jeder Demo gleich funktionieren muss: Zurücksetzen,
   Menü, Formularfelder, Handleiste, Bewegungsverzicht. Farbe, Schrift und
   Layout gehören der einzelnen Demo und stehen in ihrer `stil.css`.
   Alles hier greift auf Variablen zu, die die Demo setzt.
   ===================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  overflow-x: clip;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  overflow-x: clip;
  padding-bottom: 4.3rem;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
}
a {
  color: inherit;
}
h1,
h2,
h3,
h4 {
  margin: 0;
  text-wrap: balance;
}
p {
  margin: 0 0 1.1em;
  text-wrap: pretty;
}
p:last-child {
  margin-bottom: 0;
}

.mass {
  width: 100%;
  max-width: var(--mass);
  margin-inline: auto;
  padding-inline: var(--rand);
}
.eng {
  max-width: 44rem;
}
.mass.eng {
  max-width: var(--mass);
}
.mass.eng > * {
  max-width: 44rem;
}
.abschnitt {
  padding-block: var(--luft);
}
.trenner {
  height: 1px;
  border: 0;
  margin: 0;
  background: var(--linie);
}

/* ---------- Bilder --------------------------------------------------- */

.bild {
  position: relative;
  margin: 0;
  overflow: hidden;
  background: var(--flaeche);
}
.bild img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.r-21x9 {
  aspect-ratio: 21 / 9;
}
.r-16x9 {
  aspect-ratio: 16 / 9;
}
.r-3x2 {
  aspect-ratio: 3 / 2;
}
.r-4x3 {
  aspect-ratio: 4 / 3;
}
.r-1x1 {
  aspect-ratio: 1 / 1;
}
.r-4x5 {
  aspect-ratio: 4 / 5;
}
.r-3x4 {
  aspect-ratio: 3 / 4;
}
.r-hoch {
  aspect-ratio: 2 / 3;
}

/* ---------- Knöpfe --------------------------------------------------- */

.knopf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 3rem;
  padding: 0.8rem 1.5rem;
  border: 1px solid transparent;
  border-radius: var(--rundung, 2px);
  font-family: var(--grotesk);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.25s var(--weich), color 0.25s var(--weich),
    border-color 0.25s var(--weich), transform 0.25s var(--weich);
}
.knopf:focus-visible {
  outline: 2px solid var(--akzent);
  outline-offset: 3px;
}
.knopf-voll {
  background: var(--akzent);
  color: var(--auf-akzent);
}
.knopf-voll:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}
.knopf-linie {
  border-color: color-mix(in oklch, currentColor 32%, transparent);
}
.knopf-linie:hover {
  border-color: currentColor;
  background: color-mix(in oklch, currentColor 8%, transparent);
  transform: translateY(-2px);
}

/* ---------- Rückbalken und Kopf --------------------------------------- */

.rueckbalken {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 2.9rem;
  padding: 0.55rem 1rem;
  background: var(--balken, #0c0d10);
  color: color-mix(in oklch, white 78%, transparent);
  font-family: var(--grotesk);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
}
.rueckbalken:hover {
  color: white;
}

.kopf {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in oklch, var(--kopf-grund, var(--grund)) 90%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--linie);
}
.kopf-in {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 4rem;
  padding-block: 0.6rem;
}
.marke {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 2.9rem;
  margin-right: auto;
  text-decoration: none;
}
.menue {
  display: none;
}
.kopf .knopf {
  display: none;
}

.burger {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 2.9rem;
  height: 2.9rem;
  padding: 0;
  border: 1px solid var(--linie);
  border-radius: var(--rundung, 2px);
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.burger span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.3s var(--weich), opacity 0.2s;
}
.burger span + span {
  margin-top: 5px;
}
.burger[aria-expanded='true'] span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}
.burger[aria-expanded='true'] span:nth-child(2) {
  opacity: 0;
}
.burger[aria-expanded='true'] span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

.vorhang {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  align-content: center;
  padding: 5rem var(--rand) 2rem;
  background: var(--vorhang-grund, #0c0d10);
  color: var(--vorhang-tinte, #fff);
  transform: translateY(-100%);
  transition: transform 0.5s var(--weich);
  overflow-y: auto;
}
.vorhang[data-offen='ja'] {
  transform: translateY(0);
}
.vorhang > a {
  display: block;
  padding: 0.85rem 0;
  border-bottom: 1px solid color-mix(in oklch, currentColor 20%, transparent);
  font-family: var(--anzeige, var(--grotesk));
  font-size: 1.85rem;
  line-height: 1.15;
  text-decoration: none;
}
.vorhang > a[aria-current='page'] {
  color: var(--akzent);
}
.vorhang > .knopf {
  margin-top: 1.4rem;
  width: 100%;
  border-bottom: 0;
}
.vorhang-schluss {
  margin-top: 1.6rem;
  font-family: var(--grotesk);
  font-size: 0.92rem;
  opacity: 0.75;
}

/* ---------- Formular -------------------------------------------------- */

.formular {
  display: grid;
  gap: 1.15rem;
}
.feld {
  display: grid;
  gap: 0.4rem;
}
.feld > label {
  font-family: var(--grotesk);
  font-size: 0.86rem;
  font-weight: 600;
}
.feld input,
.feld select,
.feld textarea {
  width: 100%;
  min-height: 3rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--feld-linie, var(--linie));
  border-radius: var(--rundung, 2px);
  background: var(--feld-grund, var(--grund));
  color: var(--feld-tinte, var(--tinte));
  font-family: var(--grotesk);
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.feld textarea {
  min-height: 7rem;
  resize: vertical;
}
.feld input::placeholder,
.feld textarea::placeholder {
  color: color-mix(in oklch, var(--feld-tinte, var(--tinte)) 55%, transparent);
}
.feld input:focus-visible,
.feld select:focus-visible,
.feld textarea:focus-visible {
  outline: none;
  border-color: var(--akzent);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--akzent) 25%, transparent);
}
.feld[data-fehler] input,
.feld[data-fehler] select,
.feld[data-fehler] textarea {
  border-color: oklch(0.6 0.2 27);
}
.feld .fehler {
  display: none;
  font-family: var(--grotesk);
  font-size: 0.82rem;
  color: oklch(0.62 0.2 27);
}
.feld[data-fehler] .fehler {
  display: block;
}
.feld-paar {
  display: grid;
  gap: 1.15rem;
}
.formular .knopf {
  width: 100%;
  margin-top: 0.3rem;
}

.danke {
  display: none;
  padding: clamp(1.8rem, 5vw, 2.6rem);
  border: 1px solid var(--akzent);
  border-radius: var(--rundung, 2px);
  background: var(--flaeche);
}
.danke[data-an='ja'] {
  display: block;
}
.danke svg {
  color: var(--akzent);
}
.danke h3 {
  margin: 1rem 0 0.5rem;
}
.haken {
  stroke-dasharray: 48;
}
.danke[data-an='ja'] .haken {
  animation: haken 0.7s var(--weich) 0.1s both;
}
@keyframes haken {
  from {
    stroke-dashoffset: 48;
  }
  to {
    stroke-dashoffset: 0;
  }
}

/* ---------- Fragen (Aufklappen) ---------------------------------------- */

details.frage {
  border-bottom: 1px solid var(--linie);
}
details.frage summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.4rem;
  padding: 0.9rem 0;
  font-family: var(--grotesk);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
details.frage summary::-webkit-details-marker {
  display: none;
}
details.frage summary::after {
  content: '+';
  font-size: 1.4rem;
  line-height: 1;
  color: var(--akzent);
}
details.frage[open] summary::after {
  content: '\2013';
}
details.frage p {
  margin: 0 0 1.2rem;
  max-width: 62ch;
  opacity: 0.85;
}

/* ---------- Handleiste -------------------------------------------------- */

.handleiste {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 45;
  display: flex;
  gap: 0.5rem;
  padding: 0.55rem 0.7rem calc(0.55rem + env(safe-area-inset-bottom));
  background: color-mix(in oklch, var(--leiste-grund, var(--grund)) 94%, transparent);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--linie);
  color: var(--leiste-tinte, var(--tinte));
}
.handleiste .knopf {
  flex: 1;
  min-height: 3rem;
  padding-inline: 0.5rem;
  font-size: 0.94rem;
}

/* ---------- Fuss --------------------------------------------------------- */

.fuss-raster {
  display: grid;
  gap: 2.2rem;
}
.fuss h4 {
  margin: 0 0 0.8rem;
  font-family: var(--grotesk);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.6;
}
.fuss ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.fuss li a,
.fuss .zeile a {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 2.75rem;
  min-width: 2.75rem;
  text-decoration: none;
}
.fuss-schluss {
  margin-top: 2.2rem;
  padding-top: 1.4rem;
  border-top: 1px solid color-mix(in oklch, currentColor 18%, transparent);
  font-size: 0.84rem;
  opacity: 0.7;
}

/* ---------- Bewegungsverzicht -------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (min-width: 46rem) {
  .feld-paar {
    grid-template-columns: 1fr 1fr;
  }
  .fuss-raster {
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 3rem;
  }
}

@media (min-width: 56rem) {
  .menue {
    display: flex;
    gap: 1.7rem;
    margin-right: 1.5rem;
  }
  .menue a {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    font-family: var(--grotesk);
    font-size: 0.94rem;
    text-decoration: none;
    border-bottom: 1.5px solid transparent;
    opacity: 0.72;
  }
  .menue a:hover {
    opacity: 1;
  }
  .menue a[aria-current='page'] {
    opacity: 1;
    border-bottom-color: var(--akzent);
  }
  .kopf .knopf {
    display: inline-flex;
    min-height: 2.75rem;
    padding-inline: 1.2rem;
    font-size: 0.92rem;
  }
  .handleiste {
    display: none;
  }
  body {
    padding-bottom: 0;
  }
  .fuss li a {
    min-height: 2rem;
  }
}

/* `display: grid` schlaegt das hidden-Attribut — deshalb ausdruecklich. */
[hidden] {
  display: none !important;
}

/* ---------- Sprungmarke ---------------------------------------------------
   Ohne sie muss ein Tastaturbesucher auf jeder Seite durch das ganze
   Kopfmenü tabben, bevor er beim Inhalt ankommt (WCAG 2.4.1). */

.sprung {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 300;
  display: inline-flex;
  align-items: center;
  min-height: 2.9rem;
  white-space: nowrap;
  padding: 0.6rem 1.1rem;
  background: #0b0b0c;
  color: #fff;
  font-size: 0.94rem;
  font-weight: 600;
  text-decoration: none;
  border: 2px solid var(--akzent);
  transition: top 0.18s var(--weich, ease-out);
}
/* Bewusst :focus statt :focus-visible — die Marke soll auch auftauchen,
   wenn der Fokus programmatisch dorthin gesetzt wird. */
.sprung:focus {
  top: 0.5rem;
}
@media (prefers-reduced-motion: reduce) {
  .sprung { transition: none; }
}
