/* Same Shape: screen and print. Radius is 0 everywhere. */

html { color-scheme: light; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: var(--fw-medium);
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
}

.col {
  box-sizing: content-box;
  max-width: 44rem;
  margin: 0 auto;
  padding: 2.5rem 16px 3rem;
}

h1 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  font-size: 2.25rem;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--c-earth);
}

.lead {
  margin: 0 0 1rem;
  font-weight: var(--fw-thin);
  font-size: 1.3rem;
  line-height: 1.35;
}

/* Two lines reserved: the playing text wraps on narrow screens, and the chart must not move under a held pointer. */
.instruction { margin: 0 0 2rem; min-height: 2.9em; }

.chart-heading {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: var(--fw-medium);
}

/* The chart scrolls sideways on its own; the page never does. */
.chart-wrap {
  container-type: inline-size;
  overflow-x: auto;
  overflow-y: hidden;
}

.chart {
  --u: max(2.5rem, min(3.4rem, calc(100cqi / 12.5)));
  width: calc(12.5 * var(--u));
  font-variant-numeric: tabular-nums;
  user-select: none;
  -webkit-user-select: none;
}

.row {
  display: flex;
  margin-left: calc(var(--off) * var(--u));
}

.key {
  box-sizing: border-box;
  flex: none;
  width: var(--u);
  height: var(--u);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ink);
  font-size: calc(0.4 * var(--u));
  font-weight: var(--fw-bold);
  touch-action: none;
  cursor: default;
}

.key.held { background: var(--c-peach); }
.key.home { border: 3px solid var(--c-brick); }

.readout { margin-top: 1.25rem; font-variant-numeric: tabular-nums; }
.line {
  margin: 0;
  min-height: 1.45em;
  font-size: 1.3rem;
}

.caption {
  margin: 0.5rem 0 0;
  min-height: 1.45em;
}

.actions {
  margin: 1.5rem 0;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

button,
input {
  font: inherit;
  color: var(--ink);
  background: transparent;
  border: 1.5px solid var(--ink);
  appearance: none;
  padding: 0.35rem 0.8rem;
}
button:hover { background: var(--c-peach); }
button:focus-visible,
input:focus-visible,
a:focus-visible { outline: 2px solid var(--c-brick); outline-offset: 2px; }

a { color: var(--ink); text-underline-offset: 0.2em; }
a:hover { color: var(--c-earth); }

.notes { margin-top: 2rem; }
.note {
  margin: 0 0 0.35rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.note:empty { margin: 0; }

.colophon { margin-top: 3rem; }
.colophon img { display: block; width: 140px; height: auto; margin-bottom: 0.5rem; }

/* The strip: a keyboard template in real millimetres. */
.strip-page { margin: 0; }
.controls {
  padding: 16px 16px 0;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem 1.5rem;
  font-size: 0.9rem;
}
.controls label { display: flex; flex-direction: column; gap: 0.25rem; }
.controls input { width: 6rem; }
.controls .hint { margin: 0; color: var(--ink-soft); flex-basis: 100%; }
.sheet-wrap { overflow-x: auto; padding: 16px; }

.sheet {
  --p: 19mm;
  width: calc(12.5 * var(--p));
  font-size: 9pt;
  line-height: 4.5mm;
  font-weight: var(--fw-medium);
  font-variant-numeric: tabular-nums;
}
.sheet p { margin: 0; }
.sheet-head { margin-bottom: 4mm; }

/* One border style per box: Chrome drops lines from boxes that mix dotted and dashed when printing. */
.strip-row { position: relative; display: flex; width: max-content; margin-left: calc(var(--off) * var(--p)); }
.strip-row::before,
.strip-row::after { content: ""; position: absolute; left: 0; pointer-events: none; }
.strip-row::before { top: 0; bottom: 0; border-left: 0.3mm dashed var(--ink); }
.strip-row::after { right: 0; bottom: 0; border-bottom: 0.3mm dashed var(--ink); }
.strip-row:first-child::after { top: 0; border-top: 0.3mm dashed var(--ink); }
.cell {
  box-sizing: border-box;
  flex: none;
  width: var(--p);
  height: var(--p);
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 0.3mm dotted var(--ink);
  font-weight: var(--fw-bold);
  font-size: calc(0.38 * var(--p));
}
.cell:last-child { border-right-style: dashed; }
/* The Q row sticks out half a key past the digit row; its top cut line there. */
.strip-row:nth-child(2) .cell:last-child { position: relative; }
.strip-row:nth-child(2) .cell:last-child::before { content: ""; position: absolute; top: 0; left: 50%; right: 0; border-top: 0.3mm dashed var(--ink); }
.cell.home { outline: 1mm solid var(--ink); outline-offset: -1mm; }

.shapes { margin-top: 5mm; }
.shapes-title { font-weight: var(--fw-bold); }
.shape-list {
  display: grid;
  grid-template-rows: repeat(3, auto);
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  margin-top: 1mm;
}
.foot { margin-top: 5mm; }
.foot img { display: block; width: 40mm; height: auto; margin-top: 3mm; filter: brightness(0); }

@media print {
  @page { size: landscape; margin: 10mm; }
  body { background: #fff; color: #000; }
  .no-print { display: none !important; }
  .sheet-wrap { overflow: visible; padding: 0; }
  .sheet { --ink: #000; color: #000; }
}
