/* ============================================================
   Font — DM Sans (clean, modern, iOS-friendly)
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;0,9..40,800&display=swap');

/* ============================================================
   Tokens
   ============================================================ */
:root {
  --bg:          #F2F4F8;
  --surface:     #FFFFFF;
  --text:        #1A1A2E;
  --text-mid:    #5E6070;
  --text-soft:   #A0A3B1;
  --divider:     #EAEDF3;
  --focus-ring:  #4F46E5;

  /* Semantic feedback */
  --correct-bg:  #E6F8EC;
  --correct-txt: #1A7A3A;
  --correct-bdr: #A8E6BC;
  --wrong-bg:    #FFF0F0;
  --wrong-txt:   #B03030;
  --wrong-bdr:   #F5AAAA;

  /* Spacing (8pt grid) */
  --s1: 4px;  --s2: 8px;  --s3: 12px;  --s4: 16px;
  --s5: 20px; --s6: 24px; --s8: 32px;  --s10: 40px; --s12: 48px;

  /* Radius */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 20px;
  --r-xl: 24px;
  --r-full: 9999px;

  /* Shadow — very soft only */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.07);
}

/* ============================================================
   Reset
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   Layout
   ============================================================ */
.container {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 0 var(--s4);
}

/* ============================================================
   Header
   ============================================================ */
.site-header {
  background: var(--surface);
  padding: var(--s4) 0;
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--divider);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
}

/* Language toggle */
.lang-toggle {
  display: flex;
  align-items: center;
  background: var(--bg);
  border-radius: var(--r-full);
  padding: 3px;
  gap: 2px;
  flex-shrink: 0;
}

.lang-btn {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-soft);
  background: none;
  border: none;
  border-radius: var(--r-full);
  padding: 5px 12px;
  cursor: pointer;
  min-height: 32px;
  transition: background 0.15s, color 0.15s;
}

.lang-btn:hover { color: var(--text); }

.lang-btn--active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.lang-btn:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.site-title {
  display: flex;
  align-items: center;
  gap: var(--s2);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.site-title svg {
  width: 20px;
  height: 20px;
  stroke: var(--text);
  flex-shrink: 0;
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  background: var(--surface);
  padding: var(--s10) 0 0;
  border-bottom: 1px solid var(--divider);
}

.hero h1 {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: var(--s3);
  text-align: left;
}

.hero p {
  font-size: 1rem;
  color: var(--text-mid);
  max-width: 420px;
  margin: 0 0 var(--s8);
  line-height: 1.65;
  text-align: left;
}

/* ============================================================
   Stats Ribbon
   ============================================================ */
.stats-ribbon {
  display: flex;
  gap: var(--s3);
  overflow-x: auto;
  padding: var(--s5) var(--s4);
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.stats-ribbon::-webkit-scrollbar { display: none; }

@media (min-width: 600px) {
  .stats-ribbon {
    padding-left: calc((100vw - 600px) / 2 + var(--s4));
    padding-right: calc((100vw - 600px) / 2 + var(--s4));
  }
}

.stat-card {
  flex-shrink: 0;
  width: 175px;
  height: 110px;
  background: var(--bg);
  border-radius: var(--r-lg);
  padding: var(--s4) var(--s4) var(--s3);
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.stat-num {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text);
}

.stat-label {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-mid);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.stat-bar-track {
  height: 3px;
  background: var(--divider);
  border-radius: var(--r-full);
  overflow: hidden;
}

.stat-bar-fill {
  height: 100%;
  width: var(--stat-pct, 50%);
  background: var(--stat-color, var(--text-soft));
  border-radius: var(--r-full);
}

/* ============================================================
   Module List
   ============================================================ */
.modules-section {
  padding: var(--s6) 0 var(--s12);
}

.lessons-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  margin-bottom: var(--s4);
}

.lessons-header h2 {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.progress-banner {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-mid);
  background: var(--bg);
  border-radius: var(--r-full);
  padding: var(--s2) var(--s4);
}

.progress-banner svg {
  width: 14px;
  height: 14px;
  stroke: var(--text-soft);
}

.module-grid {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
}

/* Card — full width, pastel bg, no border, very soft shadow */
.module-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--s4);
  background: var(--card-bg, #F2F4F8);
  border-radius: var(--r-xl);
  padding: var(--s5);
  text-decoration: none;
  color: var(--text);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  min-height: 88px;
}

