/* ───────────────────────────────────────────────────────────
   Project Roblox · /journey/ stylesheet
   Inherits the global palette + fonts from assets/styles.css.
   This file owns the chat-bubble system, phase dividers, three-
   layer disclosure, ghost (upcoming) entries, and the quest map.
   ─────────────────────────────────────────────────────────── */

/* ── topbar active state ───────────────────────────────── */
.topbar nav a.is-active {
  background: var(--rb-yellow);
  color: var(--ink);
}

/* ── page body specifics ───────────────────────────────── */
.journey-body { font-size: 17px; }

/* ═══════════════════════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════════════════════ */
.j-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  align-items: center;
  gap: clamp(20px, 4vw, 60px);
  padding: clamp(36px, 7vw, 80px) clamp(24px, 5vw, 80px);
  max-width: 1400px;
  margin: 0 auto;
}
.j-hero__art {
  position: relative;
  border-radius: var(--radius-card);
  overflow: hidden;
  border: 4px solid var(--ink);
  box-shadow: var(--shadow-lift);
  background: linear-gradient(135deg, #2A1A3F 0%, #0F0820 100%);
  aspect-ratio: 16 / 10;
}
.j-hero__art img {
  display: block; width: 100%; height: 100%;
  object-fit: cover;
}
/* fallback if image fails to load — abstract gradient placeholder */
.j-hero__art--fallback img { display: none; }
.j-hero__art--fallback::after {
  content: "⬢";
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-size: clamp(80px, 14vw, 200px);
  color: var(--rb-yellow);
  text-shadow: 0 6px 0 var(--ink);
}

.j-hero__copy .kicker {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 1.5px;
  color: var(--rb-yellow);
  background: rgba(255, 224, 102, 0.1);
  border: 2px solid var(--rb-yellow);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  margin-bottom: 18px;
}
.j-hero__copy h1 {
  font-family: var(--font-display);
  font-size: clamp(40px, 6vw, 78px);
  line-height: 0.95;
  margin: 0 0 18px;
  letter-spacing: -0.5px;
  color: var(--paper);
}
.j-hero__copy h1 .pop {
  background: var(--rb-yellow);
  color: var(--ink);
  padding: 2px 14px 6px;
  border-radius: 10px;
  display: inline-block;
  transform: rotate(-1.5deg);
  box-shadow: var(--shadow-block);
}
.j-hero__copy .sub {
  font-size: 18px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.85);
  max-width: 56ch;
  margin: 0 0 26px;
}

.j-stat-strip {
  display: flex; flex-wrap: wrap; gap: 10px;
}
.j-stat {
  background: var(--bg-soft);
  border: 3px solid var(--ink);
  border-radius: 10px;
  padding: 10px 14px;
  box-shadow: var(--shadow-block);
}
.j-stat__num {
  display: block;
  font-family: var(--font-display);
  font-size: 26px;
  color: var(--rb-yellow);
  line-height: 1;
}
.j-stat__lbl {
  display: block;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
  margin-top: 2px;
}

@media (max-width: 880px) {
  .j-hero { grid-template-columns: 1fr; }
  .j-hero__art { aspect-ratio: 16 / 9; }
}

/* ═══════════════════════════════════════════════════════════
   ONBOARDING
   ═══════════════════════════════════════════════════════════ */
