/* Webseitensache – Gestaltung nach DESIGN.md. Mobil zuerst. */

@font-face {
  font-family: "Fraunces";
  src: url("../assets/fonts/fraunces-var.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --papier: #F7F7FB;
  --weiss: #FFFFFF;
  --tinte: #14142B;
  --tinte-weich: #4A4A68;
  --linie: #DCDDEB;
  --blau: #2540D9;
  --blau-tief: #1B2FA8;
  --lila: #6D3BD6;
  --rot: #D42145;
  --rot-dunkel: #B81B3A;
  --rot-gedrueckt: #A81A37;
  --nacht: #0D0D24;
  --nebel: #C9CBE6;
  --himmel: #A9B4FF;

  --schrift-kopf: "Fraunces", Georgia, "Times New Roman", serif;
  --schrift-text: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --gr-titel: clamp(2.375rem, 1.55rem + 3.7vw, 4.5rem);
  --gr-abschnitt: clamp(1.875rem, 1.45rem + 1.9vw, 3rem);
  --gr-zwischen: clamp(1.375rem, 1.33rem + 0.2vw, 1.5rem);
  --gr-ziffer: clamp(3rem, 2.4rem + 2.6vw, 4.5rem);
  --gr-vorspann: clamp(1.1875rem, 1.12rem + 0.3vw, 1.375rem);
  --gr-text: 1.0625rem;
  --gr-klein: 1rem;

  --rand: 20px;
  --abschnitt: 72px;
  --kopfzeile: 64px;
  --kurve: cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (min-width: 768px) {
  :root { --rand: 32px; --abschnitt: 96px; }
}
@media (min-width: 1100px) {
  :root { --rand: 48px; --abschnitt: 144px; }
}

/* ---------- Grundlagen ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--kopfzeile) + 16px);
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  background: var(--papier);
  color: var(--tinte);
  font-family: var(--schrift-text);
  font-size: var(--gr-text);
  line-height: 1.65;
  overflow-wrap: break-word;
}

h1, h2, h3, p, ol, ul, figure, address { margin: 0; }
ol, ul { padding: 0; list-style: none; }
address { font-style: normal; }
img { display: block; max-width: 100%; height: auto; }
main { flex: 1 0 auto; }

h1, h2, h3 {
  font-family: var(--schrift-kopf);
  font-weight: 560;
  letter-spacing: -0.015em;
  text-wrap: balance;
  hyphens: manual;
}
h1 { font-size: var(--gr-titel); line-height: 1.06; }
h2 { font-size: var(--gr-abschnitt); line-height: 1.12; }
h3 { font-size: var(--gr-zwischen); line-height: 1.25; }

a { color: var(--blau); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--blau-tief); }

:focus-visible {
  outline: 3px solid var(--blau);
  outline-offset: 3px;
  border-radius: 2px;
}

.huelle {
  width: 100%;
  max-width: calc(1120px + 2 * var(--rand));
  margin-inline: auto;
  padding-inline: var(--rand);
}

.nur-vorlesen {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.sprung {
  position: absolute;
  left: 8px; top: 8px;
  z-index: 100;
  padding: 12px 16px;
  background: var(--weiss);
  color: var(--tinte);
  font-weight: 600;
  border-radius: 8px;
  transform: translateY(-200%);
}
.sprung:focus { transform: none; }

/* ---------- Buttons ---------- */

.knopf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 8px 24px;
  border: 1.5px solid transparent;
  border-radius: 8px;
  font: 600 var(--gr-klein)/1.2 var(--schrift-text);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}
.knopf svg { flex: none; transition: transform 160ms ease; }
.knopf:hover svg { transform: translateX(4px); }
.knopf:active { transform: translateY(1px); }

.knopf--haupt { background: var(--rot); color: var(--weiss); }
.knopf--haupt:hover { background: var(--rot-dunkel); color: var(--weiss); }
.knopf--haupt:active { background: var(--rot-gedrueckt); }

/* Auf dunklem Bild bekommt der rote Button einen weißen Rand,
   damit seine Form mindestens 3:1 zum Hintergrund hat (WCAG 1.4.11). */
.einstieg .knopf--haupt,
.js .kopf--ueber:not(.ist-fest) .knopf--haupt { border-color: var(--weiss); }

.knopf--linie { background: transparent; color: var(--weiss); border-color: var(--weiss); }
.knopf--linie:hover { background: var(--weiss); color: var(--blau); }

.knopf--klein { min-height: 44px; padding-inline: 20px; }

/* ---------- Kopfzeile ---------- */

.kopf {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--kopfzeile);
  background: var(--papier);
  box-shadow: 0 1px 0 var(--linie), 0 8px 24px rgba(20, 20, 43, 0.06);
  transition: background-color 200ms ease, box-shadow 200ms ease;
}
.kopf__innen {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 100%;
}
.schriftzug {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--schrift-kopf);
  font-weight: 600;
  font-size: 1.3125rem;
  letter-spacing: -0.01em;
  color: var(--tinte);
  text-decoration: none;
  transition: color 200ms ease;
}
.schriftzug:hover { color: var(--blau); }

