/* music.slopped.site: the chrome. Hand-written; scripts/build.mjs doesn't touch it. Brand tokens and type as on
   slopped.site (slopped-brand). The idea: a record sleeve's back. Big numbers run the course like track numbers,
   hairlines rule everything, and the only colour that isn't paper and ink is in Tinny and the tools. */
@font-face { font-family: "Archivo Black"; src: url(/fonts/archivo-black-latin.woff2) format("woff2"); font-weight: 400 1000; font-display: swap; }
@font-face { font-family: "Archivo Black Fallback"; src: local("Arial Bold"), local("Arial-BoldMT"), local("Helvetica Bold"), local("Helvetica-Bold"), local("Roboto Bold"), local("Roboto-Bold"), local("Noto Sans Bold"), local("NotoSans-Bold"); size-adjust: 112%; }
:root {
  color-scheme: light;
  --paper: #f4f1e8; --ink: #171815; --acid: #e3ff59; --pink: #ff8cc6; --orange: #ffa53d;
  --muted: #6b6b62; --line: #d4d2c9; --panel: #ebe7dc; --card: #fbf9f3; --focus: #728600;
  --head: "Archivo Black", "Arial Black", "Archivo Black Fallback", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { min-width: 320px; margin: 0; background: var(--paper); color: var(--ink); font-family: Arial, Helvetica, sans-serif; line-height: 1.55; }
a { color: inherit; }
:where(a, button, input, select, summary, [tabindex]):focus-visible { outline: 3px solid var(--focus); outline-offset: 5px; }
h1, h2, h3 { margin: 0; font-family: var(--head); font-weight: 1000; letter-spacing: -1.5px; line-height: 1.02; font-synthesis: none; }
.wrap { max-width: 1440px; margin: auto; padding: 0 5%; }
main:focus { outline: none; }
html:not(.can-install) [data-install] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 10; padding: 10px 16px; border-radius: 999px; background: var(--ink); color: var(--paper); font-weight: 700; text-decoration: none; }
.skip:focus { top: 12px; }
.nojs { color: var(--muted); }
kbd { display: inline-block; min-width: 22px; padding: 1px 6px; border: 1px solid var(--ink); border-radius: 5px; background: var(--card); font: 700 12px/1.5 Arial, Helvetica, sans-serif; text-align: center; }

/* ---------------------------------------------------------------- intro */
section.intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 440px); gap: 48px; align-items: center; padding: 48px 0 56px; }
section.intro h1 { max-width: 10ch; font-size: clamp(46px, 7vw, 104px); letter-spacing: -3px; }
section.intro.narrow { display: block; padding-bottom: 28px; }
section.intro.narrow h1 { max-width: 16ch; font-size: clamp(40px, 5.4vw, 80px); }
p.lede { max-width: 620px; margin: 22px 0 0; font-size: 21px; line-height: 1.4; letter-spacing: -.3px; }
p.rules { max-width: 620px; margin: 12px 0 0; color: var(--muted); font-size: 15px; }
@media (max-width: 860px) { section.intro { grid-template-columns: minmax(0, 1fr); gap: 28px; padding-top: 28px; } p.lede { font-size: 18px; } }

/* ---------------------------------------------------------------- the front page's sections */
.sec-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 22px; margin-bottom: 18px; }
.sec-head h2, .liner-notes h2 { font-size: clamp(34px, 4vw, 48px); }
.sec-head h2 small, .liner-notes h2 small { margin-left: 2px; color: var(--muted); font: 700 14px Arial, Helvetica, sans-serif; letter-spacing: 0; vertical-align: super; }
.sec-head p { max-width: 640px; margin: 0; color: var(--muted); font-size: 17px; }
section.course, section.tools, section.liner { padding: 26px 0 52px; border-top: 1px solid var(--ink); scroll-margin-top: 12px; }

