/* =========================================================================
   MeritX — Products horizontal expanding accordion (EXPERIMENTAL)
   "Match & move" hover showcase (à la blueoceanimc): panels sit collapsed as
   vertical labels; hovering one expands it to reveal SERVICE 0N badge + title +
   description over a big ghost watermark. Pure CSS (flex-grow), theme-aware via
   the landing tokens (--surface/--bg-elev/--border/--text/--text-2/--muted).
   Isolated in this file so the experiment reverts by removing the <link> + section.
   ========================================================================= */
.pacc {
  display: flex;
  gap: 12px;
  height: 460px;
  margin-top: 8px;
}
.pacc__panel {
  position: relative;
  flex: 0.6 1 0%;
  min-width: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  transition: flex-grow .55s cubic-bezier(.4, 0, .2, 1), background .4s ease, border-color .4s ease;
}
/* the resting-open panel, and any panel under the cursor, expand */
.pacc__panel.is-open { flex-grow: 5.4; background: var(--bg-elev); }
.pacc:hover .pacc__panel { flex-grow: 0.6; background: var(--surface); }        /* hovering the strip collapses all… */
.pacc:hover .pacc__panel:hover { flex-grow: 5.4; background: var(--bg-elev); }  /* …except the one being pointed at */

/* accent left-edge on the expanded panel (per-panel colour via --pc) */
.pacc__panel::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--pc, var(--accent)); opacity: 0; transition: opacity .45s ease;
}
.pacc__panel.is-open::before { opacity: 1; }
.pacc:hover .pacc__panel::before { opacity: 0; }
.pacc:hover .pacc__panel:hover::before { opacity: 1; }

.pacc__link { display: block; height: 100%; position: relative; padding: 30px 30px; color: inherit; text-decoration: none; }

/* collapsed state: a vertical, rotated label pinned to the bottom */
.pacc__label {
  position: absolute; left: 34px; bottom: 32px;
  transform: rotate(-90deg); transform-origin: left bottom;
  font-family: var(--font-sans); font-weight: 700; letter-spacing: .2em; text-transform: uppercase;
  font-size: 13px; color: var(--text-2); white-space: nowrap;
  transition: opacity .3s ease; pointer-events: none;
}
.pacc__panel.is-open .pacc__label { opacity: 0; }
.pacc:hover .pacc__panel .pacc__label { opacity: 1; }
.pacc:hover .pacc__panel:hover .pacc__label { opacity: 0; }

/* big faint ghost word behind the content — only in the OPEN panel */
.pacc__ghost {
  position: absolute; left: 22px; top: 30%;
  font-family: var(--font-sans); font-weight: 900; font-size: clamp(80px, 11vw, 150px); line-height: .8;
  letter-spacing: -.03em; color: var(--text); opacity: 0; white-space: nowrap; pointer-events: none;
  transition: opacity .5s ease;
}
.pacc__panel.is-open .pacc__ghost { opacity: .06; }
.pacc:hover .pacc__panel .pacc__ghost { opacity: 0; }
.pacc:hover .pacc__panel:hover .pacc__ghost { opacity: .06; }

/* expanded content: fades/slides in only when the panel is open */
.pacc__body {
  position: relative; z-index: 2; max-width: 380px;
  opacity: 0; transform: translateX(-8px); pointer-events: none;
  transition: opacity .45s ease .08s, transform .55s cubic-bezier(.22, 1, .36, 1);
}
.pacc__panel.is-open .pacc__body { opacity: 1; transform: none; pointer-events: auto; }
.pacc:hover .pacc__panel .pacc__body { opacity: 0; transform: translateX(-8px); pointer-events: none; }
.pacc:hover .pacc__panel:hover .pacc__body { opacity: 1; transform: none; pointer-events: auto; }

.pacc__badge {
  display: inline-block; border: 1.5px solid var(--pc, var(--accent)); color: var(--pc, var(--accent));
  border-radius: 40px; padding: 6px 16px; font-size: 11px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase;
}
.pacc__title { font-size: clamp(26px, 3vw, 38px); font-weight: 800; line-height: 1.02; letter-spacing: -.01em; margin: 20px 0 14px; color: var(--text); }
.pacc__desc { font-size: 14.5px; line-height: 1.6; color: var(--text-2); }
.pacc__cta { display: inline-flex; align-items: center; gap: 6px; margin-top: 22px; font-weight: 600; font-size: 14px; color: var(--pc, var(--accent)); }
.pacc__cta svg { transition: transform .3s ease; }
.pacc__panel:hover .pacc__cta svg { transform: translateX(4px); }