/* Startseite: Kopfzeile liegt über dem dunklen Einstieg (nur mit JavaScript). */
.kopf--ueber { position: fixed; left: 0; right: 0; }
.js .kopf--ueber:not(.ist-fest) { background: transparent; box-shadow: none; }
.js .kopf--ueber:not(.ist-fest) .schriftzug { color: var(--weiss); }
.js .kopf--ueber:not(.ist-fest) :focus-visible { outline-color: var(--weiss); }

/* ---------- Einstieg ---------- */

.einstieg {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 100vh;
  min-height: 100svh;
  padding-top: calc(var(--kopfzeile) + 48px);
  padding-bottom: 72px;
  background: var(--nacht);
  color: var(--weiss);
  overflow: hidden;
  isolation: isolate;
}
.einstieg__bild {
  position: absolute;
  inset: 0;
  z-index: -3;
  background: linear-gradient(135deg, var(--blau), var(--lila));
  overflow: hidden;
}
.einstieg__formen,
.einstieg__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.einstieg__formen { transform: scale(1.08); }

/* Der eine bewegte Verlauf Blau→Lila. */
.einstieg__verlauf {
  position: absolute;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  opacity: 0.38;
}
.einstieg__verlauf::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 200%;
  background: linear-gradient(90deg, var(--blau) 0%, var(--lila) 25%, var(--blau) 50%, var(--lila) 75%, var(--blau) 100%);
  will-change: transform;
}

/* Überlagerung: mindestens 62 % Nacht, im Textbereich bis 86 %. */
.einstieg__schatten {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to top, rgba(13, 13, 36, 0.86) 0%, rgba(13, 13, 36, 0.7) 55%, rgba(13, 13, 36, 0.62) 100%);
}

.einstieg__kenn {
  font-size: var(--gr-klein);
  font-weight: 600;
  letter-spacing: 0.01em;
}
.einstieg h1 { max-width: 11em; margin-top: 16px; }
.einstieg__text {
  max-width: 34em;
  margin-top: 24px;
  font-size: var(--gr-vorspann);
  line-height: 1.5;
}
.einstieg .knopf { margin-top: 32px; }
.einstieg :focus-visible { outline-color: var(--weiss); }

/* Bewegung anhalten (WCAG 2.2.2). Erscheint nur, wenn sich etwas bewegt. */
[hidden] { display: none !important; }
.pause {
  position: absolute;
  right: var(--rand);
  bottom: 12px;
  min-height: 44px;
  padding: 8px 4px;
  border: 0;
  background: transparent;
  color: var(--weiss);
  font: 400 var(--gr-klein)/1.2 var(--schrift-text);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  cursor: pointer;
}
html.bewegung-aus .einstieg__verlauf::before,
html.bewegung-aus .einstieg__formen { animation-play-state: paused; }

/* ---------- Abschnitte ---------- */

.abschnitt { padding-block: var(--abschnitt); }
.abschnitt + .abschnitt--hell { border-top: 1px solid var(--linie); }

.kenn {
  display: block;
  margin-bottom: 16px;
  font-size: var(--gr-klein);
  font-weight: 600;
  color: var(--lila);
}
.vorspann {
  max-width: 34em;
  font-size: var(--gr-vorspann);
  line-height: 1.5;
}
.abschnitt__kopf { margin-bottom: 32px; }
.abschnitt__kopf h2 { max-width: 14em; }

@media (min-width: 1100px) {
  .raster {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: 24px;
  }
  .raster > .abschnitt__kopf { grid-column: 1 / span 5; margin-bottom: 0; }
  .raster > .abschnitt__inhalt { grid-column: 7 / span 6; }
}

/* Für wen */

.faelle { margin-top: 32px; border-top: 1px solid var(--linie); }
.faelle li { padding-block: 24px; border-bottom: 1px solid var(--linie); }
.faelle p { max-width: 36em; margin-top: 8px; color: var(--tinte-weich); }

/* Selbst gezeichnete Bänder, frei auf dem Papier. */
.formbild { margin-top: 48px; }
.formbild svg {
  display: block;
  width: 100%;
  max-width: 240px;
  height: auto;
  margin-inline: auto;
}
@media (min-width: 1100px) {
  .faelle li { padding-block: 32px; }
  .formbild svg { max-width: 280px; margin-inline: 0; }
}

/* Ablauf */

