/* Agil verstehen. Farben, Schriften und Kopfzeile aus wfl-landingpage/static/css/wfl.css,
   damit die Seite als Familie der WFL erkennbar ist. */

@font-face { font-family: "Bricolage"; src: url("fonts/bricolage-grotesque-var.woff2") format("woff2-variations"); font-weight: 400 800; font-display: swap; }
@font-face { font-family: "Literata"; src: url("fonts/literata-var.woff2") format("woff2-variations"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Literata"; src: url("fonts/literata-italic-var.woff2") format("woff2-variations"); font-weight: 400 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("fonts/ibm-plex-mono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --tinte: #1d2d35;
  --text: #33454e;
  --gedimmt: #5d6f78;
  --signal: #2e7788;
  --signal-satt: #1f5a68;
  --grund: #ffffff;
  --brett: #f1f4f5;
  --linie: #dae0e2;

  --display: "Bricolage", "Helvetica Neue", Arial, sans-serif;
  --lesen: "Literata", Georgia, serif;
  --mono: "Plex Mono", ui-monospace, Menlo, monospace;

  --kopf: 3rem;
  --rand: clamp(1.25rem, 4vw, 3rem);
  --bild-schmal: 36svh;
  /* Raster: eine Inhaltsbreite. Kopf, Text, Bild und Fuß teilen dieselben Kanten. */
  --breite: 76rem;
  --seite: max(var(--rand), calc((100% - var(--breite)) / 2));
}
@media (prefers-color-scheme: dark) {
  :root {
    --tinte: #e6edf1;
    --text: #c2cdd3;
    --gedimmt: #8a9aa2;
    --signal: #5aa8bd;
    --signal-satt: #8bcadb;
    --grund: #141c21;
    --brett: #0f171b;
    --linie: #26343b;
  }
}

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

html {
  overflow-x: clip;
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  /* Jede Szene rastet ein. Eine Szene ist ein Bildschirm. */
  scroll-snap-type: y mandatory;
  scroll-padding-top: calc(var(--kopf) + var(--bild-schmal));
}
body {
  margin: 0;
  background: var(--grund);
  color: var(--text);
  font: 400 1.0625rem/1.7 var(--lesen);
  -webkit-font-smoothing: antialiased;
}
/* Sehr große Schirme: alles wächst mit, statt in der Mitte klein zu bleiben. */
@media (min-width: 110rem) { html { font-size: 112.5%; } }
@media (min-width: 140rem) { html { font-size: 131.25%; } }

a { color: var(--signal-satt); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--signal); }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; border-radius: 2px; }

/* ------------------------------------------------------------- Kopf
   Eine Zeile: Weg zurück, Kapitel, Zähler, Sprache. Die Unterkante füllt sich mit dem Fortschritt. */

.kopf {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 10;
  height: var(--kopf);
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 0 var(--seite);
  background: color-mix(in srgb, var(--grund) 90%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--linie);
  font: 400 .8125rem/1.5 var(--mono);
  color: var(--gedimmt);
}
.kopf > * { white-space: nowrap; flex-shrink: 0; }
.kopf a { color: var(--gedimmt); text-decoration: none; }
.kopf a:hover { color: var(--signal-satt); }
.marke { color: var(--tinte) !important; }
.marke:hover { color: var(--signal-satt) !important; }

