/* =========================================================================
   FEATURE JOURNEY — drag-controlled carousel (no scroll-jacking)
   -------------------------------------------------------------------------
   A normal-flow section: a ruler/scale on TOP, product content BELOW. The
   track only moves horizontally when the user DRAGS the scale (or clicks a
   label). Vertical page scroll is completely free. Isolated file — remove the
   <link>, <script> and <section.jrny> to revert.
   ========================================================================= */

:root { --jrny-gap: 240px; }

.jrny {
  position: relative;
  background: var(--bg);
  padding: 30px 0 82px;            /* white breathing above the scale; 82px below to match the copilot→insights divider spacing */
  overflow: hidden;                /* clip the off-screen panels */
  /* transparent gap above the journey so the fixed dot-grid shows through as a
     divider between this and the previous section (per user). Unified ~100px
     divider, matching the other section gaps. */
  margin-top: clamp(64px, 8vw, 100px);
}
/* trim the grey empty space below the "what MeritX does" feature cards so the
   dotted divider sits closer to them; a touch less space above the heading too.
   The bottom box-shadow casts a soft "emboss" onto the recessed dotted divider. */
.s-whatwedo {
  padding-top: clamp(48px, 7vw, 92px);
  padding-bottom: 28px;
  position: relative;
  z-index: 1;
  box-shadow: 0 16px 22px -12px rgba(15, 23, 42, 0.16);
}

/* tighten the gap between the feature cards and the CTA button on every stop */
.jrny .feat-list { margin-bottom: 6px; }
.jrny .feat__copy .btn { margin-top: 16px; }

/* ---- the ruler / scale (now on top) — monochrome ruler, Vise-style ---- */
.jrny {
  --jrny-line:      color-mix(in srgb, var(--text) 20%, transparent);
  --jrny-tick:      color-mix(in srgb, var(--text) 14%, transparent);
  --jrny-tick-2:    color-mix(in srgb, var(--text) 28%, transparent);
  --jrny-label-off: color-mix(in srgb, var(--text) 32%, transparent);
}
.jrny__scale {
  position: relative;
  height: 80px;
  overflow: hidden;
  cursor: grab;
  touch-action: pan-y;             /* vertical page scroll stays free; we take horizontal */
  user-select: none;
}
.jrny__scale.is-dragging { cursor: grabbing; }

/* soft fade at the far left/right ends of the scale */
.jrny__scale::before,
.jrny__scale::after {
  content: "";
  position: absolute; top: 0; bottom: 0; width: 13%; max-width: 220px;
  z-index: 4; pointer-events: none;
}
.jrny__scale::before { left: 0;  background: linear-gradient(90deg, var(--bg), transparent); }
.jrny__scale::after  { right: 0; background: linear-gradient(270deg, var(--bg), transparent); }

/* no centre marker in the reference */
.jrny__center { display: none; }

/* moving inner layer (ticks + labels translate together) */
.jrny__scalein {
  position: absolute;
  inset: 0;
  padding-left: calc(50vw - var(--jrny-gap) / 2);   /* first label centred at rest */
  will-change: transform;
}
.jrny__scalein.is-anim { transition: transform .55s cubic-bezier(.22,1,.36,1); }

/* the ruler: a hairline with fine ticks hanging below it */
.jrny__ticks {
  position: absolute;
  left: 0; top: 46px;
  width: 900vw; height: 14px;
  border-top: 1px solid var(--jrny-line);
}
.jrny__ticks::before {           /* fine minor ticks */
  content: "";
  position: absolute; left: 0; top: 0; width: 100%; height: 5px;
  background-image: repeating-linear-gradient(90deg, var(--jrny-tick) 0 1px, transparent 1px 7px);
}

.jrny__labels { position: relative; white-space: nowrap; }
.jrny__label {
  position: relative;
  display: inline-block;
  width: var(--jrny-gap);
  text-align: center;
  vertical-align: top;
  margin-top: 8px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--jrny-label-off);
  background: none;
  transition: color .32s ease, font-size .32s ease, font-weight .32s ease;
  cursor: pointer;
}
.jrny__label.is-active { color: var(--text); font-weight: 700; font-size: 16px; }
/* the MAIN marking — a tall tick centred exactly under each name */
.jrny__label::after {
  content: "";
  position: absolute;
  left: 50%; top: 38px;
  width: 2px; height: 15px;
  transform: translateX(-50%);
  background: color-mix(in srgb, var(--text) 45%, transparent);
}
.jrny__label.is-active::after { background: var(--text); }

/* ---- the content track (below the scale) ---- */
/* height is set by JS to fit the ACTIVE panel, so shorter stops sit right under
   the scale instead of floating in the middle of the tallest panel's height. */
