/* ============================================================
   Financial Ecosystem for Kids — project-specific accents
   Palette pulled from the real app screens (Junior Bank).
   Structure/layout reuses the shared case-study classes in
   style.css; this file only adds the video preview and the
   mini mockups styled after the real screens.
   ============================================================ */

:root {
  --jb-mint: #4fbe93;
  --jb-mint-pale: #d7f0e4;
  --jb-purple: #6c5ce7;
  --jb-purple-pale: #e7e3fb;
  --jb-peach: #e0763c;
  --jb-peach-pale: #fbdcc5;
  --jb-gold: #e8a93c;
  --jb-gold-pale: #fbefc0;
  --jb-pink: #e14f86;
  --jb-pink-pale: #fbdce9;
  --jb-blue: #3e5fe0;
  --jb-blue-pale: #dee5fc;
  --jb-card: #f2f2f2;
}

/* Hero: title/meta on the left, prototype preview on the right */
.case-hero-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 48px;
  align-items: start;
}

/* Video preview — just the top edge of a phone, not a full device mockup */
.case-hero-video {
  max-width: 300px;
}
.jb-video-frame {
  position: relative;
  border-radius: 26px 26px 0 0;
  overflow: hidden;
  background: #000;
  border: 1px solid var(--border);
  border-bottom: none;
  box-shadow: var(--shadow-lift);
}
.jb-video-notch {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 64px;
  height: 16px;
  border-radius: 10px;
  background: #000;
  z-index: 2;
}
.jb-video-frame video {
  display: block;
  width: 100%;
  height: auto;
}
.jb-video-caption {
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
}

/* Mini mockups styled after the real screens */
.jb-mockup-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 22px;
  margin-top: 36px;
}
.jb-mockup {
  background: var(--jb-card);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 18px;
  aspect-ratio: 9 / 16;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-lift);
}
.jb-mockup-caption {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-faint);
  margin-top: 10px;
}

.jb-row { display: flex; align-items: center; gap: 8px; }
.jb-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--jb-mint); flex-shrink: 0; }
.jb-bal-label { font-size: 0.55rem; font-weight: 700; color: var(--jb-purple); letter-spacing: 0.06em; }
.jb-bal-amount { font-family: var(--font-display); font-size: 1.3rem; color: var(--text); }
.jb-chip-row { display: flex; gap: 6px; }
.jb-chip { font-size: 0.5rem; font-weight: 700; padding: 4px 8px; border-radius: 100px; }
.jb-chip--peach { background: var(--jb-peach-pale); color: var(--jb-peach); }
.jb-chip--gold { background: var(--jb-gold-pale); color: #8a5e14; }
.jb-card-mini { background: #fff; border-radius: 12px; padding: 10px; flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.jb-btn { background: var(--jb-mint); color: #fff; font-size: 0.58rem; font-weight: 700; padding: 6px 14px; border-radius: 100px; align-self: flex-start; }
.jb-track { height: 5px; border-radius: 4px; background: var(--border-strong); overflow: hidden; }
.jb-track > span { display: block; height: 100%; }

.jb-node-col { display: flex; flex-direction: column; gap: 16px; align-items: center; flex: 1; justify-content: center; }
.jb-node-row { display: flex; align-items: center; gap: 10px; }
.jb-node { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--text); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 0.75rem; flex-shrink: 0; }
.jb-node-label { font-size: 0.6rem; color: var(--text); font-weight: 600; }

.jb-task-row { display: flex; align-items: center; justify-content: space-between; background: #fff; border-radius: 10px; padding: 8px 10px; gap: 8px; }
.jb-task-row .label { font-size: 0.58rem; font-weight: 700; color: var(--text); }
.jb-status { font-size: 0.5rem; font-weight: 700; padding: 3px 8px; border-radius: 100px; white-space: nowrap; }
.jb-status--waiting { background: var(--jb-gold-pale); color: #8a5e14; }
.jb-status--paid { background: var(--jb-mint-pale); color: #227a58; }

/* ============================================================
   Data graphics — funnel, tension card, compare bars, dumbbell,
   meter. One hue per chart (ordinal/sequential), direct labels,
   text stays in text tokens, marks carry the color.
   ============================================================ */

.jb-context-stat {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 24px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-dim);
}
.jb-context-stat strong {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--text);
}

/* Shared horizontal bar-row pattern — used by the funnel and the
   A/B compare chart. Value sits outside the bar so it never
   gets clipped by a narrow fill. */
.jb-bar-chart {
  margin-top: 28px;
  display: grid;
  gap: 16px;
  max-width: 560px;
}
.jb-bar-row {
  display: grid;
  grid-template-columns: 150px 1fr 76px;
  align-items: center;
  gap: 14px;
}
.jb-bar-label { font-size: 0.82rem; color: var(--text-dim); }
.jb-bar-track {
  height: 20px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.jb-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}
.jb-bar-value {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text);
  text-align: right;
  white-space: nowrap;
}
.jb-bar-caption {
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
}

.jb-funnel-notes {
  margin-top: 20px;
  display: grid;
  gap: 10px;
}
.jb-funnel-note {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text-dim);
}
.jb-funnel-note strong {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--jb-purple);
  border: 1px solid var(--border-strong);
  border-radius: 100px;
  padding: 2px 8px;
  flex-shrink: 0;
}

