/* One continuous story. Progress is applied only to visual children;
   section boxes remain stationary so scroll measurements and sticky scenes agree. */
[data-flow-scene] { --flow-enter: 1; --flow-exit: 0; --flow-progress: 1; position: relative; }
.flow-surface, .flow-connection, .journey-guide, .closing-orbit { display: none; }
.flow-viewport { position: fixed; inset: 0 auto auto 0; height: 100svh; width: 0; visibility: hidden; pointer-events: none; }
.flow-ready [data-flow-scene] { isolation: isolate; }
.flow-ready .flow-surface { display: block; position: absolute; z-index: -1; inset: 0; pointer-events: none; background: var(--flow-color, var(--paper)); clip-path: inset(0 calc((1 - var(--flow-enter)) * 6%) round calc((1 - var(--flow-enter)) * 110px)); }
.flow-ready .converge { background: var(--paper); --flow-color: var(--ink); }
.flow-ready .story { background: var(--ink); border-top: 0; --flow-color: var(--ink); }
.flow-ready .story .flow-surface { clip-path: none; }
.flow-ready .capability-scene { background: var(--ink); --flow-color: var(--paper); }
.flow-ready .depth-scenarios { background: var(--paper); --flow-color: #e4eadd; }
.flow-ready .ecosystem { background: #e4eadd; --flow-color: var(--paper); }
.flow-ready .depth-install { background: var(--paper); --flow-color: var(--ink); }
.flow-ready .faq-scene { background: var(--ink); --flow-color: var(--paper); }
.flow-ready .closing { background: var(--paper); --flow-color: var(--coral); overflow: clip; }

/* The relationship sculpture leaves the opening as the first records arrive. */
.flow-ready .hero-art picture { transform: rotate(calc(var(--hero-progress, 0) * -20deg)) scale(calc(1 + var(--hero-progress, 0) * .3)); }
.flow-ready .hero-art .opportunity-note { translate: calc(var(--hero-progress, 0) * -80px) calc(var(--hero-progress, 0) * 80px); rotate: calc(var(--hero-progress, 0) * 5deg); }
.flow-ready .hero-copy h1 span:first-child { transform: translateX(calc(var(--hero-progress, 0) * -95px)); }
.flow-ready .hero-copy h1 span:last-child { transform: translateX(calc(var(--hero-progress, 0) * 75px)); }
.flow-ready .hero-copy h1 { opacity: calc(1 - var(--hero-progress, 0) * .6); }
.flow-ready .hero-promises { transform: translateY(calc(var(--flow-exit) * -38px)); opacity: calc(1 - var(--flow-exit) * .8); }

/* A record becomes a workspace, with a shared dark surface between chapters. */
.flow-ready .converge-copy { translate: calc((1 - var(--flow-enter)) * -60px) calc((1 - var(--flow-enter)) * 90px - var(--flow-exit) * 80px); opacity: clamp(.1, 1 - var(--flow-exit) * 1.15, 1); }
.flow-ready .converge-canvas { transform: perspective(1400px) translateY(calc((1 - var(--flow-enter)) * 170px)) rotateX(calc((1 - var(--flow-enter)) * 16deg)); }
.flow-ready .work-fragment { opacity: clamp(0, (.49 - var(--converge-progress)) * 9, 1); }
.flow-ready .converged-record { translate: calc(var(--flow-exit) * -85px) calc(var(--flow-exit) * -80px); scale: calc(1 + var(--flow-exit) * .8); opacity: calc(clamp(0, (var(--converge-progress) - .48) * 10, 1) * (1 - clamp(0, var(--flow-exit) * 1.2, 1))); }
.flow-ready .converge-orbit { opacity: calc(1 - var(--flow-exit)); }
.flow-ready .converge-coordinate { opacity: calc(1 - var(--flow-exit)); }
.flow-ready .flow-connection { display: block; position: absolute; z-index: 0; width: 1px; height: 150px; top: -75px; left: 73%; background: #5e6b59; pointer-events: none; }
.flow-connection > span { position: absolute; inset: 0; background: var(--coral); transform-origin: top; transform: scaleY(var(--flow-enter)); }
.flow-connection > i { position: absolute; width: 7px; height: 7px; left: -3px; top: calc(var(--flow-enter) * 100%); border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 7px rgb(245 116 69 / 8%); }
.flow-ready .story-editorial { translate: 0 calc((1 - var(--flow-enter)) * 100px - var(--flow-exit) * 60px); opacity: calc(.25 + var(--flow-enter) * .75 - var(--flow-exit) * .55); }
.flow-ready .story .product-stage { transform-origin: 65% 45%; transform: perspective(1500px) translateY(calc((1 - var(--flow-enter)) * 200px - var(--flow-exit) * 65px)) rotateY(calc((1 - var(--flow-enter)) * -15deg + var(--flow-exit) * 7deg)) rotateX(calc((1 - var(--flow-enter)) * 10deg)) scale(calc(.68 + var(--flow-enter) * .32 - var(--flow-exit) * .08)); opacity: calc(.2 + var(--flow-enter) * .8 - var(--flow-exit) * .55); }

/* The cream product workspace opens from the same side as the story window. */
.flow-ready .capability-scene .flow-surface { clip-path: inset(0 calc((1 - var(--flow-enter)) * 12%) 0 calc((1 - var(--flow-enter)) * 4%) round calc((1 - var(--flow-enter)) * 60px)); }
.flow-ready .depth-explorer-nav > .section-index { translate: 0 calc((1 - var(--flow-enter)) * 30px); }
.flow-ready .depth-explorer-nav h2 { transform: translateY(calc((1 - var(--flow-enter)) * 75px)); opacity: calc(.2 + var(--flow-enter) * .8); }
.flow-ready .depth-explorer-nav h2 em { display: inline-block; transform: translateX(calc((1 - var(--flow-enter)) * -55px)); }
.flow-ready .depth-intro { translate: 0 calc((1 - var(--flow-enter)) * 95px); opacity: calc(.3 + var(--flow-enter) * .7); }
.flow-ready .depth-panels { transform-origin: 60% 20%; transform: perspective(1500px) translateY(calc((1 - var(--flow-enter)) * 120px)) rotateY(calc((1 - var(--flow-enter)) * 12deg)) rotateX(calc((1 - var(--flow-enter)) * -8deg)) scale(calc(.8 + var(--flow-enter) * .2)); }
.flow-ready .depth-tabs button { --row: 0; translate: calc((1 - clamp(0, var(--flow-enter) * 1.5 - var(--row) * .06, 1)) * -30px) 0; }
.flow-ready .depth-tabs button:nth-child(2) { --row: 1; }
.flow-ready .depth-tabs button:nth-child(3) { --row: 2; }
.flow-ready .depth-tabs button:nth-child(4) { --row: 3; }
.flow-ready .depth-tabs button:nth-child(5) { --row: 4; }
.flow-ready .depth-tabs button:nth-child(6) { --row: 5; }

/* Different teams inherit the same flow; only headings and decoration move. */
.flow-ready .depth-scenarios .flow-surface { clip-path: inset(0 0 0 calc((1 - var(--flow-enter)) * 100%)); }
.flow-ready .depth-scenarios .depth-section-heading h2 { translate: calc((1 - var(--flow-enter)) * -70px) calc((1 - var(--flow-enter)) * 55px); }
.flow-ready .depth-section-heading > p { translate: 0 calc((1 - var(--flow-enter)) * 70px); }
.flow-ready .depth-scenario-number { transform: translateX(calc((1 - var(--flow-enter)) * -30px)); opacity: calc(.25 + var(--flow-enter) * .75); }
.flow-ready .depth-scenario[open] .depth-scenario-number { color: color-mix(in srgb, var(--forest) calc(var(--flow-enter) * 100%), transparent); }
.flow-ready .ecosystem-heading h2 { translate: 0 calc((1 - var(--flow-enter)) * 90px); }
.flow-ready .ecosystem-heading > p { translate: calc((1 - var(--flow-enter)) * 35px) 0; }
.flow-ready .network-band { background: transparent; }
.flow-ready .network-hub { transform: rotate(calc((1 - var(--flow-enter)) * -35deg)) scale(calc(.55 + var(--flow-enter) * .45)); }
.flow-ready .network-column:first-of-type .network-node { transform: translateX(calc((1 - var(--network-progress)) * -90px)); }
.flow-ready .network-column:last-of-type .network-node { transform: translateX(calc((1 - var(--network-progress)) * 90px)); }
.flow-ready .network-column .network-node:nth-child(2) { translate: 0 calc((1 - var(--network-progress)) * 25px); }
.flow-ready .network-column .network-node:nth-child(3) { translate: 0 calc((1 - var(--network-progress)) * 50px); }
.flow-ready .ecosystem { padding-bottom: 90px; }

/* The integration lines continue into a measured, four-step beginning. */
.flow-ready .depth-install .flow-surface { clip-path: ellipse(calc(45% + var(--flow-enter) * 55%) calc(45% + var(--flow-enter) * 55%) at 50% 65%); }
.flow-ready .depth-install .flow-connection { left: 50%; }
.flow-ready .depth-install .depth-section-heading h2 { translate: 0 calc((1 - var(--flow-enter)) * 90px); }
.flow-ready .depth-install-steps.reveal-ready { opacity: 1; transform: none; }
.flow-ready .depth-install-steps li { --step: 0; --step-in: clamp(0, var(--flow-enter) * 1.8 - var(--step) * .18, 1); translate: 0 calc((1 - var(--step-in)) * 70px); opacity: calc(.25 + var(--step-in) * .75); }
.flow-ready .depth-install-steps li:nth-child(2) { --step: 1; }
.flow-ready .depth-install-steps li:nth-child(3) { --step: 2; }
.flow-ready .depth-install-steps li:nth-child(4) { --step: 3; }
.flow-ready .depth-install-steps li::before { transform-origin: left; transform: scaleX(var(--step-in)); }
.flow-ready .depth-install-number { rotate: calc((1 - var(--step-in)) * -60deg); scale: calc(.7 + var(--step-in) * .3); }
.flow-ready .faq h2 { translate: 0 calc((1 - var(--flow-enter)) * 70px); }
.flow-ready .faq-list { translate: 0 calc((1 - var(--flow-enter)) * 35px); }

/* A coral circle opens the final invitation. The CTA always remains usable. */
.flow-ready .closing .flow-surface { clip-path: circle(calc(8% + var(--flow-enter) * 130%) at 80% 65%); }
.flow-ready .closing h2 { transform: translateY(calc((1 - var(--flow-enter)) * 70px)); }
.flow-ready .closing-arrow { transform: rotate(calc((1 - var(--flow-enter)) * -45deg)) scale(calc(.65 + var(--flow-enter) * .35)); }
.flow-ready .closing-orbit { display: block; position: absolute; z-index: -1; width: min(45vw, 620px); aspect-ratio: 1; right: 3%; top: 50%; transform: translateY(-50%) rotate(calc(var(--flow-progress) * 90deg)); pointer-events: none; }
.closing-orbit span { position: absolute; inset: 0; border: 1px solid rgb(25 45 37 / 14%); border-radius: 50%; scale: calc(.5 + var(--flow-enter) * .5); }
.closing-orbit span:nth-child(2) { inset: 12%; }
.closing-orbit span:nth-child(3) { inset: 24%; }

.flow-ready .journey-guide { position: fixed; z-index: 45; right: 26px; bottom: 22px; display: flex; align-items: center; gap: 12px; padding: 11px 16px; background: rgb(247 245 239 / 92%); color: var(--ink); border: 1px solid rgb(25 45 37 / 12%); border-radius: 40px; pointer-events: none; box-shadow: 0 5px 22px #102a1510; }
.journey-number, .journey-end { font-size: 9px; font-variant-numeric: tabular-nums; }
.journey-number { color: #9b3b18; font-weight: 700; }
.journey-label { font-size: 10px; font-weight: 600; min-width: 100px; }
.journey-line { width: 55px; height: 1px; background: #c6cfc0; }
.journey-line i { display: block; width: 100%; height: 100%; background: var(--coral); transform-origin: left; transform: scaleX(0); }
.journey-end { color: #64745f; }

.flow-live .flow-surface { will-change: clip-path; }
.flow-live .product-stage, .flow-live .converge-canvas, .flow-live .depth-panels { will-change: transform; }
/* Keyboard focus must never chase a departing surface or a moving control. */
.flow-ready [data-flow-scene]:focus-within { --flow-enter: 1 !important; --flow-exit: 0 !important; }

@media (max-width: 999px) {
    .flow-ready .journey-guide { display: none; }
    .flow-ready .flow-surface { clip-path: inset(0 calc((1 - var(--flow-enter)) * 4%) round calc((1 - var(--flow-enter)) * 45px)); }
    .flow-ready .story .flow-surface { clip-path: none; }
    .flow-ready .flow-connection { height: 100px; top: -50px; left: 80%; }
    .flow-ready .converge-copy { translate: 0 calc((1 - var(--flow-enter)) * 55px - var(--flow-exit) * 35px); }
    .flow-ready .converge-canvas { transform: translateY(calc((1 - var(--flow-enter)) * 85px)); }
    .flow-ready .converged-record { translate: 0 calc(var(--flow-exit) * -30px); scale: calc(1 + var(--flow-exit) * .25); }
    .flow-ready .story-editorial { translate: 0 calc((1 - var(--flow-enter)) * 55px - var(--flow-exit) * 25px); }
    .flow-ready .story .product-stage { transform: perspective(1000px) translateY(calc((1 - var(--flow-enter)) * 90px - var(--flow-exit) * 35px)) rotateX(calc((1 - var(--flow-enter)) * 9deg)) scale(calc(.88 + var(--flow-enter) * .12)); }
    .flow-ready .capability-scene .flow-surface { clip-path: inset(0 calc((1 - var(--flow-enter)) * 4%) round calc((1 - var(--flow-enter)) * 40px)); }
    .flow-ready .depth-panels { transform: perspective(1000px) translateY(calc((1 - var(--flow-enter)) * 65px)) rotateX(calc((1 - var(--flow-enter)) * 8deg)) scale(calc(.9 + var(--flow-enter) * .1)); }
    .flow-ready .depth-install .flow-surface { clip-path: inset(0 calc((1 - var(--flow-enter)) * 4%) round calc((1 - var(--flow-enter)) * 40px)); }
    .flow-ready .depth-scenarios .depth-section-heading h2 { translate: 0 calc((1 - var(--flow-enter)) * 55px); }
    .flow-ready .ecosystem-heading > p { translate: calc((1 - var(--flow-enter)) * 24px) 0; }
    .flow-ready .network-column:first-of-type .network-node { transform: translateX(calc((1 - var(--network-progress)) * -24px)); }
    .flow-ready .network-column:last-of-type .network-node { transform: translateX(calc((1 - var(--network-progress)) * 24px)); }
    .flow-ready .ecosystem { padding-bottom: 65px; }
}
@media (max-width: 700px) {
    .flow-ready .hero-copy h1 span:first-child { transform: translateX(calc(var(--hero-progress, 0) * -28px)); }
    .flow-ready .hero-copy h1 span:last-child { transform: translateX(calc(var(--hero-progress, 0) * 20px)); }
    .flow-ready .hero-copy h1 { opacity: calc(1 - var(--hero-progress, 0) * .4); }
    .flow-ready .converge-canvas { transform: translateY(calc((1 - var(--flow-enter)) * 50px)); }
    .flow-ready .depth-explorer-nav h2, .flow-ready .closing h2 { transform: translateY(calc((1 - var(--flow-enter)) * 45px)); }
    .flow-ready .depth-explorer-nav h2 em { transform: none; }
    .flow-ready .depth-intro { translate: 0 calc((1 - var(--flow-enter)) * 45px); }
    .flow-ready .depth-tabs button { translate: none; }
    .flow-ready .depth-section-heading > p { translate: 0 calc((1 - var(--flow-enter)) * 30px); }
    .flow-ready .ecosystem-heading h2 { translate: 0 calc((1 - var(--flow-enter)) * 45px); }
    .flow-ready .ecosystem-heading > p { translate: 0 calc((1 - var(--flow-enter)) * 30px); }
    .flow-ready .network-column:first-of-type .network-node { transform: translateX(calc((1 - var(--network-progress)) * -22px)); }
    .flow-ready .network-column:last-of-type .network-node { transform: translateX(calc((1 - var(--network-progress)) * 22px)); }
    .flow-ready .depth-install-steps li { translate: 0 calc((1 - var(--step-in)) * 35px); }
    .flow-ready .faq h2 { translate: 0 calc((1 - var(--flow-enter)) * 40px); }
    .flow-ready .closing-orbit { width: 80vw; right: -20%; }
    .flow-ready .closing .flow-surface { clip-path: circle(calc(15% + var(--flow-enter) * 150%) at 90% 80%); }
}
@media (prefers-reduced-motion: reduce) {
    .flow-surface, .flow-connection, .journey-guide, .closing-orbit { display: none !important; }
    [data-flow-scene] { --flow-enter: 1 !important; --flow-exit: 0 !important; }
}
