/* Inner pages (How It Works, Products). Loaded AFTER the frozen homepage stylesheets and only adds
   new classes — the homepage never loads this file. Same tokens, type scale, buttons, motion. */

/* ---------- page hero: the homepage atmosphere without the diagram ---------- */
.hero--page { padding-block: clamp(72px, 9vw, 124px) clamp(60px, 7.5vw, 104px); border-bottom: 1px solid rgba(214, 227, 245, 0.7); }
.hero--page .eyebrow { margin-bottom: 20px; }
.hero--page .h1 { font-size: clamp(2.25rem, 1.4rem + 3.4vw, 3.875rem); max-width: 17em; margin-inline: auto; }
.hero--page .lead { margin: 24px auto 0; max-width: 40rem; }

/* How It Works hero: centred, with the stage index (order carried by the line, not numbers) */
.flowindex { display: flex; align-items: center; justify-content: center; margin: 48px auto 0; padding: 0; }
.flowindex li { display: flex; align-items: center; }
.flowindex li + li::before { content: ""; width: clamp(14px, 4.4vw, 52px); height: 1px; background: linear-gradient(90deg, var(--blue-300), var(--blue-200)); }
.flowindex a {
  --pad: clamp(8px, 2.2vw, 20px);
  position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--pad);
  font-size: 0.9375rem; font-weight: 600; letter-spacing: 0.005em; color: var(--navy); transition: color 0.25s var(--ease);
}
/* hairline underline — the same language as the header nav, never a pill */
.flowindex a::after {
  content: ""; position: absolute; left: var(--pad); right: var(--pad); bottom: 8px; height: 1.5px; border-radius: 2px;
  background: var(--blue); transform: scaleX(0); transform-origin: left; transition: transform 0.35s var(--ease);
}
.flowindex a:hover, .flowindex a:focus-visible { color: var(--blue); }
.flowindex a:hover::after, .flowindex a:focus-visible::after { transform: scaleX(1); }
/* current: the stage last jumped to (CSS :target — no script) */
body:has(#ingest:target) .flowindex a[href="#ingest"],
body:has(#analyze:target) .flowindex a[href="#analyze"],
body:has(#execute:target) .flowindex a[href="#execute"],
body:has(#report:target) .flowindex a[href="#report"] { color: var(--blue); }
body:has(#ingest:target) .flowindex a[href="#ingest"]::after,
body:has(#analyze:target) .flowindex a[href="#analyze"]::after,
body:has(#execute:target) .flowindex a[href="#execute"]::after,
body:has(#report:target) .flowindex a[href="#report"]::after { transform: scaleX(1); }
@media (min-width: 600px) {
  .flowindex { margin-top: 52px; }
  .flowindex a { --pad: clamp(16px, 2vw, 24px); }
  .flowindex li + li::before { width: clamp(32px, 4.2vw, 64px); }
}

/* Products hero: same atmosphere, different composition — left-aligned copy + product index */
.hero--index { text-align: left; }
.hero__split { display: grid; gap: 40px; align-items: end; }
.hero--index .hero__copy { margin: 0; max-width: 38rem; }
.hero--index .h1 { margin-inline: 0; max-width: 12em; }
.hero--index .lead { margin-inline: 0; max-width: 34rem; }
.pindex ul { border-top: 1px solid rgba(12, 26, 75, 0.1); }
.pindex a {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 52px; padding: 10px 2px;
  border-bottom: 1px solid rgba(12, 26, 75, 0.1); font-size: 1.0625rem; font-weight: 550; color: var(--navy); transition: color 0.2s, padding 0.3s var(--ease);
}
.pindex a svg { flex: none; width: 15px; height: 15px; color: var(--blue); opacity: 0.55; transform: rotate(90deg); transition: opacity 0.2s, transform 0.3s var(--ease); }
.pindex a:hover { color: var(--blue); padding-left: 6px; }
.pindex a:hover svg { opacity: 1; transform: rotate(90deg) translateX(2px); }
@media (min-width: 900px) {
  .hero__split { grid-template-columns: minmax(0, 7fr) minmax(0, 4.5fr); gap: clamp(48px, 7vw, 120px); }
}
@media (max-width: 599.98px) {
  .pindex ul { border-top-color: rgba(12, 26, 75, 0.07); }
  .pindex a { min-height: 60px; padding-block: 14px; border-bottom-color: rgba(12, 26, 75, 0.07); }
}

.tlink { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-size: 1rem; font-weight: 650; color: var(--blue); }
.tlink svg { width: 16px; height: 16px; transition: transform 0.25s var(--ease); }
.tlink:hover svg { transform: translateX(3px); }

/* ---------- shared editorial type for stages and products ---------- */
.pstage__h, .pblock__h { font-size: clamp(1.875rem, 1.3rem + 2vw, 2.75rem); font-weight: 600; line-height: 1.1; letter-spacing: -0.024em; }
.pstage__p, .pblock__p { margin-top: 18px; max-width: 40ch; font-size: var(--fs-lead); line-height: 1.65; color: var(--ink); }
.pstage__media, .pblock__media { min-width: 0; }
.pstage .frame, .pblock .frame { border-radius: var(--r-xl); border-color: rgba(206, 222, 244, 0.6); box-shadow: 0 34px 64px -40px rgba(11, 111, 220, 0.3); }
/* scenes scale uniformly with their frame (everything inside is em/%), so larger frames = larger, clearer media */
@container (min-width: 480px) {
  .pstage .m, .pblock .m { font-size: clamp(11px, 2.02cqw, 16.5px); }
}
/* full-bleed tonal chapter (used once per page) */
.pstage--band, .pblock--band {
  margin-inline: calc(50% - 50vw); padding-inline: calc(50vw - 50%);
  background: linear-gradient(180deg, var(--blue-50) 0%, #f8fbff 100%);
  border-block: 1px solid rgba(214, 227, 245, 0.7);
}
.pstage--band .m, .pstage--wide .m, .pblock--band .m, .pblock--wide .m { max-width: 860px; margin-inline: auto; }

/* ---------- How It Works: four stages, one system, four compositions ---------- */
.proc { padding-block: clamp(64px, 8vw, 112px) 0; }
.proc__list { display: grid; gap: clamp(64px, 8vw, 112px); }
.pstage { display: grid; gap: 28px; align-items: center; scroll-margin-top: calc(var(--header-h) + 24px); }
.pstage--band { padding-block: clamp(56px, 7.5vw, 104px); gap: clamp(32px, 4vw, 52px); }
.pstage--band .pstage__text { text-align: center; }
.pstage--band .pstage__p { margin-inline: auto; max-width: 46ch; }
.pstage__more { text-align: center; }
@media (min-width: 900px) {
  .pstage--wide { gap: clamp(36px, 4vw, 56px); }
  .pstage--wide .pstage__text { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 80px); align-items: end; }
  .pstage--wide .pstage__p { margin-top: 0; max-width: 46ch; }
  .pstage--split { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(40px, 5vw, 80px); }
  .pstage--flip { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); }
  .pstage--flip .pstage__text { order: 2; align-self: end; padding-bottom: clamp(8px, 2vw, 32px); }
}

/* ---------- contract types: typographic, softly divided list (no table, no pills) ---------- */
.ctypes-sec { padding-block: var(--section-y); background: #fff; }
.ctypes-sec__in { display: grid; gap: 40px; }
.ctypes-sec__head .lead { margin-top: 18px; max-width: 32ch; }
.ctypes { display: grid; grid-template-columns: 1fr; column-gap: clamp(32px, 5vw, 72px); border-bottom: 1px solid rgba(12, 26, 75, 0.1); }
.ctypes li {
  padding: 20px 0; border-top: 1px solid rgba(12, 26, 75, 0.1);
  font-size: clamp(1.125rem, 1rem + 0.55vw, 1.4375rem); font-weight: 500; line-height: 1.3; letter-spacing: -0.012em; color: var(--navy);
}
@media (min-width: 600px) {
  .ctypes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ctypes li { padding: 24px 0; }
}
@media (min-width: 900px) {
  .ctypes-sec__in { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(48px, 7vw, 112px); align-items: start; }
  .ctypes li { padding: 28px 0; }
}

/* ---------- security: full-bleed enterprise trust close (text-led; no badges, chips or certifications) ---------- */
.trust { position: relative; isolation: isolate; overflow: hidden; background: #102562; color: #c3cfe8; padding-block: clamp(88px, 11vw, 152px); }
.trust__bg {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 90% at 100% 50%, rgba(59, 141, 239, 0.26), transparent 72%),
    linear-gradient(180deg, #102562 0%, #0f2360 100%);
}
.trust__in { display: grid; gap: 48px; align-items: center; }
.trust__h { color: #fff; font-size: clamp(2.125rem, 1.4rem + 2.7vw, 3.625rem); font-weight: 600; line-height: 1.06; letter-spacing: -0.03em; }
.trust__em { display: block; color: #8fc0ff; }
.trust__nb { white-space: nowrap; }   /* never break at the hyphen */
.trust__p { margin: 28px 0 40px; max-width: 46ch; font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem); line-height: 1.65; color: #c3cfe8; }
.btn--light { min-height: 56px; padding: 0 30px; font-size: 1rem; background: #fff; color: var(--navy); box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.5); }
.btn--light:hover { background: #eaf2ff; }
.trust :focus-visible { outline-color: #8fc0ff; }
.trust__mark { display: none; }
/* phones/tablets: the ring field sits off the top-right corner behind the copy */
@media (max-width: 899.98px) {
  .trust__bg::after {
    content: ""; position: absolute; right: -380px; top: -380px; width: 760px; height: 760px; border-radius: 50%;
    background: radial-gradient(circle closest-side, transparent 38%, rgba(143, 192, 255, 0.16) 38.3%, rgba(143, 192, 255, 0) 52%, transparent 62%, rgba(143, 192, 255, 0.1) 62.3%, rgba(143, 192, 255, 0) 78%);
  }
}
@media (min-width: 900px) {
  .trust__in { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); }
  .trust__mark { position: relative; display: grid; place-items: center; min-height: 340px; }
  /* concentric ribbons radiating from the node: soft rim + fading band, like the hero ribbons in the dark */
  .trust__mark::before {
    content: ""; position: absolute; z-index: -1; width: 1200px; height: 1200px; border-radius: 50%; pointer-events: none;
    background: radial-gradient(circle closest-side,
      transparent 25%, rgba(143, 192, 255, 0.24) 25.2%, rgba(143, 192, 255, 0.05) 28%, transparent 36%,
      transparent 42%, rgba(143, 192, 255, 0.15) 42.2%, rgba(143, 192, 255, 0.03) 46%, transparent 56%,
      transparent 63%, rgba(143, 192, 255, 0.1) 63.2%, rgba(143, 192, 255, 0.02) 68%, transparent 80%,
      transparent 86%, rgba(143, 192, 255, 0.07) 86.2%, transparent 98%);
  }
  .trust__mark::after { content: ""; position: absolute; width: 196px; height: 196px; border-radius: 50%; border: 1px solid rgba(143, 192, 255, 0.34); }
  .trust__node { position: relative; z-index: 1; display: grid; place-items: center; width: 116px; height: 116px; border-radius: 32px; background: #fff; box-shadow: 0 0 0 10px rgba(255, 255, 255, 0.06), 0 34px 70px -24px rgba(0, 0, 0, 0.55); }
  .trust__node img { width: 60px; height: auto; }
}
/* the trust close hands straight over to the navy footer: a hairline marks the seam */
main:has(> .trust:last-child) + .site-footer { border-top: 1px solid rgba(169, 184, 214, 0.2); }

/* ---------- Products: one system, five curated compositions ---------- */
.pblocks { padding-block: clamp(64px, 8vw, 112px) clamp(24px, 4vw, 48px); }
.pblock { display: grid; gap: 28px; align-items: center; padding-block: clamp(52px, 7vw, 104px); border-top: 1px solid rgba(206, 222, 244, 0.6); scroll-margin-top: calc(var(--header-h) + 8px); }
.pblock:first-child { padding-top: 0; border-top: 0; }
.pblock:last-child { padding-bottom: clamp(16px, 3vw, 40px); }
.pblock--band, .pblock--band + .pblock { border-top: 0; }
.pblock--band { border-top: 1px solid rgba(214, 227, 245, 0.7); gap: clamp(32px, 4vw, 52px); }
.pblock--band .pblock__text { text-align: center; }
.pblock--band .pblock__p { margin-inline: auto; max-width: 42ch; }
.pblock--canvas .pblock__media { order: -1; }                 /* media first on every device */
.pblock__link { margin-top: 20px; }
.pblock__frame { display: block; border-radius: var(--r-xl); }
.pblock__frame .frame { transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease); }
.pblock__frame:hover .frame { transform: translateY(-3px); box-shadow: 0 40px 70px -40px rgba(11, 111, 220, 0.38); }
@media (min-width: 900px) {
  .pblock--split { grid-template-columns: minmax(0, 4.5fr) minmax(0, 7.5fr); gap: clamp(40px, 5vw, 88px); }
  .pblock--top { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); align-items: start; }
  .pblock--top .pblock__text { padding-top: clamp(12px, 3vw, 48px); }
  .pblock--wide { gap: clamp(36px, 4vw, 56px); }
  .pblock--wide .pblock__text { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 80px); align-items: end; }
  .pblock--wide .pblock__p { margin-top: 0; max-width: 46ch; }
  .pblock--canvas { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: clamp(36px, 4vw, 64px); }
  .pblock--canvas .pblock__text { align-self: end; padding-bottom: clamp(8px, 2vw, 28px); }
}

/* ---------- process illustrations (HTML/CSS, real text; built from the shared media kit) ---------- */
.m--h1 { aspect-ratio: 640 / 430; display: grid; grid-template-rows: auto 6em auto; align-content: center; padding: 1.4em 1.6em; }
.m--h2 { aspect-ratio: 640 / 283; }
.m--h3 { aspect-ratio: 640 / 400; }
.m--h4 { aspect-ratio: 640 / 303; }
.pstage--wide .m--h1 { aspect-ratio: auto; padding: 3.2em 2em; }

/* Ingest: five source systems → converging wires → First Outcomes intake */
.h-src { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.6em; }
.h-src li { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.5em; min-height: 3.9em; padding: 0.75em 0.3em; text-align: center; font-size: 0.9em; font-weight: 600; line-height: 1.25; }
.h-src li::before { content: ""; width: 0.55em; height: 0.55em; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0.25em rgba(23, 166, 115, 0.16); }
.h-conv { display: block; width: 100%; height: 100%; overflow: visible; }
.h-conv path { fill: none; vector-effect: non-scaling-stroke; }
.h-conv .w { stroke: var(--blue-300); stroke-width: 1.2; opacity: 0.8; }
.h-conv .d { stroke: var(--blue); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 0.5 200; opacity: 0; animation: vdot 3.4s cubic-bezier(0.45, 0, 0.35, 1) infinite; animation-delay: var(--dl, 0s); }
.h-intake { width: 64%; justify-self: center; }
.h-arrow { display: none; }
.h-brand { display: inline-flex; align-items: center; gap: 0.6em; }
.h-brand img { width: 1.5em; height: auto; }

/* Analyze: rule rows */
.h-rules li { display: flex; align-items: center; gap: 0.8em; padding: 0.55em 0; }
.h-rules li + li { border-top: 0.08em solid #edf2fa; }

/* Products page: re-centre each homepage illustration inside its own frame (homepage scenes sit high in their
   canvas). Margins trim/pad the canvas only — element positions are untouched. em = the scene's own font-size. */
.pblock .m--p1 { margin-block: 0.65em -2.5em; }
.pblock .m--p2 { margin-block: 1em -6.1em; }
.pblock .m--p3 { margin-block: 0 -6.8em; }
.pblock .m--p4 { margin-block: 1em -6.4em; }
.pblock .m--p5 { margin-block: 1em -7.1em; }
@container (max-width: 549px) {
  .pblock .m--p1 { margin-block: 0.85em -1.17em; }
  .pblock .m--p2 { margin-block: 1.16em -4.13em; }
  .pblock .m--p3 { margin-block: 0 -4.27em; }
  .pblock .m--p4 { margin-block: 1.16em -4.22em; }
  .pblock .m--p5 { margin-block: 1.16em -5.6em; }
}
@container (max-width: 479px) {
  .pblock .m { margin-block: 0; }
}
@container (min-width: 480px) {
  .pblock .m--p3 > span.m-arrow:nth-of-type(2) { display: none; }   /* overlapping portal/result cards already carry the flow */
}

/* build-in on entry (uses the existing .stage → .is-in observer in main.js) */
.js .stage .pm-in { transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); transition-delay: calc(var(--i, 0) * 90ms); }
.js .stage:not(.is-in) .pm-in { opacity: 0; transform: translateY(14px); }
@media (prefers-reduced-motion: reduce) {
  .js .stage:not(.is-in) .pm-in { opacity: 1; transform: none; }
  .h-conv .d { display: none; }
}

/* ---------- narrow frames: compositions designed vertically, not squeezed ---------- */
@container (max-width: 479px) {
  /* stronger hierarchy inside every narrow scene */
  .pstage .m, .pblock .m { font-size: 12.5px; }
  .pstage .m .m-title, .pblock .m .m-title { font-size: 1.1em; font-weight: 650; }

  /* How It Works: a vertical spine — each step hangs off one line, joined by nodes instead of arrows */
  .m--h1 { display: flex; }
  .pstage .m--h1, .pstage .m--h2, .pstage .m--h4 { position: relative; gap: 1em; padding: 1.3em 1.1em 1.3em 2.7em; }
  .pstage .m--h1::before, .pstage .m--h2::before, .pstage .m--h4::before {
    content: ""; position: absolute; left: 1.35em; top: 2.2em; bottom: 2.2em; width: 1px;
    background: linear-gradient(180deg, var(--blue-200), var(--blue-300) 50%, var(--blue-200));
  }
  .pstage .m--h1 .h-arrow, .pstage .m--h2 .m-arrow, .pstage .m--h4 .m-arrow {
    align-self: flex-start; width: 0.95em; height: 0.95em; margin: -0.5em 0 -0.5em -1.82em; rotate: none;
    background: var(--blue); border: 0.2em solid #fff; box-shadow: 0 0 0 0.1em var(--blue-300);
  }
  .h-src { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5em; }
  .h-src li { flex-direction: row; justify-content: flex-start; gap: 0.6em; min-height: 0; padding: 0.7em 0.8em; text-align: left; }
  .h-src li:last-child { grid-column: 1 / -1; }
  .h-conv { display: none; }
  .h-arrow { display: block; }
  .h-intake { width: 100%; }
  .h-rules li { padding: 0.45em 0; }
  .m--h2 > .m-card:first-child .m-steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 0.8em; }

  /* paired small cards: same left-to-right story, top to bottom */
  .m--h3, .pblock .m--p2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1em 0.75em; align-content: start; padding: 1.1em; }
  .m--h3 > *, .pblock .m--p2 > * { grid-column: 1 / -1; }
  .m--h3 > div:nth-of-type(2), .m--h3 > div:nth-of-type(3),
  .pblock .m--p2 > div:nth-of-type(3), .pblock .m--p2 > div:nth-of-type(4) { grid-column: auto; }
  .pblock .m--p2 > span.m-arrow:nth-of-type(2) { display: none; }
  .m--h3 .m-card, .pblock .m--p2 .m-card { padding: 0.85em 0.8em 0.9em; }

  /* products: trim secondary skeleton detail so each scene reads at a glance */
  .pblock .m--p3 > .m-card:first-child .m-field { display: none; }
  .pblock .m--p5 .m-bars--foot { display: none; }
  .pblock .m--p5 > .m-card--raise { display: flex; align-items: center; gap: 0.9em; }
  .pblock .m--p5 > .m-card--raise .m-title { flex: 1; margin: 0; }
  .pblock .m--p5 > .m-card--raise .m-bigcheck { flex: none; margin: 0; width: 2.4em; height: 2.4em; }
  .pblock .m--p5 .m-bigcheck::after { left: 0.8em; top: 0.35em; width: 0.5em; height: 0.95em; }
  .pblock .m--p5 .m-grid13 { max-width: 15em; }
}
/* phones: frames use a little more of the width */
@media (max-width: 599.98px) {
  .pstage .frame, .pblock .frame { margin-inline: -6px; border-radius: var(--r-lg); }
}
