/* pmuP. One system: concrete ground, ink text, rust for the action, yellow for PUMP, fire for what burned.
   Display Big Shoulders Display (name, counters, titles), text IBM Plex Sans (everything else, tabular numbers),
   mono IBM Plex Mono (addresses, signatures, memos only). Spacing 8/16/24/32/48/64/96. */
:root {
  --concrete: #d9d4cc;
  --paper: #efebe4;
  --ink: #1e2428;
  --ink-2: #474d51;
  --steel: #5d6b73;
  --rust: #b5562b;
  --rust-dk: #8f3f1c;
  --yellow: #f2c230;
  --fire: #ff6a1a;
  --board: #1b2024;
  --display: "Big Shoulders Display", "Arial Narrow", Impact, sans-serif;
  --text: "IBM Plex Sans", "Segoe UI", Arial, sans-serif;
  --mono: "IBM Plex Mono", Consolas, monospace;
  --shadow: 4px 4px 0 var(--ink);
  --wrap: 1240px;
  --gut: 64px;
}
* { box-sizing: border-box; }
html { background: var(--concrete); -webkit-text-size-adjust: 100%; }
body { margin: 0; color: var(--ink); font: 400 18px/1.55 var(--text); font-variant-numeric: tabular-nums; background: var(--concrete); overflow-x: hidden; }
img { display: block; max-width: 100%; }
a { color: inherit; }
b, strong { font-weight: 700; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: var(--paper); padding: 12px 24px; z-index: 50; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--rust); outline-offset: 3px; }

/* ---------- the plate: the one card style (a safety sign of the plant) ---------- */
.plate { background: var(--paper); border: 2px solid var(--ink); box-shadow: var(--shadow); }
.bracket { font-weight: 600; letter-spacing: .06em; text-transform: uppercase; font-size: 16px; }

/* ---------- the station: picture + copy ---------- */
.station { position: relative; container-type: inline-size; }
.stage { position: relative; }
.scene { position: relative; }   /* the picture box: every overlay is in percent of it */
.art { width: 100%; height: auto; user-select: none; }
.impeller, .fire, .flash, .flow, .stencil, .board, .pot { position: absolute; }

/* overlay coordinates, measured off the picture's pixels (percent of the picture box) */
.scene {
  --imp-x: 63.2%; --imp-y: 63.2%; --imp-d: 17%;
  --fire-x: 84.6%; --fire-y: 79.2%; --fire-w: 6.8%;
  --board-x: 79.67%; --board-y: 25.5%; --board-w: 16.68%; --board-h: 23.6%;
  --pipe-y: 15.7%; --pipe-x0: 48.5%; --pipe-x1: 64.5%;
  --in-x: 42.2%; --in-y: 15.9%; --out-x: 94.5%; --out-y: 15.9%;
  --pot-x: 37.2%; --pot-y: 27.5%; --pot-w: 20.5%;
}
.impeller { left: var(--imp-x); top: var(--imp-y); width: var(--imp-d); height: auto; translate: -50% -50%; will-change: rotate; }
.fire { left: var(--fire-x); top: var(--fire-y); width: var(--fire-w); height: auto; translate: -50% -50%; opacity: 0; pointer-events: none; }
.flash { left: var(--fire-x); top: var(--fire-y); width: 18%; aspect-ratio: 1; translate: -50% -50%; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 196, 64, .9), rgba(255, 106, 26, .35) 45%, rgba(255, 106, 26, 0) 70%); opacity: 0; pointer-events: none; }
.flash.on { animation: flash 900ms ease-out; }
@keyframes flash { 0% { opacity: 0; } 12% { opacity: 1; } 100% { opacity: 0; } }

