/* Neobrutalist, dark: black and white only, one font size, no shadows */
:root {
  --fg: #fff;
  --bg: #000;
  --rule: 3px solid var(--fg);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
  margin: 0;
  font: 700 16px/1.4 ui-monospace, Menlo, Consolas, monospace;
  color: var(--fg);
  text-transform: uppercase;
  border-radius: 0;
  box-shadow: none;
}

body {
  background: var(--bg);
  padding: 16px;
}

header, main > *, .stage > *, .details > * {
  border: var(--rule);
}

header, main {
  max-width: 980px;
}

header {
  padding: 8px 12px;
  margin-bottom: 16px;
}

main {
  display: grid;
  gap: 16px;
}

.stage {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 16px;
  border: none;
}

.camera {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--bg);
}

/* Mirrored like a mirror; grey so the page stays black and white */
#video, #overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: scaleX(-1);
}

#video {
  object-fit: cover;
  filter: grayscale(1);
}

.side {
  display: grid;
  grid-template-rows: auto 1fr;
  border: none;
  gap: 16px;
}

#crop {
  width: 100%;
  aspect-ratio: 1;
  border: var(--rule);
  filter: grayscale(1);
  image-rendering: pixelated;
  transform: scaleX(-1);
}

.beat {
  display: grid;
  place-items: center;
  border: var(--rule);
}

.beat.on {
  background: var(--fg);
  color: var(--bg);
}

#readout {
  display: grid;
  grid-template-columns: max-content 1fr;
}

#readout dt, #readout dd {
  padding: 4px 12px;
  border-bottom: var(--rule);
}

#readout dt {
  border-right: var(--rule);
}

#readout dt:nth-last-child(2), #readout dd:last-child {
  border-bottom: none;
}

#strip {
  width: 100%;
  height: 160px;
  display: block;
}

.controls {
  display: flex;
  border: none;
  gap: 16px;
  flex-wrap: wrap;
}

button {
  background: var(--bg);
  border: var(--rule);
  padding: 12px 16px;
  cursor: pointer;
}

button:hover:not(:disabled), button:focus-visible, button.on {
  background: var(--fg);
  color: var(--bg);
  outline: none;
}

button:disabled {
  border-style: dashed;
  cursor: default;
}

/* The metrics, and the log beside them as tall as they are */
.details {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 16px;
  border: none;
}

#log {
  padding: 8px 12px;
  min-height: 7.2em;
  overflow-y: auto;
  white-space: pre-wrap;
  contain: size;
}

@media (max-width: 640px) {
  .stage, .details { grid-template-columns: 1fr; }
  .side { grid-template-columns: 96px 1fr; grid-template-rows: none; }
}
