/* v4 — the advisory model: bedrock → judgement → leverage.
   The v3 scroll journey, reframed for a consultancy: every stage is light, the middle bar is a stack
   of idea cards that we weigh on a value × feasibility matrix, and each stage carries an exhibit caption.
   Builds on /v2/v2.css (tokens, header, lower sections). */

:root {
  --stage-bedrock: #DCE2E0;
  --stage-judgement: #F6F8F7;
  --stage-leverage: #ECEFF8;
  --paper: #FBFCFB;
}

.journey { position: relative; }
html.js-journey .journey { height: 660vh; }
.journey__mark { position: absolute; left: 0; width: 1px; height: 1px; pointer-events: none; }
html.js-journey .journey__stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.journey__canvas { position: absolute; inset: 0; background: var(--chalk); }
.journey__canvas canvas { display: block; width: 100%; height: 100%; }
.journey__fallback { display: none; }

/* Without WebGL or scripts the journey is a normal, readable sequence. */
html:not(.js-journey) .journey__canvas { position: relative; height: 56vh; display: grid; place-items: center; padding-top: var(--hdr-h); }
html:not(.js-journey) .journey__fallback { display: block; width: 36vmin; height: 36vmin; color: var(--ink); }
html:not(.js-journey) .journey__tags,
html:not(.js-journey) .exhibits,
html:not(.js-journey) .rail { display: none; }
html:not(.js-journey) .panel { padding: 56px var(--gutter); max-width: 900px; }
html:not(.js-journey) .panel--judgement { background: var(--stage-judgement); max-width: none; }

/* ---------- Panels ---------- */
html.js-journey .panel {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: calc(var(--hdr-h) + 24px) var(--gutter) 72px;
  pointer-events: none;
  visibility: hidden;
}
html.js-journey .panel > * { pointer-events: auto; }
.panel > * { max-width: 560px; }
.panel .eyebrow { margin-bottom: 20px; }
.panel__h1 { font-size: clamp(42px, 5.2vw, 82px); }
.panel__h1 span { display: block; white-space: nowrap; }
.panel__h1 em, .panel__h2 em { font-style: normal; color: var(--ultra); }
.panel__h2 { font-size: clamp(36px, 4.2vw, 64px); max-width: 15ch; }
.panel .lede { margin-top: 24px; }
/* .hero__ctas is shared with v2 (mobile CTA logic); undo v2's column layout here. */
.panel .hero__ctas { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; justify-self: auto; gap: 16px 28px; margin-top: 32px; }
.panel__note { margin-top: 24px; color: var(--slate); }
.panel__note .link { color: var(--ink); }
html.js-journey .panel--hero { visibility: visible; }
/* The judgement panel sits right; its column keeps one left edge. */
html.js-journey .panel--judgement { padding-left: max(var(--gutter), calc(100% - 560px - var(--gutter))); }
.panel--judgement .panel__h2 { font-size: clamp(32px, 3.5vw, 52px); max-width: 14ch; }
.panel--judgement .lede { font-size: clamp(16.5px, 1.2vw, 18px); max-width: 44ch; margin-top: 18px; }
html.js-journey .panel--finale { justify-content: flex-end; align-items: center; text-align: center; padding-bottom: 104px; }
.panel--finale .panel__h2 { max-width: 18ch; font-size: clamp(30px, 3.2vw, 48px); margin-inline: auto; }
.panel--finale .link { margin-top: 22px; }
.panel--finale .eyebrow { justify-content: center; }

/* Hero: selected clients, up front */
.trust { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 26px; margin-top: 44px; padding-top: 20px; border-top: 1px solid var(--line); width: min(560px, 100%); }
.trust p { color: var(--slate); }
.trust ul { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; }
.trust img { height: var(--h, 16px); width: auto; filter: brightness(0); opacity: .58; }