/* Decorative circle behind icon */
.module-card::before {
  content: '';
  position: absolute;
  top: -32px;
  right: -32px;
  width: 140px;
  height: 140px;
  background: rgba(0,0,0,0.05);
  border-radius: 50%;
  pointer-events: none;
}

.module-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.module-card:active {
  transform: translateY(0px);
  box-shadow: none;
}

.module-card:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

/* Icon bubble */
.card-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: var(--r-md);
  background: var(--icon-bg, rgba(0,0,0,0.1));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card-icon-wrap svg {
  width: 24px;
  height: 24px;
  stroke: var(--text);
  stroke-width: 1.75;
}

/* Card body */
.card-body {
  flex: 1;
  min-width: 0;
}

.card-num {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-soft);
  letter-spacing: 0.06em;
  display: block;
  margin-bottom: 2px;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.card-tagline {
  font-size: 0.82rem;
  color: var(--text-mid);
  margin-top: 2px;
  line-height: 1.4;
}

/* Arrow */
.card-arrow {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0,0,0,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card-arrow svg {
  width: 16px;
  height: 16px;
  stroke: var(--text);
  stroke-width: 2;
}

/* Completed state */
.module-card.completed .card-arrow {
  background: #1A7A3A;
}
.module-card.completed .card-arrow svg {
  stroke: #fff;
}

.card-badge {
  display: none; /* replaced by arrow style on completed */
}

/* ============================================================
   Info Bar
   ============================================================ */
.info-bar {
  background: var(--surface);
  border-top: 1px solid var(--divider);
  padding: var(--s3) 0;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-soft);
}

/* ============================================================
   Back Nav (module page)
   ============================================================ */
.back-nav {
  padding: var(--s4) 0 0;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  color: var(--text-mid);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
  padding: var(--s2) var(--s3);
  border-radius: var(--r-full);
  background: var(--surface);
  transition: background 0.15s;
}

.back-link:hover { background: var(--divider); }

.back-link svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
}

/* ============================================================
   Module Header (module page)
   ============================================================ */
.module-header {
  padding: var(--s5) 0 var(--s4);
}

.module-icon-wrap {
  width: 64px;
  height: 64px;
  border-radius: var(--r-lg);
  background: var(--card-bg, #F2F4F8);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--s4);
}

.module-icon-wrap svg {
  width: 30px;
  height: 30px;
  stroke: var(--text);
  stroke-width: 1.75;
}

.module-meta {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--s2);
}

.module-header h1 {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.025em;
  margin-bottom: 4px;
}

.module-tagline {
  font-size: 0.95rem;
  color: var(--text-mid);
  font-weight: 500;
}

/* Progress bar */
.progress-bar-wrap {
  display: flex;
  align-items: center;
  gap: var(--s3);
  margin-top: var(--s4);
}

.progress-bar-track {
  flex: 1;
  height: 6px;
  background: var(--divider);
  border-radius: var(--r-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--text);
  border-radius: var(--r-full);
  transition: width 0.4s ease;
}

.progress-bar-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-soft);
  white-space: nowrap;
}

/* ============================================================
   Module Content Sections — flat, no shadow boxes
   ============================================================ */
.module-content {
  padding-bottom: var(--s4);
  display: flex;
  flex-direction: column;
  gap: var(--s6);
}

/* Base block: flat, just spacing */
.section-block {
  background: none;
  padding: 0;
}

.section-block h2 {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-soft);
  margin-bottom: var(--s4);
}

/* ── Why (hook callout) — uses module's pastel color ── */
.section-why-wrap {
  background: var(--mod-card-bg, #F2F4F8);
  border-radius: var(--r-xl);
  padding: var(--s5) var(--s5);
}

.section-why-wrap h2 {
  margin-bottom: var(--s3);
}

.section-why-wrap p {
  font-size: 1rem;
  line-height: 1.72;
  color: var(--text);
  font-weight: 500;
}

/* ── Tips — each bullet a visual row ── */
.tips-list {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
}

.tip-row {
  display: flex;
  align-items: flex-start;
  gap: var(--s3);
  background: var(--surface);
  border-radius: var(--r-md);
  padding: var(--s3) var(--s4);
}

.tip-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--mod-card-bg, #F2F4F8);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.tip-icon svg {
  width: 15px;
  height: 15px;
  stroke: var(--text-mid);
  stroke-width: 2;
}

.tip-text {
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--text-mid);
  padding-top: 6px;
}

/* ── Actions — prominent numbered steps ── */
.steps-list {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
}

.step-row {
  display: flex;
  align-items: flex-start;
  gap: var(--s3);
}

