/* The AI stack on the sponsors page, flat (landing_next.flat_stack; Lucas, 17 Nov: "this is still not matching the new
   style", after "just keep it flat" for the product screens). On white, its words as the other sections open them; the
   six layers as the numbered rows of the lists in one screen (.nx-dx .dx-list), in columns 1 to 5; the stack front-on
   on a light panel in 6 to 12, the list's first row on the panel's top line and the two ending together. Five ink slabs
   with their drawings in the paper colour; BuilderBase the orange frame round them, a solid top with the mark and thin
   rails down both sides and under the last one. The picked layer's slab keeps its drawing at full strength and the
   others go quiet; with BuilderBase picked the frame is the one in full and the slabs stay as they are. Loaded on the
   sponsors page only, after next.css and v2.css. */

.fs.wrap { padding-inline: var(--page-margin); }   /* the page's margin wherever the section sits: on the home it's inside .pr-main, not main, and took .wrap's 46px (Lucas, 17 Nov: "what happened to the width and padding here") */
.fs-body { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); margin-top: var(--s-4); }

/* ---------- the rows: the pick list (next.css, .pk, the product's steps' component): a number and a name, the picked row's
   outcome sentence under it, the picked row in ink with the dot. They sit in columns 1 to 5, the first row's line on the
   panel's top line ---------- */
.fs-list { grid-column: 1 / 6; grid-row: 1; align-self: stretch; margin: 0 0 0 var(--pad-panel); padding: 0; border-bottom: 1px solid var(--hair); }

/* ---------- the panel and the flat stack ---------- */
.fs-panel { grid-column: 6 / 13; grid-row: 1; display: flex; justify-content: center; min-height: 540px; padding: var(--pad-panel); border-radius: 12px; background: var(--mist); }   /* design-ok: the panels' corner */
.fs { --rail: 6px; --sun-quiet: color-mix(in srgb, var(--sun) 40%, var(--mist)); }   /* design-ok: the frame's rails; the orange gone quiet */
.fs-frame { display: flex; flex-direction: column; width: min(100%, 720px); }   /* design-ok: the stack's widest */
/* six slabs of one height and even gaps: the cage holds five slabs, its gaps and its rail, the top slab the sixth */
.fs-top { flex: 1 1 0; border-radius: 6px 6px 0 0; }   /* design-ok: the slabs' corner, square where the rails hang */
.fs-cage { display: flex; flex: 5 1 calc(6 * var(--gutter) + var(--rail)); flex-direction: column; gap: var(--gutter); min-height: 0; padding: var(--gutter); border: var(--rail) solid var(--sun); border-top: 0; border-radius: 0 0 6px 6px; }   /* design-ok: the frame, a fill of orange round the slabs */
.fs-slab { display: flex; flex: 1 1 0; align-items: center; justify-content: center; min-height: 0; container-type: size; border-radius: 6px; background: var(--ink); color: var(--paper); }   /* design-ok: the slabs' corner */
.fs-top { background: var(--sun); color: var(--ink); }
.fs-cage, .fs-top { transition: background-color var(--dur-fast) var(--ease-standard), border-color var(--dur-fast) var(--ease-standard); }

/* the drawings, each sized by its mass */
.fs-art { display: block; flex: none; width: auto; height: calc(var(--m, 46) * 1cqh); max-width: 80cqw; overflow: visible; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; transition: opacity var(--dur-fast) var(--ease-standard); }   /* design-ok: the drawings' line */
.fs-art * { vector-effect: non-scaling-stroke; }
.fs-art .f, .fs-art .f *, .fs-mark { fill: currentColor; stroke: none; }
.fs-mark { --m: 50; }
.fs-a1 { --m: 54; } .fs-a2 { --m: 50; } .fs-a3 { --m: 46; } .fs-a4 { --m: 56; } .fs-a5 { --m: 50; }

/* the pick: the picked slab in full, the others' drawings quiet; BuilderBase's frame quiet while a layer under it is picked */
.fs:not([data-on="0"]) .fs-slab:not(.on) .fs-art { opacity: .4; }
.fs:not([data-on="0"]) .fs-top { background: var(--sun-quiet); }
.fs:not([data-on="0"]) .fs-cage { border-color: var(--sun-quiet); }

@media (prefers-reduced-motion: reduce) { .fs-art, .fs-cage, .fs-top { transition: none; } }

/* ---------- phones: the panel first, then the rows ---------- */
@media (max-width: 860px) {
  .fs-body { display: flex; flex-direction: column; margin-top: var(--s-3); }
  .fs-panel { order: -1; }
  .fs-frame { width: 100%; }
  .fs-top, .fs-slab { flex: none; height: 48px; }   /* design-ok: a slab's height on a phone */
  .fs-cage { flex: none; gap: 8px; padding: 8px; }   /* design-ok: the gaps in step with the smaller slabs */
  .fs { --rail: 4px; }   /* design-ok: the rails on a phone */
  .fs-list { margin: var(--s-2) var(--pad-panel) 0; }
  .fs-panel { min-height: 0; }
}

/* ---------- the stack in three.js (stack3d.js), over the flat one once three.js has loaded ----------
   The flat stack stays for no JS and if three.js fails. On a desktop the canvas fills the panel's inside, the list's
   height; on a phone it sits in the panel at its width, as tall as the stack needs. */
.fs-panel { position: relative; }
.fs-panel.s3d-on > .fs-frame { display: none; }
.s3d { position: absolute; inset: var(--pad-panel); }
.s3d canvas { display: block; touch-action: pan-x pan-y; }
@media (max-width: 860px) { .s3d { position: static; width: 100%; } }

/* phones: the stack stays in view under the bar while its rows scroll past, and the row just under it is the picked
   layer (stack.js) (Lucas, 17 Nov: "can we make this sticky") */
@media (max-width: 860px) {
  .fs-panel { position: sticky; z-index: 2; top: 70px; }
}

/* ---------- alt/stack/ A, the ride (stack.js, stack3d.js; Lucas, 17 Nov: "Scroll ride"): the rows and the panel held on
   screen under the bar while the page scrolls the section's track, a stop every 60% of a screen; the panel as tall as
   the screen leaves. On a phone the panel takes the room over the rows ---------- */
.fs-ride .fs-track { height: calc(6 * 60svh + 100svh - 96px); margin-top: var(--s-4); }   /* design-ok: six stops of scroll */
.fs-ride .fs-body { position: sticky; top: 76px; height: calc(100svh - 96px); margin-top: 0; align-items: stretch; }   /* design-ok: under the bar */
.fs-ride .fs-list { align-self: center; }
.fs-ride .fs-panel { position: relative; top: auto; min-height: 0; }
@media (max-width: 860px) {
  .fs-ride .fs-body { top: 70px; height: calc(100svh - 82px); gap: var(--s-1); }   /* design-ok: under the phone's bar */
  .fs-ride .fs-panel { flex: 1 1 auto; min-height: 0; }
  .fs-ride .s3d { position: absolute; inset: var(--pad-panel); width: auto; }
  .fs-ride .fs-list { flex: none; margin-top: 0; }
}

/* ---------- the chain in the section's panel (Lucas, 17 Nov: "let's ship this for now"): beside the rows, as tall as
   they are; on a phone over them. Its look is chain.css; its rows light with its pills (chain.js) ---------- */
.fs-body > .ch-panel { grid-column: 6 / 13; grid-row: 1; align-self: stretch; min-height: 560px; }   /* design-ok: room for six pills */
@media (max-width: 860px) { .fs-body > .ch-panel { order: -1; min-height: 520px; } }   /* design-ok: room for six pills on a phone */
