:root {
  --bg: #170b16;
  --surface: #1f1220;
  --surface-2: #2a1a28;
  --border: #3a2438;
  --border-soft: #2a1a28;
  --pink: #e0559c;
  --pink-light: #ff9fc0;
  --violet: #7c5cd6;
  --violet-light: #b39bf0;
  --text: #ffffff;
  --text-dim: #b7a8b6;
  --text-dimmer: #9585a0;
  --gradient: linear-gradient(100deg, #ff6f91, var(--pink) 50%, var(--violet));

  --cat-kinder: #1a6aad;       --cat-kinder-bg: #0d2035;
  --cat-jugendliche: #ad2121;  --cat-jugendliche-bg: #1c0a0a;
  --cat-erwachsene: #2a7a2a;   --cat-erwachsene-bg: #0a1a0a;
  --cat-gemischt: #7a3a7a;     --cat-gemischt-bg: #1a1218;

  --font: "Space Grotesk", system-ui, -apple-system, sans-serif;
  --max-width: 720px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Startseite: Story-Swipe-Layout (volle Bildschirmhöhe, horizontales Scrollen).
   Andere Seiten (Impressum, Datenschutz) bleiben normale, scrollbare Dokumente. */
body.stories-page {
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; display: block; }
a { color: var(--pink-light); }
button { font-family: inherit; }

.grad-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Nav ---------- */

.site-header {
  flex: 0 0 auto;
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(23, 11, 22, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-soft);
}

.site-nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo { display: flex; align-items: center; text-decoration: none; }
.logo__img { height: 40px; width: auto; display: block; border-radius: 6px; }

.nav-toggle {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: none;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.nav-links {
  position: fixed;
  top: 62px;
  left: 0;
  right: 0;
  height: calc(100vh - 62px);
  background: var(--bg);
  border-top: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  padding: 20px;
  gap: 6px;
  transform: translateY(-8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
  z-index: 15;
}

.nav-links.is-open { opacity: 1; transform: translateY(0); pointer-events: auto; }

.nav-links a {
  color: var(--text);
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  padding: 12px 8px;
  border-bottom: 1px solid var(--border-soft);
}

/* ---------- Story-Fortschrittsbalken ---------- */

main {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.story-progress {
  flex: 0 0 auto;
  display: flex;
  gap: 4px;
  padding: 10px 14px 8px;
  position: relative;
  z-index: 10;
  background: var(--bg);
}

.story-progress__seg {
  flex: 1;
  height: 3px;
  border-radius: 3px;
  background: var(--border);
  border: none;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  position: relative;
}

.story-progress__seg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}

.story-progress__seg.is-active::after,
.story-progress__seg.is-done::after {
  transform: scaleX(1);
}

/* ---------- Slides (horizontal) ---------- */

.stories-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
}

.stories {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.stories::-webkit-scrollbar { display: none; }

.story-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(23, 11, 22, 0.65);
  backdrop-filter: blur(4px);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 12;
}

.story-nav-btn--prev { left: 8px; }
.story-nav-btn--next { right: 8px; }
.story-nav-btn[hidden] { display: none; }

/* Auf Touch-Geräten übernimmt die native Wisch-Geste die Navigation */
@media (hover: none) and (pointer: coarse) {
  .story-nav-btn { display: none; }
}

/* ---------- Panels ---------- */

.panel {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  padding: 32px 20px 48px;
  position: relative;
}

.panel__inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.panel--intro {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.panel--intro .glow {
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 92, 214, 0.35), transparent 70%);
  filter: blur(10px);
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
}

.panel--intro .badge {
  position: relative;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--text-dimmer);
  text-transform: uppercase;
  margin-bottom: 20px;
}

.panel--intro h1 {
  position: relative;
  font-size: clamp(2.2rem, 9vw, 3.2rem);
  font-weight: 700;
  line-height: 1.1;
  margin: 0;
}

.panel--intro .scroll-hint {
  position: relative;
  margin-top: 36px;
  font-size: 12px;
  color: var(--text-dimmer);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.panel--intro .scroll-hint--desktop { display: none; }

.panel--pitch { text-align: center; }
.panel--pitch p {
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-dim);
  margin: 0 0 28px;
}

.button-primary {
  display: inline-flex;
  align-items: center;
  background: var(--gradient);
  color: var(--bg);
  font-weight: 700;
  font-size: 14px;
  padding: 15px 26px;
  border-radius: 8px;
  text-decoration: none;
  border: none;
  cursor: pointer;
}

.button-secondary {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  margin-top: 16px;
  padding-left: 14px;
}

.button-secondary::before {
  content: '';
  position: absolute;
  left: 0;
  top: 1px;
  bottom: 1px;
  width: 3px;
  border-radius: 2px;
  background: var(--gradient);
}

/* ---------- Section titles ---------- */

.panel__title {
  font-size: clamp(1.6rem, 6vw, 2rem);
  font-weight: 700;
  margin: 0 0 6px;
}

.panel__intro-text {
  color: var(--text-dim);
  font-size: 14px;
  margin: 0 0 24px;
  line-height: 1.6;
}

/* ---------- Kurse ---------- */

.tabs { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }

.tab-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 999px;
  cursor: pointer;
}

.tab-btn[aria-selected="true"] {
  background: var(--gradient);
  border-color: transparent;
  color: var(--bg);
}

