.cx-process { margin: 0; }
.cx-process__stage {
	background: radial-gradient(120% 120% at 70% 0%, #2a2a27 0%, #121211 70%);
	border: 1px solid rgba(246, 246, 241, 0.14);
	position: relative;
	overflow: hidden;
	contain: layout paint;
}
.cx-process__stage svg { display: block; width: 100%; height: auto; }
.cx-process__caption {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1.25rem;
	margin-top: 0.75rem; font-size: 0.875rem; color: #9a9c9d;
}
.cx-process__toggle {
	font: inherit; font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
	color: #f6f6f1; background: transparent; border: 1px solid rgba(246, 246, 241, 0.4);
	padding: 0.4rem 0.9rem; cursor: pointer; min-height: 2.5rem;
}
.cx-process__toggle:hover { border-color: #ffdb15; color: #ffdb15; }
.cx-process__toggle:focus-visible { outline: 3px solid #ffdb15; outline-offset: 2px; }

/*
 * Static pose (no JS / reduced motion / paused / off-screen): a readable mid-process frame.
 * --p (turning) and --c (induction) are the static progress of the tool / coil along the part, 0-1.
 * Every moving part is transform/opacity only, so animation stays on the compositor.
 */
.cx-process--turning { --p: 0.55; }
.cx-process--induction { --c: 0.6; }
.cx-process svg * { transform-box: fill-box; }
.cx-process .cx-p-rough { transform-origin: left center; transform: scaleX(calc(1 - var(--p, 0.55))); }
.cx-process .cx-p-cut { transform-origin: right center; transform: scaleX(var(--p, 0.55)); }
.cx-process .cx-p-tool { transform-box: view-box; transform: translateX(calc(550px - 440px * var(--p, 0.55))); }
.cx-process .cx-p-tipglow { opacity: 0.6; }
.cx-process .cx-p-chip { opacity: 0; }
.cx-process .cx-p-chip--a { opacity: 1; transform: translate(-12px, -10px) rotate(-25deg); }
.cx-process .cx-p-coil { transform-box: view-box; transform: translateX(calc(70px + 500px * var(--c, 0.6))); }
.cx-process .cx-p-hardened { transform-origin: left center; transform: scaleX(calc(var(--c, 0.6) - 0.1)); }
.cx-process .cx-p-hot { opacity: 0.75; }
.cx-process .cx-p-drop, .cx-process .cx-p-spray { opacity: 0; }
.cx-process .cx-p-mist { opacity: 0.7; }
.cx-process .cx-p-spin { --cy: 2.4s; }
.cx-process .cx-p-spin rect { transform: translateY(var(--s, 0)); opacity: var(--o, 0.2); }
.cx-process .cx-p-spin--chuck { --d: 188px; --cy: 2.2s; opacity: 0.45; }
.cx-process .cx-p-spin--rough { --d: 132px; --cy: 2.6s; }
.cx-process .cx-p-spin--cut { --d: 108px; --cy: 2.4s; }
.cx-process .cx-p-spin--pin { --d: 64px; --cy: 2.2s; }

/* Motion: only while the figure is on screen, the tab is visible and the visitor has not paused it. */
.cx-process.is-playing .cx-p-spin rect {
	animation: cx-spin-y var(--cy) cubic-bezier(0.37, 0, 0.63, 1) infinite, cx-spin-o var(--cy) linear infinite;
}
.cx-process.is-playing .cx-p-rough { animation: cx-rough 10s infinite; }
.cx-process.is-playing .cx-p-cut { animation: cx-cut 10s infinite; }
.cx-process.is-playing .cx-p-tool { animation: cx-tool 10s infinite; }
.cx-process.is-playing .cx-p-tipglow { animation: cx-glow 1.8s ease-in-out infinite; }
.cx-process.is-playing .cx-p-chip { animation: cx-chip 2.4s ease-out infinite; }
.cx-process.is-playing .cx-p-chip--b { animation-delay: -0.8s; }
.cx-process.is-playing .cx-p-chip--c { animation-delay: -1.6s; }

.cx-process.is-playing .cx-p-coil { animation: cx-coil 12s infinite, cx-coil-fade 12s linear infinite; }
.cx-process.is-playing .cx-p-heatzone { animation: cx-coil 12s infinite, cx-heat 12s linear infinite; }
.cx-process.is-playing .cx-p-hardened { animation: cx-hard 12s infinite; }
.cx-process.is-playing .cx-p-hot { animation: cx-hot 1.6s ease-in-out infinite alternate; }
.cx-process.is-playing .cx-p-drop { animation: cx-p-drop 1s ease-in infinite; }
.cx-process.is-playing .cx-p-spray { animation: cx-spray 0.6s ease-in infinite; }
.cx-process.is-playing .cx-p-mist { animation: cx-hot 1.4s ease-in-out infinite alternate; }

/* Rotation: a surface line on a turning cylinder moves as sin(angle), i.e. sine easing across the face. */
@keyframes cx-spin-y { from { transform: translateY(0); } to { transform: translateY(var(--d)); } }
@keyframes cx-spin-o { 0%, 100% { opacity: 0; } 50% { opacity: 0.3; } }

/* Turning: tool, uncut stock and turned surface share the 8%-78% linear segment, so the tool tip stays on the cut edge. */
@keyframes cx-tool {
	0% { transform: translate(550px, -36px); animation-timing-function: ease-in-out; }
	8% { transform: translate(550px, 0); animation-timing-function: linear; }
	78% { transform: translate(110px, 0); animation-timing-function: ease-in-out; }
	86% { transform: translate(110px, -36px); animation-timing-function: ease-in-out; }
	100% { transform: translate(550px, -36px); }
}
@keyframes cx-cut {
	0%, 8% { transform: scaleX(0); opacity: 1; animation-timing-function: linear; }
	78%, 92% { transform: scaleX(1); opacity: 1; }
	100% { transform: scaleX(1); opacity: 0; }
}
@keyframes cx-rough {
	0%, 8% { transform: scaleX(1); opacity: 1; animation-timing-function: linear; }
	78% { transform: scaleX(0); opacity: 1; }
	90% { transform: scaleX(0); opacity: 0; }
	92% { transform: scaleX(1); opacity: 0; }
	100% { transform: scaleX(1); opacity: 1; }
}
@keyframes cx-glow { 0%, 100% { opacity: 0.45; } 50% { opacity: 0.9; } }
@keyframes cx-chip {
	0% { transform: translate(0, 0) scale(0.5) rotate(0deg); opacity: 0; }
	15% { opacity: 1; }
	60% { transform: translate(-14px, -16px) scale(1) rotate(-40deg); opacity: 1; }
	100% { transform: translate(-36px, -4px) scale(1) rotate(-110deg); opacity: 0; }
}

/* Induction: the coil scans the pin; hardened (blue-steel) surface trails behind the quench ring. */
@keyframes cx-coil {
	0%, 6% { transform: translateX(70px); animation-timing-function: linear; }
	84%, 97% { transform: translateX(570px); animation-timing-function: ease-in-out; }
	100% { transform: translateX(70px); }
}
@keyframes cx-coil-fade { 0% { opacity: 0; } 3% { opacity: 1; } 92% { opacity: 1; } 97%, 100% { opacity: 0; } }
@keyframes cx-heat { 0%, 3% { opacity: 0; } 12%, 82% { opacity: 1; } 92%, 100% { opacity: 0; } }
@keyframes cx-hard {
	0%, 13.8% { transform: scaleX(0); opacity: 1; animation-timing-function: linear; }
	84% { transform: scaleX(0.9); }
	92%, 94% { transform: scaleX(1); opacity: 1; }
	100% { transform: scaleX(1); opacity: 0; }
}
@keyframes cx-hot { from { opacity: 0.35; } to { opacity: 0.7; } }
@keyframes cx-p-drop { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(46px); opacity: 0; } }
@keyframes cx-spray { 0% { transform: translateY(0); opacity: 0; } 20% { opacity: 1; } 100% { transform: translateY(14px); opacity: 0; } }

/* Small screens: fewer animated elements. */
@media (max-width: 600px) {
	.cx-process .cx-p-d4, .cx-process .cx-p-d5, .cx-process .cx-p-d6, .cx-process .cx-p-spray, .cx-process .cx-p-chip--c, .cx-process .cx-p-spin--chuck, .cx-process .cx-p-sparks { display: none; }
	.cx-process.is-playing .cx-p-mist { animation: none; }
}


/* ---- Process routes (carburising, nitriding, finishing, bimetal): storyboards ----
 * Static pose first (no JS / reduced motion / paused / off-screen); motion only inside .is-playing.
 * Each station (.cx-p-cell) is lit in turn, in sync with the stage list (.cx-stages li): --T cycle, --N stations, --i index. */
.cx-process--bimetal { --T: 18s; --N: 6; }
.cx-process--carburising { --T: 16s; --N: 4; }
.cx-process--nitriding { --T: 15s; --N: 3; }
.cx-process--finishing { --T: 10s; --N: 2; }
.cx-process :is(.cx-p-rot, .cx-p-blade, .cx-p-form, .cx-p-mand, .cx-p-lid, .cx-p-dip, .cx-p-sweep, .cx-p-bub, .cx-p-heatw, .cx-p-wave, .cx-p-atomr, .cx-p-fall) { transform-origin: center; }
.cx-process .cx-p-core { transform-origin: center; transform: scale(var(--k, 1)); }
.cx-process .cx-p-dip { transform: translateY(34px); }
.cx-process .cx-p-warm { opacity: 0.5; }
.cx-process .cx-p-atomr { opacity: 0.8; }
.cx-process .cx-p-nflow { opacity: 0.55; }
.cx-process .cx-p-hotc, .cx-process .cx-p-coolg { opacity: 0.6; }
.cx-process .cx-p-xh { opacity: 0.85; }
.cx-process .cx-p-spark, .cx-process .cx-p-sparks path { opacity: 0.7; }
.cx-process .cx-p-spin--fpin { --d: 40px; --cy: 1.8s; }
.cx-process .cx-p-spin--wheel { --d: 51px; --cy: 0.9s; }
.cx-process .cx-p-spin--hone { --d: 48px; --cy: 1.4s; }

.cx-process--bimetal.is-playing .cx-p-cell { animation: cx-cell-6 var(--T) infinite; }
.cx-process--carburising.is-playing .cx-p-cell { animation: cx-cell-4 var(--T) infinite; }
.cx-process--nitriding.is-playing .cx-p-cell { animation: cx-cell-3 var(--T) infinite; }
.cx-process.is-playing .cx-p-cell { animation-delay: calc(var(--T) * (var(--i) / var(--N) - 1)); }
.cx-process--finishing.is-playing .cx-p-cell { animation: none; }
.cx-process.is-playing .cx-p-sweep { animation: cx-sweep 2.4s linear infinite; }
.cx-process.is-playing .cx-p-rot { animation: cx-rot 3s linear infinite; }
.cx-process.is-playing .cx-p-rot--rev { animation-direction: reverse; }
.cx-process.is-playing .cx-p-fall { animation: cx-fall 1.1s linear infinite; }
.cx-process.is-playing .cx-p-fglow, .cx-process.is-playing .cx-p-bondglow { animation: cx-glow 1.8s ease-in-out infinite alternate; }
.cx-process.is-playing .cx-p-blade { animation: cx-blade 3s ease-in-out infinite; }
.cx-process.is-playing .cx-p-form { animation: cx-form 3s ease-out infinite; transform-origin: center; }
.cx-process.is-playing .cx-p-pocket { animation: cx-pocket 3.2s ease-out infinite; }
.cx-process.is-playing .cx-p-mand { animation: cx-mand 1.6s ease-in-out infinite alternate; transform-origin: center; }
.cx-process.is-playing .cx-p-atomr { animation: cx-atom-in 2.4s linear infinite; }
.cx-process.is-playing .cx-p-core--grow { animation: cx-core-grow 6s ease-out infinite; }
.cx-process.is-playing .cx-p-core--thin { animation: cx-core-thin 7s ease-out infinite; }
.cx-process.is-playing .cx-p-dip { animation: cx-dip 5s ease-in-out infinite; }
.cx-process.is-playing .cx-p-hotc { animation: cx-hotc 5s ease-in-out infinite; }
.cx-process.is-playing .cx-p-wave { animation: cx-wave 1.6s linear infinite; }
.cx-process.is-playing .cx-p-bub { animation: cx-bub 2s ease-in infinite; }
.cx-process.is-playing .cx-p-warm { animation: cx-glow 2.4s ease-in-out infinite alternate; }
.cx-process.is-playing .cx-p-heatw { animation: cx-heatw 2.4s ease-in-out infinite; }
.cx-process.is-playing .cx-p-lid { animation: cx-lid 4s ease-in-out infinite; }
.cx-process.is-playing .cx-p-nflow { animation: cx-nflow 3s linear infinite; }
.cx-process.is-playing .cx-p-coolg { animation: cx-coolg 6s ease-out infinite; }
.cx-process.is-playing .cx-p-wheel { animation: cx-wheel 5s ease-in-out infinite alternate; }
.cx-process.is-playing .cx-p-hone { animation: cx-hone 3.6s ease-in-out infinite alternate; }
.cx-process.is-playing .cx-p-spark { animation: cx-spark 0.5s linear infinite; }
.cx-process.is-playing .cx-p-spark--b { animation-delay: -0.17s; }
.cx-process.is-playing .cx-p-spark--c { animation-delay: -0.33s; }
.cx-process.is-playing .cx-p-xh { animation: cx-xh 9s linear infinite; }

/* Stage list: numbered, editable text; the active stage follows the lit station. Only the background and top border change, so every label keeps full text contrast (never faded). */
.cx-stages { list-style: none; counter-reset: cx-st; margin: 0.9rem 0 0; padding: 0; display: grid; gap: 0.5rem 1rem; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); }
.cx-stages li { counter-increment: cx-st; position: relative; padding: 0.55rem 0.7rem 0.6rem 2.3rem; border: 1px solid rgba(246, 246, 241, 0.16); border-top: 2px solid rgba(255, 219, 21, 0.55); font-size: 0.875rem; line-height: 1.3; color: #f6f6f1; }
.cx-stages li::before { content: counter(cx-st); position: absolute; left: 0.7rem; top: 0.5rem; font-family: var(--cx-display, inherit); font-weight: 800; font-size: 1.1rem; color: #ffdb15; }
.cx-process--finishing .cx-stages li::before { content: '\2022'; }
.cx-process.is-playing .cx-stages--sync li { animation: var(--act) var(--T) infinite; animation-delay: calc(var(--T) * (var(--i) / var(--N) - 1)); }
.cx-process--bimetal.is-playing .cx-stages--sync { --act: cx-act-6; }
.cx-process--carburising.is-playing .cx-stages--sync { --act: cx-act-4; }
.cx-process--nitriding.is-playing .cx-stages--sync { --act: cx-act-3; }
.cx-process--finishing.is-playing .cx-stages--sync li { animation: none; }

@keyframes cx-cell-6 { 0%, 14.5% { opacity: 1; } 16.5%, 97% { opacity: 0.32; } 100% { opacity: 1; } }
@keyframes cx-cell-4 { 0%, 23% { opacity: 1; } 25%, 97% { opacity: 0.32; } 100% { opacity: 1; } }
@keyframes cx-cell-3 { 0%, 31% { opacity: 1; } 33.5%, 97% { opacity: 0.32; } 100% { opacity: 1; } }
@keyframes cx-act-6 { 0%, 14.5% { background-color: rgba(255, 219, 21, 0.16); border-top-color: #ffdb15; } 16.5%, 97% { background-color: transparent; border-top-color: rgba(255, 219, 21, 0.4); } 100% { background-color: rgba(255, 219, 21, 0.16); border-top-color: #ffdb15; } }
@keyframes cx-act-4 { 0%, 23% { background-color: rgba(255, 219, 21, 0.16); border-top-color: #ffdb15; } 25%, 97% { background-color: transparent; border-top-color: rgba(255, 219, 21, 0.4); } 100% { background-color: rgba(255, 219, 21, 0.16); border-top-color: #ffdb15; } }
@keyframes cx-act-3 { 0%, 31% { background-color: rgba(255, 219, 21, 0.16); border-top-color: #ffdb15; } 33.5%, 97% { background-color: transparent; border-top-color: rgba(255, 219, 21, 0.4); } 100% { background-color: rgba(255, 219, 21, 0.16); border-top-color: #ffdb15; } }
@keyframes cx-sweep { from { transform: translateX(0); opacity: 0; } 20%, 80% { opacity: 1; } to { transform: translateX(142px); opacity: 0; } }
@keyframes cx-rot { to { transform: rotate(360deg); } }
@keyframes cx-fall { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(var(--dy)); opacity: 0.2; } }
@keyframes cx-glow { from { opacity: 0.25; } to { opacity: 0.75; } }
@keyframes cx-blade { 0%, 55% { transform: translateY(0); } 70% { transform: translateY(34px); } 85%, 100% { transform: translateY(0); } }
@keyframes cx-form { 0% { transform: scale(0.55); opacity: 0.2; } 45%, 100% { transform: scale(1); opacity: 1; } }
@keyframes cx-pocket { 0%, 20% { opacity: 0; } 45%, 100% { opacity: 1; } }
@keyframes cx-mand { from { transform: scale(0.88); } to { transform: scale(1.02); } }
@keyframes cx-atom-in { 0% { transform: translate(0, 0); opacity: 0; } 20% { opacity: 1; } 100% { transform: translate(var(--tx), var(--ty)); opacity: 0; } }
@keyframes cx-core-grow { 0% { transform: scale(1); } 70%, 100% { transform: scale(0.74); } }
@keyframes cx-core-thin { 0% { transform: scale(1); } 70%, 100% { transform: scale(0.9); } }
@keyframes cx-dip { 0%, 10% { transform: translateY(0); } 40%, 85% { transform: translateY(58px); } 100% { transform: translateY(0); } }
@keyframes cx-hotc { 0%, 10% { opacity: 0.6; } 50%, 100% { opacity: 0; } }
@keyframes cx-wave { to { transform: translateX(24px); } }
@keyframes cx-bub { 0% { transform: translateY(0); opacity: 0; } 20% { opacity: 0.9; } 100% { transform: translateY(-46px); opacity: 0; } }
@keyframes cx-heatw { 0% { transform: translateY(8px); opacity: 0; } 40% { opacity: 0.8; } 100% { transform: translateY(-10px); opacity: 0; } }
@keyframes cx-lid { 0%, 8% { transform: translateY(-22px); } 30%, 92% { transform: translateY(0); } 100% { transform: translateY(-22px); } }
@keyframes cx-coolg { 0% { opacity: 0.7; } 80%, 100% { opacity: 0; } }
@keyframes cx-nflow { 0% { transform: translateX(0); opacity: 0; } 15%, 80% { opacity: 0.9; } 100% { transform: translateX(30px); opacity: 0; } }
@keyframes cx-wheel { from { transform: translateX(-70px); } to { transform: translateX(70px); } }
@keyframes cx-hone { from { transform: translateX(-30px); } to { transform: translateX(30px); } }
@keyframes cx-spark { 0% { transform: translate(0, 0); opacity: 0.9; } 100% { transform: translate(4px, -10px); opacity: 0; } }
@keyframes cx-xh { 0% { opacity: 0.1; } 85%, 100% { opacity: 1; } }

/* Reduced motion: view.js starts the figure paused; the visitor may opt in with the toggle button. */
