/* Process story: a travelling carton, with every scene composed around where it stops. */
.process-overview { padding-bottom: 24px; }
/* Section links as a quiet trail, not a row of buttons. */
.process-section-links { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 0; margin-top: 28px; }
.process-section-links a + a::before { content: ""; display: inline-block; width: clamp(22px, 3vw, 44px); height: 1px; margin: 0 14px; vertical-align: middle; background: var(--line, #e7e1d6); }
.process-section-links a { padding: 4px 0; color: var(--text); font-weight: 600; text-decoration: underline 2px transparent; text-underline-offset: 6px; transition: text-decoration-color .25s ease, color .25s ease; }
.process-section-links a:hover { color: var(--accent); text-decoration-color: var(--wood, #a67c52); }
.process-section-links a:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.process-assembly { position: relative; width: calc(100% - 48px); max-width: 1392px; margin: 0 auto; }

/* The carton lane spans the full width; JS slides the 28%-wide carton between left (0), centre (.5) and right (1). */
.assembly-rail { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.assembly-sticky { position: sticky; top: 100px; width: 28%; height: calc(100svh - 135px); display: flex; flex-direction: column; justify-content: center; align-items: center; transform: translateX(calc(var(--box-pos, 1) * 257.1429%)); will-change: transform; }
.assembly-eyebrow { color: var(--accent); font-size: 10.5px; letter-spacing: .16em; text-align: center; margin: 0 12px; }
.assembly-stage { position: relative; width: 100%; height: min(53svh,460px); }
.assembly-stage .proc-box__scene { width: 100%; height: 100%; aspect-ratio: auto; --intro: 1; --box-scale: .5; }
.assembly-stage .proc-box__rot { width: 550px; height: 460px; filter: none; opacity: 1; transform-style: preserve-3d; transform: translate(-50%,-50%) scale(var(--box-scale)) rotateX(calc(var(--view) * -18deg)) rotateY(calc(var(--view) * -32deg)); }
.assembly-stage .carton { left: 85px; top: 85px; transform: translateX(calc(var(--foldA) * 95px)); transform-style: preserve-3d; }
/* Carton colours, all driven 0 → 1 from the scroll:
   --red the printed theme, --blank unprinted white board, --mono printed in black only. */
.assembly-stage .proc-box__scene { --red-pct: calc(var(--red, 0) * 100%); --blank-pct: calc(var(--blank, 0) * 100%); --box-accent: color-mix(in srgb, #c0262f var(--red-pct), #5b5f66); }
.assembly-stage .panel { outline: 1px solid color-mix(in srgb, #b86a70 var(--red-pct), #a4a6ab); background: color-mix(in srgb, #fff var(--blank-pct), color-mix(in srgb, #fff7f7 var(--red-pct), #fcfcfc)); }
.assembly-stage .panel--left { background: color-mix(in srgb, #fff var(--blank-pct), color-mix(in srgb, #eab7ba var(--red-pct), #e2e2e4)); }
.assembly-stage .panel--right { background: color-mix(in srgb, #fff var(--blank-pct), color-mix(in srgb, #dc9a9f var(--red-pct), #cfd0d3)); }
.assembly-stage .panel--back { background: color-mix(in srgb, #fff var(--blank-pct), color-mix(in srgb, #f3d3d5 var(--red-pct), #ececed)); }
.assembly-stage .panel--top { top: -85px; height: 85px; background: color-mix(in srgb, #fff var(--blank-pct), color-mix(in srgb, #f6dfe0 var(--red-pct), #f0f0f1)); }
.assembly-stage .panel--bottom { height: 85px; background: color-mix(in srgb, #fff var(--blank-pct), color-mix(in srgb, #d99498 var(--red-pct), #cbcccf)); }
.assembly-stage .art__band, .assembly-stage .art--side { background: var(--box-accent); }
.assembly-stage .art { opacity: var(--print); filter: grayscale(var(--mono, 0)) contrast(calc(1 + .5 * var(--mono, 0))) saturate(calc(1 + .25 * var(--uv, 0))); }
/* One layer over every panel carries, top to bottom: the UV gloss streaks (--uv), the raised spot-UV dots (--spot)
   and the blue plate coating (--plate). --uv and --spot stay on once the sheet is finished, so the carton keeps them. */
.assembly-stage .panel::before { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background:
    linear-gradient(115deg, rgba(255,255,255,0) 15%, rgba(255,255,255,calc(.55 * var(--uv, 0))) 32%, rgba(255,255,255,0) 46%, rgba(255,255,255,calc(.25 * var(--uv, 0))) 66%, rgba(255,255,255,0) 80%),
    radial-gradient(circle at 42% 42%, rgba(255,255,255,calc(.45 * var(--spot, 0))) 0 1.3px, transparent 1.8px),
    radial-gradient(circle at 58% 58%, rgba(0,0,0,calc(.07 * var(--spot, 0))) 0 1.3px, transparent 1.8px),
    linear-gradient(135deg, rgba(52,97,227,var(--plate, 0)) 0%, rgba(33,73,196,var(--plate, 0)) 55%, rgba(26,58,158,var(--plate, 0)) 100%);
  background-size: 100% 100%, 8px 8px, 8px 8px, 100% 100%; }
.assembly-stage .panel--front::after { display: none; }
/* The die-cut traces the whole carton (550 × 460, like the rotating frame). */
.assembly-stage .proc-box__cut { left: 0; top: 0; width: 550px; height: 460px; }
.assembly-stage .proc-box__cut .cutline { stroke: #1c1f24; stroke-width: 2.5px; }

/* The printed sheet the carton sits on, one up. It lives in the carton's own frame, so it shares its size and turn.
   --sheet shows it; --ink, --red, --scan, --uv and --spot drive what happens across it. */
.sheet-paper, .sheet-fx { position: absolute; left: -56px; top: -34px; width: 662px; height: 528px; pointer-events: none; opacity: var(--sheet, 0); }
.sheet-paper { background: #fff; border: 1px solid #d6dbe1; box-shadow: 0 30px 50px -22px rgba(16,24,40,.28); transform: translateZ(-2px); }
.sheet-fx { overflow: hidden; transform: translateZ(3px); }
.sheet-bar { position: absolute; left: 14px; top: 42px; bottom: 42px; width: 18px; }
.sheet-bar--k { background: repeating-linear-gradient(180deg, #d0d3d8 0 28px, #9aa0a8 28px 56px, #5f656e 56px 84px, #1c1f24 84px 112px); opacity: calc(var(--ink, 0) * (1 - var(--red, 0))); }
.sheet-bar--c { background: repeating-linear-gradient(180deg, #1aa3df 0 28px, #e2328c 28px 56px, #f6d31d 56px 84px, #1c1f24 84px 112px); opacity: var(--red, 0); }
.sheet-mark { position: absolute; left: 50%; width: 22px; height: 22px; margin-left: -11px; fill: none; stroke: #1c1f24; stroke-width: 1.2; opacity: var(--ink, 0); }
.sheet-mark--top { top: 6px; }
.sheet-mark--bottom { bottom: 6px; }

.sheet-head { position: absolute; left: 0; right: 0; height: 5px; margin-top: -2.5px; border-radius: 3px; }
.sheet-head--k { top: calc(var(--ink, 0) * 100%); background: #1c1f24; opacity: calc(4 * var(--ink, 0) * (1 - var(--ink, 0))); }
.sheet-head--c { top: calc(var(--red, 0) * 100%); background: linear-gradient(90deg, #1aa3df, #e2328c, #f6d31d, #1c1f24); opacity: calc(4 * var(--red, 0) * (1 - var(--red, 0))); }
.sheet-scan-trail { position: absolute; left: 0; right: 0; top: 0; height: calc(var(--scan, 0) * 100%); background: linear-gradient(180deg, rgba(43,240,160,0), rgba(43,240,160,.22)); opacity: calc(4 * var(--scan, 0) * (1 - var(--scan, 0))); }
.sheet-scan { position: absolute; left: 0; right: 0; top: calc(var(--scan, 0) * 100%); height: 5px; margin-top: -2.5px; background: #2bf0a0; box-shadow: 0 0 20px 6px rgba(43,240,160,.65), 0 0 60px 18px rgba(43,240,160,.25); opacity: min(1, calc(5 * var(--scan, 0) * (1 - var(--scan, 0)))); }
/* A bright band of light sweeps across as the UV gloss, then the spot texture, goes on. */
.sheet-glint { position: absolute; top: -12%; bottom: -12%; width: 28%; transform: skewX(-18deg); background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,.9) 50%, rgba(255,255,255,0)); mix-blend-mode: screen; }
.sheet-glint--uv { left: calc(var(--uv, 0) * 140% - 40%); opacity: min(1, calc(5 * var(--uv, 0) * (1 - var(--uv, 0)))); }
.sheet-glint--spot { left: calc(var(--spot, 0) * 140% - 40%); opacity: min(1, calc(5 * var(--spot, 0) * (1 - var(--spot, 0)))); }
.sheet-ok { position: absolute; right: 18px; top: 16px; width: 44px; height: 44px; --ok: clamp(0, calc((var(--scan, 0) - .85) * 6.67), 1); opacity: calc(var(--ok) * (1 - var(--uv, 0))); transform: scale(calc(.6 + .4 * var(--ok))); }
.sheet-ok svg { display: block; width: 100%; height: 100%; }
.assembly-state { margin: 0 12px 12px; font-size: 14px; font-weight: 600; text-align: center; color: var(--text); }
.assembly-meter { width: 100px; height: 3px; background: var(--border); }
.assembly-meter span { display: block; height: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; }
.assembly-hint { font-size: 11px; color: var(--muted); margin: 12px 0 0; }

/* Scenes: text and photos share a grid with the 28% carton column, wherever the carton stops.
   No photo is cropped: each frame takes its photo's own ratio (--r), and the photos in a row share one height. */
.process-chapter { scroll-margin-top: 80px; }
.process-scene { --gap: 16px; --row-h: 56svh; min-height: calc(100svh - 80px); padding: 56px 0; display: grid; column-gap: 48px; row-gap: 28px; align-content: center; }
.process-scene--right { grid-template-columns: minmax(0,1fr) 28%; grid-template-areas: "copy ." "row ."; }
.process-scene--left { grid-template-columns: 28% minmax(0,1fr); grid-template-areas: ". copy" ". row"; }
.process-scene--center { --row-h: 26svh; grid-template-columns: minmax(0,1fr) 28% minmax(0,1fr); }
.process-scene--hero-left { grid-template-areas: "hero . copy" "hero . row"; }
.process-scene--hero-right { grid-template-areas: "copy . hero" "row . hero"; }

/* Story type: the same faces throughout. */
.scene-copy { grid-area: copy; align-self: end; min-width: 0; max-width: 46rem; }
.scene-head { margin-bottom: 20px; }
.scene-eyebrow { color: var(--accent); font-size: .75rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; margin: 0 0 6px; }
.scene-chapter { font-family: var(--display); font-size: clamp(2.2rem,4.4vw,3.6rem); font-weight: 700; line-height: 1.05; margin: 0; }
.scene-copy p { color: var(--muted); font-size: 1rem; line-height: 1.7; margin: 0; max-width: 62ch; }
.scene-copy .scene-lead { color: var(--text); font-size: 1.45rem; font-weight: 600; line-height: 1.3; margin-bottom: 12px; text-wrap: balance; }

.process-scene figure { display: flex; flex-direction: column; gap: 8px; min-width: 0; margin: 0; }
.process-scene figcaption { color: var(--muted); font-size: .78rem; line-height: 1.4; }
.process-photo-frame { aspect-ratio: var(--r); overflow: hidden; border-radius: 10px; background: var(--surface); }
.process-photo-frame img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* A row grows each photo in proportion to its ratio, so all share one height; it stops short of --row-h tall. */
.scene-row { grid-area: row; align-self: start; display: flex; align-items: flex-start; gap: var(--gap); width: min(100%, calc(var(--row-h) * var(--sum) + var(--gap) * 2)); }
.scene-row figure { flex: var(--r) 1 0; }
.scene-hero { grid-area: hero; align-self: center; justify-self: center; width: min(100%, calc(60svh * var(--r))); }


@media(max-width:1100px) {
  .scene-copy .scene-lead { font-size: 1.25rem; }
  .scene-copy p { font-size: .96rem; line-height: 1.7; }
}
@media(max-width:900px) {
  /* Phones and tablets: the carton gets a full-width bar under the header, tall enough for every stage to read. */
  .assembly-sticky { top: 62px; width: 100%; transform: none; height: calc(30svh + 40px); background: rgba(255,255,255,.97); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 6px 0; }
  .assembly-stage { width: 100%; height: 30svh; }
  .assembly-eyebrow, .assembly-meter, .assembly-hint { display: none; }
  .assembly-state { font-size: 12px; margin: 6px 0 0; text-align: center; }
  .process-chapter { scroll-margin-top: 0; }
  .process-assembly .process-scene { grid-template-columns: minmax(0,1fr); grid-template-areas: "copy" "hero" "row"; min-height: calc(100svh - 70px); padding: calc(30svh + 124px) 0 32px; row-gap: 16px; align-content: start; }
  .scene-hero { width: 100%; }
  .scene-row { width: 100%; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .scene-row figure:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .scene-chapter { font-size: 2rem; }
  .process-scene figcaption { font-size: 11.5px; }
  .scene-copy p { font-size: .88rem; line-height: 1.7; }
  .process-assembly .scene-copy .scene-lead { font-size: 1.15rem; margin-bottom: 9px; }
  .process-section-links a + a::before { width: 18px; margin: 0 10px; }
}
@media(prefers-reduced-motion:reduce) {
  .process-photo-frame img { animation: none; transform: none; }
}

/* The floor at a glance: the facility paragraph beside four numbers from the company profile. */
.process-glance { padding: 8px 0 clamp(40px, 5vw, 64px); }
.process-glance__inner { display: grid; grid-template-columns: minmax(0, 7fr) minmax(280px, 5fr); gap: clamp(28px, 5vw, 72px); align-items: center; padding-top: clamp(28px, 4vw, 48px); border-top: 1px solid var(--line, #e7e1d6); }
.process-glance__copy h2 { font-family: var(--display); font-size: clamp(1.7rem, 3vw, 2.4rem); line-height: 1.1; margin: 6px 0 14px; max-width: 20ch; text-wrap: balance; }
.process-glance__copy p:not(.eyebrow) { color: var(--muted); font-size: 1rem; line-height: 1.7; margin: 0; max-width: 62ch; }
.process-glance__facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px; margin: 0; }
.process-glance__facts div { padding-left: 14px; border-left: 2px solid var(--wood, #a67c52); }
.process-glance__facts dt { font-family: var(--display); font-size: clamp(1.5rem, 2.4vw, 2rem); font-weight: 700; line-height: 1; color: var(--accent); }
.process-glance__facts dd { margin: 6px 0 0; color: var(--muted); font-size: .85rem; line-height: 1.45; }

/* Chapter page: story and equipment facts on the copy side, what the chapter handles in a list column. */
.process-intro { row-gap: 32px; }
.process-scene--right.process-intro { grid-template-areas: "copy ." "details ."; }
.process-scene--left.process-intro { grid-template-areas: ". copy" ". details"; }
.process-scene--center.process-intro { grid-template-areas: "copy . details"; }
.process-intro__copy { align-self: start; }
.process-intro__facts-title { margin: 26px 0 10px; color: var(--accent); font-size: .74rem; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; }
.process-intro__facts { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; max-width: 56ch; }
.process-intro__facts li { position: relative; padding-left: 18px; color: var(--text); font-size: .95rem; line-height: 1.55; }
.process-intro__facts li::before { content: ""; position: absolute; left: 0; top: .6em; width: 8px; height: 2px; background: var(--wood, #a67c52); }
.process-intro__details { grid-area: details; align-self: start; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px 40px; max-width: 46rem; }
.process-scene--center.process-intro .process-intro__details { grid-template-columns: 1fr; align-self: end; }
.process-intro__list h3 { margin: 0 0 10px; color: var(--text); font-family: var(--display); font-size: 1.05rem; font-weight: 600; }
.process-intro__list ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.process-intro__list li { padding: 7px 0; border-top: 1px solid var(--line, #e7e1d6); color: var(--muted); font-size: .92rem; line-height: 1.45; }
.process-intro__list li:last-child { border-bottom: 1px solid var(--line, #e7e1d6); }
@media (max-width: 1100px) {
  .process-scene--center.process-intro { grid-template-areas: "copy" "details"; }
  .process-scene--center.process-intro .process-intro__details { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
}
@media (max-width: 860px) {
  .process-glance__inner { grid-template-columns: 1fr; gap: 24px; }
  .process-glance__facts { gap: 14px 18px; }
  .process-assembly .process-scene.process-intro { grid-template-areas: "copy" "details"; }
  .process-intro__facts { max-width: none; }
}

/* A little red to bring the story to life: a red stop after each chapter title, a short red rule over each
   scene's lead line, and the machine or key name that opens each "On the floor" point set in maroon. */
.scene-chapter::after { content: "."; color: var(--accent); }
.scene-copy .scene-lead::before { content: ""; display: block; width: 36px; height: 3px; margin-bottom: 14px; background: var(--accent); }
.process-intro .scene-copy .scene-lead::before { display: none; }
.process-intro__facts li::before { background: var(--accent); }
.fact-key { color: var(--accent); font-weight: 600; }
.process-glance__facts dt { color: var(--accent); }

/* the carton's printed sheet can reach past the edge on mid-size screens; clip it without breaking the sticky rail */
.process-assembly { overflow-x: clip; }
