/* Chapter 4: four steps, set out unevenly like work pinned to a table. */
.process { position: relative; z-index: 1; padding: 0; background: var(--ground); }
.process-pin {
  display: grid;
  gap: clamp(32px, 5vw, 64px);
  padding: clamp(96px, 14vh, 150px) var(--margin) clamp(64px, 10vh, 110px);
}
.process-sheet { display: contents; }
.steps { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: clamp(36px, 5vw, 72px) clamp(16px, 2.4vw, 32px); }
.step { display: grid; align-content: start; gap: 12px; min-width: 0; }
.step-1 { grid-column: 1 / span 7; }
.step-2 { grid-column: 9 / span 4; }
.step-3 { grid-column: 1 / span 4; }
.step-4 { grid-column: 6 / span 7; }
.step p { max-width: 34em; font-size: clamp(17px, 1.3vw, 19px); }
.step-screen { display: block; overflow: hidden; margin-bottom: 8px; border-radius: 12px; background: var(--ground-2); }
.step-screen.wide { aspect-ratio: 16 / 10; }
.step-screen.tall { aspect-ratio: 5 / 6; }
.step-screen img { width: 100%; height: 100%; object-fit: cover; object-position: top; }

@media (max-width: 760px) {
  .steps { grid-template-columns: minmax(0, 1fr); }
  .step-1, .step-2, .step-3, .step-4 { grid-column: 1; }
}