.step-num {
  min-width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--text);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
  font-family: 'DM Sans', sans-serif;
}

.step-text {
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--text-mid);
  padding-top: 4px;
}

/* ── Analogy — quote style, no box ── */
.analogy-block {
  border-left: 3px solid var(--mod-card-bg, var(--divider));
  padding-left: var(--s4);
}

.analogy-block h2 { margin-bottom: var(--s2); }

.analogy-block p {
  font-style: italic;
  font-size: 1rem;
  color: var(--text-mid);
  line-height: 1.7;
}

/* ── Tool link ── */
.section-block p {
  color: var(--text-mid);
  line-height: 1.7;
  font-size: 0.95rem;
}

.tool-link {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  margin-top: var(--s4);
  background: var(--text);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  padding: var(--s3) var(--s5);
  border-radius: var(--r-full);
  font-size: 0.88rem;
  transition: opacity 0.15s;
}

.tool-link:hover { opacity: 0.85; }

.tool-link svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
}

/* ── Tools list ── */
.tools-list {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  margin-top: var(--s2);
}

.tool-item {
  background: var(--surface);
  border-radius: var(--r-md);
  padding: var(--s4);
  display: flex;
  gap: var(--s3);
  align-items: flex-start;
}

.tool-item-info { flex: 1; }

.tool-item-name {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 3px;
  color: var(--text);
}

.tool-item-name a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--divider);
  text-underline-offset: 3px;
}

.tool-item-name a:hover { text-decoration-color: var(--text); }

.tool-item-desc {
  font-size: 0.85rem;
  color: var(--text-mid);
  line-height: 1.5;
}

.tool-badge {
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--bg);
  color: var(--text-mid);
  border-radius: var(--r-full);
  padding: 3px 10px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
}

/* ============================================================
   Quiz
   ============================================================ */
.quiz-section {
  padding: var(--s4) 0 var(--s8);
}

.quiz-section h2 {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  margin-bottom: var(--s4);
  color: var(--text);
}

.quiz-question {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: var(--s5);
  margin-bottom: var(--s3);
  box-shadow: var(--shadow-sm);
}

.question-number {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--s2);
}

.question-text {
  font-size: 0.97rem;
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: var(--s4);
  color: var(--text);
}

.answer-options {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
}

.answer-btn {
  display: flex;
  align-items: center;
  gap: var(--s3);
  width: 100%;
  text-align: left;
  background: var(--bg);
  border: none;
  border-radius: var(--r-md);
  padding: var(--s3) var(--s4);
  font-size: 0.92rem;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  line-height: 1.45;
  min-height: 52px;
  transition: background 0.15s, opacity 0.15s;
  touch-action: manipulation;
}

.answer-btn:hover:not(:disabled) {
  background: var(--divider);
}

.answer-btn:active:not(:disabled) {
  opacity: 0.75;
}

.answer-btn:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.answer-btn.selected {
  background: var(--divider);
  font-weight: 600;
}

.answer-btn.correct {
  background: var(--correct-bg);
  color: var(--correct-txt);
  font-weight: 600;
}

.answer-btn.wrong {
  background: var(--wrong-bg);
  color: var(--wrong-txt);
  font-weight: 600;
}

.answer-btn:disabled { cursor: default; }

.answer-letter {
  font-weight: 700;
  font-size: 0.78rem;
  min-width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-soft);
}

.answer-btn.correct .answer-letter {
  background: var(--correct-txt);
  color: #fff;
}

.answer-btn.wrong .answer-letter {
  background: var(--wrong-txt);
  color: #fff;
}

/* Feedback */
.question-feedback {
  margin-top: var(--s3);
  padding: var(--s3) var(--s4);
  border-radius: var(--r-sm);
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.65;
  display: none;
}

.question-feedback.visible { display: block; }

.question-feedback.correct {
  background: var(--correct-bg);
  color: var(--correct-txt);
}

.question-feedback.wrong {
  background: var(--wrong-bg);
  color: var(--wrong-txt);
}

.feedback-label {
  font-weight: 700;
  margin-bottom: 3px;
}

/* Submit */
.quiz-submit-wrap {
  margin-top: var(--s5);
  text-align: center;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  background: var(--text);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: 'DM Sans', sans-serif;
  border: none;
  border-radius: var(--r-full);
  padding: var(--s3) var(--s8);
  cursor: pointer;
  min-height: 52px;
  letter-spacing: -0.01em;
  text-decoration: none;
  transition: opacity 0.15s, transform 0.12s;
  touch-action: manipulation;
}

