/* Instrument Scales — product site.

   One screen. A sentence you can change ("C major on guitar.") sits above the
   instrument it describes, drawn in hairlines in the page's own ink. The only
   colour on the page is the notes. One typeface, left-aligned, no boxes. */

:root {
  --bg: #FFFFFF;
  --ink: #000000;
  --muted: #5E686D;
  --ivory: #FFFFFF;
  --ebony: #000000;
  --key-line: rgba(0, 0, 0, 0.32);

  --font: "Avenir Next", Avenir, "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --page: 70rem;
  --gutter: clamp(1.25rem, 5vw, 3rem);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --ink: #FFFFFF;
    --muted: #98A2A7;
    --ivory: #F0F0F0;
    --ebony: #000000;
    --key-line: #000000;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.125rem/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; border-radius: 2px; }
h1, h2, p { margin: 0; }

.wrap { width: 100%; max-width: var(--page); margin-inline: auto; padding-inline: var(--gutter); }
.skip { position: absolute; left: var(--gutter); top: -4rem; background: var(--ink); color: var(--bg); padding: 0.5rem 0.875rem; text-decoration: none; }
.skip:focus { top: 0.75rem; }

/* Header and footer: names and links, nothing else. */
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding-block: 1.5rem; font-size: 1rem; }
.brand { display: inline-flex; align-items: center; gap: 0.625rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
.brand img { width: 1.75rem; height: 1.75rem; border-radius: 22.5%; }
.site-header nav { display: flex; gap: 1.5rem; }
.site-header nav a, .site-footer a { color: var(--muted); text-decoration: none; }
.site-header nav a:hover, .site-footer a:hover { color: var(--ink); }
.site-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem; padding-block: clamp(2.5rem, 6vh, 4.5rem) 1.75rem; font-size: 0.9375rem; color: var(--muted); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.site-footer .credit { flex-basis: 100%; max-width: 44rem; font-size: 0.8125rem; }

/* The sentence. Its three underlined words are native menus. */
.sentence { padding-top: clamp(1.5rem, 6vh, 4.5rem); font-weight: 500; font-size: clamp(2.5rem, 9.5vw, 6rem); line-height: 1.22; letter-spacing: -0.035em; }
/* Each changeable word sits on a rule, like a blank on a form. */
.pick { position: relative; display: inline-block; max-width: 100%; line-height: 1.14; white-space: nowrap; border-bottom: 0.03em solid color-mix(in srgb, currentColor 28%, transparent); }
.pick:hover, .pick:focus-within { border-bottom-color: currentColor; }
.pick:focus-within { outline: 2px solid var(--ink); outline-offset: 0.1em; border-radius: 2px; }
@media (max-width: 26rem) { .pick { white-space: normal; } }
.pick select { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; font: 400 1rem/1.2 var(--font); letter-spacing: 0; }
.play { appearance: none; -webkit-appearance: none; display: none; width: max(0.56em, 2rem); height: max(0.56em, 2rem); margin-left: 0.18em; padding: 0; vertical-align: 0.03em; border: 0.04em solid var(--ink); border-radius: 50%; background: transparent; color: var(--ink); font: inherit; cursor: pointer; position: relative; }
.play::before { content: ""; position: absolute; left: 54%; top: 50%; transform: translate(-50%, -50%); border-style: solid; border-width: max(0.1em, 0.36rem) 0 max(0.1em, 0.36rem) max(0.16em, 0.58rem); border-color: transparent transparent transparent currentColor; }
.play::after { content: ""; position: absolute; inset: -0.4rem; }
.play:hover { background: var(--ink); color: var(--bg); }
.is-live .play { display: inline-block; }

/* The instrument: full width, and it scrolls sideways on a phone. */
.neck { overflow-x: auto; overscroll-behavior-x: contain; padding-block: clamp(1.5rem, 5vh, 3rem) 0.5rem; scrollbar-width: none; }
.neck::-webkit-scrollbar { display: none; }
.neck-inner { box-sizing: content-box; max-width: calc(var(--page) - 2 * var(--gutter)); min-width: 46rem; margin-inline: auto; padding-inline: var(--gutter); }
.neck svg { display: block; width: 100%; height: auto; overflow: visible; }
.string { stroke: var(--ink); stroke-opacity: 0.4; stroke-width: 1; }
.fret { stroke: var(--ink); stroke-opacity: 0.16; stroke-width: 1; }
.nut { stroke: var(--ink); stroke-width: 3; }
.fret-number { fill: var(--muted); font: 400 13px var(--font); }
.ivory { fill: var(--ivory); stroke: var(--key-line); stroke-width: 1; }
.ebony { fill: var(--ebony); }
.note { cursor: pointer; transform-box: fill-box; transform-origin: center; animation: arrive 0.3s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.note text { font-family: var(--font); font-weight: 600; pointer-events: none; }
.note .ring { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.note .dot { transform-box: fill-box; transform-origin: center; }
.note.ringing .dot { animation: ring 0.45s ease-out; }
@keyframes arrive { from { opacity: 0; transform: scale(0.6); } }
@keyframes ring { from { transform: scale(1.35); } }

/* What it is, and the one thing to do. */
.about { display: grid; gap: 1.5rem 3rem; padding-top: 0.25rem; }
.hint { font-size: 0.9375rem; color: var(--muted); }
.what { display: grid; gap: 0.75rem; margin-top: clamp(1rem, 3.5vh, 2.5rem); }
.about h1 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); line-height: 1.2; font-weight: 600; letter-spacing: -0.015em; text-wrap: balance; }
.lead { max-width: 38rem; color: var(--muted); }
.get { display: grid; gap: 0.75rem; justify-items: start; align-content: end; }
@media (min-width: 60rem) {
  .about { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
  .hint { grid-column: 1 / -1; }
  .get { justify-items: end; text-align: right; }
}
/* Apple's badge as supplied: black, the preferred one, whose grey border also
   holds it on the dark page. At least 40 px tall, never recoloured or animated;
   the grid gap keeps a quarter of its height clear. */
.store { display: block; line-height: 0; border-radius: 0.5rem; }
.store img { height: 3rem; width: auto; }
.get span { font-size: 0.9375rem; color: var(--muted); }

/* Support and the 404 page share the plain text column. */
.page { display: grid; gap: 1.25rem; justify-items: start; padding-top: clamp(2.5rem, 9vh, 6rem); max-width: 44rem; }
.page h1 { font-weight: 500; font-size: clamp(2.25rem, 7vw, 4.5rem); line-height: 1.04; letter-spacing: -0.035em; }
.page h2 { margin-top: clamp(1.5rem, 4vh, 2.5rem); font-size: 1.375rem; line-height: 1.25; font-weight: 600; letter-spacing: -0.01em; }
.page p { color: var(--muted); }
.page .lead-ink { color: var(--ink); font-size: 1.125rem; }
.page .address { color: var(--ink); font-weight: 600; font-size: 1.375rem; overflow-wrap: anywhere; }
.questions { width: 100%; border-top: 1px solid color-mix(in srgb, var(--ink) 14%, transparent); }
.questions details { border-bottom: 1px solid color-mix(in srgb, var(--ink) 14%, transparent); }
.questions summary { cursor: pointer; padding-block: 0.875rem; font-weight: 500; }
.questions details p { padding-bottom: 1rem; }
.links { display: grid; gap: 0.5rem; }

@media (prefers-reduced-motion: reduce) {
  .note, .note.ringing .dot { animation: none; }
}
