/* JamLand Learn: free guitar charts, articles and tools at jamland.app/learn.

   The village at night, set for long reading. The page is the night sky
   over the village (its blues are sampled from the night art), the words
   sit on a slightly lighter sheet, and the lamplight is gold: links,
   accents, the root of a chord. Ember stays what it is on the app page:
   the one button that means "get the app".

   Two faces. Jersey 15, the app's pixel face, for headings, navigation and
   small labels. Nunito for reading. Jersey is drawn on a grid of 1/27 em,
   so its sizes here are multiples of 13.5px where that is practical: every
   pixel of the letter lands on whole device pixels on a 2x screen.

   Shapes: anything you press is a pill (or a circle); panels and pictures
   are 20px; the sheet is 28px. One easing curve. Nothing moves with Reduce
   Motion. Printing gives white paper and dark ink.

   Colors are tokens on :root. Contrast on the sheet (#111a26): ink 14.7:1,
   ink-2 9.6:1, ink-3 6.5:1, gold 12.3:1. On the sky (#0b1119) all of them
   are higher. Diagrams take their colors from the --dg-* tokens, so the
   same SVG reads at night and on paper. */

/* ---------- faces ---------- */

@font-face {
  font-family: "Jersey 15";
  src: url("../fonts/jersey-15.woff") format("woff"), url("/fonts/Jersey15-Regular.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}
/* Sharps, flats and naturals drawn on Jersey's own pixel grid (the face
   has none), so "F♯ minor" sets in one face. tools/learn/site/fonts.py. */
@font-face {
  font-family: "Jersey 15";
  src: url("../fonts/jersey-15-accidentals.woff") format("woff");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+266D-266F, U+1D12A-1D12B;
}
/* Nunito, cut to Latin (15 KB a weight). Anything outside that range comes
   from the full face, fetched only by a page that uses it. */
@font-face {
  font-family: "Nunito";
  src: url("../fonts/nunito-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0000-00FF, U+2010-203A, U+2122, U+2212;
}
@font-face {
  font-family: "Nunito";
  src: url("../fonts/nunito-800.woff2") format("woff2");
  font-weight: 700 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+2010-203A, U+2122, U+2212;
}
/* The full TTFs only for rare characters. Their ranges must not overlap
   the woff2 subsets above: with overlapping ranges the browser tries the
   face declared last first, and would fetch 130 KB for one minus sign.
   Δ and arrows (not in the subsets) fall back to the system face.
   test_site checks the ranges stay apart. */
@font-face {
  font-family: "Nunito";
  src: url("/fonts/Nunito-400.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0100-024F, U+0300-036F, U+03B4, U+2070-209F, U+20AC, U+2200-2211, U+2213-22FF;
}
@font-face {
  font-family: "Nunito";
  src: url("/fonts/Nunito-800.ttf") format("truetype");
  font-weight: 700 900;
  font-display: swap;
  unicode-range: U+0100-024F, U+0300-036F, U+03B4, U+2070-209F, U+20AC, U+2200-2211, U+2213-22FF;
}
/* The same sharps and flats for reading, drawn smooth with Nunito's stems. */
@font-face {
  font-family: "Nunito";
  src: url("../fonts/nunito-accidentals.woff") format("woff");
  font-weight: 100 600;
  font-display: swap;
  unicode-range: U+266D-266F, U+1D12A-1D12B;
}
@font-face {
  font-family: "Nunito";
  src: url("../fonts/nunito-accidentals-800.woff") format("woff");
  font-weight: 700 900;
  font-display: swap;
  unicode-range: U+266D-266F, U+1D12A-1D12B;
}
/* While the faces load, Arial stands in, sized to match their widths and
   lines (measured: Nunito sets 101.3% as wide as Arial, Jersey 15 82.6%),
   so the words barely move when the real face arrives. */
@font-face {
  font-family: "Nunito fallback";
  src: local("Arial"), local("ArialMT"), local("Helvetica");
  size-adjust: 101.3%;
  ascent-override: 99.8%;
  descent-override: 34.9%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Jersey fallback";
  src: local("Arial"), local("ArialMT"), local("Helvetica");
  size-adjust: 82.6%;
  ascent-override: 94.2%;
  descent-override: 26.9%;
  line-gap-override: 0%;
}

/* ---------- tokens ---------- */

:root {
  --pixel: "Jersey 15", "Jersey fallback", system-ui, -apple-system, sans-serif;
  --read: "Nunito", "Nunito fallback", system-ui, -apple-system, "Segoe UI", sans-serif;

  --sky: #0b1119;          /* the page: the night sky over the village */
  --sky-2: #0f1722;        /* the footer's ground */
  --sheet: #111a26;        /* the reading surface */
  --raised: #172233;       /* plates, cards, callouts on the sheet */
  --raised-2: #1e2b40;     /* hover, a chosen control, table heads */
  --inset: #0c131d;        /* a tool's screen */
  --line: rgba(196, 214, 240, 0.12);
  --line-2: rgba(196, 214, 240, 0.22);

  --ink: #f3eadc;          /* 14.7:1 on --sheet */
  --ink-2: #c9bfb0;        /* 9.6:1 on --sheet, 8.4:1 on --raised */
  --ink-3: #a59d92;        /* 6.5:1 on --sheet, 5.7:1 on --raised */
  --gold: #ffd27a;         /* lamplight: links, accents. 12.3:1 on --sheet */
  --gold-2: #ffe2a6;       /* a link under the pointer */
  --gold-dim: rgba(255, 210, 122, 0.45);
  --gold-wash: rgba(255, 210, 122, 0.1);
  --on-gold: #2a1a08;      /* words on gold, 11.9:1 */
  --ember: #e8754a;        /* warm accents: an accented beat, a warning */
  --ember-2: #f08a5f;
  --on-ember: #2a140b;     /* 5.9:1 on --ember */
  --ember-text: #ff9f7a;   /* ember for words: 7.6:1 on --sheet */
  --moon: #9fb3c8;         /* cool notes: 8.1:1 on --sheet */
  --wood: #3b2618;
  --paper: #f5e7c8;
  --focus: var(--gold);

  /* Diagram colors, for the SVG renderers' hooks (tools/learn/svg,
     diagrams.css). Their own defaults are tuned for the app page's warm
     brown; these set them to the night sky. Roots are gold and drawn as
     rounded squares, so they never depend on color alone. */
  --jl-dia-ink: #f3eadc;
  --jl-dia-muted: #c9bfb0;       /* x and o, fret numbers: 8.4:1 on --raised */
  --jl-dia-line: #8d94a0;        /* strings and frets: 5.2:1 on --raised */
  --jl-dia-dot: #f3eadc;
  --jl-dia-dot-text: #111a26;    /* 14.7:1 on a dot */
  --jl-dia-root: #ffd27a;
  --jl-dia-root-text: #2a1a08;   /* 11.9:1 on gold */
  --jl-dia-inlay: #24324a;
  --jl-dia-wedge: #172233;
  --jl-dia-wedge-edge: #2b3a52;
  --jl-dia-wedge-near: #2e4262;  /* the key's other chords on the circle */
  --jl-dia-white-key: #f3eadc;
  --jl-dia-black-key: #0b1119;
  --jl-dia-key-edge: #2b3a52;
  --plate: var(--raised);

  --radius: 20px;
  --radius-sheet: 28px;
  --gutter: clamp(16px, 4vw, 36px);
  --content: 1120px;
  --measure: 34em;        /* about 75 characters of Nunito at 18px */
  --wide: 960px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --bar-h: 64px;

  color-scheme: dark;
}

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
  scroll-padding-top: 24px;
  background: var(--sky);
}
@media (min-width: 900px) { html { scroll-padding-top: calc(var(--bar-h) + 40px); } }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; min-height: 100vh;
  background:
    radial-gradient(1100px 520px at 78% -140px, rgba(159, 179, 200, 0.11), transparent 70%),
    radial-gradient(800px 420px at 8% -60px, rgba(255, 210, 122, 0.05), transparent 70%),
    var(--sky);
  background-repeat: no-repeat; color: var(--ink);
  font: 400 18px/1.65 var(--read);
  font-synthesis: style;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-wrap: break-word;
}
img, svg, video { max-width: 100%; height: auto; }
img, video { display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: -999px; top: 10px; z-index: 30;
  padding: 12px 18px; border-radius: 999px; background: var(--gold); color: var(--on-gold);
  font: 400 20.25px/1 var(--pixel); text-decoration: none;
}
.skip:focus { left: 12px; }
.print-only { display: none; }

/* ---------- type ---------- */

h1, h2, h3, h4 {
  font-family: var(--pixel); font-weight: 400; font-synthesis: none;
  color: var(--ink); margin: 0; text-wrap: balance;
}
h1 { font-size: 54px; line-height: 1; letter-spacing: 0.005em; }
h2 { font-size: 40.5px; line-height: 1.05; }
h3 { font-size: 27px; line-height: 1.15; }
h4 { font-family: var(--read); font-weight: 800; font-size: 18px; line-height: 1.4; }
@media (max-width: 640px) {
  h1 { font-size: 40.5px; }
  h2 { font-size: 33.75px; }
  h3 { font-size: 27px; }
}
@media (max-width: 359px) { h1 { font-size: 33.75px; } }
p { margin: 0; }
strong, b { font-weight: 800; color: var(--ink); }
/* Accidentals set a touch smaller in reading text, as engravers do. */
.acc { font-size: 1em; }
.pixel { font-family: var(--pixel); font-weight: 400; }
.num, .tabular { font-variant-numeric: tabular-nums; }

/* ---------- the site's bar ---------- */

.bar {
  position: relative; z-index: 20;
  width: min(calc(100% - 2 * var(--gutter)), var(--content));
  margin: 12px auto 0; min-height: var(--bar-h);
  padding: 6px 8px 6px 14px; border-radius: 999px;
  display: flex; align-items: center; gap: 8px;
  background: rgba(17, 26, 38, 0.78);
  -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%);
  box-shadow: inset 0 0 0 1px var(--line), 0 18px 40px -22px rgba(0, 0, 0, 0.8);
}
@media (min-width: 900px) { .bar { position: sticky; top: 12px; } }
@media (prefers-reduced-transparency: reduce) {
  .bar { background: var(--sheet); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
.brand { display: inline-flex; align-items: center; min-height: 44px; flex: none; text-decoration: none; border-radius: 12px; }
.brand img { height: 46px; width: auto; }
.bar-nav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.bar-nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 999px;
  font: 400 20.25px/1 var(--pixel); color: var(--ink-2); text-decoration: none; white-space: nowrap;
  transition: color .25s var(--ease), background-color .25s var(--ease);
}
.bar-nav a:hover { color: var(--ink); background: rgba(243, 234, 220, 0.07); }
.bar-nav a[aria-current] { color: var(--gold); }
@media (max-width: 760px) {
  .bar { padding-left: 10px; }
  .brand img { height: 40px; }
  .bar-nav .wide-only { display: none; }
  .bar-nav a { padding: 0 10px; }
}
@media (max-width: 359px) { .brand img { height: 34px; } }

/* The Learn sections, under the bar. Scrolls sideways on a phone. */
.sections {
  width: min(calc(100% - 2 * var(--gutter)), var(--content));
  margin: 14px auto 0; display: flex; align-items: center; gap: 10px;
}
.sections-label { flex: none; font: 400 20.25px/1 var(--pixel); color: var(--ink-3); padding-left: 6px; }
.sections ul {
  list-style: none; margin: 0; padding: 2px; display: flex; gap: 4px;
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.sections ul::-webkit-scrollbar { display: none; }
.sections a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px;
  font: 400 20.25px/1 var(--pixel); color: var(--ink-2); text-decoration: none; white-space: nowrap;
  transition: color .25s var(--ease), background-color .25s var(--ease);
}
.sections a:hover { color: var(--ink); background: rgba(243, 234, 220, 0.06); }
.sections a[aria-current] { background: var(--ink); color: var(--sheet); }
@media (max-width: 760px) {
  .sections { width: 100%; padding-left: var(--gutter); }
  .sections ul { padding-right: var(--gutter); }
}
/* The row fades where it can overflow: always on a phone, and on a tablet
   while learn.js says there is more (it sets .at-end when the row fits). */
@media (max-width: 760px) { .sections ul { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); } }
@media (min-width: 761px) and (max-width: 1099px) { .sections ul:not(.at-end) { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); } }
@media (max-width: 1099px) {
  .sections ul.is-scrolled {
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 24px, #000 85%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 24px, #000 85%, transparent);
  }
  .sections ul.is-scrolled.at-end {
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 24px); mask-image: linear-gradient(90deg, transparent, #000 24px);
  }
}