.ort { flex: 1 1 0; min-width: 0; display: flex; gap: .75rem; }
.ort .sep { color: var(--linie); }
.ort .kapitel { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.ort .zaehler { margin-left: auto; font-variant-numeric: tabular-nums; }

.kopf a.sprache {
  padding: .15rem .45rem;
  border: 1px solid var(--gedimmt);
  border-radius: 3px;
  letter-spacing: .06em;
  color: var(--text);
}
.kopf a.sprache:hover { border-color: var(--signal); color: var(--signal-satt); }

/* Fortschritt als Linie: die Unterkante des Kopfs füllt sich. */
.fortschritt {
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
}
.fortschritt i {
  position: absolute;
  inset: 0;
  background: var(--signal);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .5s cubic-bezier(.4, 0, .2, 1);
}

/* ------------------------------------------------------------- Bühne */

body { padding-top: var(--kopf); }

/* ------------------------------------------------------------- Start
   Erste Folie: kein Kreis, volle Breite, Text an der Kante des Kopfs. */

/* Erste Folie: nur Text, mittig. Der Kopf ist ausgeblendet und erscheint erst beim Weiterscrollen. */
.start {
  margin-top: calc(-1 * var(--kopf));
  min-height: 100svh;
  padding: 2rem var(--rand) 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}
/* Der Block steht mittig, der Text darin linksbündig. Zentrierter Fließtext liest sich schlecht. */
.start-innen { max-width: 42rem; margin-block: auto; }
.start h1 { margin-bottom: 1.75rem; }
.start p { margin: 0 0 1em; font-size: clamp(1.0625rem, 1rem + .4vw, 1.3rem); text-wrap: pretty; }
.start .gruss { margin-top: 2rem; font-style: italic; }
.start .anstoss { flex-direction: column; gap: .35rem; margin: 1.5rem 0 0; }

.kopf { transition: opacity .6s ease, transform .6s ease; }
.js .am-start .kopf { opacity: 0; transform: translateY(-.5rem); pointer-events: none; }

.bild {
  position: sticky;
  top: var(--kopf);
  z-index: 2;
  height: var(--bild-schmal);
  margin: 0;
  background: var(--brett);
  display: flex;
  align-items: center;
  justify-content: center;
}
.bild svg { width: 100%; height: 100%; padding: .5rem; }

.schritt {
  min-height: calc(100svh - var(--kopf) - var(--bild-schmal));
  padding: 1.5rem var(--rand) 2rem;
  scroll-snap-align: start;
  /* Ein Wisch, eine Szene. Kein Durchrauschen auf dem Handy. */
  scroll-snap-stop: always;
  transition: opacity .25s ease;
}
/* Abgedunkelt wird nur, wenn kreis.js läuft und die aktive Szene hervorhebt.
   Ohne Skript oder nach einem Fehler darin bleibt jeder Text voll lesbar. Siehe vorlage.html. */
.js .schritt { opacity: .15; }
.js .schritt.aktiv { opacity: 1; }
/* Ohne Skript gibt es keinen Kreis. Die leere Fläche fällt weg. */
html:not(.js) .bild { display: none; }
.schritt > * { max-width: 32rem; }

@media (min-width: 60rem) {
  html { scroll-padding-top: var(--kopf); }
  /* Zwei Hälften: links weiß mit Text, rechts grau mit Kreis. Die Grenze ist die Mitte.
     Der Text beginnt an derselben Kante wie der Kopf. */
  .buehne {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .schritte {
    grid-column: 1;
    grid-row: 1;
    padding-left: max(var(--rand), calc((100vw - var(--breite)) / 2));
    padding-right: clamp(2rem, 4vw, 5rem);
  }
  .bild {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
    height: calc(100svh - var(--kopf));
  }
  .bild svg { padding: 2rem var(--rand); }
  .schritt {
    min-height: calc(100svh - var(--kopf));
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem 0;
  }
}

/* ------------------------------------------------------------- Text */

h1, h2 {
  margin: 0 0 1.25rem;
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -.02em;
  color: var(--tinte);
  text-wrap: balance;
}
h1 { font-size: clamp(2.25rem, 1.4rem + 3.6vw, 3.5rem); letter-spacing: -.03em; }
h2 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.35rem); }
.schritt p { margin: 0 0 1em; }
.schritt p:last-of-type { margin-bottom: 0; }

.weiter {
  margin: 2rem 0 0;
  padding: 1rem 0 0;
  border-top: 1px solid var(--linie);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .35rem 1rem;
  font: 500 .9375rem/1.4 var(--display);
}
.weiter dt { color: var(--gedimmt); }
.weiter dd { margin: 0; }
.weiter a { text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--signal) 45%, transparent); }
.weiter a:hover { border-bottom-color: var(--signal); }