.flow { left: var(--pipe-x0); width: calc(var(--pipe-x1) - var(--pipe-x0)); top: var(--pipe-y); height: 0; }
.tag { position: absolute; top: 0; left: 0; width: 6.6cqw; translate: -50% -50%; display: grid; place-items: center; transition: left 380ms cubic-bezier(.2, .8, .2, 1), top 380ms cubic-bezier(.2, .8, .2, 1); }
.tag img { width: 100%; }
.tag span { position: absolute; font: 800 max(16px, 1.3cqw)/1 var(--display); letter-spacing: .04em; color: var(--ink); }
.stencil { font: 900 clamp(20px, 2.2cqw, 40px)/1 var(--display); color: #f6efe3; letter-spacing: .1em; translate: -50% -50%; text-shadow: 0 1px 0 rgba(30, 36, 40, .5); }
.stencil-in { left: var(--in-x); top: var(--in-y); }
.stencil-out { left: var(--out-x); top: var(--out-y); }

.board { left: var(--board-x); top: var(--board-y); width: var(--board-w); height: var(--board-h); }
.board-row { position: absolute; left: 0; right: 0; top: 0; height: 45.5%; }
.board-row + .board-row { top: 54.5%; }
.board-label { position: absolute; left: 0; right: 0; top: 0; height: 40%; display: flex; align-items: center; justify-content: center; font: 600 max(16px, 1.15cqw)/1 var(--text); color: #efe9de; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.flaps { position: absolute; left: 0; right: 0; bottom: 0; height: 54%; display: grid; grid-template-columns: repeat(7, 1fr); gap: 0 2.15%; }
/* the digits are printed straight into the cream windows painted on the board, like a mechanical counter */
.flap { display: grid; place-items: center; color: var(--ink); font: 900 2.55cqw/1 var(--display); }
.fire-ink .flap { color: var(--rust); }
.flap.flip { animation: flip 260ms ease-out; }
@keyframes flip { 0% { transform: scaleY(1); } 45% { transform: scaleY(.08); } 100% { transform: scaleY(1); } }

.pot { left: 37.2%; top: 27.5%; width: 20.5%; padding: 16px 20px; display: grid; gap: 10px; }
.pot-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.pot-left { font-weight: 600; font-size: 16px; }
.pot-foot { font-size: 16px; color: var(--ink-2); }
.pot-foot b { color: var(--ink); }
.board-legend { display: none; margin: 0; font-size: 16px; }
.board-legend b:first-child { color: #8a6a00; }
.board-legend b + b { color: var(--rust); }
.gauge { height: 16px; border: 2px solid var(--ink); background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 2px), rgba(30, 36, 40, .25) calc(10% - 2px) 10%); position: relative; }
.gauge i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--yellow); border-right: 2px solid var(--ink); transition: width 400ms ease-out; }