/* ---------- buttons ---------- */

/* The one filled button on a page (Download PDF), gold as lamplight. */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 24px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--gold); color: var(--on-gold);
  font: 400 20.25px/1 var(--pixel); text-decoration: none; white-space: nowrap;
  box-shadow: 0 10px 28px -12px rgba(255, 210, 122, 0.6);
  transition: background-color .3s var(--ease), transform .3s var(--ease);
}
.button:hover { background: var(--gold-2); transform: translateY(-1px); }
.button:active { transform: scale(0.98); }
/* The App Store link: a quiet outlined button in words, quieter than the
   gold one, and never a homemade copy of Apple's badge. */
.store { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.store-link {
  display: inline-flex; align-items: center; min-height: 48px; padding: 8px 20px; border-radius: 999px;
  color: #f4e9dc; box-shadow: inset 0 0 0 1px rgba(255, 220, 180, 0.42); text-decoration: none;
  font: 400 20.25px/1.1 var(--pixel);
}
.store-link:hover { box-shadow: inset 0 0 0 1px #f4e9dc; }

/* ---------- the top of a page: under the night sky ---------- */

.top {
  position: relative; isolation: isolate;
  width: min(calc(100% - 2 * var(--gutter)), var(--content));
  margin: 0 auto; padding: clamp(28px, 5vw, 56px) 0 clamp(32px, 5vw, 56px);
}
/* A few pixel stars over the title. Painted on the page behind it, so
   nothing here moves the words. */
.stars {
  position: absolute; top: -120px; bottom: 0; left: 50%; width: 100vw; margin-left: -50vw;
  z-index: -1; pointer-events: none; overflow: hidden;
  -webkit-mask-image: linear-gradient(#000 40%, transparent); mask-image: linear-gradient(#000 40%, transparent);
}
.stars::before, .stars::after {
  content: ""; position: absolute; inset: 0; background-repeat: repeat;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='520' height='340' shape-rendering='crispEdges'%3E%3Cg fill='%23f3eadc'%3E%3Crect x='467' y='290' width='2' height='2'/%3E%3Crect x='466' y='264' width='2' height='2'/%3E%3Crect x='193' y='266' width='2' height='2'/%3E%3Crect x='194' y='52' width='2' height='2'/%3E%3Crect x='314' y='76' width='1' height='1'/%3E%3Crect x='46' y='308' width='2' height='2'/%3E%3Crect x='467' y='319' width='2' height='2'/%3E%3Crect x='19' y='274' width='1' height='1'/%3E%3Crect x='64' y='22' width='2' height='2'/%3E%3Crect x='251' y='311' width='1' height='1'/%3E%3Crect x='479' y='171' width='2' height='2'/%3E%3Crect x='204' y='269' width='2' height='2'/%3E%3Crect x='305' y='259' width='1' height='1'/%3E%3Crect x='91' y='238' width='2' height='2'/%3E%3Crect x='420' y='286' width='1' height='1'/%3E%3Crect x='264' y='165' width='2' height='2'/%3E%3C/g%3E%3C/svg%3E");
  background-position: 37px 0;
  opacity: 0.42;
}
.stars::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='980' height='380' shape-rendering='crispEdges'%3E%3Cg fill='%23ffd27a'%3E%3Crect x='140' y='92' width='3' height='3'/%3E%3Crect x='141' y='89' width='1' height='9'/%3E%3Crect x='137' y='93' width='9' height='1'/%3E%3Crect x='760' y='210' width='3' height='3'/%3E%3Crect x='761' y='207' width='1' height='9'/%3E%3Crect x='757' y='211' width='9' height='1'/%3E%3Crect x='590' y='300' width='2' height='2'/%3E%3Crect x='300' y='34' width='2' height='2'/%3E%3C/g%3E%3C/svg%3E");
  background-position: -60px 10px;
  opacity: 0.55;
}
@media (prefers-reduced-motion: no-preference) {
  .stars::after { animation: twinkle 2.4s ease-in-out 2 alternate; }
}
@keyframes twinkle { 0%, 40% { opacity: 0.55; } 100% { opacity: 0.2; } }

.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; }
.crumbs li { display: inline-flex; align-items: center; font: 400 20.25px/1.2 var(--pixel); color: var(--ink-3); }
.crumbs li + li::before {
  content: ""; width: 6px; height: 10px; margin: 0 10px; flex: none; opacity: 0.7;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='6' height='10' shape-rendering='crispEdges' fill='%23a59d92'%3E%3Crect width='2' height='2'/%3E%3Crect x='2' y='2' width='2' height='2'/%3E%3Crect x='4' y='4' width='2' height='2'/%3E%3Crect x='2' y='6' width='2' height='2'/%3E%3Crect y='8' width='2' height='2'/%3E%3C/svg%3E") center / 6px 10px no-repeat;
}
.crumbs a {
  display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; color: var(--ink-2); text-decoration: none;
  text-decoration-thickness: 2px; text-underline-offset: 5px;
}
.crumbs a:hover { color: var(--gold); text-decoration-line: underline; text-decoration-color: var(--gold-dim); }
.crumbs [aria-current] { color: var(--ink-3); }

.top h1 { margin-top: 10px; max-width: 22ch; }
.top .lede { margin-top: 18px; max-width: 60ch; font-size: 20px; line-height: 1.55; color: var(--ink-2); }
.meta { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 4px 18px; color: var(--ink-3); font-size: 15px; }
@media (max-width: 640px) { .top .lede { font-size: 18px; } }

/* A hub's top, with the musician by the fire. */
.top.hub { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 24px; }
.top.hub .musician { margin-bottom: 4px; }
@media (max-width: 640px) { .top.hub { grid-template-columns: 1fr; } .top.hub .musician { display: none; } }

/* The guitar player from the app page, strumming: nine frames. */
.musician {
  width: 136px; height: 136px; flex: none; position: relative;
  background: radial-gradient(closest-side circle at 50% 62%, rgba(255, 190, 110, 0.3), rgba(255, 190, 110, 0));
}
.musician::before {
  content: ""; position: absolute; inset: 0;
  background: url("/img/hero/0.png") 0 0 / 900% 100% no-repeat; image-rendering: pixelated;
}
/* Two strums, then still (WCAG 2.2.2: nothing moves for more than five
   seconds next to reading text); a hover or focus on its block plays it
   again. */
@media (prefers-reduced-motion: no-preference) {
  .musician::before { animation: strum 1.8s steps(8) 2; }
  .app-block:hover .musician::before, .app-block:focus-within .musician::before,
  .top.hub:hover .musician::before { animation: strum-again 1.8s steps(8) 2; }
}
@keyframes strum-again { from { background-position: 0 0; } to { background-position: 100% 0; } }
@keyframes strum { to { background-position: 100% 0; } }

main { overflow-x: clip; }

/* ---------- the sheet: where the reading happens ---------- */

.sheet {
  width: min(calc(100% - 2 * var(--gutter)), var(--content));
  margin: 0 auto; padding: clamp(28px, 5vw, 64px) clamp(20px, 5vw, 64px) clamp(36px, 5vw, 72px);
  background: var(--sheet); border-radius: var(--radius-sheet);
  box-shadow: inset 0 0 0 1px var(--line), 0 40px 80px -40px rgba(0, 0, 0, 0.6);
}
@media (max-width: 640px) {
  .sheet { width: 100%; border-radius: 24px 24px 0 0; padding-inline: var(--gutter); box-shadow: inset 0 1px 0 var(--line); }
}

/* The reading column. Everything in it keeps to the measure; anything
   marked .wide (a fretboard, a big table) steps out to the sheet's width. */
.prose {
  display: grid;
  grid-template-columns:
    [full-start] minmax(0, 1fr)
    [wide-start] minmax(0, calc((var(--wide) - var(--measure)) / 2))
    [text-start] min(var(--measure), 100%) [text-end]
    minmax(0, calc((var(--wide) - var(--measure)) / 2)) [wide-end]
    minmax(0, 1fr) [full-end];
}
.prose > * { grid-column: text; margin-top: 0; margin-bottom: 0; }
.prose > * + * { margin-top: 1.15em; }
.prose > .wide, .prose > .related, .prose > .pager, .prose > .app-block { grid-column: wide; }
.prose > .full { grid-column: full; }
.prose > h2 { margin-top: 2.1em; scroll-margin-top: 24px; }
.prose > h3 { margin-top: 1.9em; }
.prose > h2 + *, .prose > h3 + *, .prose > h4 + * { margin-top: 0.7em; }
.prose > h2:first-child, .prose > h3:first-child { margin-top: 0; }
.prose > .figure, .prose > .table-block, .prose > .callout, .prose > .facts,
.prose > .ref-hero, .prose > .figure-grid, .prose > .figure-pair, .prose > .video, .prose > .tool, .prose > .toc,
.prose > .download, .prose > .steps { margin-top: 2em; }
.prose > .figure + *, .prose > .table-block + *, .prose > .callout + *, .prose > .figure-grid + *,
.prose > .tool + *, .prose > .video + *, .prose > .toc + * { margin-top: 2em; }
.prose > :first-child { margin-top: 0; }

.prose > :is(.play, .btn, .button, .more, .chips) { justify-self: start; }

/* Links in running text: gold, underlined. Only text links (no class), so
   cards, chips and buttons keep their own look. */
:is(.prose > p, .prose > ul, .prose > ol, .prose > blockquote, figcaption, .callout, .facts dd, .term dd,
    table.data, .tool-note, .group-head p, .transcript, .hub-intro, .lede) a:not([class]),
.link {
  color: var(--gold); text-decoration-line: underline; text-decoration-color: var(--gold-dim);
  text-decoration-thickness: 1.5px; text-underline-offset: 3px;
  transition: color .2s var(--ease), text-decoration-color .2s var(--ease);
}
:is(.prose > p, .prose > ul, .prose > ol, .prose > blockquote, figcaption, .callout, .facts dd, .term dd,
    table.data, .tool-note, .group-head p, .transcript, .hub-intro, .lede) a:not([class]):hover,
.link:hover { color: var(--gold-2); text-decoration-color: currentColor; }

/* Lists in running text (and in callouts and definitions). */
:is(.prose > ul:not([class]), .prose > ol:not([class]), .callout ul, .callout ol, .term dd ul, .term dd ol, .prose li > ul, .prose li > ol) {
  padding-left: 0; list-style: none;
}
:is(.prose > ul:not([class]), .prose > ol:not([class]), .callout ul, .callout ol, .term dd ul, .term dd ol) > li + li { margin-top: 0.5em; }
:is(.prose > ul:not([class]), .callout ul, .term dd ul, .prose li > ul) > li { position: relative; padding-left: 26px; }
:is(.prose > ul:not([class]), .callout ul, .term dd ul, .prose li > ul) > li::before {
  content: ""; position: absolute; left: 4px; top: 0.66em; width: 8px; height: 8px;
  background: var(--gold); box-shadow: 2px 2px 0 rgba(255, 210, 122, 0.28);
}
:is(.prose > ol:not([class]), .callout ol, .term dd ol) { counter-reset: item; }
:is(.prose > ol:not([class]), .callout ol, .term dd ol) > li { position: relative; padding-left: 40px; counter-increment: item; }
:is(.prose > ol:not([class]), .callout ol, .term dd ol) > li::before {
  content: counter(item); position: absolute; left: 0; top: 0.12em;
  min-width: 28px; height: 28px; padding: 0 6px; border-radius: 8px;
  display: inline-grid; place-items: center;
  background: var(--raised-2); color: var(--gold); font: 400 20.25px/1 var(--pixel);
}
.prose li > ul, .prose li > ol { margin-top: 0.5em; }
.prose blockquote { margin-inline: 0; padding-left: 20px; box-shadow: inset 3px 0 0 var(--gold-dim); color: var(--ink-2); }
.prose hr {
  border: 0; height: 4px; margin: 2.4em 0;
  background: radial-gradient(circle, var(--ink-3) 2px, transparent 2.5px) center / 18px 4px repeat-x; opacity: 0.5;
}
.prose code, kbd {
  font: 600 0.92em/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  padding: 2px 6px; border-radius: 6px; background: var(--raised-2); color: var(--ink);
}
kbd { box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.35); }
.prose .lead { font-size: 20px; color: var(--ink); }
.hint { font-size: 15px; color: var(--ink-3); }

