/* Behind the Beat: a printed marking sheet. Square, hairlines, no decoration. */

*, *::before, *::after { box-sizing: border-box; border-radius: 0; }

html { background: var(--c-cream); }
body {
  margin: 0;
  background: var(--c-cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
  -webkit-text-size-adjust: 100%;
}
p, li { text-wrap: pretty; }

.head, .page { max-width: 38rem; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
.head { display: flex; justify-content: space-between; align-items: flex-end; padding-top: 20px; }
.wordmark { display: block; height: 24px; width: auto; }
.code { font-size: .85rem; color: var(--ink-soft); letter-spacing: .02em; }
.page { padding-bottom: 56px; }

h1 { font-family: var(--font-display); font-size: 1.6rem; font-weight: var(--fw-bold); letter-spacing: -.01em; line-height: 1.15; margin: 26px 0 2px; }
.sub { margin: 0 0 16px; color: var(--ink-soft); }

h2, .label, th {
  font-size: .9rem;
  font-weight: 600;
  font-variant-caps: all-small-caps;
  letter-spacing: .07em;
  color: var(--c-earth);
  margin: 0 0 6px;
}

.sheet { border: 1px solid var(--ink); }
.box { padding: 12px 14px; border-top: 1px solid var(--ink); }
.box:first-child { border-top: 0; }
.box p { margin: 0 0 4px; }
.box p:last-child { margin-bottom: 0; }

.rule { margin: 0; padding-left: 1.6em; }
.rule li { margin: 2px 0; padding-left: .2em; }

.bands { border-collapse: collapse; width: 100%; margin: 2px 0 10px; }
.bands td { border: 1px solid var(--ink); padding: 3px 8px; }
.bands td:first-child { width: 60%; }

.box.fields { padding: 0; }
.field { display: grid; grid-template-columns: 8rem 1fr; }
.field + .field { border-top: 1px solid var(--ink); }
.field .label { grid-row: 1 / span 2; margin: 0; padding: 12px 12px; border-right: 1px solid var(--ink); }
.field .value, .field .note { grid-column: 2; padding: 0 12px; }
.field .value { padding-top: 9px; padding-bottom: 9px; }
.field .note { padding-bottom: 10px; margin-top: -4px; font-size: .88rem; color: var(--ink-soft); }
.unit { color: var(--ink-soft); }

input {
  font: inherit;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--ink);
  padding: 4px 6px;
}
#tempo { width: 5.5rem; }
#candidate { width: 100%; max-width: 22rem; }
input:focus-visible, button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

button {
  font: inherit;
  cursor: pointer;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--ink);
  padding: 7px 14px;
}
button:hover { background: rgba(26, 26, 26, .06); }
button:disabled { opacity: .35; cursor: default; }
#begin { margin-top: 10px; padding: 11px 20px; font-weight: 600; color: var(--c-cream); background: var(--ink); }
#begin:hover:not(:disabled) { background: var(--c-earth); }

.pad {
  display: flex;
  align-items: center;
  justify-content: center;
  height: max(45vh, 14rem);
  padding: 16px;
  border-top: 1px solid var(--ink);
  text-align: center;
  color: var(--ink-soft);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  outline: none;
}
.pad:focus-visible { box-shadow: inset 0 0 0 2px var(--ink); }
body[data-state="count-in"] .pad, body[data-state="playing"] .pad { color: var(--ink); font-size: 1.5rem; box-shadow: inset 0 0 0 2px var(--ink); }
.pad.down { background: rgba(26, 26, 26, .07); }

.result .blank { color: var(--ink-soft); }
.when { margin-bottom: 10px !important; }
.rows { border-collapse: collapse; width: 100%; margin: 4px 0 12px; }
.rows th { text-align: left; padding: 0 8px 3px 0; border-bottom: 1px solid var(--ink); }
.rows td { padding: 4px 8px 4px 0; border-bottom: 1px solid rgba(26, 26, 26, .25); }
.findings p { margin: 0 0 4px; }
.flag { text-decoration: underline; text-decoration-color: var(--c-brick); text-decoration-thickness: 2px; text-underline-offset: 3px; }