/* ---------- the copy column on the calm wall ---------- */
.copy { position: absolute; top: 0; bottom: 0; left: max(16px, 4.4cqw); width: 28.4cqw; display: flex; flex-direction: column; justify-content: center; gap: clamp(12px, 1.2cqw, 24px); padding: 72px 0 24px; }
.nav { position: absolute; top: clamp(16px, 2.2cqw, 32px); left: 0; display: flex; gap: 32px; font-weight: 600; font-size: 18px; }
.nav a { text-decoration: underline 3px transparent; text-underline-offset: 10px; padding: 6px 0; }
.nav a[aria-current="page"] { text-decoration-color: var(--yellow); }
.nav a:hover { text-decoration-color: var(--ink); }
.name { margin: 0; font: 900 clamp(72px, 7.8cqw, 150px)/.78 var(--display); letter-spacing: -.01em; display: grid; isolation: isolate; }
.name span { display: block; position: relative; }
.name span:first-child { z-index: 2; }
.name span + span { margin-top: -.3em; color: transparent; -webkit-text-stroke: 2px var(--ink); z-index: 1; }
.name span:nth-child(2) { opacity: .7; }
.name span:nth-child(3) { opacity: .4; }
.headline { margin: 0; font: 700 clamp(24px, 2.45cqw, 40px)/1.12 var(--text); letter-spacing: -.01em; }
.headline em { font-style: normal; color: var(--rust); }
.lede { margin: 0; font-size: clamp(17px, 1.32cqw, 21px); max-width: 34em; }
.actions { display: flex; gap: 16px; flex-wrap: wrap; }
.btn { min-height: 52px; padding: 0 1.3em; display: inline-flex; align-items: center; justify-content: center; font: 700 18px/1 var(--text); border: 2px solid var(--ink); cursor: pointer; text-decoration: none; }
.btn-main { background: var(--rust); color: #fff8ef; box-shadow: var(--shadow); }
.btn-main:hover { background: var(--rust-dk); }
.btn-main:active { translate: 2px 2px; box-shadow: 2px 2px 0 var(--ink); }
.btn-main[aria-busy="true"] { background: var(--rust-dk); }
.btn-line { background: transparent; color: var(--ink); }
.btn-line:hover { background: var(--paper); }

.links { display: grid; gap: 14px; }
.ca { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; padding: 12px 12px 12px 20px; min-height: 60px; }
.ca-label { flex: none; }
.ca-label { font-weight: 600; font-size: 16px; white-space: nowrap; }
.ca-addr { font: 500 16px/1.3 var(--mono); flex: 1; min-width: 0; overflow-wrap: anywhere; user-select: all; }
.ca:not(.set) .ca-addr { font-family: var(--text); user-select: text; color: var(--ink-2); }
.ca-copy { min-height: 44px; padding: 0 1.3em; background: var(--ink); color: var(--paper); border: 0; font: 700 16px/1 var(--text); cursor: pointer; }
.ca-copy:disabled { background: #8b8e8f; color: #f1eee8; cursor: not-allowed; }
.ca-copy.done { background: #2e7d4f; }
.wheels { display: flex; justify-content: space-between; gap: 8px; }
.valve { display: flex; flex-direction: column; align-items: center; gap: 6px; text-decoration: none; cursor: pointer; min-width: 0; }
.valve .wheel { width: 52px; height: 52px; flex: none; transition: rotate 420ms cubic-bezier(.2, .8, .2, 1); }
.valve:hover .wheel, .valve:focus-visible .wheel { rotate: -90deg; }
.valve-tag { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 16px; min-height: 44px; background: var(--paper); border: 2px solid var(--ink); font-weight: 700; font-size: 16px; white-space: nowrap; }
.valve-tag img { width: 18px; height: 18px; object-fit: contain; }
.valve[aria-disabled="true"] { cursor: default; }
.valve[aria-disabled="true"] .valve-tag { color: #5d6164; border-color: #5d6164; }
.valve[aria-disabled="true"] .valve-tag img { filter: grayscale(1); opacity: .6; }
.valve[aria-disabled="true"]:hover .wheel { rotate: 0deg; }
.links-note { margin: 0; font-size: 16px; color: var(--ink-2); }

/* ---------- sections below ---------- */
/* one left edge with the copy column of the first screen */
.sect { padding: 96px max(16px, 4.4vw) 32px; }
.sect > * { max-width: var(--wrap); }
.sect:last-of-type { padding-bottom: 96px; }
.sect-head { display: grid; gap: 8px; margin-bottom: 32px; }
.sect-head::before { content: ""; height: 12px; width: 160px; background: repeating-linear-gradient(-45deg, var(--yellow) 0 12px, var(--ink) 12px 24px); margin-bottom: 16px; }
.sect-head h2 { margin: 0; font: 900 56px/1 var(--display); }
.sect-head p { margin: 0; max-width: 46em; }
.ledger-wrap { overflow-x: auto; }
.ledger { width: 100%; border-collapse: collapse; font-size: 17px; }
/* row rules are drawn by pseudo elements, so no cell becomes a bordered box */
.ledger th { text-align: left; font-size: 16px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: 12px 16px 12px 0; white-space: nowrap; position: relative; }
.ledger td { padding: 14px 16px 14px 0; vertical-align: top; position: relative; }
.ledger th::after, .ledger td::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; border-top: 1px solid rgba(30, 36, 40, .25); }
.ledger th::after { border-top: 2px solid var(--ink); }
.ledger td.num { white-space: nowrap; }
.ledger .n { font: 800 28px/1 var(--display); }
.ledger .n a { text-decoration: none; }
.ledger .n a:hover { text-decoration: underline; }
.ledger .when { display: block; font-size: 16px; color: var(--ink-2); }
.ledger .tx a { font: 500 16px/1.6 var(--mono); }
.ledger tr.new { animation: rowin 600ms ease-out; }
@keyframes rowin { from { background: rgba(242, 194, 48, .55); } to { background: transparent; } }
.ledger .empty td { color: var(--ink-2); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.step { padding: 0 0 24px; display: grid; align-content: start; }
.step img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-bottom: 2px solid var(--ink); }
.step h3 { margin: 24px 32px 8px; font: 800 30px/1.05 var(--display); }
.step p { margin: 0 32px; font-size: 17px; }

/* ---------- the station stacked: under 1180 px wide or 660 px tall ---------- */
@media (max-width: 1179px), (max-height: 659px) {
  .station { display: flex; flex-direction: column-reverse; }
  .copy { position: relative; left: auto; width: auto; max-width: 760px; margin: 0 auto; padding: 88px 32px 32px; container-type: normal; }
  .nav { left: 32px; top: 24px; }
  .name { font-size: clamp(56px, 13vw, 132px); }
  .headline { font-size: clamp(24px, 4.2vw, 38px); }
  .lede { font-size: 18px; }
  .pot { width: 30%; }
}
@media (max-width: 860px) {
  /* the tall picture: pipe top to bottom, furnace at the foot, the board above it */
  .scene {
    --imp-x: 40.2%; --imp-y: 57.2%; --imp-d: 39.6%;
    --fire-x: 64.5%; --fire-y: 80.7%; --fire-w: 15%;
    --board-x: 67.4%; --board-y: 51.9%; --board-w: 26.1%; --board-h: 9.6%;
    --in-x: 31.3%; --in-y: 9.5%; --out-x: 17%; --out-y: 70%;
  }
  .flow { left: 31.3%; top: 14%; width: 0; height: 14%; }
  .board-label { display: none; }
  .board-row { height: 37.2%; }
  .board-row + .board-row { top: 62.8%; }
  .flaps { height: 100%; grid-template-columns: repeat(6, 1fr); gap: 0 2.4%; }
  .flap { font-size: 6cqw; }
  .board-legend { display: block; }
  .station { flex-direction: column; }
  .copy { display: contents; }
  .copy > * { margin-left: 16px; margin-right: 16px; }
  .nav { position: static; order: 1; margin-top: 16px; gap: 24px; }
  .name { order: 2; margin-top: 16px; }
  .headline { order: 3; margin-top: 12px; }
  .stage { order: 4; margin-top: 20px; }
  .lede { order: 5; margin-top: 20px; }
  .actions { order: 6; margin-top: 20px; }
  .links { order: 7; margin-top: 24px; margin-bottom: 8px; }
  .name { font-size: clamp(48px, 15vw, 64px); }
  .pot { position: relative; left: auto; top: auto; width: auto; margin: 16px 16px 0; }
  .tag { width: 15cqw; }
  .tag span { display: none; }
  .valve { flex-direction: column; gap: 6px; }
  .name span + span { -webkit-text-stroke-width: 1.5px; }
  .name span:nth-child(3) { display: none; }
  .valve .wheel { width: 48px; height: 48px; }
  .valve-tag { padding: 10px 16px; }
  .wheels { flex-wrap: wrap; justify-content: space-around; row-gap: 16px; }
  .ca { flex-wrap: wrap; padding: 12px 12px 12px 16px; }
  .ca-addr { flex-basis: 100%; order: 3; }
  .ca-copy { margin-left: auto; }
  .sect { padding: 64px 16px 24px; }
  .sect-head h2 { font-size: 44px; }
  .steps { grid-template-columns: 1fr; gap: 24px; }
  .ledger thead { display: none; }
  .ledger tr { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; padding: 16px 0; position: relative; }
  .ledger tr::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; border-top: 1px solid rgba(30, 36, 40, .25); }
  .ledger td { padding: 0; }
  .ledger td.num { white-space: normal; }
  .ledger-wrap { overflow: visible; }
  .ledger td::after { display: none; }
  .ledger td:first-child { grid-row: span 4; }
  .ledger td[data-k]::before { content: attr(data-k) ": "; font-weight: 600; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .flow { display: none; }
}

/* under 900 px of height the name keeps one outlined echo, so the copy column always clears the nav */
@media (min-width: 1180px) and (max-height: 899px) {
  .name span:nth-child(3) { display: none; }
}