/* ---------- at a glance ---------- */

.facts {
  margin: 0; padding: 6px 22px; border-radius: var(--radius);
  background: var(--raised); box-shadow: inset 0 0 0 1px var(--line);
}
.facts > div { display: grid; grid-template-columns: minmax(96px, 9.5em) 1fr; gap: 4px 16px; padding: 13px 0; align-items: baseline; }
.facts > div + div { box-shadow: inset 0 1px 0 var(--line); }
.facts dt { font: 400 20.25px/1.2 var(--pixel); color: var(--ink-3); }
.facts dd { margin: 0; font-weight: 800; color: var(--ink); }
.facts dd .soft { font-weight: 400; color: var(--ink-2); }
@media (max-width: 420px) { .facts > div { grid-template-columns: 1fr; } }

/* A chord, scale or key page opens with its picture and its facts side by
   side; on a phone the picture comes first. */
.ref-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(20px, 3vw, 36px); align-items: start; }
.ref-hero > .figure { margin: 0; display: flex; flex-direction: column; }
.ref-hero > .figure > .plate { flex: 1; }
.ref-hero-side { display: grid; gap: 16px; align-content: start; }
.ref-hero-side .actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
@media (max-width: 760px) { .ref-hero { grid-template-columns: 1fr; } }

/* ---------- on this page ---------- */

.toc { padding: 18px 22px 20px; border-radius: var(--radius); background: var(--raised); box-shadow: inset 0 0 0 1px var(--line); }
.toc-title { font: 400 20.25px/1.2 var(--pixel); color: var(--ink-3); margin: 0 0 8px; }
.toc ol { list-style: none; padding: 0; columns: 2 13em; column-gap: 28px; margin: 0; }
.toc li { break-inside: avoid; }
.toc a {
  display: block; padding: 11px 0; color: var(--ink); text-decoration: none; line-height: 1.3; font-size: 17px;
}
.toc a:hover { color: var(--gold); }

/* ---------- callouts ---------- */

.callout {
  padding: 18px 22px 20px; border-radius: var(--radius);
  background: var(--raised); box-shadow: inset 0 0 0 1px var(--line);
}
.callout-label { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; font: 400 20.25px/1.2 var(--pixel); color: var(--gold); }
.callout-label::before { content: ""; width: 8px; height: 8px; flex: none; background: currentColor; box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.35); }
.callout > * + * { margin-top: 0.7em; }
.callout.warn .callout-label { color: var(--ember-text); }
.callout.note .callout-label { color: var(--moon); }
.callout.try { background: linear-gradient(160deg, #1d2a3d, var(--raised)); box-shadow: inset 0 0 0 1px rgba(255, 210, 122, 0.26); }

/* ---------- figures and diagrams ---------- */

.figure { margin: 0; }
.plate {
  display: grid; place-items: center; padding: clamp(16px, 3vw, 28px);
  border-radius: var(--radius); background: var(--plate); box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink); overflow-x: auto;
}
.plate > svg, .plate > img { display: block; max-width: 100%; height: auto; }
.figure.small .plate > svg, .figure.small .plate > img { width: min(100%, 220px); }
.figure.medium .plate > svg, .figure.medium .plate > img { width: min(100%, 260px); }
/* The circle of fifths is read, not glanced at: at least its natural size. */
.figure.circle-hero .plate > img { width: min(100%, 400px); }
/* A diagram that is wider than a phone (a whole fretboard) scrolls inside
   its plate rather than shrinking past reading. */
.figure.scroll .plate { place-items: start; }
.figure.scroll .plate > svg { max-width: none; width: max(100%, var(--min-width, 720px)); }
.figure figcaption { margin-top: 10px; font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.figure figcaption strong { color: var(--ink); }

/* Two figures side by side (a circle and a keyboard); stacked on a phone. */
.figure-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 14px; align-items: start; }
.figure-pair .figure { display: flex; flex-direction: column; height: 100%; }
.figure-pair .plate { flex: 1; }
.figure-pair .plate > svg { width: min(100%, 380px); }

.figure-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--cell, 150px)), 1fr));
}
.figure-grid .figure { display: flex; flex-direction: column; }
.figure-grid .plate { flex: 1; padding: 14px 10px; }
.figure-grid figcaption { margin-top: 8px; text-align: center; font-size: 15px; }
.figure-grid figcaption b { display: block; font: 400 20.25px/1.15 var(--pixel); color: var(--ink); }

/* Diagram hooks. A mirror of tools/learn/svg/diagrams.css (test_site.py
   checks that every class there is styled here), so inline diagrams take
   the page's colors from the --jl-dia-* tokens above, and paper's in print.
   CSS beats the SVGs' presentation attributes, which stay as their colors
   anywhere else (an <img>, a PDF). */