/* Parent-vs-kid tension card */
.jb-tension {
  margin-top: 28px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  gap: 0;
  max-width: 640px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.jb-tension-side {
  padding: 24px;
}
.jb-tension-side--parent { background: var(--jb-purple-pale); }
.jb-tension-side--kid { background: var(--jb-mint-pale); }
.jb-tension-who {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}
.jb-tension-want {
  margin-top: 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--text);
}
.jb-tension-vs {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  background: var(--bg-card);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-faint);
}

/* Dumbbell — before/after per item, one hue two shades */
.jb-dumbbell-chart {
  margin-top: 28px;
  display: grid;
  gap: 28px;
  max-width: 620px;
}
.jb-dumbbell-row { display: grid; gap: 8px; }
.jb-dumbbell-label { font-size: 0.82rem; color: var(--text-dim); }
.jb-dumbbell-track {
  position: relative;
  height: 20px;
}
.jb-dumbbell-track::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 1px;
  background: var(--border);
  transform: translateY(-50%);
}
.jb-dumbbell-line {
  position: absolute;
  top: 50%;
  height: 2px;
  background: var(--jb-blue);
  transform: translateY(-50%);
}
.jb-dumbbell-dot {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  border: 2px solid var(--bg);
}
.jb-dumbbell-dot--before { background: var(--jb-blue-pale); }
.jb-dumbbell-dot--after { background: var(--jb-blue); }
.jb-dumbbell-values {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text);
}
.jb-dumbbell-values .arrow { color: var(--text-faint); font-weight: 400; }

/* Meter — single ratio against a limit */
.jb-meter {
  margin-top: 28px;
  max-width: 420px;
}
.jb-meter-track {
  height: 20px;
  border-radius: 4px;
  background: var(--jb-gold-pale);
  overflow: hidden;
}
.jb-meter-fill {
  height: 100%;
  background: var(--jb-gold);
  border-radius: 4px;
  transition: width 0.6s ease;
}
.jb-meter-label {
  margin-top: 10px;
  font-size: 0.88rem;
  color: var(--text-dim);
}
.jb-meter-label strong { color: var(--text); }

@media (max-width: 640px) {
  .jb-bar-row { grid-template-columns: 1fr; gap: 6px; }
  .jb-bar-value { text-align: left; }
  .jb-tension { grid-template-columns: 1fr; }
  .jb-tension-vs { display: none; }
}

@media (max-width: 760px) {
  .case-hero-grid { grid-template-columns: 1fr; }
  .case-hero-video { max-width: 240px; margin-top: 8px; }
}