.j-onboarding {
  position: relative;
  max-width: 980px;
  margin: 0 auto 40px;
  padding: 28px 32px;
  background: var(--paper);
  color: var(--ink);
  border: 4px solid var(--ink);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-lift);
}
.j-onboarding[hidden] { display: none; }
.j-onboarding h2 {
  font-family: var(--font-display);
  font-size: 24px;
  margin: 0 0 16px;
}
.j-onboarding__dismiss {
  position: absolute;
  top: 12px; right: 12px;
  width: 32px; height: 32px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--rb-yellow);
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  display: grid; place-items: center;
  line-height: 1;
}
.j-onboarding__dismiss:hover { transform: translateY(-2px); }
.j-legend { display: grid; gap: 10px; margin-bottom: 14px; }
.j-legend__row {
  display: grid;
  grid-template-columns: 90px 1fr;
  align-items: center;
  gap: 14px;
}
.j-legend__chip {
  font-family: var(--font-display);
  text-align: center;
  font-size: 13px;
  letter-spacing: 1px;
  padding: 6px 0;
  border-radius: var(--radius-pill);
  border: 3px solid var(--ink);
}
.j-legend__chip--twins   { background: var(--rb-yellow); color: var(--ink); }
.j-legend__chip--parents { background: var(--rb-blue); color: var(--paper); }
.j-legend__chip--tech    { background: var(--ink); color: var(--rb-green); }
.j-legend__row p { margin: 0; font-size: 15px; line-height: 1.5; }
.j-onboarding__cta {
  margin: 14px 0 0;
  padding: 12px 14px;
  background: var(--paper-soft);
  border-left: 4px solid var(--rb-orange);
  border-radius: 6px;
  font-size: 14px;
  color: var(--ink-soft);
}

/* ═══════════════════════════════════════════════════════════
   CONTROLS — sticky reading mode + filters
   ═══════════════════════════════════════════════════════════ */
.j-controls {
  position: sticky;
  top: 70px;          /* sits just below topbar */
  z-index: 30;
  background: rgba(15, 26, 46, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 3px solid var(--ink);
  border-bottom: 3px solid var(--rb-yellow);
  padding: 14px clamp(20px, 4vw, 40px);
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
  justify-content: center;
}
.j-controls__group { display: flex; align-items: center; gap: 10px; }
.j-controls__label {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--rb-yellow);
}

.j-modes { display: flex; border: 3px solid var(--ink); border-radius: var(--radius-pill); background: var(--bg-mid); }
.j-mode {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  padding: 8px 16px;
  background: transparent;
  color: var(--paper);
  border: 0;
  cursor: pointer;
  transition: background .15s;
}
.j-mode:first-child { border-radius: var(--radius-pill) 0 0 var(--radius-pill); }
.j-mode:last-child  { border-radius: 0 var(--radius-pill) var(--radius-pill) 0; }
.j-mode[aria-pressed="true"] {
  background: var(--rb-yellow);
  color: var(--ink);
}
.j-mode:hover:not([aria-pressed="true"]) { background: var(--bg-soft); }

.j-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.j-filter {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 13px;
  padding: 6px 12px;
  border: 3px solid var(--ink);
  border-radius: var(--radius-pill);
  background: var(--bg-mid);
  color: var(--paper);
  cursor: pointer;
  transition: background .15s, transform .15s;
}
.j-filter:hover  { transform: translateY(-2px); }
.j-filter.is-active {
  background: var(--rb-blue);
  color: var(--paper);
}

/* ═══════════════════════════════════════════════════════════
   CHAT STREAM
   ═══════════════════════════════════════════════════════════ */
.j-stream {
  max-width: 820px;
  margin: 40px auto 60px;
  padding: 0 clamp(16px, 4vw, 32px);
}
.j-loading {
  text-align: center;
  color: rgba(255,255,255,0.5);
  padding: 60px 0;
  font-size: 14px;
}
.j-loading__dots { display: inline-flex; gap: 4px; margin-right: 8px; }
.j-loading__dots span {
  width: 7px; height: 7px;
  background: var(--rb-yellow);
  border-radius: 50%;
  animation: j-pulse 1.2s ease-in-out infinite;
}
.j-loading__dots span:nth-child(2) { animation-delay: 0.15s; }
.j-loading__dots span:nth-child(3) { animation-delay: 0.30s; }
@keyframes j-pulse {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40%           { opacity: 1;   transform: scale(1.0); }
}