.jl-dia { max-width: 100%; height: auto; overflow: visible; }
.jl-dia text { font-family: var(--read); }
.jl-dia .jl-string, .jl-dia .jl-fret { stroke: var(--jl-dia-line); }
.jl-dia .jl-nut { fill: var(--jl-dia-ink); stroke: var(--jl-dia-ink); }
.jl-dia .jl-inlay { fill: var(--jl-dia-inlay); }
.jl-chord .jl-fretnum, .jl-dia .jl-string-label, .jl-dia .jl-string-name,
.jl-dia .jl-fret-number { fill: var(--jl-dia-muted); }
.jl-dia .jl-fret-number--marked { fill: var(--jl-dia-ink); }
.jl-chord .jl-caption { fill: var(--jl-dia-ink); }
.jl-chord .jl-mark--muted, .jl-chord .jl-mark--open { stroke: var(--jl-dia-muted); }
.jl-chord .jl-mark--root { stroke: var(--jl-dia-root); }
.jl-dia .jl-dot, .jl-dia .jl-barre, .jl-dia .jl-note { fill: var(--jl-dia-dot); }
.jl-dia .jl-dot--root, .jl-dia .jl-note--root { fill: var(--jl-dia-root); }
.jl-dia .jl-dot-label, .jl-dia .jl-note-label { fill: var(--jl-dia-dot-text); }
.jl-dia .jl-dot-label--root, .jl-dia .jl-note-label--root { fill: var(--jl-dia-root-text); }
.jl-dia .jl-string-label--root { fill: var(--jl-dia-root); }
.jl-neck .jl-window { fill: var(--jl-dia-root); stroke: var(--jl-dia-root); }
.jl-neck .jl-window-label { fill: var(--jl-dia-root); }
.jl-circle .jl-wedge { fill: var(--jl-dia-wedge); stroke: var(--jl-dia-wedge-edge); }
.jl-circle .jl-wedge--diatonic { fill: var(--jl-dia-wedge-near); }
.jl-circle .jl-wedge--key { fill: var(--jl-dia-root); }
.jl-circle .jl-wedge-label, .jl-circle .jl-wedge-numeral { fill: var(--jl-dia-ink); }
.jl-circle .jl-wedge--key ~ text { fill: var(--jl-dia-root-text); }
.jl-circle .jl-wedge-sig, .jl-circle .jl-circle-center--sub { fill: var(--jl-dia-muted); }
.jl-circle .jl-circle-center { fill: var(--jl-dia-ink); }
.jl-circle a:focus-visible .jl-wedge { stroke: var(--jl-dia-root); stroke-width: 3; }
.jl-circle a:hover .jl-wedge:not(.jl-wedge--key) { fill: var(--jl-dia-wedge-near); }
.jl-keyboard .jl-key--white { fill: var(--jl-dia-white-key); stroke: var(--jl-dia-key-edge); }
.jl-keyboard .jl-key--black { fill: var(--jl-dia-black-key); }

/* ---------- tables ---------- */

.table-block { margin: 0; }
.table-scroll { overflow-x: auto; border-radius: var(--radius); background: var(--raised); box-shadow: inset 0 0 0 1px var(--line); }
.table-scroll:focus-visible { outline-offset: 2px; }
table.data { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 17px; line-height: 1.45; }
table.data caption { caption-side: bottom; text-align: left; padding: 10px 2px 0; font-size: 15px; color: var(--ink-2); }
.table-block > figcaption { margin-top: 10px; font-size: 15px; color: var(--ink-2); }
table.data th, table.data td { padding: 12px 16px; text-align: left; vertical-align: top; }
table.data thead th {
  font: 400 20.25px/1.15 var(--pixel); color: var(--ink-2); white-space: nowrap;
  background: var(--raised-2); vertical-align: bottom;
}
table.data tbody tr:nth-child(even) > * { background: rgba(196, 214, 240, 0.035); }
table.data tbody th { font-weight: 800; color: var(--ink); white-space: nowrap; }
table.data td { color: var(--ink-2); }
table.data td strong { color: var(--ink); }
table.data .num { text-align: right; }
table.data .center { text-align: center; }
/* A progression or shape that must not break (text.keep_together), a cell. */
.nw { white-space: nowrap; }
table.data tr.is-root > * { color: var(--gold); }

/* ---------- hubs: cards, chips, groups ---------- */

.group + .group { margin-top: clamp(40px, 6vw, 64px); }
.group-head { margin-bottom: 18px; }
.group-title { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 20px; }
.group-head p { margin-top: 6px; color: var(--ink-2); max-width: var(--measure); }
.group-head .more { font-size: 16px; }
.hub-intro { max-width: var(--measure); margin-bottom: clamp(32px, 5vw, 48px); color: var(--ink-2); font-size: 19px; }
.hub-intro > * + * { margin-top: 1em; }
.sheet > .related:first-child, .sheet > .group:first-child { margin-top: 0; }