.mark { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; margin: 16px 0 8px; }
.spread .label { display: block; margin-bottom: 0; }
.big { display: block; font-size: 2.6rem; font-weight: 700; line-height: 1.05; letter-spacing: -.01em; white-space: nowrap; }
.examiner { display: flex; flex-direction: column; min-width: 10.5rem; padding: 8px 12px; background: var(--c-mustard); border: 1px solid var(--ink); }
.examiner .label { color: var(--ink); margin-bottom: 2px; }
.examiner .word { font-size: 1.2rem; font-weight: 600; margin: 0; }
.examiner .form { font-size: .82rem; }
.input { margin-bottom: 4px !important; }

.fig { margin: 16px 0 4px; }
.plot svg { display: block; width: 100%; height: auto; overflow: visible; }
figcaption { margin-top: 6px; font-size: .85rem; color: var(--ink-soft); }
.ft { font-size: 11px; font-weight: 600; font-variant-caps: all-small-caps; letter-spacing: .07em; fill: var(--c-earth); }
.fl { font-size: 12px; fill: var(--ink); }
.fa { font-size: 10px; fill: var(--ink-soft); }
.frow { fill: none; stroke: rgba(26, 26, 26, .3); stroke-width: .75; }
.fgrid { stroke: rgba(26, 26, 26, .25); stroke-width: .75; stroke-dasharray: 2 3; }
.fzero { stroke: var(--ink); stroke-width: 1; }
.ftick { stroke: var(--c-brick); stroke-width: 2.5; }
.fdot { fill: var(--ink); }
.fhollow { fill: var(--c-cream); stroke: var(--ink); stroke-width: 1.2; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.foot p { font-size: .88rem; color: var(--ink-soft); }

.record { margin-top: 32px; }
.record ol { list-style: none; margin: 0 0 12px; padding: 0; }
.record li { padding: 8px 0; border-top: 1px solid rgba(26, 26, 26, .3); }
.record li:last-child { border-bottom: 1px solid rgba(26, 26, 26, .3); }
.record .date { display: block; font-weight: 600; }
.record .none { color: var(--ink-soft); }

@media (max-width: 480px) {
  .field { grid-template-columns: 6.4rem 1fr; }
  .field .label { padding: 12px 10px; }
  .field .value, .field .note { padding-left: 10px; padding-right: 10px; }
  .box:not(.fields) { padding: 12px 12px; }
  .mark { grid-template-columns: 1fr; gap: 10px; }
  .examiner { justify-self: start; min-width: 12rem; }
}

@page { size: A4; margin: 11mm 14mm; }
@media print {
  :root { --ink: #000; --ink-soft: #222; --c-earth: #000; --c-brick: #000; --c-mustard: #fff; --c-cream: #fff; }
  html, body { background: #fff; color: #000; font-size: 8.3pt; line-height: 1.3; }
  .head, .page { max-width: none; padding: 0; }
  .head { padding-top: 0; }
  .wordmark { height: 14px; filter: grayscale(1) brightness(0); }
  h1 { font-size: 13pt; margin: 6px 0 0; }
  .sub { margin-bottom: 5px; }
  .box { padding: 4px 8px; }
  .box p, .findings p { margin-bottom: 1px; }
  .rule li { margin: 0; }
  .when { margin-bottom: 3px !important; }
  .pad, button, .begin, .record, .actions { display: none !important; }
  .bands { margin: 0 0 4px; }
  .bands td { padding: 1px 6px; }
  .field .label { padding: 4px 8px; }
  .field .value { padding-top: 3px; padding-bottom: 3px; }
  .field .note { padding-bottom: 4px; margin-top: 0; }
  input { border: 0; padding: 0; appearance: textfield; -moz-appearance: textfield; }
  input::-webkit-inner-spin-button, input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
  .rows { margin: 2px 0 4px; }
  .rows td { padding: 1px 8px 1px 0; }
  .flag { text-decoration: none; }
  .mark { margin: 4px 0 2px; }
  .big { font-size: 18pt; }
  .examiner { padding: 3px 8px; }
  .examiner .word { font-size: 10pt; }
  .fig { margin: 4px 0 0; break-inside: avoid; }
  .plot svg { max-height: 40mm; }
  .frow, .fgrid { stroke: #000; }
  .fhollow { fill: #fff; }
}