.tab-panel { display: none; }
.tab-panel.is-active { display: block; }

.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.course-card {
  display: block;
  width: 100%;
  appearance: none;
  margin: 0;
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 16px 16px 22px;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: default;
}

.course-card--bookable { cursor: pointer; }

.course-card--bookable::before {
  content: '';
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 4px;
  border-radius: 4px;
  background: var(--gradient);
}

.course-card__name { font-weight: 700; font-size: 14.5px; margin-bottom: 4px; }
.course-card__meta { color: var(--text-dim); font-size: 12px; line-height: 1.5; }
.course-card__cta { display: inline-block; margin-top: 8px; font-size: 12px; color: var(--pink-light); font-weight: 600; }

/* ---------- Stundenplan ---------- */

.schedule-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.schedule-legend__item { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-dim); }
.schedule-legend__dot { width: 9px; height: 9px; border-radius: 2px; flex-shrink: 0; }

.schedule-day-title { margin: 0 0 12px; font-size: 16px; }

.schedule-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }

.schedule-entry {
  display: block;
  width: 100%;
  appearance: none;
  margin: 0;
  border: none;
  border-left: 3px solid var(--text-dimmer);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  text-align: left;
  color: inherit;
  cursor: default;
  font-size: 13px;
  line-height: 1.5;
}

.schedule-entry--bookable { cursor: pointer; }

.schedule-entry__time { font-weight: 700; display: block; }
.schedule-entry__course { display: block; }
.schedule-entry__meta { display: block; color: var(--text-dimmer); font-size: 11.5px; }
.schedule-entry__cta { display: inline-block; margin-top: 6px; font-size: 11.5px; font-weight: 700; }

.schedule-entry--kinder { border-color: var(--cat-kinder); background: var(--cat-kinder-bg); color: #90c8f0; }
.schedule-entry--jugendliche { border-color: var(--cat-jugendliche); background: var(--cat-jugendliche-bg); color: #f09090; }
.schedule-entry--erwachsene { border-color: var(--cat-erwachsene); background: var(--cat-erwachsene-bg); color: #90c890; }
.schedule-entry--gemischt { border-color: var(--cat-gemischt); background: var(--cat-gemischt-bg); color: #d0a0d0; }

.schedule-empty { color: var(--text-dimmer); text-align: center; font-size: 12px; }

/* ---------- Trainer ---------- */

.trainer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }

.trainer-card {
  display: block;
  width: 100%;
  appearance: none;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  text-align: center;
}

.trainer-card__avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--gradient);
  color: var(--bg);
  font-weight: 700;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px;
}

.trainer-card__name { font-weight: 700; font-size: 14px; }

.tr-modal__body { padding: 24px 20px 28px; text-align: center; }
.tr-modal__avatar { width: 72px; height: 72px; font-size: 26px; }
.tr-modal__name { font-weight: 700; font-size: 17px; margin-top: 4px; }
.tr-modal__bio { margin: 14px 0 0; color: var(--text-dim); font-size: 13.5px; line-height: 1.6; text-align: left; }

/* ---------- Closing CTA ---------- */

.panel--closing {
  background: var(--gradient);
  color: var(--bg);
  text-align: center;
}

.panel--closing .panel__title { color: var(--bg); }
.panel--closing p { color: rgba(23, 11, 22, 0.75); margin: 0 0 24px; }

.panel--closing .button-primary {
  background: var(--bg);
  color: var(--text);
}

/* ---------- Footer (in Closing-Slide gefaltet) ---------- */

.site-footer {
  border-top: 1px solid rgba(23, 11, 22, 0.2);
  margin-top: 36px;
  padding-top: 20px;
}

.site-footer__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  font-size: 12px;
  color: rgba(23, 11, 22, 0.7);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.site-footer__inner a { color: rgba(23, 11, 22, 0.85); }

.site-footer__links { display: flex; gap: 14px; justify-content: center; }
.site-footer__links a { text-decoration: none; font-weight: 600; }
.site-footer__links a:hover { text-decoration: underline; }

/* ---------- NimbusCloud modal ---------- */

.lm-modal-bg {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 999;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.lm-modal-bg.is-open { display: flex; }

.lm-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.lm-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-soft);
}

.lm-modal__title { font-weight: 700; font-size: 16px; }

.lm-modal__close {
  background: none;
  border: none;
  color: var(--text-dimmer);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
}

.lm-modal__body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.lm-modal__body iframe { width: 100%; min-height: 500px; border: none; display: block; }

/* ---------- Desktop: klassischer One-Pager statt Story-Swipe ---------- */

@media (min-width: 881px) {
  body.stories-page {
    height: auto;
    overflow: visible;
    display: block;
  }

  .story-progress,
  .story-nav-btn {
    display: none;
  }

  main {
    display: block;
  }

  .stories-wrap {
    position: static;
    display: block;
  }

  .stories {
    display: block;
    overflow: visible;
    scroll-snap-type: none;
    height: auto;
  }

  .panel {
    flex: initial;
    width: auto;
    height: auto;
    min-height: 100vh;
    overflow-y: visible;
    scroll-snap-align: none;
    scroll-snap-stop: normal;
    padding: 96px 32px;
  }

  .panel--intro {
    height: auto;
    min-height: 90vh;
  }

  .panel--intro .scroll-hint--mobile { display: none; }
  .panel--intro .scroll-hint--desktop { display: flex; }
}
