/* Engineering: the controls under Fig. 04 and the three small diagrams lower on the page. */

/* this first screen is an instrument with a row of switches, so it takes the whole screen, as Home does */
.page-engineering .hero--page { min-height: var(--shot-h, max(640px, 100svh)); }

/* the assembly controls: a rail along the foot of the first screen */
.asm { position: relative; margin: 0 var(--gutter); padding-bottom: 20px; border-top: 1px solid var(--line); }
/* the drawing floor dissolves under the controls, so the switches sit on a plain ground */
.asm::before { content: ""; position: absolute; z-index: -1; inset: -56px calc(-1 * var(--gutter)) 0; background: linear-gradient(to bottom, rgba(8, 9, 10, 0), rgba(8, 9, 10, .9) 56px, var(--ink-0) 62%); pointer-events: none; }
.asm__top { display: flex; align-items: center; justify-content: space-between; gap: 16px 40px; min-height: 66px; padding: 10px 0; }
.asm__presets { display: inline-flex; flex: none; border: 1px solid var(--line-2); border-radius: 2px; }
.asm__presets button { min-height: 38px; padding: 0 16px; background: none; border: 0; color: var(--fg-2); font: 500 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; cursor: pointer; transition: color .2s, background .2s; }
.asm__presets button + button { border-left: 1px solid var(--line-2); }
.asm__presets button:hover { color: var(--fg); }
.asm__presets button[aria-pressed="true"] { background: var(--fg); color: var(--ink-0); }
.asm__note { margin: 0; max-width: 64ch; text-align: right; font-size: 14px; line-height: 1.5; color: var(--fg-2); }

.asm__parts { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.asm__parts li + li { border-left: 1px solid var(--line); }
.asm__parts button { display: flex; align-items: center; justify-content: center; gap: 9px; width: 100%; min-height: 44px; padding: 0 4px; background: none; border: 0; color: var(--fg-3); font: 500 10.5px/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; cursor: pointer; transition: color .2s, background .2s; }
/* the lamp: hollow while the part waits in the rack, lit once it is in place, red while it is pointed at */
.asm__parts button::before { content: ""; flex: none; width: 7px; height: 7px; border: 1px solid var(--fg-3); transition: background .2s, border-color .2s; }
.asm__parts button[aria-pressed="true"] { color: var(--fg); }
.asm__parts button[aria-pressed="true"]::before { background: var(--fg); border-color: var(--fg); }
.asm__parts button:hover, .asm__parts button:focus-visible { color: var(--fg); background: rgba(236, 239, 241, .04); }
.asm__parts button:hover::before, .asm__parts button:focus-visible::before { border-color: var(--signal); }
.asm__parts button[aria-pressed="true"]:hover::before, .asm__parts button[aria-pressed="true"]:focus-visible::before { background: var(--signal); }
.asm__parts button:focus-visible { outline-offset: -2px; }
.asm button:disabled { cursor: default; }
.asm__fine { margin: 12px 0 0; font-size: 13px; line-height: 1.5; color: var(--fg-3); }
/* where the figure cannot run there is nothing to switch: the still shows the first preset */
.no-webgl .asm__presets, .no-webgl .asm__parts { display: none; }
.no-webgl .asm__note { text-align: left; }

/* one set of services, two front ends */
.shared { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(24px, 4vw, 72px); align-items: start; margin-top: clamp(48px, 7vw, 104px); padding-top: clamp(32px, 4vw, 56px); border-top: 1px solid var(--line); }
.shared__text h3 { margin: 14px 0 20px; }
.shared__text p { margin: 0 0 1em; max-width: 42ch; color: var(--fg-2); }
.shared__text .btn { margin-top: 12px; }
.shared__fronts { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(12px, 2vw, 28px); }
.shared__front { display: grid; justify-items: start; gap: 10px; padding: 22px 24px 24px; border: 1px solid var(--line-2); border-radius: 2px; }
.shared__front b, .shared__back b { font: 700 clamp(19px, 1.7vw, 24px)/1.15 var(--sans); letter-spacing: -.016em; }
/* two lines come down from the front ends, meet, and go on as one */
.shared__join { position: relative; height: 56px; }
.shared__join i { position: absolute; top: 0; height: 50%; width: 1px; background: var(--line-2); }
.shared__join i:nth-child(1) { left: 25%; }
.shared__join i:nth-child(2) { left: 75%; }
.shared__join i:nth-child(3) { left: 50%; top: 50%; }
.shared__join::after { content: ""; position: absolute; left: 25%; right: 25%; top: 50%; height: 1px; background: var(--line-2); }
.shared__back { position: relative; padding: 20px 24px 0; border: 1px solid var(--line-2); border-radius: 2px; background: var(--ink-1); }
.shared__back ul { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 18px -24px 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.shared__back li { display: grid; align-content: start; gap: 8px; padding: 20px 16px 22px 24px; }
.shared__back li + li { border-left: 1px solid var(--line); }
.shared__back b { font-size: clamp(16px, 1.3vw, 19px); }
.shared__back li span { font: 500 10.5px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--fg-3); }

/* the number of tests behind the iPhone app */
.tally { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(24px, 4vw, 72px); align-items: end; margin-top: clamp(48px, 7vw, 104px); padding-top: clamp(32px, 4vw, 56px); border-top: 1px solid var(--line); }
.tally__n { margin: 0; font: 700 clamp(96px, 13.5vw, 212px)/.8 var(--sans); letter-spacing: -.055em; font-variant-numeric: tabular-nums; }
.tally__text { display: grid; justify-items: start; gap: 14px; padding-bottom: 6px; }
.tally__text p { margin: 0; max-width: 30ch; font-size: clamp(18px, 1.5vw, 23px); line-height: 1.4; color: var(--fg); }

/* the four status words */
.words { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(24px, 4vw, 72px); align-items: start; margin-top: clamp(48px, 7vw, 104px); padding-top: clamp(32px, 4vw, 56px); border-top: 1px solid var(--line); }
.words__text p { margin: 14px 0 0; max-width: 40ch; color: var(--fg-2); }
.words dl { margin: 0; border-top: 1px solid var(--line); }
.words dl > div { display: grid; grid-template-columns: minmax(180px, 3fr) minmax(0, 7fr); gap: 16px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line); }
.words dd { margin: 0; color: var(--fg); font-size: clamp(16px, 1.3vw, 19px); }