.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--card-min, 230px)), 1fr)); }
.cards.two { --card-min: 340px; }
.card {
  position: relative; height: 100%; display: flex; flex-direction: column; gap: 6px;
  padding: 18px 20px 20px; border-radius: var(--radius); text-decoration: none;
  background: var(--raised); box-shadow: inset 0 0 0 1px var(--line);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), background-color .35s var(--ease);
}
a.card:hover { transform: translateY(-2px); background: #1b2739; box-shadow: inset 0 0 0 1px rgba(255, 210, 122, 0.4), 0 18px 34px -22px rgba(0, 0, 0, 0.9); }
a.card:active { transform: translateY(0) scale(0.99); }
.card-media {
  display: grid; place-items: center; margin: -4px -6px 8px; padding: 12px; min-height: 120px;
  border-radius: 14px; background: var(--inset); color: var(--ink);
}
.card-media > svg, .card-media > img { width: auto; max-height: 150px; }
.card-title { font: 400 27px/1.1 var(--pixel); color: var(--ink); }
a.card:hover .card-title { color: var(--gold); }
.card-text { font-size: 16px; line-height: 1.5; color: var(--ink-2); }
.card-meta { margin-top: auto; padding-top: 8px; font-size: 14px; color: var(--ink-3); }
.card-tag {
  align-self: flex-start; padding: 3px 10px 2px; border-radius: 999px; margin-bottom: 2px;
  font: 400 16.875px/1.2 var(--pixel); background: var(--gold-wash); color: var(--gold);
}
/* A card that leads its group: wider, with its picture beside the words. */
.cards > .lead-cell { grid-column: span 2; }
.card-body { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card.lead { flex-direction: row; align-items: stretch; gap: 22px; }
.card.lead .card-media { margin: 0; flex: 0 0 44%; min-height: 180px; }
.card.lead .card-body { justify-content: center; }
.card.lead .card-title { font-size: 33.75px; }
@media (max-width: 640px) {
  .cards > .lead-cell { grid-column: auto; }
  .card.lead { flex-direction: column; align-items: stretch; }
  .card.lead .card-media { flex-basis: auto; }
}

.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; min-width: 52px;
  padding: 0 16px; border-radius: 999px; text-decoration: none; white-space: nowrap;
  font: 400 20.25px/1 var(--pixel); color: var(--ink); background: var(--raised); box-shadow: inset 0 0 0 1px var(--line);
  transition: background-color .25s var(--ease), color .25s var(--ease), box-shadow .25s var(--ease);
}
a.chip:hover { color: var(--gold); box-shadow: inset 0 0 0 1px rgba(255, 210, 122, 0.45); }
.chip[aria-current] { background: var(--ink); color: var(--sheet); box-shadow: none; }
.chip .soft { color: var(--ink-3); font-size: 16.875px; }

/* ---------- keep going ---------- */

.related { margin-top: clamp(48px, 7vw, 80px); padding-top: clamp(28px, 4vw, 40px); box-shadow: inset 0 1px 0 var(--line); }
.related h2 { font-size: 33.75px; margin-bottom: 18px; }
.related ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.related a {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 16px; height: 100%;
  padding: 14px 18px; border-radius: 16px; text-decoration: none;
  background: var(--raised); box-shadow: inset 0 0 0 1px var(--line);
  transition: background-color .3s var(--ease), box-shadow .3s var(--ease);
}
.related a:hover { background: #1b2739; box-shadow: inset 0 0 0 1px rgba(255, 210, 122, 0.4); }
.related-title { font-weight: 800; color: var(--ink); line-height: 1.35; }
.related-text { grid-column: 1; font-size: 15px; line-height: 1.45; color: var(--ink-2); }
.related a::after, .pager a::after, .more::after {
  content: ""; width: 10px; height: 14px; flex: none; grid-row: 1 / span 2; grid-column: 2;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='14' shape-rendering='crispEdges' fill='%23ffd27a'%3E%3Crect width='3' height='2'/%3E%3Crect x='2' y='2' width='3' height='2'/%3E%3Crect x='4' y='4' width='3' height='2'/%3E%3Crect x='6' y='6' width='4' height='2'/%3E%3Crect x='4' y='8' width='3' height='2'/%3E%3Crect x='2' y='10' width='3' height='2'/%3E%3Crect y='12' width='3' height='2'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform .3s var(--ease);
}
.related a:hover::after, .pager a:hover::after { transform: translateX(3px); }
.more { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: var(--gold); text-decoration: none; font-weight: 800; }
.more::after { width: 7px; height: 10px; }
.more:hover { color: var(--gold-2); }

/* ---------- next and previous ---------- */

.pager { margin-top: 28px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pager a {
  display: grid; align-items: center; gap: 2px 14px; padding: 14px 18px; border-radius: 16px; text-decoration: none;
  background: var(--raised); box-shadow: inset 0 0 0 1px var(--line);
}
.pager a:hover { box-shadow: inset 0 0 0 1px rgba(255, 210, 122, 0.4); }
.pager .next { grid-column: 2; grid-template-columns: 1fr auto; text-align: right; }
.pager .prev { grid-template-columns: auto 1fr; }
.pager .prev::after { grid-column: 1; grid-row: 1 / span 2; transform: scaleX(-1); }
.pager .prev:hover::after { transform: scaleX(-1) translateX(3px); }
.pager .prev > span { grid-column: 2; }
.pager .next > span { grid-column: 1; }
.pager-label { font: 400 20.25px/1.1 var(--pixel); color: var(--ink-3); }
.pager-title { font-weight: 800; color: var(--ink); }
@media (max-width: 560px) { .pager { grid-template-columns: 1fr; } .pager .next { grid-column: 1; } }

/* ---------- the app, once a page ---------- */

.app-block {
  margin-top: clamp(40px, 6vw, 64px); padding: clamp(22px, 3.5vw, 32px);
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(16px, 3vw, 28px); align-items: center;
  border-radius: 24px; background: linear-gradient(160deg, #2a1d15, #1d140f);
  box-shadow: inset 0 0 0 1px rgba(255, 220, 180, 0.12);
}
.app-block .musician { width: 148px; height: 148px; margin: -12px -8px -12px -16px; }
.app-block h2 { font-size: 33.75px; color: #f4e9dc; }
.app-block p { margin-top: 10px; color: #d4c3ae; max-width: 54ch; }
.app-block .actions { margin-top: 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
.app-block .hint { color: #c4b19c; }
.app-block .app-note { flex-basis: 100%; margin: 0; font-size: 16px; }
.app-block :focus-visible { outline-color: var(--gold); }
#app { scroll-margin-top: 92px; }
@media (max-width: 560px) {
  .app-block { grid-template-columns: 1fr; }
  .app-block .musician { width: 96px; height: 96px; margin: -6px 0 -10px -10px; }
}

/* ---------- play ---------- */

/* A small button that plays a chord, a scale or a note. The page's script
   finds it by [data-play] and sets aria-pressed while it sounds. */
.play {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; flex: none;
  min-width: 44px; min-height: 44px; padding: 0 18px 0 14px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--raised-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2);
  font: 400 20.25px/1 var(--pixel); white-space: nowrap;
  transition: background-color .25s var(--ease), box-shadow .25s var(--ease), transform .25s var(--ease);
}
.play:hover { background: #26354d; box-shadow: inset 0 0 0 1px rgba(255, 210, 122, 0.5); }
.play:active { transform: scale(0.97); }
.play-icon { position: relative; width: 22px; height: 22px; flex: none; border-radius: 50%; background: var(--gold); }
.play-icon::before {
  content: ""; position: absolute; left: 8px; top: 6px; width: 0; height: 0;
  border-style: solid; border-width: 5px 0 5px 8px; border-color: transparent transparent transparent var(--on-gold);
}
.play[aria-pressed="true"] { background: var(--gold-wash); box-shadow: inset 0 0 0 1px var(--gold); }
.play[aria-pressed="true"] .play-icon::before { left: 7px; top: 7px; width: 8px; height: 8px; border: 0; background: var(--on-gold); }
.play.icon-only { padding: 0; width: 44px; }
.play[disabled] { opacity: 0.5; cursor: default; }
.play-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---------- printable chart ---------- */

.download { display: grid; justify-items: start; gap: 6px; }

/* ---------- video ---------- */

.video { margin: 0; }
.video-frame { position: relative; aspect-ratio: var(--ratio, 16 / 9); border-radius: var(--radius); overflow: hidden; background: var(--inset); box-shadow: inset 0 0 0 1px var(--line); }
.video-frame video, .video-frame img { width: 100%; height: 100%; object-fit: cover; }
.video figcaption { margin-top: 10px; font-size: 15px; color: var(--ink-2); }
.transcript { margin-top: 10px; }
.transcript summary {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; list-style: none;
  font: 400 20.25px/1 var(--pixel); color: var(--gold);
}
.transcript summary::-webkit-details-marker { display: none; }
.transcript summary::before { content: "+"; font-size: 1.1em; transition: transform .3s var(--ease); }
.transcript[open] summary::before { transform: rotate(45deg); }
.transcript > div { padding: 4px 0 6px; color: var(--ink-2); font-size: 16px; }
.transcript > div > * + * { margin-top: 0.8em; }

/* ---------- glossary ---------- */

.letters { position: relative; }
.glossary { margin: 0; }
.glossary-letter { font-size: 40.5px; color: var(--gold); margin-top: 1.4em; scroll-margin-top: 24px; }
.glossary-letter:first-child { margin-top: 0; }
.term { padding: 10px 0 16px; scroll-margin-top: 24px; }
.term + .term { box-shadow: inset 0 1px 0 var(--line); }
.term dt { font-weight: 800; font-size: 20px; color: var(--ink); }
.term dt a { display: inline-flex; align-items: center; min-height: 44px; color: inherit; text-decoration: none; }
.term dt a:hover { color: var(--gold); }
.term dd { margin: 0; color: var(--ink-2); }
.term dd > * + * { margin-top: 0.6em; }
.term:target { margin-inline: -14px; padding-inline: 14px; border-radius: 14px; background: var(--gold-wash); }

/* ---------- tools ---------- */

/* A tool is a panel with a screen (what it shows) over its controls. The
   tool's script owns what is inside; these are its parts. */
.tool {
  padding: clamp(14px, 2.5vw, 22px); border-radius: var(--radius-sheet);
  background: var(--raised); box-shadow: inset 0 0 0 1px var(--line), 0 30px 60px -40px rgba(0, 0, 0, 0.8);
}
.tool-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 4px 6px 14px; }
.tool-title { font: 400 27px/1.1 var(--pixel); color: var(--ink); }
.tool-screen {
  position: relative; display: grid; place-items: center; text-align: center; gap: 8px;
  min-height: var(--screen-h, 260px); padding: 22px; border-radius: var(--radius);
  background: radial-gradient(ellipse at 50% 0%, rgba(255, 210, 122, 0.07), transparent 60%), var(--inset);
  box-shadow: inset 0 0 0 1px var(--line), inset 0 10px 30px -10px rgba(0, 0, 0, 0.6);
  color: var(--ink);
}
.readout { font: 400 81px/0.9 var(--pixel); color: var(--gold); font-variant-numeric: tabular-nums; }
.readout.medium { font-size: 54px; }
.readout-label { font: 400 20.25px/1.2 var(--pixel); color: var(--ink-3); }
.readout-sub { font-size: 16px; color: var(--ink-2); }
.tool-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 16px 4px 4px; }
.tool-controls .grow { flex: 1 1 200px; }
.tool-note { padding: 12px 6px 2px; font-size: 15px; color: var(--ink-3); }
.tool-status { min-height: 1.5em; font-size: 15px; color: var(--ink-2); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; min-width: 48px; padding: 0 20px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--raised-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2);
  font: 400 20.25px/1 var(--pixel); white-space: nowrap; text-decoration: none;
  transition: background-color .25s var(--ease), box-shadow .25s var(--ease), transform .25s var(--ease);
}
.btn:hover { background: #26354d; }
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--gold); color: var(--on-gold); box-shadow: none; min-width: 120px; }
.btn.primary:hover { background: var(--gold-2); }
.btn[aria-pressed="true"] { background: var(--ink); color: var(--sheet); }
.btn.icon { padding: 0; width: 48px; font-size: 27px; }
.btn[disabled] { opacity: 0.45; cursor: default; transform: none; }

/* Segmented choice: a radiogroup of buttons, or of labels around radios. */
.seg { display: inline-flex; flex-wrap: wrap; padding: 3px; gap: 2px; border-radius: 999px; background: var(--inset); box-shadow: inset 0 0 0 1px var(--line); }
.seg button, .seg label {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 52px; padding: 0 16px;
  border: 0; border-radius: 999px; background: transparent; cursor: pointer;
  font: 400 20.25px/1 var(--pixel); color: var(--ink-2); transition: background-color .25s var(--ease), color .25s var(--ease);
}
.seg button:hover, .seg label:hover { color: var(--ink); }
.seg [aria-checked="true"], .seg [aria-pressed="true"], .seg input:checked + label { background: var(--ink); color: var(--sheet); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: 1px; }

.stepper { display: inline-flex; align-items: center; gap: 4px; padding: 3px; border-radius: 999px; background: var(--inset); box-shadow: inset 0 0 0 1px var(--line); }
.stepper button {
  width: 44px; height: 44px; border: 0; border-radius: 50%; cursor: pointer; background: var(--raised-2); color: var(--ink);
  font: 400 27px/1 var(--pixel);
}
.stepper button:hover { background: #26354d; }
.stepper output, .stepper .value { min-width: 4ch; text-align: center; font: 400 27px/1 var(--pixel); font-variant-numeric: tabular-nums; }

.control { display: grid; gap: 6px; }
.control > label, .control-label { font: 400 20.25px/1.1 var(--pixel); color: var(--ink-3); }
.select, .input {
  min-height: 48px; padding: 0 16px; border-radius: 14px; border: 0;
  background: var(--inset); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2);
  font: 400 17px var(--read);
}
.select {
  appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer;
  background: var(--inset) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' shape-rendering='crispEdges' fill='%23ffd27a'%3E%3Crect width='2' height='2'/%3E%3Crect x='2' y='2' width='2' height='2'/%3E%3Crect x='4' y='4' width='2' height='2'/%3E%3Crect x='6' y='2' width='2' height='2'/%3E%3Crect x='8' width='2' height='2'/%3E%3C/svg%3E") right 16px center / 10px 6px no-repeat;
}
.select:focus-visible, .input:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--focus); }
.input::placeholder { color: var(--ink-3); }

.slider { -webkit-appearance: none; appearance: none; width: 100%; height: 44px; background: transparent; cursor: pointer; }
.slider::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--gold) var(--fill, 0%), rgba(196, 214, 240, 0.18) var(--fill, 0%)); }
.slider::-moz-range-track { height: 6px; border-radius: 3px; background: rgba(196, 214, 240, 0.18); }
.slider::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--gold); }
.slider::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; margin-top: -11px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 4px rgba(255, 210, 122, 0.25), 0 4px 10px rgba(0, 0, 0, 0.5); }
.slider::-moz-range-thumb { width: 28px; height: 28px; border: 0; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 4px rgba(255, 210, 122, 0.25); }
.slider:focus-visible { outline: none; }
.slider:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--focus); }
.slider:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px var(--focus); }