ol.lessons { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
ol.lessons a { display: grid; grid-template-columns: 96px minmax(0, 1fr) minmax(0, 240px); gap: 18px; align-items: center; min-height: 76px; padding: 12px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
ol.lessons .n { font: 1000 54px/1 var(--head); letter-spacing: -3px; color: var(--ink); font-synthesis: none; font-variant-numeric: tabular-nums; }
ol.lessons .t { display: grid; gap: 2px; }
ol.lessons .t b { font-size: 21px; letter-spacing: -.4px; }
ol.lessons .t span, ol.lessons .s { color: var(--muted); font-size: 15px; }
ol.lessons .s::before { content: "♪ "; }
ol.lessons a:hover { background: linear-gradient(90deg, var(--acid), var(--acid)) 0 100% / 100% 0 no-repeat; }
ol.lessons a:hover .n { -webkit-text-stroke: 0; }
ol.lessons a:hover b { text-decoration: underline; text-underline-offset: 4px; }
@media (max-width: 760px) { ol.lessons a { grid-template-columns: 58px minmax(0, 1fr); gap: 12px; } ol.lessons .n { font-size: 36px; letter-spacing: -2px; } ol.lessons .s { grid-column: 2; font-size: 14px; } }
p.deeper { max-width: 760px; margin: 20px 0 0; font-size: 16px; }

ul.toollist { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 0 28px; margin: 0; padding: 0; list-style: none; }
ul.toollist a { display: grid; gap: 4px; min-height: 92px; padding: 14px 0; border-top: 1px solid var(--line); text-decoration: none; }
ul.toollist b { font: 1000 26px/1.05 var(--head); letter-spacing: -1px; font-synthesis: none; }
ul.toollist span { color: var(--muted); font-size: 15px; }
ul.toollist a:hover b { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }

ol.songlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 0 28px; margin: 0; padding: 0; list-style: none; }
.song-play { display: grid; grid-template-columns: 40px 1fr; gap: 2px 10px; width: 100%; min-height: 56px; padding: 10px 0; border: 0; border-top: 1px solid var(--line); background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.song-play .no { grid-row: span 2; align-self: center; font: 1000 22px/1 var(--head); letter-spacing: -1px; color: var(--muted); font-synthesis: none; }
.song-play b { font-size: 16px; }
.song-play .meta { grid-column: 2; color: var(--muted); font-size: 13px; }
.song-play:hover b { text-decoration: underline; text-underline-offset: 3px; }
.song-play.on .no { color: var(--ink); }
.song-play.on .no::before { content: "▶"; font-size: 15px; }
.song-play.on .no { font-size: 0; }
.song-play.on .no::before { font-size: 18px; }

/* ---------------------------------------------------------------- the player page */
.player-intro { padding-top: 34px !important; }
.player-intro h1 { font-size: clamp(40px, 5vw, 72px) !important; }
.player-page .tinny { margin-bottom: 28px; }
details.keys-help { max-width: 560px; margin: 0 0 56px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
details.keys-help summary { display: flex; align-items: center; min-height: 48px; font-weight: 700; cursor: pointer; }
details.keys-help summary::marker { content: ""; }
details.keys-help summary::-webkit-details-marker { display: none; }
details.keys-help summary::after { content: "+"; margin-left: auto; font: 1000 20px var(--head); }
details.keys-help[open] summary::after { content: "–"; }
details.keys-help dl { margin: 0 0 14px; }
details.keys-help dl div { display: grid; grid-template-columns: 120px 1fr; gap: 12px; padding: 6px 0; font-size: 15px; }
details.keys-help dd { margin: 0; }

/* embedded in desktop.slopped.site: Tinny and nothing else */
html.embed body { min-width: 0; background: var(--paper); }
html.embed .sh-wrap, html.embed .sh-drawer, html.embed footer, html.embed .player-intro, html.embed details.keys-help, html.embed .skip, html.embed #slop-top { display: none !important; }
html.embed .wrap { padding: 10px; max-width: none; }
html.embed .player-page .tinny { margin: 0; }

/* ---------------------------------------------------------------- a lesson */
article.lesson { padding: 40px 0 40px; }
.kicker { margin: 0 0 12px; font-size: 13px; font-weight: 700; letter-spacing: .3px; }
.lesson-head h1 { max-width: 16ch; font-size: clamp(40px, 5.6vw, 84px); letter-spacing: -2.5px; }
.lesson-grid { display: grid; grid-template-columns: minmax(0, 680px) minmax(0, 440px); gap: 56px; align-items: start; margin-top: 34px; }
@media (max-width: 980px) { .lesson-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; } }
.lesson-text > p { margin: 0 0 16px; font-size: 18px; line-height: 1.55; }
.lesson-text h2, .lesson-side h2, .lesson-tool h2 { margin: 30px 0 12px; font-size: 28px; letter-spacing: -1px; }
.lesson-side h2 { margin-top: 0; }
blockquote.said { margin: 0 0 26px; padding: 0 0 0 18px; border-left: 4px solid var(--acid); }
blockquote.said p { margin: 0; font: 1000 clamp(22px, 2.3vw, 30px)/1.15 var(--head); letter-spacing: -.8px; font-synthesis: none; }
blockquote.said cite { display: block; margin-top: 8px; color: var(--muted); font-size: 14px; font-style: normal; }
ol.try { margin: 0; padding-left: 22px; font-size: 17px; }
ol.try li { margin-bottom: 8px; padding-left: 4px; }
ul.hear { margin: 0 0 18px; padding: 0; list-style: none; }
ul.hear .song-play { grid-template-columns: 1fr; padding: 12px 0; }
ul.hear .song-play .meta { grid-column: 1; }
ul.hear .why { color: var(--ink); font-size: 14px; line-height: 1.4; margin-top: 4px; }
ul.hear .song-play.on b::before { content: "▶ "; }
section.lesson-tool { margin-top: 44px; padding-top: 10px; border-top: 1px solid var(--ink); }
section.lesson-tool h2 { margin-top: 18px; }

nav.steps { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 44px; padding-top: 20px; border-top: 1px solid var(--ink); }
nav.steps a { display: grid; gap: 4px; min-height: 44px; font: 700 17px/1.3 Arial, Helvetica, sans-serif; text-decoration: none; }
nav.steps a span { color: var(--muted); font-size: 13px; }
nav.steps a[rel="next"], nav.steps a:last-child:not(:first-child) { text-align: right; }
nav.steps a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---------------------------------------------------------------- a tool page, the liner notes */
section.tool-page { padding-bottom: 36px; }
.tool-page-body .tinny { margin-bottom: 52px; }
.songs-page .tinny { margin-bottom: 36px; }
.liner-notes { padding: 22px 0 40px; border-top: 1px solid var(--ink); }
.liner-notes h2 { margin-bottom: 14px; }
.sec-line { margin: -6px 0 14px; color: var(--muted); }
ol.liner-list { margin: 0; padding: 0; list-style: none; }
li.liner-row { display: grid; grid-template-columns: 64px minmax(0, 760px); gap: 16px; padding: 16px 0; border-top: 1px solid var(--line); }
li.liner-row .song-play { display: block; width: 56px; min-height: 56px; padding: 0; border: 1px solid var(--ink); border-radius: 50%; text-align: center; }
li.liner-row .song-play:hover { background: var(--acid); }
li.liner-row .song-play .no { display: block; color: var(--ink); }
li.liner-row h3 { font-size: 24px; letter-spacing: -.8px; }
li.liner-row p { margin: 6px 0 0; font-size: 15px; }
li.liner-row p.meta { color: var(--muted); font-size: 13px; font-weight: 700; }
li.liner-row p.credit { color: var(--muted); }

footer { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; padding: 28px 0 48px; border-top: 1px solid var(--ink); }
footer .foot-logo img { display: block; width: 150px; height: auto; }
footer p { flex: 1 1 360px; margin: 0; color: var(--muted); font-size: 14px; }

/* ---------------------------------------------------------------- the tools (each tool's own parts are .tl-*) */
.tool-host { --tl-key: 44px; }
.tl { display: grid; gap: 14px; }
.tl-row { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.tl-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 0 16px; border: 1px solid var(--ink); border-radius: 999px; background: transparent; color: var(--ink); font: 700 14px Arial, Helvetica, sans-serif; cursor: pointer; white-space: nowrap; touch-action: manipulation; }
.tl-btn:hover { background: var(--acid); }
.tl-btn[aria-pressed="true"], .tl-btn.dark { background: var(--ink); color: var(--paper); }
.tl-btn.dark:hover { background: #33342f; }
.tl-field { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; }
.tl-field select, .tl-field input[type=number] { min-height: 42px; padding: 0 10px; border: 1px solid var(--ink); border-radius: 10px; background: var(--card); color: var(--ink); font: 700 14px Arial, Helvetica, sans-serif; }
.tl-field input[type=number] { width: 84px; }
.tl-field input[type=range] { accent-color: var(--ink); width: 140px; }
.tl-note { margin: 0; color: var(--muted); font-size: 14px; }
.tl-out { margin: 0; font-size: 15px; min-height: 1.5em; }
.tl-big { font: 1000 clamp(54px, 9vw, 120px)/1 var(--head); letter-spacing: -4px; font-synthesis: none; font-variant-numeric: tabular-nums; }
.tl-panel { padding: 16px; border: 1.5px solid var(--ink); border-radius: 14px; background: var(--card); }
.tl-scroll { overflow-x: auto; overscroll-behavior-x: contain; padding-bottom: 6px; }

/* metronome */
.mt-top { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 18px; }
.mt-unit { margin-left: 8px; color: var(--muted); font-weight: 700; }
.mt-lights { display: flex; gap: 10px; }
.mt-lights span { width: 30px; height: 30px; border: 1.5px solid var(--ink); border-radius: 50%; background: var(--card); }
.mt-lights span.one { width: 38px; height: 38px; }
.mt-lights span.on { background: var(--acid); }
.mt-lights span.one.on { background: var(--ink); box-shadow: inset 0 0 0 6px var(--acid); }
.mt input[type=range] { flex: 1 1 200px; max-width: 420px; accent-color: var(--ink); }

/* keys */
.kb-scale { margin: 0; font-size: 17px; }
.kb-steps { color: var(--muted); font-size: 14px; }
.kb { position: relative; display: flex; width: max-content; min-width: 100%; height: 190px; padding-top: 2px; user-select: none; -webkit-user-select: none; touch-action: none; }
.key { position: relative; flex: none; display: flex; align-items: flex-end; justify-content: center; padding: 0 0 10px; border: 1.5px solid var(--ink); font: 700 12px Arial, Helvetica, sans-serif; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.key.white { width: var(--tl-key); height: 186px; margin-right: -1.5px; border-radius: 0 0 8px 8px; background: #fffdf7; color: var(--ink); z-index: 1; }
.key.black { width: calc(var(--tl-key) * .64); height: 112px; margin: 0 calc(var(--tl-key) * -.32 - 1px); border-radius: 0 0 6px 6px; background: var(--ink); color: var(--paper); z-index: 2; padding-bottom: 6px; }
.key.white.in { background: #f7ffcf; }
.key.black.in { box-shadow: inset 0 -14px 0 #6f7b2a; }
.key.tonic::before { content: ""; position: absolute; top: 10px; left: 50%; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: var(--pink); border: 1.5px solid var(--ink); }
.key.black.tonic::before { top: 8px; }
.key.down.white { background: var(--acid); }
.key.down.black { background: #5b6b10; }
.key:focus-visible { outline-offset: -6px; z-index: 3; }
.kb-chords { gap: 6px; }
.kb-chord b { font-family: var(--head); font-weight: 1000; font-synthesis: none; }
.kb-chord.q-minor { border-style: dashed; }
.kb-chord.q-diminished { color: var(--muted); }
@media (max-width: 760px) { .tool-host { --tl-key: 40px; } }

/* drum machine */
.dm-grid, .dm-steps { display: grid; gap: 4px; min-width: 640px; }
.dm-steps { grid-template-columns: 96px repeat(16, minmax(30px, 1fr)); margin-bottom: 4px; color: var(--muted); font-size: 12px; font-weight: 700; text-align: center; }
.dm-row { display: grid; grid-template-columns: 96px repeat(16, minmax(30px, 1fr)); gap: 4px; }
.dm-name { min-height: 42px; border: 0; background: transparent; color: var(--ink); font: 700 14px Arial, Helvetica, sans-serif; text-align: left; cursor: pointer; }
.dm-name:hover { text-decoration: underline; }
.dm-cell { min-height: 42px; border: 1.5px solid var(--line); border-radius: 8px; background: var(--card); cursor: pointer; touch-action: manipulation; }
.dm-cell.beat { border-color: #a9a69a; }
.dm-cell:nth-child(4n+2), .dm-cell:nth-child(4n+3), .dm-cell:nth-child(4n+4), .dm-cell:nth-child(4n+5) { }
.dm-cell.on { background: var(--ink); border-color: var(--ink); }
.dm-cell.ghost { background: linear-gradient(var(--card), var(--card)) padding-box, var(--ink); background: repeating-linear-gradient(135deg, var(--ink) 0 3px, var(--card) 3px 7px); border-color: var(--ink); }
.dm-cell.now { box-shadow: 0 0 0 3px var(--acid) inset; }
.dm-cell.on.now { box-shadow: 0 0 0 3px var(--acid) inset; background: var(--ink); }
.dm-row:nth-child(even) .dm-cell:not(.on):not(.ghost) { background: #f6f3ea; }

/* piano roll */
.pr-wrap { width: max-content; min-width: 100%; }
.pr-chords, .pr-row { display: grid; grid-template-columns: 56px repeat(64, 20px); }
.pr-chords { grid-template-columns: 56px repeat(8, 160px); margin-bottom: 4px; }
.pr-chord { padding: 4px 6px; border-left: 1.5px solid var(--ink); font-size: 13px; }
.pr-chord b { font-family: var(--head); font-weight: 1000; font-synthesis: none; }
.pr-label { display: flex; align-items: center; padding-right: 8px; justify-content: flex-end; color: var(--muted); font-size: 12px; font-weight: 700; }
.pr-label.tonic { color: var(--ink); }
.pr-cell { height: 24px; padding: 0; border: 0; border-right: 1px solid #e2dfd5; border-bottom: 1px solid #e2dfd5; background: var(--card); cursor: pointer; }
.pr-cell.beat { border-left: 1px solid #c9c6ba; }
.pr-cell.bar { border-left: 1.5px solid var(--ink); }
.pr-cell.tone { background: #f2fbc6; }
.pr-cell.on { background: var(--ink); border-right-color: var(--ink); }
.pr-cell.on.start { border-radius: 5px 0 0 5px; box-shadow: inset 3px 0 0 var(--acid); }
.pr-cell.now:not(.on) { background: #ffe0ef; }
.pr-cell:focus-visible { outline-offset: -3px; position: relative; z-index: 2; }
@media (pointer: coarse) { .pr-row { grid-template-columns: 56px repeat(64, 28px); } .pr-chords { grid-template-columns: 56px repeat(8, 224px); } .pr-cell { height: 30px; } }

/* mixing desk */
.dk-pos { font: 1000 22px/1 var(--head); font-variant-numeric: tabular-nums; font-synthesis: none; }
.dk-lanes { position: relative; display: grid; gap: 3px; min-width: 620px; }
.dk-row { display: grid; grid-template-columns: 70px repeat(var(--bars), minmax(6px, 1fr)); gap: 2px; align-items: stretch; }
.dk-lab { font-size: 13px; font-weight: 700; align-self: center; }
.dk-sec { min-height: 34px; padding: 0 6px; overflow: hidden; border: 1.5px solid var(--ink); border-radius: 6px; background: var(--card); font: 700 12px Arial, Helvetica, sans-serif; white-space: nowrap; text-overflow: ellipsis; cursor: pointer; }
.dk-sec:hover, .dk-sec.now { background: var(--acid); }
.dk-bar { height: 22px; border-radius: 3px; background: #e7e4da; }
.dk-lane-lead .dk-bar.on { background: var(--pink); }
.dk-lane-comp .dk-bar.on { background: var(--acid); box-shadow: inset 0 0 0 1px #9aa43a; }
.dk-lane-bass .dk-bar.on { background: var(--orange); }
.dk-lane-drums .dk-bar.on { background: var(--ink); }
.dk-head { position: absolute; top: 0; bottom: 0; left: calc(70px + (100% - 70px) * var(--at, 0)); width: 2px; background: var(--ink); pointer-events: none; }
.dk-strips { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 14px; }
.dk-strip { display: grid; gap: 8px; align-content: start; padding: 14px; border: 1.5px solid var(--ink); border-radius: 12px; background: var(--card); }
.dk-name { font: 1000 20px/1 var(--head); letter-spacing: -.5px; font-synthesis: none; }
.dk-strip-lead .dk-name { box-shadow: inset 0 -6px 0 var(--pink); justify-self: start; }
.dk-strip-comp .dk-name { box-shadow: inset 0 -6px 0 var(--acid); justify-self: start; }
.dk-strip-bass .dk-name { box-shadow: inset 0 -6px 0 var(--orange); justify-self: start; }
.dk-strip-drums .dk-name { box-shadow: inset 0 -6px 0 #b9b6aa; justify-self: start; }
.dk-ms { display: flex; gap: 6px; }
.dk-ms .tl-btn { padding: 0 14px; }
.dk-f { display: grid; grid-template-columns: 44px 1fr; gap: 2px 8px; align-items: center; font-size: 12px; font-weight: 700; color: var(--muted); }
.dk-f input { width: 100%; accent-color: var(--ink); }
.dk-f output { grid-column: 2; color: var(--ink); }
.dk-read { font-size: 13px; font-variant-numeric: tabular-nums; }
.dk-meter { display: block; height: 10px; overflow: hidden; border: 1px solid var(--ink); border-radius: 5px; background: #e7e4da; }
.dk-meter i { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--ink) 0 75%, var(--orange) 75% 92%, var(--pink) 92%); background-size: 100vw 100%; }
.dk-master { background: var(--ink); color: var(--paper); }
.dk-master .dk-meter { background: #33342f; border-color: var(--paper); }
.dk-master .dk-meter i { background: var(--acid); }
.dk-master .tl-note { color: #c9c6ba; }
.dk-layers .dk-strip { grid-template-columns: 1fr auto; align-items: center; }