.schritte {
  position: relative;
  display: grid;
  gap: 48px;
  padding-left: 32px;
}
.schritte::before {
  content: "";
  position: absolute;
  left: 3px; top: 24px; bottom: 8px;
  width: 2px;
  background: linear-gradient(to bottom, var(--blau), var(--lila));
}
.schritt { position: relative; }
.schritt::before {
  content: "";
  position: absolute;
  left: -32px; top: 20px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--blau);
  box-shadow: 0 0 0 6px var(--papier);
}
.schritt:nth-child(3)::before { background: var(--lila); }
.schritt__ziffer {
  display: block;
  font-family: var(--schrift-kopf);
  font-weight: 400;
  font-size: var(--gr-ziffer);
  line-height: 1;
  color: var(--blau);
}
.schritt h3 { margin-top: 16px; }
.schritt p { max-width: 30em; margin-top: 8px; color: var(--tinte-weich); }

@media (min-width: 900px) {
  .schritte {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px;
    padding-left: 0;
    padding-top: 40px;
  }
  .schritte::before {
    left: 0; right: 0; top: 3px; bottom: auto;
    width: auto; height: 2px;
    background: linear-gradient(to right, var(--blau), var(--lila));
  }
  .schritt::before { left: 0; top: -40px; }
  .schritt p { padding-right: 16px; }
}

.ablauf .abschnitt__kopf { margin-bottom: 48px; }
@media (min-width: 1100px) {
  .ablauf .abschnitt__kopf { margin-bottom: 72px; }
}

/* Preis */

.preis { background: var(--blau); color: var(--weiss); }
.preis .kenn { color: var(--weiss); }
.preis p { max-width: 34em; }
.preis p + p { margin-top: 16px; }
.preis .knopf { margin-top: 32px; }
.preis :focus-visible { outline-color: var(--weiss); }

/* Kontakt */

.kontakt .vorspann { color: var(--tinte); }
.kontakt .knopf { margin-top: 32px; }
.kontakt__adresse { margin-top: 32px; color: var(--tinte-weich); }
.kontakt__hinweis { max-width: 34em; margin-top: 8px; color: var(--tinte-weich); }
.kontakt__hinweis a { display: inline-flex; align-items: center; min-height: 44px; }
.kontakt__adresse strong { display: block; color: var(--tinte); font-weight: 600; font-size: var(--gr-vorspann); }

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

.fuss {
  padding-block: 48px;
  background: var(--nacht);
  color: var(--nebel);
  font-size: var(--gr-klein);
}
.fuss__innen {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.fuss__name {
  font-family: var(--schrift-kopf);
  font-weight: 600;
  font-size: 1.3125rem;
  color: var(--weiss);
}
.fuss ul { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.fuss a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--himmel);
}
.fuss a:hover { color: var(--weiss); }
.fuss :focus-visible { outline-color: var(--weiss); }

@media (min-width: 768px) {
  .fuss__innen { flex-direction: row; align-items: center; justify-content: space-between; }
}

/* ---------- Rechtstexte ---------- */

.rechtstext { padding-block: 48px var(--abschnitt); }
.rechtstext h1 { font-size: var(--gr-abschnitt); line-height: 1.12; hyphens: auto; }
.rechtstext h2 { font-size: var(--gr-zwischen); line-height: 1.25; margin-top: 48px; }
.rechtstext h3 { font-family: var(--schrift-text); font-size: var(--gr-text); font-weight: 600; letter-spacing: 0; margin-top: 24px; }
.rechtstext p, .rechtstext ul, .rechtstext address { max-width: 40em; margin-top: 16px; }
.rechtstext ul { padding-left: 1.25em; list-style: disc; }
.rechtstext li + li { margin-top: 8px; }
.rechtstext .stand { color: var(--tinte-weich); }
.rechtstext .hervorgehoben { padding-left: 16px; border-left: 3px solid var(--blau); font-weight: 600; }

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

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }

  /* Nur mit JavaScript: dann gibt es auch den Knopf zum Anhalten. */
  .js .einstieg__verlauf::before { animation: verlauf-zieht 36s linear infinite; }
  .js .einstieg__formen { animation: bild-atmet 30s ease-in-out infinite alternate; }

  .einblenden { transition: opacity 600ms var(--kurve), transform 600ms var(--kurve); }
  .einblenden.wartet { opacity: 0; transform: translateY(16px); }
}

@keyframes verlauf-zieht {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@keyframes bild-atmet {
  from { transform: scale(1.08) translate3d(0, 0, 0); }
  to { transform: scale(1.2) translate3d(-2.5%, 1.5%, 0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  .einstieg__video { display: none; }
}

@media print {
  .kopf, .pause, .einstieg__bild, .einstieg__verlauf, .einstieg__schatten { display: none; }
  .einstieg { min-height: 0; color: #000; background: none; }
}

/* Für wen am Desktop: Bild unter der Überschrift in der linken Spalte. */
@media (min-width: 1100px) {
  .fuer-wen .raster { grid-template-rows: auto 1fr; }
  .fuer-wen .abschnitt__inhalt { grid-row: 1 / span 2; }
  .fuer-wen .formbild { grid-column: 1 / span 4; grid-row: 2; align-self: end; margin-top: 32px; }
}
