/* scroll-scrubbed 3D stages (pages 10+). --p is written by assets/js/scroll3d.js; every effect below is a pure function of it (transform / opacity only). */
.sx { --p: 0; position: relative; block-size: calc(var(--len, 320) * 1vh); }
.sx-pin { position: sticky; inset-block-start: var(--header-h); block-size: calc(100dvh - var(--header-h)); overflow: clip; display: grid; }
/* .seg + --a/--b: --t goes 0 -> 1 between those two progress values, --e is the same with smoothstep easing */
.seg { --t: clamp(0, calc((var(--p) - var(--a)) / (var(--b) - var(--a))), 1); --e: calc(var(--t) * var(--t) * (3 - 2 * var(--t))); }
.pagebar { position: fixed; inset-block-start: 0; inset-inline: 0; block-size: 3px; z-index: 60; pointer-events: none; }
.pagebar i { display: block; block-size: 100%; background: var(--primary); transform-origin: right; transform: scaleX(var(--pg, 0)); }
.scroll-hint { display: inline-flex; align-items: center; gap: var(--sp-2); color: var(--muted); font-size: var(--fs-sm); }
.scroll-hint i { animation: nudge 1.6s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(5px); } }
/* step text: crossfades in one cell, driven by data-step on the [data-sx] wrapper */
.stepstack { display: grid; }
.stepstack > * { grid-area: 1 / 1; opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity var(--t-med) var(--ease), transform var(--t-med) var(--ease); }
[data-step="0"] .stepstack > :nth-child(1), [data-step="1"] .stepstack > :nth-child(2), [data-step="2"] .stepstack > :nth-child(3),
[data-step="3"] .stepstack > :nth-child(4), [data-step="4"] .stepstack > :nth-child(5), [data-step="5"] .stepstack > :nth-child(6) { opacity: 1; transform: none; pointer-events: auto; }
.sdots { display: flex; gap: var(--sp-2); }
.sdots i { inline-size: 24px; block-size: 6px; border-radius: var(--r-full); background: var(--surface-3); transition: background var(--t-med), transform var(--t-med) var(--ease); }
[data-step="0"] .sdots i:nth-child(1), [data-step="1"] .sdots i:nth-child(2), [data-step="2"] .sdots i:nth-child(3),
[data-step="3"] .sdots i:nth-child(4), [data-step="4"] .sdots i:nth-child(5), [data-step="5"] .sdots i:nth-child(6) { background: var(--primary); }
.stepstack .kicker { color: var(--primary); font-weight: 700; font-size: var(--fs-sm); }
.stepstack h3 { font-size: var(--fs-2xl); line-height: var(--lh-display); margin-block: var(--sp-1) var(--sp-2); }
.stepstack p { color: var(--text-2); font-size: var(--fs-lg); max-inline-size: 36ch; }
@media (max-width: 860px) { .stepstack h3 { font-size: var(--fs-xl); } .stepstack p { font-size: var(--fs-base); } }
/* reduced motion: no pinning, everything shown in its finished state */
@media (prefers-reduced-motion: reduce) {
  .sx { block-size: auto; }
  .sx-pin { position: static; block-size: auto; min-block-size: 70vh; padding-block: var(--sp-8); }
  .stepstack { gap: var(--sp-5); } .stepstack > * { opacity: 1; transform: none; pointer-events: auto; grid-area: auto; }
  .sdots, .scroll-hint { display: none; }
  .scroll-hint i, .pagebar { animation: none; }
}