/* Judgement: the questions clients bring, each leading to a service */
.questions { margin-top: 22px; border-top: 1px solid var(--line-strong); width: 100%; }
.questions a { position: relative; display: grid; grid-template-columns: 1fr 18px; gap: 3px 16px; padding: 11px 0; border-bottom: 1px solid var(--line); text-decoration: none; transition: padding-left .4s var(--ease); }
.questions a::after { content: ""; grid-row: 1 / span 2; grid-column: 2; align-self: center; width: 9px; height: 9px; border-top: 1.5px solid currentColor; border-right: 1.5px solid currentColor; transform: rotate(45deg); opacity: .45; transition: opacity .3s var(--ease), transform .4s var(--ease); }
.questions a:hover { padding-left: 8px; }
.questions a:hover::after { opacity: 1; transform: translateX(3px) rotate(45deg); }
.questions b { font-stretch: 112%; font-weight: 400; font-size: 18px; line-height: 1.3; letter-spacing: -.018em; transition: color .3s var(--ease); }
.questions a:hover b { color: var(--ultra); }
.questions span { grid-column: 1; color: var(--slate); }

/* Leverage: what gets measured */
.metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 28px; margin-top: 28px; width: min(600px, 100%); }
.metrics li { padding-top: 14px; border-top: 1px solid var(--line-strong); }
.metrics b { display: block; font-stretch: 125%; font-weight: 400; font-size: 20px; letter-spacing: -.02em; }
.metrics span { display: block; margin-top: 6px; color: var(--slate); font-size: 15px; line-height: 1.45; }
.panel--leverage > * { max-width: 600px; }

/* ---------- 3D annotations ---------- */
.journey__tags { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.jtag {
  position: absolute; left: 0; top: 0;
  display: flex; align-items: baseline; gap: 10px;
  padding: 6px 11px 6px 10px;
  white-space: nowrap;
  background: rgba(246, 248, 247, .92);
  border: 1px solid var(--line);
  border-radius: 2px;
  opacity: 0;
  will-change: transform, opacity;
}
.jtag b { font-family: var(--f-mono); font-weight: 500; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink); }
.jtag span { font-size: 13px; color: var(--slate); }
.jtag::before { content: ""; position: absolute; right: 100%; top: 50%; width: var(--lead, 30px); height: 1px; background: var(--line-strong); }
.jtag::after { content: ""; position: absolute; right: calc(100% + var(--lead, 30px) - 3px); top: calc(50% - 3px); width: 7px; height: 7px; border-radius: 50%; background: var(--ultra); }
/* The three ideas worth building: a rank badge, and a leader line to the card it names.
   data-dir says where the tag sits relative to its card: up, right (default leader) or left. */