/* Beat lights: one square a beat, the one that sounds lights up. */
.beats { display: flex; justify-content: center; gap: 10px; }
.beat { width: 22px; height: 22px; border-radius: 5px; background: rgba(196, 214, 240, 0.14); transition: background-color .08s linear, transform .08s linear; }
.beat.accent { box-shadow: inset 0 0 0 2px rgba(255, 210, 122, 0.5); }
.beat.on { background: var(--gold); transform: scale(1.12); }
.beat.accent.on { background: var(--ember); }

/* A centered needle scale (tuner): the tool draws the needle. */
.gauge { position: relative; width: min(100%, 420px); height: 18px; border-radius: 9px; background: linear-gradient(90deg, rgba(232, 117, 74, 0.35), rgba(255, 210, 122, 0.2) 42%, rgba(160, 210, 140, 0.5) 50%, rgba(255, 210, 122, 0.2) 58%, rgba(232, 117, 74, 0.35)); }
.gauge::after { content: ""; position: absolute; left: 50%; top: -6px; bottom: -6px; width: 2px; margin-left: -1px; background: var(--ink); }

/* ---------- footer ---------- */

.foot {
  margin-top: clamp(48px, 8vw, 96px); padding: 36px var(--gutter) 44px;
  background: var(--sky-2); box-shadow: inset 0 1px 0 var(--line);
}
.foot-inner { width: min(100%, var(--content)); margin: 0 auto; display: grid; grid-template-columns: auto 1fr; gap: 24px 40px; align-items: start; }
.foot .brand img { height: 52px; }
.foot-brand { display: grid; gap: 12px; align-content: start; max-width: 34ch; }
.foot-brand p { font-size: 15px; color: var(--ink-3); }
.foot-cols { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 20px 48px; }
.foot-col h2 { font-size: 20.25px; color: var(--ink-3); margin-bottom: 6px; }
.foot-col ul { list-style: none; margin: 0; padding: 0; }
.foot-col a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; color: var(--ink-2); text-decoration: none; font-size: 16px; }
.foot-col a:hover { color: var(--gold); }
.fine { grid-column: 1 / -1; color: var(--ink-3); font-size: 14px; }
.sheet + .foot { margin-top: 0; }
@media (min-width: 641px) { .sheet + .foot { margin-top: clamp(48px, 8vw, 96px); } }
@media (max-width: 640px) {
  .foot { margin-top: 0; }
  .foot-inner { grid-template-columns: 1fr; }
  .foot-cols { justify-content: flex-start; gap: 16px 36px; }
}

/* ---------- motion, contrast, colors the system forces ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
@media (prefers-contrast: more) {
  :root {
    --ink-2: #ece3d6; --ink-3: #d3cabd; --line: rgba(196, 214, 240, 0.4); --line-2: rgba(196, 214, 240, 0.6);
    --jl-dia-line: #c3c9d3; --jl-dia-muted: #ece3d6; --gold-dim: var(--gold);
  }
  .bar { background: var(--sheet); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (forced-colors: active) {
  .card, .callout, .plate, .facts, .toc, .tool, .related a, .pager a, .button, .store-link, .chip, .play, .btn, .seg, .table-scroll, .app-block { border: 1px solid CanvasText; }
  .play-icon { forced-color-adjust: none; background: ButtonText; }
  /* The system drops our backgrounds, so what is chosen, pressed or now
     playing takes the system highlight, and a slider draws its own track. */
  .seg [aria-checked="true"], .seg [aria-pressed="true"], .seg input:checked + label, .btn[aria-pressed="true"],
  .play[aria-pressed="true"], .sections a[aria-current]:not(.sections-label), .chip[aria-current], .beat.on, .pa-card .pa-beats i.on {
    forced-color-adjust: none; background: Highlight; color: HighlightText;
  }
  [aria-pressed="true"] > .play-icon { background: HighlightText; }
  .pa-card.now, .pa-step.now { outline: 3px solid Highlight; outline-offset: -3px; }
  .slider { forced-color-adjust: none; }
  .slider::-webkit-slider-runnable-track { background: linear-gradient(90deg, Highlight var(--fill, 0%), GrayText var(--fill, 0%)); }
  .slider::-moz-range-track { background: GrayText; }
  .slider::-moz-range-progress { background: Highlight; }
  .slider::-webkit-slider-thumb { background: CanvasText; box-shadow: none; }
  .slider::-moz-range-thumb { background: CanvasText; box-shadow: none; }
  .slider:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px Highlight; }
  .slider:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px Highlight; }
}

/* ---------- paper ---------- */

