/* Interlace.
 *
 * The accent comes from la-machines.css, generated from the roster. Nothing
 * here declares --machine or --accent: a custom property set on the element
 * that reads it overrides the inherited value.
 *
 * Measures in rem, never ch: ch resolves against the element's own font-size.
 */

/* The page frame. Floating Point shipped without these and ran the full width
   of the browser, which no gate saw and an operator did. */
* { margin: 0; padding: 0; box-sizing: border-box; }

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

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

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;
}

.il-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.il-hint,
.il-note {
  color: var(--la-ink-dim);
  font-size: var(--la-text-sm);
  margin-top: var(--la-space-2);
}

/* [hidden] loses to an author display value. This family has shipped that bug
   three times, so every rule with a display restates it. */
.il-note[hidden] { display: none; }

/* ---- the picture ------------------------------------------------------ */

.il-screen {
  margin-top: var(--la-space-4);
  border: 1px solid var(--la-hairline-strong);
  border-radius: var(--la-radius, 6px);
  background: color-mix(in srgb, var(--la-ink) 4%, transparent);
  overflow: hidden;
}

.il-line {
  position: relative;
  height: 0.55rem;
  /* The faint banding is the point: you are looking at discrete lines. */
  border-bottom: 1px solid color-mix(in srgb, var(--la-ink) 5%, transparent);
}

.il-line:last-child { border-bottom: 0; }

.il-bar {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 9%;
  background: var(--accent);
  /* No transition. A CSS animation between positions would smooth over the
     jump between fields, which is the only thing this page is about. */
}

/* The two fields, told apart by brightness as well as position, so the
   interleaving survives a greyscale screenshot and colour blindness. */
.il-line[data-field="1"] .il-bar { opacity: 0.55; }
.il-line[data-field="0"] .il-bar { opacity: 1; }

/* ---- controls --------------------------------------------------------- */

.il-presets {
  display: flex;
  flex-wrap: wrap;
  gap: var(--la-space-2);
  margin-top: var(--la-space-3);
}

.il-btn {
  font-family: var(--la-font-mono);
  font-size: var(--la-text-sm);
  color: var(--la-ink);
  background: color-mix(in srgb, var(--la-ink) 6%, transparent);
  border: 1px solid var(--la-hairline-strong);
  border-radius: var(--la-radius, 6px);
  padding: 0.4em 0.9em;
  cursor: pointer;
  /* 2.5.8 asks for 24 CSS pixels. */
  min-height: 2.25rem;
  min-width: 2.25rem;
}

.il-btn:hover { border-color: var(--accent); color: var(--accent); }

.il-btn[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.il-btn:focus-visible,
.il-range:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.il-knob { margin-top: var(--la-space-4); }

.il-knob label {
  display: block;
  font-family: var(--la-font-mono);
  font-size: var(--la-text-xs);
  color: var(--la-ink-dim);
  margin-bottom: var(--la-space-2);
}

.il-value { color: var(--accent); }

.il-range {
  width: 100%;
  max-width: 26rem;
  accent-color: var(--accent);
  min-height: 1.5rem;
}

/* ---- the readout ------------------------------------------------------ */

.il-readout {
  margin-top: var(--la-space-4);
  border-top: 1px solid var(--la-hairline);
}

.il-row {
  display: grid;
  grid-template-columns: 12rem 1fr;
  gap: var(--la-space-3);
  padding: var(--la-space-2) 0;
  border-bottom: 1px solid var(--la-hairline);
}

.il-row dt {
  font-family: var(--la-font-mono);
  font-size: var(--la-text-xs);
  color: var(--la-ink-dim);
}

.il-row dd {
  font-size: var(--la-text-sm);
  color: var(--la-ink);
  overflow-wrap: anywhere;
}

.il-strong dd { color: var(--accent); font-weight: 600; }

.il-num { font-family: var(--la-font-mono); }

.il-why { margin-top: var(--la-space-6); }

.il-why h2 {
  margin-top: var(--la-space-5);
  margin-bottom: var(--la-space-2);
}

.il-why p { margin-top: var(--la-space-3); color: var(--la-ink-dim); }

.il-why q { color: var(--la-ink); }

/* The reduced-motion answer is in the script, not here: the page opens frozen
   for anyone who has asked for it, because the movement is the subject and
   cannot be styled away. Nothing in this file animates anything. */

@media (max-width: 34rem) {
  .il-row { grid-template-columns: 1fr; }
  .il-row dt { color: var(--la-ink-faint); }
  .il-line { height: 0.45rem; }
}
