/* Solfaboard — one stylesheet for every page. No inline styles anywhere (CSP: style-src 'self'). */
@font-face {
  font-family: "Noto Music";
  src: url("fonts/NotoMusic-subset.woff2?v=99434ac749") format("woff2");
  font-display: swap;
  unicode-range: U+266D-266F, U+1D100-1D1FF;
}
:root {
  --bar: #1d2030; --bar2: #2a2e42; --line: #33374a; --fg: #f4f1ea; --acc: #f0a830;
  --ink: #1d2030; --muted: #5b6072; --paper: #faf8f3; --link: #1c5fb0;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --music: "Noto Music", "Apple Symbols", "Segoe UI Symbol", serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.55 var(--sans); }
a { color: var(--link); }
img, svg { display: inline-block; vertical-align: middle; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--acc); outline-offset: 2px; }

/* ---------- site header ---------- */
.site { display: flex; align-items: center; gap: 16px; padding: 0 14px; height: 44px; background: var(--bar); color: var(--fg); }
.brand { display: flex; align-items: center; gap: 8px; color: var(--fg); text-decoration: none; font-weight: 700; letter-spacing: .01em; }
nav.main { display: flex; gap: 4px; margin-left: auto; overflow-x: auto; }
nav.main a { color: #c9cbd6; text-decoration: none; padding: 6px 10px; border-radius: 6px; font-size: 14px; white-space: nowrap; }
nav.main a:hover { background: var(--bar2); color: var(--fg); }
nav.main a[aria-current="page"] { color: var(--fg); background: var(--bar2); }

/* ---------- board page ---------- */
.app { height: 100vh; height: 100svh; min-height: 520px; display: flex; flex-direction: column; background: var(--bar); }
#bar { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; padding: 6px 8px; background: var(--bar); color: var(--fg); border-top: 1px solid var(--line); }
.grp { display: flex; gap: 3px; align-items: center; padding-right: 7px; margin-right: 3px; border-right: 1px solid var(--line); }
.grp:last-child { border-right: 0; }
#bar button, .menu button, .view button, #bar select, .view select {
  font: 14px/1 var(--sans); color: var(--fg); background: var(--bar2); border: 2px solid transparent; border-radius: 7px;
  min-width: 34px; height: 34px; padding: 0 7px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
#bar button:hover, .menu button:hover, .view button:hover { background: #363b54; }
#bar button[aria-pressed="true"] { border-color: var(--acc); background: #3a3420; }
#bar button svg { width: 20px; height: 20px; }
#bar .sym, .menu .sym { font-family: var(--music); font-size: 22px; }
#bar .wide { padding: 0 9px; }
#bar .wide svg { width: 22px; }
#bar .caret::after { content: "\25BE"; font-size: 11px; opacity: .8; }
#bar .sw { min-width: 26px; width: 26px; padding: 0; }
.c0 { background: #111111 !important; } .c1 { background: #e03131 !important; } .c2 { background: #1971c2 !important; }
.c3 { background: #2f9e44 !important; } .c4 { background: #f08c00 !important; } .c5 { background: #9c36b5 !important; }
#bar select { padding: 0 4px; }
#sound .on-only, #sound .off-only { display: none; }
#sound[aria-pressed="true"] .on-only, #sound[aria-pressed="false"] .off-only { display: inline; }
#play .stop, #play[aria-pressed="true"] .go { display: none; }
#play[aria-pressed="true"] .stop { display: inline; }
#board { position: relative; flex: 1 1 auto; min-height: 300px; overflow: hidden; background: #e7e5de; }
#cv { position: absolute; left: 0; top: 0; display: block; }
#scroller { position: absolute; inset: 0; overflow: auto; touch-action: none; cursor: crosshair; }
#sizer { width: 1px; height: 1px; }
#txt {
  position: absolute; z-index: 3; margin: 0; padding: 0; border: 0; outline: 2px dashed var(--acc); outline-offset: 3px;
  background: rgba(255, 255, 255, .92); font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; font-weight: 600;
  line-height: 1.2; resize: none; overflow: hidden; field-sizing: content; min-width: 4ch;
}
#txt.caps { text-transform: uppercase; }
#toast { pointer-events: none; position: absolute; left: 50%; top: 14px; transform: translateX(-50%); z-index: 4; background: var(--bar); color: var(--fg);
  padding: 8px 14px; border-radius: 8px; font-size: 14px; box-shadow: 0 4px 18px rgba(0, 0, 0, .25); max-width: calc(100% - 32px); }
.view { position: absolute; right: 22px; bottom: 22px; z-index: 2; display: flex; gap: 3px; padding: 4px; border-radius: 10px;
  background: rgba(29, 32, 48, .88); box-shadow: 0 2px 10px rgba(0, 0, 0, .2); }
.view button, .view select { height: 30px; min-width: 30px; font-size: 15px; }
.view #zreset { min-width: 54px; font-size: 13px; }
.menu { position: fixed; z-index: 20; background: var(--bar); color: var(--fg); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); display: flex; flex-direction: column; gap: 4px; max-width: calc(100vw - 16px); }
.menu > button { justify-content: flex-start; width: 100%; padding: 0 10px; height: 38px; }
.menu .mh { margin: 4px 2px 2px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: #aeb2c2; }
.menu .grid { display: grid; grid-template-columns: repeat(8, 38px); gap: 4px; }
.menu .grid button { min-width: 0; padding: 0; font-size: 13px; }
.menu .row { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.menu input { width: 52px; height: 34px; border-radius: 7px; border: 1px solid var(--line); background: #fff; color: var(--ink); font: 15px var(--sans); text-align: center; }
.menu .tsym { font-family: var(--music); font-size: 20px; }
@media (max-width: 760px) {
  #bar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
  .grp { flex: none; }
  .view { right: 14px; bottom: 14px; }
}

/* ---------- tooltip ---------- */
#tip { position: fixed; z-index: 50; max-width: 300px; padding: 8px 11px; border-radius: 8px; background: #fffdf7; color: var(--ink);
  border: 1px solid #d9d4c5; box-shadow: 0 6px 20px rgba(0, 0, 0, .18); font-size: 13.5px; line-height: 1.4; pointer-events: none; }
#tip strong { display: block; font-size: 14px; margin-bottom: 2px; }
@media (prefers-reduced-motion: no-preference) { #tip { animation: tipin .08s ease-out; } @keyframes tipin { from { opacity: 0; transform: translateY(-2px); } } }

/* ---------- landing / prose ---------- */
.landing, .prose { max-width: 760px; margin: 0 auto; padding: 36px 20px 24px; }
.landing h1, .prose h1 { font-size: clamp(26px, 4vw, 36px); line-height: 1.2; margin: 0 0 14px; }
.landing h2, .prose h2 { font-size: 20px; margin: 28px 0 8px; }
.landing .lead { font-size: 18px; color: #2c3040; }
.landing ul, .prose ul { padding-left: 22px; }
.landing li, .prose li { margin: 6px 0; }
.landing ol { padding-left: 22px; }
.cta { display: inline-block; margin-top: 6px; padding: 10px 16px; border-radius: 8px; background: var(--bar); color: var(--fg); text-decoration: none; font-weight: 600; }
.small { font-size: 14px; color: var(--muted); }
.ad-slot { max-width: 760px; margin: 8px auto 0; padding: 0 20px; min-height: 0; }
.ad-slot::before { content: "Advertisement"; display: block; font-size: 11px; color: #8a8f9e; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 4px; }
.ad-slot ins.adsbygoogle { display: block; }
.ad-slot ins.adsbygoogle[data-ad-status="unfilled"] { display: none !important; }

/* ---------- footer & feedback ---------- */
.foot { border-top: 1px solid #e3dfd3; margin-top: 32px; padding: 20px; color: var(--muted); font-size: 14px; }
.foot .in { max-width: 760px; margin: 0 auto; }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 14px 0 6px; }
.linkish { background: none; border: 0; padding: 0; color: var(--link); text-decoration: underline; font: inherit; cursor: pointer; }
.fb summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.fb form { margin-top: 10px; display: grid; gap: 8px; max-width: 520px; }
.fb fieldset { border: 0; padding: 0; margin: 0; display: flex; gap: 16px; }
.fb textarea { width: 100%; font: 15px/1.4 var(--sans); padding: 8px; border: 1px solid #cfc9b8; border-radius: 8px; background: #fff; color: var(--ink); }
.fb button[type="submit"] { justify-self: start; padding: 8px 16px; border-radius: 8px; border: 0; background: var(--bar); color: var(--fg); font: 600 14px var(--sans); cursor: pointer; }
.fb button[disabled] { opacity: .5; cursor: not-allowed; }
.fb #fb-status { margin: 0; min-height: 1.4em; color: var(--ink); }

/* ---------- live keyboard page ---------- */
.kbd { height: calc(100vh - 44px); height: calc(100svh - 44px); min-height: 420px; display: flex; flex-direction: column;
  background: radial-gradient(ellipse at 50% 120%, #1f1840 0%, #0e0f1a 60%); color: var(--fg); overflow: hidden; }
.kbd-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 24px; color: #9a9fb3; font-size: 15px; }
.kbd-top button { background: #232641; color: var(--fg); border: 0; border-radius: 999px; padding: 8px 16px; font: 14px var(--sans); cursor: pointer; }
.kbd #stage { position: relative; flex: 1; }
.kbd #fx { position: absolute; inset: 0; width: 100%; height: 100%; }
.kbd #names { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 36px; flex-wrap: wrap; padding: 0 24px; pointer-events: none; }
.nm { font-size: min(13vw, 140px); font-weight: 800; line-height: 1; letter-spacing: -.02em; animation: pop .18s ease-out; }
.nm small { display: block; font-size: 26%; font-weight: 600; opacity: .65; text-align: center; margin-top: 10px; letter-spacing: .05em; }
@keyframes pop { from { transform: scale(.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.kbd #keys { position: relative; height: 34vh; min-height: 200px; margin: 0 18px 18px; }
.w, .b { position: absolute; top: 0; border-radius: 0 0 10px 10px; transition: background .05s; }
.w { height: 100%; background: linear-gradient(#fbf9f4, #e9e4d8); border: 1px solid #1a1b26; }
.b { height: 62%; background: linear-gradient(#2b2d3a, #0b0c12); z-index: 2; border: 1px solid #000; border-radius: 0 0 7px 7px; }
.w.on, .b.on { background: var(--c); transform: translateY(2px); }
.w.held { background: color-mix(in srgb, var(--c) 45%, #fff); }
.b.held { background: color-mix(in srgb, var(--c) 45%, #000); }
.lbl { position: absolute; bottom: 12px; width: 100%; text-align: center; font-size: clamp(12px, 1.8vw, 24px); font-weight: 700; color: #8f8aa0; pointer-events: none; }
.lbl.c { color: #3a3550; }
@media (prefers-reduced-motion: reduce) { .nm { animation: none; } .w, .b { transition: none; } }

/* ---------- language menu (header) ---------- */
.langs { position: relative; }
.langs summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 5px; padding: 6px 9px; border-radius: 6px; color: #c9cbd6; font-size: 13px; font-weight: 600; }
.langs summary::-webkit-details-marker { display: none; }
.langs summary:hover, .langs[open] summary { background: var(--bar2); color: var(--fg); }
.langs-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; background: var(--bar); border: 1px solid var(--line); border-radius: 10px;
  padding: 6px; display: grid; min-width: 160px; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.langs-list a { color: #dfe1ea; text-decoration: none; padding: 7px 10px; border-radius: 6px; font-size: 14px; }
.langs-list a:hover { background: var(--bar2); }
.langs-list a[aria-current="true"] { color: var(--acc); }
@media (max-width: 560px) { nav.main a { padding: 6px 6px; font-size: 13px; } .brand span, .site .brand { font-size: 15px; } }

/* ---------- home page extras ---------- */
.landing .tagline { font-size: 19px; font-weight: 600; color: #2c3040; margin: 0 0 10px; }
.faq h3 { font-size: 17px; margin: 18px 0 4px; }
.faq p { margin: 0; }

/* ---------- live keyboard: playable keys ---------- */
.kbd #keys { touch-action: none; cursor: pointer; }

/* ---------- lessons ---------- */
.lessons .lx-hero { display: flex; gap: 28px; align-items: center; margin-bottom: 8px; }
.lessons .lx-photo { width: 220px; height: 220px; object-fit: cover; border-radius: 50%; flex: none; box-shadow: 0 6px 24px rgba(0, 0, 0, .15); }
.lessons .lx-hero h1 { margin-bottom: 8px; }
.lessons .offer { margin: 24px 0 8px; padding: 18px 20px; border-radius: 14px; background: #fff7e6; border: 1px solid #f3d9a4; }
.lessons .offer h2 { margin: 0 0 6px; }
.lessons .cta-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 8px; }
.lessons .cta.alt { background: #fff; color: var(--ink); border: 1px solid #cfc9b8; }
.lessons .price { margin: 0; font-size: 15px; color: #4a4f61; }
.ct { display: grid; gap: 6px; max-width: 520px; margin-top: 10px; }
.ct label { font-weight: 600; font-size: 15px; margin-top: 6px; }
.ct fieldset label { font-weight: 400; margin: 0; }
.ct input[type="text"], .ct input[type="email"], .ct select, .ct textarea {
  font: 16px/1.4 var(--sans); padding: 9px 10px; border: 1px solid #cfc9b8; border-radius: 8px; background: #fff; color: var(--ink); width: 100%; }
.ct fieldset { border: 0; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.ct legend { font-weight: 600; font-size: 15px; padding: 0; margin-bottom: 4px; width: 100%; }
.ct button[type="submit"] { justify-self: start; margin-top: 8px; padding: 10px 18px; border-radius: 8px; border: 0; background: var(--bar); color: var(--fg); font: 600 15px var(--sans); cursor: pointer; }
.ct button[disabled] { opacity: .5; cursor: not-allowed; }
#ct-status { min-height: 1.4em; margin: 4px 0 0; font-weight: 600; }
@media (max-width: 600px) { .lessons .lx-hero { flex-direction: column; align-items: flex-start; } .lessons .lx-photo { width: 160px; height: 160px; } }

/* ---------- song form dialog ---------- */
.sf { border: 1px solid var(--line); border-radius: 14px; padding: 0; background: var(--bar); color: var(--fg); max-width: min(720px, calc(100vw - 24px)); width: 100%; box-shadow: 0 20px 60px rgba(0, 0, 0, .45); }
.sf::backdrop { background: rgba(10, 12, 20, .45); }
.sf-in { padding: 18px 20px; display: grid; gap: 10px; }
.sf h2 { margin: 0; font-size: 19px; }
.sf-row { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.sf label { display: grid; gap: 4px; font-size: 13px; color: #c9cbd6; }
.sf select, .sf input { font: 15px var(--sans); height: 34px; border-radius: 7px; border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 0 8px; }
.sf #sf-per { width: 70px; }
.sf .mh { margin: 4px 0 0; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: #aeb2c2; }
.sf-chips { display: flex; flex-wrap: wrap; gap: 6px; max-height: 40vh; overflow: auto; }
.chip { display: flex; align-items: center; gap: 3px; background: var(--bar2); border-radius: 9px; padding: 4px; }
.chip input[type="text"] { width: 108px; height: 30px; }
.chip input[type="number"] { width: 56px; height: 30px; }
.chip button, .sf-add button, .sf-btns button { font: 14px var(--sans); color: var(--fg); background: #363b54; border: 0; border-radius: 6px; min-width: 28px; height: 30px; cursor: pointer; }
.chip button:disabled { opacity: .35; cursor: default; }
.sf-add { display: flex; gap: 6px; }
.sf-add input { width: 200px; }
.sf-add button { padding: 0 12px; height: 34px; }
.sf-note { margin: 0; font-size: 13px; color: #aeb2c2; }
.sf-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.sf-btns button { padding: 0 16px; height: 36px; }
.sf-btns .primary { background: var(--acc); color: #1d2030; font-weight: 700; }
.sf-btns .primary:disabled { opacity: .5; }

/* ---------- live keyboard: spelling, chords, key ---------- */
.kbd .nm .alt { font-size: 45%; font-weight: 700; opacity: .75; margin-left: .25em; vertical-align: middle; }
.kbd .chord { text-align: center; line-height: 1; animation: pop .18s ease-out; }
.kbd .chord .sym { font-size: min(15vw, 160px); font-weight: 800; letter-spacing: -.02em; }
.kbd .chord .tones { margin-top: 14px; font-size: clamp(18px, 3vw, 34px); font-weight: 700; opacity: .85; }
.kbd .chord .chalt { margin-top: 10px; font-size: clamp(14px, 1.8vw, 20px); font-weight: 600; color: #c9cbd6; }
#keyinfo { position: absolute; left: 0; right: 0; top: 6px; margin: 0; text-align: center; font-size: 15px; font-weight: 600; color: #9a9fb3; pointer-events: none; min-height: 1.2em; }
@media (prefers-reduced-motion: reduce) { .kbd .chord { animation: none; } }

/* ---------- clear dialog and actionable toast ---------- */
.sf.clr { max-width: min(460px, calc(100vw - 24px)); }
.sf.clr .sf-note { font-size: 15px; color: #dfe1ea; }
.sf.clr .sf-btns { flex-wrap: wrap; }
#toast button { pointer-events: auto; margin-left: 8px; font: 600 14px var(--sans); color: var(--bar); background: var(--acc); border: 0; border-radius: 6px; padding: 4px 10px; cursor: pointer; }