.btn-primary:hover:not(:disabled) { opacity: 0.85; }

.btn-primary:active:not(:disabled) {
  transform: scale(0.97);
}

.btn-primary:disabled {
  background: var(--divider);
  color: var(--text-soft);
  cursor: not-allowed;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  background: var(--surface);
  color: var(--text-mid);
  font-size: 0.95rem;
  font-weight: 700;
  font-family: 'DM Sans', sans-serif;
  border: none;
  border-radius: var(--r-full);
  padding: var(--s3) var(--s8);
  cursor: pointer;
  min-height: 52px;
  text-decoration: none;
  letter-spacing: -0.01em;
  transition: background 0.15s, transform 0.12s;
  touch-action: manipulation;
}

.btn-secondary:hover { background: var(--divider); }

.btn-secondary:active { transform: scale(0.97); }

/* ============================================================
   Completion Card
   ============================================================ */
.completion-card {
  background: var(--surface);
  border-radius: var(--r-xl);
  padding: var(--s8) var(--s6);
  text-align: center;
  margin-bottom: var(--s8);
  display: none;
  box-shadow: var(--shadow-sm);
}

.completion-card.visible { display: block; }

.completion-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--s4);
}

.completion-icon svg {
  width: 32px;
  height: 32px;
  stroke: var(--text);
  stroke-width: 1.75;
}

.completion-card h3 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: var(--s2);
  letter-spacing: -0.02em;
}

.completion-card > p {
  color: var(--text-mid);
  font-weight: 500;
  margin-bottom: var(--s6);
  font-size: 0.95rem;
  line-height: 1.6;
}

.completion-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
  justify-content: center;
}

/* Try again button */
.btn-retry {
  background: none;
  border: none;
  color: var(--text-soft);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 4px;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s;
  min-height: 44px;
}

.btn-retry:hover { color: var(--text-main); }

/* Feedback widget */
.feedback-row {
  margin: var(--s5) 0 var(--s4);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s3);
}

.feedback-prompt {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-mid);
  margin: 0;
}

.feedback-btns {
  display: flex;
  gap: var(--s3);
}

.feedback-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border: 2px solid var(--divider);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-mid);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s, transform 0.15s;
  min-height: 44px;
}

.feedback-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.feedback-btn:hover {
  border-color: var(--text);
  color: var(--text);
  background: color-mix(in srgb, var(--text) 8%, transparent);
}

.feedback-btn--selected {
  border-color: var(--text);
  color: var(--text);
  background: color-mix(in srgb, var(--text) 10%, transparent);
}

.feedback-btn--selected[data-rating="heart"] {
  border-color: #e05555;
  color: #e05555;
  background: color-mix(in srgb, #e05555 10%, transparent);
}

.feedback-btn--selected[data-rating="heart"] svg {
  fill: #e05555;
}

.feedback-btn--selected[data-rating="star"] {
  border-color: #d4900a;
  color: #d4900a;
  background: color-mix(in srgb, #d4900a 10%, transparent);
}

.feedback-btn--selected[data-rating="star"] svg {
  fill: #d4900a;
}

@keyframes feedbackBounce {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.18); }
  65%  { transform: scale(0.94); }
  100% { transform: scale(1); }
}

.feedback-btn--bounce {
  animation: feedbackBounce 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ============================================================
   Loading / Error
   ============================================================ */
.state-loading,
.state-error {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-soft);
  font-weight: 500;
}

.state-error { color: var(--wrong-txt); }

/* ============================================================
   Email Signup
   ============================================================ */
.email-signup {
  background: var(--surface);
  border-top: 1px solid var(--divider);
  padding: var(--s8) 0;
  text-align: center;
}

.signup-label {
  font-weight: 700;
  font-size: 1.05rem;
  margin: 0 0 var(--s4);
  color: var(--text-main);
}

.signup-form {
  display: flex;
  gap: var(--s2);
  max-width: 400px;
  margin: 0 auto var(--s3);
}

.signup-input {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid var(--divider);
  border-radius: var(--r-md);
  font-family: inherit;
  font-size: 0.95rem;
  background: #fff;
  min-height: 44px;
  color: var(--text-main);
}

.signup-input:focus {
  outline: none;
  border-color: var(--text);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--text) 12%, transparent);
}

.signup-btn {
  padding: 10px 22px;
  background: var(--text);
  color: #fff;
  border: none;
  border-radius: var(--r-md);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
  transition: opacity 0.15s;
  white-space: nowrap;
}

