/* Lernpfad – Projektseite. Keine externen Ressourcen (Schriften und Bilder liegen lokal). */

@font-face { font-family: "Andika"; src: url("fonts/andika_regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Andika"; src: url("fonts/andika_bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Fredoka"; src: url("fonts/fredoka.ttf") format("truetype"); font-weight: 300 700; font-display: swap; }

:root {
  --primaer: #6c4ce0;
  --primaer-dunkel: #4b32b0;
  --primaer-hell: #e8e1ff;
  --sekundaer: #ff8a65;
  --hintergrund: #fff8ee;
  --flaeche: #ffffff;
  --text: #2b2540;
  --text-leise: #5c566f;
  --rand: #e9e3f2;
  --richtig: #2e9e5b;
  --richtig-hell: #ddf6e6;
  --hinweis: #e08a00;
  --hinweis-hell: #fff0d6;
  --deutsch: #ef5b5b;
  --mathe: #3c8dff;
  --sach: #2fae6a;
  --englisch: #9b5de5;
  --ethik: #f29a1f;
  --radius: 20px;
  --breite: 1080px;
}

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

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

body {
  margin: 0;
  font-family: "Andika", system-ui, sans-serif;
  font-size: 1.125rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--hintergrund);
}

h1, h2, h3 { font-family: "Fredoka", "Andika", sans-serif; line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 600; }
h2 { font-size: clamp(1.7rem, 3.5vw, 2.3rem); font-weight: 600; }
h3 { font-size: 1.3rem; font-weight: 600; }
p { margin: 0 0 1em; }
a { color: var(--primaer-dunkel); }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--primaer); outline-offset: 3px; border-radius: 4px; }

.skip { position: absolute; left: -999px; top: 0; background: var(--primaer-dunkel); color: #fff; padding: .6rem 1rem; z-index: 10; }
.skip:focus { left: 0; }

.wrap { width: min(100% - 2.5rem, var(--breite)); margin-inline: auto; }
section { padding: 4rem 0; }
section.alt { background: var(--flaeche); border-block: 1px solid var(--rand); }
.lead { font-size: 1.25rem; color: var(--text-leise); max-width: 46rem; }
.klein { font-size: .95rem; color: var(--text-leise); }

/* Kopf */
header.site { background: var(--flaeche); border-bottom: 1px solid var(--rand); }
header.site .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1.5rem; padding-block: .8rem; }
.marke { font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 1.4rem; color: var(--primaer); text-decoration: none; }
nav ul { display: flex; flex-wrap: wrap; gap: .25rem 1.2rem; list-style: none; margin: 0; padding: 0; }
nav a { text-decoration: none; color: var(--text); padding: .25rem 0; }
nav a:hover { color: var(--primaer-dunkel); text-decoration: underline; }

/* Hero */
.hero { padding: 3.5rem 0 4rem; }
.hero .wrap:first-child { display: grid; grid-template-columns: 1.3fr 1fr; gap: 2rem; align-items: center; }
.hero h1 span { color: var(--primaer); }
.hero picture { justify-self: center; }
.hero img { display: block; width: 100%; max-width: 340px; }
.knoepfe { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.5rem; }
.knopf { display: inline-block; padding: .75rem 1.4rem; border-radius: 999px; background: var(--primaer); color: #fff; text-decoration: none; font-weight: 700; border: 2px solid var(--primaer); }
.knopf:hover { background: var(--primaer-dunkel); border-color: var(--primaer-dunkel); }
.knopf.zweit { background: transparent; color: var(--primaer-dunkel); }
.knopf.zweit:hover { background: var(--primaer-hell); }

.zahlen { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-top: 2.5rem; padding: 0; list-style: none; }
.zahlen li { background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius); padding: 1rem 1.2rem; }
.zahlen strong { display: block; font-family: "Fredoka", sans-serif; font-size: 2rem; color: var(--primaer); line-height: 1.1; }

/* Karten */
.raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.2rem; margin-top: 2rem; }
.karte { background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius); padding: 1.4rem; }
section.alt .karte { background: var(--hintergrund); }
.karte h3 { margin-bottom: .4em; }
.karte p:last-child { margin-bottom: 0; }