@media (max-width: 1239px) {
  .asm__parts { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .asm__parts li:nth-child(n+7) { border-top: 1px solid var(--line); }
  .asm__parts li:nth-child(7) { border-left: 0; }
}
@media (max-width: 860px) {
  .asm { order: 4; display: flex; flex-direction: column; margin-top: 4px; padding-bottom: 0; border-top: 0; }
  .asm::before { display: none; }
  /* the figure's own frame fades into the page above and below it */
  .page-engineering .fig::before, .page-engineering .fig::after { content: ""; position: absolute; z-index: 1; left: 0; right: 0; height: 15%; pointer-events: none; }
  .page-engineering .fig::before { top: 0; background: linear-gradient(to bottom, var(--ink-0), rgba(8, 9, 10, 0)); }
  .page-engineering .fig::after { bottom: 0; height: 9%; background: linear-gradient(to top, var(--ink-0), rgba(8, 9, 10, 0)); }
  .asm__top { display: contents; }
  .asm__presets { order: 1; display: flex; }
  .asm__presets button { flex: 1 1 auto; min-height: 42px; padding: 0 6px; font-size: 10px; letter-spacing: .05em; }
  .asm__parts { order: 2; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 12px; }
  .asm__parts li:nth-child(n) { border-left: 0; border-top: 0; }
  .asm__parts li:not(:nth-child(3n+1)) { border-left: 1px solid var(--line); }
  .asm__parts li:nth-child(n+4) { border-top: 1px solid var(--line); }
  .asm__parts button { justify-content: flex-start; gap: 8px; padding: 0 10px; font-size: 10px; letter-spacing: .05em; }
  .asm__note { order: 3; max-width: none; min-height: 4.5em; margin-top: 14px; text-align: left; }
  .asm__fine { order: 4; margin-top: 8px; }
  .shared, .tally, .words { grid-template-columns: 1fr; }
  .shared__back ul { grid-template-columns: 1fr 1fr; }
  .shared__back li:nth-child(n) { border-left: 0; }
  .shared__back li:nth-child(even) { border-left: 1px solid var(--line); }
  .shared__back li:nth-child(n+3) { border-top: 1px solid var(--line); }
  .tally { align-items: start; }
  .words dl > div { grid-template-columns: 1fr; gap: 8px; }
}
@media (max-width: 420px) {
  .shared__fronts { gap: 10px; }
  .shared__front { padding: 16px 14px 18px; }
  .shared__back li { padding: 16px 12px 18px 14px; }
  .shared__back { padding: 16px 14px 0; }
  .shared__back ul { margin: 14px -14px 0; }
}

/* picture mode: the figure alone */
.bare .asm { visibility: hidden; }