/* icon chip at the top of an expanded panel */
.pacc__ico {
  display: none;   /* removed — no extra icon/symbol chips per user request */
  width: 46px; height: 46px; border: 1.5px solid var(--pc, var(--accent));
  align-items: center; justify-content: center; color: var(--pc, var(--accent)); margin-bottom: 20px;
}
.pacc__ico svg { width: 22px; height: 22px; }

/* variant: the accordion living inside the landing "MeritX — Terminal" window frame.
   Contained to the site's .container margin (no longer edge-to-edge) so the graphs
   don't look stretched — the window fills the 1360px content width and keeps its border. */
.terminal-wrap--full .terminal { max-width: none; margin-inline: 0; }   /* fill the .container width */
.terminal-wrap--full .terminal.window { border-radius: var(--r-lg) !important; overflow: hidden; }   /* rounded, contained window */
/* drop the terminal's extra bottom padding so the gap to the journey below is
   just the journey's ~100px dotted divider (was padding 120px + margin 128px). */
.terminal-wrap.terminal-wrap--full { padding-bottom: 0; }
/* keep the card's drop shadow, plus a top emboss onto the dotted band above it */
.terminal-wrap--full .terminal.window { box-shadow: var(--shadow), 0 -16px 24px -16px var(--emboss-shadow); }
.terminal .pacc--term { padding: 12px; gap: 2px; height: clamp(480px, 84vh, 900px); }

/* jumbled tab order (visual only; DOM order unchanged). Command Deck stays
   first & open; the other six are shuffled "here and there" per user. */
.pacc--term .pacc__panel:nth-child(1) { order: 0; }  /* Command Deck  */
.pacc--term .pacc__panel:nth-child(2) { order: 4; }  /* Stocks        */
.pacc--term .pacc__panel:nth-child(3) { order: 1; }  /* Screener      */
.pacc--term .pacc__panel:nth-child(4) { order: 6; }  /* Strategy Lab  */
.pacc--term .pacc__panel:nth-child(5) { order: 2; }  /* Portfolio Genie */
.pacc--term .pacc__panel:nth-child(6) { order: 5; }  /* Sector Pulse  */
.pacc--term .pacc__panel:nth-child(7) { order: 3; }  /* Smart Money   */
/* one hero visual per tool — modest open width, narrower collapsed strips */
.pacc--term .pacc__panel { flex-grow: 0.7; background: var(--bg); }
.pacc--term .pacc__panel.is-open { flex-grow: 5; background: var(--surface); }
.pacc--term:hover .pacc__panel { flex-grow: 0.7; background: var(--bg); }
.pacc--term:hover .pacc__panel:hover { flex-grow: 5; background: var(--surface); }
.pacc--term .pacc__link { padding: 18px 20px; }
.pacc--term .pacc__ghost { display: none; }                 /* graphics fill the box instead of the ghost word */

/* expanded body = compact header + the tool's hero visual. FIXED width so the charts
   inside always lay out at full (expanded) size and just get clipped when collapsed. */
.pacc--term .pacc__body { width: 46vw; max-width: 860px; height: 100%; display: flex; flex-direction: column; }
.pacc--term .pacc__head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; flex: none; }
.pacc--term .pacc__ico { margin-bottom: 0; width: 42px; height: 42px; }
.pacc--term .pacc__htxt { flex: 1; min-width: 0; }
.pacc--term .pacc__title { font-size: 20px; margin: 0; line-height: 1.05; }
.pacc--term .pacc__desc { font-size: 12px; margin: 3px 0 0; max-width: 560px; color: var(--text-2); }
.pacc--term .pacc__open { display: inline-flex; align-items: center; gap: 5px; flex: none; font-size: 12.5px; font-weight: 600; color: var(--pc, var(--accent)); text-decoration: none; }
.pacc--term .pacc__gfx { flex: 1; min-height: 0; overflow: hidden; }
/* the open panel's visual fills the (now taller) panel instead of floating at
   the top. mx-chart drops its fixed 190px height and flex-fills — its own
   ResizeObserver (terminal-charts.js) redraws it at the new height. */
.pacc--term .pacc__gfx .term-card { height: 100%; display: flex; flex-direction: column; }
.pacc--term .pacc__gfx .term-panel__head { flex: none; }
.pacc--term .pacc__gfx .mx-chart { flex: 1 1 auto; height: auto; min-height: 0; }

/* contextual KPI strip above each chart — gives every tool distinct numbers so
   the panels don't all read as "just a line chart". flex:none so the chart keeps
   filling the space below it. */