.jtag--pick { --lead: 26px; align-items: center; gap: 8px; padding: 4px 11px 4px 4px; background: rgba(251, 252, 251, .96); border-color: rgba(52, 69, 240, .4); box-shadow: 0 6px 18px -10px rgba(11, 30, 40, .35); }
.jtag--pick i { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--ultra); color: #fff; font-family: var(--f-mono); font-style: normal; font-size: 10px; line-height: 1; }
.jtag--pick b { font-family: var(--f-text); font-size: 13.5px; font-weight: 500; letter-spacing: -.005em; text-transform: none; }
.jtag--pick::before { background: var(--ultra); opacity: .75; }
.jtag--pick::after { background: #fff; box-shadow: 0 0 0 2px var(--ultra); }
.jtag--pick[data-dir="up"]::before { right: auto; left: 50%; top: 100%; width: 1px; height: var(--lead); }
.jtag--pick[data-dir="up"]::after { right: auto; left: calc(50% - 3.5px); top: calc(100% + var(--lead) - 3.5px); }
.jtag--pick[data-dir="down"]::before { right: auto; left: 50%; top: auto; bottom: 100%; width: 1px; height: var(--lead); }
.jtag--pick[data-dir="down"]::after { right: auto; left: calc(50% - 3.5px); top: auto; bottom: calc(100% + var(--lead) - 3.5px); }
.jtag--pick[data-dir="left"]::before { right: auto; left: 100%; }
.jtag--pick[data-dir="left"]::after { right: auto; left: calc(100% + var(--lead) - 3.5px); }

/* Exhibit captions: each stage is captioned like a figure in a report. */
.exhibits { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.exhibit { position: absolute; bottom: 24px; display: grid; gap: 5px; width: min(340px, 30vw); padding-top: 10px; border-top: 1px solid var(--line-strong); visibility: hidden; opacity: 0; }
.exhibit--left { left: var(--gutter); }
.exhibit--right { right: var(--gutter); }
.exhibit b { color: var(--ink); }
.exhibit span { color: var(--slate); font-size: 13px; line-height: 1.45; }

/* ---------- Progress rail: the mark as navigation ---------- */
.rail {
  position: absolute; z-index: 4;
  left: 50%; bottom: 26px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 7px;
  transform: translateX(-50%);
  color: var(--ink);
}
.rail__bar { position: relative; display: flex; flex-direction: row-reverse; align-items: center; justify-content: flex-end; gap: 12px; padding: 3px 0; text-decoration: none; color: inherit; }
.rail__bar i { display: block; height: 7px; border-radius: 1px; background: currentColor; opacity: .28; transform: skewY(-10deg); transition: opacity .4s var(--ease), background-color .4s var(--ease); }
.rail__bar[data-rail="leverage"] i { width: 22px; }
.rail__bar[data-rail="judgement"] i { width: 30px; }
.rail__bar[data-rail="bedrock"] i { width: 38px; }
.rail__bar span { position: absolute; left: calc(100% + 12px); font-family: var(--f-mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; opacity: 0; transform: translateX(-6px); transition: opacity .35s var(--ease), transform .35s var(--ease); }
.rail__bar:hover span, .rail__bar:focus-visible span { opacity: .9; transform: none; }
.rail__bar.is-on i { opacity: 1; background: var(--ultra); }
.rail.is-complete .rail__bar i { opacity: 1; background: currentColor; }

/* ---------- Client stories: the question first ---------- */
.case__q { margin-top: 20px; color: var(--ultra); }
.case__q + .case__title { margin-top: 6px; }

/* ---------- Session: the written recap as an exhibit ---------- */
.recap__desk { position: relative; padding: clamp(22px, 3vw, 38px); background: var(--core); border: 1px solid var(--line); }
.recap__desk::before {
  content: ""; position: absolute; inset: clamp(22px, 3vw, 38px);
  background: #F1F4F2;
  box-shadow: 0 12px 28px -16px rgba(11, 30, 40, .35);
  transform: rotate(2.2deg) translate(5px, 6px);
}
.recap__page {
  position: relative; z-index: 1;
  padding: 24px 26px 26px;
  background: var(--paper);
  box-shadow: 0 1px 2px rgba(11, 30, 40, .08), 0 22px 44px -20px rgba(11, 30, 40, .38);
  transform: rotate(-1deg);
  transition: transform .6s var(--ease);
}
.session__card:hover .recap__page { transform: rotate(0deg) translateY(-3px); }
.recap__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--slate); }
.recap__head .mono { font-size: 10px; }
/* The mark, blind-embossed: no ink, only light and shadow. */
.recap__mark { width: 34px; height: 34px; color: var(--paper); filter: drop-shadow(-.7px -.7px 0 rgba(255, 255, 255, 1)) drop-shadow(.8px .9px .5px rgba(15, 42, 56, .3)); }
.recap__title { margin-top: 20px; font-stretch: 125%; font-weight: 400; font-size: clamp(19px, 1.6vw, 22px); line-height: 1.12; letter-spacing: -.03em; max-width: 19ch; text-wrap: balance; }
.recap__meta { margin-top: 10px; color: var(--slate); font-size: 10px; }
.recap__toc { margin-top: 20px; border-top: 1px solid var(--line); }
.recap__toc > li { display: grid; grid-template-columns: 24px 1fr; gap: 0 10px; align-items: baseline; padding: 11px 0 12px; border-bottom: 1px solid var(--line); }
.recap__toc > li > .mono { color: var(--slate); font-size: 10px; }
.recap__toc b { font-size: 14.5px; font-weight: 500; }
.recap__lines {
  grid-column: 2; display: block; height: 14px; margin-top: 7px;
  background:
    linear-gradient(rgba(15, 42, 56, .09), rgba(15, 42, 56, .09)) 0 1px / 100% 3px no-repeat,
    linear-gradient(rgba(15, 42, 56, .09), rgba(15, 42, 56, .09)) 0 9px / 68% 3px no-repeat;
}
.recap__lines--short { height: 6px; background: linear-gradient(rgba(15, 42, 56, .09), rgba(15, 42, 56, .09)) 0 1px / 46% 3px no-repeat; }
.recap__rank { grid-column: 2; display: grid; gap: 8px; margin-top: 10px; }
.recap__rank li { display: grid; grid-template-columns: 18px minmax(0, 11em) 1fr; align-items: center; gap: 9px; font-size: 13.5px; }
.recap__rank em { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--ultra); color: #fff; font-family: var(--f-mono); font-size: 9.5px; font-style: normal; line-height: 1; }
.recap__rank span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recap__rank i { position: relative; height: 5px; background: rgba(52, 69, 240, .12); }
.recap__rank i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: calc(var(--w, .5) * 100%); background: var(--ultra); }
.recap figcaption { display: grid; gap: 4px; margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line-strong); }
.recap figcaption b { color: var(--ink); }
.recap figcaption span { color: var(--slate); font-size: 13.5px; line-height: 1.45; }