/* phase divider */
.j-phase {
  position: relative;
  text-align: center;
  margin: 56px 0 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.j-phase::before, .j-phase::after {
  content: "";
  flex: 1;
  height: 3px;
  background: var(--rb-yellow);
  border-radius: 2px;
}
.j-phase__label {
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 2px;
  color: var(--rb-yellow);
  text-transform: uppercase;
  padding: 6px 16px;
  background: var(--bg);
  border: 3px solid var(--rb-yellow);
  border-radius: var(--radius-pill);
  white-space: nowrap;
}
.j-phase__date {
  display: block;
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.55);
  text-transform: uppercase;
  margin-top: 4px;
}

/* entry block — clusters a conversation + its disclosure + outcome */
.j-entry {
  margin: 18px 0 28px;
  scroll-margin-top: 160px;
}
.j-entry.is-active .j-bubble:last-of-type {
  animation: j-active-pulse 2s ease-in-out infinite;
}
@keyframes j-active-pulse {
  0%, 100% { box-shadow: var(--shadow-block); }
  50%      { box-shadow: 0 4px 0 var(--ink), 0 0 0 3px var(--rb-orange); }
}

/* bubbles
   ─── unified card system ───
   FAMILY (Dad, Twin-A, Twin-B) → right-aligned, avatar on RIGHT
   AI    (Claude, Crew)         → left-aligned,  avatar on LEFT
   All avatars share a 44×44 ink-bordered circle with shadow-block.
*/
.j-bubble {
  position: relative;
  max-width: 72%;            /* narrower than before → cleaner left/right read */
  margin: 10px 0;
  padding: 14px 18px 16px;
  border: 3px solid var(--ink);
  border-radius: 18px;
  box-shadow: var(--shadow-block);
  line-height: 1.45;
  font-size: 16px;
}
.j-bubble__who {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 4px;
  opacity: 0.75;
}

/* Per-mode layer spans inside a bubble — exactly one is visible at a time.
   The toggling itself is JS (applyMode); these rules just keep things tidy. */
.j-bubble__layer { display: block; }
.j-bubble__layer[hidden] { display: none; }
.j-bubble__draft {
  display: inline-block;
  font-style: italic;
  opacity: 0.55;
  font-size: 0.92em;
}

/* ──────────────────────────────────────────────────────────────────
   SCROLL-DRIVEN REVEAL — the parallax chat effect.
   Each turn lives inside a .j-turn-segment of fixed scroll-height
   (set via --turn-vh inline style by JS, scaled to message length).
   The bubble inside uses position: sticky so it anchors at the
   viewport's active line throughout the segment. Scroll progress
   within the segment drives the typing animation in JS.
   ────────────────────────────────────────────────────────────────── */

.j-turn-segment {
  position: relative;
  min-height: var(--turn-vh, 55vh);
  /* No padding/margins — the sticky child handles its own breathing room */
}
.j-turn-stage {
  position: sticky;
  top: 28vh;            /* matches ACTIVE_LINE_FRAC in journey.js */
  display: block;
  /* Pull the bubble into the stage; its left/right alignment is
     inherited from the .j-bubble role-specific rules. */
}

