/* The public site: the app's tokens (tokens.css, copied at build) and its glass
   design, in the layout of the landing page design (#556). */

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/fonts/atkinson-latin.woff2") format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F,
    U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/fonts/atkinson-latin-ext.woff2") format("woff2");
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F,
    U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Parisienne";
  font-style: normal;
  font-display: swap;
  src: url("/fonts/parisienne-latin.woff2") format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F,
    U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Parisienne";
  font-style: normal;
  font-display: swap;
  src: url("/fonts/parisienne-latin-ext.woff2") format("woff2");
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F,
    U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* The music fonts of the drawn scores (VexFlow's, SIL Open Font Licence); only piece pages use them. */
@font-face {
  font-family: "Bravura";
  font-display: block;
  src: url("/fonts/bravura.woff2") format("woff2");
}

@font-face {
  font-family: "Academico";
  font-display: swap;
  src: url("/fonts/academico.woff2") format("woff2");
}

* {
  box-sizing: border-box;
}

:root {
  font-family: var(--font);
  /* The system font scaled to Atkinson's x-height until it has loaded (#772). */
  font-size-adjust: from-font;
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
}

/* Soft glows down the page, left and right, scrolling with it. */
body {
  min-height: 100dvh;
  margin: 0;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(50% 40rem at 0% 0%, var(--bg-glow-1), transparent 70%),
    radial-gradient(45% 40rem at 100% 30rem, var(--bg-glow-2), transparent 70%),
    radial-gradient(40% 36rem at 0% 70%, var(--bg-glow-2), transparent 70%),
    radial-gradient(45% 36rem at 100% 92%, var(--bg-glow-1), transparent 70%), var(--bg);
}

a {
  color: var(--link);
}

a:hover {
  color: var(--accent);
}

/* Like the app (apps/web/src/styles/base.css): Parisienne for titles, the
   text font, bold, for the headings below them. */
h1,
h2,
h3 {
  margin: 0;
  font-weight: 400;
  line-height: 1.25;
  text-wrap: balance;
}

h1,
h2 {
  font-family: var(--font-title);
  font-size-adjust: 0.5;
}

h3 {
  font-weight: 700;
}

h1 {
  font-size: clamp(1.9rem, 3.6vw, 2.7rem);
}

h2 {
  font-size: clamp(1.8rem, 3.4vw, 2.5rem);
}

p {
  margin: 0;
  text-wrap: pretty;
}

/* font-size-adjust is inherited as a number: not inside drawings (the scores' music font). */
svg {
  font-size-adjust: none;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.wrap,
.site-header,
.site-footer {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding-inline: 24px;
}

main {
  flex: 1;
  padding-bottom: 32px;
}

/* A page's sections, spaced out. */
.section {
  padding-bottom: 104px;
}

.narrow {
  max-width: 820px;
}

.muted {
  color: var(--muted);
}

.lead {
  color: var(--muted);
  font-size: 1.15rem;
  max-width: 52ch;
}

.draft-banner {
  margin: 0;
  padding: 10px 16px;
  background: var(--warn-bg);
  border-bottom: 1px solid var(--warn-border);
  text-align: center;
  font-size: 0.9rem;
}

/* Glass, as in the app: frosted, with a light top edge. */
.glass,
.card {
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  border-radius: 26px;
  box-shadow:
    var(--shadow),
    inset 0 1px 0 var(--glass-highlight);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

.card {
  padding: 28px;
}

/* Header and footer */

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-block: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-family: var(--font-title);
  font-size: 1.6rem;
  font-weight: 400;
  font-size-adjust: 0.5;
  text-decoration: none;
  white-space: nowrap;
}

.brand img {
  border-radius: 12px;
}

.site-header nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 22px;
  font-weight: 500;
}

.site-header nav a:not(.button) {
  color: var(--text);
  text-decoration: none;
}

.site-header nav a:not(.button):hover,
.site-header nav a[aria-current="page"] {
  color: var(--accent);
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
  padding-block: 28px 48px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}

/* Brand, three links and the button on one line, down to a small phone. */
@media (max-width: 520px) {
  .site-header,
  .site-header nav {
    gap: 6px 14px;
  }

  .site-header .button.small {
    padding: 0 14px;
  }
}

/* The smallest phones: the logo without the name, and the FAQ only in the footer. */
@media (max-width: 420px) {
  .brand span,
  .nav-faq {
    display: none;
  }
}

/* Buttons and small labels */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 26px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-text);
  font: 800 1.05rem var(--font);
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 10px 26px var(--accent-glow);
  cursor: pointer;
}