/* ---------- Short desktop viewports: keep every panel inside the stage ---------- */
@media (min-width: 761px) and (max-height: 880px) {
  .panel--judgement .lede { display: none; }
  .panel .eyebrow { margin-bottom: 14px; }
}
@media (min-width: 761px) and (max-height: 760px) {
  .questions span { display: none; }
  .questions a { padding: 9px 0; }
  .metrics span { display: none; }
  .trust { margin-top: 28px; }
}

/* ---------- Mobile ---------- */
@media (max-width: 760px) {
  html.js-journey .journey { height: 720vh; }
  html.js-journey .panel { justify-content: flex-end; padding: 0 20px 92px; }
  html.js-journey .panel::before {
    content: ""; position: absolute; inset: auto 0 0 0; height: 68%; z-index: -1;
    background: linear-gradient(to bottom, rgba(238, 241, 240, 0), rgba(238, 241, 240, .96) 20%);
  }
  html.js-journey .panel--bedrock::before { background: linear-gradient(to bottom, rgba(220, 226, 224, 0), rgba(220, 226, 224, .96) 20%); }
  html.js-journey .panel--judgement::before { background: linear-gradient(to bottom, rgba(246, 248, 247, 0), rgba(246, 248, 247, .97) 20%); }
  html.js-journey .panel--leverage::before { background: linear-gradient(to bottom, rgba(236, 239, 248, 0), rgba(236, 239, 248, .96) 20%); }
  html.js-journey .panel--judgement { padding-left: 20px; }
  html.js-journey .panel--finale { padding-bottom: 120px; }
  .panel__h1 { font-size: clamp(34px, 10.2vw, 46px); }
  .panel__h1 span { white-space: normal; }
  .panel__h2, .panel--judgement .panel__h2 { font-size: clamp(30px, 8.6vw, 40px); }
  .panel .lede { font-size: 16.5px; margin-top: 16px; }
  .panel--judgement .lede { display: none; }
  .panel .hero__ctas { margin-top: 22px; }
  .panel .hero__ctas .btn { width: 100%; }
  .panel .hero__ctas .btn > span:first-child { flex: 1; }
  .trust { display: none; }
  .questions { margin-top: 16px; }
  .questions a { padding: 9px 0; }
  .questions b { font-size: 15.5px; }
  .questions span { display: none; }
  .metrics { grid-template-columns: 1fr 1fr; gap: 14px 16px; margin-top: 18px; }
  .metrics b { font-size: 16px; }
  .metrics span { font-size: 13px; }
  .exhibits { display: none; }
  .rail { left: auto; right: 20px; bottom: auto; top: calc(var(--hdr-h) + 14px); transform: none; gap: 6px; }
  .rail__bar span { display: none; }
  .jtag span { display: none; }
  .jtag--pick { padding: 3px; border-radius: 50%; }
  .jtag--pick b, .jtag--pick::before, .jtag--pick::after { display: none; }
  html.js-journey .panel--finale::before { display: none; }
  .recap__desk { padding: 14px; }
  .recap__desk::before { inset: 14px; }
  .recap__page { padding: 20px 16px 22px; }
  .recap__rank li { grid-template-columns: 18px minmax(0, 1fr) 40px; }
  .recap__rank span { white-space: normal; }
}
