/* Your Second: a turntable brochure specification page. */

:root { --headline: var(--c-earth); }
[data-theme="dark"] { --headline: var(--ink); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --headline: var(--ink); }
}

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

html { background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
}

.sheet { max-width: 52rem; margin: 0 auto; padding: 2.5rem 16px 3rem; }

h1 {
  margin: 0;
  padding-bottom: .35rem;
  border-bottom: 2px solid var(--c-brick);
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  font-size: 2rem;
  letter-spacing: -.01em;
  color: var(--headline);
}

h2 {
  margin: 2.25rem 0 .5rem;
  font-size: .75rem;
  font-weight: var(--fw-thin);
  text-transform: uppercase;
  letter-spacing: .14em;
}

.reading { margin: 1.75rem 0 1.5rem; }
.headline {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .25rem 1.25rem;
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  font-size: clamp(2rem, 7vw, 3.5rem);
  line-height: 1.1;
  color: var(--headline);
}
.prov { font-size: 1.25rem; color: var(--ink-soft); font-weight: var(--fw-medium); }
.prov[hidden] { display: none; }
.prov-label {
  font-size: .7rem;
  font-weight: var(--fw-thin);
  text-transform: uppercase;
  letter-spacing: .14em;
}
.sub { margin: .5rem 0 0; color: var(--ink-soft); font-size: .9rem; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.controls { display: grid; gap: .75rem; margin-bottom: 2rem; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; }

button {
  appearance: none;
  font: inherit;
  font-size: .95rem;
  padding: .5rem 1.1rem;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
  cursor: pointer;
}
button:not(:disabled):hover,
button:not(:disabled):focus-visible { background: var(--ink); color: var(--bg); outline: none; }
button:disabled { color: var(--ink-soft); border-color: var(--ink-soft); cursor: default; }

.dur { display: flex; flex-wrap: wrap; }
.dur button { font-size: .85rem; padding: .4rem .8rem; }
.dur button + button { margin-left: -1px; }
.dur button:not(:disabled):hover,
.dur button:not(:disabled):focus-visible { background: transparent; color: var(--ink); outline: 2px solid var(--ink); outline-offset: 2px; position: relative; }
.dur button[aria-pressed="true"],
.dur button[aria-pressed="true"]:hover,
.dur button[aria-pressed="true"]:focus-visible { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.silent { display: inline-flex; align-items: center; gap: .45rem; font-size: .9rem; cursor: pointer; }
input[type="checkbox"] {
  appearance: none;
  margin: 0;
  width: 1em;
  height: 1em;
  display: inline-grid;
  place-content: center;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
  font: inherit;
  cursor: pointer;
}
input[type="checkbox"]:checked { background: var(--ink); color: var(--bg); }
input[type="checkbox"]:checked::before {
  content: "";
  width: .55em;
  height: .28em;
  margin-top: -.12em;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
}
input[type="checkbox"]:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

table.spec { width: 100%; border-collapse: collapse; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.spec th, .spec td { padding: .45rem .5rem .45rem 0; border-bottom: 1px solid var(--ink-soft); text-align: left; vertical-align: top; }
.spec tr:last-child th, .spec tr:last-child td { border-bottom: 0; }
.spec th {
  font-weight: var(--fw-thin);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .72rem;
  padding-top: .62rem;
}
.spec thead th { color: var(--ink-soft); border-bottom: 1px solid var(--ink); }
.result tbody th, .cond th { width: 38%; }
.result td { font-size: 1.05rem; }
.result #drift { width: 26%; }
.cellnote { display: block; margin-top: .2rem; font-size: .78rem; color: var(--ink-soft); }
.foot { margin: .5rem 0 0; font-size: .78rem; color: var(--ink-soft); }

.fig { margin: 2rem 0 0; }
#fig { display: block; width: 100%; height: 220px; color: var(--ink); overflow: visible; }
#fig .axis { stroke: var(--ink); stroke-width: 1; fill: none; shape-rendering: crispEdges; }
#fig .grid { stroke: var(--ink-soft); stroke-width: 1; stroke-dasharray: 1 3; shape-rendering: crispEdges; }
#fig .dot { fill: var(--ink-soft); }
#fig .out { fill: none; stroke: var(--ink-soft); }
#fig .line { stroke: var(--ink); stroke-width: 1; fill: none; }
#fig text { fill: var(--ink-soft); font-size: 11px; font-family: var(--font-body); }
#fig .empty { fill: var(--ink-soft); font-size: 13px; }
figcaption { margin-top: .5rem; font-size: .78rem; color: var(--ink-soft); }

.notes { margin: 0; padding-left: 1.4rem; font-size: .8rem; color: var(--ink-soft); }
.notes li { margin: .2rem 0; padding-left: .2rem; }

.record-actions { margin-bottom: .6rem; }
.record-actions button { font-size: .85rem; padding: .35rem .8rem; }
.record th, .record td { font-size: .74rem; padding-right: .6rem; }
.record td { font-size: .8rem; }
.record td:first-child { white-space: nowrap; }

.colophon {
  margin-top: 3rem;
  padding-top: .9rem;
  border-top: 1px solid var(--ink);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .3rem 1.2rem;
  font-size: .75rem;
  color: var(--ink-soft);
}
.colophon p { margin: 0; }
.wordmark { height: 22px; width: auto; color: var(--headline); }

/* Narrow sheets: the Record table reads row by row. */
@media (max-width: 640px) {
  .result tbody th, .cond th { width: 36%; }
  .result #drift { width: 24%; }
  .record thead { display: none; }
  .record tr { display: block; padding: .5rem 0; border-bottom: 1px solid var(--ink-soft); }
  .record tr:last-child { border-bottom: 0; }
  .record td { display: flex; gap: .75rem; padding: .08rem 0; border: 0; }
  .record td::before {
    content: attr(data-label);
    flex: 0 0 8.5rem;
    font-weight: var(--fw-thin);
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: .68rem;
    padding-top: .1rem;
  }
  .record td:empty { display: none; }
}

/* One A4 sheet. Paper is the ground. */
@media print {
  @page { size: A4; margin: 10mm 12mm; }
  :root:not(#print) {
    --bg: var(--c-cream);
    --ink: #1A1A1A;
    --ink-soft: #5B5B5B;
    --headline: var(--c-earth);
    color-scheme: light;
  }
  html, body { background: none; }
  body { font-size: 8pt; line-height: 1.3; }
  .sheet { max-width: none; padding: 0; }
  .controls, .record-actions { display: none; }
  h1 { font-size: 15pt; padding-bottom: .15rem; }
  h2 { margin: .6rem 0 .2rem; font-size: 6.5pt; }
  .reading { margin: .45rem 0 .5rem; }
  .headline { font-size: 20pt; }
  .prov { font-size: 10pt; }
  .sub { margin-top: .15rem; font-size: 7.5pt; }
  .spec th, .spec td { padding-top: .1rem; padding-bottom: .1rem; }
  .spec th { padding-top: .17rem; font-size: 6pt; }
  .result td { font-size: 8.5pt; }
  .cellnote, .foot, figcaption { font-size: 6.5pt; margin-top: .1rem; }
  .fig { margin-top: .5rem; break-inside: avoid; }
  #fig { height: 120px; }
  #fig text { font-size: 8px; }
  .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0 6mm; }
  .cond th { width: 46%; }
  .cond td { font-size: 7.5pt; }
  .notes { font-size: 6.8pt; padding-left: 1rem; }
  .notes li { margin: .05rem 0; }
  .record th, .record td { font-size: 6.5pt; padding-top: .05rem; padding-bottom: .05rem; }
  .record tbody tr:nth-child(n+13) { display: none; }
  .colophon { margin-top: .5rem; padding-top: .3rem; font-size: 6.5pt; }
  .wordmark { height: 11px; }
}