/* Dad / twin blinking cursor — chunky yellow block, iMessage-but-chunkier */
.j-typing-cursor {
  display: inline-block;
  width: 0.5em;
  height: 1.05em;
  margin-left: 3px;
  vertical-align: text-bottom;
  background: var(--rb-yellow, #FFE066);
  border: 2px solid var(--ink, #1a1a2e);
  box-shadow: 2px 2px 0 var(--ink, #1a1a2e);
  animation: j-cursor-blink 0.85s steps(2, start) infinite;
}
.j-typing-cursor[hidden] { display: none; }
@keyframes j-cursor-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* Claude / crew "typing..." dots — three glowing dots in a mini-bubble.
   Positioned in the same column as the upcoming bubble. */
.j-typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 22px;
  margin: 10px 0;
  background: var(--paper-soft, #f6f3eb);
  border: 3px solid var(--ink, #1a1a2e);
  border-radius: 999px;
  box-shadow: var(--shadow-block, 4px 4px 0 var(--ink));
  /* Match left-aligned crew/claude bubble column */
  max-width: 120px;
}
.j-typing-dots[hidden] { display: none; }
.j-typing-dots__dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--rb-yellow, #FFE066);
  box-shadow: 0 0 12px var(--rb-yellow, #FFE066), 0 0 24px rgba(255, 224, 102, 0.55);
  animation: j-dot-pulse 1.4s ease-in-out infinite;
}
.j-typing-dots__dot:nth-child(2) { animation-delay: 0.18s; }
.j-typing-dots__dot:nth-child(3) { animation-delay: 0.36s; }
@keyframes j-dot-pulse {
  0%, 80%, 100% { transform: scale(0.55); opacity: 0.35; }
  40% { transform: scale(1.05); opacity: 1; }
}
/* Smoothly soft bubble fade-in for snap-reveal */
.j-turn-segment[data-reveal="snap"] .j-bubble {
  transition: opacity 0.32s ease-out;
}

/* ──────────────────────────────────────────────────────────────────
   NOTICE — "X joined the chat" system pill.
   Not a bubble; small centered chunky chip with dashed yellow border.
   ────────────────────────────────────────────────────────────────── */
.j-notice {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 18px 0 10px;
  opacity: 0;
  transform: translateY(8px) scale(0.92);
  transition: opacity 0.45s ease-out, transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.j-notice.is-revealed {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.j-notice__chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 18px 8px;
  background: rgba(255, 224, 102, 0.10);
  border: 2px dashed var(--rb-yellow, #FFE066);
  border-radius: 999px;
  font-family: var(--font-display, "Lilita One", sans-serif);
  font-size: 11px;
  letter-spacing: 1.7px;
  text-transform: uppercase;
  color: var(--rb-yellow, #FFE066);
  white-space: nowrap;
}
.j-notice__chip::before {
  content: "✦";
  font-size: 13px;
  line-height: 1;
  opacity: 0.85;
}

/* ──────────────────────────────────────────────────────────────────
   OUTCOME CHIP — slides in from the right when its entry completes.
   The chip already has its own .j-outcome styling above; here we just
   add the reveal-state animation hooks.
   ────────────────────────────────────────────────────────────────── */
.j-outcome {
  opacity: 0;
  transform: translateX(60px);
  transition: opacity 0.45s ease-out, transform 0.65s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.j-outcome.is-revealed {
  opacity: 1;
  transform: translateX(0);
}

/* Reduced-motion: kill the reveal animations + show everything fully.
   The scroll engine also short-circuits in this mode, but defense in depth. */
@media (prefers-reduced-motion: reduce) {
  .j-turn-stage { position: static; }
  .j-typing-cursor, .j-typing-dots { display: none !important; }
  .j-notice, .j-outcome {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .j-turn-segment[data-reveal="snap"] .j-bubble { opacity: 1 !important; }
}

/* shared avatar shape — used by every speaker's ::before */
.j-bubble.dad::before,
.j-bubble.twin-a::before,
.j-bubble.twin-b::before,
.j-bubble.claude::before,
.j-bubble.crew::before {
  content: "";
  position: absolute;
  top: 0;
  width: 44px;
  height: 44px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  box-shadow: var(--shadow-block);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* ── FAMILY side (right-aligned, avatar on right) ───────── */
.j-bubble.dad,
.j-bubble.twin-a,
.j-bubble.twin-b {
  margin-left: auto;
  margin-right: 56px;
  border-bottom-right-radius: 4px;
}
.j-bubble.dad::before,
.j-bubble.twin-a::before,
.j-bubble.twin-b::before {
  right: -56px;
}

/* DAD — yellow bubble, bearded avatar */
.j-bubble.dad {
  background: var(--rb-yellow);
  color: var(--ink);
}
.j-bubble.dad .j-bubble__who { color: var(--ink); }
.j-bubble.dad::before {
  background-image: url('../assets/images/avatars/dad.jpg');
}

/* TWIN-A — cream bubble, left-twin avatar */
.j-bubble.twin-a {
  background: var(--paper-soft, #f6efd9);
  color: var(--ink);
}
.j-bubble.twin-a .j-bubble__who { color: var(--rb-blue-d); }
.j-bubble.twin-a::before {
  background-image: url('../assets/images/avatars/twin-a.jpg');
}

/* TWIN-B — cream bubble, right-twin avatar */
.j-bubble.twin-b {
  background: var(--paper-soft, #f6efd9);
  color: var(--ink);
}
.j-bubble.twin-b .j-bubble__who { color: var(--rb-blue-d); }
.j-bubble.twin-b::before {
  background-image: url('../assets/images/avatars/twin-b.jpg');
}

/* ── AI side (left-aligned, avatar on left) ─────────────── */
.j-bubble.claude,
.j-bubble.crew {
  margin-left: 56px;
  border-bottom-left-radius: 4px;
}
.j-bubble.claude::before,
.j-bubble.crew::before {
  left: -56px;
}

/* CLAUDE — paper bubble, yellow hex glyph */
.j-bubble.claude {
  background: var(--paper);
  color: var(--ink);
}
.j-bubble.claude::before {
  content: "⬢";
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--rb-yellow);
  font-size: 22px;
}
.j-bubble.claude .j-bubble__who { color: var(--rb-blue-d); }

/* CREW — blue bubble, role-letter chip */
.j-bubble.crew {
  background: var(--rb-blue);
  color: var(--paper);
}
.j-bubble.crew::before {
  content: attr(data-role-letter);
  display: grid;
  place-items: center;
  background: var(--rb-orange);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 20px;
}
.j-bubble.crew .j-bubble__who { color: var(--paper); opacity: 0.85; }

/* role-specific accent for the avatar */
.j-bubble.crew[data-role-letter="R"]::before { background: var(--rb-green); }   /* Researcher */
.j-bubble.crew[data-role-letter="E"]::before { background: var(--rb-orange); }  /* Engineer */
.j-bubble.crew[data-role-letter="V"]::before { background: var(--rb-pink); }    /* Reviewer (V for review) */
.j-bubble.crew[data-role-letter="W"]::before { background: var(--rb-purple); color: var(--paper);} /* Writer */

/* typing indicator on active state */
.j-typing {
  display: inline-flex;
  gap: 4px;
  margin-left: 6px;
  vertical-align: middle;
}
.j-typing span {
  width: 6px; height: 6px;
  background: currentColor;
  border-radius: 50%;
  animation: j-pulse 1.2s ease-in-out infinite;
  opacity: 0.6;
}
.j-typing span:nth-child(2) { animation-delay: 0.15s; }
.j-typing span:nth-child(3) { animation-delay: 0.30s; }

/* mobile bubble + controls adjustments */
@media (max-width: 600px) {
  /* bubbles: tighter avatars, slightly narrower text */
  .j-bubble { max-width: 84%; font-size: 15px; }

  /* family side mobile */
  .j-bubble.dad,
  .j-bubble.twin-a,
  .j-bubble.twin-b { margin-right: 46px; }
  .j-bubble.dad::before,
  .j-bubble.twin-a::before,
  .j-bubble.twin-b::before { right: -46px; }

  /* AI side mobile */
  .j-bubble.claude,
  .j-bubble.crew { margin-left: 46px; }
  .j-bubble.claude::before,
  .j-bubble.crew::before { left: -46px; }

  /* shared avatar size shrink on mobile */
  .j-bubble.dad::before,
  .j-bubble.twin-a::before,
  .j-bubble.twin-b::before,
  .j-bubble.claude::before,
  .j-bubble.crew::before {
    width: 38px; height: 38px;
  }
  .j-bubble.claude::before { font-size: 18px; }
  .j-bubble.crew::before   { font-size: 17px; }

  /* CONTROLS bar — hide uppercase labels, compact, single-row filters */
  .j-controls {
    padding: 10px clamp(12px, 3vw, 20px);
    gap: 10px;
    justify-content: flex-start;
  }
  .j-controls__label { display: none; }
  .j-controls__group { gap: 8px; }
  .j-mode { padding: 6px 12px; font-size: 13px; }
  .j-filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex: 1 1 auto;
    min-width: 0;
  }
  .j-filters::-webkit-scrollbar { display: none; }
  .j-filter {
    flex: 0 0 auto;
    padding: 5px 10px;
    font-size: 12px;
    border-width: 2px;
  }
}

/* ═══════════════════════════════════════════════════════════
   DISCLOSURE PANELS
   ═══════════════════════════════════════════════════════════ */
.j-disclosure {
  margin: 14px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.j-disc-btn {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 6px 12px;
  background: var(--bg-mid);
  color: var(--paper);
  border: 2px solid var(--ink);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background .15s, transform .15s;
}
.j-disc-btn:hover { transform: translateY(-2px); }
.j-disc-btn[aria-expanded="true"] { background: var(--rb-blue); }
.j-disc-btn.j-disc-btn--tech[aria-expanded="true"] { background: var(--rb-green); color: var(--ink); }

.j-layer {
  margin: 14px 0 0;
  padding: 16px 18px;
  border-radius: 10px;
  border: 3px solid var(--ink);
  font-size: 15px;
  line-height: 1.55;
  animation: j-slide-down 0.2s ease-out;
}
.j-layer[hidden] { display: none; }
@keyframes j-slide-down {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.j-layer.parent {
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow-block);
}
.j-layer.parent::before {
  content: "FOR PARENTS";
  display: inline-block;
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--rb-blue-d);
  margin-bottom: 6px;
}
.j-layer.tech {
  background: var(--ink);
  color: var(--rb-green);
  font-family: ui-monospace, "JetBrains Mono", SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  line-height: 1.6;
}
.j-layer.tech::before {
  content: "// TECH LAYER";
  display: block;
  font-family: ui-monospace, monospace;
  font-size: 11px;
  color: var(--rb-yellow);
  margin-bottom: 8px;
  letter-spacing: 1px;
}
.j-layer.tech dt {
  color: var(--rb-yellow);
  font-weight: 700;
  margin-top: 8px;
}
.j-layer.tech dt:first-child { margin-top: 0; }
.j-layer.tech dd {
  margin: 2px 0 0 0;
  color: var(--paper);
  word-break: break-word;
}
.j-layer.tech dd a {
  color: var(--rb-blue);
  text-decoration: none;
  border-bottom: 1px dotted var(--rb-blue);
}
.j-layer.tech dd a:hover { color: var(--rb-yellow); }
.j-layer.tech ul { margin: 4px 0 0; padding-left: 18px; }
.j-layer.tech ul li::marker { color: var(--rb-orange); }
.j-layer.tech code, .j-layer.tech .pill {
  background: var(--bg-mid);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--rb-yellow);
  font-size: 12px;
}

/* ═══════════════════════════════════════════════════════════
   OUTCOME CHIP — the "where this lives on the site" CTA
   ═══════════════════════════════════════════════════════════ */
.j-outcome {
  margin: 22px 0 0;
  padding: 14px 18px;
  background: var(--ink);                /* ink, not yellow — reads as nav CTA, not chat */
  border: 3px solid var(--rb-yellow);    /* yellow border keeps brand colour without bubble grammar */
  border-radius: 12px;                   /* squarer than bubbles (18px) → different family */
  box-shadow: 0 4px 0 var(--rb-yellow-d, #d9b020);
  display: flex;
  gap: 14px;
  align-items: center;
  text-decoration: none;
  color: var(--paper);
  transition: transform .15s, box-shadow .15s, background .15s;
}
.j-outcome:hover {
  transform: translateY(-2px);
  background: #1a2a4a;                    /* slightly lifted ink on hover */
  box-shadow: 0 6px 0 var(--rb-yellow-d, #d9b020);
}
.j-outcome__arrow {
  font-family: var(--font-display);
  font-size: 22px;
  background: var(--rb-yellow);
  color: var(--ink);
  width: 38px; height: 38px;
  border-radius: 8px;                     /* squared arrow chip, not circle — disambiguates from avatar circles */
  display: grid; place-items: center;
  flex-shrink: 0;
}
.j-outcome__body { flex: 1; min-width: 0; }
.j-outcome__label {
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 0.5px;
  color: var(--rb-yellow);                /* yellow on ink — high contrast, owns the CTA register */
  text-transform: uppercase;
}
.j-outcome__summary {
  font-size: 13px;
  margin-top: 3px;
  color: rgba(255,255,255,0.72);
  line-height: 1.4;
}

/* tags row */
.j-tags {
  margin: 10px 0 0;
  display: flex; flex-wrap: wrap; gap: 4px;
}
.j-tag {
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: var(--bg-soft);
  color: var(--paper);
  border: 2px solid var(--ink);
}

/* draft + status badges */
.j-badge {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 1.5px;
  padding: 2px 8px;
  border-radius: 4px;
  border: 2px solid var(--ink);
  margin-left: 8px;
  vertical-align: middle;
}
.j-badge--draft  { background: var(--rb-pink);   color: var(--ink); }
.j-badge--active { background: var(--rb-orange); color: var(--ink); }
.j-badge--upcoming { background: var(--bg-mid); color: var(--rb-yellow); border-color: var(--rb-yellow); }

/* ═══════════════════════════════════════════════════════════
   GHOST (upcoming) ENTRIES
   ═══════════════════════════════════════════════════════════ */
.j-entry.is-upcoming { opacity: 0.65; }
.j-entry.is-upcoming .j-bubble {
  border-style: dashed;
  background: transparent !important;
  color: var(--paper) !important;
  box-shadow: none;
  backdrop-filter: blur(2px);
}
.j-entry.is-upcoming .j-bubble.dad { border-color: var(--rb-yellow); }
.j-entry.is-upcoming .j-bubble.claude { border-color: var(--paper); }
.j-entry.is-upcoming .j-bubble.crew { border-color: var(--rb-blue); }
.j-entry.is-upcoming .j-bubble.claude::before,
.j-entry.is-upcoming .j-bubble.crew::before {
  opacity: 0.55;
  box-shadow: none;
}
.j-entry.is-upcoming .j-outcome {
  background: transparent;
  color: var(--rb-yellow);
  border-style: dashed;
  box-shadow: none;
}
.j-entry.is-upcoming .j-outcome__arrow {
  background: transparent;
  border: 2px dashed var(--rb-yellow);
  color: var(--rb-yellow);
}
.j-entry.is-upcoming .j-outcome__label,
.j-entry.is-upcoming .j-outcome__summary {
  color: var(--rb-yellow);
}
.j-when {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--rb-yellow);
  margin-top: 6px;
  opacity: 0.8;
}

/* ═══════════════════════════════════════════════════════════
   QUEST MAP
   ═══════════════════════════════════════════════════════════ */
.j-questmap {
  max-width: 1200px;
  margin: 80px auto 40px;
  padding: 0 clamp(20px, 4vw, 40px);
}
.j-questmap__header { text-align: center; margin-bottom: 30px; }
.j-questmap__header h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 44px);
  color: var(--rb-yellow);
  margin: 0 0 8px;
}
.j-questmap__header p { color: rgba(255,255,255,0.7); margin: 0; }

.j-questmap__art {
  position: relative;
  border-radius: var(--radius-card);
  overflow: hidden;
  border: 4px solid var(--ink);
  box-shadow: var(--shadow-lift);
  background: linear-gradient(135deg, var(--bg-soft) 0%, var(--bg-mid) 100%);
  aspect-ratio: 16 / 9;
  margin-bottom: 24px;
}
.j-questmap__art img {
  display: block; width: 100%; height: 100%;
  object-fit: cover;
}
.j-questmap__art--fallback img { display: none; }
.j-questmap__art--fallback::after {
  content: "🗺";
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: clamp(80px, 14vw, 200px);
  opacity: 0.4;
}

.j-questmap__steps {
  list-style: none;
  padding: 0; margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  counter-reset: step;
}
.j-questmap__steps li {
  position: relative;
  padding: 12px 14px 12px 50px;
  background: var(--bg-mid);
  border: 3px solid var(--ink);
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  box-shadow: var(--shadow-block);
}
.j-questmap__steps li span {
  position: absolute;
  left: 8px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px;
  display: grid; place-items: center;
  background: var(--bg-soft);
  color: rgba(255,255,255,0.5);
  font-family: var(--font-display);
  font-size: 15px;
  border-radius: 50%;
  border: 2px solid var(--ink);
}
.j-questmap__steps li em {
  display: block;
  font-style: normal;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 2px;
  font-weight: 500;
  color: rgba(255,255,255,0.55);
}
.j-questmap__steps li.is-done {
  background: var(--bg-soft);
  color: var(--paper);
}
.j-questmap__steps li.is-done span {
  background: var(--rb-green);
  color: var(--ink);
}
.j-questmap__steps li.is-active {
  background: var(--rb-orange);
  color: var(--ink);
  animation: j-active-pulse 2s ease-in-out infinite;
}
.j-questmap__steps li.is-active span {
  background: var(--ink);
  color: var(--rb-yellow);
}
.j-questmap__steps li.is-active em { color: var(--ink); opacity: 0.7; }

/* ═══════════════════════════════════════════════════════════
   FORK SECTION
   ═══════════════════════════════════════════════════════════ */
.j-fork {
  margin: 80px auto 60px;
  padding: 60px clamp(20px, 4vw, 40px);
  background:
    linear-gradient(180deg, transparent 0%, rgba(255,224,102,0.04) 100%);
  border-top: 3px dashed var(--rb-yellow);
}
.j-fork__inner { max-width: 980px; margin: 0 auto; }
.j-fork h2 {
  font-family: var(--font-display);
  font-size: clamp(30px, 4.5vw, 48px);
  color: var(--rb-yellow);
  margin: 0 0 14px;
}
.j-fork .lead {
  font-size: 17px;
  color: rgba(255,255,255,0.85);
  max-width: 60ch;
  margin: 0 0 30px;
}
.j-fork__steps {
  list-style: none;
  padding: 0; margin: 0;
  display: grid;
  gap: 18px;
  counter-reset: fork;
}
.j-fork__steps li {
  position: relative;
  padding: 18px 22px 18px 80px;
  background: var(--bg-mid);
  border: 3px solid var(--ink);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-block);
  counter-increment: fork;
}
.j-fork__steps li::before {
  content: counter(fork);
  position: absolute;
  left: 18px; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px;
  background: var(--rb-yellow);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 22px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 3px solid var(--ink);
}
.j-fork__steps h3 {
  font-family: var(--font-display);
  font-size: 18px;
  margin: 0 0 4px;
  color: var(--rb-yellow);
}
.j-fork__steps p {
  margin: 0;
  color: rgba(255,255,255,0.8);
  font-size: 15px;
  line-height: 1.5;
}
.j-fork__footnote {
  margin-top: 30px;
  font-size: 13px;
  color: rgba(255,255,255,0.55);
}
.j-fork__footnote a { color: var(--rb-yellow); }

/* ═══════════════════════════════════════════════════════════
   FLOATING JUMP-TO-NOW BUTTON
   ═══════════════════════════════════════════════════════════ */
.j-jump {
  position: fixed;
  bottom: 20px; right: 20px;
  z-index: 40;
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 1px;
  padding: 10px 16px;
  background: var(--rb-orange);
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-lift);
  cursor: pointer;
  transition: transform .15s;
}
.j-jump:hover { transform: translateY(-3px); }

/* ═══════════════════════════════════════════════════════════
   ACCESSIBILITY
   ═══════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  .j-entry.is-active .j-bubble:last-of-type,
  .j-questmap__steps li.is-active {
    animation: none !important;
  }
  .j-loading__dots span, .j-typing span { animation: none !important; opacity: 1; }
  .j-layer { animation: none !important; }
}