.signup-btn:hover { opacity: 0.88; }
.signup-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.signup-note {
  font-size: 0.8rem;
  color: var(--text-soft);
  margin: 0;
}

.signup-success {
  font-weight: 600;
  color: var(--correct-txt);
  padding: var(--s3) 0;
}

@media (max-width: 480px) {
  .signup-form { flex-direction: column; }
  .signup-btn { width: 100%; }
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--divider);
  padding: var(--s6) 0;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-soft);
}

/* ============================================================
   Intro overlay
   ============================================================ */
@keyframes introFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes introSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes introIconIn {
  0%   { opacity: 0; transform: scale(0.6); }
  60%  { transform: scale(1.08); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes introPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.15); }
  50%       { box-shadow: 0 0 0 16px rgba(99, 102, 241, 0); }
}

@keyframes outroFadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

.intro-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: #FFFFFF;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: var(--s6);
}

.intro-overlay.visible {
  display: flex;
  animation: introFadeIn 0.4s ease both;
}

.intro-overlay.outro {
  animation: outroFadeOut 0.5s ease both;
}

.intro-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  max-width: 340px;
  gap: var(--s4);
}

/* Top row: brand + lang toggle */
.intro-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  animation: introSlideUp 0.5s ease 0.1s both;
}

/* Brand row */
.intro-brand {
  display: flex;
  align-items: center;
  gap: var(--s3);
}

.intro-icon {
  width: 40px;
  height: 40px;
  background: #EEF2FF;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4F46E5;
  flex-shrink: 0;
}

.intro-icon svg { width: 22px; height: 22px; }

.intro-brand-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-soft);
  letter-spacing: 0.01em;
}

/* Big stat */
.intro-big-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: introSlideUp 0.5s ease 0.25s both;
}

.intro-big-num {
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text);
}

.intro-big-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-mid);
  line-height: 1.4;
}

/* Chart */
.intro-chart-wrap {
  width: 100%;
  animation: introSlideUp 0.5s ease 0.4s both;
}

.intro-chart {
  width: 100%;
  height: auto;
  overflow: visible;
}

/* Lollipop lines */
.lc-line {
  stroke: #4F46E5;
  stroke-width: 1.5;
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: lcLineGrow 0.45s ease calc(0.7s + var(--ci) * 0.1s) both;
}

/* Lollipop dots */
.lc-dot {
  fill: #4F46E5;
  transform-box: fill-box;
  transform-origin: 50% 50%;
  animation: lcDotIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) calc(1.1s + var(--ci) * 0.1s) both;
}

.lc-dot.peak { fill: #4F46E5; }

/* Peak label */
.lc-peak-lbl {
  font-family: 'DM Sans', sans-serif;
  font-size: 9px;
  font-weight: 700;
  fill: #4F46E5;
  animation: introFadeIn 0.4s ease 1.7s both;
  opacity: 0;
  animation-fill-mode: both;
}

/* Year labels */
.lc-year {
  font-family: 'DM Sans', sans-serif;
  font-size: 9px;
  font-weight: 500;
  fill: #A0A3B1;
}

@keyframes lcLineGrow {
  from { transform: scaleY(0); }
  to   { transform: scaleY(1); }
}

@keyframes lcDotIn {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* Chart note */
.intro-chart-note {
  font-size: 0.7rem;
  color: var(--text-soft);
  margin-top: -8px;
  animation: introFadeIn 0.4s ease 0.5s both;
}

/* CTA */
.intro-cta {
  width: 100%;
  background: var(--text);
  color: #fff;
  border: none;
  border-radius: var(--r-full);
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  padding: var(--s4) var(--s6);
  cursor: pointer;
  min-height: 52px;
  transition: transform 0.15s, background 0.15s;
  animation: introSlideUp 0.5s ease 0.6s both;
}

.intro-cta:hover  { background: #2d2d44; }
.intro-cta:active { transform: scale(0.97); }

/* ============================================================
   Reset progress
   ============================================================ */
.reset-row {
  text-align: center;
  margin-top: 2rem;
  padding-bottom: 1rem;
}

.reset-btn {
  background: none;
  border: none;
  color: var(--text-soft);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

.reset-btn:hover {
  color: #c0392b;
  background: #fdf0ee;
}

/* ============================================================
   Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* ============================================================
   Tablet+ — widen a touch
   ============================================================ */
@media (min-width: 640px) {
  .hero h1 { font-size: 2.4rem; }
  .module-header h1 { font-size: 2rem; }
}