.jrny__viewport {
  position: relative;
  overflow: hidden;
  transition: height .55s cubic-bezier(.22,1,.36,1);
}
.jrny__track {
  display: flex;
  align-items: flex-start;         /* panels take their own height, top-aligned */
  width: max-content;
  will-change: transform;
}
.jrny__track.is-anim { transition: transform .55s cubic-bezier(.22,1,.36,1); }
.jrny__panel {
  flex: 0 0 100vw;
  display: flex;
  align-items: flex-start;
  padding: 22px 0 12px;
}
.jrny__panelin { width: 100%; }
.jrny__panelin .container { padding-block: 0; }
.jrny__panelin .feat { margin: 0; }

/* tighten the gap between the copy and the visual: cap each side to its content
   width and centre the pair, so there's no dead space in a wide text column.
   The VISUAL always gets the wider track (660) and the COPY the narrower (500),
   regardless of normal/reverse order — so mocks never get squished. */
.jrny .feat {
  grid-template-columns: minmax(0, 500px) minmax(0, 660px);
  justify-content: center;
  column-gap: 72px;
  row-gap: 32px;
}
.jrny .feat--reverse {
  grid-template-columns: minmax(0, 660px) minmax(0, 500px);
}
@media (max-width: 639px) {
  .jrny .feat, .jrny .feat--reverse { grid-template-columns: 1fr; }
}

/* ---- phones: show the neighbouring stops on the scale ----
   Each label occupies a fixed --jrny-gap slot, so at the desktop 240px only
   ~1.5 slots span a 375px screen — the centred name filled the scale and the
   thing read as a static caption rather than something you can drag. A 118px
   slot fits just over three, so the previous/next names sit either side under
   the existing edge fades. Dragging and tapping already worked (journey.js
   uses pointer events and the labels are real buttons); they were simply the
   only stop you could see. */
@media (max-width: 639px) {
  :root { --jrny-gap: 126px; }
  /* 13.5px matches .gg__lead in the "How MeritX works" block, so the stop names
     read at the same size as that section's body copy */
  .jrny__label {
    font-size: 13.5px;
    padding-bottom: 22px;     /* 18px of text -> ~40px of tappable height */
  }
  .jrny__label.is-active { font-size: 14.5px; }

  /* ---- one running order for every stop ----
     The panels disagree in the markup: Stock Research / Screener / Fund
     Workspace put .feat__copy first, Terminal / Strategies put .feat__visual
     first, so stacked into one column they alternated. Dissolving .feat__copy
     with display:contents promotes its children into the .feat grid, and
     explicit `order` then fixes the same sequence everywhere —
     eyebrow, heading, blurb, the product mock, the feature cards, the CTA.
     Child margins go to 0 so the grid gap is the only spacing. */
  .jrny .feat__copy { display: contents; }
  .jrny .feat__copy > .eyebrow       { order: 1; }
  .jrny .feat__copy > .section-title { order: 2; margin-top: 0; }
  .jrny .feat__copy > .section-sub   { order: 3; margin-top: 0; }
  .jrny .feat__visual                { order: 4; }
  .jrny .feat__copy > .feat-list     { order: 5; margin: 0; }
  .jrny .feat__copy > .btn           { order: 6; margin-top: 0; justify-self: start; }

  /* ---- compact the panel copy ---- */
  .jrny .feat { gap: 16px; }
  /* line-height has to clear the pill, not the text: at 32px the pill's box is
     35px tall inside what was a 25px line box, so it bit ~2px into the line
     above. Open the leading and drop most of the -0.2em baseline nudge (the
     pill wraps onto its own line at this width, so it does not need it). */
  .jrny .section-title { font-size: 24px; line-height: 1.65; }
  .jrny .section-title em.mx-fx-rot { vertical-align: -0.06em; }
  /* the rolling phrase in every stop's heading matches the terminal intro pill
     (.tintro .mx-fx-rot in terminal-vert.css) — same clamp, not a lookalike
     number, so the two stay identical at every width. Widest phrase here
     ("screen and chart.") is 219px of the 339px available. */
  .jrny .section-title em.mx-fx-rot { font-size: clamp(24px, 8.53vw, 32px); }
  .jrny .section-sub { font-size: 14px; line-height: 1.5; }
  /* Two boxes per row. The base list is auto-fit/minmax(190px), which needs
     380px for a second column — 41px more than the 339px available — so every
     card claimed a full row and left half the width empty beside it. Each card
     already stacks icon-over-text, so it reads fine at ~165px. */
  .jrny .feat-list { grid-template-columns: 1fr 1fr; gap: 10px; }
  .jrny .feat-item { padding: 12px; gap: 8px; }
  .jrny .feat-item .ic { width: 30px; height: 30px; }
  .jrny .feat-item .tx b { font-size: 14px; }
  .jrny .feat-item .tx span { font-size: 12.5px; line-height: 1.45; }
  .jrny .feat__copy .btn { padding: 9px 16px; font-size: 13.5px; }

  /* ---- shrink the page mock ----
     It is a decorative screenshot with a lot of internal structure, so it is
     scaled as a whole rather than by unpicking every child. `zoom` (unlike
     transform:scale) shrinks the layout box too, so nothing is left behind it;
     the width is pre-divided by the same factor so it still fills the column. */
  .jrny .feat__visual .mock { zoom: .78; width: calc(100% / .78); }
}