.button:hover {
  color: var(--accent-text);
  filter: brightness(1.06);
}

.button.small {
  min-height: 44px;
  padding: 0 20px;
  font-size: 0.92rem;
}

.button.large {
  min-height: 54px;
  padding: 0 30px;
  font-size: 1.05rem;
}

.button.quiet {
  background: var(--glass);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
}

.eyebrow {
  align-self: flex-start;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  font-size: 0.88rem;
  font-weight: 600;
}

a.chip {
  color: var(--text);
  text-decoration: none;
}

a.chip:hover {
  background: var(--accent);
  color: var(--accent-text);
}

.level {
  flex: none;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 650;
}

/* Room for the deer, until it's drawn. */
.mascot {
  flex: none;
  display: grid;
  place-items: center;
  width: 120px;
  height: 120px;
  padding: 12px;
  border: 2px dashed currentColor;
  border-radius: 50%;
  color: var(--accent);
  font-size: 0.75rem;
  text-align: center;
  opacity: 0.7;
}

@media (max-width: 520px) {
  .mascot {
    display: none;
  }
}

/* The landing page */

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr));
  gap: 48px;
  align-items: center;
  padding-block: 48px 72px;
}

.hero-text {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.try {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  border-radius: 30px;
}

.try-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.try-head p:first-child {
  font-weight: 600;
}

.try-head p:last-child,
.try-foot {
  color: var(--muted);
  font-size: 0.9rem;
}

.try-app:not([hidden]) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.staff {
  padding: 10px 14px;
  border-radius: 16px;
  background: var(--paper);
  box-shadow: var(--paper-shadow);
}

.staff svg {
  display: block;
  width: 100%;
  height: auto;
}

/* Notation is always on light paper, in both themes. */
.staff-lines line,
.staff .ledger {
  stroke: #3a3f4a;
  stroke-width: 1.2;
}

.staff .clef,
.staff .head {
  fill: #2a1a35;
}

.staff .played {
  fill: var(--note-landmark);
}

.staff .stem {
  stroke: var(--note-landmark);
  stroke-width: 1.6;
}

.note-landmark {
  fill: var(--note-landmark);
}

.note-hit {
  fill: var(--note-hit);
}

.note-near {
  fill: var(--note-near);
}

.note-due {
  fill: var(--note-due);
}

.note-muted {
  fill: var(--note-muted);
}

.keys {
  position: relative;
  display: flex;
  height: 150px;
  padding: 8px;
  border-radius: 16px;
  background: var(--key-black);
}

.key {
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  margin: 0 2px;
  padding: 0 0 10px;
  border: 0;
  border-radius: 0 0 10px 10px;
  background: var(--key-white);
  color: #5e4b6c;
  font: 600 0.8rem var(--font);
  cursor: pointer;
  touch-action: manipulation;
  transition:
    background var(--dur-fast) var(--ease),
    transform var(--dur-fast) var(--ease);
}

.key.landmark {
  background: var(--key-landmark);
}

.key.down {
  background: var(--hint);
}

.key:active {
  transform: translateY(2px);
}

.black {
  position: absolute;
  top: 8px;
  width: 7%;
  height: 56%;
  transform: translateX(-50%);
  border: 2px solid rgb(255 255 255 / 10%);
  border-top: 0;
  border-radius: 0 0 6px 6px;
  background: var(--key-black);
  pointer-events: none;
}

.benefits {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 24px 32px;
  padding: 26px 28px;
}

.benefit {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.benefit h3 {
  font-size: 1.05rem;
}

.benefit p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.95rem;
}

.icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: var(--accent-soft);
  color: var(--accent);
}

.intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
}

.intro p {
  color: var(--muted);
  font-size: 1.1rem;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 20px;
  margin-bottom: 32px;
}

.section-head > div {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 640px;
}

.section-head p {
  color: var(--muted);
  font-size: 1.05rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 20px;
}

.grid.four {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  gap: 18px;
}

.grid article {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.grid h3 {
  font-size: 1.2rem;
}

.grid article p {
  color: var(--muted);
}

.steps {
  margin: 0;
  padding: 0;
  list-style: none;
}

.steps .card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
}

.step {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 1.3rem;
  font-weight: 700;
}

.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr));
  gap: 48px;
  align-items: center;
}

.split > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.split > div:first-child p {
  color: var(--muted);
  font-size: 1.05rem;
}

/* A drawing of the app's Today screen. */
.preview {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px;
  border-radius: 30px;
}

.preview-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.preview-head span:last-child {
  color: var(--muted);
  font-size: 0.82rem;
}

