/* GOOGLE FONTS  */
@import url('https://fonts.googleapis.com/css2?family=Parkinsans:wght@300..800&display=swap');


/* CSS VARIABLES */
:root {
  /* Background tones */
    --bg: #ffffff;
    --surface: #f4f3fb;
    --surface2: #e9e7f7;
    --border: #d1cdea;

  /* Text */
    --text: #121212;
    --muted: #222222;

  /* KI-Akademie green - done indicator */
  --accent: #a2c73b;
  /*--accent2: #a5cd79;*/
  --accent-pale: #e8f1ce;

  /* Cluster colours (up to 8 groups) */
  --c1: #f25f4c;
  /* red-orange */
  --c2: #4cc9f0;
  /* sky blue   */
  --c3: #7bed9f;
  --c3-dark: #3fd46a;
  /* mint green */
  --c4: #f7b731;
  /* amber      */
  --c5: #cf6ef8;
  /* purple     */
  --c6: #ff6b6b;
  /* coral      */

  /* Global easing */
  --transition: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}


::selection {
  background: var(--accent);
}

.hero h1 em::selection {
  background: var(--accent-pale);
}

.in-text-highlight {
  color: var(--accent);
}

.in-text-highlight::selection {
  background: var(--accent-pale);
}

.slider-wrap span::selection {
  background: var(--accent-pale);
}

.algorithm-list {
  list-style: none;
  counter-reset: item;
  padding-left: 0;
}

.algorithm-list li {
  counter-increment: item;
  padding-left: 40px;
  padding-right: 40px;
  position: relative;
}

/* Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Parkinsans',sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}


/* NAVIGATION BAR */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  padding: 14px 32px;
  background: var(--surface);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  font-family: 'Parkinsans',sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.02em;
}

/* Progress pip strip */
.nav-steps {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);

  display: flex;
  gap: 4px;
}

.nav-step {
  width: 2em;
  height: 0.5em;
  border-radius: 2px;
  background: var(--border);
  transition: background var(--transition);
  cursor: pointer;
}

.nav-step.active {
  background: var(--accent);
}

.nav-step.done {
  background: var(--border);
}

.nav-label {
  font-size: 0.75rem;
  color: var(--muted);
  font-family: 'Parkinsans', sans-serif;
}


/* STAGE SECTIONS */
.stage {
  display: none;
  min-height: 100vh;
  padding-top: 64px;
  /* clears fixed nav */
}

.stage.active {
  display: block;
}


/* HEADINGS */
.hero {
  max-width: 780px;
  margin: 0 auto;
  text-align: justify;
  line-height: 1.7;
}

/* story intro */
.hero-lead {
  font-size: 1.15rem;
  color: #f4ea7c;
  font-style: italic;
}

/* explanation text */
.hero-body {
  color: #d6d6e7;
  font-size: 1rem;
}

/* key takeaway highlight */
.hero-highlight {
  color: var(--accent);
  font-weight: 600;
}

.hero-header {
  text-align: center;
}

/* Small pill badge above each stage title */
.stage-badge {
  display: inline-block;
  color: var(--muted);
  border: 1px solid var(--accent);
  background-color: var(--surface);
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 20px;
}

.stage-badge h2 {
  font-family: 'Parkinsans', sans-serif;;
  font-weight: 900;
}

/* Italic accent inside headings */
.hero h1 em {
  font-style: italic;
  color: var(--accent);
}

.hero p {
  font-size: 1.05rem;
  color: var(--muted);
  line-height: 1.75;
  margin-bottom: 14px;
}


/* CANVAS & AXIS LABELS */
.canvas-wrap {
  position: relative;
  width: 780px;
  height: 420px;
  margin: 2em auto;
}

canvas {
  /*width: 100%;*/
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  display: block;
  touch-action: none;
  /* prevents scroll-hijack on mobile drag */
}

.axis-label-x,
.axis-label-y {
  position: absolute;
  font-size: 0.8rem;
  color: var(--muted);
  font-family: 'Parkinsans', sans-serif;
}

.axis-label-x {
  position: absolute;
  left: 50%;
  bottom: 1em;
  transform: translateX(-50%);
  text-align: center;
  white-space: nowrap;
}

.axis-label-y {
  position: absolute;
  top: 50%;
  left: -9.1em;
  /* distance from canvas edge */
  transform: translateY(-50%) rotate(-90deg);
  transform-origin: center;
  white-space: nowrap;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 8px;
  font-family: 'Parkinsans', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 200ms;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: var(--text);
}

.btn-primary:hover {
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-sm {
  padding: 8px 18px;
  font-size: 0.85rem;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

/* Horizontal row of buttons, centred */
.btn-group {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 20px;
  margin-bottom: 20px;
}


/* CARDS */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}


/* NARRATOR BOX */
/* The left-bordered callout that tells the story at each step */
.narrator {
  max-width: 780px;
  margin: 0 auto 20px;
  padding: 0 16px;
}

.narrator-inner {
  text-align: justify;
  background: var(--accent-pale);
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  padding: 14px 18px;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.65;
  transition: all var(--transition);
  min-height: 54px;
}

.narrator-inner strong {
  color: var(--text);
}

.narrator-inner em {
  color: var(--accent);
  font-style: normal;
}


/* METRICS ROW */
.metrics {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 680px;
  margin: 0 auto 20px;
  padding: 0 16px;
}

.metric {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 20px;
  text-align: center;
  min-width: 120px;
}

.metric-val {
  font-family: 'Parkinsans', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent);
}

.metric-label {
  font-size: 0.72rem;
  color: var(--muted);
  text-align: center;
  letter-spacing: 0.08em;
  margin-top: 2px;
}