.schritt .anstoss {
  margin: 2.5rem 0 0;
  font: 500 .9375rem/1.4 var(--display);
  color: var(--gedimmt);
  display: flex;
  align-items: center;
  gap: .6rem;
}
.anstoss { font: 500 .9375rem/1.4 var(--display); color: var(--gedimmt); display: flex; align-items: center; gap: .6rem; }
.anstoss svg { width: 1.25rem; height: 1.25rem; stroke: var(--signal); animation: tippen 1.8s ease-in-out infinite; }
@keyframes tippen { 0%, 100% { transform: translateY(0); opacity: 1; } 50% { transform: translateY(6px); opacity: .5; } }

/* ------------------------------------------------------------- Kreis */

#kreis .strich {
  fill: none;
  stroke-width: 22;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke .5s ease, opacity .5s ease, stroke-dashoffset .9s cubic-bezier(.4, 0, .2, 1);
}
#kreis .text { font-family: var(--display); transition: fill .5s ease, opacity .5s ease; }
#kreis .knoten { font-weight: 700; font-size: 50px; letter-spacing: -.01em; }
#kreis .beschriftung { font-weight: 500; font-size: 28px; }
#kreis .frage { font-weight: 800; font-size: 110px; }

#kreis .c-tinte  { stroke: var(--tinte);  fill: var(--tinte); }
#kreis .c-akzent { stroke: var(--signal); fill: var(--signal); }
#kreis .c-leise  { stroke: var(--linie);  fill: var(--gedimmt); }
#kreis .strich.c-tinte, #kreis .strich.c-akzent, #kreis .strich.c-leise { fill: none; }
#kreis .weg { opacity: 0; }
#kreis .strich.punkt { stroke-width: 10; }
/* Gepunktet und leise: dunkler als ein leiser Vollstrich, sonst verschwinden die Punkte auf dem Grau. */
#kreis .strich.c-leise.punkt { stroke: var(--gedimmt); opacity: .55; }
/* Sonst gewinnt die Zeile darüber, und ein gepunkteter Bogen bleibt nach „weg“ stehen. */
#kreis .strich.c-leise.punkt.weg { opacity: 0; }
/* Bezug: Wort im Text hovern, der Teil im Kreis leuchtet auf. Der Rest tritt zurück.
   cursor: pointer braucht iOS: Sonst schickt Safari den Klick nicht bis zum document weiter. */
.bezug { text-decoration: underline dotted var(--signal); text-decoration-thickness: 2px; text-underline-offset: .2em; cursor: pointer; -webkit-tap-highlight-color: transparent; border-radius: .15em; transition: color .2s ease, background-color .2s ease; }
.bezug:hover, .bezug:focus-visible, .bezug.an { color: var(--signal-satt); background: var(--brett); outline: none; }
/* Zurücktreten über die Farbe, nicht über Deckkraft. Sonst sieht man, wo Bogen und Pfeilspitze sich überlappen. */
#kreis.fokus .strich:not(.weg):not(.hervor) { stroke: var(--linie); }
#kreis.fokus .text:not(.weg):not(.hervor) { fill: var(--linie); stroke: var(--linie); }
#kreis .strich.hervor { stroke: var(--signal); }
#kreis .text.hervor { fill: var(--signal); stroke: var(--signal); }
#kreis .puls { fill: var(--brett); opacity: 0; transition: opacity .4s ease; }
#kreis .puls.an { opacity: 1; }

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

.fuss {
  scroll-snap-align: end;
  position: relative;
  z-index: 3;
  background: var(--grund);
  border-top: 1px solid var(--linie);
  padding: 1.5rem var(--rand);
}
/* Eine Zeile: Rückweg links, Rechtliches rechts. Die Türen in die WFL stehen auf der Schlussfolie darüber. */
.fuss-innen {
  max-width: var(--breite);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.5rem;
  font: 400 .85rem/1.4 var(--display);
  color: var(--gedimmt);
}
.fuss a { color: var(--gedimmt); text-decoration: none; }
.fuss a:hover { color: var(--signal-satt); }
.fuss .zurueck { margin-right: auto; color: var(--tinte); }