.preview-title span:first-child {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.preview-title span:last-child {
  font-size: 1.35rem;
  font-weight: 600;
}

.preview .chips span {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--well);
  font-size: 0.78rem;
  font-weight: 600;
}

.preview .chips .on-time {
  background: var(--right-soft);
}

.preview .chips .late {
  background: var(--near-soft);
}

.bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--border);
}

.bar span {
  display: block;
  width: 62%;
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
}

/* Pieces in a row that scrolls sideways, lined up with the page. */
.rail {
  display: flex;
  gap: 18px;
  margin: 0;
  padding: 8px max(24px, calc((100% - 1132px) / 2)) 24px;
  overflow-x: auto;
  list-style: none;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: max(24px, calc((100% - 1132px) / 2));
  scrollbar-width: thin;
}

.rail li {
  flex: none;
  width: 240px;
  scroll-snap-align: start;
}

.rail a {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  padding: 18px;
  border-radius: 24px;
  color: var(--text);
  text-decoration: none;
}

.rail .staff {
  padding: 6px 10px;
  border-radius: 14px;
  box-shadow: none;
}

.rail-group {
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.rail-title {
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.3;
}

.rail a:hover .rail-title {
  color: var(--accent);
}

.devices svg {
  color: var(--accent);
}

.feedback {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: clamp(28px, 5vw, 56px);
  border-radius: 32px;
}

.feedback p {
  max-width: 62ch;
  color: var(--muted);
  font-size: 1.05rem;
}

.faq {
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin-inline: auto;
}

.faq .glass {
  padding: 8px 28px;
}

.faq details {
  padding: 18px 4px;
  border-top: 1px solid var(--border);
}

.faq details:first-child {
  border-top: 0;
}

.faq summary {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 1.05rem;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  color: var(--accent);
  font-weight: 700;
}

.faq details[open] summary::after {
  content: "\2212";
}

.faq details p {
  max-width: 62ch;
  margin-top: 10px;
  color: var(--muted);
}

.closing {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: clamp(32px, 6vw, 64px);
  border-radius: 34px;
  background: var(--accent);
  color: var(--accent-text);
  box-shadow: 0 30px 70px var(--accent-glow);
}

.closing > div {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 560px;
}

.closing h2 {
  font-size: clamp(1.9rem, 3.6vw, 2.7rem);
}

.closing p {
  font-size: 1.08rem;
  opacity: 0.9;
}

.closing .button {
  align-self: flex-start;
  margin-top: 8px;
  background: var(--accent-text);
  color: var(--accent);
  box-shadow: none;
}

.closing .mascot {
  width: 170px;
  height: 170px;
  color: var(--accent-text);
}

/* Other pages: a title, then their content */

.page-head {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-block: 48px 40px;
}

.breadcrumb {
  color: var(--muted);
  font-size: 0.95rem;
}

.post-list,
.piece-list {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.post-list a {
  display: block;
  padding: 24px 28px;
  color: var(--text);
  text-decoration: none;
}

/* Smaller headings: the text font, bold, like h3 (script is for large titles). */
:is(.post-list, .post, .play-along) h2 {
  font-family: var(--font);
  font-weight: 700;
  font-size-adjust: none;
}

.post-list h2 {
  font-size: 1.3rem;
}

.post-list a:hover h2 {
  color: var(--accent);
}

.post-list p {
  margin-top: 8px;
}

/* A post reads best in a narrow column. */
.post {
  max-width: 44em;
}

.post .page-head {
  padding-bottom: 24px;
}

.post h2 {
  margin-top: 2em;
  font-size: 1.4rem;
}

.post p,
.post li {
  font-size: 1.05rem;
}

.post p,
.post ul,
.post ol,
.post blockquote {
  margin-top: 1em;
}

.post li + li {
  margin-top: 6px;
}

.post blockquote {
  margin-inline: 0;
  padding-left: 16px;
  border-left: 3px solid var(--accent);
  color: var(--muted);
}

.post-cta {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 48px;
}

.post-cta h2 {
  margin-top: 0;
}

.post-cta p {
  margin-top: 0;
}

/* Pieces: a list per section */

.piece-group {
  margin-top: 48px;
}

.piece-group > p {
  margin: 8px 0 18px;
}

.piece-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 22px;
  border-radius: 22px;
  color: var(--text);
  text-decoration: none;
}

.piece-row:hover strong {
  color: var(--accent);
}

.score-paper {
  display: grid;
  gap: 8px;
  margin: 0 0 8px;
  padding: clamp(12px, 3vw, 28px);
  border-radius: 22px;
  background: var(--paper);
  box-shadow: var(--paper-shadow);
}

.score-wide,
.score-narrow {
  display: grid;
  gap: 8px;
}

/* Two bars a line on a phone, four wider up (#572). */
.score-narrow {
  display: none;
}

@media (max-width: 600px) {
  .score-wide {
    display: none;
  }

  .score-narrow {
    display: grid;
  }
}

.score-paper svg {
  display: block;
  width: 100%;
  height: auto;
}

/* A song's or classic's page: the Piece design. */
.piece-page {
  max-width: 940px;
}

.piece-page .page-head .chips {
  margin-top: 4px;
}

.piece-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 64px;
}