/* Computers, without graphics: all four steps at once, on the pin, inside the frame. */
.tier-full .process { height: 410vh; }
.tier-full .process, .tier-full .assembly-pin {
  --paper: #e3e3e3;
  --pencil: #161616;
  --tooth: 0.16;
  --beam: linear-gradient(90deg, rgb(254 254 254 / 0) 0%, rgb(255 255 255 / 0.059) 12.2%, rgb(255 255 255 / 0.117) 22.2%, rgb(255 255 255 / 0.187) 30%, rgb(255 255 255 / 0.261) 35.6%, rgb(255 255 255 / 0.353) 40%, rgb(255 255 255 / 0.504) 43.3%, rgb(255 255 255 / 0.728) 46%, rgb(255 255 255 / 0.912) 47.8%, #fff 48.9%, #fff 51.1%, rgb(254 254 254 / 0.879) 52.2%, rgb(248 248 248 / 0.609) 54%, rgb(208 208 208 / 0.359) 56.7%, rgb(120 120 120 / 0.247) 60%, rgb(79 79 79 / 0.136) 64.4%, rgb(140 140 140 / 0.024) 70%, rgb(140 140 140 / 0) 78%);
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 1.5 -.45'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}
html.tier-full[data-theme='dark'] .process, html.tier-full[data-theme='dark'] .assembly-pin {
  --paper: #121212;
  --pencil: #e8e8e8;
  --tooth: 0.13;
  --beam: linear-gradient(90deg, rgb(255 255 255 / 0) 0%, rgb(255 255 255 / 0.016) 12.2%, rgb(255 255 255 / 0.032) 22.2%, rgb(255 255 255 / 0.051) 30%, rgb(255 255 255 / 0.072) 35.6%, rgb(255 255 255 / 0.106) 40%, rgb(255 255 255 / 0.202) 43.3%, rgb(255 255 255 / 0.374) 46%, rgb(255 255 255 / 0.518) 47.8%, rgb(255 255 255 / 0.907) 48.9%, #fff 50%, rgb(255 255 255 / 0.863) 51.1%, rgb(255 255 255 / 0.471) 52.2%, rgb(255 255 255 / 0.323) 54%, rgb(255 255 255 / 0.15) 56.7%, rgb(255 255 255 / 0.055) 60%, rgb(255 255 255 / 0.026) 64.4%, rgb(255 255 255 / 0.014) 70%, rgb(255 255 255 / 0.006) 76.7%, rgb(255 255 255 / 0) 88%);
}
.tier-full .process-pin { position: sticky; top: 0; display: block; height: 100svh; padding: 0; overflow: hidden; background: var(--ground); }
.tier-full .process-sheet {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 2.4svh;
  height: 100%;
  padding: calc(var(--bar-h) + 1svh) var(--margin) var(--margin);
}
.tier-full .steps { grid-template-columns: 1.7fr 1fr 1fr 1.7fr; gap: clamp(16px, 2vw, 32px); min-height: 0; }
.tier-full .step { grid-column: auto; grid-template-rows: minmax(0, 1fr) auto auto; gap: 8px; min-height: 0; }
.tier-full .step-screen, .tier-full .step-screen.wide, .tier-full .step-screen.tall { aspect-ratio: auto; min-height: 0; margin-bottom: 4px; }
.tier-full .step-screen img { object-position: 0 0; }
.tier-full .step h3 { font-size: min(2vw, 3.6svh); }
.tier-full .step p { font-size: clamp(14px, min(1.15vw, 2svh), 18px); line-height: 1.35; }

/* With graphics: a sheet two frames wide and two tall. Each step fills the frame by itself, the last view takes in all four. */
.tier-full .process.scene-on .process-sheet {
  --gap: 5vw;
  position: absolute;
  left: 0;
  top: 0;
  z-index: 1;
  display: block;
  width: calc(200% + var(--gap));
  height: calc(200% + var(--gap));
  padding: 0;
  transform-origin: 0 0;
  will-change: transform;
}
.tier-full .process.scene-on .process-sheet h2 { position: absolute; left: var(--margin); top: calc(var(--bar-h) + 1svh); z-index: 1; font-size: var(--type-giant); }
.tier-full .scene-on .steps { display: grid; grid-template: minmax(0, 1fr) minmax(0, 1fr) / minmax(0, 1fr) minmax(0, 1fr); gap: var(--gap); height: 100%; }
.tier-full .scene-on .step { position: relative; display: block; overflow: hidden; min-width: 0; min-height: 0; }
.tier-full .scene-on .step-1 { grid-area: 1 / 1; }
.tier-full .scene-on .step-2 { grid-area: 1 / 2; }
.tier-full .scene-on .step-3 { grid-area: 2 / 2; }
.tier-full .scene-on .step-4 { grid-area: 2 / 1; }
.tier-full .scene-on .step h3, .tier-full .scene-on .step p { position: absolute; margin: 0; }
.tier-full .scene-on .step h3 { font-size: var(--type-big); line-height: 1.06; letter-spacing: -0.03em; }
.tier-full .scene-on .step p { font-size: min(1.5vw, 2.8svh); line-height: 1.4; max-width: none; color: var(--ink-2); }
.tier-full .scene-on .step-2, .tier-full .scene-on .step-3 { display: grid; grid-template-rows: auto auto; align-content: center; gap: 3svh; padding-top: var(--bar-h); }
.tier-full .scene-on .step-2 h3, .tier-full .scene-on .step-2 p, .tier-full .scene-on .step-3 h3, .tier-full .scene-on .step-3 p { position: static; }
.tier-full .scene-on .step-2 h3, .tier-full .scene-on .step-3 h3 { font-size: var(--type-giant); }
.tier-full .scene-on .step-2 p, .tier-full .scene-on .step-3 p { width: min(46vw, 100%); }
.tier-full .scene-on .step-screen { position: absolute; margin: 0; border-radius: 18px; box-shadow: 0 0 0 1px var(--ground-3); }
.tier-full .scene-on .step-screen.wide { aspect-ratio: 8 / 5; }
.tier-full .scene-on .step-screen.tall { aspect-ratio: 414 / 900; width: 36vw; top: calc(var(--bar-h) + 1svh); }

.tier-full .scene-on .step-1 .step-screen { left: 36vw; top: 31svh; width: 72vw; }
.tier-full .scene-on .step-1 h3 { left: var(--margin); bottom: 19svh; width: 32vw; }
.tier-full .scene-on .step-1 p { left: var(--margin); bottom: var(--margin); width: 30vw; }

.tier-full .scene-on .step-2 { padding-inline: var(--margin) calc(36vw + var(--margin) * 2); }
.tier-full .scene-on .step-2 .step-screen { right: var(--margin); }

.tier-full .scene-on .step-3 { padding-inline: calc(36vw + var(--margin) * 2) var(--margin); }
.tier-full .scene-on .step-3 .step-screen { left: var(--margin); }

.tier-full .scene-on .step-4 .step-screen { left: var(--margin); top: calc(var(--bar-h) + 21svh); width: calc(100% - var(--margin) * 2); }
.tier-full .scene-on .step-4 h3 { left: var(--margin); top: calc(var(--bar-h) + 1svh); white-space: nowrap; }
.tier-full .scene-on .step-4 p { right: var(--margin); top: calc(var(--bar-h) + 1svh); width: 30vw; }

/* The paper laid over a finished step: the light cuts it away. */
.tier-full .process-draft, .tier-full .process-veil, .tier-full .process-beam { display: none; color: var(--pencil); pointer-events: none; }
.tier-full .scene-on .process-draft { position: absolute; inset: 0; z-index: 2; display: block; overflow: hidden; background: var(--paper); will-change: transform; }
.tier-full .process-draft::before { content: ''; position: absolute; inset: 0; opacity: var(--tooth); background: var(--noise); }
.tier-full .process-draft canvas { z-index: 1; display: none; }
.tier-full .process-draft canvas.on { display: block; }

/* Clean ground: before the paper arrives, and behind the last sweep of the light. */
.tier-full .scene-on .process-veil { position: absolute; inset: 0; z-index: 3; display: block; background: var(--ground); }

.tier-full .scene-on .process-beam {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 4;
  display: block;
  width: 900px;
  height: 116vmax;
  margin: -58vmax 0 0 -450px;
  background: var(--beam);
  visibility: hidden;
  will-change: transform, opacity;
}
.tier-full .process-beam::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.1;
  background: var(--noise);
  -webkit-mask-image: var(--beam);
  mask-image: var(--beam);
}
