/* Pianuméro — the look of the videos: a deep violet stage, the yellow band, paper stickers of colour. */
:root {
  --bg-top: #33284a;
  --bg-bottom: #14141b;
  --card: #ffffff;
  --ink: #141418;
  --ink-soft: #6a6a72;
  --yellow: #fcde14;
  --red: #ec4060;
  --white-key: #fbfbf7;
  --black-key: #16171b;
  --felt: #781c24;
  --radius: 18px;
  --shadow: 0 8px 0 rgba(0, 0, 0, .28);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #f4f2f8;
  background: radial-gradient(1200px 600px at 20% -10%, rgba(160, 205, 235, .12), transparent 60%),
              radial-gradient(900px 500px at 90% 10%, rgba(245, 170, 185, .10), transparent 60%),
              linear-gradient(180deg, var(--bg-top), var(--bg-bottom) 70%) fixed;
  line-height: 1.5;
}
a { color: var(--yellow); }
button, input { font: inherit; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }

/* Header and footer */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  max-width: 1120px; margin: 0 auto; padding: 18px 16px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 900; letter-spacing: .04em; font-size: 22px; color: var(--yellow); text-decoration: none;
}
.brand-keys { display: inline-flex; gap: 3px; }
.brand-keys i { width: 10px; height: 18px; border-radius: 3px; background: #a0cdeb; }
.brand-keys i:nth-child(2) { background: var(--yellow); }
.brand-keys i:nth-child(3) { background: #f5aab9; }
.top nav { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.top nav a {
  color: #e9e6f0; text-decoration: none; font-weight: 800; text-transform: uppercase; font-size: 14px;
  padding: 8px 12px; border-radius: 999px;
}
.top nav a:hover, .top nav a.on { background: rgba(255, 255, 255, .1); color: #fff; }
.foot { max-width: 1120px; margin: 40px auto 0; padding: 24px 16px 40px; color: #b9b4c6; border-top: 1px solid rgba(255, 255, 255, .08); }
.foot .small { font-size: 14px; }
main { max-width: 1120px; margin: 0 auto; padding: 0 16px; outline: none; }

/* Common pieces */
.band {
  display: inline-block; background: var(--yellow); color: var(--ink); font-weight: 900; text-transform: uppercase;
  border-radius: 16px; padding: .15em .6em; box-shadow: var(--shadow); letter-spacing: .01em;
}
.pill {
  display: inline-block; background: var(--ink); color: var(--yellow); font-weight: 900; text-transform: uppercase;
  font-size: 14px; letter-spacing: .06em; border-radius: 999px; padding: 6px 14px;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; cursor: pointer; text-decoration: none; text-transform: uppercase; font-weight: 900; letter-spacing: .02em;
  color: var(--ink); background: var(--yellow); border-radius: 14px; padding: 12px 20px; box-shadow: 0 5px 0 #b59d00;
  transition: transform .08s ease, box-shadow .08s ease;
}
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #b59d00; }
.btn.ghost { background: rgba(255, 255, 255, .1); color: #fff; box-shadow: 0 5px 0 rgba(0, 0, 0, .35); }
.btn.white { background: #fff; box-shadow: 0 5px 0 #b8b8c2; }
.btn[aria-pressed="true"] { background: #fff; box-shadow: 0 5px 0 #b8b8c2; }
.chip {
  display: inline-grid; place-items: center; min-width: 1.6em; height: 1.6em; padding: 0 .25em;
  border-radius: .35em; color: var(--ink); font-weight: 900;
}
.muted { color: #b9b4c6; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .4em; }
h2 { text-transform: uppercase; font-weight: 900; font-size: clamp(22px, 3.2vw, 30px); letter-spacing: .01em; }

/* Home */
.hero { display: grid; gap: 28px; grid-template-columns: 1.1fr .9fr; align-items: center; padding: 28px 0 44px; }
.hero h1 { font-size: clamp(34px, 6vw, 64px); font-weight: 900; text-transform: uppercase; }
.hero h1 .band { font-size: .9em; margin-top: .15em; }
.hero p.lead { font-size: clamp(17px, 2vw, 20px); color: #ddd8e8; max-width: 34em; }
.hero .actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 22px; }
.hero-card {
  background: rgba(0, 0, 0, .25); border-radius: 24px; padding: 18px; box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, .08);
}
.numbers-demo { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; font-size: 34px; margin: 6px 0 12px; }
.numbers-demo .chip { width: 1.4em; height: 1.4em; transition: transform .15s ease; }
.hero-card .words { text-align: center; font-weight: 800; text-transform: uppercase; margin-bottom: 14px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 8px 0 48px; }
.step { background: rgba(255, 255, 255, .06); border-radius: var(--radius); padding: 20px; border: 1px solid rgba(255, 255, 255, .07); }
.step b.n { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; color: var(--ink); font-weight: 900; font-size: 22px; margin-bottom: 10px; }
.step h3 { text-transform: uppercase; font-weight: 900; }
.step p { margin: 0; color: #cfcadb; }
.songs-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.search { background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); color: #fff; border-radius: 12px; padding: 10px 14px; min-width: 240px; }
.search::placeholder { color: #a9a3b8; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.card {
  display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: var(--ink);
  background: var(--card); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
  transition: transform .12s ease;
}
.card:hover { transform: translateY(-3px) rotate(-.3deg); }
.card .stickers { display: flex; gap: 5px; flex-wrap: wrap; }
.card .stickers .chip { font-size: 14px; }
.card h3 { font-size: 20px; font-weight: 900; text-transform: uppercase; margin: 0; }
.card .origin { color: var(--ink-soft); font-size: 14px; margin: -6px 0 0; }
.card .meta { margin-top: auto; display: flex; gap: 8px; flex-wrap: wrap; font-size: 13px; font-weight: 800; text-transform: uppercase; }
.card .meta span { background: #f0eef5; border-radius: 999px; padding: 3px 10px; }
.card .meta span.easy { background: #d8f0c8; }
.free { margin: 48px 0 8px; display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  background: rgba(0, 0, 0, .25); border-radius: 24px; padding: 24px; border: 1px solid rgba(255, 255, 255, .08); }
.free p { margin: 0; color: #cfcadb; }

/* The lesson */
.lesson-head { text-align: center; padding: 8px 0 14px; }
.lesson-head h1 { font-size: clamp(26px, 5vw, 46px); margin-bottom: 10px; }
.lesson-head .origin { color: #cfcadb; font-weight: 700; }
.stage {
  position: relative; background: rgba(0, 0, 0, .22); border-radius: 26px; padding: 18px 14px 0;
  border: 1px solid rgba(255, 255, 255, .08); overflow: hidden;
}
.now { display: flex; align-items: center; justify-content: center; gap: 14px; }
.numbers {
  display: flex; align-items: center; gap: .45em; background: #fff; color: var(--ink); border-radius: 18px;
  padding: 10px 22px; box-shadow: var(--shadow); font-size: clamp(34px, 7vw, 60px); font-weight: 900; min-height: 1.9em;
}
.numbers .first { display: grid; place-items: center; min-width: 1.15em; padding: 0 .12em; border-radius: .18em; line-height: 1; }
.numbers .first small { display: block; font-size: max(14px, .26em); font-weight: 900; text-transform: uppercase; margin-top: .1em; }
.numbers .next { color: #6a6a72; font-size: .78em; transition: transform .2s ease; }
.numbers.bump .first { animation: bump .25s ease-out; }
@keyframes bump { 0% { transform: scale(1.28); } 100% { transform: scale(1); } }
.stars { display: flex; flex-direction: column; gap: 4px; font-size: 28px; line-height: 1; }
.stars span { color: rgba(255, 255, 255, .35); transition: color .2s ease, transform .2s ease; }
.stars span.on { color: var(--yellow); transform: scale(1.15); text-shadow: 0 0 12px rgba(252, 222, 20, .7); }
.progress { height: 6px; background: rgba(255, 255, 255, .12); border-radius: 99px; margin: 14px auto 0; max-width: 520px; overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--yellow); border-radius: 99px; transition: width .2s linear; }
.words-now {
  margin: 14px auto 0; max-width: 760px; text-align: center; background: #fff; color: var(--ink);
  border-radius: 16px; padding: 10px 16px; box-shadow: var(--shadow); text-transform: uppercase; font-weight: 800;
  font-size: clamp(18px, 3.2vw, 28px); min-height: 2.9em;
}
.words-now .line { display: block; }
.words-now .coming { display: block; font-size: max(13px, .6em); color: #6a6a72; margin-top: 2px; }
.words-now .sung { color: var(--ink); }
.words-now .todo { color: #6a6a72; }
.words-now .cur { border-radius: .25em; padding: 0 .08em; color: var(--ink); }
.cheer {
  position: absolute; left: 50%; top: 10px; transform: translate(-50%, -140%); background: var(--yellow); color: var(--ink);
  font-weight: 900; text-transform: uppercase; border-radius: 999px; padding: 6px 16px; box-shadow: var(--shadow);
  transition: transform .35s cubic-bezier(.3, 1.6, .5, 1); white-space: nowrap; z-index: 3; pointer-events: none;
}
.cheer.show { transform: translate(-50%, 0); }

/* The keyboard */
.keyboard-wrap { margin-top: 4px; padding-top: 42px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; }
.keyboard {
  position: relative; display: flex; margin: 0 auto; height: clamp(170px, 30vw, 250px); user-select: none; -webkit-user-select: none;
  touch-action: none; border-top: 10px solid #18191d; box-shadow: 0 -3px 0 var(--felt) inset;
}
.key { position: relative; cursor: pointer; }
.key.white {
  flex: 0 0 var(--w); height: 100%; background: linear-gradient(180deg, #fff, #e6e6e2); border: 1px solid #9a9a9a; border-top: 0;
  border-radius: 0 0 8px 8px; box-shadow: inset 0 -10px 0 #cfcfca;
}
.key.black {
  position: absolute; top: 0; width: calc(var(--w) * .62); height: 60%; z-index: 2;
  background: linear-gradient(180deg, #3a3c44, #0c0c0f); border-radius: 0 0 6px 6px; box-shadow: 2px 3px 0 rgba(0, 0, 0, .45), inset 0 -8px 0 #2a2c33;
}
.key.down.white { background: linear-gradient(180deg, color-mix(in srgb, var(--c, #cfe3ff) 45%, white), var(--c, #cfe3ff)); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .25), inset 0 8px 10px rgba(0, 0, 0, .18); }
.key.down.black { background: linear-gradient(180deg, color-mix(in srgb, var(--c, #6b7aa0) 70%, black), color-mix(in srgb, var(--c, #6b7aa0) 40%, black)); }
.key.wrong { animation: wrong .35s ease; }
@keyframes wrong { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.key .sticker {
  position: absolute; left: 12%; right: 12%; bottom: 20%; aspect-ratio: 1 / 1; max-height: 34%; margin: 0 auto;
  display: grid; place-items: center; border-radius: 22%; color: var(--ink); font-weight: 900; font-size: clamp(14px, 2.4vw, 22px);
  box-shadow: 0 2px 0 rgba(0, 0, 0, .18);
}
.key.black .sticker { bottom: 14%; font-size: clamp(11px, 1.8vw, 16px); }
.key.down .sticker { outline: 3px solid var(--ink); }
.key .hint { position: absolute; left: 0; right: 0; bottom: 5%; text-align: center; font-size: 12px; font-weight: 800; color: #5d5d66; pointer-events: none; }
.key.black .hint { color: #9a9ca6; bottom: 3%; }
.key .name { position: absolute; left: 0; right: 0; bottom: 5%; text-align: center; font-size: 11px; font-weight: 800; color: #6a6a72; }
.key.target::after {
  content: ""; position: absolute; left: 50%; top: -34px; width: 0; height: 0; transform: translateX(-50%);
  border: 13px solid transparent; border-top: 16px solid var(--c, var(--yellow)); filter: drop-shadow(0 2px 0 var(--ink));
  animation: hop .5s ease-in-out infinite alternate; z-index: 4;
}
.key.black.target::after { top: -30px; }
@keyframes hop { from { transform: translate(-50%, -6px); } to { transform: translate(-50%, 2px); } }
.key .ring { position: absolute; left: 50%; bottom: 26%; width: 10px; height: 10px; border-radius: 50%; border: 3px solid var(--c, #fff);
  transform: translate(-50%, 50%) scale(1); opacity: .9; pointer-events: none; animation: ring .7s ease-out forwards; z-index: 3; }
@keyframes ring { to { transform: translate(-50%, 50%) scale(9); opacity: 0; } }

/* Controls */
.controls { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: center; padding: 18px 0 20px; }
.tempo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; text-transform: uppercase; font-size: 14px; color: #ddd8e8; }
.tempo input { accent-color: var(--yellow); width: 150px; height: 32px; }
.help { text-align: center; color: #cfcadb; font-size: 15px; margin: 0 0 6px; }
.help kbd { background: #fff; color: var(--ink); border-radius: 6px; padding: 1px 7px; font-weight: 900; box-shadow: 0 2px 0 #b8b8c2; font-family: inherit; }

/* Result */
.result { position: absolute; inset: 0; display: none; place-items: center; background: rgba(20, 20, 27, .72); z-index: 6; padding: 16px; }
.result.show { display: grid; }
.result .box { background: #fff; color: var(--ink); border-radius: 24px; padding: 22px 26px; text-align: center; box-shadow: var(--shadow); max-width: 420px; animation: pop .35s cubic-bezier(.3, 1.6, .5, 1); }
.result .big-stars { font-size: 46px; letter-spacing: .1em; }
.result .big-stars .off { color: #d7d5df; }
.result .big-stars .on { color: var(--yellow); text-shadow: 0 2px 0 var(--ink); }
.result h2 { font-size: 34px; margin: 4px 0; }
.result .actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* The number sheet */
.sheet { margin-top: 34px; }
.sheet-lines { display: grid; gap: 12px; }
.sheet-line { background: rgba(255, 255, 255, .06); border-radius: 14px; padding: 12px; display: flex; flex-wrap: wrap; gap: 6px 4px; }
.sheet-note { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 34px; }
.sheet-note .chip { font-size: 18px; width: 1.6em; }
.sheet-note .syl { font-size: 13px; font-weight: 800; text-transform: uppercase; color: #ddd8e8; }
.share-row { display: flex; gap: 12px; flex-wrap: wrap; margin: 22px 0 0; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(120px); background: #fff; color: var(--ink);
  font-weight: 900; border-radius: 999px; padding: 10px 18px; box-shadow: var(--shadow); transition: transform .3s ease; z-index: 50; }
.toast.show { transform: translateX(-50%) translateY(0); }

/* Free piano and about */
.piano-head { text-align: center; padding: 10px 0 16px; }
.piano-head h1 { font-size: clamp(28px, 5vw, 44px); text-transform: uppercase; font-weight: 900; }
.about { max-width: 760px; }
.about h1 { text-transform: uppercase; font-weight: 900; font-size: clamp(28px, 5vw, 44px); }
.about li { margin: 4px 0; }

@media (max-width: 820px) {
  .totals { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; padding-top: 8px; }
  .steps { grid-template-columns: 1fr; }
  .stars { font-size: 22px; }
}
@media (max-width: 480px) {
  .top { padding: 14px 16px; }
  .brand { font-size: 18px; }
  .top nav a { padding: 6px 8px; font-size: 12px; }
  .numbers { padding: 8px 14px; }
  .search { min-width: 0; width: 100%; }
}
/* The account */
.top nav a.account { background: var(--yellow); color: var(--ink); max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top nav a.account:hover, .top nav a.account.on { background: #fff; color: var(--ink); }
.auth { max-width: 460px; margin: 10px auto 0; }
.auth.wide { max-width: 760px; }
.auth h1 { text-transform: uppercase; font-weight: 900; font-size: clamp(28px, 5vw, 40px); }
.tabs { display: flex; gap: 6px; background: rgba(255, 255, 255, .08); padding: 5px; border-radius: 14px; margin: 18px 0; }
.tabs button { flex: 1; border: 0; border-radius: 10px; padding: 10px; font-weight: 900; text-transform: uppercase; cursor: pointer; background: transparent; color: #ddd8e8; }
.tabs button[aria-selected="true"] { background: #fff; color: var(--ink); }
.form { display: grid; gap: 14px; background: #fff; color: var(--ink); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.form label { display: grid; gap: 6px; font-weight: 800; font-size: 14px; text-transform: uppercase; }
.form input { border: 2px solid #d8d6e0; border-radius: 10px; padding: 11px 12px; font-size: 16px; text-transform: none; font-weight: 600; color: var(--ink); background: #fff; }
.form input:focus { border-color: var(--ink); outline: none; }
.form .small { margin: -6px 0 0; font-size: 13px; }
.form .error { margin: 0; color: #c21d3f; font-weight: 800; min-height: 0; }
.form .error:empty { display: none; }
.form.inline { background: transparent; box-shadow: none; padding: 0; color: inherit; }
.form.inline label { color: #ddd8e8; }
.btn.red { background: #c21d3f; color: #fff; box-shadow: 0 5px 0 #7d1228; }
.btn:disabled { opacity: .6; cursor: wait; }
.totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 18px 0 20px; }
.totals div { background: #fff; color: var(--ink); border-radius: var(--radius); padding: 14px; text-align: center; box-shadow: var(--shadow); }
.totals b { display: block; font-size: 34px; font-weight: 900; line-height: 1.1; }
.totals span { font-size: 13px; font-weight: 800; text-transform: uppercase; color: var(--ink-soft); }
.mine { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 8px; }
.mine li { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; background: rgba(255, 255, 255, .06); border-radius: 12px; padding: 10px 14px; }
.mine a { font-weight: 900; text-transform: uppercase; color: #fff; text-decoration: none; }
.best { color: var(--yellow); letter-spacing: .08em; font-weight: 900; }
.card .meta span.best { background: var(--ink); color: var(--yellow); }
.danger { margin-top: 26px; border-top: 1px solid rgba(255, 255, 255, .1); padding-top: 16px; }
.danger summary { cursor: pointer; color: #ff9fb2; font-weight: 800; }
.result .saved { font-weight: 800; color: var(--ink-soft); margin: 0; }
.result .saved a { color: #1f5fbf; }

.tip { display: none; text-align: center; font-weight: 900; text-transform: uppercase; color: var(--yellow); margin: 0 0 8px; }
/* A phone or a tablet: no computer keyboard, so no letters on the keys; a tip for the fingers instead. */
@media (hover: none) and (pointer: coarse) {
  .key .hint, .help { display: none; }
  .tip { display: block; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* The page's words for everyone (and for search engines): under the lesson, the home page, the piano. */
.more { max-width: 820px; margin: 44px auto 0; padding: 0 16px; color: #ddd8e8; }
.more h2 { margin-top: 1.4em; }
.more h3 { text-transform: uppercase; font-weight: 900; margin-top: 1.6em; color: #fff; }
.more p, .more li { font-size: 17px; }
.crumbs { font-size: 14px; font-weight: 800; text-transform: uppercase; color: #b9b4c6; }
.crumbs a { color: #b9b4c6; }
.steps-list li { margin: 6px 0; }
table.keys { border-collapse: collapse; width: 100%; background: #fff; color: var(--ink); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
table.keys th, table.keys td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #ecebf1; }
table.keys th { font-size: 13px; text-transform: uppercase; color: var(--ink-soft); }
.letters p { background: rgba(255, 255, 255, .06); border-radius: 12px; padding: 10px 14px; margin: 8px 0; }
.letters b { font-size: 20px; letter-spacing: .12em; color: #fff; }
.faq details { background: rgba(255, 255, 255, .06); border-radius: 12px; padding: 12px 16px; margin: 8px 0; }
.faq summary { cursor: pointer; font-weight: 800; color: #fff; }
.faq details p { margin: 10px 0 2px; }
.more .grid { margin-top: 12px; }
.stage.static { padding-bottom: 16px; }
.stage.static .words-now { margin-bottom: 8px; }
.notes-line { max-width: 760px; margin: 12px auto 0; font-size: 17px; color: #ddd8e8; letter-spacing: .02em; }
.notes-line b { color: #fff; }
.sheet-note .letter { font-size: 13px; font-weight: 900; color: #fff; }
/* Read by screen readers, not shown. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* The lesson's room is kept before the script draws it: nothing under it moves (layout shift). */
/* Song pages only; the free piano's stage is much shorter. Measured: 668 px on a computer, 639 px on a phone. */
.stage.static.song-stage { min-height: 668px; }
.stage.static.piano-stage { min-height: 254px; }
@media (max-width: 480px) { .stage.static.song-stage { min-height: 640px; } }

/* Room for a finger: every link and control at least 44 px high (WCAG 2.5.5). */
.top nav a { display: inline-flex; align-items: center; min-height: 44px; }
.faq summary, .letters-all summary, .danger summary { padding: 11px 0; }
.foot a, .crumbs a { display: inline-block; padding: 12px 2px; }
.letters-all summary { cursor: pointer; font-weight: 800; color: var(--yellow); }
.sheet .notes-line { margin: 0 0 18px; }
@media (max-width: 480px) {
  .top { padding: 8px 12px; }
  .top nav a { font-size: 13px; }
  .lesson-head { padding: 0 0 8px; }
  .lesson-head .pill { font-size: 13px; }
  .card .meta { font-size: 14px; }
  table.keys th { font-size: 14px; }
}
.brand { min-height: 44px; }