.pacc--term .pacc__kpis {
  flex: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 2px 0 12px;
}
.pacc--term .pacc__kpi {
  min-width: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.pacc--term .pacc__kpi-k {
  font-size: 10px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pacc--term .pacc__kpi-v {
  font-family: var(--font-mono); font-size: 15px; font-weight: 700;
  color: var(--text); letter-spacing: -.01em; line-height: 1.1;
}
.pacc--term .pacc__kpi-d { font-family: var(--font-mono); font-size: 11px; font-weight: 600; color: var(--muted); }
.pacc--term .pacc__kpi .up   { color: var(--green); }
.pacc--term .pacc__kpi .down { color: var(--red); }
.pacc--term .pacc__kpi .warn { color: var(--gold); }
/* KPI strip only makes sense in the expanded panel; hide while collapsed so it
   doesn't flash during the width transition. */
.pacc--term .pacc__panel:not(.is-open):not(:hover) .pacc__kpis { opacity: 0; }

/* ---- arrangement variants: vary graph vs numbers layout per panel so the
        open panels don't all read as "row of stats, then a line chart" ---- */
/* default = KPI row on top, chart below (Command Deck) */

/* chart on top, KPI row as a footer (Stocks) */
.pacc--term .pacc__gfx--stats-below .pacc__kpis { order: 3; margin: 12px 0 2px; }
.pacc--term .pacc__gfx--stats-below .mx-chart   { order: 2; }

/* KPI 2×2 block on top, chart below (Portfolio Genie) */
.pacc--term .pacc__gfx--stats-2x2 .pacc__kpis { grid-template-columns: 1fr 1fr; }

/* two-column: KPI sidebar next to the chart (Screener = left, Strategy Lab = right).
   term-card becomes a grid: head spans the top, then kpi + chart share a row. */
.pacc--term .pacc__gfx--split-left  .term-card,
.pacc--term .pacc__gfx--split-right .term-card {
  display: grid; column-gap: 14px; grid-template-rows: auto 1fr;
}
.pacc--term .pacc__gfx--split-left .term-card {
  grid-template-columns: minmax(150px, 34%) 1fr;
  grid-template-areas: "head head" "kpi chart";
}
.pacc--term .pacc__gfx--split-right .term-card {
  grid-template-columns: 1fr minmax(150px, 34%);
  grid-template-areas: "head head" "chart kpi";
}
.pacc--term .pacc__gfx--split-left  .term-panel__head,
.pacc--term .pacc__gfx--split-right .term-panel__head { grid-area: head; }
.pacc--term .pacc__gfx--split-left  .pacc__kpis,
.pacc--term .pacc__gfx--split-right .pacc__kpis {
  grid-area: kpi; grid-template-columns: 1fr; align-content: start; margin: 0;
}
.pacc--term .pacc__gfx--split-left  .mx-chart,
.pacc--term .pacc__gfx--split-right .mx-chart { grid-area: chart; }

/* ---- Sector Pulse: multi-component card (heatmap + breadth bar + stat grid) ---- */
.pacc--term .term-card--sp { gap: 14px; }
.pacc--term .sp-lbl {
  font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); display: flex; justify-content: space-between; align-items: center; margin-bottom: 7px;
}
.pacc--term .sp-lbl span { color: var(--text-2); font-family: var(--font-mono); font-weight: 600; letter-spacing: 0; }
.pacc--term .sp-heat { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.pacc--term .sp-heat .s-terminal__heat { flex: 1; grid-auto-rows: 1fr; gap: 6px; }
.pacc--term .sp-heat .s-terminal__cell { justify-content: center; }
.pacc--term .sp-bar { flex: none; }
.pacc--term .term-card--sp .s-breadth { grid-template-columns: repeat(4, 1fr); gap: 8px; flex: none; }

@media (prefers-reduced-motion: reduce) {
  .pacc__panel, .pacc__body, .pacc__label, .pacc__panel::before { transition: none; }
}

/* stack vertically on narrow screens (each panel becomes a short open card) */
@media (max-width: 639px) {
  .pacc, .terminal .pacc--term { flex-direction: column; height: auto; }
  .pacc__panel, .pacc:hover .pacc__panel, .pacc:hover .pacc__panel:hover { flex: none; min-height: 150px; background: var(--bg-elev); }
  .pacc__panel::before, .pacc:hover .pacc__panel::before { opacity: 1; }
  .pacc__label, .pacc:hover .pacc__panel .pacc__label { opacity: 0; }
  .pacc__body, .pacc:hover .pacc__panel .pacc__body { opacity: 1; transform: none; pointer-events: auto; }
  .pacc__ghost { font-size: 90px; }
}