.piece-section > p {
  max-width: 62ch;
  color: var(--muted);
  font-size: 1.05rem;
}

.play-along {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
}

.play-along > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 34rem;
}

.play-along h2 {
  font-size: 1.3rem;
}

.letter-notes {
  display: grid;
  gap: 10px;
  padding: 22px 26px;
  border-radius: 22px;
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  word-spacing: 0.15em;
}

.hand-keys {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  max-width: 26rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hand-keys li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 4px 18px;
  border: 1px solid var(--border);
  border-radius: 0 0 14px 14px;
  background: var(--key-white);
  color: #2a1a35;
}

.hand-keys li:first-child {
  background: var(--key-landmark);
}

.hand-keys strong {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-text);
}

.piece-page .closing {
  margin-top: 72px;
}

.piece-row[aria-current="page"] {
  border-color: var(--accent);
}

.piece-facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 24px;
  margin: 24px 0 0;
}

.piece-facts dt {
  color: var(--muted);
}

.piece-facts dd {
  margin: 0;
}

/* The pieces page: search and filters, cards per tune, the hands-together path, studies by topic. */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.piece-filter {
  display: grid;
  gap: 14px;
  margin-top: 8px;
  padding: 18px 22px;
}

.piece-search input {
  width: 100%;
  padding: 12px 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--field);
  color: var(--text);
  font: inherit;
}

.piece-search input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.piece-filter fieldset {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  /* A fieldset is as wide as its content unless told otherwise. */
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.piece-filter legend {
  float: left;
  min-width: 5.5em;
  margin-right: 4px;
  color: var(--muted);
  font-size: 0.88rem;
}

.filter-chip {
  position: relative;
}

.filter-chip input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
}

.filter-chip span {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

.filter-chip input:checked + span {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-text);
}

.filter-chip input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.piece-count {
  min-height: 1.5em;
  margin: 14px 0 0;
}

.pieces-index .piece-group:first-of-type,
.piece-count + .piece-group {
  margin-top: 24px;
}

.tune-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tune-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: 24px;
}

.tune-link {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  padding: 18px 18px 12px;
  color: var(--text);
  text-decoration: none;
}

.tune-link .staff svg {
  display: block;
  width: 100%;
  max-width: 200px;
  height: auto;
}

.tune-title {
  font-size: 1.12rem;
  font-weight: 650;
  line-height: 1.3;
}

.tune-link:hover .tune-title {
  color: var(--accent);
}

.tune-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 0 18px 18px;
  font-size: 0.9rem;
}

.versions {
  margin: 0;
  padding: 4px 10px 12px;
  border-top: 1px solid var(--glass-edge);
  list-style: none;
}

.versions a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 14px;
  color: var(--text);
  font-size: 0.92rem;
  text-decoration: none;
}

.versions a:hover {
  background: var(--accent-soft);
}

.versions a > span:nth-child(2) {
  flex: 1;
}

.versions .step {
  flex: none;
  width: 24px;
  height: 24px;
  font-size: 0.8rem;
}

.path {
  counter-reset: step;
}

.path .piece-row::before {
  counter-increment: step;
  content: counter(step);
  display: grid;
  flex: none;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 700;
}

.path .piece-row > span:first-child {
  flex: 1;
}

.topic {
  margin-top: 14px;
  border-radius: 22px;
}

.topic summary {
  padding: 16px 22px;
  cursor: pointer;
}

.topic .piece-list {
  padding: 0 12px 12px;
}

.topic .piece-row {
  box-shadow: none;
}

/* On a phone each filter is one row that scrolls sideways. */
@media (max-width: 640px) {
  .piece-filter {
    padding: 14px;
  }

  .piece-filter fieldset {
    flex-wrap: nowrap;
    margin-inline: -14px;
    padding-inline: 14px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .piece-filter legend {
    flex: none;
    min-width: 0;
  }

  .filter-chip {
    flex: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .key {
    transition: none;
  }

  .rail {
    scroll-snap-type: none;
  }
}
