/* Trigger — a Logical Art nibble.
 *
 * The subject is a scope face, so the page is built around one: a ruled
 * rectangle with traces on it and the numbers that describe them directly
 * underneath, close enough that you read the picture and the measurement in
 * one glance. That adjacency is the argument. A smear with a number beside it
 * saying how wide it is cannot be dismissed as a drawing choice.
 *
 * The machine takes the studio neutral rather than phosphor green. Green is
 * the tube's colour and this page is not about the tube; borrowing it would
 * claim a subject the page has explicitly refused to simulate.
 *
 * Three colours carry meaning and nothing else does: the face, the graticule,
 * and the beam. Everything else is the studio's own ink.
 */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--la-font-ui);
  background: var(--la-page);
  color: var(--la-ink);
  line-height: var(--la-leading-body);
  -webkit-font-smoothing: antialiased;
}

main.nibble {
  max-width: var(--la-measure);
  margin: 0 auto;
  padding: 3rem 1.25rem 3rem;
}

main.nibble p, main.nibble ul, main.nibble ol, main.nibble dl,
main.nibble h1, main.nibble h2 { max-width: none; }

/* Read but not seen. [hidden] is restated because any selector carrying a
   display value outranks the user-agent rule for the attribute, which has
   shipped broken in this family three times. */
.tg-sr {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.tg-sr[hidden] { display: none; }

/* ---- the instrument ---------------------------------------------------- */
.tg {
  --tg-face: #0d1113;
  --tg-rule: #38434a;
}

.tg-screen {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 900 / 380;
  background: var(--tg-face);
  border: 1px solid var(--la-hairline-strong);
  border-radius: var(--la-radius-sm);
}

/* ---- what the picture measured ----------------------------------------- */
.tg-readout {
  display: flex;
  flex-wrap: wrap;
  gap: var(--la-space-2);
  margin-top: var(--la-space-3);
  font-family: var(--la-font-mono);
  font-size: var(--la-text-sm);
}

.tg-reg {
  padding: 0.2rem 0.55rem;
  background: var(--la-sunken);
  border: 1px solid var(--la-hairline);
  border-radius: var(--la-radius-sm);
  color: var(--la-ink);
  white-space: nowrap;
}

.tg-verdictline {
  margin-top: var(--la-space-3);
  padding-left: var(--la-space-3);
  border-left: 3px solid var(--la-hairline-strong);
  color: var(--la-ink);
}
.tg-verdictline.is-still { border-left-color: var(--accent); }
.tg-verdictline.is-smeared,
.tg-verdictline.is-blank { border-left-color: var(--la-ink-faint); }

/* ---- the knobs --------------------------------------------------------- */
.tg-controls {
  display: grid;
  gap: var(--la-space-4);
  margin-top: var(--la-space-4);
}

.tg-modes {
  display: grid;
  gap: var(--la-space-1);
  padding: var(--la-space-3);
  border: 1px solid var(--la-hairline);
  border-radius: var(--la-radius-sm);
}

.tg-modes legend {
  padding: 0 0.4rem;
  font-size: var(--la-text-sm);
  color: var(--la-ink-dim);
}

/* The row is the target, not the dot, so the 24px minimum is met by the whole
   label rather than by a radio a finger cannot find. */
.tg-radio {
  display: flex;
  align-items: center;
  gap: var(--la-space-2);
  min-height: 2.25rem;
  padding: 0 0.3rem;
  border-radius: var(--la-radius-sm);
  cursor: pointer;
}
.tg-radio:hover { background: var(--la-sunken); }
.tg-radio input { width: 1.1rem; height: 1.1rem; accent-color: var(--accent); }

.tg-knobs {
  display: grid;
  gap: var(--la-space-3);
}

.tg-knob {
  display: grid;
  grid-template-columns: minmax(min(7.5rem, 100%), auto) 1fr auto;
  align-items: center;
  gap: var(--la-space-2);
}

.tg-knob label {
  font-size: var(--la-text-sm);
  color: var(--la-ink-dim);
}

.tg-range {
  width: 100%;
  min-height: 1.75rem;
  accent-color: var(--accent);
}
.tg-range:disabled { opacity: 0.45; cursor: not-allowed; }

.tg-out {
  font-family: var(--la-font-mono);
  font-size: var(--la-text-sm);
  color: var(--la-ink);
  white-space: nowrap;
  justify-self: end;
}

.tg-select,
.tg-button {
  font-family: inherit;
  font-size: var(--la-text-sm);
  min-height: 2.25rem;
  padding: 0.35rem 0.7rem;
  color: var(--la-ink);
  background: var(--la-sunken);
  border: 1px solid var(--la-hairline-strong);
  border-radius: var(--la-radius-sm);
  cursor: pointer;
}
.tg-select { grid-column: 2 / -1; }
.tg-button { grid-column: 1 / -1; justify-self: start; }
.tg-button:hover:not(:disabled),
.tg-select:hover:not(:disabled) { border-color: var(--accent); }
.tg-button:disabled,
.tg-select:disabled { opacity: 0.45; cursor: not-allowed; }
.tg-button[aria-pressed="true"] { border-color: var(--accent); }

/* ---- the four stages ---------------------------------------------------- */
.tg-stages {
  margin-top: var(--la-space-5);
  list-style: none;
  display: grid;
  gap: var(--la-space-4);
}

.tg-step {
  padding-left: var(--la-space-4);
  border-left: 1px solid var(--la-hairline);
}

.tg-steplabel {
  font-weight: 600;
  color: var(--la-ink);
}

.tg-stepno {
  display: inline-block;
  min-width: 1.6rem;
  margin-left: calc(-1 * var(--la-space-4) - 0.8rem);
  margin-right: 0.4rem;
  font-family: var(--la-font-mono);
  color: var(--accent);
}

.tg-line {
  margin-top: var(--la-space-1);
  color: var(--la-ink-dim);
}
.tg-line.is-quiet { color: var(--la-ink-faint); font-size: var(--la-text-sm); }

.tg-proof,
.tg-note {
  margin-top: var(--la-space-4);
  padding-top: var(--la-space-3);
  border-top: 1px solid var(--la-hairline);
  font-size: var(--la-text-sm);
  color: var(--la-ink-dim);
}

/* ---- the prose ---------------------------------------------------------- */
.tg-why { margin-top: var(--la-space-6); }
.tg-why h2 {
  margin-top: var(--la-space-5);
  margin-bottom: var(--la-space-2);
  font-size: var(--la-text-xl);
  line-height: var(--la-leading-tight);
}
.tg-why h2:first-child { margin-top: 0; }
.tg-why p { margin-top: var(--la-space-3); }
.tg-why q { font-style: italic; }

@media (min-width: 34rem) {
  .tg-knobs { gap: var(--la-space-2); }
}
