/* Windows 3.1 meets neo-brutalism. Only the 16 VGA colors. Type sized for A4. */
:root {
  --black: #000000; --white: #ffffff; --silver: #c0c0c0; --gray: #808080;
  --navy: #000080; --teal: #008080; --yellow: #ffff00; --red: #ff0000;
}
* { box-sizing: border-box; }
html { font-size: 13pt; }
body {
  margin: 0; background: var(--teal); color: var(--black);
  font-family: Arial, Helvetica, sans-serif; line-height: 1.35;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
a { color: var(--navy); font-weight: bold; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
h2 { font-size: 1.5rem; margin-bottom: 4mm; border-bottom: 3px solid var(--black); }
h3 { font-size: 1.1rem; margin-bottom: 1mm; }
p + p { margin-top: 2mm; }
ul, ol { padding-left: 1.3rem; }
li { margin-bottom: 1mm; }

.menubar {
  display: flex; flex-wrap: wrap; position: sticky; top: 0; z-index: 1;
  background: var(--white); border-bottom: 3px solid var(--black);
}
.menubar a, .menubar button {
  font: inherit; font-weight: bold; color: var(--black); text-decoration: none;
  padding: 0.4rem 0.9rem; border: 0; border-right: 3px solid var(--black);
  background: var(--white); cursor: pointer;
}
.menubar a:hover, .menubar button:hover, .menubar a:focus, .menubar button:focus {
  background: var(--navy); color: var(--white); outline: 0;
}
.menubar .brand { background: var(--yellow); }
.menubar .brand:hover { background: var(--navy); }

main { display: flex; flex-direction: column; align-items: center; gap: 8mm; padding: 6mm 16px 12mm; }
.window {
  width: 100%; max-width: 190mm; min-width: 0; background: var(--white);
  border: 3px solid var(--black); box-shadow: 8px 8px 0 var(--black);
}
.titlebar {
  display: flex; align-items: center; gap: 3mm; padding: 1.5mm 2mm;
  background: var(--navy); color: var(--white); border-bottom: 3px solid var(--black);
}
.titlebar h1 { flex: 1; font-size: 1.05rem; text-align: center; padding-right: 7mm; }
.sysbox {
  width: 6mm; height: 6mm; flex: none; background: var(--silver);
  border: 2px solid var(--black); position: relative;
}
.sysbox::after {
  content: ""; position: absolute; left: 20%; right: 20%; top: 42%;
  height: 3px; background: var(--white); border: 1px solid var(--black);
}
.window-body { padding: 5mm 6mm; }
.sheet-foot { padding: 1mm 6mm 2mm; font-size: 0.75rem; font-weight: bold; border-top: 2px solid var(--black); }
.lead { font-size: 1.25rem; font-weight: bold; margin-bottom: 4mm; }

.tiles { display: flex; flex-wrap: wrap; gap: 6mm; }
.tile {
  flex: 1 1 60mm; display: flex; flex-direction: column; align-items: center; gap: 1mm;
  padding: 5mm; color: var(--black); text-decoration: none; background: var(--silver);
  border: 3px solid var(--black); box-shadow: 6px 6px 0 var(--black);
}
.tile:hover, .tile:focus { background: var(--yellow); outline: 0; }
.tile:active { box-shadow: none; transform: translate(6px, 6px); }
.tile svg { width: 30mm; height: 30mm; }
.tile strong { font-size: 1.6rem; }
.steps li { margin-bottom: 2mm; }
.steps + p { margin-top: 4mm; }

.actions { display: flex; flex-wrap: wrap; gap: 5mm; justify-content: center; }
.button {
  padding: 2mm 5mm; background: var(--silver); color: var(--black); text-decoration: none;
  border: 3px solid var(--black); box-shadow: 5px 5px 0 var(--black);
}
.button:hover, .button:focus { background: var(--yellow); outline: 0; }
.button:active { box-shadow: none; transform: translate(5px, 5px); }

table { border-collapse: collapse; }
.contents, .log { width: 100%; margin: 3mm 0; }
.contents th, .contents td, .log th, .log td {
  border: 2px solid var(--black); padding: 1.5mm 2mm; text-align: left; vertical-align: top;
}
.contents th, .log th { background: var(--black); color: var(--white); }
.contents .num { font-size: 1.5rem; font-weight: bold; text-align: center; }
.summary { font-size: 0.9rem; }
.nowrap { white-space: nowrap; }
.log td { height: 10.5mm; }
.log th:nth-child(1) { width: 26mm; } .log th:nth-child(2) { width: 15mm; }
.log th:nth-child(3) { width: 30mm; } .log th:nth-child(4) { width: 17mm; }

.prose { margin-bottom: 4mm; }
figure { margin-bottom: 4mm; }
figcaption { font-size: 0.9rem; font-weight: bold; margin-top: 1mm; }

.exercise { border: 3px solid var(--black); margin-bottom: 4mm; break-inside: avoid; }
.exercise-head { display: flex; border-bottom: 3px solid var(--black); font-weight: bold; font-size: 1.1rem; }
.exercise-no { background: var(--black); color: var(--white); padding: 0.5mm 3mm; }
.exercise-title { padding: 0.5mm 3mm; }
.exercise-body { padding: 2mm 3mm; }
.goal { font-weight: bold; }
.ladder { display: flex; flex-wrap: wrap; align-items: center; gap: 2mm 5mm; margin: 2mm 0; font-weight: bold; }
.ladder-label { background: var(--black); color: var(--white); padding: 0 2mm; }
.rung { display: flex; align-items: center; gap: 1.5mm; cursor: pointer; }
.rung input {
  appearance: none; -webkit-appearance: none; margin: 0; width: 7mm; height: 7mm;
  border: 3px solid var(--black); background: var(--white); cursor: pointer;
}
.rung input:checked {
  background:
    linear-gradient(45deg, transparent 42%, var(--black) 42%, var(--black) 58%, transparent 58%),
    linear-gradient(-45deg, transparent 42%, var(--black) 42%, var(--black) 58%, transparent 58%),
    var(--yellow);
}
.rung input:focus-visible { outline: 3px solid var(--red); }

.notation { overflow-x: auto; }
pre.tab {
  margin: 2mm 0; font-family: "Courier New", Courier, monospace; font-weight: bold;
  font-size: 13pt; line-height: 1.12; overflow-x: auto;
}
.fretboard { display: block; width: 100%; height: auto; }
.fretboard text { font-family: Arial, Helvetica, sans-serif; font-weight: bold; text-anchor: middle; }
.fb-string { font-size: 22px; }
.fb-fret { font-size: 24px; }
.fb-note circle { fill: var(--white); stroke: var(--black); stroke-width: 4; }
.fb-note text { font-size: 20px; fill: var(--black); }
.fb-root circle { fill: var(--black); stroke: var(--black); stroke-width: 4; }
.fb-root text { font-size: 20px; fill: var(--white); }

.grid { display: flex; flex-wrap: wrap; gap: 2mm 5mm; margin: 2mm 0; overflow-x: auto; }
.bar { border: 3px solid var(--black); table-layout: fixed; }
.bar th, .bar td { width: 10mm; text-align: center; border-left: 1px solid var(--gray); padding: 0; }
.bar.slots-4 th, .bar.slots-4 td { width: 20mm; }
.bar .beat { border-left: 3px solid var(--black); }
.bar th:first-child, .bar td:first-child { border-left: 0; }
.bar .counts th { height: 6mm; font-size: 0.85rem; background: var(--silver); border-bottom: 2px solid var(--black); }
.bar .counts .beat { font-size: 1rem; }
.bar .strokes td { height: 10mm; font-size: 1.3rem; font-weight: bold; }
.bar .accent { background: var(--black); color: var(--white); }
.bar .grace { font-family: "Courier New", Courier, monospace; font-size: 0.95rem; vertical-align: super; margin-right: 0.3mm; }

.chart { width: 100%; margin: 2mm 0 4mm; table-layout: fixed; border: 3px solid var(--black); }
.chart td { border: 2px solid var(--black); height: 16mm; text-align: center; font-size: 1.6rem; font-weight: bold; }

@page { size: A4; margin: 10mm; }
@media print {
  body { background: var(--white); }
  .no-print { display: none !important; }
  main { display: block; padding: 0; }
  .window { max-width: none; box-shadow: none; margin: 0; }
  .sheet { break-after: page; }
  .sheet:last-of-type { break-after: auto; }
  .titlebar { background: var(--white); color: var(--black); }
  a { color: var(--black); text-decoration: none; }
  .notation, pre.tab, .grid { overflow: visible; }
}
