/* A plate from a workshop manual: two inks on grey-green stock. */
.hp {
  --ink: #17251e;
  --air: #c2660c;
  position: relative;
  width: 540px;
  height: 540px;
  overflow: hidden;
  background: #cdd5c3 url("./paper.jpg") center / 540px 540px no-repeat;
  color: var(--ink);
  font-family: "Barlow Condensed", sans-serif;
  user-select: none;
  -webkit-user-select: none;
}

.hp * { box-sizing: border-box; }

/* Line weights: outlines of parts, hairlines, section hatching, solid parts. */
.hp-edge { fill: none; stroke: var(--ink); stroke-width: 0.9; stroke-linejoin: miter; }
.hp-fine { fill: none; stroke: var(--ink); stroke-width: 0.5; stroke-linejoin: round; }
.hp-hatch { fill: none; stroke: var(--ink); stroke-width: 0.5; }
.hp-solid { fill: var(--ink); }
.hp-cut-a { fill: url(#hp-ha); stroke: var(--ink); stroke-width: 0.9; }
.hp-cut-b { fill: url(#hp-hb); stroke: var(--ink); stroke-width: 0.9; }
.hp-cut-c { fill: url(#hp-hc); stroke: var(--ink); stroke-width: 0.9; }

.hp-plan {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  pointer-events: none;
}

/* The air, in the second ink. */
.hp-air,
.hp-port,
.hp-line,
.hp-vent { fill: var(--air); }

.hp-dots {
  fill: none;
  stroke: var(--air);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-dasharray: 0.01 4;
}

.hp-ball,
.hp-flap,
.hp-cap { will-change: transform; }

/* The handle, rod and piston move as one. */
.hp-handle {
  position: absolute;
  left: 410px;
  top: 60px;
  width: 116px;
  height: 220px;
  pointer-events: none;
  will-change: transform;
}

.hp-handle svg { display: block; }

.hp-hit {
  position: absolute;
  left: 6px;
  top: -6px;
  width: 104px;
  height: 46px;
  cursor: grab;
  pointer-events: auto;
  touch-action: none;
}

.hp-hit:active { cursor: grabbing; }

/* The release valve: the drawn cap is the button. */
.hp-valve {
  position: absolute;
  left: 368px;
  top: 390px;
  width: 48px;
  height: 84px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  outline: none;
  touch-action: none;
}

.hp-valve svg {
  display: block;
  overflow: visible;
}

.hp-cap-ring {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1;
  opacity: 0;
  pointer-events: none;
}

/* focus doubles the cap's outline */
.hp-valve:focus-visible .hp-cap-ring { opacity: 1; }

/* The gauge is the number input: dial, needle, and the field in a window. */
.hp-gauge {
  position: absolute;
  left: 24px;
  top: 60px;
  width: 376px;
  height: 376px;
  border-radius: 50%;
}

.hp-dial,
.hp-needle {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  pointer-events: none;
}

.hp-num {
  fill: var(--ink);
  font-size: 27px;
  font-weight: 500;
  text-anchor: middle;
  dominant-baseline: central;
}

.hp-num-psi {
  font-size: 11px;
  letter-spacing: 0.02em;
}

.hp-unit {
  fill: var(--ink);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-anchor: middle;
}

.hp-unit-psi { font-size: 11px; }

.hp-needle {
  transform-origin: 188px 188px;
  will-change: transform;
}

.hp-blade { fill: var(--air); }

/* The window in the dial face and the two printed keys beside it. */
.hp-group {
  position: absolute;
  left: 106px;
  top: 263px;
  width: 164px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hp-field {
  width: 92px;
  height: 42px;
  padding: 0 0 2px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: none;
  outline: 0.5px solid var(--ink);
  outline-offset: -4px;
  color: var(--ink);
  caret-color: var(--ink);
  font: inherit;
  font-size: 33px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  text-align: center;
  user-select: text;
  -webkit-user-select: text;
}

.hp-field::selection { background: #17251e33; }

/* focus thickens the window's frame */
.hp-field:focus-visible { box-shadow: 0 0 0 1.5px var(--ink); }

.hp-step {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: none;
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  outline: none;
}

.hp-step svg {
  width: 14px;
  height: 14px;
  stroke-width: 1.7;
  stroke-linecap: butt;
}

.hp-step:focus-visible { box-shadow: 0 0 0 1.5px var(--ink); }

.hp-step:active {
  background: var(--ink);
  color: #cdd5c3;
}

.hp-step[data-disabled] {
  border-color: #17251e59;
  background: none;
  color: #17251e59;
  cursor: default;
}
