.process { padding-top: clamp(56px, 6.5vw, 96px); }
.process .head { max-width: none; }

.tiles-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding-bottom: 14px; color: var(--ink); font-size: 0.9375rem; font-weight: 500; }

/* Three steps side by side, each shown as the product working in front of a destination. */
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.tile { position: relative; display: grid; align-content: start; gap: 16px; }

.scene { display: grid; place-items: center; aspect-ratio: 1; padding: 20px; transition: box-shadow 0.3s; }
.scene.on { box-shadow: 0 0 0 2px var(--blue); }
.ui { position: relative; width: 100%; padding: 16px; border-radius: var(--r-card); background: var(--paper); box-shadow: var(--float); color: var(--ink); font-size: 0.875rem; }
.ui-title { margin-bottom: 10px; font-weight: 600; }
.ui-title span { display: block; color: var(--ink-3); font-size: 0.75rem; font-weight: 400; }
.ui-bar { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 12px; font-size: 0.75rem; color: var(--ink-3); }
.ui-note { margin-top: 10px; font-size: 0.75rem; line-height: 1.45; color: var(--ink-3); }
.live { color: var(--blue); font-weight: 500; }

/* The bar under a tile is the timer for its step. */
.bar { position: relative; height: 3px; overflow: hidden; border-radius: 2px; background: var(--line); }
.bar::after { content: ""; position: absolute; inset: 0; background: var(--blue); translate: calc(-101% * var(--dir)) 0; }
.bar.done::after { translate: 0; }
.bar.run::after { animation: fill 5.2s linear forwards; }
[data-state="idle"] .bar.run::after { animation: none; }
[data-state="paused"] *, [data-state="paused"] *::after { animation-play-state: paused !important; }
@keyframes fill { to { translate: 0; } }

.step { display: grid; gap: 6px; }
.step .num { color: var(--ink-3); font-size: 0.875rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.step button { padding: 0; border: 0; background: none; font: inherit; letter-spacing: inherit; text-align: start; }
.step button::after { content: ""; position: absolute; inset: 0; }

.process-foot { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; margin-top: 32px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--ink); font-weight: 500; }
.process-foot .num { color: var(--blue); font-variant-numeric: tabular-nums; }
.process .fine { max-width: 76ch; margin-top: 8px; }

/* Each scene rests in its finished state; the motion only plays it in. */
#process:not([data-state="idle"]) .scene.on :is(.pick-list li, .ui-file, .fields div, .slots li, .ui-done, .ui-note) { animation: arrive 0.55s var(--ease) backwards; }
#process:not([data-state="idle"]) .scene.on :is(li, .fields div):nth-child(2) { animation-delay: 0.14s; }
#process:not([data-state="idle"]) .scene.on :is(li, .fields div):nth-child(3) { animation-delay: 0.28s; }
#process:not([data-state="idle"]) .scene.on :is(li, .fields div):nth-child(4) { animation-delay: 0.42s; }
#process:not([data-state="idle"]) .scene.on li:nth-child(5) { animation-delay: 0.56s; }
#process:not([data-state="idle"]) .scene.on li:nth-child(6) { animation-delay: 0.7s; }
#process:not([data-state="idle"]) .scene.on :is(.ui-done, .ui-note) { animation-delay: 1.5s; }

.pick-list ul { display: grid; gap: 6px; }
.pick-list li { display: flex; align-items: center; gap: 10px; padding: 6px; padding-inline-end: 12px; border-radius: var(--r-ctl); background: var(--tint); font-weight: 500; }
.pick-list img { width: 44px; height: 32px; border-radius: 5px; object-fit: cover; }
.pick-list .i { margin-inline-start: auto; color: var(--blue); }
.pick-list .sel { background: var(--paper); box-shadow: inset 0 0 0 1.5px var(--blue); }

.ui-file { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 10px; padding: 7px 10px; border-radius: var(--r-ctl); background: var(--tint); font-size: 0.75rem; }
.ui-file b { display: flex; align-items: center; gap: 4px; color: var(--blue-dk); font-weight: 500; }
.fields { display: grid; gap: 7px; }
.fields div { display: flex; justify-content: space-between; gap: 10px; padding-bottom: 7px; border-bottom: 1px solid var(--line); }
.fields dt { color: var(--ink-3); }
.fields dd { font-weight: 500; white-space: nowrap; }
.ui-done { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; padding: 9px 12px; border-radius: var(--r-ctl); background: var(--tint); color: var(--blue-dk); font-size: 0.8125rem; font-weight: 500; }
.ui-done b { display: block; color: var(--ink); font-weight: 600; }
.ui-done span { color: var(--ink-2); font-weight: 400; }

.slots ol { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.slots li { display: grid; padding: 7px 9px; border-radius: var(--r-ctl); background: var(--tint); font-size: 0.75rem; font-weight: 500; }
.slots li span { font-size: 0.6875rem; font-weight: 400; color: var(--ink-3); white-space: nowrap; }
.slots .hit { background: var(--blue); color: #fff; }
.slots .hit span { color: #fff; }
.ui-bar .now { color: var(--blue); font-weight: 600; }

/* Two readings share one slot: the earlier one holds, then gives way. */
.swap { display: grid; }
.swap > * { grid-area: 1 / 1; }
.swap .was { opacity: 0; }
#process:not([data-state="idle"]) .scene.on .swap .was { animation: hold-out 1.5s linear backwards; }
#process:not([data-state="idle"]) .scene.on .now { animation: hold-in 1.5s linear backwards; }
@keyframes hold-out { 0%, 86% { opacity: 1; } }
@keyframes hold-in { 0%, 86% { opacity: 0; } }

@media (max-width: 900px) {
  .tiles { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .scene { aspect-ratio: auto; min-height: 300px; }
}

@media (prefers-reduced-motion: reduce) {
  #process-toggle { display: none; }
}