@media print {
  :root {
    --sky: #fff; --sky-2: #fff; --sheet: #fff; --raised: #fff; --raised-2: #f2f2f2; --inset: #fff;
    --ink: #111; --ink-2: #333; --ink-3: #555; --gold: #111; --gold-dim: #999; --line: #c8c8c8; --line-2: #999;
    --plate: #fff;
    --jl-dia-ink: #1b1410; --jl-dia-muted: #4d4036; --jl-dia-line: #5e5148; --jl-dia-dot: #1b1410;
    --jl-dia-dot-text: #fff; --jl-dia-root: #8a4b00; --jl-dia-root-text: #fff; --jl-dia-inlay: #d9d0c5;
    --jl-dia-wedge: #fff; --jl-dia-wedge-edge: #5e5148; --jl-dia-wedge-near: #e8d3b4;
    --jl-dia-white-key: #fff; --jl-dia-black-key: #1b1410; --jl-dia-key-edge: #5e5148;
    color-scheme: light;
  }
  @page { margin: 14mm 14mm 16mm; }
  html, body { background: #fff; color: #111; }
  body { font-size: 11.5pt; line-height: 1.5; }
  .bar, .sections, .stars, .skip, .app-block, .related, .pager, .foot, .play, .play-row, .tool-controls,
  .musician, .transcript, .toc, .no-print { display: none !important; }
  .print-only { display: block; }
  .top, .sheet { width: 100%; padding: 0; margin: 0; box-shadow: none; border-radius: 0; background: none; }
  .top { padding-bottom: 10pt; }
  .crumbs { display: none; }
  h1 { font-size: 26pt; } h2 { font-size: 18pt; } h3 { font-size: 14pt; }
  .top .lede { font-size: 12.5pt; color: #333; }
  .prose { display: block; }
  .prose > * + * { margin-top: 0.8em; }
  .prose a { color: #111; text-decoration-color: #999; }
  .prose ul > li::before { background: #111; box-shadow: none; }
  .prose ol > li::before { background: none; box-shadow: inset 0 0 0 1px #999; color: #111; }
  h2, h3 { break-after: avoid; }
  .figure, .table-block, .callout, .facts, .ref-hero, .figure-grid .figure, .card, .term, tr { break-inside: avoid; }
  .plate, .facts, .callout, .table-scroll, .card, .tool, .tool-screen, .card-media { box-shadow: none; border: 1px solid #c8c8c8; background: #fff; }
  .table-scroll { overflow: visible; }
  table.data thead th { background: #f2f2f2; color: #111; }
  table.data tbody tr:nth-child(even) > * { background: #fafafa; }
  table.data td { color: #222; }
  .figure.scroll .plate > svg { width: 100%; }
  .callout-label, .callout.warn .callout-label, .callout.note .callout-label { color: #111; }
  .readout { color: #111; }
  .print-source { margin-top: 18pt; padding-top: 8pt; border-top: 1px solid #c8c8c8; font-size: 9.5pt; color: #555; }
}

/* =====================================================================
   Page parts for the real /learn pages (tools/learn/pages). Built on the
   tokens and parts above; nothing here changes them.
   ===================================================================== */

/* The featured-snippet answer: the first thing on the sheet. */
.prose > .answer { font-size: 20px; line-height: 1.6; color: var(--ink); }

/* Diagram images: sized like the inline SVGs they stand in for. */
img.dia { display: block; max-width: 100%; height: auto; }
.figure.scroll .plate > img { max-width: none; width: max(100%, var(--min-width, 720px)); }
.figure.scroll .plate { justify-items: start; }

/* Shapes like x02210, Roman numerals: the pixel face, in gold. */
code.shape, .prose code.shape {
  padding: 3px 8px 1px; border-radius: 8px; background: var(--raised-2); color: var(--gold);
  font: 400 20.25px/1 var(--pixel); letter-spacing: 0.04em; white-space: nowrap;
}
.numeral { font: 400 20.25px/1 var(--pixel); color: var(--gold); white-space: nowrap; }
.facts dd code.shape { font-size: 22px; }

/* The row that switches every diagram's labels and hand. */
.view-controls {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
  padding: 12px 14px; border-radius: var(--radius); background: var(--raised); box-shadow: inset 0 0 0 1px var(--line);
}
.view-label { font: 400 20.25px/1 var(--pixel); color: var(--ink-3); }
.btn.toggle { min-height: 50px; }
.view-controls .btn.toggle { margin-left: auto; }
@media (max-width: 560px) { .view-controls .btn.toggle { margin-left: 0; } }

/* Chord shapes, one card each. */
.prose > .voicings { list-style: none; padding: 0; margin-top: 1.4em; display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.voicing {
  display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: 18px 20px 20px; border-radius: var(--radius);
  background: var(--raised); box-shadow: inset 0 0 0 1px var(--line);
}
.voicing-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.voicing-head h3 { font-size: 27px; line-height: 1.1; margin: 0; }
.voicing .plate { padding: 14px 10px; }
.voicing .plate > img { width: min(100%, 210px); }
.voicing-meta { margin: 0; font-size: 15px; color: var(--ink-2); }
.voicing-meta code.shape { margin-right: 2px; }
.finger-list { list-style: none; margin: 0; padding: 0; font-size: 16px; line-height: 1.5; color: var(--ink-2); }
.finger-list li + li { margin-top: 4px; }
.voicing-tip { font-size: 16px; line-height: 1.55; color: var(--ink); }
.voicing-tip > * + * { margin-top: 0.6em; }
.voicing .play-row { margin-top: auto; padding-top: 2px; }
.level {
  flex: none; padding: 4px 11px 3px; border-radius: 999px; font: 400 16.875px/1.1 var(--pixel);
  background: var(--gold-wash); color: var(--gold);
}
.level-2 { background: rgba(159, 179, 200, 0.14); color: var(--moon); }
.level-3 { background: rgba(255, 159, 122, 0.12); color: var(--ember-text); }

/* Questions and answers: each ### is a question. */
.faq > h3 { margin-top: 1.6em; font-family: var(--read); font-weight: 800; font-size: 19px; line-height: 1.4; }
.faq > h3:first-child { margin-top: 0; }
.faq > p { margin-top: 0.5em; }

/* A print button that sits with the play buttons. */
.play.quiet .print-icon {
  position: relative; width: 20px; height: 14px; flex: none; margin-top: 4px;
  border-radius: 3px; box-shadow: inset 0 0 0 2px var(--gold);
}
.play.quiet .print-icon::before {
  content: ""; position: absolute; left: 4px; top: -6px; width: 12px; height: 7px; box-shadow: inset 0 0 0 2px var(--gold);
}

/* Tab: monospaced lines that scroll sideways rather than wrap. */
.tab-block { margin: 0; }
.tab-block pre {
  margin: 0; padding: 16px 18px; overflow-x: auto; border-radius: var(--radius);
  background: var(--inset); box-shadow: inset 0 0 0 1px var(--line);
  font: 500 15px/1.45 ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: var(--ink); tab-size: 4;
}
.tab-block pre:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.tab-block figcaption { margin-top: 8px; font-size: 15px; color: var(--ink-2); }

/* A set of things side by side that wrap on a phone (scale positions). */
.positions { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); }
.position {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 18px 20px 20px; border-radius: var(--radius);
  background: var(--raised); box-shadow: inset 0 0 0 1px var(--line);
}
.position-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 14px; }
.position-head h3 { margin: 0; font-size: 27px; line-height: 1.1; }
.position-head .soft { font-size: 15px; color: var(--ink-3); }
.position .plate { padding: 12px; justify-items: start; }
.position .plate > img { width: min(100%, 420px); }
.position p { margin: 0; font-size: 16px; color: var(--ink-2); }

/* Chord diagram rows (a key's seven chords, a progression's chords). */
.chord-row { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 148px), 1fr)); }
.chord-cell {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 10px 14px;
  border-radius: var(--radius); background: var(--raised); box-shadow: inset 0 0 0 1px var(--line); text-align: center;
}
.chord-cell .numeral { font-size: 27px; }
.chord-cell .chord-name { font: 400 27px/1 var(--pixel); color: var(--ink); }
.chord-cell .chord-sub { font-size: 14px; color: var(--ink-3); }
.chord-cell img { width: min(100%, 130px); }
.chord-cell a { color: inherit; text-decoration: none; }
.chord-cell a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.chord-cell:has(a):hover { box-shadow: inset 0 0 0 1px rgba(255, 210, 122, 0.45); }
.chord-cell:has(a):hover .chord-name { color: var(--gold); }

/* A tool that should feel like an instrument (metronome, play-along). */
.tool .seg { max-width: 100%; }
.tool-row { display: flex; flex-wrap: wrap; align-items: end; gap: 12px 16px; }
.tool-row + .tool-row { margin-top: 14px; }
.tool-controls > .tool-row { flex: 1 1 100%; }
.control-inline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.control-inline > .control-label { margin-right: 2px; }
.input.number { width: 6.5ch; text-align: center; font: 400 27px/1 var(--pixel); padding: 0 8px; }
.switch {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer;
  font: 400 20.25px/1 var(--pixel); color: var(--ink-2);
}
.switch input { width: 22px; height: 22px; accent-color: var(--gold); margin: 0; }

@media print {
  img.dia { filter: invert(1) grayscale(1) contrast(1.25) brightness(1.08); }
  .figure.scroll .plate > img { width: 100%; }
  .view-controls, .chord-cell .play-row { display: none !important; }
  code.shape { background: none; color: #111; box-shadow: inset 0 0 0 1px #999; }
  .voicing, .position, .chord-cell { box-shadow: none; border: 1px solid #c8c8c8; background: #fff; break-inside: avoid; }
  .voicing .plate, .position .plate { background: #fff; }
  .tab-block pre { background: #fff; box-shadow: none; border: 1px solid #c8c8c8; }
}

/* Diagram files carry their plate color behind them (so they read in an
   image search too); wherever one sits, the box around it is that color. */
.card-media:has(> img.dia) { background: var(--plate); box-shadow: inset 0 0 0 1px var(--line); }
.figure-grid .plate { background: var(--plate); }
/* A wide picture that scrolls inside its plate says so on a phone. */
.scroll-hint { display: none; }
@media (max-width: 760px) { .figure.scroll .scroll-hint { display: inline; color: var(--ink-3); } }
.prose > .toc { margin-top: 2em; }

.prose .soft { color: var(--ink-3); }

/* ---------- the progression play-along ---------- */

.playalong .tool-screen, #play-along .tool-screen { display: block; place-items: normal; justify-items: stretch; padding: 16px; text-align: left; }
.pa-key-line { margin: 0; font-size: 16px; color: var(--ink-2); }
.pa-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 620px) { .pa-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.pa-card {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 8px 12px;
  border-radius: 16px; background: var(--plate); box-shadow: inset 0 0 0 1px var(--line);
  transition: box-shadow .2s var(--ease), transform .2s var(--ease);
}
.pa-card img { width: min(100%, 132px); }
.pa-card .numeral { font-size: 24px; }
.pa-card .chord-name { font: 400 30px/1 var(--pixel); color: var(--ink); }
.pa-card .chord-sub { font-size: 13px; color: var(--ink-3); text-align: center; }
.pa-card.now { box-shadow: inset 0 0 0 2px var(--gold), 0 0 26px -6px rgba(255, 210, 122, 0.55); }
.pa-card.now .chord-name { color: var(--gold); }
.pa-beats { display: flex; gap: 5px; margin-top: 4px; }
.pa-beats i { width: 10px; height: 10px; border-radius: 3px; background: var(--raised-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.pa-beats i.on { background: var(--gold); box-shadow: none; }
.pa-strum { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; margin-top: 14px; }
.pa-step { display: grid; justify-items: center; gap: 2px; padding: 6px 0 5px; border-radius: 10px; background: var(--raised); }
.pa-step b { font: 400 24px/1 var(--pixel); color: var(--ink); }
.pa-step small { font: 400 15px/1 var(--pixel); color: var(--ink-3); }
.pa-step.rest b { color: var(--ink-3); }
.pa-step.now { background: var(--gold-wash); box-shadow: inset 0 0 0 1px var(--gold); }
.pa-step.now b { color: var(--gold); }
.pa-status { margin: 12px 0 0; text-align: center; font-size: 15px; color: var(--ink-2); min-height: 1.5em; }
.pa-capo:empty { display: none; }
@media (prefers-reduced-motion: reduce) { .pa-card, .pa-step { transition: none; } }
@media print { .pa-strum, .pa-status, .pa-beats { display: none; } }

/* ---------- the metronome ---------- */

.tool .seg { border-radius: 26px; }
.stepper-input {
  width: 4.2ch; min-height: 44px; border: 0; background: transparent; color: var(--ink); text-align: center;
  font: 400 30px/1 var(--pixel); font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield;
}
.stepper-input::-webkit-outer-spin-button, .stepper-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper-input:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 10px; }
.mt-beats { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 6px; }
.mt-beats .beat { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 12px; }
.mt-beats .beat b { font: 400 24px/1 var(--pixel); color: var(--ink-3); }
.mt-beats .beat.group b, .mt-beats .beat.accent b { color: var(--ink-2); }
.mt-beats .beat.on b { color: var(--on-gold); }
.mt-beats.many .beat { width: 36px; height: 36px; border-radius: 10px; }
.mt-beats.many .beat b { font-size: 20px; }
.soft-label { font-size: 16px; color: var(--ink-2); }
.trainer-opts { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.select.small { min-height: 44px; padding-left: 12px; padding-right: 34px; }
.input.number.small { width: 5ch; font-size: 22px; min-height: 44px; }
.btn.flash { box-shadow: inset 0 0 0 2px var(--gold); }
.seg.is-off { opacity: 0.45; pointer-events: none; }
.tool-row.narrow { max-width: 360px; }
.mt-beats .beat.group { box-shadow: inset 0 0 0 2px rgba(159, 179, 200, 0.45); }
.prose > .grid-caption { margin-top: 10px; font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.figure-grid figcaption .shape { display: inline-block; margin-top: 4px; }
.figure-grid figcaption .play-row { justify-content: center; margin-top: 8px; }
.figure figcaption .play-row { display: inline-flex; vertical-align: middle; margin: 4px 0; }
.toc a { line-height: 1.35; }
.toc li + li { margin-top: 2px; }
.sheet > .group + .prose, .sheet > .prose + .group { margin-top: clamp(40px, 6vw, 64px); }
/* A hub's reference block (a table of chord types, every key): it lines up
   with the groups of cards instead of the centered reading column. */
.prose.flush { display: block; }
.prose.flush > * { max-width: 820px; }
.prose.flush > p { max-width: var(--measure); }
.prose.flush > * + * { margin-top: 1.15em; }
.prose.flush > h2 + * { margin-top: 0.7em; }
.prose.flush > .table-block { margin-top: 1.6em; }
.prose.flush > .table-block + h2 { margin-top: 2.1em; }
/* Scrolling boxes contain their screen-reader-only words too, or those
   (absolutely placed) would widen the page on a phone. */
.table-scroll, .plate, .tab-block pre, .sections ul { position: relative; }

/* ---------- round-1 review fixes ---------- */

/* The answer is the lede now: the first paragraph under the h1. */
.top .lede.answer { color: var(--ink); }
@media (max-width: 640px) { .top .lede.answer { font-size: 17px; line-height: 1.55; margin-top: 12px; } }

/* "Guitar" in the section row is a link to the guitar hub, styled as the
   row's label (smaller, with a divider), not as one of the tabs. */
.sections a.sections-label {
  flex: none; min-height: 44px; padding: 0 12px 0 6px; border-radius: 0; background: none;
  font: 400 16.875px/1 var(--pixel); color: var(--ink-3); box-shadow: inset -1px 0 0 var(--line-2);
}
.sections a.sections-label:hover { color: var(--ink); background: none; }
.sections a.sections-label[aria-current] { background: none; color: var(--gold); }

/* "How we check these shapes", under the facts. */
.ref-hero-side .checked { margin: -6px 0 0; font-size: 15px; }
.ref-hero-side .checked a { color: var(--ink-2); text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.ref-hero-side .checked a:hover { color: var(--gold); }
.finger-ref { margin: 0; font-size: 16px; color: var(--ink-2); }
.finger-ref a { color: var(--gold); }

/* A single chord figure in an article: the chord, its shape and Strum on
   one row, then the caption sentence on its own. */
.figure figcaption .fig-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.figure figcaption .fig-head .play-row { margin: 0; }
.figure figcaption .fig-text { display: block; margin-top: 8px; }


/* The chord chart on the chords hub: a line of roots for every type. */
.chord-chart { list-style: none; padding: 0; margin: 1em 0 0; display: grid; gap: 10px; }
.chord-chart > li { display: grid; grid-template-columns: minmax(150px, 13em) 1fr; gap: 6px 14px; align-items: baseline;
  padding: 10px 14px; border-radius: var(--radius); background: var(--raised); box-shadow: inset 0 0 0 1px var(--line); }
.chart-type { font: 400 20.25px/1.2 var(--pixel); color: var(--ink); }
.chart-roots { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 4px 6px; }
.chart-roots li { min-width: 3.2em; }
.chord-chart .chart-roots > li { padding-left: 0; }
.chord-chart .chart-roots > li::before { content: none; }
.chart-roots a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px; color: var(--gold); }
.chart-roots li:not(:has(a)) { display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px; color: var(--ink-3); }
@media (max-width: 560px) { .chord-chart > li { grid-template-columns: 1fr; } }

/* Links in table cells: the whole cell height is the target (44px+). */
table.data td a, table.data th a { display: block; padding: 10px 0; margin: -10px 0; }
/* A link alone in its cell (a chord) takes the whole cell as its target,
   without widening the table. */
table.data td { position: relative; }
table.data td > a:only-child::after { content: ""; position: absolute; inset: 0; }

/* Wide tables and tab say they scroll: the line shows and the right edge
   fades while there is more to see (learn.js sets .overflows). */
.table-hint, .tab-hint { display: none; margin: 6px 2px 0; font-size: 14px; color: var(--ink-3); }
.table-block.overflows .table-hint, .tab-block.overflows .tab-hint { display: block; }
.table-block.overflows .table-scroll:not(.at-end), .tab-block.overflows pre:not(.at-end) {
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 44px), rgba(0, 0, 0, 0.25));
  mask-image: linear-gradient(90deg, #000 calc(100% - 44px), rgba(0, 0, 0, 0.25));
}
/* Phones: the every-key tables fit at 390px (all eight columns). */
@media (max-width: 480px) {
  .table-block.wide table.data { font-size: 15px; }
  .table-block.wide table.data th, .table-block.wide table.data td { padding: 9px 7px; }
  .table-block.wide table.data .numeral { font-size: 16.875px; }
}

/* A tool takes focus when clicked, so its shortcuts work; keyboard users
   see the ring. */
.tool[data-tool]:focus { outline: none; }
.tool[data-tool]:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
/* A tool whose controls sit beside its screen on a wide window, so the
   main button is above the fold. */
@media (min-width: 900px) {
  .tool.side .tool-body { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 18px; align-items: start; }
  .tool.side .tool-controls { padding-top: 0; }
}

@media print {
  /* A page-jump button is no use on paper; level badges print as outlines. */
  .ref-hero-side .actions, .ref-hero-side .checked, a.btn, .btn, .table-hint, .tab-hint, .finger-ref { display: none !important; }
  .level { color: #222; background: none; box-shadow: inset 0 0 0 1px #999; }
  .chord-chart > li { background: #fff; box-shadow: none; border: 1px solid #c8c8c8; }
}

/* Phones: the answer, then the picture, with less air between them, so
   the hero diagram starts within the first screen. */
@media (max-width: 640px) {
  .top:not(.hub) { padding-top: 16px; padding-bottom: 18px; }
  .top:not(.hub) h1 { margin-top: 4px; }
  .top .meta { margin-top: 8px; }
  .sheet { padding-top: 14px; }
  .ref-hero > .figure > .plate { padding: 10px; }
}
/* Phones: Start, the tempo stepper and Tap share one row. */
@media (max-width: 420px) {
  .tool .btn.primary { min-width: 92px; padding: 0 16px; }
  .tool .tool-row { gap: 10px; }
  .tool .btn { padding: 0 16px; }
}
/* Phones: a shorter metronome screen, so Start is on the first screen
   (the stepper beside it shows the tempo too). */
@media (max-width: 640px) {
  #metronome .tool-screen { min-height: 0; padding: 12px 14px 14px; gap: 6px; }
  #metronome .readout { font-size: 60px; }
  #metronome .readout-label { display: none; }
  #metronome .mt-beats { margin-top: 2px; }
  #metronome .mt-beats .beat { width: 38px; height: 38px; }
  #metronome .tool-status:empty { display: none; }
}

/* ---------- tools-c (round 2) ---------- */
/* Circle of fifths and strumming trainer. Most of their look is inline or
   borrowed (.facts, .callout, .chord-row, .pa-card, .pa-step); these rules
   need a media query. */
#circle-tool .tool-screen, #strum-trainer .tool-screen { place-items: stretch; min-height: 0; padding: 12px; text-align: left; }
@media (min-width: 760px) { #circle-tool .tool-screen { grid-template-columns: 1.2fr 1fr; align-items: center; gap: 22px; } }
.st-grid { grid-template-columns: repeat(4, 1fr); }
@media (min-width: 560px) { .st-grid { grid-template-columns: repeat(8, 1fr); } }
@media (min-width: 1100px) { .st-grid.is-16 { grid-template-columns: repeat(16, 1fr); } }
@media (forced-colors: active) { .jl-circle .cf-center, .jl-circle .cf-center-sub { fill: CanvasText; } }

/* ---------- printables (round 2) ---------- */
/* Hub cards with a small paper thumbnail. A printable's own page loads
   sheets.css for the rest. */
.card-media > img.sheet-thumb { max-height: 160px; border-radius: 4px; background: #fff;
  box-shadow: 0 10px 22px -14px rgba(0, 0, 0, 0.9); }
@media print { .card-media > img.sheet-thumb { box-shadow: none; border: 1px solid #c8c8c8; } }

/* ---------- assembly (round 2) ---------- */
/* An 8-slot strum grid fits a 320 px phone without scrolling. */
@media (max-width: 360px) { .strum-grid table.data th, .strum-grid table.data td { padding: 10px 6px; text-align: center; } }
/* ---------- videos (round 3) ---------- */
/* The video pages' own rules (chapters, player) are in videos.css. */
/* Hub cards: the poster fills the top of the card, with the length on it. */
.card-media:has(> img.poster) {
  position: relative; display: block; padding: 0; min-height: 0; overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--line);
}
.card-media > img.poster { display: block; width: 100%; height: auto; max-height: none; aspect-ratio: 16 / 9; }
.video-length {
  position: absolute; right: 8px; bottom: 8px; padding: 3px 8px 2px; border-radius: 6px;
  font: 400 16.875px/1.2 var(--pixel); color: var(--ink); background: rgba(11, 17, 25, 0.86);
}
@media (forced-colors: active) {
  .video-length { border: 1px solid CanvasText; }
}
@media print {
  .video-length { display: none; }
}

/* ---------- round-4 fixes ---------- */
/* A scale diagram is wide: it may use its whole plate, like the circle,
   so its labels stay readable. */
.figure.medium .plate > img[src*="/scales/"] { width: min(100%, 420px); }
/* Phones: the stars stay under the section row, never on its words. */
@media (max-width: 760px) { .stars { top: 0; } }
/* Wider: the faint dots may reach up behind the bar, but the gold
   sparkles start under the section row, so none sits by a label. */
@media (min-width: 761px) { .stars::after { top: 120px; } }
/* Phones: a diagram uses the full width of its card, so its labels stay
   readable (scale positions, a key's circle and chords). */
@media (max-width: 420px) {
  .position .plate { margin: 0 -20px; padding: 8px 0; border-radius: 0; }
  .ref-hero > .figure > .plate { padding-left: 0; padding-right: 0; }
  .ref-hero > .figure.circle-hero > .plate { padding: 0; }
  .chord-cell { padding-left: 4px; padding-right: 4px; }
  .chord-cell img { width: min(100%, 150px); }
}