@media (max-width: 30rem) {
  .lang { display: none; }
  body { font-size: 1rem; line-height: 1.6; }
  /* Handy: etwas weniger Luft, damit eine Szene unter dem Kreis Platz hat. */
  :root { --bild-schmal: 34svh; }
  .weiter { margin-top: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  #kreis .strich, #kreis .text, .schritt, .fortschritt i, .kopf { transition: none; }
  /* Kopf erscheint ohne Schieben. Die Bögen hält kreis.js an, das CSS erreicht element.animate() nicht. */
  .js .am-start .kopf { transform: none; }
  #kreis .puls, .anstoss svg { animation: none; }
}


/* ------------------------------------------------------------- Kapitelanfang und Einwand */

.kapitelname {
  margin: 0 0 .9rem;
  font: 600 .9375rem/1.3 var(--display);
  color: var(--signal-satt);
}
.einwand .kapitelname { color: var(--gedimmt); }
.einwand h2 { font-weight: 600; }
.fehlt { color: var(--gedimmt); font-style: italic; }

/* ------------------------------------------------------------- Zwischenfolie
   Vor einem Kapitel: nur der Kapitelname, waagrecht und senkrecht mittig, über die volle Breite.
   Sie liegt in der Textspalte, ist aber so breit wie das Fenster und deckt den Kreis ab. */

.zwischen {
  position: relative;
  z-index: 4;
  width: 100vw;
  min-height: calc(100svh - var(--kopf));
  /* Schmal: oben bündig unter dem Kopf, damit sie auch das Bild über dem Text verdeckt.
     Der Abstand unten in Bildhöhe läuft hinter dem Bild durch. Ohne ihn läge das Ende der Folie
     über dem Kreis, sobald die nächste Szene einrastet. */
  scroll-margin-top: calc(-1 * var(--bild-schmal));
  margin-bottom: var(--bild-schmal);
  padding: 2rem var(--rand);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--grund);
  scroll-snap-align: start;
  scroll-snap-stop: always;
}
.zwischen h2 {
  margin: 0;
  max-width: 20ch;
  font-size: clamp(2.5rem, 1.6rem + 4vw, 4.5rem);
  letter-spacing: -.03em;
}
@media (min-width: 60rem) {
  .zwischen {
    margin-left: calc(-1 * max(var(--rand), calc((100vw - var(--breite)) / 2)));
    scroll-margin-top: 0;
    margin-bottom: 0;
  }
}

/* ------------------------------------------------------------- Schlussfolie
   Technik der Zwischenfolie: volle Breite, deckt den Kreis ab. Satz wie die Startfolie: Block mittig,
   Text linksbündig. Statt Lesen und Hören stehen Türen in die WFL, je eine Zeile mit zwei Zielen. */

.zwischen.schluss { text-align: left; margin-bottom: 0; }
.schluss-innen { width: 100%; max-width: 42rem; }
.zwischen.schluss h2 {
  max-width: none;
  margin-bottom: 1.25rem;
  font-size: clamp(2.25rem, 1.4rem + 3.6vw, 3.5rem);
}
.schluss p { margin: 0 0 1.5rem; font-size: clamp(1.0625rem, 1rem + .4vw, 1.3rem); text-wrap: pretty; }
/* Tabelle mit kurzen Linktexten (Kapitel 3, NBAK10). So passen sechs Türen auch auf ein kleines Handy. */
.tueren { width: 100%; border-collapse: collapse; font: 500 .9375rem/1.4 var(--display); }
.tueren th, .tueren td {
  padding: .6rem 1rem .6rem 0;
  text-align: left;
  vertical-align: baseline;
  border-bottom: 1px solid var(--linie);
}
.tueren th:last-child, .tueren td:last-child { padding-right: 0; }
.tueren thead th { font-weight: 500; color: var(--gedimmt); }
.tueren tbody th { font-weight: 600; color: var(--tinte); }
.tueren td { white-space: nowrap; }
.tueren a { text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--signal) 45%, transparent); }
.tueren a:hover { border-bottom-color: var(--signal); }