.faecher { display: flex; flex-wrap: wrap; gap: .6rem; padding: 0; list-style: none; margin: 1.5rem 0 0; }
.faecher li { padding: .4rem 1rem; border-radius: 999px; font-weight: 700; color: var(--text); border: 2px solid var(--c); background: color-mix(in srgb, var(--c) 14%, #fff); }

.schritte { counter-reset: s; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; padding: 0; list-style: none; margin: 2rem 0 0; }
.schritte li { counter-increment: s; background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius); padding: 1.2rem 1.2rem 1.2rem 3.6rem; position: relative; }
.schritte li::before { content: counter(s); position: absolute; left: 1rem; top: 1rem; width: 2rem; height: 2rem; border-radius: 50%; background: var(--primaer); color: #fff; display: grid; place-items: center; font-family: "Fredoka", sans-serif; font-weight: 600; }
.schritte strong { display: block; }

.spalten { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: start; }
.liste-haken, .liste-nein { padding: 0; list-style: none; margin: 0 0 1em; }
.liste-haken li, .liste-nein li { padding-left: 1.7rem; position: relative; margin-bottom: .45rem; }
.liste-haken li::before { content: "✓"; position: absolute; left: 0; color: var(--richtig); font-weight: 700; }
.liste-nein li::before { content: "–"; position: absolute; left: .2rem; color: var(--text-leise); font-weight: 700; }

/* Lehrgang-Zeitleiste */
.stufen { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-top: 2rem; padding: 0; list-style: none; }
.stufen li { background: var(--flaeche); border: 1px solid var(--rand); border-top: 6px solid var(--primaer); border-radius: var(--radius); padding: 1rem 1.2rem; }
.stufen .tage { font-size: .9rem; color: var(--text-leise); }
.buchstaben { font-family: "Andika", sans-serif; font-weight: 700; font-size: 1.35rem; letter-spacing: .12em; color: var(--primaer-dunkel); margin: .2rem 0; }

/* Abzeichen */
.abzeichen { display: inline-block; padding: .25rem .8rem; border-radius: 999px; font-size: .9rem; font-weight: 700; background: var(--hinweis-hell); color: #7a4b00; border: 2px solid var(--hinweis); vertical-align: middle; }
.abzeichen.fertig { background: var(--richtig-hell); color: #1d6b3d; border-color: var(--richtig); }

/* KI-Tutor */
#tutor { background: linear-gradient(180deg, #f3eeff 0%, var(--hintergrund) 100%); }
.hinweis-kasten { background: var(--hinweis-hell); border: 2px solid var(--hinweis); border-radius: var(--radius); padding: 1rem 1.3rem; margin: 1.5rem 0; }
.hinweis-kasten p:last-child { margin: 0; }

.leitplanken { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.2rem; margin-top: 2rem; padding: 0; list-style: none; }
.leitplanken li { background: var(--flaeche); border: 1px solid var(--rand); border-left: 6px solid var(--primaer); border-radius: var(--radius); padding: 1.2rem 1.4rem; }
.leitplanken h3 { margin-bottom: .3em; }
.leitplanken p { margin: 0; }
.herkunft { display: inline-block; margin-top: .6rem; font-size: .85rem; color: var(--text-leise); }

.ablauf { display: flex; flex-wrap: wrap; align-items: stretch; gap: .6rem; margin: 2rem 0 0; padding: 0; list-style: none; }
.ablauf li { flex: 1 1 150px; background: var(--flaeche); border: 2px solid var(--primaer-hell); border-radius: 16px; padding: .8rem 1rem; text-align: center; position: relative; font-size: 1rem; }
.ablauf li strong { display: block; color: var(--primaer-dunkel); }
.ablauf li.sperre { border-color: var(--primaer); background: var(--primaer-hell); }
.ablauf li:not(:last-child)::after { content: "→"; position: absolute; right: -.8rem; top: 50%; transform: translateY(-50%); color: var(--primaer); font-weight: 700; z-index: 1; }

.dialog { display: grid; gap: .7rem; margin-top: 1.2rem; }
.dialog p { margin: 0; padding: .7rem 1rem; border-radius: 16px; max-width: 34rem; }
.dialog .kind { background: var(--primaer-hell); justify-self: end; border-bottom-right-radius: 4px; }
.dialog .tutor { background: var(--flaeche); border: 1px solid var(--rand); border-bottom-left-radius: 4px; }
.dialog .system { background: transparent; font-size: .9rem; color: var(--text-leise); padding: 0 .3rem; font-style: italic; }

.einsatz { width: 100%; border-collapse: collapse; margin-top: 1.5rem; background: var(--flaeche); border-radius: var(--radius); overflow: hidden; }
.einsatz th, .einsatz td { text-align: left; padding: .8rem 1rem; border-bottom: 1px solid var(--rand); vertical-align: top; }
.einsatz thead th { background: var(--primaer-hell); font-family: "Fredoka", sans-serif; }
.einsatz tr:last-child td { border-bottom: 0; }
.tabelle-scroll { overflow-x: auto; }

/* Status */
.status { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; margin-top: 2rem; }
.status ul { padding-left: 1.2rem; margin: 0; }
.status li { margin-bottom: .4rem; }

footer { padding: 2.5rem 0; background: var(--text); color: #e8e4f2; font-size: .95rem; }
footer a { color: #fff; }
footer .wrap { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem; }
footer h2 { font-size: 1.1rem; color: #fff; }

@media (max-width: 760px) {
  .hero .wrap:first-child, .spalten { grid-template-columns: 1fr; }
  .hero picture { order: -1; }
  .hero img { max-width: 220px; }
  section { padding: 3rem 0; }
  .ablauf li:not(:last-child)::after { content: "↓"; right: 50%; top: auto; bottom: -1.05rem; transform: translateX(50%); }
  .ablauf li { flex-basis: 100%; }
  .ablauf { gap: 1.2rem; }
}

/* ---------- Animationen ----------
   Inhalte sind ohne JavaScript sichtbar. Erst wenn seite.js die Klasse "js" setzt,
   werden Elemente mit .zeige beim Scrollen eingeblendet.
   Bei "Bewegung reduzieren" läuft nichts davon. */

@media (prefers-reduced-motion: no-preference) {
  .hero h1 span { background: linear-gradient(90deg, var(--primaer), var(--sekundaer), var(--primaer)); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: farblauf 8s linear infinite; }
  @keyframes farblauf { to { background-position: -200% 0; } }

  .hero .wrap > div > * { animation: hoch .7s cubic-bezier(.2, .8, .2, 1) both; }
  .hero .wrap > div > :nth-child(2) { animation-delay: .1s; }
  .hero .wrap > div > :nth-child(3) { animation-delay: .2s; }
  .hero .wrap > div > :nth-child(4) { animation-delay: .3s; }
  @keyframes hoch { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

  .schweben { animation: schweben 5s ease-in-out infinite; }
  @keyframes schweben { 50% { transform: translateY(-10px) rotate(1.5deg); } }

  .js .zeige { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s cubic-bezier(.2, .8, .2, 1); transition-delay: calc(var(--i, 0) * 80ms); }
  .js .zeige.sichtbar { opacity: 1; transform: none; }

  .karte, .stufen li, .zahlen li, .schritte li, .leitplanken li { transition: transform .25s ease, box-shadow .25s ease; }
  .karte:hover, .stufen li:hover, .zahlen li:hover, .schritte li:hover, .leitplanken li:hover { transform: translateY(-4px); box-shadow: 0 10px 24px rgba(108, 76, 224, .14); }
  .js .zeige.sichtbar:hover { transform: translateY(-4px); }

  .knopf { transition: transform .2s ease, background .2s ease; }
  .knopf:hover { transform: translateY(-2px) scale(1.03); }

  .faecher li { transition: transform .2s ease; }
  .faecher li:hover { transform: rotate(-3deg) scale(1.08); }

  .schritte li::before { transition: transform .4s ease; }
  .schritte li:hover::before { transform: rotate(360deg) scale(1.1); }

  /* Safeguard-Schritt pulsiert leicht, damit man ihn im Ablauf findet */
  .ablauf li.sperre { animation: puls 2.8s ease-in-out infinite; }
  @keyframes puls { 0%, 100% { box-shadow: 0 0 0 0 rgba(108, 76, 224, .35); } 50% { box-shadow: 0 0 0 10px rgba(108, 76, 224, 0); } }
  .ablauf li:not(:last-child)::after { animation: pfeil 1.6s ease-in-out infinite; }
  @keyframes pfeil { 50% { transform: translate(4px, -50%); } }

  /* Beispiel-Dialog baut sich nacheinander auf */
  .js .dialog.sichtbar > p { animation: blase .5s ease both; }
  .js .dialog.sichtbar > p:nth-child(2) { animation-delay: .5s; }
  .js .dialog.sichtbar > p:nth-child(3) { animation-delay: 1.4s; }
  .js .dialog.sichtbar > p:nth-child(4) { animation-delay: 2.4s; }
  .js .dialog > p { opacity: 0; }
  .js .dialog.sichtbar > p { opacity: 1; }
  @keyframes blase { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: none; } }

  .zeigerleiste { position: fixed; inset: 0 0 auto 0; height: 4px; z-index: 20; background: linear-gradient(90deg, var(--primaer), var(--sekundaer)); transform-origin: 0 50%; transform: scaleX(var(--fortschritt, 0)); }
}

@media (prefers-reduced-motion: reduce) {
  .zeigerleiste { display: none; }
}

/* Lange Hinweise in Tabellen: keine Pillenform */
td .abzeichen { border-radius: 14px; line-height: 1.4; padding: .3rem .8rem; }
