/* AES — a Logical Art nibble.
 *
 * Sixteen bytes at a time, so the page is a grid of hex pairs and the mono
 * face carries it. Colour marks one thing: which bytes moved when a single
 * input bit was flipped. That is the page's whole claim, so it is marked with
 * a rule as well as a tone.
 *
 * The machine takes the studio neutral. la-accent-pick.py reports no colour
 * left that clears both floors against the accents already published.
 */

* { margin: 0; padding: 0; box-sizing: border-box; }

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

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

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

.ae-steplabel { margin: var(--la-space-5) 0 var(--la-space-2); font-weight: 600; color: var(--la-ink); }
.ae-stepno {
  display: inline-block; min-width: 1.6rem; margin-right: 0.5rem;
  padding: 0.05rem 0.5rem; border: 1px solid var(--la-hairline-strong);
  border-radius: 999px; font-family: var(--la-font-mono);
  font-size: var(--la-text-xs); color: var(--la-ink-dim); text-align: center;
}
.ae-hint { margin: 0 0 var(--la-space-3); color: var(--la-ink-dim); }

.ae-controls { display: flex; flex-wrap: wrap; align-items: end; gap: var(--la-space-2); margin: var(--la-space-3) 0; }
.ae-field { width: 100%; }
.ae-field label { display: block; margin-bottom: 0.35rem; color: var(--la-ink-dim); font-size: var(--la-text-sm); }
.ae-range { width: 100%; max-width: 24rem; accent-color: var(--la-instrument); }
.ae-btn {
  padding: 0.45rem 0.9rem; border: 1px solid var(--la-hairline-strong);
  border-radius: var(--la-radius-sm, 4px); background: var(--la-raised);
  color: var(--la-ink); font-family: var(--la-font-mono); font-size: var(--la-text-sm);
  cursor: pointer;
}
.ae-btn:hover { border-color: var(--la-instrument); }
.ae-btn:focus-visible { outline: 2px solid var(--la-instrument); outline-offset: 2px; }

/* Sixteen bytes, four to a column the way the standard lays a state out. */
.ae-state {
  display: grid; grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 0.3rem; margin: var(--la-space-3) 0; max-width: 26rem;
  font-family: var(--la-font-mono); font-size: var(--la-text-sm);
}
.ae-byte {
  padding: 0.25rem 0.15rem; text-align: center;
  border: 1px solid var(--la-hairline); border-radius: 2px;
  color: var(--la-ink-dim);
}
/* A byte that moved when one input bit was flipped. Rule and weight as well
   as tone, because this is the claim the page is named for. */
.ae-byte[data-mark="moved"] {
  color: var(--la-instrument); border-color: var(--la-instrument);
  border-bottom-width: 3px; font-weight: 700;
}

.ae-said { margin: var(--la-space-3) 0 0; color: var(--la-ink-dim); font-size: var(--la-text-sm); }

.ae-checks { width: 100%; border-collapse: collapse; font-size: var(--la-text-sm); }
.ae-checks th, .ae-checks td {
  text-align: left; padding: 0.35rem 0.6rem; border-bottom: 1px solid var(--la-hairline);
  vertical-align: top;
}
.ae-checks thead th {
  font-size: var(--la-text-xs); letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--la-ink-dim); font-weight: 600;
}
.ae-checks td { color: var(--la-ink-dim); }
.ae-checks td:last-child { font-family: var(--la-font-mono); font-size: 0.8rem; }
.ae-checks tr[data-mark="bad"] td { color: var(--la-warn, #e0b341); }