/* description text: full-strength (black in light mode), no reveal shade */
.jrny .section-sub,
.jrny .section-sub .scrollreveal-unit {
  color: var(--text) !important;
  -webkit-text-fill-color: var(--text) !important;
  opacity: 1 !important;
  filter: none !important;
}

/* ---- MERITX brand palette remap (scoped to the journey mocks) ----
   Mains: #2708A0 navy · #F8FAFC · #ffd700 gold · #7B7B7B grey · #000
   Add-ons: #4969FF blue · #C9A227 deep gold · #4225c3 violet
   Green/red stay ONLY as functional signals (+/-%, sparklines, KEEP/DROP). */
.jrny {
  --accent: #4969FF;                       /* dark theme: brand blue reads on near-black */
  --accent-2: #4225c3;
  --accent-soft: rgba(73, 105, 255, 0.14);
  --grad: linear-gradient(135deg, #4969FF 0%, #4225c3 100%);
  --purple-bright: #4225c3;
  --gold: #FFD700;
}
[data-theme="light"] .jrny {
  --accent: #2708A0;                       /* light theme: brand navy */
  --accent-2: #4225c3;
  --accent-soft: rgba(39, 8, 160, 0.10);
  --gold: #C9A227;
}
/* Quality bar: green -> brand gold; Momentum -> brand blue #4969FF (user 2026-07-14);
   Value stays --accent (navy on light) but flips to violet on dark so it doesn't
   collide with the now-blue Momentum bar. */
.jrny .s-research__bar--q > span { background: var(--gold); }
.jrny .s-research__bar--m > span { background: #4969FF; }
:root:not([data-theme="light"]) .jrny .s-research__bar--v > span { background: #4225c3; }
/* QVM score chips: green -> black-on-gold (the MERITX Excel pairing) */
.jrny .s-screener__row .badge--green { color: var(--text); background: color-mix(in srgb, var(--gold) 22%, transparent); }
/* Portfolio donut 4th sector: green -> brand grey (categorical, not a signal) */
.jrny .s-wv-dot--4 { background: #7B7B7B; }

/* ---- Fund Workspace placeholder mock ---- */
.jrny-ph__body { display: flex; flex-direction: column; gap: 9px; padding: 16px; }
.jrny-ph__row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
}
.jrny-ph__name { flex: 1; min-width: 0; font-weight: 600; color: var(--text); font-size: 0.92rem; }
/* image-2/3/4 card language: blue logo tile + name/category + green MX-score chip */
.jrny-ph__row { padding: 10px 14px; }
.jrny-ph__ava {
  width: 32px; height: 32px; flex: none; border-radius: 9px;
  display: grid; place-items: center;
  font-size: 0.68rem; font-weight: 700;
  color: var(--accent); background: var(--accent-soft); border: 1px solid var(--border);
}
.jrny-ph__nm { flex: 1; min-width: 0; }
.jrny-ph__nm b { display: block; font-size: 0.85rem; font-weight: 650; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jrny-ph__nm span { display: block; font-size: 0.72rem; color: var(--muted); margin-top: 1px; }
.jrny-ph__score {
  flex: none; font-size: 0.7rem; font-weight: 700; letter-spacing: .02em;
  padding: 4px 8px; border-radius: 6px;
  color: var(--text); background: color-mix(in srgb, var(--gold, #C9A227) 22%, transparent);
}
.jrny-ph__tag {
  flex: none; font-size: 0.62rem; font-weight: 700; letter-spacing: .06em;
  padding: 4px 9px; border-radius: 6px; text-transform: uppercase;
}
.jrny-ph__tag.pos  { color: var(--green-text); background: color-mix(in srgb, var(--green) 15%, transparent); }
.jrny-ph__tag.warn { color: var(--gold);       background: color-mix(in srgb, var(--gold) 16%, transparent); }
.jrny-ph__tag.neg  { color: var(--red-text);   background: color-mix(in srgb, var(--red) 14%, transparent); }
.jrny-ph__v { flex: none; width: 34px; text-align: right; font-weight: 700; color: var(--text); }
.jrny-ph__foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 4px; padding: 0 4px; font-size: 0.72rem; color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  .jrny__track.is-anim, .jrny__scalein.is-anim { transition: none; }
}