/* SLIDERS */
.slider-wrap {
  max-width: 500px;
  margin: 0 auto 20px;
  padding: 0 20px;
  text-align: center;
  vertical-align: middle;
}

.slider-wrap label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 10px;
}

.slider-wrap span {
  font-family: 'Parkinsans', sans-serif;
  font-size: 1.5rem;
  color: var(--accent);
  font-weight: 700;
  vertical-align: middle;
}

input[type=range] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  outline: none;
}

input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid var(--bg);
  transition: transform 200ms;
}

input[type=range]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

input[type=range]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid var(--bg);
  transition: transform 200ms;
}

input[type=range]::-moz-range-thumb:hover {
  transform: scale(1.2);
}


/* ELBOW CHART WRAPPER */
.elbow-wrap {
  max-width: 780px;
  margin: 0 auto;
  text-align: justify;
  line-height: 1.7;
}

.elbow-wrap p {
  font-size: 1.05rem;
  color: var(--muted);
  line-height: 1.75;
  margin-bottom: 14px;
}


#elbowCanvas {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}


/* STAGE INTRO CARDS (Stage 1 three-panel row) */
.intro-cards {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 700px;
  margin: 0 auto;
}

.intro-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px 20px;
  text-align: center;
  flex: 1;
  /*min-width: 140px;*/
  /*max-width: 180px;*/
}

.intro-card .icon {
  font-size: 2.2rem;
  margin-bottom: 10px;
  text-align: center;
}

.intro-card p {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
}


/* LASSO TOOLS (Stage 2) */
.lasso-tools {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 14px;
}

.lasso-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 20px;
  border: 2px solid transparent;
  background: var(--surface);
  color: var(--text);
  font-family: 'Parkinsans', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 200ms;
}

.lasso-btn.active {
  border-color: currentColor;
}

/* Coloured dot inside each lasso button */
.lasso-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}


/* QUIZ (Stage 6) */
.quiz-container {
  max-width: 680px;
  margin: 0 auto;
}

.quiz-q {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin: 16px;
}

.quiz-q-last {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin: 16px 16px 0 16px;
}

.quiz-q h3 {
  font-family: 'Parkinsans', sans-serif;
  font-size: 1.1rem;
  margin-bottom: 16px;
}

.quiz-q-last h3 {
  font-family: 'Parkinsans', sans-serif;
  font-size: 1.1rem;
  margin-bottom: 16px;
}

.quiz-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quiz-opt {
  padding: 8px 18px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-family: 'Parkinsans', sans-serif;
  text-align: justify;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 200ms;
}

.quiz-opt:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.quiz-opt.correct {
  /*background: rgba(123, 237, 159, 0.15);*/
  background: var(--bg);
  border-color: var(--c3-dark);
  color: var(--c3-dark);
}

.quiz-opt.wrong {
  /*background: rgba(242, 95, 76, 0.15);*/
  background: var(--bg);
  border-color: var(--c1);
  color: var(--c1);
}


/* SUMMARY TIMELINE (Stage 6)  */
.timeline {
  display: flex;
  gap: 0;
  max-width: 780px;
  margin: 0 auto 40px;
  padding: 0 16px;
  overflow-x: auto;
}

.timeline-step {
  flex: 1;
  min-width: 130px;
  text-align: center;
  padding: 20px 12px;
  position: relative;
}

/* Arrow between steps */
.timeline-step::after {
  content: '→';
  position: absolute;
  right: -8px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--border);
  font-size: 1.2rem;
}

.timeline-step:last-child::after {
  display: none;
}

.timeline-icon {
  font-size: 1.8rem;
  margin-bottom: 8px;
}

.timeline-step h4 {
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.timeline-step p {
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.4;
}


/* LIMITATIONS GRID (Stage 6) */
.limits {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  max-width: 680px;
  margin: 0 auto 32px;
  padding: 0 16px;
}

.limit-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
}

.limit-card h4 {
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 6px;
  font-weight: 600;
}

.limit-card p {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.55;
}


/* REAL-WORLD APPS CHIPS (Stage 6) */
.apps {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  max-width: 680px;
  margin: 0 auto 40px;
  padding: 0 16px;
}

.app-chip {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 0.82rem;
  color: var(--muted);
}

.app-chip span {
  font-size: 1rem;
  margin-right: 6px;
}


/* UTILITY / ANIMATION HELPERS */
.fade-in {
  animation: fadeIn 600ms ease forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Orange text highlight used inline */
.highlight {
  color: var(--accent);
  font-weight: 600;
}

/* Short decorative horizontal rule */
.divider {
  width: 60px;
  height: 2px;
  background: var(--accent);
  margin: 30px auto 30px auto;
  border-radius: 1px;
}

/* Italic reassurance text under interactive elements */
.reassure {
  font-size: 1.05rem;
  line-height: 1.75;
  margin-bottom: 14px;
  color: var(--muted);
  font-style: italic;
  text-align: center;
}

/* Two-column flex layout */
.two-col {
  display: flex;
  gap: 16px;
  max-width: 700px;
  margin: 0 auto 20px;
  padding: 0 16px;
}

.two-col>* {
  flex: 1;
}

/* Speed control row (Stage 4) */
.speed-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  margin-bottom: 12px;
}

.speed-wrap label {
  font-size: 0.8rem;
  color: var(--muted);
}

.speed-wrap input {
  width: 100px;
}


/* RESPONSIVE */
@media (max-width: 600px) {
  .nav {
    padding: 12px 16px;
  }

  .hero {
    padding: 40px 16px 30px;
  }

  .two-col {
    flex-direction: column;
  }

  .why-sidebar {
    display: none;
  }

  /* hidden on small screens- not enough room */
  .timeline {
    gap: 0;
  }

  .timeline-step {
    min-width: 110px;
  }
}